Skip to content(if available)orjump to list(if available)

The cryptography behind electronic passports

miki123211

> The filesystem architecture is straightforward, comprising three file types: master files (MFs) serving as the root directory; dedicated files (DFs) functioning as subdirectories or applications; and elementary files (EFs) containing actual binary data.

AFAIK, this is the exact same protocol used in all other kinds of smart cards, including credit / debit (EMV) chip cards, both standard and contactless, as well as SIM cards.

Not sure whether public transit, employee ID and TV cards use it too, but I wouldn't be surprised.

tonymet

Washington State “Enhanced ID” (which is also REALID compliant) was one of the first DHS-approved IDs from way back in 2005 . Ari Jeuls et al (see below) found a number of vulns including remote cloning and remote disablement, publishing their findings a few years after the launch.

I talked to WA DOL Privacy Officer about it a couple years ago, and found that the tech platform had remained unchanged. WA maintains the printed material and DHS maintains the RFID package which is over 20 years old now .

Think of other 20 year old tech and how safe you feel having that in your wallet.

https://www.arijuels.com/wp-content/uploads/2013/09/KJKB09.p...

Edit: clarified Enhanced ID because there are differences in the program

mothballed

Enhanced ID allows border crossing for most cases covered by the passport card, while real ID does not, for reasons that are unclear to me.

tonymet

My understanding is that you can be RealID compliant without checking for citizenship. And in theory RealID doesn’t have to have RFID in the chip. Enhanced ID has to have both of those requirements.

khuey

I can't speak to the technical side of things but legally for a state to issue a REAL ID they have to verify that the person is allowed to be in the US at the time of issuance, not that they are citizens, and, if applicable, they have to shorten the validity of the ID to the period that the person is expected to be allowed to be in the US.

wartywhoa23

But what kind of cryptography makes it mathematically impossible for bribed officials to issue perfecly legal and cryptographically protected fake passports, and if none, then what problem do electronic passports actually solve other than creating even more opportunities to surveil common people?

miki123211

1. It's easier to centralize cryptographic cert issuance than passport issuance.

You may allow embassy personnel to issue passports, while still requiring a computer system in the homeland to verify that the person actually exists in some government register (and that photos match) before the certificate can be issued.

If you give embassy personnel blank passport templates, they can issue passports with completely fake identification details, for people who have never existed. The moment computers get into the mix, that may no longer be possible, or at least leave an audit trail.

2. There's no risk of surveillance. Reading data from the chip still requires you to read the MRZ, so you can't do that remotely.

There's nothing a chip gives you that you wouldn't get from a normal passport (beyond a very easy and hard-to-fake way to verify that the passport is authentic).

alibarber

Usually some state's passports grant the holder more privileges than those issued by another state precisley because of the perceived risk of them being (not) obtained by fraud. Your genuine Sealand passport is less practically useful than a genuine Finnish one for use in the context of international travel.

The cryptography aspect is basically preventing the corrupt Sealand government official from stamping out ones that might be confused for, for example, a Finnish one.

Sealand[1] being used as an example least likely to cause offense - but you can understand that most governments around the world really do want to ensure that they are the only ones issuing their passports, and hence what that means for their citizens.

[1] https://en.wikipedia.org/wiki/Principality_of_Sealand

SR2Z

Here is a list of trivially obvious ways that they solve problems:

1. They can be read significantly faster, or even automatically, which cuts down on long border control lines even when the biometrics are not used.

2. They are significantly harder to forge without the consent of the issuer, even for other nation-states.

3. They can store biometrics that allow the bearer's identity to be verified automatically and with a very high degree of confidence.

I am all for being skeptical of the government's actions, but passports are a ridiculous place to have such a strong kneejerk reaction. You're already on a list and your movements are being tracked. ePassport features are only more convenient when compared to older passports.

lkurtz

Cryptography is a tool that turns arbitrary problems into key management problems. It doesn't solve problems, but it constrains them in useful ways.

jakobnissen

That's an overly cynical take. Obviously it means that a criminal organization would need to recruit officials before they could issue fake passports. Which is already pretty hard.

And maybe they would need to recruit multiple officials across multiple agencies. And if these agencies has internal policing, then even if they manage to do that, they now have another vulnerability where the criminal operation can be discovered and sabotaged.

lxgr

Nice overview, although it seems to be missing one of the most important changes from AA to CA: AA uses signatures for challenge/responses, which are by definition non-repudiable.

This means that any second party with access to your passport can prove to any (unaffiliated/untrusted) third party that they had access to your passport and can even include something like a cryptographic timestamp to prove that they did so at a given point in time.

