note 33161 added to function.crypt
| From: | webmaster at woodydrn dot com | Date: | Wed, 18 Jun 2003 00:34:23 +0000 |
| Subject: | note 33161 added to function.crypt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-50545@lists.php.net to get a copy of this message | ||
I don't know what people are talking about ... two first chars in the password ? nooo ...
What you do is first create a password with crypt:
$passwd = crypt("testing");
now $passwd will have something like:
$1$/33Tmd.m$TFPkxx6N5em0u.5lcgy1I1
This is devided up:
md5 hash salt real password cryptet with salt
$1$ /33Tmd.m $ TFPkxx6N5em0u.5lcgy1I1
So now when you check for password, just read the org. password, break it up and get the salt.
Encrypt password with salt, and compare it with org. encrypted password.
----
Manual Page -- http://www.php.net/manual/en/function.crypt.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33161
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33161&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33161&report=yes