You download an installer and find a SHA-256 string next to the download button. Your local hash matches. What have you learned?
You have evidence that your file matches the bytes represented by that digest, assuming a correct calculation. You have not independently established who published the file if an attacker could replace both the installer and the digest on the same page. A checksum needs a trusted reference to support a publisher decision. NIST FIPS 180-4 — Secure Hash Standard
Calculate without running the download
For a file named package.zip, OpenSSL provides a portable example:
openssl dgst -sha256 package.zip
On PowerShell, the corresponding built-in operation is:
Get-FileHash -Algorithm SHA256 -LiteralPath .\package.zip
Compare the digest value, not the filename printed beside it. Check that the release page specifies SHA-256, the same version, the same operating system and the same architecture. A Linux archive and a Windows installer should not be expected to share a hash.
For a visual explanation of what a digest can and cannot establish, PKI Channel’s hash guide (Japanese) separates data comparison from the trustworthiness of the reference value.
A mismatch is a stop signal, not a diagnosis
Possible explanations include an incomplete download, the wrong release asset, a changed file or malicious replacement. The mismatch alone does not tell you which explanation is true.
Write down the expected value, observed value, release version and source URL. Revisit the publisher's official release instructions. Do not “repair” the test by editing the expected digest to match the file you already have.
| Observation | Reasonable conclusion | Unsupported conclusion |
|---|---|---|
| Hash differs | The bytes do not match this reference | An attacker definitely changed it |
| Hash matches a trusted release record | The bytes match that record | The software has no vulnerabilities |
| Hash matches an unknown mirror's record | File and mirror record agree | The publisher approved the file |
Where signatures add value
A digital signature lets a verifier check data using a public key associated with the signer. The remaining question is how that public key became trusted. Fetching a key from the same untrusted message as the signature does not settle the publisher's identity. NIST FIPS 186-5 — Digital Signature Standard
Different ecosystems use different signature formats and trust distribution. Follow the publisher's documented verifier instead of copying an OpenSSL command for an unrelated format. A detached signature, a signed package and an operating-system code signature are not interchangeable files.
The code-signature verification guide (Japanese) explains the additional publisher and integrity checks, along with their limits. It helps answer what a signature adds after the checksum comparison.
A small local observation
In the accompanying local exercise, a signature verified for the bytes release=1 followed by a newline. Changing the digit to 2 produced an InvalidSignature result. The two SHA-256 values also differed. This demonstrates sensitivity to a byte change, not the identity or safety of a real publisher. The observation was recorded on 2026-10-30 using Python 3.12.14 and cryptography 50.0.2 in an offline local exercise; it was not a test of a real publisher.
For a team, keep the original release metadata with the downloaded artifact, including the approved source and verification method. That record turns “I checked the hash” into a statement another person can actually evaluate.
Top comments (0)