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
pyscardor PN532 reader using UART (usingpyserialas 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.
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:
- Desfire Python: https://github.com/patsys/desfire-python
- EasyPay: https://github.com/nceruchalu/easypay/blob/master/mifare/mifare_crypto.c
- Libfreefare: https://github.com/nfc-tools/libfreefare/blob/c2b0cfa4b9fb0e4be88604f00b7a2405618d5abc/libfreefare/mifare_desfire.c
- ESUP NFC Tag: https://github.com/EsupPortail/esup-nfc-tag-server/blob/master/src/main/java/org/esupportail/nfctag/service/desfire/DESFireEV1Service.java#L1523
- DESfire PDF on Github: https://raw.githubusercontent.com/revk/DESFireAES/master/DESFire.pdf
- DESFire Examples: https://hack.cert.pl/files/desfire-9f122c71e0057d4f747d2ee295b0f5f6eef8ac32.html
Metadata
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| python_desfire-0.1.5.tar.gz | 29.7 kB | Without provenance | Details for python_desfire-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_desfire-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for python_desfire-0.1.5-py3-none-any.whl |
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
|
Security for python-desfire 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.