
mhx
Enthusiast
/ Moderator
Aug 27, 2001, 12:12 PM
Post #2 of 4
(392 views)
|
|
Re: I need to encrypt passwords
[In reply to]
|
Can't Post
|
|
Try not to store passwords. 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. -- Marcus
s$$ab21b8d15c3d97bd6317286d$;$"=547269736;split'i',join$,,map{chr(($*+= ($">>=1)&1?-hex:hex)+0140)}/./g;$"=chr$";s;.;\u$&;for@_[0,2];print"@_,"
|