Hashing Haus, Maus, and Laus with SHA-1 produces three completely different outputs, even though the inputs differ by a single letter. What property does this demonstrate?
The avalanche effect — a 1-bit change in input flips ~50% of output bits, making outputs look statistically unrelated.
* One input bit changed flips roughly half the hash output bits. — Davidgothberg, Public domain, via Wikimedia Commons. *
The example:
Haus → 22b78e2d5c887ec315104ccbe9430c30ceeb82a3
Maus → a47deac51013521af07aa030cfa3e8e504192996
Laus → 26aff90edc2ce45c123b7bf55d215f0bbf9e5971
Note that Haus and Maus differ in only ONE character — but the hashes share essentially zero structure.
Why this matters for security:
- An attacker can't tell if their guess is "close" —
Haus,Maus,Hauzall produce wildly different hashes, so there's no gradient to follow - This is what makes hashing fundamentally different from encryption — there's no way to "decode" partially
Why this matters for integrity:
- Hashes are used to detect file tampering — change 1 byte of a file, the hash changes completely
- Git, checksums, blockchain — all rely on this property
Tip: This is the cryptographic sense of avalanche. Bad hash functions (like a simple checksum) lack it — you can craft collisions easily. Cryptographic hashes (SHA-2, SHA-3) are designed so even quantum-level analysis can't predict the output structure.
Go deeper:
Avalanche effect (Wikipedia) — flipping one input bit flips ~half the output bits, with a SHA-1 example.