The cryptography behind electronic passports

200 pointsposted 3 months ago
by tatersolid

76 Comments

tonymet

3 months ago

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

3 months ago

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

3 months ago

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.

lxgr

3 months ago

Wait, so these IDs essentially just broadcast what amounts to a static identifier wirelessly (which allows tracking and cloning, but not document authentication)? What's the point of that?

Or was there some cryptographic scheme that has since been broken?

tonymet

3 months ago

More or less . They also failed to deactivate the “remote kill” flag for remote disablement

lxgr

3 months ago

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.

miki123211

3 months ago

So, if I understand this article correctly, if a single terminal private key ever leaks, all the protections preventing any random passer-by from reading your biometric data go out the window[1].

You could partially mitigate such a weakness by including "not valid before" and "not valid after" timestamps in the certificates, which would have to be short-lived. Passports would then verify that the timestamp supplied by the terminal is in the correct range, as well as that it is greater than any previous timestamp this passport has ever recorded.

salviati

3 months ago

This would also add the requirement of an accurate internal clock.

throwaway89201

3 months ago

In theory, you can add some more complexity/fragility and have 'time notaries' sign the current time together with a challenge from the passport, verifiable against embedded public keys.

Scoundreller

3 months ago

Driveby bricking of passports, coming to an airport near you!

iancarroll

3 months ago

Not an expert but my understanding is that active authentication only occurs after the basic “I can see the MRZ data” authentication passes first. You can’t skip proving you can read the MRZ in any scenario.

noodlesUK

3 months ago

U.S. passports have a unique shielding which prevents them from being read whilst closed. It’s a low tech solution but I think it’s an amazing example of clever mitigations.

commandersaki

3 months ago

I think this is a similar situation with Felica IC cards in Japan.

usr1106

3 months ago

Not cryptography, but slightly related.

German passports are valid 10 years. When my previous one was maybe 7 years old, to my surprise UK border control told me, your chip is dead. He was very friendly and said that's not a problem.

I never traveled to any country with less friendly border control after that, partly it were pandemic years anyway. But I wouldn't want to experience such surprise at the US border or probably many others, too.

I have no idea where, when, and how the chip got damaged. The passport was only used a couple of weeks every year. It had never been soaked, heated, frozen, severly bent or otherwise mechanically damaged. Once it got a bit moist at a sweaty bike trip in the mountains.

As embedded SW engineer I'd say: It's always the hardware :)

dent9876543

3 months ago

I have same — dead chip.

Cost of replacement is not relevant as the chip and passport are linked, so need a new passport to get that fixed. Not terribly costly. But annoying given that, like you, it is due to no obvious fault on my part.

However it seems pretty routine. All the face-scanning readers eventually (after several attempts and failures) bubble you up into to a process exception that refers you to a human and you get sent into another queue: this time, to be reviewed by a human.

Unless border control are particularly by the book, most of them will simply accept the explanation, and let me directly into the human queue. Sometimes this works out for the better — for all their cleverness, the automated scanners seem particularly tricky for them to keep working reliably. Other times there's lots of families travelling, and I end up waiting a bit longer.

Either way, I'm glad that most of them are alive enough to the issue that time consuming try/fail/repeat/escalate/re-queue part of the process can be skipped.

wartywhoa23

3 months ago

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?

SR2Z

3 months ago

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.

wartywhoa23

3 months ago

> strong kneejerk reaction

Living in a country whose government started a genocidal war in a neighbour one and conscripted hundreds of thousands to become food for vultures in the fields, I have all reasons for strong and quite conscious, as opposed to "kneejerk", reactions against its initiatives.

Thinking that anyone in the world is safe from such atrocities where they live is bit shortsighted, to put it mildly, and the writing is already on the wall if you watch the state of the world affairs. Just imagine trying to avoid being dragged into a meatgrinder started by psychopaths when one's every move requires your ID. Yes, every, because being significantly faster makes for pervasively frequent instead of convenient.

I also envision that this checkpoint frequency will eventually reach the level when people are required to emit constant _streams_ of authentication tokens, which will of course imply it must be done remotely and without any manual consent. That's a perfect use case for the proverbial implanted RFID chips or continuous and ubiquitous biometric scanning, and rejecting that is the absolute hill to die on for people who have any remaining human dignity and love for freedom.

michaelt

3 months ago

For one thing, with printed passports border officials have to recognise all the anti-fraud features on all the passports issued worldwide in the past 10 years.

