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.
Purpose
Ensures a hash value uniquely identifies its input — the security foundation of digital signatures and integrity verification.
Mechanism
For an n-bit hash, the birthday attack needs about 2^(n/2) computations to find a collision. Hence a 128-bit hash collides in only 2^64 trials (insecure), while 256 bits requires 2^128 (secure). MD5 and SHA-1 are deprecated due to collision attacks.
Use cases
- Digital signature security foundation
- Content-addressed storage (Git, IPFS)
- Certificate fingerprint uniqueness
- Blockchain proof of work
Examples
- Input
SHA-256 (256-bit)Output2^128 trials needed to find a collisionSecure
Common errors
- Using a 128-bit hash (collision needs only 2^64)
- Use at least 256-bit output
Related terms
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. GLOSSARY
Birthday Attack
The birthday attack exploits the birthday paradox: after about 2^(n/2) hash computations there is a 50% chance of finding a collision in an n-bit hash, which 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