View Full Version : Update encrypted password
adamjthompson
10-18-2006, 10:56 PM
Hello,
I have a PHP/MySQL app installed on my site. I've forgotten my password, but the password in the MySQL table is encrypted. How do I encrypt a new password and/or decrypt the old password to see what it is?
Thanks,
Adam
CFMaBiSmAd
10-18-2006, 11:17 PM
This is probably a one way hash (md5.) If so, you cannot easily determine what the original password was that generated it.
The surest way of generating a new value and replacing the existing value with a new one that works, is to duplicate the code that created and inserted the existing password. This was likely done using an install script that came with the application. DON'T run the install script again unless you want to wipe out existing work. Find the code that accepts the password, encrypts it, and places it into the database. Duplicate the functionality of this code to create a "reset" password script.
if it is hashed with md5:
UPDATE table SET password=md5('password');
will set it to 'password'
adamjthompson
10-19-2006, 05:44 PM
if it is hashed with md5:
UPDATE table SET password=md5('password');
will set it to 'password'
Do I run that in PHPmyAdmin?
~Adam
guelphdad
10-19-2006, 06:26 PM
You can run that in phpmyadmin. use the sql tab.
aliendisaster
10-19-2006, 09:48 PM
If your using phpMyAdmin, you can edit the row and use the drop down to use md5 or password.
vBulletin® v3.8.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.