Ordinary forensic watermarking asks the recipient's software to add a mark. A recipient who patches the viewer gets a clean copy, and there is nothing in the cryptography to stop them.
PQFW splits the document into a base body plus m mark slots. Each slot is rendered two ways that a reader cannot tell apart, and the two renderings are encrypted under different keys. Both ship to everybody. A recipient's key bundle holds exactly one variant key per slot, chosen by their Tardos codeword bit — so the other rendering is an AES-GCM tag failure for them.
slot i variant 0 ──encrypted under VK[i][0]──┐
variant 1 ──encrypted under VK[i][1]──┤── both, in the shared ciphertext
│
recipient j's bundle: VK[i][ X[j][i] ] ← one of the two, never both
There is no code path around a tag check. Patching the client does not help; reverse engineering it does not help. There is no unmarked copy anywhere in the system — not in the package, not in transit, not on the distributor's disk after the package is built.
r03 holds one variant key for each of 301 slots. Tried the other rendering at 301 slots: refused at every one. variant they hold decrypts (301/301) the other rendering InvalidTag (301/301) The shared ciphertext is byte-identical for all 8 recipients: public part 42,799 bytes per recipient 14,028 bytes
[2m-- enroll ------------------------------------------------------[0m state state recipients 20 (r00 .. r19) witnesses 3, 2-of-3 required key encapsulation ML-KEM-768 (FIPS 203) signatures ML-DSA-65 (FIPS 204) content encryption AES-256-GCM hash / KDF SHA3-256 / HKDF-SHA3-256 liboqs 0.16.0 [2m recipient devices state\recipients[0m [2m witness keys state\witnesses[0m [2m sealed store state\distributor.sealed[0m
[2m-- protect -----------------------------------------------------[0m
document report.txt (2158 bytes)
doc id report
carrier text-zwsp
recipients 20
decryption credentials 60 (3 per recipient, each with its own codeword)
mark slots 301
[33m code length capped by the carrier: 12434 slots wanted for c=3, eps=1e-06, 301 available[0m
[2m a shorter code gives weaker evidence, not false
evidence: the p-value is computed from the score
actually observed[0m
best achievable eps 9.09e-29 against a single leaker
public ciphertext 42,801 bytes (identical for everyone)
per recipient 14,028 bytes (ML-KEM ct + wrapped bundle)
total 884,481 bytes
[2m package state\packages\report.json[0m
[2m every recipient receives the same ciphertext; only the wrapped key bundle
differs, and it decides which rendering of each slot they can decrypt[0m
The Tardos bound asks for 12,434 slots at this coalition size and confidence; the memo holds 301. The code is shortened rather than the requirement quietly dropped — which costs confidence, not correctness, because the probability reported at trace time is computed from the score actually observed. Here that still comes to 3e-29.
[2m-- open --------------------------------------------------------[0m recipient r07 session r07#0 (2 credentials left) doc id report written to leaked.txt (2,575 bytes) copy hash 8d2fd64c9df5ea011de48f60fd346df8[2m...[0m receipt signed ML-DSA-65 by r07 ledger entry seq 0 af286805c0d55fd1d7762d88[2m...[0m [2m this copy carries a fingerprint that its holder could not decline: they hold one variant key per slot and cannot decrypt the other rendering. Opening again spends the next credential and yields a different mark, so a leak resolves to this decryption rather than merely to this person.[0m
[2m-- trace -------------------------------------------------------[0m
leaked file leaked.txt (2,575 bytes)
doc id report
readable slots 301 of 301
alpha 1e-06
best match [1mr07[0m
decryption session r07#0
z-score 10.85 sigma
false-accusation [1m1.823e-47[0m provable bound
[2m5.674e-26 Gaussian approximation, for reference[0m
raw score 188.3
[2mrunners-up[0m
r12 z= 2.24 bound=1.000000
r19 z= 1.85 bound=1.000000
r03 z= 1.66 bound=1.000000
r01 z= 1.61 bound=1.000000
[2mcorroboration[0m
[32mOK[0m statistical significance (p < alpha)
[32mOK[0m recipient's ML-DSA-65 receipt verifies
[32mOK[0m ledger hash chain intact
[32mOK[0m checkpoint witnesses 3/2 required
[32mOK[0m Merkle inclusion proof to the signed root
[2mledger entry[0m seq 0
[32m[1mIDENTIFIED -> r07[0m[0m false-accusation probability at most 1.823e-47
A trace is called conclusive only when all five hold: the provable bound clears α;
the accused's own ML-DSA-65 receipt verifies; the ledger hash chain is intact; a
k-of-n witness checkpoint covers that entry; and a Merkle inclusion proof ties it
to the witness-signed root. Anything less reports UNCORROBORATED — a
lead. That is how an innocent person avoids being named.
[2m-- audit -------------------------------------------------------[0m
[33m deliberately corrupted ledger entry 0 field 'doc_hash'[0m
[2m was 8d2fd64c9df5ea011de48f60fd346df8d6c77d5f25b0c00987c2aabf80a7d631[0m
[2m now c9460c7625cf7a52b2728afd9f0a1ce03e0cf80c15fb90981975e166c0d28c30[0m
[2mdistributed ledger[0m
validators 3 independent replicas, 2-of-3 to commit, height 1
[32mOK[0m validator 0 in agreement [2m1965780cd980cd57...[0m
[32mOK[0m validator 1 in agreement [2m1965780cd980cd57...[0m
[32mOK[0m validator 2 in agreement [2m1965780cd980cd57...[0m
[32mOK[0m an honest quorum still stands: one compromised validator changes nothing
entries 1
local hash chain [31mX[0m [31mBROKEN[0m
first bad entry [31mseq 0[0m
[31m seq 0: contents do not match entry_hash (record was altered)[0m
[31m seq 0: recipient signature does not verify[0m
[2mcheckpoints (2-of-3 witnesses)[0m
[32mOK[0m #0 seq 0-0 3/2 witnesses root aeb1341583881e15[2m...[0m
[31mX[0m the signed root still covers exactly these 1 entries
[31m the ledger no longer reproduces this witnessed root: the entries are all present but their contents have changed[0m
primitives ML-KEM-768 / ML-DSA-65 / AES-256-GCM / SHA3-256
The same leaked file, traced again against the corrupted ledger. The marks have not changed, so the statistics are exactly as strong as before — and the verdict is no longer an identification:
[2m-- trace -------------------------------------------------------[0m
leaked file leaked.txt (2,575 bytes)
doc id report
readable slots 301 of 301
alpha 1e-06
best match [1mr07[0m
decryption session r07#0
z-score 10.85 sigma
false-accusation [1m1.823e-47[0m provable bound
[2m5.674e-26 Gaussian approximation, for reference[0m
raw score 188.3
[2mrunners-up[0m
r12 z= 2.24 bound=1.000000
r19 z= 1.85 bound=1.000000
r03 z= 1.66 bound=1.000000
r01 z= 1.61 bound=1.000000
[2mcorroboration[0m
[32mOK[0m statistical significance (p < alpha)
[31mX[0m recipient's ML-DSA-65 receipt verifies
[31mX[0m ledger hash chain intact
[32mOK[0m checkpoint witnesses 3/2 required
[32mOK[0m Merkle inclusion proof to the signed root
[2mledger entry[0m seq 0
[33m[1mUNCORROBORATED[0m[0m
[2m the marks match, but the ledger evidence does not stand up. This is a
lead, not an identification.[0m
Editing a record and then recomputing every downstream hash still fails, because the administrator cannot reproduce the recipient's signature. Truncating the tail leaves a valid chain — the known limit of a hash chain, and exactly why checkpoints exist: the witnessed Merkle root no longer reproduces.
A receipt carries SHA3-256(codeword ‖ salt) and nothing else about the
fingerprint, so it could be published in full — handed to every recipient, printed,
pinned to a wall — without giving anybody the means to forge, strip or transplant a
mark. The root is exported as a QR code: print it and the paper is a witness. No
chain, no orderer, no network.
A trace never reports a bare identification. It reports a false-accusation probability — and the one it gates on is a provable Chernoff bound, not a Gaussian p-value. That distinction came out of the evaluation harness rather than out of theory.
The Tardos score is a sum of m independent terms each with mean 0 and variance 1 — but not each small. A slot whose bias sits near the truncation limit contributes up to 27, while the whole sum's standard deviation at m=800 is 28. A handful of slots dominate, the central limit theorem has not taken hold in the tail, and the normal approximation understates the false-accusation rate:
| nominal α | empirical — Gaussian p-value | empirical — provable bound |
|---|---|---|
| 1e-03 | 2.4e-03 ↑ above nominal | 1.6e-03 |
| 1e-04 | 5.0e-04 ↑ above nominal | 1.0e-04 |
| 1e-05 | 0 / 10,000 | 0 / 10,000 |
| 1e-06 | 0 / 10,000 | 0 / 10,000 |
| 1e-07 | 0 / 10,000 | 0 / 10,000 |
| 1e-08 | 0 / 10,000 | 0 / 10,000 |
| 1e-09 | 0 / 10,000 | 0 / 10,000 |
P(Z ≥ t) ≤ min over λ>0 of exp(−λt) · Π E[exp(λ·w)]
Valid because an innocent recipient's codeword is independent of the extracted bits — they hold no key that could have influenced them. And because the score is bounded, the bound is not merely valid but tighter than the Gaussian tail in the regime an accusation actually lives in: at m=301 a real leaker's bound comes out near 1e-47 where the Gaussian says 1e-25. Using the rigorous number costs nothing.
Coalitions can only act where their members disagree; where they agree they are stuck, because none of them holds the key for the other rendering. That constraint is enforced by the package, not assumed of the attacker.
| coalition | detection at m=1200 | detection at the prescribed m | mean rank of first colluder |
|---|---|---|---|
| 1 | 100% | 100% | 1.00–1.00 |
| 2 | 100% | 100% | 1.00–1.00 |
| 3 | 100% | 100% | 1.00–1.00 |
| 5 | 46%–57% | 100% | 1.00–1.00 |
| 8 | 0%–8% | 100% | 1.00–1.01 |
At a length a real document can hold, detection against a coalition of eight collapses — while the mean rank of the first true colluder stays at 1.0 and innocent accusations stay at 0.0%. The ordering barely degrades; what degrades is confidence. The system declines to name anybody rather than guessing.
Measured, with the losses reported next to the wins. Text carrier, m=728.
| attack | what it does | bit error rate | z | outcome |
|---|---|---|---|---|
none | baseline: the file as issued | 0.0% | 19.0 | traced |
nfc | Unicode NFC normalisation | 0.0% | 19.0 | traced |
nfkc | Unicode NFKC normalisation (compatibility) | 0.0% | 19.0 | traced |
utf16_roundtrip | re-encode via UTF-16 and back | 0.0% | 19.0 | traced |
truncate_75 | keep the first 75% of the file | 0.0% | 16.5 | traced |
truncate_50 | keep the first half | 0.0% | 13.8 | traced |
truncate_25 | keep the first quarter | 0.0% | 10.1 | traced |
whitespace_collapse | collapse runs of spaces/tabs | 0.0% | 19.0 | traced |
strip_format_chars | remove every Unicode format character | 51.0% | 2.4 | DEFEATS THE CARRIER |
retype | read it and type it out again | 50.9% | 2.4 | DEFEATS THE CARRIER |
insert_word_start | prepend one word (shifts every slot) | 50.7% | 1.9 | DEFEATS THE CARRIER |
insert_word_midway | insert one word halfway through | 25.4% | 10.1 | traced |
delete_word_start | delete the first word | 50.8% | 0.6 | DEFEATS THE CARRIER |
Cutting a document only removes slots, and a removed slot is carried as an erasure rather than guessed as a zero — so the evidence weakens and never inverts. Across a 0–95% erasure sweep, misidentification stays at 0.0% at every level.
A slot's address is "the k-th space in the document", so inserting or deleting a word shifts every later address. This is the sharpest limitation of the design and the first thing anyone asks about. A content-anchored locator would fix it, and is the natural next iteration.
One shared ciphertext plus a small per-recipient envelope. The envelope is independent of both N and the document's size.
The distributor knows every codeword, so a malicious distributor could in principle fabricate a copy carrying someone's marks. True non-repudiation needs asymmetric fingerprinting — classically Paillier plus zero-knowledge proofs — and there is no drop-in post-quantum Paillier. A BFV-based construction is the documented next step. It is not built here and it is not claimed.
Also out of scope by construction: retyping and OCR (no text carrier survives a human reading the document and typing it out), and a recipient who leaks their own private key, which leaks their own accountability.
Everything runs offline — no cloud KMS, no timestamping service, no public chain, no network calls at runtime. That is asserted by a test that replaces the socket layer with one refusing every operation and then runs the whole pipeline anyway.
pqfw enroll --recipients 20 --out ./state pqfw protect --doc report.txt --state ./state --coalition 3 --eps 1e-6 pqfw open --doc-id report --recipient r07 --state ./state --out leaked.txt pqfw trace --doc-id report --leaked leaked.txt --state ./state pqfw audit --state ./state --tamper 0
The interactive browser demo is a container: docker build -f deploy/Dockerfile
., or deploy the included Render blueprint. It needs a server because the point
is that liboqs does the work — reimplementing ML-KEM and the Tardos scorer in
JavaScript to fit a static host would replace the thing being demonstrated with an
untested copy of it.
Smart India Hackathon 2026 · problem statement SIH26237 — Cryptographic Attribution and Immutable Decryption Provenance for Multi-Recipient Encrypted Document Distribution, Ministry of Defence. Built by Team NOX, IIIT Bhubaneswar.
144 tests, including the safety-critical ones: that a recipient cannot decrypt the other variant, that a coalition cannot forge a slot they agree on, that erasures are never read as zeros, that the provable bound never sits below the measured rate, and that no accusation is reported without its error probability. All sample content is synthetic. There is no real data of any kind in this project.