Mathematics · Explainer

How SHA-1 was broken, and what a shared birthday has to do with it

In 2017 Google and CWI Amsterdam found two different PDF files with the same SHA-1 fingerprint, breaking a code trusted for decades. The weakness is the same math behind the birthday paradox: matches between pairs pile up far faster than intuition expects, so a fingerprint is broken by collisions long before you would guess.

Why 23 people already share a birthday

In a room of just 23 people, there is about a 50-50 chance two of them share a birthday. That feels far too low a number, because we picture ourselves against the room: my birthday against 22 others. But that is the wrong count.

What matters is pairs. With 23 people there are 253 possible pairs, and each pair is a chance for a match. Pairs pile up as roughly the square of the group size, so the number of chances explodes while the group stays small. Coincidences that feel rare become likely, fast.

The same trick attacks digital fingerprints

A cryptographic hash like SHA-1 turns any file into a short fingerprint, and the whole system relies on no two meaningful files ever sharing one. If an attacker can find two files with the same fingerprint, a collision, they can swap one for the other undetected: sign a harmless document, then attach the signature to a malicious one.

The birthday math is exactly the attacker's advantage. They do not need to match one specific fingerprint. They just need any two files that collide with each other, and pairs pile up the same way birthdays do. That shortcut, the birthday attack, roughly halves the effective security of a hash. It is why cryptographers demand large fingerprints with generous safety margins.

SHAttered, the real break

In 2017 researchers at Google and CWI Amsterdam turned this from theory into a working attack called SHAttered. They produced two distinct PDF files that share one identical SHA-1 fingerprint, the first full collision for the algorithm. It took enormous computing power, but it proved SHA-1 could no longer be trusted.

The response was swift: browsers, software, and standards bodies moved off SHA-1 for security. A puzzle that starts with people sharing a birthday ends with the retirement of a code that had guarded the internet for years. The counterintuitive pile-up of pairs is the thread running through both.

Sources & further reading

See why coincidences pile up, step by step

Free to start. Sign in with Google, no card.

How SHA-1 was broken, and what a shared birthday has to do with it · One Profound Idea