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)=targetOutput2^n trials needed to find xOne-wayness
Common errors
- Confusing collision resistance with preimage resistance
- They are independent properties; assess each separately
Related terms
Collision Resistance
Collision resistance is the property of a hash function that it is infeasible to find two distinct inputs producing the same hash output. The birthday attack dictates the required output length. GLOSSARY
MD5
MD5 is a 128-bit cryptographic hash function designed by Ronald Rivest; proven insecure by collision attacks, it is now used only for non-security purposes such as checksums. GLOSSARY
SHA-256
SHA-256 is the 256-bit-output member of the SHA-2 family, widely used in TLS, blockchains, and cryptographic applications, with no known practical attacks. GLOSSARY