PN532 Magic Cards

PN532 Introduction

Welcome to PN532 Magic Cards page! Here, you’ll find all the types of Magic Cards supported by the PN532 NFC module and their features. The PN532 is a high-performance NFC controller capable of reading various types of cards, including NFC tags, MIFARE cards, and Felica cards. Our Magic Cards leverage this technology to provide you with an unparalleled level of convenience.

PN532 Supported Magic Cards

Gen1 MIFARE Classic 1K 4 Byte UID

Magic Card TypeMemory SizeUID LengthSectorsFeatures
Gen1A

Buy Gen1A Card
1KB4 bytes16– Backdoor read and write
– Can detected by advanced access system

Gen2 MIFARE Classic 1K 4 Byte UID

Magic Card TypeMemory SizeUID LengthSectorsFeatures
Gen2

Buy CUID Card
1KB4 bytes16Block 0 can be writen with NFC reader after authentication

Gen3 MIFARE Classic 1K 4B, 7B and 4K in 4B, 7 Byte UID

Magic Card TypeMemory SizeUID LengthSectorsFeatures
Mifare S20 0.2KB

Buy Gen3 S20
0.2KB4 bytes / 7 bytes5UID and Block0 can be configured using backdoor commands.
Mifare S50 1K

Buy Gen3 1K
1KB4 bytes / 7 bytes16UID and Block0 can be configured using backdoor commands.
Mifare S70 4K

Buy Gen3 4K Card
4KB4 bytes / 7 bytes40UID and Block0 can be configured using backdoor commands.

Gen3 MIFARE Ultralight 7 Byte UID

Magic Card TypeMemory SizeUID LengthFeatures
Mifare Ultralight0.2KB7 bytesUID Changeable with direct write.

Gen4 Ultimate Magic Card

Magic Card TypeMemory SizeUID LengthSectorsFeatures
Gen4 GTU

Buy Gen4 GTU Card
Configurable4 bytes
7 bytes
10 bytes
ConfigurableCan be configured as different types of MIFARE Classic cards and MIFARE Ultralight cards. Advanced commands support with detailed documentation available.

How to Use PN532 to Change the UID of Magic Cards

MTools Tec provides a new Python tool called PN532 CLI (Command Line Tool for PN532) to interact with the PN532. This tool supports all the commands in the PN532 documentation and can even run HF 14A raw commands to configure the Ultimate Magic Card and other commands.

Installation and Usage

  1. Download PN532 CLI:
http://github.com/whywilson/pn532-python
  1. Connect PN532 to Your Device:
    Ensure your PN532 module is properly connected to your Windows, Linux or MacOS.
  2. Run Main Script:
python script/pn532_cli_main.py
  1. Interactive Command Line:Run the commands with prompt.
[USB] PN532 --> help
------------------          ------------------------------
 - hw                       { Hardware-related commands... }
 - hf                       { High-frequency commands... }
 - lf                       { Low Frequency commands... }
 - ntag                     { NTAG commands... }
 - clear                    Clear screen
 - exit                     Exit client

How to read block of Mifare Classic on PN532

[USB] PN532 --> hf mf rdbl --blk 0 -k ffffffffffff -a
Block 0: 005678BB9508040002B21E2423271E1D

How to write block of Mifare Classic on PN532

[USB] PN532 --> hf mf wrbl --blk 1 -k ffffffffffff -a -d 000102030405060708090a0b0c0d0e0f
 - Write done.
[USB] PN532 --> hf mf rdbl --blk 1 -k ffffffffffff -a
Block 1: 000102030405060708090A0B0C0D0E0F

How to read block of Mifare Ultralight on PN532

[USB] PN532 --> hf mfu rdbl -b 16
16: 00000000

How to write block of Mifare Ultralight on PN532

[USB] PN532 --> hf mfu wrbl -b 16 -d 41424344
Write block 16 with data 41424344: Success
[USB] PN532 --> hf mfu rdbl -b 16
16: 41424344    |    ABCD

Change UID of Mifare Classic Magic Card on PN532

[USB] PN532 --> hf mf setuid -h
--------------------------------------------------------------------------------
hf mf setuid

Set UID of magic Mifare classic with UID or block0.

usage:
  hf mf setuid [-h] [-u <hex>] [--blk0 <hex>] [-g <dec>] [-k <hex>] [-b] [--lock] [-p <hex>]

options:
  -h, --help    show this help message and exit
  -u <hex>      UID to set (Default 11223344)
  --blk0 <hex>  Block 0 (16 bytes)
  -g <dec>      Generation: 1 => Gen1A (Default), 2 => cuid, 3 => Gen3, 4 => Gen4
  -k <hex>      Mifare Key (6 bytes)
  -b            Set Gen2 use keyB (Default keyA)
  --lock        Lock Gen3 UID forever
  -p <hex>      Set Gen4 Password (Default 00000000)

examples:
  hf mf setuid -u 11223344
  hf mf setuid -u 11223344 -g 2
  hf mf setuid --blk0 1122334444080400aabbccddeeff1122 -g 3
  hf mf setuid --blk0 1122334444080400aabbccddeeff1122 -g 4 --pwd 00000000

Execute hf 14a raw on PN532

[USB] PN532 --> hf 14a scan
- UID: 3DD6CCC2
- ATQA: 0004 (0x0400)
- SAK: 08
[USB] PN532 --> hf 14a raw -a -k -b 7 -d 40
 - 00 0A
[USB] PN532 --> hf 14a raw -d 43 -k
 - 00 0A
[USB] PN532 --> hf 14a raw -d 3000 -c -k
 - 3D D6 CC C2 E5 08 04 00 02 E2 93 65 03 12 76 1D 55 6A
[USB] PN532 --> hf 14a raw -d 3001 -c -k
 - 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 37 49
[USB] PN532 --> hf 14a raw -d 3002 -c -k
 - 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 37 49
[USB] PN532 --> hf 14a raw -d 3003 -c
 - 1B 5E A8 2A 95 55 FF 07 80 69 C8 3A A3 57 E2 FB 87 63

Get dump from Gen1A Tag

[USB] PN532 --> hf mf cview [--file] [--bin]

Get dump from Mifare Classic

A key file is necessary for authentication.

[USB] PN532 --> hf mf dump [-k <file>] [--file] [--bin]

Get dump from Mifare Ultralight

[USB] PN532 --> hf mfu dump [--file] [--bin]