Skip to content
uencoder

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.

Purpose

Sets the lower bound on hash output length so that collision search is infeasible.

Mechanism

Birthday paradox: among 23 people there is a 50% chance two share a birthday. For a hash with n-bit output, about 1.177×√(2^n) = 1.177×2^(n/2) random inputs yield a 50% collision probability. Hence a 128-bit hash is insecure at only 2^64 trials.

Use cases

  • Hash output length selection
  • Digital signature security level
  • Certificate lifetime assessment
  • Cryptography education

Examples

  • Input
    128-bit hash
    Output
    Collision found in 2^64 trials

    Insecure

Common errors

Assuming an n-bit hash needs 2^n trials to collide
Collisions take only 2^(n/2); use outputs of at least 256 bits

Related terms

Related tools

References