Is mysql encrypted or php application-layer encryption? is mysql encrypted or php application-layer encryption for user sensitive information such as passwords or ID cards?
Reply to discussion (solution)
I don't understand what you mean.
In fact, I think the effect of encryption through MySQL and php is to encrypt and store plain text information, which is the same for individual users.
I don't understand what you mean.
Well, one is to encrypt data with aes or other algorithms in php, and the other is to encrypt data with the built-in aes function in mysql when saving data to mysql.
In fact, I think the effect of encryption through MySQL and php is to encrypt and store plain text information, which is the same for individual users.
Is there a difference?
If you only use MySQL (will not be promoted in the future), you can use AES_ENCRYPT (str, key_str), AES_DECRYPT (crypt_str, key_str), ENCODE (str, pass_str), DECODE (str, pass_str)
Encryption, but the encryption result is binary data, should be saved using blob type field
Otherwise, you should use php for encryption
If you only use MySQL (will not be promoted in the future), you can use AES_ENCRYPT (str, key_str), AES_DECRYPT (crypt_str, key_str), ENCODE (str, pass_str), DECODE (str, pass_str)
Encryption, but the encryption result is binary data, should be saved using blob type field
Otherwise, you should use php for encryption
Thank you for your reply.
If php and mysql are used together, you are advised to use php for encryption.
In fact, I also tend to encrypt data in php. it seems that I have never seen anyone encrypt data in mysql during php.
But I want to know why?
Forward compatibility
Forward compatibility
It's too short.
In fact, I think the effect of encryption through MySQL and php is to encrypt and store plain text information, which is the same for individual users.
Is there a difference?
If you use MySQL to encrypt your database, it may be difficult for you to replace the database later. if you use php for general purposes, it will be better.
Flexible encryption using php
I personally think: the database should do the data access work, and the encryption should be handed over to PHP.