The useful part, up front

What you’ll take away

  • A plain SHA-256 match establishes consistency with an expected digest; authenticate the reference separately when publisher provenance matters.
  • Hash the exact artifact using the named algorithm and compare the complete digest.
  • Identical bytes under another filename keep their digest, while the demonstrated LF-to-CRLF change produces a different digest.
  • An archive and its extracted members have different hashing boundaries, even when their payloads agree.
  • Record signature trust, file-match results, and tool errors separately so “verified” has a precise meaning.
01

A matching number answers only part of the download question

You download a file, calculate its SHA-256 checksum, and find that it matches the number beside the download link. That is useful evidence: the bytes you checked are consistent with that reference value. But it leaves another question open: who supplied the reference, and why should you trust it? A plain checksum does not contain a publisher’s identity or a signature. GnuPG’s download guidance explains the weakness of obtaining a file and its checksum through a source that could change both. Ubuntu’s verification tutorial separates checking a signed checksum file from comparing the downloaded image with the checksum. Those are two connected checks, not one. [3][4]

This distinction is useful for software downloads, shared archives, and files copied between storage locations. Sometimes the goal is simply to detect an incomplete copy. Sometimes it is to establish that the file agrees with a particular publisher’s release. The required reference evidence differs. We will follow both questions and use a small local experiment with invented text and ZIP files to show exactly what changes a file digest. No software release is being certified by that experiment. The central habit is to keep the measured byte comparison and the reason for trusting its expected value together in the record.

A file checksum answers a byte-comparison question. The meaning of a match depends on the expected value and the artifact boundary. A plain digest contains no publisher signature.
The meaning of a match depends on the expected value and the artifact boundary. A plain digest contains no publisher signature. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
02

SHA-256 summarizes bytes, not a filename or a promise

SHA-256 produces a 256-bit digest. Written in the usual hexadecimal form, that is 64 characters, because each hexadecimal character represents four bits. GNU’s SHA-2 documentation identifies the 256-bit output, and Microsoft’s Get-FileHash documentation explains that the calculation concerns file contents rather than the file’s name or extension. A file called invoice.pdf can therefore be renamed without changing its content hash. Conversely, keeping a familiar filename does not preserve the content that was originally inside it. The name helps you select a file; the digest is calculated from the bytes you actually read. [1][2]

A cryptographic hash is designed to make it computationally infeasible to find different inputs with the same digest. That is a practical security property, not a mathematical promise that every possible file has a unique number. There are more possible files than fixed-length digest values, so collisions must exist in principle. For ordinary SHA-256 verification, a full match is strong evidence of agreement with the expected bytes, provided the reference and calculation are trustworthy. It still does not tell you whether the file is useful, safe to run, or published by the person whose name appears next to the download. [1][2][3]

03

The same visible word can have different file bytes

The local example starts with the five ASCII letters orbit followed by a line feed. Its six bytes, written in hexadecimal, are 6f 72 62 69 74 0a. A second file contains the same letters followed by carriage return and line feed: 6f 72 62 69 74 0d 0a, seven bytes. A third file has a different filename but exactly the same six bytes as the first. We calculated SHA-256 for all three. The first and third matched; the seven-byte file differed. These are actual calculations on deliberately tiny example files, with the complete inputs specified here.

The result explains why looking at the word in a text editor can miss a relevant difference. The editor may display both endings as a new line, but the hash reads different byte sequences. Meanwhile, a filename change alone does not enter the content digest, consistent with Microsoft’s documentation. If a downloaded text file has been resaved, transformed, or copied through a tool that changes its bytes, compare the resulting artifact with the appropriate reference. A checksum for the original downloaded bytes is not automatically a reference for an edited or transformed version, even when the text appears unchanged. [1]

Actual local example: bytes and names affect different things. SHA-256 was computed on these complete invented inputs. A and C match; B differs. Hexadecimal pairs describe input bytes.
SHA-256 was computed on these complete invented inputs. A and C match; B differs. Hexadecimal pairs describe input bytes. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
04

Match the algorithm and the exact release artifact first

