On step 3, where you say "scrypt(s'i, md5(si, password))", don't you actually need "scrypt(s'i, md5(s0, password))", where s0 is the original salt? In other words, you still need to know the original salt you were using to successfully migrate. Therefore, if you are storing the per-user salt as the first bytes in the hashed password field, then you have to be careful when you "throw away the old weak hash hi and forg…
The original salt is s_i which you do need to keep around. The new salt is s^'_i.
One way to fix your rubbish password database
11–20 of 94 posts
Re: One way to fix your rubbish password database
#12Re: One way to fix your rubbish password database
#13I think a better idea would be to establish an easily implemented pattern for "password bankruptcy" that companies could follow in the case of a leak.
Re: One way to fix your rubbish password database
#14... then you should stop doing that and you should start using OAuth, so the client application never sees your user's password.
Re: One way to fix your rubbish password database
#15Re: One way to fix your rubbish password database
#16Isn't the fact that s/bcrypt is by design costly preventing this idea from being executed?
Re: One way to fix your rubbish password database
#17This is a good step, but unfortunately all of the actual passwords are still out there, so they need to be changed. I think a better idea would be to establish an easily implemented pattern for "password bankruptcy" that companies could follow in the case of a leak.
Re: One way to fix your rubbish password database
#18Isn't the fact that s/bcrypt is by design costly preventing this idea from being executed?
Re: One way to fix your rubbish password database
#19Is there a security disadvantage to taking the MD5 hashes you already have and running those through bcrypt? It seems like that would let you get to a salted bcrypt implementation in one day as opposed to waiting for all your users to log in. Perhaps you could do the mix (md5 + bcrypt) until the user logs in and then switch them solely to bcrypt?
That's what the article says.
Re: One way to fix your rubbish password database
#20Is there a security disadvantage to taking the MD5 hashes you already have and running those through bcrypt? It seems like that would let you get to a salted bcrypt implementation in one day as opposed to waiting for all your users to log in. Perhaps you could do the mix (md5 + bcrypt) until the user logs in and then switch them solely to bcrypt?
No. I don't believe there's any disadvantage to this. An MD5 hash is a 128 bit random number; it's 16 fully random characters, better than almost any human password.