Concepts / Cryptography at work

Cryptography at work

Integrity versus authenticity

Also called tamper detection, trusted channel, self-published checksum

Integrity asks whether the bytes match a digest you trust; authenticity asks whether they came from who you think — a bare hash gives the first, a keyed hash or signature the second.

A checksum beside the file proves little
A checksum beside the file proves little

Whoever can swap the file can rewrite the checksum next to it, and the check still says OK. A signature fails instead, because the attacker does not hold the signing key.

Integrity means the bytes match a digest; authenticity means they came from who you think. A [[cryptographic-hash|hash]] published beside a file gives only integrity: an attacker who can swap the file rewrites the checksum too, and sha256sum -c prints OK. Authenticity needs a key the attacker lacks: a signed sums file (SHA256SUMS.gpg) checked with a public key fetched over another channel, or a [[message-authentication-code|keyed hash]] between parties sharing a secret.

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