Re: How crypting passwords in DB
| From: | Anuradha Ratnaweera | Date: | Wed, 27 Dec 2000 12:37:40 +0000 |
| Subject: | Re: How crypting passwords in DB | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-31957@lists.php.net to get a copy of this message | ||
On Wed, 27 Dec 2000 ouldm@linux-at-business.com wrote:
> In reality I'm asking for the two cases. i.e. encrypting passwords in
> my database and not allow password to be clear when user sign up in
> the pop-up (user, password) on my site.
When the user sends a password, calculate it's MD5 hash (a 32 byte string)
$md5 = md5($HTTP_POST_VARS["password"]);
and insert this value to the database instead of plain text. When the user
logs in, test MD5 hash of the password he sends with the one in the
database.
Anuradha