Avaneesh DashProduct Designer
Based in Bengaluru
Project 05 / 06 · Selected work
Identity · Security · Mobile

Passport Reader.

A mobile app that checks whether a passport's chip was issued by its country and hasn't been altered.

PlatformAndroid app + browser demo
StatusWorking end to end, verified on a real passport
IndustryIdentity · Security · Fintech
ScopeNFC · Cryptography · Mobile UI
Passport Reader — The verdict, on a real passport
Passport Reader — The verdict, on a real passport
Visual 01The verdict, on a real passportChip read and result recorded on a Samsung Galaxy S20 FE: the photo page, the emblem cover opening, and 6 of 6 checks passed. Personal details are blurred.
01 — Overview

A passport check that happens entirely on the phone.

Scan the photo page with the camera, hold the passport to the phone, and in a few seconds the app reads the chip over NFC and verifies the issuing country's digital signature, entirely on the device.

Built as a web app inside a native NFC shell for Android, with a browser demo that runs against a simulated chip. It works end to end and has been verified with a real passport on a Samsung Galaxy S20 FE.

Passport Reader — Browser demo
Passport Reader — Browser demo
Passport Reader — Browser demo
Visual 02Browser demoThe desktop showcase and the demo against the ICAO specimen passport. The same code runs here against a software chip.
02 — How it works

Scan, unlock, read, validate, check for clones, show the verdict.

The camera reads the machine-readable zone with on-device OCR, and check digits catch and correct OCR mistakes, so a scan is either right or rejected. The passport number and two dates form the access key, so the chip only talks to a reader that has the passport open in front of it.

Personal details, the photo and the chip's security record arrive over an encrypted, authenticated channel. The signature is traced back to the issuing country's root certificate, and every file read is hashed and compared with the signed values.

Passport Reader — Scan, tap, verify
Passport Reader — Scan, tap, verify
Passport Reader — Scan, tap, verify
Passport Reader — Scan, tap, verify
Passport Reader — Scan, tap, verify
Visual 03Scan, tap, verifyPassport details, the camera scan of the photo page, holding the passport to the phone, the live chip read, and the country's emblem cover.
Passport Reader — The full flow in 35 seconds
Passport Reader — The full flow in 35 seconds
Visual 04The full flow in 35 secondsCamera scan, chip read (sped up 4x), emblem cover, photo page, verdict, then the checks, signature and chip details.
03 — Highlights

The full ICAO 9303 protocol, written from scratch.

Protocol
  • BAC key derivation, 3DES secure messaging with ISO 9797-1 retail MAC, chunked and extended-offset reads, and file parsing, matching the ICAO worked examples byte for byte.
