What Is the Avalanche Effect?
In a secure hash function, changing even one input bit should alter roughly half of the output bits. This sensitivity is called the avalanche effect and helps thwart attackers by hiding patterns.
SHA-256 in Brief
- Outputs a 256-bit (32-byte) digest.
- Built on 64 rounds of bitwise operations and modular additions.
- Collision- and pre-image-resistant (for now).
Interactive Demo
- Enter two messages. The second defaults to the first with one character tweaked.
- The hashes update live. The coloured bar highlights differing bytes.
- Notice how the difference ratio hovers near 50 % regardless of input size.
Hashing is performed with the native crypto.subtle.digest
API. Visualisation code lives in games/js/demos.js
.