avalanche effect

The property of a good hash function or cipher that changing a single input bit changes about half of the output bits, in an unpredictable way.

In more detail

Because similar inputs give unrelated outputs, a digest reveals nothing about how close a guess is to the real input, and a tiny edit is as obvious as a large one. In the course demonstration, changing one character of a payment line flipped 131 of the 256 bits of its SHA-256 digest.

Examples

differ = bin(int.from_bytes(da) ^ int.from_bytes(db)).count("1")
131 of 256 bits differ

Related terms

Taught in

References