A Hash Is a Fingerprint
A hash turns any message into a short fixed-size fingerprint. Measure SHA-256, watch one letter change it, see how it pads a message and how a truncated toy collides, and learn what a hash does not promise. Everything is computed in the page.
The Digest
What a SHA-256 digest is: its bytes, its reaction to a changed letter, its fixed length and the padding of the last block.
- Digest of abc
one message, one 32-byte digest
- One Letter Changes Everything
a one-letter change gives an unrelated digest
- Length Never Changes
the digest length belongs to the function
- Padding Fills the Block
the message is padded to whole blocks
What It Promises
What a hash does and does not promise: collisions in a toy, extension of a plain hash, a different construction, and no key and no secrecy.
- Collisions in a Toy Hash
a short fingerprint repeats soon
- Length Extension on a Toy
continue a plain hash without knowing the key
- SHA-3 Is Built Differently
another 32-byte hash and a variable-length one
- A Hash Is Not a Key
guess, hash, compare