This library contains a collection of cryptography-related functions for Apache Drill. It generally mirrors the crypto functions in MySQL. The package includes:
aes_encrypt()
/aes_decrypt()
: implement encryption and decryption of data using the official AES (Advanced Encryption Standard) algorithm, previously known as “Rijndael.”AES_ENCRYPT()
encrypts the stringstr
using the key stringkey_str
and returns a binary string containing the encrypted output.AES_DECRYPT()
decrypts the encrypted stringcrypt_str
using the key stringkey_str
and returns the original cleartext string. If either function argument is NULL, the function returns NULL.
> SELECT aes_encrypt( 'encrypted_text', 'my_secret_key' ) AS aes FROM (VALUES(1));