Quick, what security image on a valid UK passport - a thistle, a daffodil, a rose, a clover, a coat of arms (but not the same coat of arms as on the front cover), a map of the UK, a harlequin pattern, a crown, a lighthouse, a pair of bird wings, William Shakespeare, an oak leaf, a compass, a marine chronometer, the letters UK, the words United Kingdom, a Bermuda-rigged boat, a square-rigged boat, a steamship, or the holder's birth date?

It's a trick question, you'll find all of them; they changed the passport once for brexit, and again after the queen's death. And that's just one document from one country. Far simpler to just hold it to the reader and get a beep.

For another thing, if you're worried about bribed officials - it's much harder to bribe airport border officials if they're required to scan every passport into a computer, and match it against the airline's passenger list.

zenmac

3 months ago

That is true. However, the border guard should also be trained to recognize the passport physically without the electronic tracking. Putting your national security eggs in one digital basket just seems like a disaster waiting to happen.

Digital system can go down or hacked.

alibarber

3 months ago

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

lkurtz

3 months ago

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

Gathering6678

3 months ago

This is an interesting statement I've never thought of before. Makes a lot of sense to me.

miki123211

3 months ago

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).

raron

3 months ago

> 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 were many attack on that.

https://en.wikipedia.org/wiki/Biometric_passport#Attacks

> There's nothing a chip gives you that you wouldn't get from a normal passport

I think your fingerprints are stored on the chip and not on the printed part.

heavyset_go

3 months ago

The history of passports has always been surveillance and control of movement of, and enforcing quotas on, the proles.

In their earliest form, they were documents from your lord that permitted you to travel, and specified where you belonged and where you were allowed to travel to, most often used for internal travel. Later and in general, they were used to keep the poor from moving, for example, to find work elsewhere.

Later Americans used them to limit European immigration based on country of origin, Europeans used them in WWII to do some not good things, Soviets used them to exile or keep undesirables where they wanted them, etc

wartywhoa23

3 months ago

Referring to prior steps of incremental loss of freedoms as excuse for the upcoming is like stabbing oneself with a barbed harpoon one notch deeper under the excuse of it being already quite deep into one's flesh.

FridayoLeary

3 months ago

What's your point? Passports are essential in todays globalist world. I read once that British people travelling through revolutionary france were incredulous and derisive of their insistence that everyone should have a passport. I do believe that the British historically had a much stronger sense of personal liberty as opposed to Europe and you can see remenants of that to this day and that they passed on this culture to the US who are the strongest believers in it.

Spooky23

3 months ago

Electronic passports are about faster processing. The nerd drama is mostly irrelevant.

throwaway290

3 months ago

Faster processing leads to more processing and ID checks for everything. When no one notices total surveillance because it is quietly automatic, God forbid nerds make a drama about it right? America needs more Flock cameras!

jakobnissen

3 months ago

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.

darkamaul

3 months ago

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

3 months ago

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

3 months ago

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.

purpleidea

3 months ago

I had heard something about some sort of counter being incremented in the passport when it's read, which was meant to dissuade you from messing with it, since the next check-in at a border crossing would report this information...

This article doesn't really give much useful information beyond what is mostly well-known.

4rt

3 months ago

