OPENSSL_DECRYPT

Decrypts encrypted data using OpenSSL.

The output is your plaintext. Arguments:

encrypted: The encrypted ciphertext.

algorithm: The algorithm to use, one of ["aes-128-cbc", "aes-256-cbc", "aes-256-gcm", "aes-256-ecb", "aes-128-ecb"].

key: The key to decrypt with.

iv: The initialization vector used during encryption. Value must be set to "" or nil when algorithm does not support an IV (such as AES ECB).

aad: The unencrypted data to be authenticated. Only supported by AEAD algorithms.

auth_tag: The authentication tag. Only supported by AEAD algorithms.

Syntax 

OPENSSL_DECRYPT(ciphertext, algorithm, key, iv, [aad], [auth_tag])

Usage examples 

Example 1

Formula

OPENSSL_DECRYPT(input.ciphertext, "aes-256-gcm", CREDENTIAL.secret_key, input.iv)
Was this helpful?