AES_ENCRYPT(str,key_str): encryption and decryption of data using the official AES (Advanced Encryption Standard) algorithm. : AES_ENCRYPT « Encryption Compression Functions « MySQL Tutorial






Encoding with a 128-bit key length is used.

AES_ENCRYPT() encrypts a string and returns a binary string.

You can use the AES functions to store data in an encrypted form by modifying your queries:

INSERT INTO t VALUES (1,AES_ENCRYPT('text','password'));
mysql>
mysql>
mysql> select AES_ENCRYPT("text","password") ;
+--------------------------------+
| AES_ENCRYPT("text","password") |
+--------------------------------+
| J/TfD               |
+--------------------------------+
1 row in set (0.00 sec)








19.3.AES_ENCRYPT
19.3.1.AES_ENCRYPT(str,key_str): encryption and decryption of data using the official AES (Advanced Encryption Standard) algorithm.
19.3.2.Using AES_ENCRYPT to ENCRYPT the first name