ENCRYPT
8.5C
The ENCRYPT instruction encodes a variable using a default or a user specified key. The instruction uses the following format:
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
source
Required. A previously defined Character String Variable or character string array that contains the input string that is encrypted.
sep
Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.
key
Optional. A character variable or literal that contains a user specified key string.
Flags Affected: EQUAL, OVER
Note the following:
Only the Logical String of the {source} variable is encrypted.
The encryption can be done using a default PL/B language key or a user specified key.
A user key can be specified in a DIM variable or literal and must be no more than thirty-two (32) hexadecimal digits.
If the {key} parameter is not specified, a default PL/B language key is used.
The EQUAL flag is set if the {source} data is successfully encrypted.
The OVER flag is set if an invalid encryption key is specified. This can occur if a key character other than 0-9 or A-F is used. In addition, a key that evaluates to a value of zero is invalid.
A user cannot APPEND two encrypted strings together and expect the concatenated string to decrypt properly.
Ennhanced ARRAY processing is supported. If an array is specified (without an index), the ENCRYPT instruction is performed on each element within the array.
See Also: Example Code, DECRPYPT, Character String Instructions
![]() |