Rainbow table

A precomputed structure of hash chains that trades storage for computation, letting an attacker reverse unsalted password hashes much faster than brute force at the moment of attack.

A rainbow table is a time-memory trade-off for reversing password hashes, described by Philippe Oechslin in 2003 as a refinement of Martin Hellman’s 1980 method. Storing every possible password with its hash would take impractical space, so the table stores chains instead. Each chain starts with a candidate password, hashes it, applies a reduction function that maps the hash to another candidate, and repeats; only the first and last values are kept. To look up a stolen hash, the attacker regenerates chain segments until a match appears. Using a different reduction function at each step reduces collisions between chains.

The standard countermeasure is salting: a unique random value added to each password before hashing means a precomputed table would be needed for every salt, which makes the approach impractical. Key stretching with functions such as bcrypt, scrypt or Argon2 adds cost to every guess. The attack works offline against stolen hashes, not against a login page. It differs from a dictionary attack, which hashes a word list at attack time, and from a brute-force attack, which tries every combination.

Exam relevance: a scenario in which stolen unsalted hashes are cracked quickly with precomputed tables is likely to point to a rainbow table. Candidates are expected to choose salting as the countermeasure.