Skip to content
A convenience API for NFC cards manipulations on top of libnfc.
C Roff Makefile CMake M4 Vim script Shell
Branch: master
Clone or download
darconeous and smortex Add support for JCOP cards with DESFire emulation
Some JCOP cards support native DESFire EV1/EV2 emulation, but the
existing code was ignoring these cards because they didn't have
the expected ATS prefix.

This change updates `mifare_desfire_taste` to also return true
for JCOP cards with DESFire support, allowing them to be used
with libfreefare.
Latest commit 0480b72 Jan 3, 2020
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmake Make CMake emit PACKAGE_VERSION in config.h Jan 26, 2019
contrib Remove subversion artifacts. May 12, 2015
debian Update changelog for 0.4.0 Dec 4, 2013
examples Properly handle edge cases in AN10922 key diversification Oct 29, 2019
test Properly handle edge cases in AN10922 key diversification Oct 29, 2019
.gitignore Ignore new examples Jun 27, 2017
.travis-ci-build Do not use pkg-config(1) to search for libnfc Jun 26, 2017
.travis.yml Build test then run them Jun 26, 2017
AUTHORS Updates invalid email address Dec 3, 2013
CMakeLists.txt Make CMake emit PACKAGE_VERSION in config.h Jan 26, 2019
ChangeLog Update changelog for 0.4.0 Dec 4, 2013 Fix issues for NTAG21x tags Mar 9, 2018
NEWS Updates NEWS file Jan 20, 2013
TODO Add updating instructions. May 13, 2015 Install a libfreefare.pc pkg-config module. Dec 18, 2009


Build Status Join the chat at

The libfreefare project provides a convenient API for MIFARE card manipulations.

It is part of the nfc-tools, you can find more info on them on the nfc-tools wiki.

If you are new to libfreefare or the nfc-tools, you should collect useful information on the project website and the dedicated forums.

Feature matrix


Tag Status
FeliCa Lite Supported
MIFARE Classic 1k Supported
MIFARE Classic 4k Supported
MIFARE DESFire 2k Supported
MIFARE DESFire 4k Supported
MIFARE DESFire 8k Supported
MIFARE DESFire EV1 Supported
MIFARE Mini Supported
MIFARE Plus S 2k Not supported
MIFARE Plus S 4k Not supported
MIFARE Plus X 2k Not supported
MIFARE Plus X 4k Not supported
MIFARE Ultralight Supported
MIFARE Ultralight C Supported
NTAG21x Supported


Specification Status
Mifare Application Directory (MAD) v1 Supported
Mifare Application Directory (MAD) v2 Supported
Mifare Application Directory (MAD) v3 Supported (part of Mifare DESFire support)


For *NIX systems

You can use released version (see Download section) or development version:

First, ensure all dependencies are installed:

  • libnfc;
  • git;
  • Autotools (autoconf, automake, libtool);
  • OpenSSL development package.
apt-get install autoconf automake git libtool libssl-dev pkg-config

Clone this repository:

git clone
cd libfreefare

Before compiling, remember to run:

autoreconf -vis

You can now compile libfreefare the usual autotools way:

./configure --prefix=/usr
sudo make install

For Windows Systems


  • cmake
  • make
  • mingw{32,64}-gcc


mingw64-cmake -DLIBNFC_INCLUDE_DIRS=/path/to/libnfc-source/include  -DLIBNFC_LIBRARIES=/path/to/libnfc.dll


In order to debug using gdb, you should tune the CFLAGS:

CFLAGS="-O0 -ggdb" ./configure --prefix=/usr
make clean all

It is then possible to debug examples using this kind of command from the root of the repository:

./libtool --mode=execute gdb examples/mifare-classic-write-ndef

If you are only interested in viewing transfert traces between the PCD and the PICC, simply use the --enable-debug configure flag:

./configure --enable-debug
make clean all
You can’t perform that action at this time.