Crack an MD5 hash in less than a second

Here is a common misconception when it comes to password security:

“It’s unsafe store user passwords as plain text in the database, so I’ll MD5 the passwords. MD5 is safe because it is one-way encryption, and takes too long to brute force.”

WRONG!

An unsalted MD5 hash can be cracked in less than a second, because it is vulnerable to a precomputation attack. Don’t believe me? Try it for yourself. There are dozens of websites that will take a hash, and return the original password almost instantly. This is true of all hashing algorithms, not just MD5.

How do you defend against a precomputation attack? You use a salt when computing the hash. Using a large salt makes it infeasible to precompute. Also, it helps if you have a strong password that contains numbers, uppercase letters, lowercase letters, and especially symbols. You get bonus points if your password contains strange characters (unicode characters, ascii characters above 128, etc) because nobody can be bothered precomputing rainbow tables for those.

View Comments to “Crack an MD5 hash in less than a second”

  1. [...] if the hash is generated from sensitive information such as passwords, then you should be aware of hashes weakness to precomputation attacks. Basically, make sure you sprinkle some salt [...]

blog comments powered by Disqus