Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Tom Rettigs Library - password(<expc>) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 PASSWORD(<expC>)
 Stores a password so that it cannot be read.
 Returns <expN> in the range from eight to ten digits.

 <expC> may contain spaces and non-alpha characters.
 Distinguishes between uppercase and lowercase.

 Returns zero if <expC> is less than 3 characters.

 Useful in applications that require one or more levels
 of password protection.

 <expN> cannot be decoded to reveal the <expC> that created it.

 * User enters password
 pass_word = SPACE(20)
 SET COLOR TO w, x    && invisible
 @...SAY "Enter your password" GET pass_word
 READ
 SET COLOR TO w, i    && normal
 pass_word = PASSWORD( pass_word )

 * Store a user's first time entry in a
 * file with one field: pw_code, N, 10, 0
 USE Passfile
 APPEND BLANK
 REPLACE pw_code WITH pass_word
 USE  && close files when no longer needed

 * Validate a user's subsequent password entry
 USE Passfile
 LOCATE FOR pw_code = pass_word
 is_found = FOUND()
 USE  && close files when no longer needed
 IF .NOT. is_found
    ? "Error -- invalid password"
    RETURN
 ELSE
    DO <system entry procedure>
 ENDIF


             Placed in the Public Domain by Tom Rettig Assoc.

See Also: DECRYPT() ENCRYPT()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson