๐ The Birthday Paradox: Math Behind Collisions
Learn why finding collisions is easier than you thinkโbut still impossibly hard
Your Progress
0 / 5 completed๐ The Birthday Paradox
Here's a counterintuitive fact: In a room of just 23 people, there's a 50% chance that two share the same birthday! This paradox explains why hash collisions are easier to find than you might think.
๐ค The Classic Birthday Problem
Most people assume you'd need 183 people (half of 365 days) for a 50% collision chance. But mathematics tells a different story!
๐ฎ Interactive Birthday Simulator
Adjust the number of people and see how collision probability changes:
๐ข Key Birthday Probabilities
๐ Applying to Hash Functions
The birthday paradox explains why finding hash collisions is easier than brute-forcing a specific hash. Instead of targeting ONE hash, attackers can generate MANY inputs and look for ANY collision.
| Hash Size | Possible Outputs | Collision at ~ | Example |
|---|---|---|---|
| 8 bits | 256 | ~16 | Tiny hash |
| 16 bits | 65K | ~256 | Very weak |
| 32 bits | 4.3B | ~65K | CRC32 |
| 128 bits | 3.4ร10ยณโธ | ~2โถโด | MD5 (broken) |
| 256 bits | 1.2ร10โทโท | ~2ยนยฒโธ | SHA-256 (secure) |
๐ก Key Insights
For n-bit hash, collisions appear after ~2^(n/2) attempts. SHA-256 (256 bits) requires ~2^128 attempts for collision.
Doubling hash size from 128 to 256 bits increases collision resistance from 2^64 to 2^128 - that's 18 quintillion times harder!
With 2^128 attempts needed and billions of hashes per second, finding a SHA-256 collision would take longer than the age of the universe.