← Back to section · Foundations of Cryptography

A History of Collision Attacks: How MD5 and SHA-1 Left the Stage

From Wang Xiaoyun's team breaking MD5 in 2004, to SHAttered's first practical SHA-1 collision in 2017, to chosen-prefix collisions costing tens of thousands of dollars by 2020 — this history shows how collision attacks turn from theoretical blemishes into engineering incidents, and why standards bodies retire algorithms a decade early.

Published 22 November 2026 · 5 min read · PQ Frontier

A History of Collision Attacks: How MD5 and SHA-1 Left the Stage
AI-generated site artwork
Video explainer · Hash functions: from message to digest

Hash functions are never retired by a single paper’s verdict; they are pushed out by a cost curve that keeps sinking. The exits of MD5 and SHA-1 are the best textbook for this law: collision attacks descend a predictable staircase — theoretical weakness, identical-prefix collision, chosen-prefix collision, cheap practicality — and each step comes with a real-world incident or warning.

MD5: from Wang’s paper to a forged CA certificate

MD5 outputs 128 bits, so the birthday bound should have given it about 64 bits of collision security. In 2004, Wang Xiaoyun and collaborators published a complete collision construction for MD5 that brought the cost of finding a colliding pair within reach of ordinary computers, stunning the field — this was not a marginal improvement but a structural break. Progress then walked down the staircase steadily: by around 2006, generating collisions within minutes was routine; in 2007–2009, Stevens and colleagues upgraded the attack to a chosen-prefix collision — the attacker first picks two documents with different beginnings of their own choosing, then computes a suffix for each so that the two documents hash identically. The two kinds of collision differ completely in harm: an identical-prefix collision only lets an attacker mint a pair of “twin” junk files, while a chosen-prefix collision pairs a legitimate file (say, a certificate request) with a malicious one, so a signature honestly obtained on the legitimate file transfers to the malicious one.

At the end of 2008, researchers used exactly a chosen-prefix collision to forge a CA certificate, demonstrating to the world the practical bankruptcy of the MD5-based issuance system. In 2012, the Flame malware was found to carry a Microsoft code-signing certificate forged via an MD5 collision — a nation-state attacker had turned an academic result into a weapon. After that, MD5 had no place in any security use, surviving only in non-adversarial roles like checksums.

SHA-1: a twenty-year suspended sentence

SHA-1 outputs 160 bits, with a design strength of about 80 bits of collision security. In 2005, analysis again from Wang’s team cut the theoretical attack cost far below the birthday bound, and NIST started the retirement clock: phased restrictions after 2010, and a ban on digital-signature use from 2013. But between “breakable in theory” and “someone actually computed one” stretched twelve years — in 2017, Google and CWI published SHAttered, the first real SHA-1 colliding pair (two PDFs with different contents), at a cost of roughly 110 GPU-years. Its significance was turning the attack from a paper into an exhibit anyone could download and verify.

The next step came far faster. In 2020, Leurent and Peyrin published a chosen-prefix collision for SHA-1 with an estimated cost in the tens of thousands of dollars — rentable GPU clusters suffice — and demonstrated a practical impact on the PGP web of trust along the way. Within three years the attack went from “only large institutions need apply” to “a line item in a medium-sized project budget”. The slope of that descending curve is exactly why standards bodies insist on retiring early: if you wait until attacks are cheap for everyone before migrating, certificate, signature and archival systems cannot turn around in time.

How collisions are actually made: differential paths (qualitatively)

It is worth a paragraph on the methodology of these attacks, lest “broken” be imagined as brute force. The core of a modern collision attack is differential analysis: rather than searching directly for two inputs with the same hash, the attacker carefully chooses a small difference between two inputs (often just a few bits) and tracks how that difference propagates through the compression function’s rounds — hoping it cancels itself out exactly in the final round so the two internal states reconverge. Much of Wang’s team’s breakthrough lay in systematizing how to construct and correct such differential paths, turning the once-vanishingly-unlikely “the difference cancels itself” into something computable and composable. SHAttered used the industrialized version of the same idea: a near-collision for the first block (shrinking the difference greatly but not to zero), then a second near-collision block to clear the remainder. Understanding this methodology explains why a hash function’s retirement signals always appear first in academic differential-analysis papers — once a differential path is found, the rest is only a question of compute price and time.

The retirement moves of browsers and operating systems are also worth recording: mainstream browsers completed their rejection of SHA-1 certificates around 2017, the very year SHAttered was published — a rare case of industry not waiting for an incident, made possible precisely by NIST’s retirement agenda started a decade earlier and academia’s continuous cost warnings.

Three engineering disciplines this history leaves behind

First, treat theoretical attacks as a countdown, not a comfort. “No practical collision yet” only means no attacker has spent the money yet; it does not mean the algorithm is safe. Second, key retirement decisions to the attack type: for signature and certificate systems, the fatal one is the chosen-prefix collision, which arrives far later than an ordinary collision but is wholly different in destructive power — migration windows must be sized by it. Third, build in algorithm agility: the decade-plus migrations of MD5 and SHA-1 dragged largely because protocols and file formats had hard-coded the algorithm. The “inventory first, keep a replacement interface” mantra repeated across this site has its prototype in this history. As for SHA-256, its analytic margin remains healthy to this day — but the discipline stands: watch the cost curve, not the “has it been broken?” headlines.

One last detail is often misunderstood: a broken collision resistance does not mean every use of the hash fails at once. Preimage resistance is the other leg — preimage attacks on MD5 and SHA-1 still have no practical break, so certain uses that depend only on preimage resistance (HMAC, covered in a companion article in this section) survived for a while after the collision collapse. But that is no argument for continuing to use them: in real systems the boundaries between uses blur easily, and data that was “only checksummed” is promptly relied on as signature evidence. The sound engineering practice is to treat a collision break as a retirement order for the whole function, and to discuss exceptions only in controlled settings with explicit analysis behind them.

Tags: MD5SHA-1Collision Attacks