$Encrypt

From m204wiki
Revision as of 13:18, 20 April 2013 by Alex (talk | contribs) (Automatically generated page update)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.