Platform independent Near Field Communication (NFC) library

Overview
*-
* Free/Libre Near Field Communication (NFC) library
*
* Libnfc historical contributors:
* Copyright (C) 2009      Roel Verdult
* Copyright (C) 2009-2015 Romuald Conty
* Copyright (C) 2010-2012 Romain Tartière
* Copyright (C) 2010-2013 Philippe Teuwen
* Copyright (C) 2012-2013 Ludovic Rousseau
* Additional contributors:
* See AUTHORS file
-*

General Information

libnfc is a library which allows userspace application access to NFC devices.

The official web site is: http://www.nfc-tools.org/

The official forum site is: http://www.libnfc.org/community/

The official development site is: https://github.com/nfc-tools/libnfc

Important note: this file covers POSIX systems, for Windows please read README-Windows.md

Requirements

Some NFC drivers depend on third party software:

  • pcsc:

    • Support build with pcsc driver, which can be using all compatible readers, Feitian R502 and bR500 already passed the test.

The regression test suite depends on the cutter framework: http://cutter.sf.net

Installation

See the file INSTALL for configure, build and install details.

Additionnally, you may need to grant permissions to your user to drive your device. Under GNU/Linux systems, if you use udev, you could use the provided udev rules. e.g. under Debian, Ubuntu, etc.

sudo cp contrib/udev/93-pn53x.rules /lib/udev/rules.d/

Under FreeBSD, if you use devd, there is also a rules file: contrib/devd/pn53x.conf.

Configuration

In order to change the default behavior of the library, the libnfc uses a configuration file located in sysconfdir (as provided to ./configure).

A sample commented file is available in sources: libnfc.conf.sample

If you have compiled using:

./configure --prefix=/usr --sysconfdir=/etc

you can make configuration directory and copy the sample file:

sudo mkdir /etc/nfc
sudo cp libnfc.conf.sample /etc/nfc/libnfc.conf

To configure multiple devices, you can either modify libnfc.conf or create a file per device in a nfc/devices.d directory:

sudo mkdir -p /etc/nfc/devices.d
printf 'name = "My first device"\nconnstring = "pn532_uart:/dev/ttyACM0"\n' | sudo tee /etc/nfc/devices.d/first.conf
printf 'name = "My second device"\nconnstring = "pn532_uart:/dev/ttyACM1"\n' | sudo tee /etc/nfc/devices.d/second.conf

How to report bugs

To report a bug, visit https://github.com/nfc-tools/libnfc/issues and fill out a bug report form.

If you have questions, remarks, we encourage you to post this in the developers community: http://www.libnfc.org/community

Please make sure to include:

  • The version of libnfc

  • Information about your system. For instance:

    • What operating system and version
    • For Linux, what version of the C library

    And anything else you think is relevant.

  • A trace with debug activated.

    Reproduce the bug with debug, e.g. if it was:

      $ nfc-list -v
    

    run it as:

      $ LIBNFC_LOG_LEVEL=3 nfc-list -v
    
  • How to reproduce the bug.

    Please include a short test program that exhibits the behavior.

    As a last resort, you can also provide a pointer to a larger piece

    of software that can be downloaded.

  • If the bug was a crash, the exact text that was printed out

    when the crash occured.

  • Further information such as stack traces may be useful, but

    is not necessary.

Patches

Patches can be posted to https://github.com/nfc-tools/libnfc/issues

If the patch fixes a bug, it is usually a good idea to include all the information described in "How to Report Bugs".

Building

It should be as simple as running these two commands:

./configure
make

To build with specific driver(s), see option --with-drivers=... detailed in ./configure --help.

Note: if you're using directly the development repository and not the release sources, you will have to execute firstly autoreconf -vis.

Troubleshooting

Touchatag/ACR122:

If your Touchatag or ACR122 device fails being detected by libnfc, make sure that PCSC-lite daemon (pcscd) is installed and is running.

