In Snowflake how to Encrypts a BINARY value using a BINARY key ?


ENCRYPT_RAW is used to Encrypts a BINARY value using a BINARY key.


ENCRYPT_RAW( <value_to_encrypt> , <key> , <iv> , [ [ <additional_authenticated_data> , ] <encryption_method> ])

value_to_encrypt : The binary value to encrypt.
key : The key to use to encrypt or decrypt the data. The key should be a BINARY value. The key can be any value as long as the length should be correct. For AES128, the key must be 128 bits (16 bytes), for AES256, the key must be 256 bits (32 bytes). The key used to encrypt the value must be used to decrypt the value.
iv : This parameter contains the Initialization Vector (IV) to use to encrypt and decrypt this piece of data. The IV must be a BINARY value of a specific length:
additional_authenticated_data : Additional authenticated data (AAD) is additional data whose confidentiality and authenticity is assured during the decryption process.
encryption_method : This string specifies the method to use for encrypting/decrypting the data.

Snowflake reference page

Author: user

Leave a Reply