frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Reading NFC Passport Chips in Linux

https://shkspr.mobi/blog/2025/06/reading-nfc-passport-chips-in-linux/
164•robin_reala•6h ago

Comments

stavros•4h ago
Hm, he doesn't say whether he managed to decrypt the passport with the missing checksum in the end, or whether the piercing doesn't matter because it's trivial to calculate the checksum from the rest of the info, or how long that would take. Did I miss it, or is that useful information omitted?
edent•4h ago
OP here. It is trivial to create the missing checksum. It is detailed at https://shkspr.mobi/blog/2025/06/reading-nfc-passport-chips-...
stavros•3h ago
Yep, I saw that section, but thought that the next section was a continuation of it. Maybe you could say a few more things about it, like "since it was trivial to recreate the checksum, I managed to read my passport fine, and then wondered what it would take to guess the entire MRZ" as a segue.
dzhiurgis•4h ago
Hol up. So what stops you from uploading custom photo + metadata onto random chip and planting it in a fake passport?
23434dsf•4h ago
Conscience
ragebol•3h ago
Expectation of punishment
neoromantique•4h ago
Considering how often it is done, not much?
agnishom•3h ago
What makes you think it is done often?
crowbahr•1h ago
(It's not)
edent•4h ago
The data are signed with the passport issuing authority's private key.

So you could implement a chip which reacts like an official passport. When the border guards see that the signature is invalid, you can explain how it's just a prank and you'll all have a jolly good laugh about it.

23434dsf•3h ago
So if I strolled through the airport with a high power NFC reader/writer, I could ruin a lot of peoples trips?
daveoc64•3h ago
What makes you think you could do this?
lukan•3h ago
"The NFC chip in a passport is protected by a password. The password is printed on the inside of the physical passport. As well as needing to be physically close to the passport for NFC to work0, you also need to be able to see the password."
wkat4242•3h ago
Yes but. In Europe this tech is also in our id cards whether said passport is printed on the outside (considering it's just a credit card format). You still have to see it but it doesn't have to be opened to the right page like a passport.

Both sides even have the info printed. One side in human format, the owner side in machine readable.

lukan•3h ago
Yes, but this still means a attacker needs to have physical access to the passport?
tialaramex•2h ago
They need to know the information which functions as key. Because many people don't trust government secrets, the information used for this purpose on a passport is actually just facts about you which were already printed in your passport, plus the passport number. The machine summarises these in a "Machine readable zone" but they're nothing you didn't know.

For a random traveller you can probably guess roughly how old they are, which is a few bits for the date-of-birth, and maybe you could strike up conversation and discover their name (or maybe it's printed on baggage, called out by fellow travellers etc.) but yeah it'll be very hard

For a very well known person you can likely discover everything except the passport number and you might get a decent guess at that from knowing roughly when it would be issued.

lukan•2h ago
"For a very well known person you can likely discover everything except the passport number and you might get a decent guess at that from knowing roughly when it would be issued."

From a very well known person you could probably also steal everything you need directly, if your purpose is to create damage.

wkat4242•2h ago
Kinda the same as with the NFC.

You can read from a small distance, probably further than you can read an NFC tag with your phone. And you can automate both on a phone (OCR and NFC)

edent•3h ago
No.

NFC chips can be locked. That means the data can't be overwritten. No matter the writer, nor its strength, you can't overwrite a passport's chip.

I suppose you could use an EMP - but that would ruin a lot more than just some trips.

crowbahr•1h ago
In addition to the mechanisms people are describing here - passports have a metal mesh in them to disrupt NFC signals. It's not a full faraday cage but it works on similar principles. The passport has to be _open_ to be read from, and then only after you transmit the MRZ will you get anything.
raron•52m ago
> passports have a metal mesh in them to disrupt NFC signals

I don't think that is universally true. At least I can read my closed 2 years old passport with my phone.

crowbahr•3m ago
Hmm the American passports have the mesh afaik - I _thought_ it was part of the ICAO docs (not that that means people do it but still...)
wkat4242•3h ago
I doubt border guards know what a cryptographic signature is. But they'll probably have a big red marker that tells them to hold you and get someone who knows :)
Nextgrid•3h ago
I remember reading an article or paper that checked the validity and spec compliance of various nations's passports, and found lots of variation, so a valid signature isn't actually a guarantee even in a legit passport.
vbezhenar•2h ago
Invalid signature probably will result from chip degradation or other electronic failures and I'm pretty sure that you won't be the first they see. Passport is supposed to be valid without any digital things, so they'll proceed with ordinary procedures, with manual entry of data from passport.
remcob•3h ago
Besides the data being signed as already mentioned, the protocol is interactive and custom to passport documents. So you can’t just put it on any programmable NFC tag. I also doubt you can buy programmable ones implementing the passport protocols. But maybe you can find general purpose programmable ones you can implement the protocol on.

There are also optional subprotocols that allow the chip to be authenticated (i.e. proof it knows a private key). These prevent copying valid signed data to a different chip.

crowbahr•1h ago
Yeah but since the USA doesn't sign on to anything above basic auth (MRZ unlock) everyone also has to work on the more basic level. Kinda unfortunate.
SXX•2h ago
Countries like UK actually have publicly database for e-visas (share code) that can easily be verified via online API. So probably at least some foreign governments can cross validate some of passport data with each other.
crowbahr•1h ago
Countries all know each other's signing certs. There's a question of how much they _trust_ the other country but the certs are all public.
frelp•4h ago
I wonder if you could create a chip that could break the passport reader system. That could really disrupt things, so hopefully that’s not possible.
hypeatei•3h ago
Burning a zero day like that in front of border / travel officers will probably land you in prison very quickly.
edent•3h ago
The ICAO documents contain the complete specification. It is moderately complex and involves twiddling lots of bits. So I've no doubt that a passport reader somewhere isn't doing bounds checking properly.

But you could achieve much the same effect with a hammer.

giantg2•3h ago
But could a hammer deliver a malicious payload that could spread in the system? I'm not sure if you could do that with data on the chip, but maybe.
monai•1h ago
You can transmit arbitrary data in certain steps of the passport reading process. The possibility of disruption depends on whether the reading system has bugs exploitable by the incoming data.

I've seen crashes in PKCS#11 drivers when reading cards with malformed data. So, the possibility, in theory, is always there.

wkat4242•3h ago
Many passports also contain digitized fingerprint scans. But those are even harder to access. You need a private key that only governments have.
aneutron•1h ago
Sounds fairly sensible to me
SXX•2h ago
I always wondered isn't this kind of specification also have digital signature of the passport issuer or something? Otherwise how do other countries can verify it's not a fake one?

I read this article, but seems like any information about it is kind a omited.

janmo•2h ago
The passports contain a digital signature and a DSC (Document Signing Certificate). This DSC is signed by a CSCA certificate which you can download from the ICAO Public Key Directory. Link here: https://pkddownloadsg.icao.int/
landgenoot•2h ago
Yes. There is even an active function that allows you sign arbitrary bits to check if the passport actually contains the private key. Otherwise you could spoof a passport by just replaying the government signed data.

Source: I have been working on a blockchain implementation in the past that was compatible with the cryptographic functions in an NFC passport. Basically using a standard NFC passport as a cold wallet.

Fun fact. The cryptographic system even differs per country.

E.g. the Dutch don't trust the NIST elliptic curves so use the brainpool curves instead. Some other countries are still using RSA iirc.

SXX•1h ago
Thanks for details.

Actual validation methods would be actually cool to read about. Since if we ignore legal diffuculties of storing the data then we can actually use passport cryptography as something like actual proof-of-human without pesky 3rd-parties.

bluesign•1h ago
but why would passport contain a private key ?
tauntz•2h ago
The spec for machine readable travel documents is sadly not the most concise but if you're interested in the nitty-gritty details of how to validate documents, how to read data from them, etc then jump into ICAO 9303:

https://www.icao.int/publications/documents/9303_p10_cons_en...

https://www.icao.int/publications/documents/9303_p11_cons_en...

But please keep in mind that this is just the spec for how it's supposed to be implemented. Real world implementations of it have lots of creative interpretations of the spec in addition to straight bugs in their implementations, so if you're going to write software that has to work with various different documents issued by various governments, you'll have many fun debugging sessions :)

chatmasta•38m ago
It seems every country that moves to electronic travel authorization has an app that requires me to verify my passport with this method. I have a fairly new passport, issued in the last few years, and a recent phone… and this process is a huge pain. I need to massage my passport with my phone for a minute, maybe I get a bite, hold it still… oops, start over… try again… okay, use our partner’s face ID recognition service instead… ugh it’s horrible.

I don’t know if the issue is the very low power chip in the passport, or some damage or what… but I dread the process any time I need to do it.

doublerabbit•18m ago
It's just a future fantasy that isn't fit for our dystopian world. I'm still waiting for the fantasy of fixed potholes.
nemoniac•1h ago
Here's a tidied up version of the Python code to generate the MRZ from the passport data. It also corrects a padding error.

    https://pastebin.com/k0Tty22a
My Dutch driver's licence has a single MRZ-like line across the bottom. It seems to encode the country and licence number but I can't make any sense of the rest of the line. Anyone have any leads?

The Hardest Bluffing Game

https://www.theatlantic.com/magazine/archive/2025/07/mheibes-iraq-game/682901/
1•gmays•1m ago•0 comments

The JPEG XL Image Coding System

https://arxiv.org/abs/2506.05987
1•ksec•3m ago•0 comments

Cryptic Isoprene Emission of Soybeans

https://www.pnas.org/doi/10.1073/pnas.2502360122
1•PaulHoule•3m ago•0 comments

Patterns for Compounding the Value of LLM Interactions

https://spin.atomicobject.com/patterns-llm-interactions/
1•philk10•4m ago•0 comments

Show HN: FRGVN – AI-powered app turns journal into devotionals and worship music

https://apps.apple.com/us/app/frgvn-journal-ai-devotional/id6745778888
1•Oftenalways•4m ago•0 comments

All Hail the Slop Bowl, Lunch of Our Ancestors

https://www.atlasobscura.com/articles/all-hail-the-slop-bowl
1•strict9•5m ago•0 comments

Show HN: A PDF metadata (and text data) extractor

https://pdf-miner.streamlit.app/
1•metalshanked•5m ago•1 comments

Show HN: Automatic Testing for GitHub PRs

https://www.playmatic.ai/
2•ElasticBottle•5m ago•0 comments

Show HN: We created a platform to make it easy to find tech internships

https://internshipp.com
1•yogini•5m ago•0 comments

LibreOffice 25.8 Beta1 is available for testing

https://qa.blog.documentfoundation.org/2025/06/13/libreoffice-25-8-beta1-is-available-for-testing/
1•neustradamus•5m ago•0 comments

Intel lays off engineers in California

https://www.tomshardware.com/pc-components/cpus/intel-lays-off-hundreds-of-engineers-in-california-including-chip-design-engineers-automotive-chip-division-also-axed
2•radialstub•6m ago•0 comments

Firefox 140 Released with "Unload Tab", CSS Custom Highlighting API

https://www.phoronix.com/news/Firefox-140
1•ksec•8m ago•0 comments

Sony Opposes Trademark for 'Naughty Cat' Because 'Cat' Is Too Similar to 'Dog'

https://www.techdirt.com/2025/06/24/sony-opposes-trademark-for-naughty-cat-because-cat-is-too-similar-to-dog/
2•hn_acker•10m ago•0 comments

Gaza death toll exceeds 56,000 as Israeli assault persists

https://truthforge.substack.com/p/gaza-death-toll-exceeds-56000-as
2•ahmetcadirci25•12m ago•4 comments

Openfire 5.0.0 Released – Open-Source – Java XMPP/Jabber Server

https://discourse.igniterealtime.org/t/openfire-5-0-0-a-new-era-of-real-time-communication/95627
2•neustradamus•13m ago•0 comments

LakeFS adds REST catalog support for data version control on structured data

https://lakefs.io/blog/lakefs-iceberg-rest-catalog/
1•edogrider•14m ago•0 comments

China Strikes Hard: Chinese Satellite Pulverizes Starlink with a 2-Watt Laser

https://www.msn.com/en-us/news/technology/china-strikes-hard-chinese-satellite-pulverizes-starlink-with-a-2-watt-laser-36-000-km-from-earth/ar-AA1HbNWi
7•thesecretceo•16m ago•3 comments

Deep Down the Rabbit Hole: Bash, OverlayFS, and a 30-Year-Old Surprise

https://sigma-star.at/blog/2025/06/deep-down-the-rabbit-hole-bash-overlayfs-and-a-30-year-old-surprise/
5•Deeg9rie9usi•16m ago•0 comments

Show HN: EvoAI.tools – Discover and share the best AI tools

https://evoai.tools
1•quantummint•20m ago•0 comments

HDMI 2.2 will support 16K video at 60Hz

https://www.theverge.com/news/692052/hdmi-2-2-specification-released-96gbps-audio-sync-16k
4•mfiguiere•20m ago•0 comments

4 Month Journey to Cissp – 2025

https://www.lampysecurity.com/post/4-month-journey-to-cissp-2025
1•lampysecurity•20m ago•0 comments

Talk to the Sculptures of the Gardens of Versailles

https://en.chateauversailles.fr/news/life-on-estate/talk-sculptures-gardens-versailles
1•gnabgib•21m ago•0 comments

GeForce RTX 5050

https://www.nvidia.com/de-de/geforce/graphics-cards/50-series/rtx-5050/
1•doener•22m ago•0 comments

Obesity drugs show promise for treating a new ailment: migraine

https://www.nature.com/articles/d41586-025-01976-2
2•timbilt•25m ago•0 comments

AI-Generated Android Apps: The Good, the Bad and the Shocking

https://medium.com/mobile-app-development-publication/ai-generated-android-apps-the-good-the-bad-and-the-shocking-5d99def2027e
1•elye•26m ago•1 comments

Philosophy 101

https://www.evphil.com/philosophy-101.html
2•mathattack•26m ago•0 comments

Tech execs are joining the Army – no grueling boot camp required

https://www.businessinsider.com/tech-execs-just-joined-the-army-boot-camp-not-required-2025-6
2•diggan•27m ago•2 comments

Learning the Simplest AI Unit: A Neuron

https://medium.com/tech-ai-chat/learning-the-simplest-ai-unit-a-neuron-b46dc5d1b48c
1•elye•28m ago•1 comments

Foreign Scammers Use U.S. Banks to Fleece Americans

https://www.propublica.org/article/pig-butchering-scam-cybercrime-us-banks-money-laundering
4•wstrange•30m ago•0 comments

The Guide to the Foundation Models Framework

https://azamsharp.com/2025/06/18/the-ultimate-guide-to-the-foundation-models-framework.html
1•skreep•33m ago•0 comments