Re: problems with md5()

From: Date: Thu, 08 Apr 2004 04:57:47 +0000
Subject: Re: problems with md5()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-182784@lists.php.net to get a copy of this message
On Thursday 08 April 2004 12:35, jdavis wrote: > hello, > I have a database containing usernames and md5 encrypted passwords. > When i use md5() to encrypt a users password recived via a form > to compare to the md5ed passwd in the database i get problems... > > for instance ... > > user foo has passwd 'pass' > 'pass' md5ed in database is this > > 1a1dc91c907325c69271ddf0c > > i got this using phps md5. > > Then ... when i md5 a pass i recieve later to compare > for a login the password 'pass' comes up like this... > > 1a1dc91c907325c69271ddf0c944bc72 > > they are the same except the trailing 944bc72 md5() returns a 32 character string so whatever is stored in your DB is obviously truncated. Make sure the field holding the password is of sufficient size/length. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* Most burning issues generate far more heat than light. */

« previous php.general (#182784) next »