Contents
- What are you trying to verify?
- How do SHA-256, SHA-512 and BLAKE3 differ?
- Which algorithm and reference should you choose?
- How do you verify a download on Linux?
- How do you compare a checksum on Windows?
- What should you check when the values differ?
- Which algorithm is fastest on your server?
- What mistakes should you avoid in a repeatable workflow?
- How does CH-J Tools help with checksums?
- Frequently asked questions
What are you trying to verify?
You download a server installation image, copy a backup to another machine or receive an archive from a colleague. The filename and size look right, but neither tells you whether every byte arrived unchanged. A cryptographic checksum, also called a digest or hash, gives you a compact value to compare with a known reference. Calculate it over the complete file after the transfer finishes.
Start with the reference, not with a speed comparison. If the publisher provides SHA-256, calculate SHA-256. A SHA-512 or BLAKE3 result cannot be compared with it, even when both tools read the same file correctly. If you control both ends of a transfer, you can choose the algorithm and record that choice alongside the digest.
For a new workflow spanning Linux and Windows, SHA-256 is a practical default. SHA-512 is also suitable when your existing process uses it. Consider BLAKE3 for your own large datasets when every participant has compatible tooling. The useful result is a reproducible check that people can actually run, with a reference they have reason to trust.
How do SHA-256, SHA-512 and BLAKE3 differ?
SHA-256 and SHA-512 are distinct members of the SHA-2 family specified in NIST FIPS 180-4. SHA-512 is not simply SHA-256 run twice, and truncating its output does not produce SHA-256. BLAKE3 is a separate design with a tree structure that allows parallel processing. Its usual checksum output is 256 bits, although the algorithm supports other output lengths.
- SHA-256 produces 32 bytes, normally displayed as 64 hexadecimal characters. It is widely supported by download publishers and operating system tools.
- SHA-512 produces 64 bytes, normally displayed as 128 hexadecimal characters. Use it when the published manifest or your agreed procedure requires it.
- BLAKE3 normally produces 32 bytes, displayed as 64 hexadecimal characters by b3sum. A 64-character value alone therefore does not identify the algorithm.
For ideal hashes of these lengths, generic collision searches take roughly 2^128 work for a 256-bit digest and 2^256 for a 512-bit digest. A collision means finding any two different inputs with the same digest; matching a particular existing file is a different problem. These figures describe cryptographic strength, not how quickly your disk can be checked. They do not compensate for an untrusted reference.
Which algorithm and reference should you choose?
Before troubleshooting a failed comparison, establish exactly what was hashed. Match the release, CPU architecture, archive format and filename. A compressed archive and its extracted image have different contents and therefore different digests. A checksum for yesterday's build is not a reference for today's replacement, even if the download URL stayed the same.
- For a vendor download, use the vendor's documented algorithm and obtain the manifest through its authenticated distribution channel.
- For internal transfers, agree on one algorithm and output format before copying. Keep the original digest somewhere the receiving copy cannot silently replace.
- For regulated systems, check the applicable policy and the cryptographic implementation requirements. Choosing a SHA-2 name alone does not establish that a deployment is compliant; BLAKE3 is not specified by FIPS 180-4.
An attacker who replaces both a file and its advertised checksum can make the comparison pass. For stronger origin verification, use a signed manifest with a signing key whose fingerprint you have independently verified. A signature from an arbitrary imported key does not establish the publisher's identity.
How do you verify a download on Linux?
The following commands use GNU coreutils, as supplied on Ubuntu, Debian and RHEL systems. Run them as your normal user in the directory containing the finished download. No administrator privileges are needed to hash a readable file. Here image.iso is an example filename; substitute your actual download name and keep paths quoted when they contain spaces.
- Obtain the download and the matching checksum manifest. If a detached signature is offered, obtain it too and first establish which publisher signing key is trusted.
- Inspect the manifest as text to confirm its filenames and algorithm. Treat it as data; do not execute downloaded verification scripts just to calculate a digest.
- Calculate the appropriate digest, or ask the matching sum utility to check a manifest in its supported format.
- Confirm that the intended file reports OK and that the command succeeds. Investigate warnings, missing files and FAILED results before using the download.
sha256sum -- image.iso
sha512sum -- image.isoUse one algorithm to match the reference; running both commands above only illustrates the alternatives. For a GNU-format SHA256SUMS manifest, verification reads the listed paths relative to your current directory. The example below checks a signed manifest only if GPG verification succeeds. It assumes GPG is installed and the correct signing key has already been authenticated.
gpg --verify SHA256SUMS.asc SHA256SUMS && sha256sum --check SHA256SUMSIf the publisher supplies SHA512SUMS, use sha512sum --check SHA512SUMS instead. A manifest covering several downloads may report missing files you did not download; those messages are different from a checksum mismatch. They still require you to check which files actually passed. A typical successful status for the example image is:
image.iso: OKHow do you compare a checksum on Windows?
In Windows PowerShell 5.1 or PowerShell 7, Get-FileHash calculates SHA-256 and SHA-512 without a separate checksum program. Specify the algorithm explicitly so the command remains understandable when copied into a runbook. LiteralPath handles the named path without treating wildcard characters as patterns. These commands read the file and do not require an elevated PowerShell session:
Get-FileHash -LiteralPath 'C:\Users\user\Downloads\image.iso' -Algorithm SHA256
Get-FileHash -LiteralPath 'C:\Users\user\Downloads\image.iso' -Algorithm SHA512To avoid comparing a long value by eye, use the SHA-256 example below. Paste only the complete expected hexadecimal digest from your trusted reference when prompted. The length check catches pasted labels or incomplete values. PowerShell's ordinary string comparison is case-insensitive, so uppercase and lowercase hexadecimal letters compare equally.
$expected = (Read-Host 'Trusted SHA-256 digest').Trim()
if ($expected -notmatch '^[0-9a-fA-F]{64}$') { throw 'Expected 64 hexadecimal characters' }
$actual = (Get-FileHash -LiteralPath 'C:\Users\user\Downloads\image.iso' -Algorithm SHA256 -ErrorAction Stop).Hash
if ($actual -ne $expected) { throw 'Checksum mismatch' }
'Checksum matches'Get-FileHash does not provide BLAKE3 among these built-in algorithms. Use a trusted BLAKE3 tool when that is the published reference. Do not substitute SHA-256 merely because its output has the same length.
What should you check when the values differ?
A mismatch is evidence that the comparison did not verify the intended bytes. It is not, by itself, proof of an attack or of a broken hash algorithm. Work through the ordinary causes before repeating the download or suspecting storage hardware:
- Confirm the algorithm, full digest and exact release. Do not compare only a prefix or mix a SHA-512 reference with a SHA-256 calculation.
- Confirm the actual path and wait for all writers to finish. A browser, synchronization client or backup job may still be changing the file you read.
- Check whether you hashed the archive or its extracted contents. Text transfers that alter line endings also change file bytes.
- Repeat the check against the original trusted reference. If the mismatch persists, obtain a fresh copy under a different filename and compare before replacing anything.
On Linux, compare two stable local files directly when no published reference is involved. The following command is silent when both files match, reports a difference otherwise and returns a nonzero status for differences or errors. It compares bytes rather than stored digest strings:
cmp -- image.iso image-copy.isoDo not install or boot a downloaded image with an unexplained checksum mismatch. Do not regenerate the expected checksum from the suspect copy and then treat that new value as verification.
Which algorithm is fastest on your server?
BLAKE3 can use multiple CPU cores and vector instructions, which can make it attractive for large files. SHA-256 and SHA-512 performance depends on the processor and implementation, including hardware acceleration. There is no useful universal ranking for every workstation, virtual machine and storage device. A slow source disk or network share can hide differences between the algorithms.
On Linux, time each available tool against the same completed large file. b3sum may need separate installation from a trusted source. These are measurement commands, not example benchmark results:
time sha256sum -- large.iso
time sha512sum -- large.iso
time b3sum large.isoRepeat in a different order because the first read may populate the filesystem cache. Compare elapsed time and note whether the file is local or remote and whether other workloads are active. Multiple threads can consume more total CPU time while finishing sooner. Choose based on the real verification workload, then confirm that every receiving system can reproduce the digest.
What mistakes should you avoid in a repeatable workflow?
Keep the distinction between detecting accidental damage and protecting against deliberate substitution. MD5 and SHA-1 have broken collision resistance and are unsuitable choices for new security checks. CRC-32 and xxHash serve different purposes and should not replace a cryptographic digest where an adversary can alter the data.
- Record the algorithm, complete digest, exact filename and release together. Do not identify the algorithm by digest length alone.
- Hash a completed backup or a consistent snapshot. Reading a live database file while it changes does not establish a usable backup.
- For automated verification, check the process exit status and treat unreadable files and malformed manifests as failures. Seeing one OK line is insufficient when other required files failed.
- Preserve the trusted manifest with the release record. If you create a new baseline after a planned change, retain the previous record instead of silently overwriting it.
A content hash does not cover permissions, ownership or whether an application can restore an archive. Include those checks separately in your backup procedure. Two files may have matching contents while their names or filesystem metadata differ. Verify the property you actually need rather than treating a matching digest as approval for every operational use.
How does CH-J Tools help with checksums?
The Hash & Checksum module includes SHA-256, SHA-512 and BLAKE3. It marks these algorithms as recommended and MD5 and SHA-1 as broken. It can calculate digests, compare files and check an expected value.
The module cannot determine whether the expected value is trustworthy; obtain that value from a source you trust. The app verifies its own updates using SHA-512 together with an OpenPGP signature.
Frequently asked questions
Can I convert a SHA-256 checksum into SHA-512 or BLAKE3?
No. Recalculate the required algorithm over the original file. Hashing the printed checksum produces a digest of that text, not the digest of the file.
Does renaming a file change its checksum?
Renaming alone does not change a content checksum. A manifest check can still fail because it looks for the original filename. Update the path used for comparison without changing the trusted digest.
Why does Linux show lowercase hashes while PowerShell shows uppercase?
Hexadecimal letter case does not change the value. Compare all digits using the same algorithm and encoding. Do not remove internal characters or truncate the value to force a match.
Is a matching checksum enough to prove a download is safe?
No. It supports content integrity relative to the reference. Even an authentic signed release may contain vulnerabilities or unwanted behavior; a checksum is not malware analysis or a software review.
Can I use these hashes to store user passwords?
Do not use a plain fast file hash as password storage. Password storage requires a dedicated password hashing scheme with salts and an appropriate cost, such as Argon2id. File verification and password protection have different requirements.