Concepts / Cryptography at work

Cryptography at work

Cryptographic hash

Also called message digest, file fingerprint, avalanche effect

A one-way function that turns any data into a short fixed-size fingerprint, so the same bytes always give the same digest and no one can find two inputs that share one.

Any input, one fixed-size fingerprint
Any input, one fixed-size fingerprint

The digest is always the same length, one changed letter gives a digest that looks unrelated, and there is no way back from a digest to its input.

A cryptographic hash turns any data into a fixed-size digest: SHA-256 always gives 64 hex characters. The same bytes always give the same digest, one changed bit gives an unrelated one, and it cannot be run backwards. No one can find two inputs that share a SHA-256 digest; for MD5 and SHA-1 they can, so avoid those. A digest alone proves a match, not who published it: see [[integrity-vs-authenticity]].

See it on real machines

Read next

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab