top of page

What is Checksum?

Oct 23
11 min read
What is Checksum?

 

A checksum is a calculated value used to help detect changes in a defined set of data. Software calculates it from the original bytes, then calculates or checks it again when the data is received, read or compared. A disagreement shows that the inputs, calculation settings or expected value do not agree. A match provides evidence of agreement, with limits determined by the algorithm and the trustworthiness of the reference.

 

Checksums appear in network packets, downloaded software, archives and storage systems. The word is also used broadly for file-verification values produced by cryptographic hashes such as SHA-256. The important questions are which algorithm is being used, which bytes it covers and where the expected result came from.

 

The Techie Broadband terminology guide connects checksums with networking and storage. The infographic introduces calculation and comparison; the examples below explain why a matching value is useful evidence without being a guarantee of safety.

 

Checksum infographic showing exact input, named algorithm, trusted comparison, matching and mismatching results, and the limits of checksum verification

 

How does a checksum work?

 

A calculation reduces the selected input to a value that can be stored or transmitted alongside it. The receiver or verifier applies the specified calculation to the relevant data and checks whether the result is acceptable. For a downloaded file, this commonly means comparing a newly calculated digest with a publisher's expected digest.

 

Some network protocols verify the combination of the data and its included checksum rather than simply comparing two printed numbers. The mechanism is defined by the protocol. There is no single universal checksum formula.

 

Calculation

Output size

Typical purpose

Important limit

Simple byte sum used in the example below

8 bits

Teaching how a weak checksum behaves

Reordering bytes can leave the sum unchanged

Internet checksum

16 bits

Error detection in specified network protocols

Not cryptographic authentication

CRC32

32 bits

Error detection in formats and protocols using that CRC variant

Not designed to establish a trustworthy sender

SHA-256

256 bits

Cryptographic content comparison and other security constructions

Requires a trustworthy expected value for the intended task

 

The output width does not specify the complete algorithm. Two checks with the same number of bits can calculate different results. CRC variants can use different polynomials and settings; CRC32 and CRC32C are not interchangeable merely because both produce 32-bit values.

 

Internet checksums and CRCs use different calculations

 

The traditional Internet checksum groups bytes into 16-bit words, adds them using one's-complement arithmetic and complements the result. Overflow is folded back through an end-around carry. RFC 1071 explains this calculation; it is an informational implementation document, rather than a claim that every checksum works this way.

 

A cyclic redundancy check, or CRC, uses a polynomial-based calculation over the bit pattern. Its error-detection properties depend on the chosen CRC and the data being protected. It is more useful to identify the exact algorithm than to describe every checksum as simply adding numbers together.

 

A worked checksum example: detecting and missing changes

 

Techie Broadband tested three two-byte inputs using Python 3.12.14. Each contains exactly the displayed ASCII characters, with no newline. For the deliberately weak teaching checksum, add the byte values and keep the remainder after division by 256. This example is not the Internet checksum and is not a CRC.

 

Input

Decimal byte values

Teaching checksum

CRC32 from Python zlib, hexadecimal

AB

65, 66

131

30694c07

BA

66, 65

131

824d4e7e

AC

65, 67

132

476e7c91

 

Changing AB to AC changes both calculated values. Changing AB to BA leaves the teaching checksum at 131, even though the bytes are in a different order. That change would escape a comparison using only this checksum. Different inputs producing the same result are a collision.

 

The tested CRC32 values differ for all three inputs, as do their SHA-256 digests. This demonstrates these particular cases. It does not prove that a CRC or hash can distinguish every possible pair of files.

 

We also evaluated every possible two-byte input for the teaching calculation. There are 256 × 256 = 65,536 inputs, but only 256 possible results. Each result occurred for 256 different inputs. That is an exhaustive result for this artificial algorithm and input space, not a universal checksum failure probability.

 

Why a longer result is not an absolute guarantee

 

A finite result cannot give every possible file a mathematically unique value. Cryptographic hashes address this by making particular collision and replacement attacks computationally infeasible under their security assumptions, rather than by eliminating the mathematical possibility of collisions.

 

NIST's hash-function guidance distinguishes collision resistance from preimage and second-preimage resistance. For everyday file verification, use the complete output of the required supported algorithm and a trusted reference. Comparing only a short prefix reduces the evidence available.

 

SHA-256 is commonly displayed as 64 hexadecimal characters. A 32-bit CRC is often displayed as eight. Hexadecimal letter case does not change the underlying value, but omitted leading zeros, decimal output and different byte-order conventions can make two displays look different. Check the representation before concluding that the calculations disagree.

 

Is a checksum the same as a hash?

 

The terminology overlaps. Download pages and tools often call SHA-256 outputs checksums, even though SHA-256 is a cryptographic hash function. It is therefore misleading to insist that anything called a checksum must be non-cryptographic, or that every checksum provides cryptographic protection.

 

Identify the named algorithm and its purpose. CRC32 is useful for accidental-error detection in systems designed around it. SHA-256 supports stronger content-verification use cases. Neither an unkeyed CRC nor an unkeyed hash establishes who supplied the expected value by itself.

 

