Crypto Functions

2 functions for AES encryption and decryption. The source column is always the implicit first input.

Requires Spark 3.3 or later. Keys must be 16, 24, or 32 bytes for AES-128/192/256.
FunctionSyntaxParametersNotes
aes_encryptaes_encrypt(column, key, mode, padding)key — required, 16/24/32-byte string. mode default GCM (also CBC, ECB). padding optional.
aes_decryptaes_decrypt(column, key, mode)key — required, must match the key used for encryption. mode default GCM.