MySQL | AES_DECRYPT ( ) Function Last Updated : 14 Sep, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report The MySQL AES_DECRYPT function returns the original string after decrypting an encrypted string. It uses AES(Advanced Encryption Standard) algorithm to perform the decryption. The AES_DECRYPT function returns the decrypted string or NULL if it detects invalid data. The value returned by the AES_DECRYPT function is the original plaintext string encrypted using AES_ENCRYPT function. The AES_DECRYPT function accepts two parameters which are the encrypted string and a string used to decrypt the encrypted string. Syntax: AES_DECRYPT(encrypted_string, key_string) Parameters Used: encrypted_string - It is used to specify the encrypted string.key_string - It is used to specify the String which is used to decrypt encrypted_string. Return Value: The AES_DECRYPT function in MySQL returns the original plaintext string encrypted using AES_ENCRYPT function. Supported Versions of MySQL: MySQL 5.7MySQL 5.6MySQL 5.5MySQL 5.1MySQL 5.0MySQL 4.1 Example-1: Implementing AES_DECRYPT function on a string. SELECT AES_DECRYPT(AES_ENCRYPT('ABC', 'key_string'), 'key_string'); Output: ABC Example-2: Implementing AES_DECRYPT function on a string with a combination of characters and integer values. SELECT AES_DECRYPT(AES_ENCRYPT('ABC123', 'key_string'), 'key_string'); Output: ABC123 Example-3: Implementing AES_DECRYPT function on a bigger string. SELECT AES_DECRYPT(AES_ENCRYPT('geeksforgeeks', 'key_string'), 'key_string'); Output: geeksforgeeks Example-4: Implementing AES_DECRYPT function on a NULL string. SELECT AES_DECRYPT(AES_ENCRYPT(NULL, 'key_string'), 'key_string'); Output: NULL Comment More infoAdvertise with us Next Article MySQL | CONVERT( ) Function S Shubrodeep Banerjee Follow Improve Article Tags : SQL mysql SQLmysql Similar Reads MySQL | AES_ENCRYPT ( ) Function The MySQL AES_ENCRYPT function is used for encrypting a string using Advanced Encryption Standard (AES) algorithm. The MySQL AES_ENCRYPT function encodes the data with 128 bits key length but it can be extended up to 256 bits key length. It encrypts a string and returns a binary string. The value re 1 min read MySQL | DES_ENCRYPT ( ) Function In todayâs world, keeping data safe is important for any database. MySQL, one of the most popular database systems, offers various tools to secure your information. Among these is the DES_ENCRYPT() function, which uses the Data Encryption Standard (DES) algorithm to encrypt your data. This function 3 min read SQL | ENCRYPT Function The SQL Encrypt function is used to encrypt a string using UNIX crypt(). The function is based on Unix crypt() system call, hence it returns NULL on Windows systems. The Encrypt function accepts two parameters which are the string and the salt to be encrypted. The Encrypt function returns a binary s 2 min read MySQL | BINARY Function The MySQL BINARY function is used for converting a value to a binary string. The BINARY function can also be implemented using CAST function as CAST(value AS BINARY). The BINARY function accepts one parameter which is the value to be converted and returns a binary string. Syntax: BINARY value Parame 1 min read MySQL | CONVERT( ) Function The MySQL CONVERT() function is used for converting a value from one datatype to a different datatype. The MySQL CONVERT() function is also used for converting a value from one character set to another character set. It accepts two parameters which are the input value and the type to be converted in 2 min read ASCII() Function in MySQL In this article, we are going to cover the ASCII function with examples and you will see the ASCII MYSQL query. And will also cover the ASCII code for the given character. Let's discuss one by one. ASCII function in MySQL is used to find the ASCII code of the leftmost character of a character expres 1 min read Like