whatisgithub

What is cnie-python-tools?

hufon/cnie-python-tools — explained in plain English

Analysis updated 2026-05-18

93PythonAudience · researcherComplexity · 5/5LicenseSetup · hard

In one sentence

An experimental Python tool that reads the chip in newer French ID cards through a smart card reader, extracting the photo and printed personal data.

Mindmap

mindmap
  root((repo))
    What it does
      Authenticate to chip
      Set up encrypted channel
      Read photo and text data
      Verify data hashes
    Tech stack
      Python
      pyscard
      PC SC drivers
    Use cases
      Research ID card security
      Extract card photo
      Verify card data integrity
    Audience
      Researchers
      Developers
    Limitations
      No fingerprint access
      No iris scan access
      No full certificate check

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Research how the chip in a French national identity card authenticates and protects its data.

USE CASE 2

Extract the machine readable text and photo stored on your own identity card for testing.

USE CASE 3

Verify that the data read from a card's chip matches its stored security hashes.

USE CASE 4

Learn how PACE-CAN authentication and secure messaging work on real government issued smart cards.

What is it built with?

PythonpyscardPC/SC

How does it compare?

hufon/cnie-python-toolsagricidaniel/claude-shortscalesthio/generative-media-skills
Stars939393
LanguagePythonPythonPython
Setup difficultyhardmoderateeasy
Complexity5/53/52/5
Audienceresearcherdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires a compatible PC/SC smart card reader plus OS-level driver packages before the Python tool will work.

Use, modify, and share freely, including for commercial purposes, as long as you keep the copyright notice.

So what is it?

This is an experimental Python toolkit for reading the chip inside the newer French national identity card, using a physical smart card reader plugged into your computer. It is built for education and research, and the author says it should only be used on cards you own or have explicit permission to read. Since 2021, French identity cards have carried a chip that stores a person's basic details and photo in a standardized format used on passports and ID cards worldwide. To talk to that chip, the tool first proves it has permission by using a six digit access code printed on the front of the card, then sets up an encrypted channel so nothing sent back and forth can be read by anyone else nearby. Once connected, it reads the different sections of data stored on the chip: the machine readable text at the bottom of the card, the passport style photo, and some additional personal fields such as address, birth place, and height, though those extra fields are read on a best effort basis since their exact layout is not fully documented. It also checks the digital hash values on the card to confirm the data has not been tampered with, though it does not yet verify the full certificate chain behind those hashes. Importantly, the tool cannot read fingerprints or iris scans stored on the chip, since those are locked behind a separate government controlled security layer that requires an official terminal certificate the tool does not have. It needs a compatible smart card reader, works primarily with a handful of tested contact readers, and one contactless reader has also been confirmed to work by the community. Setup requires installing a smart card driver stack on Linux, then installing the Python package itself, after which a single command line tool dumps the card's contents to a folder as both raw files and a structured summary file. The project is released under the MIT license.

Copy-paste prompts

Prompt 1
Help me set up the PC/SC smart card driver stack on Linux so this tool can talk to my card reader.
Prompt 2
Walk me through what the six digit CAN code does during the PACE-CAN authentication step.
Prompt 3
Explain what each data group like DG1, DG2, and DG13 stores on the card and why some are best effort.
Prompt 4
Show me how to run cnie-dump and interpret the resulting summary.json file.

Frequently asked questions

What is cnie-python-tools?

An experimental Python tool that reads the chip in newer French ID cards through a smart card reader, extracting the photo and printed personal data.

What language is cnie-python-tools written in?

Mainly Python. The stack also includes Python, pyscard, PC/SC.

What license does cnie-python-tools use?

Use, modify, and share freely, including for commercial purposes, as long as you keep the copyright notice.

How hard is cnie-python-tools to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is cnie-python-tools for?

Mainly researcher.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.