Signature validation
  • RSA (PKCS #1 v1.5 and PSS) and ECDSA on NIST and Brainpool curves, including explicit curve parameters that browsers' WebCrypto can't handle. Written with BigInt.
Clone detection
  • Chip Authentication from the DG14 key (ECDH or DH, then secure messaging re-keyed to 3DES or AES-CMAC) and Active Authentication from the DG15 key (RSA ISO 9796-2 or ECDSA challenge signature). A cloned chip has identical data and passes every other check; only this catches it.
Trust list
  • Ships the German CSCA Master List: 609 root certificates from 117 countries, its own signature verified against the fingerprint BSI publishes.
Camera scanning
  • OCR output is cleaned up and every field the chip key needs must pass its check digit. A reading is accepted only after two frames agree.
Private by design
  • No internet permission, OCR on the device, nothing stored. A privacy mode swaps personal details for placeholders before they are drawn.
04 — Engineering challenges

Working around what the browser can't do.

The browser can't reach a passport: Chrome's Web NFC only reads NDEF tags, while passports are smart cards that need raw ISO 7816 commands. The fix was a hybrid in which every protocol step stays in the web app and a small native shell only moves bytes.

WebCrypto has no 3DES, no SHA-224, no Brainpool curves and no explicit curve parameters, all of which real passports use, so these were implemented directly, with curve constants generated from OpenSSL's definitions.

OCR is noisy but keys must be exact. Ambiguous characters are resolved by trying alternatives against the check digits, and a repair is only accepted when the overall check digit also agrees. A dependency that quietly added internet permission was removed explicitly to keep the privacy promise.

Web appProtocol, crypto and UI
  • ICAO 9303 · BAC · secure messaging
  • RSA · ECDSA · ECDH · DH in BigInt
  • ~3,700 lines protocol · ~1,600 UI
Android shell · 420 linesOnly moves bytes
  • NFC reader mode + IsoDep
  • ML Kit OCR, bundled offline
  • No internet permission
e-Passport chipData groups + security record
Browser demoSame code, software chip
Trust list609 roots · 117 countriesGerman CSCA Master List, verified against BSI's fingerprint
Visual 05ArchitectureEvery protocol step lives in the web app; a 420-line native shell only moves bytes. The same code runs in the browser demo against a software chip.
05 — Design

Deep navy, glass, and a passport that opens like a book.

The signature element is the passport cover. It uses the issuing country's real cover colour, with its national emblem rendered as a single-colour gold foil mask with a moving sheen, and it opens like a book into the data page.

Motion is purposeful: staggered entrances, numbers that roll into place, a scan line that locks on to the MRZ and view transitions between screens. All of it switches off under reduced-motion settings.

Passport Reader — Onboarding, home and covers
Passport Reader — Onboarding, home and covers
Passport Reader — Onboarding, home and covers
Passport Reader — Onboarding, home and covers
Passport Reader — Onboarding, home and covers
Visual 06Onboarding, home and coversValidate in seconds, scan then tap, signed by the country; the dashboard and the carousel of country covers with gold-foil emblems.
06 — Quality and testing

Checked against the spec, OpenSSL and real passports.

Spec conformance
  • Key derivation, mutual authentication and secure messaging reproduce ICAO 9303 Part 11 Appendix D exactly, down to every byte sent to the chip.
Independent crypto checks
  • Hashes, 3DES and MAC compared with OpenSSL; certificate chains and signatures generated by OpenSSL for every supported algorithm, then verified by the app.
Real-world data
  • All 609 certificates in the German Master List checked: 597 verify and OpenSSL agrees on the other 12. In 2,500 tamper tests, no altered certificate was accepted.
Clone detection
  • Chip and Active Authentication tested against simulated chips with OpenSSL-generated keys across curves and ciphers. Cloned chips are caught every time.
Failure cases
  • Wrong passport details, a forged signature, an impostor root with the same name, a tampered data group, a corrupted radio response, oversized and missing files.
On a device
  • Camera scan, chip read and signature validation of a real passport on a Galaxy S20 FE.
Passport Reader — Signature, chip and trust list
Passport Reader — Signature, chip and trust list
Passport Reader — Signature, chip and trust list
Passport Reader — Signature, chip and trust list
Visual 07Signature, chip and trust listThe document signer and country root (CSCA India), what the chip holds, and 609 root certificates from 117 countries.
07 — Technology

Technology / stack

App
  • JavaScript · HTML · CSS · ES modules · No frameworks or runtime dependencies
Android shell
  • Android · Java · Gradle · Google ML Kit · WebView · NFC reader mode and IsoDep · Offline text recognition
Bridge and camera
  • JavaScript interface with async callbacks · Raw APDUs in, responses out · Camera frames in, text lines out · getUserMedia with torch control
Crypto
  • 3DES, AES and AES-CMAC · ISO 9797-1 MAC · SHA-1/224/256 in JavaScript · SHA-384/512 via WebCrypto · RSA, ISO 9796-2, ECDSA, ECDH and DH in BigInt
Standards
  • ICAO Doc 9303 · ISO/IEC 7816-4 · ISO/IEC 14443-4 · CMS (RFC 5652) · X.509 (RFC 5280) · RFC 8017 · RFC 5639 · BSI TR-03111
Ui and testing
  • View Transitions API · CSS foil masks · Glass with backdrop-filter · Haptics · Reduced motion · Light and dark themes
  • Node.js · OpenSSL · Google Chrome · node:test with 66 tests · Headless screenshots over the DevTools protocol
08 — Honest limits

What it doesn't do yet.

  • PACE, the newer unlock protocol some recent passports require, isn't supported.
  • No revocation lists are consulted and JPEG 2000 photos aren't displayed.
  • Android only for now; an iOS version would need a Core NFC shell implementing the same bridge.
09 — By the numbers

Small, tested and self-contained.

01

About 3,700 lines of protocol and crypto code, 1,600 lines of UI code and 2,400 lines of CSS

02

A 420-line Android shell

03

66 automated tests

04

117 countries in the trust list, 17 country covers with emblems

05

A 25 MB APK, mostly the offline OCR model

10 — Credits

Sources and attributions.

Root certificates
  • German CSCA Master List, published by BSI (Federal Office for Information Security, Germany).
National emblems
  • Wikimedia Commons, converted to single-colour masks. UK, France, Canada, Singapore and the Netherlands are CC BY-SA; the rest are public domain.
Specimen data
  • Specimen passport data from ICAO Doc 9303.
More work

Keep exploring.

Let’s work together

Interested in working together?

work@avaneeshdash.com
← Previous projectQ SpaceNext project →UK Imports & Exports