Skip to main content

Documentation Status License: MIT GitHub issues GitHub release (latest by date) GitHub top language pre-commit.ci status

Python DESFire

Full documentation is available at read the docs.

The MIFARE DESFire product provides high security RFID key tokens than can be used for contactless identity, access control or payment applications.

This package provides a simple interface of interacting with DESFire chips using pure Python. It currently supports managing keys, applications and file operations, which should cover the majority of use cases. AES-128 is fully supported both, DES/3DES currently only receives limited testing up to the extend that is needed to change the default key and create applications.

Both PC/SC readers as well as the popular PN532 reader (only UART, no SPI or I2C as of today) is supported. Please make sure to install the correct extra dependencies.

Core features:

  • Compatible with all PC/SC readers supported by pyscard or PN532 reader using UART (using pyserial as only additional dependency)
  • Support for AES and ISO authentication (DES, 2K3DES and 3K3DES). No support for legacy authentication.
  • Full crypto support including CMAC and CRC validation on all commands that require it
  • Key management change and create keys on PICC and application leven
  • Application management create and delete applications
  • File management support for standard data files is implemented, other file types are currently not available

Currently, the library has been used and tested with EV1 cards and CSL USB Reader, but other PC/SC compatible readers should work the same. It is also tested using PN532 readers, although I recommend using the Adafruit reader for better compatibility.

[!IMPORTANT] Note that NXP does not release the DESFire documentation to the public, NDA signature is required to obtain this information. The author of this package has not signed this NDA, nor does he have access to the documentation. This package has been created based on other open source work, see the Credits section below for details.

This also means that there is very limited ability to guarantee a correct implementation of all commands. The package has mainly been tested using DES and AES-128 keys. If you encounter any issues, please feel free to raise a ticket and/or submit an MR.

Documentation Sources and Credits

This library would not be possible without other amazing open source contributions that served as source of information when creating this package. Credits go to the creators and maintainers of the following repositories, in no particular order:

Release files for python-desfire 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-desfire 0.1.5
File Size Uploaded
python_desfire-0.1.5.tar.gz 29.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-desfire 0.1.5
File Interpreter ABI Platform
python_desfire-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 64.7 kB

Release files / python_desfire-0.1.5.tar.gz

Download URL python_desfire-0.1.5.tar.gz
Size 29.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0d92af004b681ce5cb851b7f4907147847c5ada45101e8fddf8c2a61883ed67e
BLAKE2b-256 checksum
How to use checksums
cbdfa2a2e84a2c5d4ee8f8ed17a14b800fdea93163d17a51bb4a33d8b90f9f81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / python_desfire-0.1.5-py3-none-any.whl

Download URL python_desfire-0.1.5-py3-none-any.whl
Size 35.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b39455fc7b5ad600826c44c1604cdf710efd92292417b4732c6caefabf5792c
BLAKE2b-256 checksum
How to use checksums
099bacdbb31e6a6f1488c1817bab5f613417535b4b1707f141838607c8d4d1a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page