Skip to content
cybersecurity cryptography

Checksum

checksum hashing integrity sha-256 cryptography file-verification
Plain English

A checksum is like a fingerprint for a file. Run any file through a checksum algorithm and it produces a unique string of characters. If even a single byte in the file changes, that fingerprint changes completely. Two identical copies of a file always produce the exact same fingerprint, no matter where they are in the world. This lets you confirm a download arrived exactly as the publisher intended.

Technical Definition

A checksum is the output of a cryptographic hash function applied to a block of data. Hash functions are one-way mathematical operations with three critical properties:

Deterministic: the same input always produces the same output, on any machine, anywhere.

Avalanche effect: a single-bit change in the input produces a completely different output. There is no gradual drift; the change is total and unpredictable.

Preimage resistance: given the hash output, it is computationally infeasible to reconstruct the original input.

Collision resistance: it is computationally infeasible to find two different inputs that produce the same hash output.

Common algorithms:

AlgorithmOutput sizeStatusUse
MD5128-bit (32 hex chars)BrokenLegacy only; do not use for security
SHA-1160-bit (40 hex chars)BrokenDeprecated; collision demonstrated
SHA-256256-bit (64 hex chars)CurrentStandard for download verification
SHA-512512-bit (128 hex chars)CurrentHigher assurance, larger output
SHA-3VariableCurrentNIST standard; Keccak construction

SHA-256 and SHA-512 are both members of the SHA-2 family, designed by the NSA and standardized by NIST. They are the current defaults for download verification.

Checksums verify integrity, not authenticity. A matching checksum proves the file was not corrupted in transit. It does not prove the file came from the expected publisher. If an attacker compromises the server hosting both the file and the checksum, they can replace both. GPG signatures address the authenticity gap.

original.iso4.2 GB, unmodifiedSHA-256a435f6f3...b3742bc0Matches published hashoriginal.iso (1 byte changed)4.2 GB, tamperedSHA-256c8f02b71...9d4ae031Does not matchOne byte changed. Completely different hash. That is the avalanche effect.

Computing and verifying checksums

# Compute the SHA-256 hash of a downloaded file
sha256sum ubuntu-24.04-desktop-amd64.iso
# a435f6f393dda581172490eba797417a...  ubuntu-24.04-desktop-amd64.iso

# Compute SHA-512 instead
sha512sum ubuntu-24.04-desktop-amd64.iso

# Verify against a published checksum file (Linux)
# The file SHA256SUMS contains: <hash>  <filename>
sha256sum -c SHA256SUMS --ignore-missing
# ubuntu-24.04-desktop-amd64.iso: OK

# Windows PowerShell equivalent
Get-FileHash .\ubuntu-24.04-desktop-amd64.iso -Algorithm SHA256

# macOS uses shasum with -a flag for algorithm selection
shasum -a 256 ubuntu-24.04-desktop-amd64.iso
In the Wild

Every major Linux distribution publishes SHA-256 (and often SHA-512) checksums alongside their ISO releases. Ubuntu posts a SHA256SUMS file at releases.ubuntu.com; Kali Linux, Fedora, and Debian all follow the same pattern. Security tools like Wireshark, VirtualBox, and OpenWRT firmware images do the same. The workflow is always: download the file from any source, download the checksum from the official site, run sha256sum -c or Get-FileHash, and only proceed if the hashes match. A mismatch means either a corrupted download (re-download) or a tampered file (report it and do not use it). For software that will be deployed to production systems or burned to install media, skipping checksum verification is the kind of shortcut that shows up in post-incident reports.