Aug 27, 2001, 12:12 PM
Post #2 of 4
Try not to store passwords.
Re: I need to encrypt passwords
[In reply to]
Perl has a crypt function that converts a string, e.g. a password, to an encrypted string. There's no known decrypt function, so you won't be able to reconstruct the password from that string. Storing the encrypted string is completely safe, even if everyone could see it. To check a password, just crypt it again and compare the result with the stored encrypted string. If they match, the password is ok.
See perldoc -f crypt for details.
Hope this helps.