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.

  1. Digest of abc

    one message, one 32-byte digest

  2. One Letter Changes Everything

    a one-letter change gives an unrelated digest

  3. Length Never Changes

    the digest length belongs to the function

  4. 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.

  1. Collisions in a Toy Hash

    a short fingerprint repeats soon

  2. Length Extension on a Toy

    continue a plain hash without knowing the key

  3. SHA-3 Is Built Differently

    another 32-byte hash and a variable-length one

  4. A Hash Is Not a Key

    guess, hash, compare