/pn532-cloner

Use NXP PN532 board to read and write MIFARE Classic tags on Windows and macOS

Primary LanguageCGNU General Public License v2.0GPL-2.0

What is this project?

This project is based on the famous libnfc project as the backend to drive the NXP PN532 chip. Much of the higher-level application code is based on the mfoc-hardnested project.

This project aims to provide a cost-effective way to make duplicating MIFARE Classic tags easy on Windows and macOS.

Supported hardware

Only NXP PN532 board via UART to USB interface is supported. The PN532 boards are widely available from all the major online retailers. If you buy one of the boards without a USB port, you will need to buy a UART to USB cable as well (also available via all major online retailers). Some PN532 readers do not work with the Gen 3 magic cards. The widely available ACR122 reader is not supported due to ACR122 does not use UART to USB interface.

Supported operating system

Only Windows and macOS are supported. There's no plan to support Linux. For Linux applications, you can use libnfc directly.

Supported RFID tags

Read

MIFARE Classic and MIFARE Plus in Security Level 0 or 1 mode.

Write

Gen 3 Magic MIFARE Classic, Gen 2 Magic MIFARE Classic.

Usage

Reader driver installation (Windows)

If you purchased a driver from me, Windows should already have the driver for the reader. Just plug the reader into the PC, and wait for a minute or 2, the correct driver should get installed automatically. If the driver is not installed correctly, you can open the Device Manager and install the driver with the following instructions:

Driver not installed Driver install Step 1 Driver install Step 2 Driver install Step 3 Driver installed

If the above method does not work (this is usually due to you are running an old version of Windows), the driver can be found in this repository or search "CH340 driver" on the internet.

Reader driver installation (macOS)

The reader is plug-n-play on macOS. No need to install any driver.

How to clone a tag

Plug the reader into the PC, run the application, and follow the instructions on the screen. Simply read the original tag, after the read is complete, write the data onto a Magic tag (a special changeable tag). Please note, that the MIFARE Classic tags are encrypted tags, it takes time to crack the keys and read the tag. The application will provide you with an ETA when you start to read a tag.

I have included the built binary files in the Releases section for your convenience. Below is the screenshot of the application Application Windows Application Mac

Fix macOS "cannot be opened" error for unofficial software ( for example the test software I sent you to test)

macOS has secure measurements to make a user run unsigned applications harder. If you are getting the following error message, you will have to go to the System Preferences -> Security & Privacy. Click on "Click the lock to make changes", enter your password, then click on OK on the error message. After that, you should be able to see the option to be able to run the application. I have included screenshots with step-by-step instructions below. If you have concerns the safety of running the application, you can inspect every line of source code and build the application from the source (instructions below). Mac cannot be opened error Security and Privacy settings Mac cannot be opened Click on OK Open anyway Can open

Build instruction

Windows

MSYS2

Install MSYS2. Open the MSYS2 UCRT64 terminal, and clone this project first:

git clone https://github.com/jumpycalm/pn532-cloner.git

Navigate into the project folder, create a new folder called build, go to that folder, use the CMake to generate the Makefile, then build the project with mingw32-make

cd pn532-cloner
mkdir build
cd build
cmake -G "MinGW Makefiles" ../
mingw32-make

After the software is built, a PN532-Cloner-Win-x64.exe file should be generated. Just double-click on this application and run it.

CLion

Simply create a project from version control, and enter the GitHub link for this project.

macOS

Xcode

You can build the Xcode project file with CMake. Simply download and install CMake. The instruction can be found on CMake's official website: Installing CMake

After the CMake is installed, clone this project first:

git clone https://github.com/jumpycalm/pn532-cloner.git

Navigate into the project folder, create a new folder called build, go to that folder, and use the CMake to generate the Xcode project file.

cd pn532-cloner
mkdir build
cd build
cmake -G "Xcode" ../

If you are getting Xcode 1.5 not supported. error, you need to manually specify the Xcode location. sudo /usr/bin/xcode-select --switch /Users/admin/Downloads/Xcode.app, you may need to change the command to match your Xcode.app location.

After the Xcode project file is generated, you can open Xcode and open the project and build the project inside the Xcode.

Clion

Install CLion. Create a project from version control, enter the GitHub link for this project. Build the project from CLion.

License

Because source code from mfoc-hardnested project is used. mfoc-hardnested project under GPL-2.0 License. This project must be under GPL license to comply with the mfoc-hardnested project.

Proprietary Notes

MIFARE is a trademark of NXP Semiconductors. All other trademarks are the property of their respective owners.