News for hackers. Stuff that matters.
Re:To Keep Passwords Safe from Hackers, Just Break Them into... by jrockway on Monday January 28, 2013 @11:11PM (#5132283)
The problem is that when you make this mistake early, it's not easy to fix, since you don't have the passwords yourself. Though I guess they could have rainbow-table'd their own password database and migrated everything over to a better scheme, rather than waiting for users to successfully log in.
Re:To Keep Passwords Safe from Hackers, Just Break Them into... by moxie on Tuesday January 29, 2013 @02:12AM (#5132785)
It's not really that difficult. Let's say you've got a column called 'insecure_pass' that is storing a simple md5 hash of users' passwords.

Four simple steps:

1) You add a new password column to your DB (secure_pass) and modify your account creation / password change code to store bcrypt(md5(password)) in that column in parallel with just md5(password) in the old insecure_pass column.

2) You run a job that migrates insecure_pass to secure_pass by calculating bcrypt(insecure_pass) and storing that in secure_pass.

3) You turn on "dark reads" for secure_pass on login and log if there are any cases where validation against secure_pass failed when validation against insecure_pass succeeded. If a log message shows up, you did something wrong.

4) You move over to "light reads" for secure_pass and stop updating/validating insecure_pass. Once that's deployed, you drop the insecure_pass column from your DB.

Re:To Keep Passwords Safe from Hackers, Just Break Them into... by jrockway on Tuesday January 29, 2013 @02:22PM (#5135706)
That's a really good idea. If you can't protect the passwords, you can at least protect the hashes, with almost no loss of speed or security.
Re:To Keep Passwords Safe from Hackers, Just Break Them into... by bradleyland on Monday January 28, 2013 @11:26PM (#5132317)
I'm surprised common auth systems don't handle this more elegantly. It's possible to maintain a history of crypt methods and store that with the password data. The system can then keep track of which user records were created with older algorithms, and automatically update them when the user logs in, but not requiring an across-the-board password update. The process is completely transparent to the user.
Re:To Keep Passwords Safe from Hackers, Just Break Them into... by mnutt on Monday January 28, 2013 @11:33PM (#5132340)
I believe there are some systems that don't store the crypt methods with the password data, but instead just run through each password method to try to find one that works, then transparently upgrade to the newest.
Re:To Keep Passwords Safe from Hackers, Just Break Them into... by lucian1900 on Tuesday January 29, 2013 @04:11AM (#5133060)
That may be vulnerable to a timing attack, however.
Re:To Keep Passwords Safe from Hackers, Just Break Them into... by bradleyland on Tuesday January 29, 2013 @11:39AM (#5134866)
You could definitely use a timing attack to isolate accounts still using the weak crypto, but the mitigation against that is the same as any time attack mitigation strategy: you configure your auth solution with a return time floor.

I don't see this scenario presenting any more risk from a timing attack vector than a bare implementation using weak crypto, and it offers a balance between having no option to upgrade your crypto algorithm, and an option that involves some trade off.

Re:To Keep Passwords Safe from Hackers, Just Break Them into... by mnutt on Tuesday January 29, 2013 @09:47AM (#5134214)
Possibly. I'm no expert, but it seems like if you were using an incorrect password, you would be running through every old system every time, regardless of if the person had upgraded. The only time you would short-circuit any of the methods would be if you used the right password.

I actually think the originally described system is more vulnerable to a timing attack, since you could determine which crypto system a user's password is using based on the timing.

Re:To Keep Passwords Safe from Hackers, Just Break Them into... by aqme28 on Tuesday January 29, 2013 @02:05AM (#5132771)
Alternatively, rehash the passwords on login with the new, safer system.
Re:To Keep Passwords Safe from Hackers, Just Break Them into... by jrockway on Wednesday January 30, 2013 @09:14PM (#5143002)
That's the standard, but all those unused accounts still have vulnerable passwords, which is sub-optimal. (This might not matter for discussion forums or something like that, but consider something like your state's online tax site; something people only view once a year, but something that's very important to keep secure.)