Skip to content

Hash properties

The five properties that make a function a cryptographic hash, demonstrated by an input you can type into.

Output

Deterministic

The same input always yields the same hash. Edit a single character and recompute: same input, same output, every time.

Fixed-length output

SHA-256 emits 256 bits whether you feed it one byte or one gigabyte. Switch algorithms and the output length changes; the input doesn't.

Avalanche

Flip one bit of the input (say, swap a single character) and roughly half the output bits flip too. There's no "close."

One-way

Given the output, there's no way to recover the input short of guessing every possible one. That's why password databases store hashes, not passwords.

Collision-resistant

Finding two different inputs with the same hash should be computationally infeasible. The broken algorithms in this lab failed exactly that property.

Read the deep dive on guptadeepak.com