NyayLedger
Guides / Record verification

How to verify a digital record with SHA-256

NyayLedger · VixitAI Labs · Published

A SHA-256 fingerprint is a value calculated from the exact bytes of a file or message. If you have a trustworthy fingerprint from the day a record was issued, you can calculate the fingerprint of your copy and compare the two. This answers a useful, narrow question: do I still have the same digital version?

Try changing one digit

Our fictional road office has issued a payment entry for ₹8 lakh. The examples below use plain text and write the amount in rupees. Select a copy to calculate its fingerprint in your browser. The saved receipt always refers to the original line. The demonstration uses sample text only.

Sample text "RD-008 | INR 800000"

Fingerprint on the saved receipt fddb3acffb7c9f2158065f506684b13f78200392c16203841a1cc4ebcf788eb1

Fingerprint of the selected copy fddb3acffb7c9f2158065f506684b13f78200392c16203841a1cc4ebcf788eb1

The original sample matches the saved receipt.

Why a new line changes the result

A hash function reads bytes. Letters, spaces and line endings all have byte representations. A second PDF export can also contain new metadata or a different internal layout. A reader may see the same words while a comparison reports different fingerprints. Conversely, renaming a file without changing its contents preserves its fingerprint. This is why the person issuing a receipt must say exactly which file or representation it covers. NIST Secure Hash Standard.

Read a receipt in four passes

  1. Identify the item. Does the receipt cover one PDF, one attachment or a structured database entry? A scan of a printed page is a new file. Comparing it to the original PDF answers the wrong question.
  2. Identify the algorithm. For SHA-256 in hexadecimal, expect 64 characters in the full digest. A short excerpt printed in a video is convenient for recognising a receipt. Compare the full value when checking a record.
  3. Establish the source. A reference fingerprint published independently or signed by a trusted issuer has a different evidentiary value from a string supplied by the same person who supplied the disputed copy. If someone can replace both file and receipt, the two can still match.
  4. Check the time claim. A verifiable timestamp can support a claim that the fingerprint existed by a particular time. The event described in the document may have happened much earlier. As a separate example of this distinction, the IETF timestamp protocol describes proof that data existed at a time. IETF RFC 3161.

What a match can settle

Suppose a resident has two files named payment.pdf. One was downloaded in June and the other arrived in a message in August. Comparing each to the same independently preserved June receipt can identify which copy matches that receipt. It cannot establish whether the contractor received money, whether the road surface met specifications, or whether the issuer entered an incorrect amount in June.

What to do with a mismatch

Keep both files. Record which receipt and algorithm you used. Check first for a scanned copy, redaction, re-export or a formally issued revision. Ask the issuer for the version history before drawing a conclusion about tampering. A good correction process preserves the previous receipt and links to the replacement, so a reader can tell which version a decision relied on.

NyayLedger’s Agami proposal uses a public blockchain as an independent reference for fingerprints. This browser exercise calculates a local comparison. It sends no transaction and takes no case-file uploads.