Reading NFC Passport Chips in Linux

https://news.ycombinator.com/rss Hits: 9
Summary

For boring and totally not nefarious reasons, I want to read all the data contained in my passport's NFC chip using Linux. After a long and annoying search, I settled on roeften's pypassport. I can now read all the passport information, including biometrics. Background Recreating the MRZ Python code to generate an MRZ Can you read a cancelled passport? Cryptography and other security Can you brute-force a passport? Is it worth brute-forcing a password? Installing Getting structured data Saving the image What didn't work mrtdreader Jean-Francois Houzard's and Olivier Roger's pyPassport beaujean's pyPassport d-Logic Android reader Is it worth it? 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 work, you also need to be able to see the password. The password is printed in the "Machine Readable Zone" (MRZ) - which is why some border guards will swipe your passport through a reader before scanning the chip; they need the password and don't want to type it in. I had a small problem though. I'm using my old passport which has been cancelled. Cancelling isn't just about revoking the document. It is also physically altered: Cut off the bottom left hand corner of the personal details page, making sure you cut the MRZ on the corner opposite the photo. So a chunk of the MRZ is missing! Oh no! Whatever can we do!? The password is made up of three pieces of data: Passport Number (Letters and Numbers) Date of Birth (YYMMDD) Expiry Date (YYMMDD) Each piece also has a checksum. This calculation is defined in Appendix A to Part 3 of Document 9303. Oh, and there's a checksum for the entire string. It's this final checksum which is cut off when the passport cover is snipped. The final password is: Number Number-checksum DOB DOB-checksum Expiry Expiry-checkum checksum-of-previous-digits If you know the passport number, date of birth, and expiry date...

First seen: 2025-06-25 08:17

Last seen: 2025-06-25 16:19