SQL — DECRYPT Function

Syntax

DECRYPT (string1,string2)

Description

In BBj 4.00 and higher, the DECRYPT() function, and counterpart ENCRYPT() function, supports encrypted fields. In the syntax, string1 is the string to decrypt, and string2 is the mode line for encryption as described in the DECRYPT verb documentation. The return value is the decrypted string as produced by the DECRYPT verb.

Mode

value Description
CRYPTPASS=

String

The decryption key.

CRYPTALG=

AES-128

AES -256

Uses AES-128 bit encryption, which is also the default.

Uses AES-256 bit encryption, in BBj 6.0 and higher and PRO/5 6.0 and higher.

CHARSET=

String

In BBJ 16.00 and higher, specifies the character set encoding of the password string.

Example

Select A,DECRYPT(B,'CRYPTPASS=abcde') from SecureTable