Why i can't read a card(SAK=28) with PN532(libnfc)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Why i can't read a card(SAK=28) with PN532(libnfc)

6,100 Views
willok
Contributor I


I have a card, with a SAK=28,the info in AN10833

SAK=28 is a multiple MIFARE implementation card

SAK=0x08(MIFARE Classic 1KB) + SAK = 0x20(MIFARE DESFire)

I can't read with libnfc like "MIFARE Classic 1KB" card

D:\PN532\Release>nfc-anticol.exe

NFC reader: pn532_uart:COM1 opened

Sent bits:     26 (7 bits)

Received bits: 04  00

Sent bits:     93  20

Received bits: 43  76  2d  0b  13

Sent bits:     93  70  43  76  2d  0b  13  5b  2e

Received bits: 28  b4  fc

Sent bits:     e0  50  bc  a5

Received bits: 10  78  80  a0  02  20  90  00  00  00  00  00  43  76  2d  0b  e8  e0

Sent bits:     50  00  57  cd

Found tag with

UID: 43762d0b

ATQA: 0004

SAK: 28

ATS: 10  78  80  a0  02  20  90  00  00  00  00  00  43  76  2d  0b  e8  e0

Labels (2)
0 Kudos
Reply
1 Reply

3,115 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello,

I am not familiar with libnfc and do not have your card to test, but the next list of raw codes could be used to access (Read/Write) a MIFARE Classic 1K tag using a PN532, assuming that the tag has the default generic authentication keys (all FFs). In the authentication command I used the UID you showed above with the corresponding packet data checksum.

// ====================== //

// Activate a target in passive mode //

// ====================== //

00 00 FF 04 FC D4 4A 01 00 E1 00;

// ====================== //

// Authentication sector 1 (addresses 4 to 7)

// ====================== //

// Replace the 4 bytes XX XX XX XX below by the Mifare ID number (NFCID1).

// This number is returned by InListPassiveTarget call.

// Calculate the required DCS (Packet Data Checksum) and place it in YY

// 00 00 FF 0F F1 D4 40 01 60 07 FF FF FF FF FF FF XX XX XX XX YY 00

00 00 FF 0F F1 D4 40 01 60 07 FF FF FF FF FF FF 43 76 2D 0B 99 00;

// ====================== //

// Read/Write command     //

// ====================== //

// Read 16 bytes from block address 0x04

00 00 FF 05 FB D4 40 01 30 04 B7 00;

// Write 16 bytes to block address 0x04

00 00 FF 15 EB D4 40 01 A0 04 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF 4F 00;

// Read 16 bytes from block address 0x04

00 00 FF 05 FB D4 40 01 30 04 B7 00;

I hope this helps.

Regards!

Jorge Gonzalez

0 Kudos
Reply