The Problem
Degree certificate fraud was rising across Pakistani institutions. Employers verifying credentials had to contact the university directly, wait days for a manual check, and had no guarantee the printed document had not been altered. The university needed a verification system that worked in the field — a smartphone scan, instant result.
The Design Decision
The QR code needed to be self-verifying — it could not rely on a database lookup alone, because database tampering was also a threat vector. I chose RSA-2048 digital signatures: the server signs a payload containing the document's key fields (student ID, degree type, issue date, institution) with a private key. The QR encodes the payload + signature. The public portal decodes it, verifies the signature, and cross-references the DB record.
Even if a QR is visually cloned, the signature will not match a tampered payload. Even if the DB record is altered, the signature will not validate against the stored original hash.
Rate Limiting & Abuse Prevention
The public portal uses a throttle:60,1 middleware per IP for verification requests, with stricter throttle:5,1 on batch endpoints. Suspicious patterns (bulk sequential ID scans) trigger a temporary block and flag the event for review.
Outcome
12,000+ documents verified since launch. Zero confirmed fraud cases in the verification system. Verification time dropped from days (manual) to under 3 seconds. The system is now being considered for rollout across the university consortium. This is what software engineering at scale looks like.