Passport Chips, Explained

A code-dependent life form.
The first time I held my phone against my passport and watched an app pull my own photo off the chip, I had two reactions. First: that's really cool. Second: wait, how did it do that?
So I went digging. And here's the short version of what I found.
Treat your passport as a locked diary. Your government wrote your details inside, put a special seal on it, and hid a tiny computer in the cover to hold it all. Your phone can knock on that computer, open the diary, and check the seal. That's it. That's the whole system.
Now let me show you each piece.
Five words you'll see everywhere
The passport world uses big acronyms for simple things. Here's the cheat sheet.
eMRTD (Electronic Machine Readable Travel Document) just means "a passport with a chip." If your passport has a little symbol on the cover that looks like a camera, you have one. Over 140 countries make them. Almost every passport made after 2006 is one.
ICAO (International Civil Aviation Organisation) 9303 is the rulebook. A UN agency wrote it. Every country follows it. That's why a machine in Brazil can read a passport from Japan. Same rules everywhere.
MRZ (Machine-Readable Zone) is the two strange lines at the bottom of your photo page. The ones full of <<<. Remember these lines. They're secretly a password.
NFC (Near Field Communication) is the radio the chip uses to talk. It's the same thing as tap-to-pay. It only works from a few centi-meters away.
SOD (Security Object) is the seal. It's a file where the government promises "nothing in this passport has been changed." We'll get to it. It's the best part.
The two strange lines
Look at the bottom of any passport's photo page. You'll see something like this:
P<INDERIK<<KARTIK<MEHTA<<<<<<<<<<<<<<<<<<<
L898902C36UTO7408122F1204159ZE184226B<<<<<10
It looks like a cat walked on a keyboard. It's actually very simple. It's your normal passport details, written in a font that machines can read easily. The < just means "empty space."
The first line says: this is a Passport, from the country IND, belonging to ERIK, KARTIK MEHTA.
The second line has the numbers: passport number, birthday, expiry date, and nationality.
You'll also notice extra single digits sprinkled between the fields. Those are called check digits, and they're just spell-check for machines. Each one is a tiny answer key. If the scanner reads a number wrong, the answer key won't match, and the scanner knows to try again. That's all they do.
So the lines are just your info in robot handwriting. But they have a second job. A much cooler one.
The lines are the password to the chip.
The lock on the diary
Here's a fear people have: "Can someone with a scanner read my passport through my bag on the train?"
No. And the reason is clever.
The chip refuses to talk to strangers. Before it says anything, it asks the reader one question: prove you can see my photo page.
How do you prove that? With the MRZ lines. Your phone reads the two lines with its camera, turns them into a key, and knocks on the chip with that key. Wrong key, no answer. And the only way to have the key is to be holding the passport, open, in your hand.
The old version of this handshake is called BAC. The newer, stronger version is called PACE. Same idea in both: the printed lines unlock the chip. New passports use PACE.
And after the handshake, the chip and the phone whisper. Everything they say to each other is encrypted, so nobody nearby can listen in.
Inside: sixteen drawers
Once the door opens, the chip looks like a small filing cabinet. Every passport on Earth has the same drawers, in the same order. The drawers are called Data Groups: DG1, DG2, and so on up to DG16.
Only two drawers must be filled in every passport:
DG1 holds a copy of the two lines from the photo page.
DG2 holds your face photo, as a real image file.
The rest are optional, and each country picks what to use. The interesting ones:
DG3 and DG4 hold fingerprints and iris scans. These drawers have an extra lock. The password lines are not enough to open them. The reader itself must show a special government permission slip. Your phone doesn't have one. Border control machines do. So no app can ever take your fingerprints. That's on purpose.
DG11 and DG12 hold extras, like your name in your own alphabet, your birthplace, and who issued the passport.
DG14 and DG15 hold two special keys. These are the anti-photocopying trick. Hold that thought.
And one question you might have: why does DG1 store the two lines again, when they're already printed on paper? Because paper can be faked. Someone can scratch off ink and reprint it. The chip copy is protected by the seal. If the paper and the chip ever disagree, the paper is lying.
The seal: how you know it's real
So far the chip is just storage. A bad guy could build his own chip and fill it with fake data. So how does anyone know the data is really from the government?
This is the job of the seal, the SOD. And it works like a lunchbox note.
Imagine your government packs the chip like a lunchbox. Before closing it, it writes a note: "This box contains one photo, one set of details, one set of keys." Then it signs the note. If anyone swaps the apple for a cookie, the note won't match the box anymore, and everyone can see it.
The real version uses fingerprints of data instead of words. Every drawer gets a fingerprint (change even one letter inside, and the fingerprint changes completely). The seal lists all the fingerprints, and the government signs the list.
One more question, though. How do we know the signature is real? Because signatures come in a chain. Stamps on stamps:
Every country has one master stamp. It's too precious for daily use, so it stays locked away. It only comes out to approve everyday stamps, and the everyday stamps sign the actual passports. Countries share their stamps with each other through a shared directory. So a machine anywhere in the world knows which stamps to trust.
Checking a passport is three questions:
Do the drawers match the fingerprints on the seal?
Is the seal signed by a real everyday stamp?
Was that everyday stamp approved by the country's master stamp?
Three yeses means: this data is exactly what the government wrote. Not one letter has changed. This check has an official name, Passive Authentication, but it's really just those three questions.
dew
The photocopier problem
There's one hole left. The seal proves the data is real. It doesn't prove the chip is real.
Think about it. Everything on the chip can be read. So a bad guy could copy all of it, seal included, onto a blank chip. A perfect photocopy. It would pass all three questions.
The fix uses those keys in drawers DG14 and DG15. Each key has a twin, a private key, buried inside the chip's hardware. The private key can never be read out. Not by your phone, not by anyone. It can only be used, inside the chip.
So the reader plays a trick. It makes up a random sentence and says: "sign this for me, right now." The real chip can, using its buried key. A photocopy can't, because the buried key was never readable, so it was never copied.
It's like calling a friend and asking about something only the real friend would know. A voice imitator has all the public facts, but fails the personal question.
This trick also has official names, Active Authentication and Chip Authentication (an older and a newer flavor of the same idea).
So the whole trust story is three lines:
The handshake proves you're holding the open passport.
The seal proves nobody changed the data.
The trick question proves the chip isn't a copy.
Why I care
Now think about what a passport really is. It's a package of facts about you, sealed by your government, sitting in your pocket. And your own phone can open it and check the seal.
That opens a door. If your phone can verify the package itself, you never have to hand the whole package to anyone again.
That's the idea Self is built on. Your phone reads your passport, checks the seal, and then builds a proof on top of it. The proof says one thing, like "this person is over 18," and nothing else. The app you show it to never sees your name, your photo, or your number. Just a yes. And it can trust the yes, because the government's seal sits underneath it.
But even if you never touch any of that, this is a fun thing to know. Next time you tap your passport at an airport gate, you'll know the whole conversation happening in those two seconds. A handshake with a printed password. A filing cabinet opening. Three questions about a seal. And one trick question to catch photocopies.
Not bad for a chip with no battery.



