Home / Knowledge hub / Rainbow table
Knowledge hub
Rainbow table
A precomputed list of hashes used to reverse unsalted passwords quickly.
What it means
A rainbow table is a precomputed structure that helps an attacker turn password hashes back into passwords. It is a space-saving way to store the results of hashing a huge number of likely passwords, so a lookup takes seconds instead of the time needed to hash them all again.
It works only when the same input always gives the same hash. If two users share a password and your system stores no salt, both rows show the same hash, and one table lookup reveals both. A salt breaks that link, because the same password then produces different hashes.
Why it matters
Password databases leak. When one does, the question is how quickly the attacker can turn hashes into working passwords, which people often reuse elsewhere. Unsalted fast hashes such as plain MD5 or SHA-1 can be reversed at scale, which feeds credential stuffing.
The fix is cheap and well known, so finding unsalted hashes during a review reflects poorly on the team. MITRE tracks the flaw as CWE-759, use of a one-way hash without a salt. Rotating to a stronger scheme at next login fixes old accounts without a mass reset.
How it shows up
A unique random salt for each password makes the precomputed table useless, because the attacker would need a separate table for every salt. Better still, use a purpose-built slow algorithm such as Argon2 or bcrypt, which add a salt and a cost setting. The OWASP password storage cheat sheet recommends them.
Salts stop rainbow tables, but they do not make a weak password strong. A salted fast hash can still be guessed at high speed with graphics cards, which is why the slow algorithms matter too. Check how your application stores passwords, and whether old accounts still use an older scheme that was never upgraded.
Questions people ask
Rainbow table, answered
Do rainbow tables still work?
Against unsalted hashes, yes, and large tables are freely available. Against properly salted hashes they do not.
Modern systems should not be vulnerable to them. Check any old systems you have not touched for years.
What is the difference between a rainbow table and brute force?
Brute force tries guesses live. A rainbow table does the hashing work in advance and trades storage for time.
A unique salt defeats the table, but not live guessing. Choose a slow, salted function as well.
Does adding a salt solve password storage?
It stops precomputed tables, but a fast hash can still be guessed quickly.
Use a slow, salted password hashing function such as Argon2id or bcrypt. Both matter. Do both. Check the cost setting too.
Is a pepper the same as a salt?
No. A salt is stored with each hash and is unique per password. A pepper is a secret kept outside the database.
See the pepper entry for how they combine.
How do we check our app?
Look at the password column and the hashing code. Hashes of one fixed length with no salt prefix, or a plain SHA or MD5 call, are warning signs.
A white-box review of the code finds this quickly.
Sources
Where this comes from
Related
Terms that sit next to this one
Salt
Random data added to each password before hashing so identical passwords differ.
Pepper
A secret added to every password hash and kept outside the database.
Hashing
A one-way transformation, so a password can be checked but never read back.
bcrypt
A deliberately slow password hashing function with a built-in salt.
Argon2
A modern password hashing function that is slow and memory-hungry on purpose.
How are your passwords stored?
In white-box mode we read your code while testing the running app, so weak password handling points to the file and line. Each finding carries the evidence. Book a pilot on one app.
Or start with a $199 pilot on one application: thirty days, success criteria agreed before day one, credited against the annual if you convert.