Syntax
DES_DECRYPT(crypt_str[,key_str])
Purpose
This function is used to decrypt a string that was encrypted by the DES_ENCRYPT() function. If an error occurs, the function returns NULL. This feature is only available when OceanBase Database is configured to support SSL.
The key_str parameter is used to pass the key for decrypting the message. If the key_str parameter is not specified, the DES_DECRYPT() function checks the first byte of the encrypted string to determine the DES key number used to encrypt the original string, then reads the key from the DES key file to decrypt the string. Therefore, the user must have the SUPER privilege.
If the crypt_str parameter is not an encrypted string, it is returned directly.
Examples
obclient> SELECT DES_DECRYPT(DES_ENCRYPT('secret','cry'), 'cry');
+-------------------------------------------------+
| DES_DECRYPT(DES_ENCRYPT('secret','cry'), 'cry') |
+-------------------------------------------------+
| secret |
+-------------------------------------------------+
1 row in set
