Syntax
AES_ENCRYPT(text, key, [iv], [mode: "aead"], [expires_in])
Usage examples
Example 1
Formula | AES_ENCRYPT("hello world", CREDENTIAL.secret_key, mode: "aead", expires_in: 60) |
AES_ENCRYPT
Encrypts text using AES
The output is encoded with character set "[A-Za-z0-9+/=.]" (base64 + '.'). An initialization vector can optionally be passed as a third argument. The mode should be set to "aead" for additional security. When the mode is "aead" you can also set expires_in, which defines the number of seconds before the ciphertext will be rejected by AES_DECRYPT. Note, the secret key must be 32 characters long.