Table of Contents

Search

  1. Preface
  2. Function reference
  3. Constants
  4. Operators
  5. Dates
  6. Functions
  7. System variables
  8. Datatype reference

Function Reference

Function Reference

AES_GCM_DECRYPT

AES_GCM_DECRYPT

Returns plaintext as a string.
Data Integration
uses the Advanced Encryption Standard (AES) algorithm with the Galois/Counter Mode (GCM) of operation. The AES algorithm is a FIPS-approved cryptographic algorithm that uses 128, 192, or 256-bit keys.
The
Validate
button doesn't validate this function. Review the syntax and argument rules to ensure that the arguments are valid.

Syntax

AES_GCM_DECRYPT (
value, init_vector, key [, keysize]
)
Argument
Required/
Optional
Description
value
Required
Binary data type. The ciphertext value to be decrypted into plaintext.
init_vector
Required
String data type. Use the same initialization vector (IV) to decrypt a value that you used to encrypt the ciphertext. The IV must be 96-bit and randomly generated.
key
Required
String data type of size 128, 192, or 256 bits. Use the same key to decrypt a value that you used to encrypt it.
keysize
The size of the key argument, in bits, determines whether the keysize argument is optional or required.
  • If the key argument size is <= 128 bits, then the keysize is optional.
  • If the key argument size is > 128 bits and <= 192 bits, then the keysize is 192 bits, and required.
  • If the key argument size is >192 and <=256 bits, then the keysize is 256 bits, and required.
Integer data type. Size of the key provided.
Possible values:128, 192, 256 bits. Default value is 128 bits.

Return Value

Decrypted string plaintext.
NULL if the input value is a null value.

Example

The following examples return decrypted Social Security numbers. The
init_vector
and
key
are the same values that were used to encrypt the Social Security number.
In this example, the
init_vector
is 12 characters, or 96 bits; the
key
is 16 characters, or 128 bits; the
keysize
is optional because the key is the default value of 128 bits:
AES_GCM_DECRYPT(SSN_ENCRYPT, '012345678901', '1234567890123456', 128)
In this example, the
init_vector
is 12 characters, or 96 bits; the
key
is 17 characters, or 136 bits; the
keysize
is required because the key is > 128 bits. Because the size of the key is less than 192 bits, the key is padded with null characters:
AES_GCM_DECRYPT(SSN_ENCRYPT, '123456789012', '12345678901234567', 192)

0 COMMENTS

We’d like to hear from you!