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

Why Two Files Will Never Have the Same SHA-256

2²⁵⁶ possible hashes.

SHA-256 produces 2²⁵⁶ possible values — a number with 77 digits. A collision is theoretically possible but practically impossible.

Hash space

The birthday attack threshold is ~2¹²⁸ trials.

2256≈1.16×10772^{256} \approx 1.16 \times 10^{77}

Brute-force collision

  1. 1

    Trials needed

    ~2¹²⁸ ≈ 3.4 × 10³⁸

  2. 2

    At 10⁹ hashes/s

    3.4 × 10²⁹ seconds

  3. 3

    In years

    ≈ 10²² years

Answer

No computer will ever find a collision by brute force

The formula behind it

Exponent

ana^n
See the full formula, variables and more examples

The takeaway

Hash collisions are the mathematical equivalent of two snowflakes being identical.

Back to all stories