Why Fast Hashes Like MD5 and SHA-256 Are Unsuitable
You'll learn why using general-purpose hash functions for passwords makes brute-force attacks dangerously easy.
The Speed Problem
In the previous lesson, you learned about salting passwords to prevent rainbow table attacks. But there's another critical issue: even with salts, hashing functions like MD5 and SHA-256 are too fast.
These hash functions were designed for tasks like verifying file integrity or generating checksums, where speed is essential. MD5 and SHA-256 can compute billions of hashes per second on modern hardware. This is excellent for checksums but catastrophic for password security.
Why Speed Enables Brute-Force Attacks
When an attacker steals a database of salted password hashes, they can still try to guess passwords by:
- Taking a potential password guess (like "password123")
- Adding the salt
- Hashing it
- Comparing the result to the stolen hash
Because MD5 and SHA-256 are so fast, an attacker can test billions of password guesses per second using specialized hardware (GPUs). Even with unique salts for every user, they can crack weak passwords in minutes or hours.
The Real-World Impact
Think of it like a lock that opens instantly versus one that requires 10 seconds to try each key. If someone has millions of keys to test, the instant lock will be defeated quickly, while the slow lock makes the attack impractical.
With modern GPU clusters, an attacker can test:
- MD5: ~50 billion hashes/second
- SHA-256: ~20 billion hashes/second
This makes even moderately complex passwords vulnerable to brute-force attacks.
Key Takeaway: Fast hash functions like MD5 and SHA-256 are unsuitable for passwords because their speed enables attackers to perform brute-force attacks at scale, even with proper salting.