How can someone verify that a digital file has not been altered?

What you need

  1. The file you want to check.

  2. A hash of the file recorded earlier, and the algorithm used, usually SHA-256.

  3. Ideally, a timestamp token showing when that earlier hash existed.

Calculate the hash

Windows (Command Prompt):

certutil -hashfile "C:\path\to\file.jpg" SHA256

Mac (Terminal):

shasum -a 256 /path/to/file.jpg

Each command prints a 64-character value.

Compare

Compare the value to the recorded hash, character by character or with a copy-and-paste search. Capital and lowercase letters do not matter.

Result

Meaning

Match

The file is bit-for-bit identical to the one hashed earlier

No match

The file has changed, or it is a different copy

Check the timestamp, if there is one

An RFC 3161 token can be verified with standard tools such as OpenSSL against the timestamping authority's certificate. That confirms the recorded hash existed at the stated time. See trusted timestamps.

Common reasons for a mismatch

  • The file was resized, converted or compressed.

  • It was opened and re-saved by an editing program.

  • Metadata was stripped when it was shared.

  • It is a different file with a similar name.

Where Verin Legal fits

Every item Verin Legal receives has its SHA-256 hash and timestamp token recorded at receipt. Anyone holding the exported file can recalculate the hash with the commands above and check it without relying on Verin Legal.

Common questions

Do I need special software?

No. Windows and macOS include command-line tools that calculate SHA-256 hashes.

What if the hashes do not match?

The file differs from what was recorded. Find out whether it is a different version, such as a resized copy, before drawing conclusions.

Related questions

  • What is a hash value, and how does it show a file has not changed?

  • What is a trusted timestamp (RFC 3161)?

  • What does tamper-evident mean for digital evidence?

See it live

Book a twenty-minute live demo with us. We will run a sample matter from the first client text to the finished record, and you can text a screenshot to it during the call and watch it come back dated and filed. If it is not useful, we will go away.

verify-a-file

Calculate the file's hash with a standard tool and compare it to a hash recorded earlier from a trustworthy source, ideally one tied to an independent timestamp. If the values match, the file is identical to what was recorded. If they differ, the file has changed.

How can someone verify that a digital file has not been altered?

How to check that a digital file has not changed, using built-in hash tools on Windows and Mac and a previously recorded hash.

Evidence

What is a hash value, and how does it show a file has not changed?

What is a trusted timestamp (RFC 3161)?

What does tamper-evident mean for digital evidence?

{"@context": "https://schema.org", "@graph": [{"@type": "Article", "headline": "How can someone verify that a digital file has not been altered?", "description": "How to check that a digital file has not changed, using built-in hash tools on Windows and Mac and a previously recorded hash.", "author": {"@type": "Person", "name": "Jared Jackson"}, "publisher": {"@type": "Organization", "name": "Verin Legal", "url": "https://verinlegal.com"}, "mainEntityOfPage": "https://verinlegal.com/evidence/verify-a-file"}, {"@type": "FAQPage", "mainEntity": [{"@type": "Question", "name": "Do I need special software?", "acceptedAnswer": {"@type": "Answer", "text": "No. Windows and macOS include command-line tools that calculate SHA-256 hashes."}}, {"@type": "Question", "name": "What if the hashes do not match?", "acceptedAnswer": {"@type": "Answer", "text": "The file differs from what was recorded. Find out whether it is a different version, such as a resized copy, before drawing conclusions."}}]}, {"@type": "BreadcrumbList", "itemListElement": [{"@type": "ListItem", "position": 1, "name": "Home", "item": "https://verinlegal.com/"}, {"@type": "ListItem", "position": 2, "name": "Evidence", "item": "https://verinlegal.com/evidence"}, {"@type": "ListItem", "position": 3, "name": "How can someone verify that a digital file has not been altered?", "item": "https://verinlegal.com/evidence/verify-a-file"}]}]}