Glossary
Rainbow table
Definition
Rainbow table: A precomputed table of hash chains that lets an attacker recover passwords from stolen unsalted hashes by lookup rather than fresh guessing, trading storage for cracking time. A unique random salt per password defeats it.
Also known asrainbow table attackprecomputed hash tabletime-memory trade-off table
In short
A rainbow table is a precomputed table that lets an attacker recover passwords from stolen hashes by lookup instead of fresh guessing. It stores chains of hashes compactly, trading storage for cracking time, and works only against unsalted hashes made the same way everywhere. Adding a unique random salt to each password before hashing defeats it.
Key takeaways
- A rainbow table does the hashing work in advance and reuses it against every matching hash.
- It stores only the start and end of long chains, which keeps it small enough to use.
- Philippe Oechslin introduced rainbow tables at CRYPTO 2003.
- A unique salt per password makes precomputed tables useless.
- Salted but fast hashes still fall to ordinary guessing, so password hashing must also be slow.
Last reviewed 3 December 2026 by Foxcolab Team
A rainbow table is a precomputed table that lets an attacker turn a stolen password hash back into the password by lookup instead of fresh guessing. The heavy work of hashing billions of candidate passwords is done once, in advance, and reused against every hash made the same way. MITRE ATT&CK lists it under password cracking: an attacker "may use a pre-computed rainbow table to crack hashes."
How it works#
A plain lookup table stores every candidate password next to its hash. It's fast but impossibly large. Rainbow tables, introduced by Philippe Oechslin at CRYPTO 2003, store chains instead:
- Start with a candidate password and hash it.
- Apply a "reduction function" that turns the hash into another candidate password.
- Hash that, reduce again, and repeat thousands of times.
- Keep only the first and last entries of the chain.
To crack a stolen hash, the attacker reduces and hashes it until the result matches a stored endpoint, then replays that chain from its start to find the password. Oechslin used a different reduction function at each step ("We call our chains rainbow chains"), which stops chains from merging and gave the method its name.
A worked example#
Oechslin tested the idea against a Microsoft Windows password-hashing scheme of the time. With 1.4 GB of precomputed data, two CD-ROMs, his table cracked 99.9% of alphanumeric password hashes in 13.6 seconds. It worked because that scheme added nothing unique per user: the same password always produced the same hash on every machine, so one table fit them all.
Why salt defeats it#
A table is built for one exact hashing method. Add a unique random salt to each password before hashing, and the attacker would need a separate table for every salt value, which removes the point of precomputing. OWASP's Password Storage Cheat Sheet is blunt: "A unique salt must be added to each password to prevent attackers from using precomputed lookup tables like rainbow tables."
Where the risk remains#
- Legacy systems that still store unsalted hashes.
- Short values hashed without salt, such as PINs, which can be listed outright.
- Salted hashes that are fast to compute. They resist tables but still fall to dictionary and brute-force guessing, which is why password hashing must also be slow.
In Foxcolab#
Foxcolab stores your sign-in password only as a salted, deliberately slow hash. Your device also locks your account key with a key made from your password, using a fresh random salt and a deliberately slow function. No precomputed table applies to either.
That account key protects your end-to-end encrypted files, documents and notes. Create a free account.
Keep exploring
Related terms
- Salt (password salt)A salt is a random value added to a password before it's hashed, so identical passwords never produce identical hashes and precomputed cracking tables stop working.
- HashingHashing turns any data into a short, fixed-length fingerprint that can't be turned back. It's how services check passwords without storing them and how you confirm a file arrived intact.
- Brute-force attackA brute-force attack guesses passwords, codes or keys one after another until one works. Rate limits stop it online; slow hashing and long passwords stop it offline.
- Dictionary attackA dictionary attack guesses passwords from a list of likely candidates, such as common and leaked passwords plus predictable variations, instead of trying every combination.
- Key derivation functionA key derivation function turns a password or other secret into an encryption key. Password-based ones are deliberately slow, so every guess costs an attacker time and hardware.

Foxcolab
Private work tools, without the ads.
Mail, files, documents, spreadsheets and meetings in one account. Files, documents and spreadsheets are end-to-end encrypted.