The VikiD Truth

Knowledge base / Computing / Security

Computing | Computer Security | Linux Security | Industrial Control Systems Security | Penetration Testing | Exploitation

Rainbow Tables

Wikipedia Article on Rainbow Tables

L0PHTCRACK (LC6) - PASSWORD - AUDITOR

Perpetrators can use huge tables (terabytes in size) to lookup passwords to known hashes.

This is a brute force method but effective for small passwords.

The only and best way to protect against this sort of attack is to use passwords greater than 15 characters

The plain idea

A rainbow table is a huge pre-computed dictionary that maps password hashes back to the passwords that made them. Systems never store your password; they store its hash (a one-way fingerprint, see encryption). If an attacker steals that list of hashes, they cannot reverse a hash directly, so instead they hash millions of candidate passwords in advance and look yours up. A rainbow table is a clever, space-saving version of that idea: it stores “chains” of hashes rather than every entry, trading a little extra computation for a massive saving in storage.

Why it matters

It turns a stolen hash database into stolen passwords, in seconds, for any password short or common enough to be in the table. It is the attack that explains two of the most important rules in all of security: salt your hashes, and use a slow hashing algorithm.

An everyday analogy: the answer key

Imagine a teacher who locks the answers in a safe but publishes, for every possible exam paper, the exact pattern of correct ticks and crosses. Steal the mark sheet and you can match the pattern straight to the answers, without opening the safe. A salt is the teacher secretly adding a different random question to each student’s paper, so one universal answer key no longer fits anybody.

A worked example: why a salt destroys the table

Two users both pick the password summer2026. Without a salt, both rows store the identical hash, and one rainbow-table lookup cracks both. Now add a unique random salt to each:

hash1 = SHA256("a9f3..." + "summer2026")
hash2 = SHA256("7c1e..." + "summer2026")

The stored hashes are now completely different, and no pre-computed table helps, because the attacker would need a separate table for every possible salt. That is the whole defence: rainbow tables rely on the same password always producing the same hash, and salting breaks that.

Updating my old note for 2026

My original advice, “use passwords longer than 15 characters”, is good for you as a user, and length genuinely does push a password out of reach of these tables. But the real fix lives on the defender’s side:

With a proper salted, slow hash, classic rainbow tables are essentially obsolete; attackers fall back to slow brute force and dictionary attacks, which strong, unique passwords and a password manager defeat.

Common misconceptions

How it connects

The truth revealed: a rainbow table does not break hashing; it beats lazy hashing. A pinch of salt ruins the whole recipe.

Last edited · 4 revisions

Tags: #Computing