If your Touchatag or ACR122 device fails being detected by PCSC-lite daemon (pcsc_scan doesn't see anything) then try removing the bogus firmware detection of libccid: edit libccid_Info.plist configuration file (usually /etc/libccid_Info.plist) and locate <key>ifdDriverOptions</key>, turn <string>0x0000</string> value into 0x0004 to allow bogus devices and restart pcscd daemon.

ACR122:

Using an ACR122 device with libnfc and without tag (e.g. to use NFCIP modes or card emulation) needs yet another PCSC-lite tweak: You need to allow usage of CCID Exchange command. To do this, edit libccid_Info.plist configuration file (usually /etc/libccid_Info.plist) and locate <key>ifdDriverOptions</key>, turn <string>0x0000</string> value into 0x0001 to allow CCID exchange or 0x0005 to allow CCID exchange and bogus devices (cf previous remark) and restart pcscd daemon.

Warning: if you use ACS CCID drivers (acsccid), configuration file is located in something like: /usr/lib/pcsc/drivers/ifd-acsccid.bundle/Contents/Info.plist

SCL3711:

Libnfc cannot be used concurrently with the PCSC proprietary driver of SCL3711. Two possible solutions:

  • Either you don't install SCL3711 driver at all
  • Or you stop the PCSC daemon when you want to use libnfc-based tools

PN533 USB device on Linux >= 3.1:

Since Linux kernel version 3.1, a few kernel-modules must not be loaded in order to use libnfc : "nfc", "pn533" and "pn533_usb". To prevent kernel from loading automatically these modules, you can blacklist them in a modprobe conf file. This file is provided within libnfc archive:

sudo cp contrib/linux/blacklist-libnfc.conf /etc/modprobe.d/blacklist-libnfc.conf

FEITIAN bR500 and R502:

Libnfc can work with PCSC proprietary driver of bR500 and R502, which is already available on most Linux setups. To activate the PCSC support: ./configure --with-drivers=pcsc. Readers known to work:

  • Feitian bR500
  • Feitian R502 Dual interface reader
  • Feitian R502 CL(Contactless) reader

These readers are support by CCID since v1.4.25, make sure your CCID driver version higher or equal to 1.4.25.

On MacOS, you can check your CCID version with the following command, and if required, you can install latest CCID driver from https://github.com/martinpaljak/osx-ccid-installer/releases

grep -A 1 CFBundleShortVersionString /usr/local/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist

On Linux, you can check your CCID version with the following command, and if required, you can install latest CCID driver from https://ccid.apdu.fr/

grep -A 1 CFBundleShortVersionString /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist

Proprietary Notes

FeliCa is a registered trademark of the Sony Corporation. MIFARE is a trademark of NXP Semiconductors. Jewel Topaz is a trademark of Innovision Research & Technology. All other trademarks are the property of their respective owners.

Comments
  • Unable to claim USB interface (Permission denied)

    Unable to claim USB interface (Permission denied)

    i run nfc-list on terminal Mac Yosemite But the error appears:

    nfc-list uses libnfc 1.7.1
    error   libnfc.driver.acr122_usb    Unable to claim USB interface (Permission denied)
    

    Please guide me to solve this problem.

    opened by syarizat 55
  • Unable to set alternate setting on USB interface (Connection timed out)

    Unable to set alternate setting on USB interface (Connection timed out)

    Hello,

    I get the following message using my ACR_122U

    $ sudo nfc-scan-device -v
    nfc-scan-device uses libnfc 1.7.1
    1 NFC device(s) found:
    error   libnfc.driver.acr122_usb        Unable to set alternate setting on USB interface (Connection timed out)
    nfc_open failed for acr122_usb:003:005
    

    Is someone familiar with this problem ? Any idea of what i can look for to troubleshoot this ?

    opened by alexandredubois 37
  • nfc-mfclassic doesn't work when used with mifare 4k emulated

    nfc-mfclassic doesn't work when used with mifare 4k emulated

    
    
    I have the following tools:
    - Feig Elettronics M02 reader e software tool.
    - Reader ACR122U102 - PN532,
    - Nokia 6212 with Mifare 4k,
    - MIFARE 4k (emulated)
    - Another Mifare 1k.
    
    If I use the Feig and proprietary software for windows, I get the following 
    dump:
    
    Nokia 6212 phone - sector 0:
    6b a0 22 02 .......... serial manufactor ......... etc ...
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    FF FF FF FF FF FF FF 07 80 69 00 00 00 00 00 00
    .....
    MIFARE 4K - sector 0:
    B0 57 34 11 .......... serial manufactor ......... etc. ..
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    FF FF FF FF FF FF FF 07 80 69 00 00 00 00 00 00
    .....
    MIFARE 1K - sector 0:
    c4 e3 06 0c .......... serial manufactor ......... etc. .....
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    FF FF FF FF FF FF FF 07 80 69 00 00 00 00 00 00
    
    work well.
    
    If  use nfc-mfclassic, micmd  or another tools with libnfc and PN532:
    
    Nokia 6212 phone - sector 0:
    FF FF FF FF FF FF 6b a0 22 02 FF FF FF FF FF FF
    FF FF FF FF FF FF 6b a0 22 02 FF FF FF FF FF FF
    FF FF FF FF FF FF 6b a0 22 02 FF FF FF FF FF FF
    FF FF FF FF FF FF 6b a0 22 02 FF FF FF FF FF FF
    ..... for all areas ....   note UID ! 
    
    MIFARE 4K emulated - sector 0:
    FF FF FF FF FF FF B0 57 34 11 FF FF FF FF FF FF
    FF FF FF FF FF FF B0 57 34 11 FF FF FF FF FF FF
    FF FF FF FF FF FF B0 57 34 11 FF FF FF FF FF FF
    FF FF FF FF FF FF B0 57 34 11 FF FF FF FF FF FF
    ..... for all areas .... note UID !
    
    MIFARE 1K - sector 0:
    c4 e3 06 0c .......... serial manufactor ......... etc. .....
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    FF FF FF FF FF FF FF 07 80 69 00 00 00 00 00 00
    .... ok.
    
    libnfc correctly read the Mifare 1k,  but the 4k filled with FF and the UID. 
    This seems very strange .... libnfc Bug?
    
    

    Original issue reported on code.google.com by [email protected] on 11 Aug 2010 at 8:39

    opened by GoogleCodeExporter 32
  • acr122_usb: touchatag 'Too small reply'

    acr122_usb: touchatag 'Too small reply'

    Using nfc-list:
    
    info    libnfc.config   Unable to open file: /etc/nfc/libnfc.conf
    debug   libnfc.config   Unable to open directory: /etc/nfc/devices.d
    unkown  libnfc.general  log_level is set to 3
    debug   libnfc.general  allow_autoscan is set to true
    debug   libnfc.general  allow_intrusive_scan is set to false
    debug   libnfc.general  0 device(s) defined by user
    nfc-list uses libnfc libnfc-1.6.0-rc1-184-gff3d8f7
    debug   libnfc.general  0 device(s) found using pn53x_usb driver
    debug   libnfc.driver.acr122_usb    device found: Bus 003 Device 002 Name ACS ACR122
    debug   libnfc.general  1 device(s) found using acr122_usb driver
    debug   libnfc.driver.acr122_usb    3 element(s) have been decoded from 
    "acr122_usb:003:002"
    debug   libnfc.driver.acr122_usb    TX: 62  00  00  00  00  00  00  01  00  00  
    debug   libnfc.driver.acr122_usb    RX: 80  13  00  00  00  00  00  00  00  00  3b  
    be  95  00  00  41  03  00  00  00  00  00  00  00  00  00  02  90  00  
    debug   libnfc.driver.acr122_usb    ACR122 PICC Operating Parameters
    debug   libnfc.driver.acr122_usb    TX: 6b  05  00  00  00  00  00  00  00  00  ff  
    00  51  00  00  
    debug   libnfc.driver.acr122_usb    RX: 83  00  00  00  00  00  00  40  05  00  
    debug   libnfc.chip.pn53x   GetFirmwareVersion
    debug   libnfc.driver.acr122_usb    TX: 6b  07  00  00  00  00  00  00  00  00  ff  
    00  00  00  02  d4  02  
    debug   libnfc.driver.acr122_usb    RX: 83  00  00  00  00  00  00  40  07  00  
    error   libnfc.driver.acr122_usb    Too small reply
    debug   libnfc.general  Unable to open "acr122_usb:003:002".
    nfc-list: ERROR nfc-list.c:132
    nfc-list:     Unable to open NFC device: acr122_usb:003:002
    
    Seems like a duplicate of bug #201 but I'm using the latest from git, so it 
    should be fixed. Using the acr122_pcsc driver works. 
    
    

    Original issue reported on code.google.com by [email protected] on 9 Jan 2013 at 12:31

    opened by GoogleCodeExporter 29
  • Format/Overwrite of mifare classic

    Format/Overwrite of mifare classic "fails"

    I cloned a mifare classic card onto an empty card.Now everytime I write to this 
    card I get a error like this:
    [code]failed to write trailer block 3 
    xnfc_initiator_transceive_bytes: Timeout[/code]
    I tried to overwrite the card with the empty dump I got from 
    http://www.libnfc.org/_media/libnfc/documentation/empty_mfd_example.zip
    but it went like this:
    [code][email protected] ~ $ nfc-mfclassic w b Downloads/14f1f9d7.mfd clean
    Connected to NFC reader: ACS ACR122U 00 00 / ACR122U103 - PN532 v1.6 (0x07)
    Found MIFARE Classic card:
        ATQA (SENS_RES): 00  04  
           UID (NFCID1): ec  c3  66  d3  
          SAK (SEL_RES): 08  
    Guessing size: seems to be a 1024-byte card
    Writing 64 blocks |nfc_initiator_transceive_bytes: Timeout
    failed to write trailer block 3 
    xnfc_initiator_transceive_bytes: Timeout
    failed to write trailer block 7 
    xnfc_initiator_transceive_bytes: Timeout
    failed to write trailer block 11 
    xnfc_initiator_transceive_bytes: Timeout
    failed to write trailer block 15 
    xnfc_initiator_transceive_bytes: Timeout
    failed to write trailer block 19 
    xnfc_initiator_transceive_bytes: Timeout
    failed to write trailer block 23 
    xnfc_initiator_transceive_bytes: Timeout
    failed to write trailer block 27 
    xnfc_initiator_transceive_bytes: Timeout
    failed to write trailer block 31 
    xnfc_initiator_transceive_bytes: Timeout
    failed to write trailer block 35 
    xnfc_initiator_transceive_bytes: Timeout
    failed to write trailer block 39 
    xnfc_initiator_transceive_bytes: Timeout
    failed to write trailer block 43 
    xnfc_initiator_transceive_bytes: Timeout
    failed to write trailer block 47 
    xnfc_initiator_transceive_bytes: Timeout
    failed to write trailer block 51 
    xnfc_initiator_transceive_bytes: Timeout
    failed to write trailer block 55 
    xnfc_initiator_transceive_bytes: Timeout
    failed to write trailer block 59 
    x.|
    Done, 4 of 64 blocks written.
    [email protected] ~ $ nfc-mfclassic w b tim-100 Downloads/14f1f9d7.mfd 
    Connected to NFC reader: ACS ACR122U 00 00 / ACR122U103 - PN532 v1.6 (0x07)
    Expected MIFARE Classic card with UID starting as: 14f1f9d7
    Found MIFARE Classic card:
        ATQA (SENS_RES): 00  04  
           UID (NFCID1): ec  c3  66  d3  
          SAK (SEL_RES): 08  
    Guessing size: seems to be a 1024-byte card
    Writing 64 blocks |nfc_initiator_transceive_bytes: Mifare Authentication Error
    !
    Error: authentication failed for block 00
    [email protected] ~ $ nfc-mfclassic w b tim-100
    Connected to NFC reader: ACS ACR122U 00 00 / ACR122U103 - PN532 v1.6 (0x07)
    Found MIFARE Classic card:
        ATQA (SENS_RES): 00  04  
           UID (NFCID1): ec  c3  66  d3  
          SAK (SEL_RES): 08  
    Guessing size: seems to be a 1024-byte card
    Writing 64 blocks |nfc_initiator_transceive_bytes: Mifare Authentication Error
    nfc_initiator_transceive_bytes: Mifare Authentication Error
    nfc_initiator_transceive_bytes: Mifare Authentication Error
    nfc_initiator_transceive_bytes: Mifare Authentication Error
    nfc_initiator_transceive_bytes: Mifare Authentication Error
    nfc_initiator_transceive_bytes: Mifare Authentication Error
    nfc_initiator_transceive_bytes: Mifare Authentication Error
    nfc_initiator_transceive_bytes: Mifare Authentication Error
    nfc_initiator_transceive_bytes: Mifare Authentication Error
    !
    Error: authentication failed for block 00
    [email protected] ~ $ mifare-classic-format 
    Found Mifare Classic 1k with UID ecc366d3. Format [yN] y
    Formatting 16 sectors [.mifare-classic-format: No known authentication key for 
    sector 0
    [/code]
    I also added the keys that were used to write to the card to the default keys 
    of mifare-classic-format.
    I'm using a touchatag pad 072f:2200 with the acsccid 1.0.2 driver and libnfc 
    1.5.1.
    

    Original issue reported on code.google.com by [email protected] on 24 Nov 2011 at 6:10

    enhancement 
    opened by GoogleCodeExporter 26
  • PN532 UART device is not getting connected

    PN532 UART device is not getting connected

    What steps will reproduce the problem?
    1.nfc-list
    2.
    3.
    
    What is the expected output? What do you see instead?
    device id, tag id
    
    What version of the product are you using? On what operating system?
    1.5.1
    
    Please provide any additional information below.
    
    hi when i tried to run libnfc in my PC its not detected. its showing that 
    device is not found
    i used nfc-list
    
    
    [email protected]:/media/kdata/packages/libnfc-1.5.1$ nfc-list 
    nfc-list uses libnfc 1.5.1 (r1175)
    No NFC device found.
    
    my pn532_uart driver is enabled and i am using it only. is it possible to give 
    the target device file with the command
    
    i ve used the below command also
    
    ./configure --with-drivers=pn532_uart --enable-serial-autoprobe
    
    but its not getting detected
    showing the same error
    

    Original issue reported on code.google.com by [email protected] on 18 Oct 2011 at 3:18

    opened by GoogleCodeExporter 22
  • PN532 UART support broken/unstable

    PN532 UART support broken/unstable

    What steps will reproduce the problem?
    1. Add a default PN532 NXP's demo-board.
    2. Compile libnfc with option "--with-drivers=pn532_uart 
    --enable-serial-autoprobe".
    3. Put a tag on the antenna and launch "nfc-list".
    
    What is the expected output? What do you see instead?
    
    This is the output of nfc-list execution:
    
    Connected to NFC reader: PN532 (/dev/ttyUSB0) - PN532 v1.6 (0x07)
    
     TX: 00  00  ff  04  fc  d4  4a  01  00  e1  00  
     RX: 00  00  ff  00  ff  00  00  00  ff  03  fd  d5  4b  00  e0  00  
     RX: 00  00  ff  03  fd  d5  4b  00  e0  00  
     TX: 00  00  ff  09  f7  d4  4a  01  01  00  ff  ff  00  00  e2  00  
     RX: 00  00  ff  00  ff  00  00  00  ff  03  fd  d5  4b  00  e0  00  
     RX: 00  00  ff  03  fd  d5  4b  00  e0  00  
     TX: 00  00  ff  09  f7  d4  4a  01  02  00  ff  ff  00  00  e1  00  
     RX: 00  00  ff  00  ff  00  00  00  ff  03  fd  d5  4b  00  e0  00  
     RX: 00  00  ff  03  fd  d5  4b  00  e0  00  
     TX: 00  00  ff  05  fb  d4  4a  01  03  00  de  00  
     RX: 00  00  ff  00  ff  00  00  00  ff  03  fd  d5  4b  00  e0  00  
     RX: 00  00  ff  03  fd  d5  4b  00  e0  00  
     TX: 00  00  ff  04  fc  d4  4a  01  04  dd  00  
     RX: 00  00  ff  00  ff  00  00  00  ff  03  fd  d5  4b  00  e0  00  
     RX: 00  00  ff  03  fd  d5  4b  00  e0  00  
     TX: 00  00  ff  03  fd  d4  44  00  e8  00  
     RX: 00  00  ff  00  ff  00  00  00  ff  03  fd  d5  45  00  e6  00  
     RX: 00  00  ff  03  fd  d5  45  00  e6  00  
     TX: 00  00  ff  04  fc  d4  32  01  00  f9  00  
     RX: 00  00  ff  00  ff  00  00  00  ff  02  fe  d5  33  f8  00  
     RX: 00  00  ff  02  fe  d5  33  f8  00 
    
    So no tag found.
    
    

    Original issue reported on code.google.com by emanuele.bertoldi on 11 Jun 2010 at 3:55

    opened by GoogleCodeExporter 21
  • Fix build on Windows (pn53x_transceive() usability in examples)

    Fix build on Windows (pn53x_transceive() usability in examples)

    Initial report by @JONIDi12P:

    undefined reference to pn53x_transceive

    i got error of undefined reference to pn53x_transceive' on file https://github.com/nfc-tools/libnfc/blob/master/examples/pn53x-diagnose.c

    on line 106+117

    but i saw here https://github.com/nfc-tools/libnfc/blob/master/libnfc/chips/pn53x.h the header of function pn53x_transceive

    that not depend on windows/linux thanks

    opened by JONIDi12P 20
  • tricky detection of touchatag under MacOS

    tricky detection of touchatag under MacOS

    What steps will reproduce the problem?
    
    1. Plug in a touchatag (real touchatag)
    2. Run nfc-list
    
    What is the expected output? What do you see instead?
    
    Expected output: "Connected to NFC device: ACS ACR 38U-CCID 00 00 / ACR122U102 
    - PN532 v1.4 (0x07)"
    
    What I see instead: "nfc-list: INFO: No device found."
    
    What version of the product are you using? On what operating system?
    
    Mac OS X 10.6.4
    PCSC Framework version 1.4.0 (stock one that comes with OS X 10.6)
    libnfc 1.3.9 (r794)
    
    Please provide any additional information below.
    
    The workaround to the above problem is to plug in touchatag without card, kill 
    pcscd, unplug touchatag, place card on touchatag, then plug touchatag back in 
    (with card on top), which will open pcscd again. Running nfc-list again will 
    show the expected output above.
    
    Note this does not happen in Fedora with same version. Also, I do not think 
    it's a problem with pcsc-lite, because even when nfc-list shows no readers, 
    pcsctest will show "Reader 01: ACS ACR38U-CCID 00 00".
    

    Original issue reported on code.google.com by [email protected] on 3 Nov 2010 at 4:04

    opened by GoogleCodeExporter 20
  • Remove binary blob in repository

    Remove binary blob in repository

    Source repository contains win32 subdirectory with some compiled objects.
    

    Original issue reported on code.google.com by [email protected] on 8 Sep 2009 at 8:00

    opened by GoogleCodeExporter 19
  • error: conflicting types for 'uint8_t', 'uint16_t'

    error: conflicting types for 'uint8_t', 'uint16_t'

    What steps will reproduce the problem?
    1.compiling libnfc for ltib using scbuild
    2.
    3.
    
    What is the expected output? What do you see instead?
    it should be compiled
    error: conflicting types for 'uint8_t', 'uint16_t'
    
    What version of the product are you using? On what operating system?
    its libnfc 1.5 with linux and ARM(iMX257)
    
    Please provide any additional information below.
    
    

    Original issue reported on code.google.com by [email protected] on 17 Oct 2011 at 12:16

    opened by GoogleCodeExporter 17
  • problem to write/read block for Mifare Emulator in Mifare Smart  MX based card

    problem to write/read block for Mifare Emulator in Mifare Smart MX based card

    Hi, I meet the same problem when trying to write/read block for Mifare Emulator in Mifare Smart MX based card. Can you help share more experience on how you solve the problem?

    Originally posted by @TonyPeng-cyber in https://github.com/nfc-tools/libnfc/issues/364#issuecomment-511649829

    opened by amolood 0
  • Is nfc-mfclassic the right app to write a dump gained with mfoc-hardnested back to a card?

    Is nfc-mfclassic the right app to write a dump gained with mfoc-hardnested back to a card?

    Hi everyone

    I successfully extracted the contents of a MIFARE classic card using mfoc-hardnested using mfoc-hardnested -f keys.txt -O extractedcard.mfd over an USB Adafruit PN532 Breakout Board:

    # ./mfoc-hardnested -f keys.txt -O extractedcard.mfd 
    ATS len = -20
    Found Mifare Classic 1k tag
    ISO/IEC 14443A (106 kbps) target:
        ATQA (SENS_RES): 00  04  
    * UID size: single
    * bit frame anticollision supported
           UID (NFCID1): 6d  02  b6  62  
          SAK (SEL_RES): 08  
    * Not compliant with ISO/IEC 14443-4
    * Not compliant with ISO/IEC 18092
    
    Fingerprinting based on MIFARE type Identification Procedure:
    * MIFARE Classic 1K
    * MIFARE Plus (4 Byte UID or 4 Byte RID) 2K, Security level 1
    * SmartMX with MIFARE 1K emulation
    Other possible matches based on ATQA & SAK values:
    
    Try to authenticate to all sectors with default keys...
    ...
    ...
    

    However, when trying to write the dump back to the card using nfc-mfclassic w a extractedcard.mfd extractedcard.mfd, the process fails with

    [email protected]:/home/to# LIBNFC_LOG_LEVEL=3 nfc-mfclassic w a extractedcard.mfd extractedcard.mfd
    NFC reader: Adafruit PN532 Breakout opened
    Found MIFARE Classic card:
    ISO/IEC 14443A (106 kbps) target:
        ATQA (SENS_RES): 00  04  
           UID (NFCID1): 6d  02  b6  62  
          SAK (SEL_RES): 08  
    RATS support: no
    Guessing size: seems to be a 1024-byte card
    Writing 63 blocks |Failure to write to data block 1
    [email protected]:/home/to# 
    

    and the card remains unaltered. I'm using a fresh Kali linux and an uptodate libnfc (1.8.0).

    Am I correct using nfc-mfclassic to write the dump back or should I use another program (since it identifies as a MIFARE Plus)?

    Does anyone have an idea what the problem might be? Thanks!

    opened by ld21 0
  • Is this project dead?

    Is this project dead?

    There has been no activity (commits or comments) for nearly 10 month from any of the main developers, the website given in the README, nfc-tools.org, is down (last snapshot from the internet archive is from 25.08.2021), the last release is over 2 years old, despite issues like #669. If this project indeed is dead what would be the best way to revive it? Would it be possible to move ownership or a fork to a different project?

    opened by TheChronicler 0
  • Please add support for native Linux NFC interface (via NetLink)

    Please add support for native Linux NFC interface (via NetLink)

    There was a similar issue closed some time ego (#466), but I think that this issue needs to be reevaluated to support cases like #455 (Lenovo T470) and for many more modern laptops (like mine HP ZBook Firefly 14 G8), which happens to have an NFC chip available and usable via Netlink interface (e.g. via nfctool) but not by any software which uses libnfc to access an NFC interface (like pcsclite).

    Sure thing, such a driver would be not cross platform, but on Linux it may cover many devices in a unified way.

    For example, support for native Linux NFC was added to libfido2 for a similar reason to support NFC pasword-less authentication tokens (e.g. Yubikeys), these devices can act as contactless smart-cards as well, but often not on Linux, due to lack of native Linux NFC support in libnfc.

    opened by arbv 0
  • WIP: Update libusb to version 1.0

    WIP: Update libusb to version 1.0

    Fixes #191 I reimplemented the usb code for libusb1.0. Currently it uses https://github.com/kenspeckle1/libnfc/tree/update_libusb10_branch as base which in turn updates the libusb10 branch to match the master branch. As such it would be best if PR #672 would be merged before this or the libusb10 branch would be updated in some other way.

    A review and help with testing would be greatly appreciated. I only have access to an ACR122U device and a linux pc so I am unable to test other devices or OSes.

    opened by kenspeckle1 0
Releases(libnfc-1.8.0)
The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.

The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.

Microsoft 7.1k Oct 5, 2022
A cross platform C99 library to get cpu features at runtime.

cpu_features A cross-platform C library to retrieve CPU features (such as available instructions) at runtime. Table of Contents Design Rationale Code

Google 2.1k Oct 6, 2022
A cross-platform protocol library to communicate with iOS devices

libimobiledevice A library to communicate with services on iOS devices using native protocols. Features libimobiledevice is a cross-platform software

libimobiledevice 5.2k Sep 26, 2022
LibOS is a modern C++17 library that makes OS-specific features cross-platform.

LibOS is a modern C++17 library that makes OS-specific features cross-platform. Ever tried to get Windows version after Windows 8? Or to send ke

Gavrilikhin Daniil 27 Sep 13, 2022
WAFer is a C language-based software platform for scalable server-side and networking applications. Think node.js for C programmers.

WAFer WAFer is a C language-based ultra-light scalable server-side web applications framework. Think node.js for C programmers. Because it's written i

Riolet Corporation 693 Aug 16, 2022
PRK is a keyboard firmware platform in PicoRuby

PRK is a keyboard firmware written and configured in PicoRuby which is an alternative mruby implementation targeting on one-chip microcontroller.

PicoRuby 344 Sep 22, 2022
A cross-platform OpenXR capabilities explorer and runtime switcher with a CLI and GUI.

OpenXR Explorer OpenXR Explorer is a handy debug tool for OpenXR developers. It allows for easy switching between OpenXR runtimes, shows lists of the

Nick Klingensmith 138 Oct 2, 2022
Isocline is a pure C library that can be used as an alternative to the GNU readline library

Isocline: a portable readline alternative. Isocline is a pure C library that can be used as an alternative to the GNU readline library (latest release

Daan 129 Sep 22, 2022
A linux library to get the file path of the currently running shared library. Emulates use of Win32 GetModuleHandleEx/GetModuleFilename.

whereami A linux library to get the file path of the currently running shared library. Emulates use of Win32 GetModuleHandleEx/GetModuleFilename. usag

Blackle Morisanchetto 3 Sep 24, 2022
Command-line arguments parsing library.

argparse argparse - A command line arguments parsing library in C (compatible with C++). Description This module is inspired by parse-options.c (git)

Yecheng Fu 512 Sep 26, 2022
Library that solves the exact cover problem using Dancing Links, also known as DLX.

The DLX Library The DLX library The DLX library solves instances of the exact cover problem, using Dancing Links (Knuth’s Algorithm X). Also included

Ben Lynn 41 Sep 30, 2022
Standards compliant, fast, secure markdown processing library in C

Hoedown Hoedown is a revived fork of Sundown, the Markdown parser based on the original code of the Upskirt library by Natacha Porté. Features Fully s

Hoedown 917 Sep 30, 2022
CommonMark parsing and rendering library and program in C

cmark cmark is the C reference implementation of CommonMark, a rationalized version of Markdown syntax with a spec. (For the JavaScript reference impl

CommonMark 1.4k Sep 27, 2022
A C library for parsing/normalizing street addresses around the world. Powered by statistical NLP and open geo data.

libpostal: international street address NLP libpostal is a C library for parsing/normalizing street addresses around the world using statistical NLP a

openvenues 3.6k Oct 4, 2022
Your friendly e-mail address validation library.

libvldmail Your friendly e-mail address validation library. Why? Did you know that parentheses, spaces and - according to the RFC 6531 document - emoj

Cthulhux 46 Sep 9, 2022
A protocol buffers library for C

PBC PBC is a google protocol buffers library for C without code generation. Quick Example package tutorial; message Person { required string name =

云风 1.6k Sep 24, 2022
An easy-to-use C library for displaying text progress bars.

What is this thing? progressbar is a C-class (it's a convention, dammit) for displaying attractive progress bars on the command line. It's heavily inf

Trevor Fountain 436 Sep 15, 2022
Library for writing text-based user interfaces

IMPORTANT This library is no longer maintained. It's pretty small if you have a big project that relies on it, just maintain it yourself. Or look for

null 1.9k Sep 30, 2022
Locate the current executable and the current module/library on the file system

Where Am I? A drop-in two files library to locate the current executable and the current module on the file system. Supported platforms: Windows Linux

Gregory Pakosz 373 Sep 28, 2022