Legacy MD5 and SHA-1 values may still appear on download pages. They should not be treated as modern collision-resistant security checks. Follow the publisher's current verification method, including signatures where supplied, rather than choosing a method solely because it produces a familiar-looking string.

 

The data integrity explanation covers the wider distinctions between matching bytes, accurate information, completeness and authenticity. A checksum can help answer one of those questions without answering the others.

 

What if someone replaces both the file and its checksum?

 

A replacement file can be accompanied by its own freshly calculated value. They will agree. That comparison does not connect either item to the original trusted publisher.

 

An authenticated reference, a correctly verified signed manifest or an independently protected baseline can supply stronger provenance. The mechanism and its verification key must be appropriate to the task. A valid signature still does not prove that the software is free of vulnerabilities or that its publisher made no mistakes.

 

How to check a downloaded file

 

For a router firmware image, operating-system image or software archive, establish the exact release and device variant before calculating anything. A perfect copy of the wrong firmware is still the wrong firmware.

 

  1. Identify the intended file, release, architecture or device model.

  2. Obtain the publisher's verification information through an appropriate trusted route.

  3. Confirm the algorithm and whether the reference describes the downloaded archive or another representation.

  4. Calculate the value over the complete local file using that algorithm.

  5. Compare the full result, or verify the supplied compatible manifest or signature using its documented procedure.

  6. Investigate any failure before installing or relying on the file, and retain the result if it matters for later recovery.

 

The examples below calculate SHA-256 for a local file named sample.bin. Substitute the path to your actual downloaded file and quote paths containing spaces. These commands read the file; calculating a digest does not install or execute its contents.

 

Windows PowerShell

 

Microsoft's Get-FileHash documentation describes the command and its algorithm selection. Specifying SHA256 explicitly makes the intended calculation clear:

 

Get-FileHash -LiteralPath '.\sample.bin' -Algorithm SHA256

 

Compare the Hash field with the expected SHA-256 value. The name or extension of a file does not establish that its contents match. Renaming a file without changing its content does not change its content hash.

 

Linux with GNU coreutils

 

Calculate the value with:

 

sha256sum sample.bin

 

For a trusted SHA256SUMS file in the compatible GNU checksum-list format, check its listed files from the appropriate directory:

 

sha256sum --check SHA256SUMS

 

The list identifies both expected digests and filenames. An OK result applies to the files actually checked. Inspect the listed paths and any warnings; do not treat ignored or unlisted files as verified.

 

In our synthetic test on GNU coreutils 9.4, an exact file produced sample.bin: OK with exit status 0. A modified file produced FAILED with exit status 1. A missing listed path also failed. These are actual local results, not claims that every tool uses identical output or status conventions.

 

Systems with shasum, including many macOS installations

 

Where shasum is available, select SHA-256 explicitly:

 

shasum -a 256 sample.bin

 

We ran this command and GNU sha256sum against the same synthetic file on Linux; both matched Python's SHA-256 result. The Windows syntax was checked against Microsoft's documentation. No Windows or macOS execution test is claimed here.

 

Make sure you are comparing the same bytes

 

Archive contents and the archive itself are different inputs. Text files can differ through line endings or encoding even when they look alike. A copied command that hashes a string with a trailing newline is not calculating the same input as that string without one.

 

Before a comparison, confirm:

 

  • The exact file version and whether the calculation covers compressed or extracted content.

  • The full algorithm and variant, rather than output length alone.

  • The expected output representation and complete value.

  • The required file set, because checking one listed file does not establish that a whole download collection is complete.

 

If the file is still being downloaded or changed, wait for a stable completed version before calculating its verification value. Otherwise, different reads may cover different states.

 

Network checksums cover defined layers

 

A network packet can contain several different checks. Each has its own boundary. A valid check at one layer does not automatically validate a complete downloaded file or the application's stored result.

 

Check

What it protects or describes

What it does not establish

Ethernet frame check sequence

The frame content covered by the Ethernet FCS calculation

End-to-end integrity of an entire application file

IPv4 header checksum

The IPv4 header

The packet's payload

TCP checksum

TCP header and data plus a pseudo-header derived from IP-layer information

Correct application selection or durable storage of a file

IPv6 base header

Has no IPv4-style header checksum field

That higher-layer traffic has no integrity checks

Downloaded file's SHA-256

The selected file bytes supplied to the hash calculation

Whether all earlier or later application operations were correct

 

TCP uses the 16-bit Internet checksum. Its pseudo-header includes addressing and other information needed for the calculation; it is not simply another copy of the file header. The TCP checksum is required, including when TCP runs over IPv6.

 

The data transfer guide explains the separation between transport delivery and the usable application result. A checksum calculated for an individual segment cannot tell the receiver that the publisher selected the correct release before transmission.

 

When a protocol rejects damaged data, recovery depends on the surrounding system. TCP can retransmit data when loss is detected. The checksum value itself is not the replacement data. The packet loss explanation covers how missing packets affect application behaviour.

 

