Hacker News new | ask | show | jobs
by tudorconstantin 4706 days ago
Confession time: i still have some apps with salted md5 hashed passwords
4 comments

The first step is accepting that you have a problem. Fortunately, it's fairly straightforward to fix the problem!

Previous discussion of how to handle this scenario: https://news.ycombinator.com/item?id=2689149

You shouldn't be using any of the functions on that page directly, anyway: http://throwingfire.com/storing-passwords-securely/#notpassw...
But it does matter, because if you can exploit a weakness in the hash function you can figure out the salt, strip it, and then use your precomputed dictionary.
That's not really how it works. Either way, you shouldn't be using just a regular "hash function" anyway. Even basic constructions like PBKDF2 use HMAC constructions where SHA1 and even MD5 are still pretty safe to use (although not very computationally expensive.)
So migrate? Hash the hashes with Bcrypt or PBKDF2.

Bcrypt(MD5(password)) is just as effective as Bcrypt(password) at knocking brute force attempts on the head.

Unless the Bad Guys already have the MD5 hashes
Then the problem is not "I support an app that uses md5 hashes" any more. Your problem in that case is "all my users accounts were broken."
Right, but you can still perform the migration I suggested and flag accounts for a password reset on next login.
I was supporting an installation with md5 unsalted passwords

let us hang our heads in shame.