There were even some experimental schemes explicitly making use of ICAO biometric passports as a "proof of personhood", as far as I remember, but given that the ICAO scheme does not have any notion of document holder consent (e.g. via a PIN or other means of authentication), there are also significant privacy and security problems.

CA intentionally avoids all of that, since the risk of entities using ICAO passports as unintentional and insecure digital signature tokens was apparently deemed too high.

darkamaul

I never realized how much complexity goes into a passport, the cryptography, authentication layers, and others are mind blowing.

It’s impressive that something so small carries so many trust anchors. I’m wondering how they will manage to upgrade them - for future algorithms without breaking compatibility.

Muromec

Passports and money are quote complex to be forgery-resistant. With internet existing it turns out, it's easier to discard the physical form altogether and only leave pure chain of trust digital form.

It already happened to money, it is slowly happening to passports and ids too.

> I’m wondering how they will manage to upgrade them - for future algorithms without breaking compatibility.

The same way as always -- introduce a new version of the passport, which can as well be verified through a completely different system altogether.

lxgr

What's even more impressive is that this technology has been around for decades!

> I’m wondering how they will manage to upgrade them - for future algorithms without breaking compatibility.

Just like all other smartcard systems: Very, very slowly. Credit and debit payment cards with a smartcard (EMV) chip have similar issues – even small patches take multiple years due to the relatively long average card validity.

SJk7TAy

I have a very practical question with big political implications: Can electronic passports be used to make large-scale elections without government involvement?

I am thinking of authoritarian countries that issue modern e-passports but do not allow free elections. Can activists organize an election for all citizens of that country in some online form, asking the voters to scan their passports using their phones, so that

- only legitimate citizens (who have passports) can vote - votes remain anonymous - everybody can vote only once - the whole election can be audited

Muromec

>Can activists organize an election for all citizens of that country in some online form, asking the voters to scan their passports using their phones, so that

By the point said activists reach organizational capacity to do so, they have already won and can hold the vote basically with scanning a qr code with a simple app.

>only legitimate citizens (who have passports) can vote

this makes no sense as a requirement in a situation you described.

j16sdiz

> authoritarian countries that issue modern e-passports but do not allow free elections

You are trying to solve a political problem with a technological solution.

1. Many authoritarian countries don't allow freedom of travel (i.e. it is not easy to get a passport)

2. If they don't care free election, what's stopping them issuing more passport just for voting?

3. What's stopping them confiscating or revoking your passport?

alphazard

Yes, as long as the passports implement a signing scheme, and the set of valid public keys (the electorate) can be agreed upon. If you can sign arbitrary data, then you can sign other public keys, including whatever the voting system requires.

Vitalik has a great blog post about blockchain voting.

https://vitalik.eth.limo/general/2021/05/25/voting2.html

You probably wouldn't want to use the cryptography on the passports themselves to implement the voting system. You probably want to use one of the general purpose zkSTARKs or multi-party-computation systems.

morshu9001

Can it be anonymous though? Ie you as a citizen can check that the outcome didn't count illegitimate votes, and that it included your vote, but can't tell who voted each way or at all.

alphazard

Yes, it is possible to anonymously aggregate votes from a set of public keys, and ensure that no key has voted twice. It's also possible to ensure that one's own vote was included in the total.

The fact that this is even possible is deeply un-intuitive as it requires some of the most sophisticated cryptography. That's probably the greatest barrier to adoption. When people think of electronic voting, they think about trusting a company to make machines that operate on plaintext, and require humans to guard access to the machines. They aren't thinking about systems that are provably correct, where it is more likely for an asteroid to wipe out the country conducting the election than for the election results to be incorrect.

For the details and tradeoffs, I highly recommend Vitalik's blog.

gruez

hence why

>You probably wouldn't want to use the cryptography on the passports themselves to implement the voting system. You probably want to use one of the general purpose zkSTARKs or multi-party-computation systems.

stuffn

This seems like navel gazing. Under OP's constraints it wouldn't matter what the tally is. The authoritarian won't cede power because they lost by a cryptographically secure election. They'll either

A. Force the cryptography to be weak to provide plausible deniability

B. Issue more passports for "citizens" that "voted" for them

C. Refuse the count and just keep power

Leaders don't cede power because their citizens are angry. Especially not in authoritarian countries.

morshu9001

The authoritarian govt controls who gets passports and can create fake people if it wants.

embedding-shape

I think once an authoritarian government is holding elections, regardless digital, analog or anything else, they can manipulate the results, there is no 100% foolproof way of holding honest elections when the top authority might not be honest.

morshu9001

See also: e2ee on Facebook Messenger

