AES_ENCRYPT(encrypted_string,key)

Description: Encrypts a given string that has been encrypted using password using AES (Advanced Encryption Standard).

The most cryptographically secure encryption/decryption algorithm available in MySQL, it uses a 128-bit key length.

Example:

  • AES_ENCRYPT('message', 'the key') returns a binary string.

See also: AES_DECRYPT(), ENCODE(), ENCRYPT()

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.