Why a Boolean 'Valid/Invalid' PDF Verifier Is the Wrong Design
Developer Aman Singh, building Putmysign, a PDF signature collection app, discovered a critical flaw when Outlook re-saved a forwarded signed contract, altering its bytes and causing his verifier to flag a legitimate document as invalid. This revealed that 'byte mismatch' and 'forgery' are entirely different conditions that a simple true/false check cannot distinguish. To fix this, he designed a five-tier verification system using two independent checks: a SHA-256 hash lookup against stored records, and an HMAC-signed certificate embedded in the PDF's metadata. The tiered verdicts range from 'verified' (exact byte match) and 'certified' (authentic certificate, altered bytes) to 'tampered' and 'unknown', covering cases where files are modified by mail clients, records are deleted, or plans are downgraded. The embedded certificate ensures documents can prove their own authenticity even after the original database record is gone.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in