Real World Maths Busters

The Maths Behind Everyday Life

The story, the formula and a worked example — see exactly where this maths shows up in the world around you.

Back to all stories
Technology 4 min read

Birthday Attack on Hashes

Why 50% collision risk comes much sooner than you’d think.

Just like 23 people give a 50% chance of a birthday match among 365 days, hash collisions appear at the square root of the output space.

Birthday bound

50% collision probability at approximately √N trials.

n≈1.2×N=1.2×2k/2n \approx 1.2 \times \sqrt{N} = 1.2 \times 2^{k/2}

256-bit hash

  1. 1

    Step

    N = 2²⁵⁶

  2. 2

    Step

    50% collision at ≈ 2¹²⁸ hashes

  3. 3

    Step

    Still astronomically large

Answer

2¹²⁸ ≈ 3.4 × 10³⁸ — safe for now

The formula behind it

Square Root

n\sqrt{n}
See the full formula, variables and more examples

The takeaway

The birthday attack halves the effective security — a 256-bit hash gives 128-bit collision resistance.

Back to all stories