Re: Crypt

From: Date: Mon, 23 Oct 2000 08:04:52 +0000
Subject: Re: Crypt
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-21736@lists.php.net to get a copy of this message
On Mon, 23 Oct 2000, Joseph H Blythe wrote: > Hey, > > I was just trying to encrypt a user inputted password from a form field: > > $password = crypt($password); > > I then inserted it into the database, then when a user logs in I am > basically comparing the users password encrypted to the one in the > database, I have done this before but can't remember if I actually used > the crypt function ( might have been md5 ) and for the life of me I > can't find the code I wrote. > > The problem is that when I use the crypt function it keeps creating > different encrypted strings from the same password. > > What am I doing wrong? > > Regards, > > Joseph I think you might need a pinch of salt :-) Pass a salt value to crypt or you'll get random salts, hence random values for the same input. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA

« previous php.general (#21736) next »