iso1631

> authoritarian countries that issue modern e-passports but do not allow free elections

Those tend to not issue passports (of any kind) to many citizens.

Then there's access. In America for example only half the adults in the country even have a passport, and I suspect that skews quite heavily towards one demographic. Do you think that India, Nigeria, or Russia have more equitable access?

And even if they did, what stops the state issuing extra fake passports to citizens they want to vote.

of course then there's key elements of a free election, freedom of access to the ballot paper, freedom to campaign the same as others, freedom from imprisonment because you are running against the incumbent leader, having each vote being worth the same. Many countries prevent people in jail from voting, or even people who used to be in jail. Many countries give more power to one constituency than another, almost all have some level of unequal access to campaigning.

It's not a "Free election" or "no election".

The actual casting of the vote is only part of the story.

mothballed

The amount of human effort, labor, and heartache put into squabbling over where someone was born or was naturalized is absolutely mind blowing.

z2

It is one of the core concepts of sovereignty--defining a territory and then deciding who or what gets to be inside. Along with a government with a monopoly on violence used inwards, and some foreign relations directed outwards, you have the recipe for a modern country.

toomuchtodo

Also, access to nation state provided benefits, which is limited because resources are (currently) limited.

alphazard

A democracy cannot function if the electorate is not well defined. They are vulnerable to Sybil attacks, same as the distributed ledgers and hash tables.

axus

The native Americans tolerated immigration, and we all know what happened to them.

On the topic of the article, every hotel outside the US I've used has asked for my passport; I didn't know that a copy of the details exposed weaknesses on the electronic side.

hylaride

Passports are much more common in some countries, and for most of the others where it's not you were probably obviously a foreigner based on your appearance, accent, or the fact you were likely in a tourist area.

Many countries also have mandatory registration of foreign visitors that hotels do automatically so they know the drill.

Phemist

Yes, as this blog post doesn't mention it, the "password key" is specifically derived from your Date of Birth, the document's Date of Expiry and the Document Number. For the specimen document in the blog post these values are respectively 740812 (YYMMDD), 120415 (YYMMDD) and L898902C3. They are contained in both the MRZ and the VIZ (Visual Inspection Zone).

Considering the Date of Birth and Date of Expiry are necessarily limited in entropy, one should take care in protecting their Document Number as it is the greatest source of entropy for the derived "password key".

ghaff

I very much doubt if every hotel I've stayed in outside the US has asked for my passport but certainly many/most have. Never really paid much mind.

As a US resident, I have often been asked for a drivers license in the US and it was actually an issue at one point when I had lost it though I was able to work around with some difficulty. I suspect the details were some combination of local/state/and hotel policy.

stackskipton

Most hotels I’ve stayed at ask for ID. If you are foreign, they want a passport only.

I have had issues with US hotels accept US passports and fought with one over it.

iso1631

> Every hotel outside the US I've used has asked for my passport

Every hotel in the US and any other country has asked for my passport (and credit card), but I'm not American.

The textual information on the page of my passport is basically public knowledge, like a phone number or an american social security number. It's rare that a hotel takes the passport out of sight (and potentially scan the chip), but a photocopy is fairly frequent.

xhkkffbf

Tolerated? Some welcomed it and some actively fought several wars against it and lost. Many tribes conducted some kind of economic transaction that traded land for something else.

mistrial9

Various California native people practiced slavery and indentured servitude on each other before the arrival of Spanish Catholics. The Mayan people went further than that.

wat10000

The USA welcomed immigration and we all know what happened to them.

15155

How do you offer entitlements and quality healthcare to the entire population of the world without money?

Who should be allowed to participate in the decision-making process that allocates these finite resources?

ceejayoz

Who said anything about "without money"?

15155

Money is finite - where is this money coming from?

Vacuuming the (imaginary - we're using feelings here, let's not split hairs on things like 'markets') accounts of every billionaire and redistributing these funds evenly amounts to singular thousands of dollars to just citizens.

The overwhelming majority of actual taxpaying citizens don't pay enough tax to cover their per-capita share of government spending, is there some factual evidence to suggest that unlimited economic migrants would? (or could?)

paddleon

who said anything about finite?

morshu9001

It's because generations/families are a thing. Even the countries taking the most immigrants like USA aren't expecting an immediate benefit, they're thinking 1-2 gens later.

Danjoe4

Go to South Sudan and tell me if you still feel the same way.

foofoo12

I was going to respond, but when I looked in my bag of trollfeed I saw it contained fuck all.

IncreasePosts

Do you treat your immediate family better than an absolute stranger?

If so, why? Aren't they all just people?