Tamper-Evident Anchors for Re-Scanned Paper Documents

When a paper record is copied, re-scanned, or photographed, it never produces the same file twice. A cryptographic hash, the fingerprint that blockchains use to prove a record has not changed, flips completely at a single altered bit. As a result, today's integrity systems cannot answer a basic question: "is this re-scanned insurance form, receipt, or allergy sheet the same document that was registered last year, or did someone change the dollar amount?" Hashing the text that optical character recognition (OCR, software that converts an image of text into characters) produces does not help, because OCR introduces new random character errors on every scan.

This note proposes a fingerprint for paper documents that tolerates benign scanning and OCR noise and still flags small deliberate edits, field by field. The fingerprint is committed on a blockchain so the registering party cannot quietly rewrite it later. Two parties can compare their copies under homomorphic encryption (encryption that lets a server compute on data it cannot read), so neither has to reveal its document. The central scientific question is not cryptographic. It is whether representations exist in which "the scanner misread a 1 as an l" and "someone changed 100 to 900" fall measurably far apart. The cryptography is the deployment wrapper that makes the answer usable across institutions that do not trust each other.

Core Claim

Robustness to OCR noise and sensitivity to tampering pull in opposite directions. The literature has optimized only the first. FS-DAG shows that a spatial graph network over text boxes loses less than 1% when 10% of OCR characters are corrupted, while BERT loses 25–30%. That same insensitivity means a whole-document FS-DAG embedding would also absorb a one-digit edit to a total.

Our claim is that separating noise from tampering requires structure at the level of individual fields, plus a fingerprint whose tolerance depends on the type of field. Free-text fields get an edit-tolerant character n-gram profile. Numeric and date fields get a confusion-aware canonical form, in which pairs of characters that OCR commonly swaps are collapsed into a shared symbol. They also get a small visual embedding of the field's image crop, which catches edits that the canonical text cannot distinguish from noise.

We expect this field-typed fingerprint to achieve a much lower rate of accepted tampered fields, at a fixed rate of rejected benign re-scans, than either whole-document robust embeddings or perceptual image hashes. We also expect the comparison to remain cheap enough under encryption that a verification costs seconds, not hours.

The blockchain gap this addresses is stated plainly in the research file: ledgers guarantee that recorded state cannot be altered later, but they cannot recognize a noisy re-observation of the same physical object. Existing anchoring work commits exact data. Chen and Chen records plaintext vaccination entries, and Zhang et al. anchors Merkle roots of exact sensor streams. The closest encrypted-and-anchored system, EKV-VBQ, supports only exact-match Boolean queries over discrete keys and explicitly leaves fuzzy matching open. We target exactly that missing tolerance, for one well-defined task: verifying a document's identity, not general search.

Research Program

The fingerprint. The registering party, for example a hospital or insurer, runs key-information extraction on the original scan. Key-information extraction is a model that finds labelled fields such as total, date, or drug name, together with their bounding boxes. We use an SDMG-R-style graph model (SDMG-R), which reports 87.1% F1 on SROIE and 88.7% on WildReceipt and whose layout reasoning compensates for OCR misreads.

For each extracted field $f$, the fingerprint stores three things. The first is a vector $v_f$ of character q-gram counts, where a q-gram is a run of $q$ consecutive characters. The second is a canonical string, produced by mapping learned OCR confusion classes to single symbols. The third is a low-dimensional embedding of the field's image crop. These are quantized, salted with fresh randomness so that low-entropy fields such as dates cannot be dictionary-guessed, and hashed into Merkle-tree leaves. Only the root of the tree, a single hash summarizing all leaves, is written on-chain.

Following the off-chain/on-chain split of Zhang et al., one root covers a whole batch of documents. This spreads their reported 18–21 second write latency across many records.

Tolerance with a principled threshold. A single character substitution, insertion, or deletion changes at most $q$ q-grams going out and $q$ coming in. This gives the standard bound

$$\lVert v_f - v'_f \rVert_1 \le 2q \cdot \mathrm{ED}(s_f, s'_f),$$

where $s_f$ and $s'_f$ are the registered and re-scanned field strings, $\mathrm{ED}$ is their edit distance, and $v_f, v'_f$ are their q-gram count vectors. The bound converts an OCR error budget, measured per field type on benign re-scans, into a distance threshold. It also lets us replace exact homomorphic edit distance, which is expensive at document scale according to Homomorphic Computation of Edit Distance, with inner products, which are cheap under encryption.

For numeric fields, the threshold on the canonical form is zero, so any difference after canonicalization is flagged. The visual crop distance then decides the cases where a confusable pair, such as 1 and 7, is genuinely ambiguous.

Encrypted comparison. The verifier holds a re-scanned copy. It computes its own fingerprint and encrypts it under CKKS, an encryption scheme that supports approximate arithmetic on real-valued vectors, using its own key. The registering party combines that ciphertext with its own plaintext fingerprint. Operations between a ciphertext and a plaintext are cheaper than operations between two ciphertexts. The registering party computes per-field squared distances, applies a polynomial approximation of the sign function to produce threshold bits, and returns only the encrypted match bits.

The polynomial step reuses the minimax-approximation approach of Lee et al.. That work evaluates a degree-15 sigmoid approximation over CKKS-encrypted Sentence-BERT vectors and retains 98.8–99.6% of plaintext accuracy, on clean text only. Our computation is shallower than theirs, since it involves no training loop, but our inputs carry OCR noise they never tested.

In this protocol, the verifier learns only which fields match, and the registering party learns nothing. The anchor on the chain prevents the registering party from later claiming a different fingerprint. In a dispute, the contested Merkle leaf is opened and checked against the on-chain root.

