A dictionary attack cracks stored password digests by hashing a large set of possible passwords with the same hash function, then looking up a target digest among those results. It does not reverse a hash function; it finds an input whose computed digest matches a stored target. section 6.4.2 section 6.5
The attack becomes practical when the candidate password space is limited. If an application permits only lowercase six-character passwords, an attacker can precompute digests for that space, store digest-to-password pairs, and perform a nearly immediate lookup after a database leak. Longer, more complex passwords enlarge the required dictionary. section 6.4.2
Figure 6.8 Hash digests are the keys. Passwords that resulted in those digests are stored as values.
Read the table as a reverse index: hash digests are lookup keys, and the password guesses that produced them are stored as values. section 6.4.2
A dictionary attack follows this pattern:
- Choose a candidate-password space, often informed by word lists or application password restrictions. section 6.4.2
- Hash every candidate with the target system's hash function and retain the resulting digest mappings. section 6.4.2
- Obtain target digests, such as hashed passwords exposed in a leaked username-and-digest database. section 6.4.2
- Look up each target digest and verify any recovered candidate through the normal authentication check. section 6.4.2
Storage is the main cost of retaining every digest-to-password mapping. Hash chains reduce that storage through a time-space trade-off: they alternate hashing with a reduction function that maps a digest back into the candidate-password space. Rainbow tables refine this approach by varying the reduction function by column, helping prevent chains from merging. section 6.4.2 section 6.5
Unsalted SHA-256 password database
A Go implementation stores SHA-256 digests for randomly generated six-character passwords. A rainbow-table test generates millions of chain rows, tries to crack 100 stored user digests, and authenticates each recovered password against the database. The scenario demonstrates that hashing alone does not stop precomputed guessing when passwords come from a constrained space. section 6.4.2
Salts counter precomputed tables made without the salt. A salt is stored in plaintext alongside the digest, but it changes the hash output so an attacker must account for that salt rather than reuse a single unsalted dictionary across targets. section 6.4.2 section 6.5

