Hash

All five algorithms at once, over text or a file, so you can see the lengths side by side and check a download against the hash somebody published. Two of these five are broken, and the page says which and why.

Input

Digests

Check against a published hash

Paste a hash and this says which algorithm produced it, and whether it matches.

What this is actually doing

A hash takes any amount of input and produces a fixed-size output. The same input always gives the same output, a tiny change gives a completely different output, and you cannot go backwards from the output to the input. That last property is what makes it useful for storing passwords and for checking that a file arrived intact.

Length is the quickest way to tell which algorithm produced a digest you are looking at. MD5 is 32 hexadecimal characters, SHA-1 is 40, SHA-256 is 64, SHA-384 is 96 and SHA-512 is 128. That is why a "hash" you find in the wild is usually identifiable on sight.

MD5 and SHA-1 are both in this tool and both marked broken, which is not a contradiction. They are broken for collision resistance, meaning somebody can construct two different inputs with the same digest, which is fatal for signatures and certificates. They are still perfectly good at detecting an accidental corruption, which is what an MD5 checksum on an old download page was always for. The line to hold is this: never use either of them for anything new, and never trust either of them to prove that a file is what it claims to be when somebody has a reason to lie.

One thing a hash does not do is prove where something came from. If an attacker can change the file, they can change the published hash on the same page. That is the problem signatures solve, and it is why a download page over plain HTTP telling you a SHA-256 value is not actually telling you very much.

Build it yourself

The same thing with sha256sum, openssl dgst and a comparison that fails loudly, plus what a checksum file is and how to verify one you were sent.

Read the lesson

Other utilities

Random passwords and Diceware passphrases, with an honest entropy figure.

Base64, Base64URL, hex, URL, ROT13, HTML entities and binary.

Read a token, check its claims, and actually verify the signature.

Octal and symbolic file permissions, including the special bits.

CIDR to network, broadcast, host range and host count, for v4 and v6.