MIFARE Classic is the card that taught the industry that a proprietary cipher is not a security model. It is still in service in many buildings, transport systems and hotels. This guide covers how the memory is laid out, how its keys work and how to recover them from a card you own using the current Iceman client. Test only cards and systems you own or are authorised to assess.
The three sizes
MIFARE Classic is a 13.56 MHz ISO 14443-A memory card. The memory is organised in 16-byte blocks that are grouped in sectors.
- Mini: 320 bytes, five sectors of four blocks.
- 1K: 1,024 bytes, sixteen sectors of four blocks.
- 4K: 4,096 bytes, thirty-two sectors of four blocks followed by eight sectors of sixteen blocks.
The client also has a --2k option for 2K cards, such as a MIFARE Plus 2K running in its Classic compatible mode.
Blocks, sectors and trailers
Every sector ends in a trailer block that holds the keys and the access conditions. The trailer has Key A in bytes 0 to 5, the access bits in bytes 6 to 8, a general purpose user data byte in byte 9, then Key B in bytes 10 to 15. The access bits decide which key can read, write or change each block of the sector, so two applications can share one card with different keys. When a reader reads a trailer, the card returns zeros in place of Key A.
Block 0 is the manufacturer block. It holds the UID (with its check byte on 4-byte UID cards) and manufacturer data. It is programmed and write protected in production, so on a genuine card it cannot be written. Block 3 of each 1K sector, and the last block in each larger sector, is the trailer. This is why an application’s data sits in blocks 1 and 2, 4 to 6 and so on.

Identifying a card
hf search
hf mf infohf search confirms the ISO 14443-A card and hf mf info reports the UID, ATQA and SAK, tests common default keys, shows whether the card is a magic card and reports its random number generator behaviour, including a static nonce. It also recognises some clone chip makers, such as the Fudan FM11RF08 family and its backdoor keys.
The cipher and why it fails
The cards authenticate each sector with a 48-bit key using a proprietary stream cipher called Crypto1. Since 2008 researchers published a series of attacks that together make key recovery practical. The darkside attack (Nicolas Courtois, 2009) needs no known key. The nested attack (Garcia and colleagues at Radboud University, 2009) needs one known key and recovers the rest. The hardnested attack (Carlo Meijer and Roel Verdult, ACM CCS 2015) handles the hardened cards, such as the Classic EV1, that NXP released in response. A card that uses a static nonce has its own variant. In 2024 Philippe Teuwen of Quarkslab showed that the Fudan FM11RF08S, a compatible chip sold as resistant to every known card-only attack, carries a hardware backdoor key that is the same on every such card and lets its keys be recovered in minutes even when they are diversified; the older FM11RF08 has a similar backdoor. hf mf info reports these backdoor keys when it finds them. The core fact is that a 48-bit key and a weak cipher cannot hold up against an attacker with a reader, whether the keys are default or not.

Recovering keys on your own card
The Iceman client automates the process:
hf mf autopwnIt tries the default key dictionary first, falls back to the darkside attack if no key is found, uses the keys it has to run the nested, hardnested or static nested attack against the remaining sectors, and writes the keys and a dump file when it finishes. For a 1K card you can say so with --1k. If you only want to test the default keys, use:
hf mf chk --1k -k FFFFFFFFFFFFThe key FFFFFFFFFFFF is the factory default, and the client also ships a dictionary file of common keys. To dump the card once you have its keys:
hf mf dump --1kThe dump is saved as binary and JSON files. It takes its keys from the key file that hf mf autopwn or hf mf chk --dump wrote, and from v4.23346 --sk also saves the extracted keys. To read a single block or sector, use hf mf rdbl or hf mf rdsc. The attacks run against a card, so keep the card still and in the same position on the antenna for the whole run.
Copying a card
To copy a dump you need a card that accepts a write to block 0. These cards are called magic cards, and they come in a few generations.
- Gen1A: responds to special commands that unlock block 0 writes. In the client,
hf mf csetuid -u 01020304sets the UID, andhf mf cload -f <file>loads a dump. - Gen2 or CUID: accepts direct writes to block 0 with ordinary commands, so a normal
hf mf restorewrites the whole card. - Gen4 GTU, also called UMC (ultimate magic card): has a configurable behaviour, a shadow mode and optional password protected backdoor commands, and can emulate MIFARE Classic, Ultralight and NTAG chips.
Some systems check for magic cards by testing their special commands, so a copy that works on one reader can fail on another. The Proxmark3 documentation of magic cards lists the types and the commands that identify them.
Security in plain terms
Treat MIFARE Classic as broken. A card that uses only default keys can be copied in seconds, and a card that uses diversified keys can usually still be recovered with the nested attacks. The right defence is to move to a card that uses an AES or equivalent scheme, with keys that are unique to each card and application, such as DESFire EV2 or EV3.
Where it is used
Hotel keys, gym and building access, student cards, laundry and vending credits, and older city transport cards.
To see the whole workflow in an assessment, with reporting and remediation, read Attacking RFID Access Control: Assess, Report and Fix. The Proxmark3 commands are taught in Proxmark: RFID Research and Cloning and the RFID and NFC Ultimate Course. For handheld emulation of the same cards, see Chameleon Ultra: Cloning and Emulating RFID Cards.
Proxmark3 commands
These commands were checked against Iceman client v4.23346, released September 2026. Run -h on any of them for the options in your own build.
hf mf infoidentifies the card and tests the default keys, andhf mf autopwnrecovers the keys and dumps the card in one run.hf mf chk,hf mf fchk,hf mf darkside,hf mf nested,hf mf hardnestedandhf mf staticnestedrun the individual steps.hf mf senandhf mf isenhandle static encrypted nonce cards such as the FM11RF08S.hf mf dumpreads a card whose keys are known,hf mf rdblandhf mf rdscread a block or sector, andhf mf viewshows a saved dump. From v4.23346hf mf viewalso decodes VIGIK and HID PACS data, andhf mf dumpaccepts--sk.hf mf restorewrites a dump back,hf mf wrblwrites one block, andhf mf wiperesets a card to zeros and default keys.hf mf simsimulates a card from emulator memory, loaded withhf mf eloadand read back withhf mf eview.hf mf csetuid,hf mf cloadandhf mf cwipework on Gen1A magic cards, thehf mf g...commands on Gen3 and Gen4 cards, and thehf mf gdm...commands on GDM cards.hf mf acldecodes access bits.
Each chip in this guide has its own entry in the RFID and NFC Chip Database: MIFARE Classic 1K, MIFARE Classic 4K and MIFARE Classic Mini.
More in this series
Start with the hub guide, How to Identify an RFID or NFC Card. Related reading: MIFARE Ultralight and Ultralight C and MIFARE Plus.
More from this author
- One capture, three questions2 December, 2026
- Payload channels versus timing channels2 December, 2026