We state the limitation honestly. Proving in real time that the encrypted computation used the anchored leaf would require zero-knowledge proofs, which are out of scope. The trust model is therefore "honest-but-curious during comparison, accountable afterwards." Where both sides must hold key shares, the multiparty variant of Geva et al. is a drop-in option.

The benchmark we must build. No dataset in the file pairs benign re-scans with adversarial edits, so constructing one is part of the contribution. Starting from SROIE, WildReceipt, CORD, and FUNSD (FUNSD), we generate benign variants in three ways. The first is synthetic degradation: blur, resolution loss, bleed-through, fading, and skew, modeled on the failure types documented by Ströbel et al. and Pippi et al.. The second is images passed through restoration models such as DocEnTr. The third, for a held-out subset, is physical print-and-rescan.

Tampered variants re-render a single field value in matching font and position. Edits range from one digit to a whole entity, and include adversarial edits that deliberately use OCR-confusable characters. The Berge et al. finding that OCR caused 32.3% of extraction failures on scanned clinical forms, with handwriting the leading cause, motivates a handwritten-annotation split. We use H-DIBCO-style handwritten degradation as a proxy for that split.

Baselines

The naive reference point is an exact SHA-256 hash of the OCR text, anchored on-chain. It is run on the same benign and tampered pairs. We expect it to reject nearly every benign re-scan. Any proposed method must keep its tamper detection while cutting that false-rejection rate by an order of magnitude, or the problem is not being solved at all.

The perceptual image hash computes a compact image signature that changes little under small visual perturbations. It is the obvious non-learned competitor and needs no OCR. We run it at the same false-rejection operating points, on the same images, with its single threshold tuned on the same validation split. To beat it, we must show substantially lower false acceptance on single-field edits, which a global image signature should barely register.

The strongest learned competitor is a whole-document robust embedding. We use an FS-DAG model trained on WildReceipt, which the file reports at 93.90% F1 with under 1% degradation at 10% OCR errors (FS-DAG). We compare documents by cosine distance between their pooled embeddings. It gets the same training data, a matched hyperparameter search budget, and threshold tuning on the same validation split as our fingerprint. This baseline embodies the "just use the most noise-robust representation" view. To beat it, we need lower tampered-field acceptance at 1% and 5% benign rejection. There is no reported result on Lacuna for tamper detection with any of these models, so all numbers here will be new measurements.

Three ablations isolate the key ingredient. The first removes field structure by pooling all q-grams across the document. The second removes confusion-aware canonicalization. The third removes the visual crop channel. The plaintext version of our fingerprint serves as the upper bound for the encrypted version. The gap between the two measures how much accuracy the CKKS approximation costs.

Why not just…?

Why not just hash the original image file and keep it? That works only if the exact file is presented again. The use case is a later physical copy or re-scan, which never reproduces the file bit for bit. The naive-hash baseline quantifies this directly, by its benign rejection rate on our re-scan splits.

Why not just use a perceptual hash and skip OCR entirely? This is a real threat, because perceptual hashes are cheap and tolerate scanner noise by design. Our concern is that they are equally tolerant of a single changed digit, which occupies a tiny fraction of the image. The experiment settles it: if perceptual hashing matches our tampered-field acceptance on one-digit edits, the field-typed design is unnecessary and we will say so. It cannot report which field changed, but that alone would not justify the extra machinery.

Why not run OCR post-correction, then hash the corrected text exactly? Post-correction reduces noise but does not make it zero. Any residual error still breaks an exact hash. Correction also risks "correcting" a tampered value toward something plausible. We include post-corrected exact hashing as an additional row. If it alone achieves low benign rejection on numeric fields, the canonicalization component reduces to it and we will simplify the method.

Why not skip encryption and let a trusted verifier compare plaintext copies? Where such a verifier exists, that is the right answer, and our plaintext fingerprint serves it directly. Encryption matters only across institutions that will not share records. In that setting, Lee et al. shows that even unencrypted embeddings can be inverted back to text. We report the encrypted protocol's latency and bandwidth separately so a reader can judge whether the privacy is worth its cost.

Why not use a signed append-only log at one institution instead of a blockchain? For a single issuer that is adequate, and the fingerprint does not depend on the ledger. The blockchain earns its place only in multi-issuer settings, where no party will host the log, as in the cross-provider audit work of Gong. We treat the ledger as an interchangeable anchor and measure only its amortized cost per document.

Proposed Experiments

The primary result is a curve of tampered-field acceptance against benign-rescan rejection, for each baseline and ablation, on each dataset and degradation type. It is reported separately for single-digit edits, confusable-character edits, and whole-entity edits.

The decisive check concerns confusable-character attacks on numeric fields. These are where text-only fingerprints must fail, by the bound above. If the visual crop channel does not reduce acceptance there relative to the text-only ablation, the core claim that typed, multimodal fields separate noise from tampering is falsified for the hardest case.

A second check tests whether thresholds calibrated on synthetic degradation transfer to physical print-and-rescan. If they do not, the q-gram bound is only as good as the error model behind it.

For the cryptographic layer, we report agreement between encrypted and plaintext decisions, with a target of at least 99%, informed by the 98.8–99.6% retention reported by Lee et al.. We also report per-document verification latency on a single GPU, ciphertext bandwidth (Lee et al. report a roughly 200 MB to 11 GB expansion on SNIPS, so field-level vectors must be kept small), and on-chain cost per batch.

A negative outcome would still be informative. A finding that no fingerprint separates OCR noise from one-digit edits below some resolution would establish a concrete limit on registering paper documents with fuzzy tolerance.