All paths

RFID and NFC

MIFARE Classic and NTAG cards on an MFRC522 and a PN532: how a passive tag is powered, UIDs of four and seven bytes, sectors, keys and blocks, NTAG pages and NDEF, an access list with a master card, honest security (UIDs clone, Crypto1 is broken), and a spaceship crew airlock.

Arduino Uno R3Free7 lessons6 h3 chapters1,892 XPEmbedded engineering · Intermediate+150 XP

0 of 7 done

What you will build

2 projects, built step by step

7 lessons in 3 chapters, about 6 hours on a simulated Arduino Uno R3. Free, in your browser, every step checked by the simulator.

Chapter 1 project

Sectors and blocks

Inside a MIFARE Classic 1K: 16 sectors of four 16-byte blocks, keys and access bits in every sector trailer, the wrong key timing out, the transport key FF FF FF FF FF FF working, and a name written to block 4 and read back.

Open it in the simulator
Chapter 2 project

Security limits

A door that trusts the UID lets in a card that only copies it. A door that gives each card a secret in a keyed sector and checks it on every tap refuses the copy. And why even that is not enough: MIFARE Classic’s Crypto1 has been broken since 2008.

Open it in the simulator
The map

Chapter by chapter

Each lesson opens when the one before it is done, and each chapter ends in a project.

Chapter 1

Cards and readers

How tags work, their UIDs, and the memory inside a MIFARE Classic.

  1. Open187 XP

    How tags work

    A reader that powers the card it reads: the MFRC522’s 13.56 MHz field, a passive tag’s coil and chip, and the ATQA and SAK that tell a MIFARE Classic 1K from an NTAG213 before anything else is said.

    0 of 5 steps

  2. Locked187 XP

    MFRC522 UIDs

    Every card’s UID, four bytes or seven, sent in the clear before anything secret; PICC_HaltA() makes a card held on the reader count once per tap; and the property that decides which UIDs the cards on this bench carry.

    0 of 5 steps

  3. ProjectLocked472 XP

    Sectors and blocks

    Inside a MIFARE Classic 1K: 16 sectors of four 16-byte blocks, keys and access bits in every sector trailer, the wrong key timing out, the transport key FF FF FF FF FF FF working, and a name written to block 4 and read back.

    0 of 6 steps

5 questions, graded as you go.
Chapter 2

Building with tags

NFC on the PN532, access lists, and the limits of card security.

  1. Locked236 XP

    PN532 and NFC

    The PN532 NFC controller on I2C: firmware version 1.6, a card’s UID through command frames, an NTAG213’s capability container E1 10 12 00, and a page of user memory written and read back with no key.

    0 of 6 steps

  2. Locked236 XP

    Access lists

    A door controller: an allow list of UIDs with names, a green lamp for Ana, a red lamp and a buzzer for a stranger, and a master card that enrolls the stranger as a guest, who then gets in.

    0 of 6 steps

  3. ProjectLocked338 XP

    Security limits

    A door that trusts the UID lets in a card that only copies it. A door that gives each card a secret in a keyed sector and checks it on every tap refuses the copy. And why even that is not enough: MIFARE Classic’s Crypto1 has been broken since 2008.

    0 of 5 steps

5 questions, graded as you go.
Chapter 3

Boss project

A crew airlock that knows who is aboard.

  1. Locked236 XP

    Boss: the crew airlock

    The airlock of a deep-space ship: crew cards board and leave for spacewalks, the LCD keeps the count aboard, the outer door lamp cycles on every crossing, and an unknown card sounds the intruder alarm.

    0 of 6 steps

3 questions, graded as you go.
Syllabus

Every lesson in the course

All 7 lessons, in order, each with what it covers. Any of them opens in the editor right away.

Chapter 1

Cards and readers

  1. How tags workA reader that powers the card it reads: the MFRC522’s 13.56 MHz field, a passive tag’s coil and chip, and the ATQA and SAK that tell a MIFARE Classic 1K from an NTAG213 before anything else is said.
  2. MFRC522 UIDsEvery card’s UID, four bytes or seven, sent in the clear before anything secret; PICC_HaltA() makes a card held on the reader count once per tap; and the property that decides which UIDs the cards on this bench carry.
  3. Sectors and blocksInside a MIFARE Classic 1K: 16 sectors of four 16-byte blocks, keys and access bits in every sector trailer, the wrong key timing out, the transport key FF FF FF FF FF FF working, and a name written to block 4 and read back.
Chapter 2

Building with tags

  1. PN532 and NFCThe PN532 NFC controller on I2C: firmware version 1.6, a card’s UID through command frames, an NTAG213’s capability container E1 10 12 00, and a page of user memory written and read back with no key.
  2. Access listsA door controller: an allow list of UIDs with names, a green lamp for Ana, a red lamp and a buzzer for a stranger, and a master card that enrolls the stranger as a guest, who then gets in.
  3. Security limitsA door that trusts the UID lets in a card that only copies it. A door that gives each card a secret in a keyed sector and checks it on every tap refuses the copy. And why even that is not enough: MIFARE Classic’s Crypto1 has been broken since 2008.
Chapter 3

Boss project

  1. Boss: the crew airlockThe airlock of a deep-space ship: crew cards board and leave for spacewalks, the LCD keeps the count aboard, the outer door lamp cycles on every crossing, and an unknown card sounds the intruder alarm.
Kits

Build it on your bench too

Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.

Have a kit already?

Find your kit

Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.

See every kit
Questions

About RFID and NFC

Is RFID and NFC free?

Yes. All 7 lessons of RFID and NFC are free and run in your browser, with nothing to install and no parts to buy before you start.

Do I need a real Arduino Uno R3?

No. Every lesson runs on a simulated Arduino Uno R3 with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.

How long does RFID and NFC take?

About 6 hours: 7 lessons in 3 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.

What will I build?

Each chapter ends in a project that puts it together: Sectors and blocks and Security limits.

Where do I start?

With "How tags work", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.