AES_ENCRYPT()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Enterprise Server
Topics on this page:
Overview
Encrypts data using the AES algorithm with the given key.
EXAMPLES
SELECT SUBSTRING(HEX(AES_ENCRYPT('This is a test string to encrypt',
'This is the AES key to use')), 1, 32) AS HexSubstring;
+----------------------------------+
| HexSubstring |
+----------------------------------+
| C3448D2B75B4C4F32221F78B7098FCBE |
+----------------------------------+
SET @key_str = SHA2('passphrase',512);
SELECT HEX(AES_ENCRYPT('text', @key_str)) AS HexString;
+----------------------------------+
| HexString |
+----------------------------------+
| 09F25245882D04F8AE24FDD5D887B157 |
+----------------------------------+
CHANGE HISTORY
EXTERNAL REFERENCES
Additional information on this topic may be found in the MariaDB Public Knowledge Base.