3 ms·
Actually, you can migrate slowly. Create a second password column on your database to store your new hash. When a user logs in check if the new column is blank
by Jeremy1026 13y ago
Actually, you can migrate slowly.
Create a second password column on your database to store your new hash. When a user logs in check if the new column is blank. If it is check that they entered the password correctly by verifying against your MD5 hash. If it is correct rehash their plain text and store it in the new column.
If the new column isn't blank, then the have already logged in and you have the new hash, so verify against the new hash. As everyone logs into your website, you'll have a new set of, more secure, hashes. For those that are inactive you can either delete them, assign a random password and email them, or let their MD5 password hash sit there forever.
- DoubleMalt 13y agoDon't forget to delete the value in the md5 column, otherwise the whole exercise is for naught.
- Jeremy1026 13y agoCorrect.