i went through border control twice at an airport after going to the wrong gate and when i returned to the uk the e-gates immediately declined to process it (the camera etc. didn't move and e.g. reject the facial recognition, it just immediately said go to the desks). i've always wondered what that was about, how do they know i didn't just go to a third country?

SJk7TAy

3 months ago

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

iso1631

3 months ago

> 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.

j16sdiz

3 months ago

> 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

3 months ago

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

3 months ago

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.

stuffn

3 months ago

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.

Muromec

3 months ago

>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.

morshu9001

3 months ago

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

embedding-shape

3 months ago

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.

miki123211

3 months ago

> 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.

mothballed

3 months ago

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

z2

3 months ago

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.

Spooky23

3 months ago

No, it’s a core tenet of bureaucracy. None of this stuff existed outside of diplomatic circles as recently as a century ago.

Nations and kingdoms have been able to assert sovereignty for eons.

toomuchtodo

3 months ago

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

alphazard

3 months ago

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.

Terr_

3 months ago

Yeah: Determining voting eligibility (nearly synonymous with citizenship) is required unless "outsiders" simply don't exist.

Even if one government spanned literally every sentient being, it'd still need to ensure no citizen votes twice.

15155

3 months ago

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

3 months ago

Who said anything about "without money"?

paddleon

3 months ago

who said anything about finite?

axus

3 months ago

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.

Phemist

3 months ago

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".

xhkkffbf

3 months ago

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.

iso1631

3 months ago

> 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.

ghaff

3 months ago

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.

hylaride

3 months ago

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.

wat10000

3 months ago

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

IncreasePosts

3 months ago

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

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

foofoo12

3 months ago

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

morshu9001

3 months ago

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

3 months ago

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

xhkkffbf

3 months ago

If you want to have "safety net" social programs, it can't be avoided. At least until there's only one government.

iso1631

3 months ago

In the UK I don't need a passport to travel or move home, yet social programs and taxes vary not just between the constituent nations but also between smaller government areas. It's often decried as a "postcode lottery".

I'm certain that it varies even more between American states. Presumably the social "safety net" assistance in California is different to that in Montana. In Alaska people get free money.

Entitlement tends to be based on where you live

drsim

3 months ago

It is a shame you are being downvoted, as it is an admirable ideology: why should someone be (dis)advantaged by the accident of where they were born.

In reality though, 8 billion people hold a wide spectrum of beliefs. I would not want to live in a society with low taxation and low welfare for example. How can I live side-by-side with those that do? Of course, we all have limited choice to move if our society does not match our beliefs.

lazide

3 months ago

It also essentially defines who is asserting ownership over someone (from the sense of ‘who gets the body if they die?’ to ‘who is going to go to war with us if we do something they really don’t like to this person’). Not to mention if someone gets hurt and ends up in a coma or something, who is responsible for the bills?

Which may seem like hypothetical questions to the young or the inexperienced, but are very real concerns hidden behind a veil of generally maintained civility in most of modern society.

morshu9001

3 months ago

Plenty of the 8B people will take you up on that high taxation and welfare offer

wat10000

3 months ago

The downvotes on this comment are wild. Like, you didn't even say we should definitely enact open borders right now. You just lamented how things are. And it is absolutely lamentable. All the responses are basically saying "but we need it!" Which isn't even addressing what you're saying. Plenty of necessary things are lamentable.

blackcatsec

3 months ago

The comments rebuking you appear to forget that by definition GDP and wealth are derived from the population. Wealth for social programs is not a finite resource as the general consensus is that over one's lifetime more wealth is created by one's work effort than is needed to sustain the individual. Capitalism by definition extracts this extra wealth for the private interests of a few. But there's no particular reason that this extra wealth can't be used to assist those that may not even meet the necessity of output of sustaining themselves.

This is a difficult concept for people to understand because they look at their paychecks and go "I'm not deriving so much wealth!" well yeah. A huge, large chunk of your wealth is being extracted for capitalism. And in manners that will be very difficult for you to understand.

I'll try to explain it, though, for the audience that peruses these forums. You're a software developer.

You work for a public B2B software company. Your wealth is being extracted to: Pay for those company pizza parties, pay for the office you work in, pay in to the healthcare system that "your company is paying for" that isn't directly part of the premium you see on open enrollment, paying for the company holiday parties, paying into everyone's various insurance plans to reduce the out-of-pocket costs for everyone in those insurance plans (outside of your company, of course), paying for the CEO's multi-million dollar paycheck, paying for the bonuses of all of the management, paying for shareholder value and dividends, paying for the taxes your company pays, paying for the taxes you pay.

If your existence at your job didn't pay for those things, most companies will tend to lay you off.

And this goes for pretty much the vast majority of workers in the vast majority of jobs.

So saying that more immigrants somehow puts a strain on the system is just by definition incorrect, even if a percentage of those immigrants don't generate the same level of value you do as an individual. Do you think every person in your organization generates the same relative value? Of course not. In most businesses in America, does the janitor generate the same wealth as the CEO?

To be fair, there is a snarky comment to be made there about CEOs--but the objective reality is probably not. But the janitor is still generating some wealth by ensuring a safe, healthy, and comfortable workplace for the employees. Does that mean the janitor is not entitled to income? to healthcare? to benefits? to company holiday parties? to company pizza parties?

Just convert this into a much larger scale of the entirety of a country's population--and well, the answer is that most populations have enough free money floating around somewhere to provide essential services to everyone: education, food, safety and security, health, and likely even housing, electricity, and pretty much any other public service we could provide.

And this scales as a population grows.

blackcatsec

3 months ago

To build on this: One might ask, why don't countries with larger populations directly derive more wealth (particular by measurement of GDP) than smaller populations naturally?

There are a lot of reasons for this, but the short answer is that health, education, and enough individual wealth to explore figuring out ways to generate new revenue streams is important. Authoritarian countries are by nature not able to do this due to limits of their authoritarian nature, not necessarily limits of their population numbers.

It's all intertwined :)

vmykyt

3 months ago

no one launch Doom yet?