AES_DECRYPT()

Overview

Decrypts data using the AES algorithm with the given key.

USAGE

AES_DECRYPT(encrypted_string, key_string)

Argument Name

Description

encrypted_string

The encrypted string to decrypt

key_string

The decryption key to use

DETAILS

AES_DECRYPT() is an encryption function that decrypts a string using Advanced Encryption Standard (AES).

The same key string that was used during encryption needs to be used to successfully decrypt the encrypted string.

A NULL is returned if any of the arguments is NULL.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SET @key_str = SHA2('passphrase', 512);
SET @enc_str = 'B8656AA940B6D6ABAD5DA4891E746ED9';

SELECT AES_DECRYPT(UNHEX(@enc_str), @key_str) AS result;
+--------+
| result |
+--------+
| hello  |
+--------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES