On Thu, Feb 13, 2003 at 03:01:35PM -0000, Neil Fryer wrote:

> I found this script on the net, and I am still learning, Perl, but I was
> wondering, just to play around with, if this script encrypts, how would I
> decrypt?
> 
> http://www.ca-osi.com/print.php?sid=127

It doesn't encrypt, and so you can't decrypt.  The crypt() function is one-
way, and is intended to let you store sensitive information like passwords
in a non-readable form.  Then, when someone provides a password for their
login, you encrypt (hash, more accurately) what they provided and compare
it with the hashed version you have stored.  If they match, then it is
assumed that the password provided matches and you allow login.

Use of crypt() for this is deprecated, nowadays you should be using MD5 or -
preferably - SHA1 for your password-hashing needs.

-- 
David Cantrell    |    Degenerate    |    http://www.cantrell.org.uk/david

 Pressure was growing last night for the global "war on terror" to be
 broadened to take in a wide range of other 'rogue emotions' including
 horror, shock and a general feeling of bewilderment about the state of
 the world.    -- The Brains Trust

Reply via email to