AES_ENCRYPT
Encrypt data using AES. This function encrypts a string using the Advanced Encryption Standard (AES) algorithm and returns a binary string.
Syntax
AES_ENCRYPT(str, key, [, iv [, mode]])AES_ENCRYPT(str,key_str)Description
16 x (trunc(string_length / 16) + 1)Examples
SELECT HEX(AES_ENCRYPT('foo', 'bar', '0123456789abcdef', 'aes-256-cbc')) AS x;
+----------------------------------+
| x |
+----------------------------------+
| 42A3EB91E6DFC40A900D278F99E0726E |
+----------------------------------+INSERT INTO t VALUES (AES_ENCRYPT('text',SHA2('password',512)));See Also
Last updated
Was this helpful?

