Skip to content
uencoder

Preimage Resistance

Preimage resistance is the property of a hash function that, given a hash value h, it is infeasible to find an input x with H(x)=h. One-wayness.

Purpose

Lets a hash function be safely used for password storage and commitment schemes — the input cannot be recovered from the hash.

Mechanism

For an n-bit hash, the best generic attack takes about 2^n brute-force trials, so a 256-bit hash is preimage-secure. Note: collision resistance ≠ preimage resistance; MD5's collisions are broken but its preimages remain hard.

Use cases

  • Password hashing (one-way storage)
  • Hash commitment schemes
  • HMAC security proofs
  • Blockchain PoW

Examples

  • Input
    H(x)=target
    Output
    2^n trials needed to find x

    One-wayness

Common errors

Confusing collision resistance with preimage resistance
They are independent properties; assess each separately

Related terms

Related tools

References