3 ms·
It's one way to do it, which is okay sometimes. The other way is to add a new empty column for bcrypt. The next time the user logs in, you save the bcrypt hash
by user5994461 10y ago
It's one way to do it, which is okay sometimes.
The other way is to add a new empty column for bcrypt. The next time the user logs in, you save the bcrypt hash and you remove the MD5 hash.
Over time, the active users will be migrated to the new scheme. The only issue is the abandoned accounts, they'll keep the old weak scheme.
- cm2187 10y agoI am not sure I agree. Your way will leave all the non active users exposed in the case of a leak. They may not be active on your website but are likely active on another website using the same password.
- user5994461 10y agoAs I said, that's an option among others, it has drawbacks. For a website like Yahoo with billions of abandoned accounts, that's a serious drawback ^^
- danielweber 10y agoThere are other migration techniques. If you know md5(password), you can create bcrypt(md5(password)).
- syncsynchalt 10y agoThat's what I do, though care should be taken that you can't then login against the old passwords by putting md5(password) in the password field. Usually you do this by decorating the bcrypt(md5(p)) entries in some way so you can recognize which ones are tested with bcrypt() vs bcrypt(md5()).