← Back

MD5 Collision Demo

When different files produce the same hash

⚠️ MD5 is Cryptographically Broken

MD5 collisions can be generated in seconds on a laptop. Never use MD5 for security purposes. Use SHA-256 or SHA-3 for cryptographic hashing.

Famous Collision Example

Two different files, same MD5 hash - first published by Wang et al. (2004)

📄 File A

d131dd02c5e6eec4693d9a0698aff95c 2fcab58712467eab4004583eb8fb7f89 55ad340609f4b30283e488832571415a 085125e8f7cdc99fd91dbdf280373c5b d8823e3156348f5bae6dacd436c919c6 dd53e2b487da03fd02396306d248cda0 e99f33420f577ee8ce54b67080a80d1e c69821bcb6a8839396f9652b6ff72a70
79054025255fb1a26e4bc422aef54eb4

📄 File B

d131dd02c5e6eec4693d9a0698aff95c 2fcab50712467eab4004583eb8fb7f89 55ad340609f4b30283e4888325f1415a 085125e8f7cdc99fd91dbd7280373c5b d8823e3156348f5bae6dacd436c919c6 dd53e23487da03fd02396306d248cda0 e99f33420f577ee8ce54b67080280d1e c69821bcb6a8839396f965ab6ff72a70
79054025255fb1a26e4bc422aef54eb4

⚡ COLLISION!

Different input data → Same hash output

79054025255fb1a26e4bc422aef54eb4

MD5 Collision Timeline

1996 Dobbertin finds collision in MD5 compression function
2004 Wang et al. find practical collision in under an hour
2006 Collisions generated in minutes on a laptop
2008 Fake SSL certificate created using MD5 collision
2012 Flame malware uses MD5 collision to fake Microsoft signature

❌ MD5 (Broken)

Output Size 128 bits
Collision Resistance BROKEN
Collision Time Seconds
Use Cases Checksums only

✓ SHA-256 (Secure)

Output Size 256 bits
Collision Resistance 2^128 ops
Collision Time Heat death of universe
Use Cases All cryptographic

Why Collisions Matter

Digital Signatures: If you can create a collision, you can make two documents with the same signature - one innocent, one malicious.

Certificate Attacks: Attackers created fake CA certificates by generating collisions with real certificates.

Integrity Checks: Malware can be hidden in files that have the same hash as legitimate files.

Solution: Always use SHA-256, SHA-3, or BLAKE3 for security-sensitive hashing.