Use a checksum for accidental corruption and a cryptographic hash for stronger integrity checks. In both cases, the expected value must come from a trusted source. A digest is not a signature and does not prove who made the file.
What a checksum is good for
A checksum is a compact value computed from data to detect accidental changes. Simple checksums and CRCs are fast and useful for network frames, storage blocks, and download integrity. They are not designed to resist an attacker who can choose or modify the data.
If a file is truncated during download or a disk block flips, a checksum can reveal the mismatch. That is a useful, narrow property.
What a cryptographic hash adds
A cryptographic hash is designed so that finding a different input with the same digest is computationally difficult. That property makes it useful for integrity checks where an attacker might try to substitute a different file. SHA-256 and SHA-512 are common choices.
The hash still does not tell you who created the file or whether the content is safe. It only gives you a value to compare. If an attacker can replace both the file and the expected digest, the comparison is meaningless.
A practical comparison
| Property | Simple checksum / CRC | Cryptographic hash |
|---|---|---|
| Main purpose | Detect accidental corruption | Detect changes with a stronger adversarial model |
| Resistance to deliberate collisions | Not designed for it | Designed for it, within the algorithm's limits |
| Speed | Very fast | Fast, but slower than a simple checksum |
| Proves authenticity? | No | No, not by itself |
| Needs a trusted reference? | Yes | Yes |
For a casual download, a published SHA-256 value is a reasonable integrity check if you get the value from a trusted channel. For a high-value file, use a signature or an authenticated update mechanism, not just a digest on the same page as the download.
A file-integrity workflow
- Get the expected digest or signature from a trusted source, not from the same untrusted page as the file.
- Compute the digest locally with a tool you trust.
- Compare the full value, not a short prefix.
- If the values differ, stop and re-download from a trusted source.
- If the values match, remember that you have checked integrity, not safety or authorship.
A simple checksum is still useful
A CRC or another simple checksum is cheap to compute and good at catching accidental corruption in a stream or a stored block. It is not obsolete; it is just aimed at a different threat. Use it where the risk is a flipped bit or a truncated transfer, not a deliberate substitution. The mistake is treating a checksum as an authenticity control.
A small check
In November 2026, the Signal Bench SHA-2 tool and OpenSSL both produced the same SHA-256 digest for the text Signal Bench. The matching value shows that the implementations agree for that input. It does not show that a file with that digest is trustworthy; the expected value still has to come from somewhere you trust.
Common mistakes
- Publishing the digest next to the download on the same server and calling it authenticity.
- Comparing only the first few characters of a digest.
- Using a checksum to defend against a deliberate substitution.
- Assuming a matching hash means the file is malware-free.
- Hashing a text representation when the file's raw bytes are what matter.
Limits
Checksums and hashes are integrity tools, not trust systems. Use signatures, authenticated channels, and trusted distribution for high-value files. If you are building a system, follow the protocol's rules for canonicalization, encoding, and comparison.
Common questions
Is SHA-256 a checksum?
It is a cryptographic hash, which can be used as an integrity checksum. It is stronger than a simple CRC against deliberate changes, but it still needs a trusted expected value.
Does a matching hash mean the file is safe?
No. It means the bytes match the expected value. It does not prove authorship or that the content is free of malware.
Should I compare the whole hash?
Yes. Compare the full value from a trusted source; a short prefix is easier to forge or misread.