$Encrypt

From m204wiki
(Redirected from $ENCRYPT)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The $ENCRYPT function performs a one-way encryption of a zero to eight-character string. Longer strings are truncated at eight characters. The result of this function is an eight-byte encrypted representation of the input string.

Syntax

The format of $ENCRYPT is:

$ENCRYPT(string,parameter)

$ENCRYPT accepts the second argument (parameter) so that the same source string can be encrypted to different strings in different systems.

Note: You should use a parameter value of less than 1000 for best performance; numbers significantly larger than 1000 can cause serious performance degradation.

Example

$ENCRYPT ($READINV ('ENTER PASSWORD'),%PARAM)

returns one encrypted value if %PARAM equals 28 and another value if %PARAM equals 18. If no parameter is supplied, a default of 15 is used. A null string is returned and an error message is issued if a parameter of zero or a negative value is specified.