Skip to content

tommy-gilligan/nfcdecode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nfcdecode

NFC protocol decoder for demodulation and decoding NFC-A, NFC-B, NFC-F and NFC-V signals up to 424 Kbps. Forked from https://github.com/josevcm/nfc-laboratory . If you are looking for a desktop application for decoding please look there.

Description

Currently, detection and decoding is implemented for:

  • NFC-A (ISO14443A): 106kbps, 212kbps and 424kbps with ASK / BPSK modulation.
  • NFC-B (ISO14443B): 106kbps, 212kbps and 424kbps with ASK / BPSK modulation.
  • NFC-V (ISO15693): 26kbps and 53kbps, 1 of 4 code and 1 of 256 code PPM / BPSK modulation (pending FSK).
  • NFC-F (ISO18092): Preliminary support to 212kbps and 424kbps with manchester modulation.

Prerequisites

  • A modern C/C++ toolchain
  • CMake >= 3.15
  • Rust >= 1.62 (required by mufft)

Building

$ git clone --recurse-submodules https://github.com/tomgilligan/nfcdecode.git nfcdecode
$ cd nfcdecode
$ cmake .
$ make

Testing

In the "test" directory you can find a series of samples of different captures for the NFC-A, NFC-B, NFC-F and NFC-V modulations with their corresponding analysis inside the "json" files.

./test/test ./test/*.wav
TEST FILE "test_NFC-A_106kbps_001.wav": PASS
TEST FILE "test_NFC-A_106kbps_002.wav": PASS
TEST FILE "test_NFC-A_106kbps_003.wav": PASS
TEST FILE "test_NFC-A_106kbps_004.wav": PASS
TEST FILE "test_NFC-A_212kbps_001.wav": PASS
TEST FILE "test_NFC-A_424kbps_001.wav": PASS
TEST FILE "test_NFC-A_424kbps_002.wav": PASS
TEST FILE "test_NFC-B_106kbps_001.wav": PASS
TEST FILE "test_NFC-B_106kbps_002.wav": PASS
TEST FILE "test_NFC-F_212kbps_001.wav": PASS
TEST FILE "test_NFC-F_212kbps_002.wav": PASS
TEST FILE "test_NFC-V_26kbps_001.wav": PASS
TEST FILE "test_NFC-V_26kbps_002.wav": PASS
TEST FILE "test_POLL_ABF_001.wav": PASS
TEST FILE "test_POLL_AB_001.wav": PASS

Input / Output file formats

The library allows you to read and write files in two different formats:

  • WAV: Reading signals in standard WAV format with 1 or 2 channels is supported. In the first case, it should contain the sample of the signal in absolute real values. If 2 channels are used they should contain the sampling of the I / Q components.

  • JSON: The analyzed signal can be stored in a simple JSON text file or read back from one of them.

Source code and licensing

If you think it is an interesting job or you plan to use it for something please send me an email and let me know, I will be happy to exchange experiences, thank you very much.

This project is published under the terms of the MIT license, however there are parts of it subject to other types of licenses, please check if you are interested in this work.

About

NFC signal and protocol decoding

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 93.5%
  • Rust 5.7%
  • CMake 0.8%