Rainbow Tables and Why Simple Hashing Fails
What you'll learn: How attackers use precomputed hash tables to instantly crack passwords stored with unsalted hashes.
The Problem with Simple Hashing
You've learned that one-way hash functions protect passwords by making them (theoretically) impossible to reverse. However, there's a critical flaw when hashing is used alone: attackers don't need to reverse the hash if they can recognize it.
What Are Rainbow Tables?
A rainbow table is a massive precomputed database that maps millions or billions of common passwords to their hash values. Think of it like a dictionary where you can look up a hash and instantly find the original password.
For example, a rainbow table for MD5 might contain:
5f4dcc3b5aa765d61d8327deb882cf99→ "password"e10adc3949ba59abbe56e057f20f883e→ "123456"25d55ad283aa400af464c76d713c07ad→ "12345678"
The Attack in Action
When an attacker steals a database of hashed passwords, they simply:
- Take each hash value
- Look it up in their rainbow table
- Instantly retrieve the original password
No cracking, no computation needed—just a simple lookup operation. The work was done once, in advance, and can be reused forever against any unsalted hash database.
Why This Defeats Simple Hashing
Hashing the same password always produces the same output. This predictability is what makes rainbow tables possible. If 10,000 users all chose "password123", their hash will be identical—and one rainbow table lookup compromises all 10,000 accounts instantly.
This is why modern password storage never uses hashing alone.
Key Takeaway: Rainbow tables exploit the deterministic nature of hash functions to enable instant password lookup, making unsalted hashing completely inadequate for password protection.