Does a bad checksum in Wireshark prove network corruption?

 

Not necessarily. A capture on the sending host may observe an outgoing packet before the network adapter finishes its checksum calculation. Checksum offloading can therefore produce an apparently invalid or incomplete value in the local capture even when the transmitted packet is valid.

 

Wireshark's checksum and offloading guidance explains this capture-point issue. Its treatment of partial checksums also depends on the protocol, platform and Wireshark version. Distinguish an invalid on-wire packet from a value captured before processing was complete.

 

Check the direction, capture location, offload settings and receiver-side evidence before blaming a cable, router or ISP. A local capture warning is not automatically a measurement of corrupt packets delivered across the broadband line. Equally, an offload explanation should not be used to dismiss genuine receiver-side errors without investigation.

 

Checksums are not encryption

 

A checksum or digest does not hide the underlying data. TLS provides a different service: an authenticated, encrypted channel whose protection is defined between its endpoints. Modern authenticated encryption combines confidentiality and integrity for the protected records.

 

That channel protection does not remove the value of checking the intended download, nor does a file checksum replace encryption where confidentiality is required. Each control should be judged by its scope.

 

What to do when a checksum does not match

 

Start with the comparison, not an assumed cause. A mismatch can arise from the wrong reference or algorithm as well as a changed file. Preserve the expected value and the observed result while investigating.

 

Observation

Possible explanation

Useful next check

File has the expected size but a different digest

Changed bytes or the wrong release

Confirm the exact version and recalculate the full supported digest

Two tools disagree

Different algorithms, CRC variants, inputs or display formats

Compare settings and the actual bytes read

Manifest reports a missing file

Wrong directory, renamed path or incomplete file set

Check the listed relative paths and required downloads

A text file looks identical but differs

Line endings, encoding or hidden content

Compare the byte representation and transformation history

Repeated calculations change

File still being written or an unstable read path

Establish a stable source and inspect relevant system errors

Local packet capture shows checksum warnings

Offloading or a genuine packet problem

Check capture stage, direction and receiving-side evidence

 

Re-download from the intended official source when appropriate, then compare again. If a fresh copy still disagrees, investigate the reference and exact release rather than silently accepting it or generating a new expected value to conceal the failure.

 

For important stored data, avoid overwriting the only potentially good copy. Use the storage or application's supported recovery process. An error-detection value usually cannot reconstruct the original data without another valid copy or suitable error-correction redundancy.

 

Checksums, storage and verification time

 

Storage checksums can expose damage when protected data is read or scanned. Their usefulness depends on coverage, a trustworthy reference and what the system can do after a mismatch. Detection, repair and restoring an older version are separate operations.

 

Calculating a file hash also requires reading its content. As a theoretical illustration, reading 100 decimal GB at a constant 250 MB/s takes 100,000 ÷ 250 = 400 seconds, or 6 minutes 40 seconds. Hash processing, seeks, cache behaviour and contention can change elapsed time. This is a calculation, not a measured hardware benchmark.

 

For UK home labs and NAS users, a checksum scan can be limited by local storage or CPU rather than broadband. If the copy is already local, verification need not mean downloading it again. Follow where the actual reads and transfers occur.

 

Key takeaway

 

A checksum is useful when the algorithm, input and expected result are clearly defined. A mismatch deserves investigation. A match should be interpreted within the calculation's strength and the reference's provenance.

 

  • Checksums and cryptographic hashes have overlapping terminology but different capabilities.

  • Network checks cover particular layers, while file verification covers the selected file input.

  • Matching values do not prove a trustworthy publisher, safe software or complete recovery.

  • Keep correct data and appropriate recovery options, because detecting a change is not the same as repairing it.

 

Frequently asked questions

 

What is a checksum in simple terms?

 

A checksum is a calculated value used to help check whether selected data agrees with an expected state. Recalculate it using the same algorithm and input definition, then compare or verify the result according to the system's rules.

 

Is SHA-256 a checksum?

 

SHA-256 is a cryptographic hash function. Its output is often called a file checksum when used for verification. The named algorithm matters more than whether a website uses the word hash or checksum.

 

Does every change produce a different checksum?

 

No. Different inputs can produce the same result, called a collision. Error-detecting algorithms and cryptographic hashes have different properties and limits. A finite checksum is not a mathematically unique identifier for every possible file.

 

Can a checksum repair a damaged file?

 

An ordinary checksum helps detect disagreement but does not normally contain enough information to recreate the file. Repair needs a valid replacement or sufficient error-correction redundancy and a mechanism that can use it.

 

Does renaming a file change its checksum?

 

Renaming alone does not change a checksum calculated only over file content. A manifest may still fail because it expects the original path. Other checks can include names or metadata, so confirm the defined input.

 

Does a matching checksum mean a download is safe?

 

It establishes agreement with the expected value to the extent supported by the algorithm and reference. It does not independently prove that the publisher is trustworthy, the expected value is authentic or the software is safe to execute.

 
 
UK Techie Broadband Providers
bottom of page