DIGEST() |
|
|
The DIGEST() function returns the message digest string for a supplied string or file.
Format
DIGEST(string, is.file, mode)
where
If successful, the DIGEST() returns the result of applying the specified digest algorithm to the supplied data and the STATUS() function will return zero. All error conditions return a null string and the STATUS() function can be used to determine the cause.
Example
DISPLAY 'Password: ' : INPUT PASSWORD IF DIGEST(PASSWORD, @FALSE, 'SHA256') # ENCRYPTED.PASSWORD THEN DISPLAY 'Access denied' RETURN END
The above example compares a password entered by the user with a stored message digest value for the correct password. Because message digests are not reversible, there is no way to determine the actual password from the stored value.
See also: |