22.02.2014, 15:50
Should be. Execute these queries through phpMyAdmin or another client. To generate random salts you can use something like:
Replacing keystring with a random sequence of characters of your choice. I've done this because UUID_SHORT(), while unique, is predictable.
Next, update the actual passwords.
You can use any combination of functions to generate the password, just make sure you remember it because you will need it in your script.
PHP код:
UPDATE testtable SET salt = SHA1(CONCAT(UUID_SHORT(), 'keystring'))
Next, update the actual passwords.
PHP код:
UPDATE testtable SET pass = SHA1(CONCAT(salt, SHA1(pass)))
PHP код:
SELECT * FROM testtable WHERE user = '%s' AND pass = SHA1(CONCAT(salt, SHA1('%s')))