Skip to content
uencoder

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)
    Output
    2^128 trials needed to find a collision

    Secure

Common errors

Using a 128-bit hash (collision needs only 2^64)
Use at least 256-bit output

Related terms

Related tools

References