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. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php