note 15776 deleted from function.crypt by jimw

From: Date: Sat, 03 Nov 2001 18:20:52 +0000
Subject: note 15776 deleted from function.crypt by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-20378@lists.php.net to get a copy of this message
OK. Perhaps this is trivial for long time UNIX gurus, but it took me two years or so to find out how to validate a Solaris shadowed password. It's quite simple: get the first and second characters of the password you want to validate, then feed this as the salt, and what the user is entering as the string, as follows: $salt = "do your own stuff to read /etc/shadow and get the first and second characters of the password"; $pass_cryp = crypt($user_entered_pass, $salt); if ($pass_cryp == $user_entered_pass) echo "Passwords match"; else echo "Get the hell outta here, intruder!"; Hope it helps. Paulo

« previous php.notes (#20378) next »