How many strangers do you need in a room before two of them share a birthday? Most people guess somewhere around 183 — half of 365. The real answer is just 23. That gap between intuition and reality is called the birthday paradox, and it is the most important piece of probability theory in all of cryptography.
A cryptographic hash function maps any input — a file, a password, a message — to a short, fixed-length fingerprint called a digest. If two different inputs produce the same digest, we call that a collision. Good hash functions make collisions hard to find on purpose: their security guarantee is that finding one should take as long as brute-forcing a safe.
The birthday attack turns that guarantee upside down. Instead of hunting for a specific output, it collects random inputs and watches for any two that match. The mathematics of random collisions means the attack succeeds far sooner than designers expect — in roughly tries, not the full output space. For a 128-bit hash that means operations, not . For the once-ubiquitous MD5, with 128-bit output, that is catastrophically broken territory.
The attack is a proven lower bound on achievable security: no hash function with n-bit output can ever offer more than n/2 bits of collision resistance, regardless of how cleverly it is designed. It is not a flaw to be patched — it is arithmetic.
Comments
Loading comments...