Re: Decrypting PASSWORD() from MySQL

From: Date: Wed, 19 Dec 2001 21:39:32 +0000
Subject: Re: Decrypting PASSWORD() from MySQL
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-15122@lists.php.net to get a copy of this message
> I have a form for a user to request their forgotten username and password by > entering their email address. I then process this and use mail() to send > them their username and password. However, the password is stored in an > encrypted PASSWORD('password') field in the MySQL table. How can I retrieve > the decrypted password in a SELECT statement? You can't. This is what I do: 1) Use password('$password') to store my passwords. 2) Since this is a one-way algoritme I replace the password with some random letters (and encrypt it!) 3) Then I email the new password to the user 4) And.. force the user to change the password at the first login. Best Regards Fredrik A. Takle Bergen, Norway

« previous php.db (#15122) next »