When using mod_auth_mysql with encrypted passwords (encrypted with the encrypt()
function) you want to be able to let users change their own passwords. For this, you must be
able to ask the user for the old pass and compare it to the encrypted string in the db. From a
first glance, it seems that each time you encrypt() the password you get a different string so
how can you know that this is the password?
The correct way to do this is by taking the first two characters from the encrypted string in the
database and the password the user sent to your script and encrypt them again like this :
Encrypted string in the database : dX8OQBwAA2TOs
Password : MyPass
To confirm do : encrypt('MyPass','dX')
The result will be dX8OQBwAA2TOs.
So if, encrypt('MyPass','dX') == "dX8OQBwAA2TOs" than the user entered the correct pass.