Syntax
Parameters
-
str(Required): the string to encrypt. It must be of the VARCHAR type. -
key_str(Required): the key used to encryptstr. It must be of the VARCHAR type. -
init_vector(Optional): Initialization Vector (IV): A crucial security parameter in AES encryption that ensures identical plaintexts yield distinct ciphertexts. It is only utilized in CBC, CFB, OFB, CTR, and GCM modes. It must be of the VARCHAR type. -
encryption_mode(Optional): The encryption algorithm. It must be of the VARCHAR type. Default value:AES_128_ECB. Supported algorithms: -
aad_str(Optional): Denotes Additional Authenticated Data (AAD). This is a parameter unique to authenticated encryption modes (e.g., GCM). It allows for including data that must be authenticated for integrity (preventing tampering) but does not require confidentiality (it remains unencrypted). It must be of the VARCHAR type.
Return value
Returns a value of the VARCHAR type. If the input is NULL, NULL is returned.Examples
Use this function to AES encryptstarrocks and convert the encrypted string into a Base64-encoded string.
Text