A release page may list several downloads: different operating systems, processor types, packaging formats, or versions. Choose the checksum entry for the exact artifact you intended to download. Ubuntu’s tutorial makes this concrete with a SHA256SUMS file containing entries for available images and a separate signature for that file. Selecting a checksum from the wrong release creates a mismatch even if both downloads are legitimate. Keep the filename, release identity, algorithm, and expected digest together rather than copying a number away from the context that explains what it describes. [1][4]

Compare the complete digest using the named algorithm. The first few characters are only a prefix, not a substitute for the full SHA-256 value. Uppercase and lowercase hexadecimal letters represent the same digits, but a different algorithm is not a different spelling of the same calculation. Microsoft’s tool can calculate several algorithms and reports which one it used, while GNU provides separate SHA-2 utilities for different digest lengths. A screenshot showing only part of a hash or omitting the algorithm leaves a weaker verification record. File size is useful context too, but equal size does not establish equal contents. [1][2]

05

A mismatch is a finding, not yet an explanation

When the correctly selected SHA-256 values differ, the file does not pass that comparison. Check the straightforward causes before assigning a story: the wrong release entry, an incomplete download, a file changed after downloading, or a transformation such as the line-ending change in our example. Ubuntu lists alteration and incorrect downloading among reasons an image can fail its checksum comparison. The digest does not distinguish those causes by itself. It also does not tell you how many bytes differ or where they are. It answers whether the computed value agrees with the expected one. [1][4]

Keep the actual values and artifact details so the mismatch can be investigated. If the file is meant to be installed or executed, resolve the failed comparison before treating it as the verified release. A fresh copy obtained through the publisher’s established distribution route can help check whether the earlier copy was incomplete, but changing the expected value just to match the file proves nothing about the intended release. A missing file, unreadable path, or tool error is a different result again: the check may not have completed at all. Successful verification requires a successful computation and the intended comparison, not merely the absence of a visible complaint. [1][4]

06

A replacement reference can make a replacement file match

Imagine that the intended release is file A and its published checksum is H(A). Someone changes the download to file B and also replaces the displayed checksum with H(B). Your calculator can work perfectly and report a match for B. No special weakness in SHA-256 is required: the replacement reference describes the replacement bytes. GnuPG’s integrity page warns about this same dependence when the download and the displayed checksum can both be modified. The problem is the authority of the expected value, not a failure to calculate it correctly. [3]

For a simple copy check, you might already possess a trusted original and calculate its digest before moving it. For a software release, you need a reference connected to the publisher’s established distribution process. A signed checksum manifest is one method, provided you verify it using the correct authenticated signing key. Ubuntu demonstrates that two-stage arrangement. The label “official checksum” written on an arbitrary page cannot supply the missing connection by itself. Ask where the expected value came from and what evidence makes it the right reference for this particular release. [3][4]

A correct match can still use the wrong authority. Conceptual replacement example. Publishing B with its ordinary digest H(B) requires no collision with the intended A.
Conceptual replacement example. Publishing B with its ordinary digest H(B) requires no collision with the intended A. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
07

A signature needs the right key, not just a reassuring label

A signed manifest adds another object to check. In Ubuntu’s example, SHA256SUMS contains image checksums and SHA256SUMS.gpg supplies the signature for that checksum file. The verifier checks the signature, then the image is compared with the appropriate entry. This lets the download’s byte check depend on an authenticated statement about the expected bytes. The workflow still needs the correct signing key and the correct release entry. A file bearing the expected signature filename is not enough; its signature must actually verify under the intended key. [3][4]

GnuPG distinguishes a valid signature from confidence that the key belongs to the intended signer. Its guidance explains why a “Good signature” message can appear alongside a warning that the key’s identity has not been established, and recommends comparing fingerprints through trusted evidence. Do not replace that step with a familiar-looking name attached to a key. Use the publisher’s current verification instructions and an already trusted verification tool; the historical key identifiers shown in tutorials are examples, not instructions to trust those identifiers forever. A correctly authenticated signature supports provenance, while the separate digest comparison checks the selected downloaded artifact. [3][4]

08

An archive hash and its extracted-file hash cover different bytes

