Hi Bobby, > In my code I am trying to send an email (containing a password) > to a user when he has forgotten his password. [...] > The problem is that security leads to needing to encrypt > passwords in the database. Im using the password function > within mysql. Is there any way of reversing the password > function to get the original password to send out to the user?
I think it's a one-way hash, like MD5. You could set their password to something else - a random 8-letter string, for example - and send them that along with a note encouraging them to change it. If you want two-way encryption, have a look at AES_ENCRYPT and AES_DECRYPT: http://www.mysql.com/doc/en/Miscellaneous_functions.html (scroll down a bit) Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php