Catching Hallucinated Citations Locally: ISO 2108 ISBN, ISO 3297 ISSN Check-Digit Math and BibTeX Forensics in Zero-Upload Python and WebCrypto
Catching Hallucinated Citations Locally: ISO 2108 ISBN, ISO 3297 ISSN Check-Digit Math and BibTeX Forensics in Zero-Upload Python and WebCrypto
Peer-review confidentiality rules such as NIH Notice NOT-OD-23-149 prohibit pasting embargoed manuscripts into hosted third-party services, yet ungrounded language models continue to emit plausible bibliographies with fabricated identifiers. Because autoregressive next-token sampling splits 10- and 13-digit book codes across variable subword boundaries without computing modular inner products, structural checksum math eliminates fabricated citations deterministically on your own hardware (0 bytes uploaded).
This 12th and final monograph in our engineering series documents the shared verification logic behind our browser Citation & Hallucinated Reference Verifier (25,001 B pure client-side JS, 0 fetch/XHR calls) and the MIT-licensed verify_citation_identifiers MCP tool & ./cli/destiny-verify.sh cite CLI in karany97/destiny.
1. ISO 2108 ISBN-13 (EAN-13 1/3 Modulo-10) & Algebraic Blind Spots
Every modern Bookland identifier starts with GS1 prefix 978 or 979 and appends terminal check digit d_13:
S_12 = sum_{i=1}^{12} w_i * d_i, w_i = 1 (odd i) or 3 (even i)
d_13 = (10 - (S_12 mod 10)) mod 10
For Kernighan & Ritchie (The C Programming Language, 2nd ed., 978-0-13-110362-7), S_12 = 73, requiring d_13 = (10 - 3) mod 10 = 7. Altering 7 -> 9 yields residue 82 != 0 (mod 10), rejecting 90% of uniformly random 13-digit fabrications offline. Because gcd(3 - 1, 10) = 2, EAN-13 catches 100% of single-digit errors and all adjacent transpositions except pairs differing by |d_i - d_{i+1}| = 5.
2. Prime Field Z_11 Protection in ISBN-10 & ISO 3297 ISSN
Because 11 is prime, every nonzero residue difference has a multiplicative inverse modulo 11. Both ISO 2108 ISBN-10 (weights 10..1, terminal 'X' = 10) and ISO 3297 ISSN (8-character XXXX-YYYX, weights 8..1) guarantee 100% detection of every single-digit alteration and every transposition between any two distinct positions:
- ISBN-10 check (
0-201-61622-X):sum_{i=1}^{9} (11 - i)*d_i = 100, giving(11 - (100 mod 11)) mod 11 = 10 -> 'X'. Substituting'7'emits deterministic failure (expected X, found 7). - ISO 3297 ISSN check (Nature
0028-0836):8*0 + 7*0 + 6*2 + 5*8 + 4*0 + 3*8 + 2*3 + 1*6 = 88 == 0 (mod 11).
3. ANSI/NISO Z39.84 DOI Grammar, arXiv Calendar Bounds & BibTeX Forensics
- DOI Screening (
ISO 26324): Normalizesdoi:/doi.org/prefixes, strips trailing sentence punctuation (.,;)]}), ignores path segments inside unrelatedhttps://URLs, and rejects synthetic registrant prefixes (10.0000,10.1234,10.9999). - arXiv Calendar & Era Invariants: Post-April 2007
YYMM.NNNN(N)identifiers require01 <= MM <= 12, reject modern prefixes earlier than0704, enforce4digits for2007–2014and5digits for2015+(2309.06180passes;2309.6180fails;2315.06180fails), verify pre-April 2007archive/YYMMNNN(1991-08..2007-03), and flag cited-year splices (|arXiv_year - year| > 2). - Escape-Aware BibTeX & Local
MITTooling: Tracks`-escaped quotes and{}depth per@entry{key, …}, checks mandatory fields per entry type (@article,@book,@inproceedings,@phdthesis), flags duplicate cite keys, and audits local.bibfiles under strict path-traversal (..) and size guards inside both browser RAM and Python>=3.10stdlib (0` pip deps).
Live Zero-Upload Tools, Mathematical Guide & Archival References
- Offline Browser Citation Verifier: nandai.org/tools/citation-verifier (
25,001B pure JS engine,0uploads) - Mathematical Guide (
G-01 · Bibliometric Forensics): nandai.org/guides/detecting-hallucinated-citations-checksum-math - Open MIT Repo,
9-Tool MCP Server &./cli/destiny-verify.sh cite: github.com/karany97/destiny - CERN Zenodo Academic Record (
CITATION.cff/codemeta.json):10.5281/zenodo.24642737
- Reference: https://nandai.org/tools/citation-verifier
- Reference: https://nandai.org/guides/detecting-hallucinated-citations-checksum-math
- Reference: https://doi.org/10.5281/zenodo.24642737
- Reference: https://github.com/karany97/destiny
Write a comment