liveBook · Manning

Pre-image resistance

As explained in Real-World Cryptography

Pre-image resistance is the property that, given a hash output, it is computationally infeasible to find an input that hashes to that output.

Pre-image resistance means that, given a hash output or digest, an attacker should not be able to recover an input that produced it. Hashing behaves like blending ingredients: the result is easy to produce, but reversing it is computationally infeasible. section 2.2

Figure 2.3 Given the digest produced by a hash function (represented as a blender here), it is impossible (or technically so hard we assume it will never happen) to reverse it and find the original input used. This security property is called pre-image resistance.

Use the blender image to distinguish producing a digest from recovering the original input. section 2.2

Small spaces defeat the property

Hashing either “yes” or “no” does not hide the choice: an observer can hash both candidates and compare the results. The same weakness applies to predictable messages, such as variants of “I will be home on Monday at 3 a.m.” Pre-image resistance protects sufficiently unpredictable inputs, not tiny or guessable ones. section 2.2 section 2.3

Keep these neighboring properties separate:

  • Second pre-image resistance starts with a known input and seeks a different input with the same digest. section 2.2
  • Collision resistance lets the attacker choose both different inputs and seek a shared digest. section 2.2
  • Digest size matters: extremely short outputs make collisions easy, while practical hash functions commonly use at least 256-bit outputs. section 2.3

How Real-World Cryptography covers it

How deep it goes
Defines one-wayness, demonstrates exhaustive guessing, and distinguishes second pre-image and collision resistance without proving internals.
Examples
Uses a blender analogy, yes/no choices, predictable sentences, and tiny two-bit digests to expose weaknesses.
What it assumes
Assumes basic familiarity with hash functions and digests while defining the security property in plain language.
What you can do after
Evaluate whether a hashing use meaningfully hides an input or merely disguises a small, predictable candidate set.
How it connects
Connects pre-image resistance to hash functions, digests, second pre-image resistance, collision resistance, and digest size.

Also explained in

Compare how 2 books explain pre-image resistance →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Real-World Cryptography. The section links point to the parts of the book it draws on.