liveBook · Manning

Pre-image resistance

As explained in Hacking Cryptography

The security property that makes it computationally infeasible to find an input corresponding to a specified hash output.

Pre-image resistance is the requirement that, given a digest Y = H(A), an attacker cannot feasibly recover the original input A. It is also called first pre-image resistance and expresses the one-way behavior of a hash function. section 6.2 section 6.5

A fixed-size digest compresses inputs of unlimited size, so collisions must exist in theory; pre-image resistance instead concerns the difficulty of reversing one chosen digest to its input. section 6.2 section 6.5

Keep these distinctions clear:

  • Pre-image resistance asks for A when Y = H(A) is known. section 6.2
  • Second pre-image resistance asks for a different B matching the digest of a known A. section 6.2
  • Collision resistance asks for any pair of inputs with the same digest, without fixing the digest first. section 6.2
  • Dictionary attacks weaken password secrecy by precomputing digests for likely valid passwords and performing reverse lookups. section 6.0 section 6.5

Password hash

A stored password digest should not reveal the exact password used to produce it. An attacker who obtains Y should face an infeasible search for A, although likely-password dictionaries can provide a practical attack path. section 6.2 section 6.5

Figure 6.4 Security properties of hash functions
figure

Compare pre-image resistance with second pre-image and collision resistance in the security-property diagram. section 6.2

How Hacking Cryptography covers it

How deep it goes
Defines the attacker’s target and distinguishes it from related properties, but does not develop a concrete inversion algorithm.
Examples
Uses password digests, reverse-looked-up password dictionaries, and fixed-size hash outputs as concrete illustrations.
What it assumes
Assumes basic familiarity with hash functions and digest notation while explaining the security terminology from its definitions.
What you can do after
Evaluate hash security claims by distinguishing reversal of a chosen digest from second-preimage and collision attacks.
How it connects
Connects pre-image resistance to hash functions, one-way functions, second pre-image resistance, collision resistance, and dictionary attacks.

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 Hacking Cryptography. The section links point to the parts of the book it draws on.