Loading CryptoViz...
Loading page content...Loading CryptoViz...
Loading page content...Attack Simulator
Witness the power of the birthday paradox. Instead of searching for a specific target hash, a birthday attack searches for any two random outputs that match. Learn why collision resistance is mathematically much easier to break than standard brute force preimage resistance.
Collision Paradox
In a group of 23 people, there is a 50.7% chance that at least two share a birthday, despite 365 possible dates. In cryptography, this means finding collisions requires exponentially fewer attempts than guessing a key.
Reduce the output size of the hash space to observe the paradox dynamically.
256
Possible outputs ($2^8$)19
Expected inputs for collisionMapping all 256 possible hash outputs in a 16x16 grid. Cells turn teal when visited. Multiple hits (collisions) flash rose/gold.
The paradox reveals that counter-intuitive probabilities arise when looking for matches among ANY members of a set rather than matching a single PRE-SPECIFIED member. For collision searches, we compare every generated output with every other generated output.
Brute forcing a *specific* hash output (preimage resistance) has a complexity of O(2^n). Finding *any* collision (collision resistance) has a complexity of only O(2^(n/2)). Thus, a 256-bit hash function only provides 128 bits of security against collisions.
Because birthday attacks cut cryptographic security in half, hashes must have much larger output sizes than symmetric block keys. A symmetric key of 128 bits is secure, but a hash function must output at least 256 bits (like SHA-256) to resist collision searches.