The second local experiment created two ZIP archives. Each contained one member called note.txt with the same six bytes used earlier: orbit followed by a line feed. Both archives were 120 bytes long and used stored, uncompressed content. The first recorded an entry timestamp of 1 January 2000; the second recorded 2 January 2000. Their outer SHA-256 values differed. Reading note.txt from each archive produced identical bytes and matching payload digests. Python’s ZIP documentation identifies member timestamps as archive metadata and provides separate operations for writing an archive and reading a member’s bytes. [5]

This shows why two archives can carry the same text without being the same downloadable file. Their metadata belongs to the archive’s byte sequence. Renaming the outer archive on disk leaves that sequence alone, while rebuilding the archive or changing information stored inside it can change the sequence. If a publisher supplies a checksum for the ZIP download, hash that ZIP. Hashing only an extracted member answers a narrower question about that member. Likewise, a checksum for an unpacked file is not interchangeable with a checksum for its containing archive, even when both values were calculated correctly. [1][5]

Same extracted text, different ZIP containers. Actual constructed ZIP_STORED example. Both archives are 120 bytes; only the chosen entry timestamp was deliberately changed.
Actual constructed ZIP_STORED example. Both archives are 120 bytes; only the chosen entry timestamp was deliberately changed. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
09

Use the tool’s result, including errors and the named file

For a local file in PowerShell, an explicit example is Get-FileHash -LiteralPath './download.bin' -Algorithm SHA256. Replace that example path with the intended file. Microsoft documents LiteralPath as using the supplied path without wildcard interpretation, and the returned object includes the algorithm, hash, and path. GNU’s sha256sum download.bin similarly calculates the SHA-256 digest for the named file. These examples read and hash files; a downloaded executable does not need to be run to calculate its checksum. Compare the result with the complete expected value for that artifact. [1][2]

When checking a compatible manifest with GNU’s sha256sum --check SHA256SUMS, read the named-file results and any errors. The documented common options distinguish successful matches, mismatches, unreadable files, and invalid input. A quiet mode can suppress successful messages, while other options affect which missing files are reported, so silence alone is not a reliable interpretation. An automated workflow should use the documented completion status and ensure the intended artifact was actually included. A copied “OK” line for a different file does not verify the file you planned to use. [2][6]

10

Make the final conclusion as specific as the evidence

A useful verification record answers five questions: which artifact was checked, which algorithm was used, where the expected value came from, whether that reference was authenticated as needed, and whether the complete comparison succeeded. If a signature was involved, keep its outcome and the basis for trusting the signing key separate from the file’s checksum result. If only one member of an archive was hashed, say so. These details make “verified” understandable to someone who did not watch the check happen, and they make a later mismatch easier to investigate. [1][3][4][6]

Then keep the conclusion at that boundary. A match against a trusted release reference supports that the checked bytes agree with that release. It does not review the program’s behavior, establish that the release is the newest one, or promise that the file will remain unchanged afterward. Our small experiments show why the byte boundary matters: an external filename can change without changing the digest, a line ending can change it, and archive metadata can change the outer digest while preserving an inner file. The value of the checksum comes from combining that precise comparison with the right reference, not from the impressive length of the number. [1][3][4][5]

Five fields make a verification record meaningful. Record the exact completed check. File consistency, reference authentication and software behavior are separate questions.
Record the exact completed check. File consistency, reference authentication and software behavior are separate questions. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
Follow the evidence

Sources & further reading

Explore the references behind this guide. External pages may change after our review.

  1. Get-FileHash (Microsoft.PowerShell.Utility) - PowerShell | Microsoft Learn
    Microsoft · Accessed 6 Nov 2026
  2. sha2 utilities (GNU Coreutils 9.12)
    GNU Project · Accessed 6 Nov 2026
  3. GnuPG - Integrity Check
    GnuPG · Accessed 6 Nov 2026
  4. How to verify your Ubuntu download | Ubuntu
    Canonical · Accessed 6 Nov 2026
  5. zipfile — Work with ZIP archives — Python 3.15.2 documentation
    Python Software Foundation · Accessed 6 Nov 2026
  6. cksum common options (GNU Coreutils 9.12)
    GNU Project · Accessed 6 Nov 2026

Article updated 6 Nov 2026.

Found something we should revisit?

Good explanations get better with thoughtful feedback.

Suggest a correction