Hash Functions in Depth
Fingerprints for data: properties, lengths, collisions, and which hashes are broken.
Hashes verify downloads, store passwords, sign certificates, and identify malware. Know which ones to trust.
1
Properties
A cryptographic hash turns any input into a fixed-length digest:
- Deterministic: same input, same hash.
- One-way: you can't compute the input from the hash.
- Collision-resistant: it should be infeasible to find two inputs with the same hash (a collision).
- Avalanche: changing one bit changes about half the output.
$ echo -n "makoo" | sha256sumOn Linux,
sha256sum file.isoverifies a download against the published hash.2
Lengths and broken hashes
Hash Bits Hex characters Status MD5 128 32 broken (collisions in seconds) SHA-1 160 40 broken (collision shown in 2017) SHA-256 256 64 secure The length of a hex hash is a quick way to guess the algorithm. MD5 and SHA-1 are still fine for non-security checksums, but never for signatures or passwords.
โ Report a problem with this room
Log in to report a problem.