ENCRYPT() - Encrypt Specified String
Syntax in BBj 9.00 and higher
ENCRYPT(string{,password}(,MODE=string){,ERR=lineref})
Syntax prior to BBj 9.00
Before BBj 9.00
ENCRYPT(string,MODE=string{,ERR=lineref})
Description
In PRO/5 5.00 and BBj 4.00 and higher, the ENCRYPT() encrypts the specified string and returns an encrypted string. Note that the encrypted string may be longer than the specified string.
Mode |
Value |
Description |
---|---|---|
CRYPTPASS= |
String |
The encryption key. BASIS recommends a password of at least 20 characters when using AES-128 and at least 40 characters when using AES-256. |
CRYPTALG= |
AES-128 AES-256 |
Uses AES-128 bit encryption, which is also the default. In BBj 6.0 and higher, and PRO/5 6.0 and higher, uses AES-256 bit encryption. |
CHARSET= |
String |
In BBj 16.00 and higher, specifies the character set encoding of the password string. |
To utilize AES-256 in BBj, the Java Cryptography Extension (JCE) module
must be installed. These files are available for download at Oracle's
Java
SE Downloads page under "Additional Resources" near the
bottom of the page.
Parameter |
Description |
---|---|
string |
The text that the ENCRYPT function will cipher. |
password |
The encryption key. BASIS recommends a password of at least 20 characters when using AES-128 and at least 40 characters when using AES-256. |
If both the password parameter and the CRYPTPASS= mode are specified, the password value takes precedence.
BBj 16.00 and Higher
Example 1
|
BBj 9.00 and Higher
Example 2
|
Prior to BBj 9.00
Before BBj 9.00
Example 3
|
Example 4
|
Example 5
|