How to Read MIFARE Classic Cards Using C#
← Back to PC/SC programming in C#
How do you read a MIFARE Classic card in C#? Connect to the card through PC/SC and send three reader commands with SCardTransmit. Load Authentication Keys (FF 82) puts a 6-byte key into the reader's volatile memory. General Authenticate (FF 86) proves to the card that the reader knows that key for one sector. Read Binary (FF B0) then returns 16 bytes per block from that sector. Each reply ends in a status word. 90 00 means success. 63 00 means the reader could not do it. 69 82 means the security conditions were not met.
This tutorial builds a small .NET 10 console program that does exactly that with the factory default key FF FF FF FF FF FF on ACS readers such as the ACR1252U, ACR1552U and ACR122U. It reads data blocks only. It never reads or writes a sector trailer and contains no write command. It reuses the two PC/SC files from our PC/SC programming in C# tutorial and adds one MIFARE helper file. To try the same commands by hand first, without writing code, use our MIFARE card test guide. BSD Infotech is an independent ACS supplier and integrator, not the manufacturer.
Compiled by BSD; not yet tested on a reader. BSD Infotech built this code for .NET 10 on 1 Dec 2026 with 0 warnings and 0 errors, and ran it on a PC without an ACS reader (it reported "no reader" as expected). It has not yet been run with an ACS reader and a MIFARE Classic card. The tests still to be done are listed under what BSD still has to test.
MIFARE Classic 1K Memory Layout
A MIFARE Classic 1K card holds 1,024 bytes in 16 sectors of 4 blocks, each block 16 bytes. Blocks are numbered straight through, 00 to 3F in hex, so sector n starts at block n × 4. Your code always addresses blocks, and the card checks keys per sector.
| Sector | Data blocks (hex) | Sector trailer (hex) | Notes |
|---|---|---|---|
| 0 | 00, 01, 02 | 03 | Block 00 is the manufacturer block: UID and manufacturer data, read-only. Only 01 and 02 are free for data. |
| 1 | 04, 05, 06 | 07 | The sector this tutorial reads by default. |
| 2 | 08, 09, 0A | 0B | |
| 3 to 14 | 0C to 3A, three per sector | 0F, 13, 17 … 3B | Same pattern: the 4th block of every sector is its trailer. |
| 15 | 3C, 3D, 3E | 3F | Last sector. |
That leaves 47 data blocks (752 bytes) for your application. In code, a block is a trailer when block % 4 == 3, and its sector is block / 4.
The sector trailer, read-only explanation
The trailer is the security block of the sector. NXP's MIFARE Classic EV1 1K data sheet lays it out as bytes 0 to 5: key A, bytes 6 to 9: the access bits (byte 9 is a free user byte) and bytes 10 to 15: key B (optional). The access bits decide which key may read or write each block of the sector. Keys are never returned in clear: when a trailer is read, key A comes back as zeros, and key B too unless the access bits make it readable. What key A, key B and the access bits do, and why changing them needs great care, is explained on our MIFARE authentication and key management page. This program has nothing to do with trailers, so it never reads them.
A MIFARE Classic 4K card uses the same layout for sectors 0 to 31 and has eight larger sectors (16 blocks each) after that. The program below reads only sectors 0 to 15 of either card. The 4K details and the read lengths each ACS reader allows are in the MIFARE Classic test section.
The Three Commands: FF 82, FF 86, FF B0
MIFARE Classic cards do not understand ISO 7816-4 APDUs. The PC/SC Workgroup therefore defined storage-card commands with class FF, which the reader carries out itself and turns into MIFARE commands on the radio side (background in ACS FF commands vs card APDUs). The ACR1252U, ACR1552U and ACR122U manuals document the same three byte layouts:
| Step | Bytes | Fields | Expected reply |
|---|---|---|---|
| Load Authentication Keys | FF 82 00 00 06 FF FF FF FF FF FF | P1 00 = key goes into the reader's volatile memory. P2 = key location, 00 or 01. Lc 06, then the 6 key bytes. Nothing is sent to the card. | 90 00 |
| General Authenticate | FF 86 00 00 05 01 00 04 60 00 | Five data bytes: version 01, address 00 04 (block 04), key type 60 (key A; 61 = key B), key location 00. | 90 00 |
| Read Binary | FF B0 00 04 10 | P1 P2 = block address (00 04), Le 10 = 16 bytes, one block. | 16 data bytes + 90 00 |
Four facts from the ACS manuals shape the code:
- The key locations are volatile. ACS provides two (00 and 01). They are cleared when the reader is disconnected, so the program loads the key every time it starts.
- One authentication covers the whole sector. After
90 00on block 04, blocks 04, 05 and 06 can be read without authenticating again. Moving to another sector needs a newFF 86. - The older
FF 88authenticate command is obsolete. Both PC/SC Part 3 and the ACS manuals say so. UseFF 86. - Read lengths differ between readers. One block (16 bytes) works on all three. The ACR1252U also reads up to 3 data blocks of a 1K card at once, and the ACR1552U up to 255 bytes. The program reads one block per command, so it behaves the same on every model. The comparison is in the test guide's reader table.
// The sequence the program sends for sector 1. Compiled by BSD; not yet tested on a reader.
FF 82 00 00 06 FF FF FF FF FF FF load the factory key into location 00 -> 90 00
FF 86 00 00 05 01 00 04 60 00 authenticate block 04 with key A -> 90 00
FF B0 00 04 10 read block 04 -> 16 bytes + 90 00
FF B0 00 05 10 read block 05 -> 16 bytes + 90 00
FF B0 00 06 10 read block 06 -> 16 bytes + 90 00
block 07 (trailer) is skipped
Project Setup (.NET 10)
Language: C# 14 on .NET 10, Windows only (P/Invoke to winscard.dll, no NuGet packages). You need: an ACS contactless reader with its driver installed and visible to PC/SC (check with our PC/SC reader status guide), and a spare MIFARE Classic 1K test card that still has its factory keys. Never point this program at a card from a live access, canteen or membership system.
- Create the project exactly as in the Day 35 project setup:
dotnet new console -n ReadMifare, which targetsnet10.0with the .NET 10 SDK. - Add the two shared PC/SC files from that tutorial, unchanged: WinScard.cs (the P/Invoke declarations) and Pcsc.cs (
PcscContext,CardConnection,Apduhelpers). - Add
MifareClassic.csfrom the next section. - Replace
Program.cswith the program below. - Build:
dotnet build. Expected: Build succeeded, 0 errors. Run:dotnet run -- ACR1252 1,2to use the reader whose name contains "ACR1252" and read sectors 1 and 2. With no arguments it uses the first reader whose name contains "PICC" and reads sector 1.
The project needs four files in all: WinScard.cs, Pcsc.cs, MifareClassic.cs and Program.cs. The project file is the one shown in the Day 35 setup, with nothing added.
MifareClassic.cs: the Read-Only Helper
This file wraps the three commands and turns each status word into a result your code can switch on. It holds the factory default key as its only key and has two built-in limits: LoadKey accepts only locations 00 and 01, and ReadBlock throws if you pass a trailer block. It also checks the ATR, because sending a MIFARE key to a card that is not a MIFARE Classic achieves nothing. The ATR layout used here (card name 00 01 = 1K, 00 02 = 4K) is explained in our C# UID tutorial and in the card identification step.
Compiled by BSD; not yet tested on a reader. Built for net10.0 with 0 warnings and 0 errors (nullable on, warnings as errors) on 1 Dec 2026.
// MifareClassic.cs: read-only MIFARE Classic 1K helpers over the PC/SC Part 3 storage-card commands
// that ACS documents for the ACR1252U, ACR1552U and ACR122U (FF 82, FF 86, FF B0).
// C# 14, .NET 10, Windows only. Needs WinScard.cs and Pcsc.cs. Compiled by BSD; not yet tested on a reader.
// Deliberately has no write command and refuses to read sector trailers.
using System;
namespace Bsd.Pcsc;
/// <summary>What a reply to FF 82, FF 86 or FF B0 means.</summary>
public enum MifareResult
{
Ok, // 90 00
Failed, // 63 00: ACS "the operation failed"; PC/SC Part 3 "no information given"
SecurityNotSatisfied, // 69 82: PC/SC Part 3 "security status not satisfied"
Other // any other status word (the ACR1552U manual allows other 6X XX codes)
}
public static class MifareClassic
{
/// <summary>NXP's factory default (transport) key: FF FF FF FF FF FF. This example uses no other key.</summary>
public static readonly byte[] FactoryDefaultKey = [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF];
public const byte KeyTypeA = 0x60; // General Authenticate key type for key A (0x61 would be key B)
public const int Sectors1K = 16, BlocksPerSector = 4, BlockSize = 16;
/// <summary>First block of a 1K sector: sector 1 starts at block 04.</summary>
public static int FirstBlock(int sector) => sector * BlocksPerSector;
/// <summary>The sector trailer is the 4th block of each 1K sector: 03, 07, 0B ... 3F.</summary>
public static bool IsTrailer(int block) => block % BlocksPerSector == BlocksPerSector - 1;
public static MifareResult Classify(byte[] reply)
{
if (reply.Length < 2) return MifareResult.Other;
byte sw1 = reply[^2], sw2 = reply[^1];
if (sw1 == 0x90 && sw2 == 0x00) return MifareResult.Ok;
if (sw1 == 0x63 && sw2 == 0x00) return MifareResult.Failed;
if (sw1 == 0x69 && sw2 == 0x82) return MifareResult.SecurityNotSatisfied;
return MifareResult.Other;
}
/// <summary>True when the ATR is the PC/SC Part 3 storage-card ATR of a MIFARE Classic 1K (card name 00 01)
/// or 4K (00 02): 3B 8F 80 01 80 4F 0C A0 00 00 03 06 SS C0 C1 ...</summary>
public static bool IsMifareClassic(byte[] atr, out string name)
{
name = "not a MIFARE Classic ATR";
if (atr.Length < 15 || atr[7] != 0xA0 || atr[8] != 0x00 || atr[9] != 0x00 || atr[10] != 0x03 || atr[11] != 0x06)
return false;
if (atr[13] != 0x00) return false;
if (atr[14] == 0x01) { name = "MIFARE Classic 1K"; return true; }
if (atr[14] == 0x02) { name = "MIFARE Classic 4K (only the 1K-style sectors 0-15 are read here)"; return true; }
return false;
}
/// <summary>Load Authentication Keys: FF 82 00 [location] 06 [key]. P1 00 = reader volatile memory.
/// ACS readers offer volatile locations 00 and 01; they are cleared when the reader is unplugged.</summary>
public static MifareResult LoadKey(CardConnection card, byte location, byte[] key)
{
if (key.Length != 6) throw new ArgumentException("A MIFARE Classic key is 6 bytes.", nameof(key));
if (location > 1) throw new ArgumentOutOfRangeException(nameof(location), "Use volatile location 00 or 01.");
byte[] apdu = new byte[11];
apdu[0] = 0xFF; apdu[1] = 0x82; apdu[2] = 0x00; apdu[3] = location; apdu[4] = 0x06;
key.CopyTo(apdu, 5);
try { return Classify(card.Transmit(apdu)); }
finally { Array.Clear(apdu); } // do not leave key bytes lying around in memory longer than needed
}
/// <summary>General Authenticate: FF 86 00 00 05 01 00 [block] [key type] [location].
/// One successful authentication opens every block of the same sector.</summary>
public static MifareResult Authenticate(CardConnection card, int block, byte keyType, byte location)
{
if (block is < 0 or > 0xFF) throw new ArgumentOutOfRangeException(nameof(block));
byte[] apdu = [0xFF, 0x86, 0x00, 0x00, 0x05, 0x01, 0x00, (byte)block, keyType, location];
return Classify(card.Transmit(apdu));
}
/// <summary>Read Binary: FF B0 00 [block] 10, one 16-byte block. Refuses sector trailers.</summary>
public static MifareResult ReadBlock(CardConnection card, int block, out byte[] data)
{
if (block is < 0 or >= Sectors1K * BlocksPerSector) throw new ArgumentOutOfRangeException(nameof(block));
if (IsTrailer(block)) throw new InvalidOperationException($"Block {block:X2} is a sector trailer; this example does not read trailers.");
byte[] reply = card.Transmit([0xFF, 0xB0, 0x00, (byte)block, BlockSize]);
var result = Classify(reply);
data = result == MifareResult.Ok ? Apdu.Data(reply) : [];
if (result == MifareResult.Ok && data.Length != BlockSize) result = MifareResult.Other; // unexpected length
return result;
}
/// <summary>Plain-language meaning of a result, for log lines.</summary>
public static string Explain(MifareResult result, string step) => (result, step) switch
{
(MifareResult.Ok, _) => "OK (90 00)",
(MifareResult.Failed, "load") => "63 00: the reader did not accept the key (check Lc = 06, six key bytes, location 00 or 01)",
(MifareResult.Failed, "auth") => "63 00: authentication failed (key not loaded, not the factory key for this sector, key type not allowed, or the card moved)",
(MifareResult.Failed, _) => "63 00: read failed (block not authenticated, a different sector, or the card moved)",
(MifareResult.SecurityNotSatisfied, _) => "69 82: security status not satisfied (authenticate this sector first; the access bits may not allow this key)",
_ => "unexpected status word: check the reader's API manual"
};
/// <summary>Printable ASCII view of a block, dots for other bytes.</summary>
public static string Ascii(byte[] data) =>
new(Array.ConvertAll(data, b => b is >= 0x20 and < 0x7F ? (char)b : '.'));
}
Program.cs: Read the Data Blocks
The program finds the reader, waits up to 15 seconds for a card, connects in shared mode and checks the ATR. It reads the UID for your log and loads the factory key into location 00. Then, for each sector you name, it authenticates the sector's first block with key A and reads the three data blocks. The key is fixed in the code on purpose: this example is for factory-key test cards only, and how real keys should be handled is a separate topic (see good practice).
Compiled by BSD; not yet tested on a reader. Built for net10.0 with 0 warnings and 0 errors on 1 Dec 2026. Run on a PC without an ACS reader only.
// Day 43: read MIFARE Classic 1K data blocks in C# with the factory default key.
// C# 14, .NET 10, Windows only. Needs WinScard.cs, Pcsc.cs and MifareClassic.cs. Compiled by BSD; not yet tested on a reader.
// Read-only: loads FF FF FF FF FF FF into volatile key location 00, authenticates with key A
// and reads the data blocks of the sectors you name. It never reads or writes a sector trailer
// and has no write command at all. Use it on your own test cards only.
// Usage: dotnet run -- [reader filter, default PICC] [sectors, default 1], e.g. dotnet run -- ACR1252 1,2
using System;
using System.Linq;
using System.Threading;
using Bsd.Pcsc;
using var cts = new CancellationTokenSource();
Console.CancelKeyPress += (_, e) => { e.Cancel = true; cts.Cancel(); };
string filter = args.Length > 0 ? args[0] : "PICC";
int[] sectors;
try
{
sectors = (args.Length > 1 ? args[1] : "1").Split(',').Select(int.Parse).Distinct().ToArray();
}
catch (FormatException) { Console.WriteLine("Sectors must be numbers such as 1 or 1,2."); return 1; }
if (sectors.Any(s => s is < 0 or >= MifareClassic.Sectors1K)) { Console.WriteLine("Sectors run from 0 to 15 on a 1K card."); return 1; }
try
{
using var pcsc = new PcscContext();
string? reader = pcsc.ListReaders().FirstOrDefault(r => r.Contains(filter, StringComparison.OrdinalIgnoreCase));
if (reader is null) { Console.WriteLine($"No reader whose name contains \"{filter}\". Use the contactless (PICC) reader."); return 1; }
Console.WriteLine($"Reader: {reader}");
// Wait up to 15 s for a card.
var state = new[] { PcscContext.NewState(reader) };
pcsc.WaitForChange(state, 0, cts.Token);
while ((state[0].dwEventState & WinScard.SCARD_STATE_PRESENT) == 0)
{
Console.WriteLine("Place a MIFARE Classic test card on the reader (15 s; Ctrl+C to stop)...");
PcscContext.Acknowledge(state);
if (!pcsc.WaitForChange(state, 15_000, cts.Token)) { Console.WriteLine("No card within 15 s."); return 2; }
}
using var card = pcsc.Connect(reader);
var (_, _, atr) = card.Status();
Console.WriteLine($"ATR: {Apdu.HexSpaced(atr)}");
// 1. Make sure it is a MIFARE Classic before sending any key.
if (!MifareClassic.IsMifareClassic(atr, out string cardName))
{
Console.WriteLine($"Card is {cardName}. No key sent. For other card types see the MIFARE test guide.");
return 3;
}
Console.WriteLine($"Card: {cardName}");
byte[] uidReply = card.Transmit(Apdu.GetUid);
Console.WriteLine(Apdu.IsSuccess(uidReply) ? $"UID: {Apdu.Hex(Apdu.Data(uidReply))}" : $"UID not read ({Apdu.StatusWord(uidReply)})");
// 2. Load the factory default key into the reader's volatile location 00. Nothing goes to the card yet.
const byte keyLocation = 0x00;
var load = MifareClassic.LoadKey(card, keyLocation, MifareClassic.FactoryDefaultKey);
Console.WriteLine($"Load key (location 00): {MifareClassic.Explain(load, "load")}");
if (load != MifareResult.Ok) return 4;
int failures = 0;
foreach (int sector in sectors)
{
int first = MifareClassic.FirstBlock(sector);
// 3. Authenticate the sector once with key A. Any block of the sector would do; use its first block.
var auth = MifareClassic.Authenticate(card, first, MifareClassic.KeyTypeA, keyLocation);
Console.WriteLine($"Sector {sector:D2}, authenticate block {first:X2} with key A: {MifareClassic.Explain(auth, "auth")}");
if (auth != MifareResult.Ok)
{
failures++;
// A failed authentication can leave the card unable to continue until it is selected again.
// If the next sectors fail too, lift the card, present it again and rerun. Here we report and move on.
continue;
}
// 4. Read the three data blocks (block 00 of sector 0 is the read-only manufacturer block). Skip the trailer.
for (int block = first; block < first + MifareClassic.BlocksPerSector; block++)
{
if (MifareClassic.IsTrailer(block)) { Console.WriteLine($" Block {block:X2}: sector trailer, not read"); continue; }
var read = MifareClassic.ReadBlock(card, block, out byte[] data);
Console.WriteLine(read == MifareResult.Ok
? $" Block {block:X2}: {Apdu.HexSpaced(data)} |{MifareClassic.Ascii(data)}|{(block == 0 ? " (manufacturer block)" : "")}"
: $" Block {block:X2}: {MifareClassic.Explain(read, "read")}");
if (read != MifareResult.Ok) failures++;
}
}
return failures == 0 ? 0 : 5;
}
catch (OperationCanceledException)
{
Console.WriteLine("Stopped.");
return 130;
}
catch (PcscException ex)
{
Console.WriteLine(ex.Message); // e.g. 0x80100069 when the card was removed mid-read
return 1;
}
What the output should look like
The lines below show the expected format for a new card. They illustrate the program's output and are not a captured result. Your UID will differ, and NXP's data sheet says the content of data blocks at delivery is not defined, so new cards often show zeros but may hold other bytes.
// Illustrated output, not a captured result. Compiled by BSD; not yet tested on a reader.
Reader: ACS ACR1252 1S CL Reader PICC 0
ATR: 3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 01 00 00 00 00 6A
Card: MIFARE Classic 1K
UID: 1A2B3C4D
Load key (location 00): OK (90 00)
Sector 01, authenticate block 04 with key A: OK (90 00)
Block 04: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
Block 05: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
Block 06: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
Block 07: sector trailer, not read
The exit code tells a calling script what happened: 0 all blocks read, 1 setup or PC/SC error, 2 no card, 3 not a MIFARE Classic, 4 key not loaded, 5 at least one sector or block failed, 130 stopped with Ctrl+C.
Handling 63 00 and 69 82
Two layers can fail, and the code checks them in order. First the PC/SC return code of SCardTransmit: if it is not zero, Pcsc.cs throws a PcscException and no status word exists (for example 0x80100069 when the card was lifted). Then the status word at the end of the reply. The ACS manuals list 90 00 for success and 63 00 for failure on all three commands (the ACR1552U manual allows other 6X XX codes too). PC/SC Part 3 adds 69 82, "security status not satisfied", for General Authenticate and Read Binary. MifareClassic.Classify maps all of these to a result.
| Command | Reply | What it usually means | What the program does / what you should check |
|---|---|---|---|
FF 82 Load Keys | 63 00 | The reader rejected the key load: wrong Lc, wrong key length or a location it does not have | Stops (exit 4). Check Lc = 06, exactly 6 key bytes, location 00 or 01. The helper already enforces all three, so a 63 00 here points at the reader or firmware. |
FF 86 Authenticate | 63 00 | Authentication did not succeed. Causes: key not loaded (reader replugged), the sector no longer has the factory key, the access bits do not allow this key type, the card is not a MIFARE Classic, or it moved | Reports the sector as failed and goes on to the next one. Lift and present the card, then rerun. If one sector keeps failing on your own test card, it has been given another key. This program only uses the factory key and does not try others. |
FF 86 Authenticate | 69 82 | Security status not satisfied (PC/SC Part 3 wording) | Treated like 63 00 for that sector. The fix is the same: check the key and key type for that sector. |
FF B0 Read Binary | 63 00 | The read failed: the block is in a sector that was not authenticated in this session, the address is wrong, or the card moved | Reports the block. Authenticate a block of the same sector first. Remember that reading block 08 needs sector 2's authentication, not sector 1's. |
FF B0 Read Binary | 69 82 | Security status not satisfied: not authenticated, or the access bits do not let this key read the block | Reports the block. In the factory configuration, key A may read every data block, so on a new card this points to a missing or failed authentication. |
| Any | Other 6X XX | Reader-specific error (the ACR1552U documents more codes) | Reported as "unexpected status word". Look it up in your reader's API manual and our status word table. |
A failed authentication on your own factory-key card almost always has a simple cause. Work through the checklist in what a failed authentication means. If the card has been given keys you do not know, the right answer is to ask whoever issued it. BSD does not publish, and will not help with, ways of finding or recovering keys.
Why the Program Never Touches Sector Trailers
- Reading one tells you little. The keys come back as zeros. Only the access bits (and key B, if the access bits make it readable) are visible, and you do not need them to read data.
- Writing one is the riskiest operation on the card. NXP's data sheet warns that if the card finds a format error in the access bits, the whole sector is blocked irreversibly. Valid but badly chosen bits can also leave a sector whose keys can never be changed again.
- Multi-block reads exclude trailers by design. The ACR1252U manual allows trailer access only in single-block mode, and the ACR1552U skips trailers unless the "with trailers" mode is set in P1. Keeping P1 =
00keeps them out.
Changing keys and access bits belongs in a controlled card-issuing step, not in a reading tool. Our key management page explains that step in concept, without code.
Good Practice for Real Applications
- Do not hard-code production keys. The factory key is public, so it is fine in a tutorial. A real system's keys should never sit in a .NET assembly, a config file or a log, because .NET code is easy to decompile. Where they should live (a SAM, or a server) is covered in secure key storage.
- Load the key once per session, and again after any reconnect: the volatile locations are cleared when the reader is unplugged.
- Keep one sector's authenticate and read together. If another program might use the same reader, wrap them in
SCardBeginTransaction/SCardEndTransaction(explained in share modes and transactions), so nobody else's command lands in the middle. - Treat the UID as an identifier, not as proof. Use the data you read after authentication for decisions, and validate it in your application (for example, a checksum or a server-side check).
- Log status words, not keys. The program prints the key location, never the key bytes.
- Plan beyond MIFARE Classic for anything security-relevant: NXP points such applications to MIFARE DESFire and MIFARE Plus. See MIFARE Classic security and migration.
What BSD Still Has to Test
Until these tests are done, the code stays marked "not yet tested on a reader". All tests use BSD's own MIFARE Classic 1K test cards with factory keys, on Windows 10 or 11, and are read-only:
- ACR1252U, sector 1: load key, authenticate block 04, read blocks 04 to 06. Expect
90 00on each step and 16 bytes per block. - ACR1552U and ACR122U, sectors 0, 1 and 15: the same sequence, to confirm one program works on all three models. Sector 0 also shows the manufacturer block.
- Reader replugged between runs: confirm the program still works because it loads the key every run.
- Card lifted during a read: record the PC/SC error the program prints (expected
0x80100069or similar) and that it exits cleanly. - NTAG tag on the reader: confirm the ATR check stops the program before any key is sent.
- Status words on failure: read a block of sector 2 after authenticating only sector 1 (by changing one line), and record whether each reader replies
63 00,69 82or another code.
Troubleshooting
| What you see | Likely cause | What to do |
|---|---|---|
| "No reader whose name contains PICC" | Driver missing, or you passed a filter that matches nothing | Run the program with part of the reader's name, for example -- ACR122. Check the reader in the PC/SC status guide. |
| "Card is not a MIFARE Classic ATR" | An NTAG, Ultralight or DESFire card, or the SAM reader entry was chosen | Use the PICC reader entry. Identify the card with the card identification step. |
SCardConnect failed: 0x8010000B | Another program (QuickView, Script Tool, a BSD utility) holds the card | Close the other tool and run again. |
Sector 0 reads, sector 1 fails with 63 00 | Sector 1 of this card no longer has the factory key, or the card moved after a failed step | Present the card again and rerun. If it still fails, the card has been personalised: use another factory-new test card. |
| Every authentication fails after the reader was unplugged | The key location was cleared | The program loads the key at the start of every run. If you changed it to load once, load again after a reconnect. |
| Reads of a 4K card stop at sector 15 | By design: the program reads 1K-style sectors only | For sectors 16 and up, extend Sectors1K to 32. Sectors 32 to 39 use 16-block sectors, so they need different block numbering. |
SCardTransmit failed: 0x80100069 | Card removed during the exchange | Keep the card flat and still. Reconnect, load the key and authenticate again. |
Sources
Checked on 30 Nov 2026. Command layouts and response codes were checked in the ACS manuals from the SDK kits (local copies), and the MIFARE memory layout in NXP's data sheet. Explanations are in BSD's own words.
- ACS, ACR1252U Application Programming Interface, version 1.17: Load Authentication Keys, Authentication for MIFARE Classic, Read Binary Blocks (section 5.2.4), listed on the ACR1252U product page
- ACS, ACR1552U Series Reference Manual, version 1.05: Load Key, Authenticate, Read Binary Blocks (section 5.3.3), MIFARE Classic 1K/4K memory maps
- ACS, ACR122U Application Programming Interface: Load Authentication Keys, Authentication, Read Binary Blocks
- PC/SC Workgroup specifications, Part 3 "Requirements for PC-Connected Interface Devices": Load Keys, General Authenticate and Read Binary commands and their status words (section 3.2.2.1)
- NXP, MF1S50yyX/V1 MIFARE Classic EV1 1K data sheet, rev. 3.2: memory organisation, manufacturer block, sector trailer, access-condition format check
- Microsoft Win32 reference: SCardTransmit
BSD Infotech is an independent ACS supplier and integrator, not the manufacturer. ACS, the ACS logo and ACS product names belong to Advanced Card Systems Ltd. MIFARE, MIFARE Classic, MIFARE DESFire and MIFARE Plus are trademarks of NXP B.V. Windows is a trademark of Microsoft Corporation.
