Copyright Elektor

1y ago
23 Views
2 Downloads
6.17 MB
25 Pages
Last View : 30d ago
Last Download : 3m ago
Upload by : Kaydence Vann
Transcription

corypthigelErokt

ContentsPreface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .131 RFID Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.1 Introduction to RFID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.1.1 RF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.1.2 ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.1.3 RFID system classification . . . . . . . . . . . . . . . . . . . . . . . . . .1.1.3.1 Frequencies and transmission principles . . . . . . . . .1.1.3.2 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.2 RFID system components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.2.1 Card (PICC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.2.2 Reader (PCD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.3 ISO/IEC 14443 application example . . . . . . . . . . . . . . . . . . . . . . . .1.3.1 Public transport ticketing . . . . . . . . . . . . . . . . . . . . . . . . . . .1.3.2 Employee identification cards . . . . . . . . . . . . . . . . . . . . . . . .1.3.3 Electronic passports and identity cards . . . . . . . . . . . . . . . . .1.3.4 Other applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.4 Physical fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.4.1 Energy transmission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.4.2 Data transmission from PCD to PICC . . . . . . . . . . . . . . . . . . .1.4.2.1 Amplitude modulation . . . . . . . . . . . . . . . . . . . . . .1.4.2.2 Standard data rate (106 Kb/s) . . . . . . . . . . . . . . . . .1.4.2.3 Higher data rates (up to 848 Kb/s) . . . . . . . . . . . . .1.4.3 Data transmission from PICC to PCD . . . . . . . . . . . . . . . . . . .1.4.3.1 Load modulation . . . . . . . . . . . . . . . . . . . . . . . . . .1.4.3.2 Subcarrier modulation:Manchester encoding using ASK . . . . . . . . . . . . . . .1.4.3.3 Subcarrier modulation:NRZ encoding with BPSK . . . . . . . . . . . . . . . . . . . .17171718191920222223242425262727272929293132332 Overview of the Relevant Standards . . . . . . . . . . . . . . . . . . . . . . . . .2.1 ISO/IEC 14443 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.1.1 Part 1: physical properties . . . . . . . . . . . . . . . . . . . . . . . . . .2.1.2 Part 2: RF properties and signals . . . . . . . . . . . . . . . . . . . . .2.1.3 Part 3: Card selection and activation . . . . . . . . . . . . . . . . . . . .2.1.3.1 Type A: UIDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.1.3.2 Type A: card activation . . . . . . . . . . . . . . . . . . . . . .2.1.3.3 Type A: SAK encoding . . . . . . . . . . . . . . . . . . . . . . .2.1.3.4 Type A: collision-detection andconflict resolution . . . . . . . . . . . . . . . . . . . . . . . . .2.1.3.5 Type B card activation . . . . . . . . . . . . . . . . . . . . . .2.1.3.6 Type B: Card activation parameters . . . . . . . . . . . . .3535363738384042poc089028-UK RFID-book 06.indd 3kleEthgiryrto333444464827.05.2013 12:15:04

Contents2.1.4Part 4: communication protocol . . . . . . . . . . . . . . . . . . . . . .2.1.4.1 Protocol activation . . . . . . . . . . . . . . . . . . . . . . . . .2.1.4.2 T CL protocol block structure . . . . . . . . . . . . . . . . .2.1.5 Information Block (I Block) . . . . . . . . . . . . . . . . . . . . . . . . .2.1.5.1 Receive-ready Blocks (R Blocks) . . . . . . . . . . . . . . .2.1.5.2 Supervisory Blocks (S Blocks) . . . . . . . . . . . . . . . . .2.1.6 Electromagnetic disturbance (EMD) . . . . . . . . . . . . . . . . . . . .2.1.6.1 Rest period . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.1.6.2 Rest level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.1.6.3 Distinction between invalid cardresponse and EMD . . . . . . . . . . . . . . . . . . . . . . . . .2.1.6.4 The MFRC522 reader IC and EMD . . . . . . . . . . . . . . . .2.2 ISO/IEC 10373-6 test methods . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.2.1 Test equipment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.2.1.1 Calibration coil . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.2.1.2 Test PCD assembly . . . . . . . . . . . . . . . . . . . . . . . . .2.2.1.3 ReferencePICC . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.2.2 Tuning and calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.2.2.1 Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.2.2.2 Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.2.3 Measurements at the reader . . . . . . . . . . . . . . . . . . . . . . . .2.2.3.1 Range measurement . . . . . . . . . . . . . . . . . . . . . . .2.2.3.2 Measurement effort . . . . . . . . . . . . . . . . . . . . . . . . .2.2.4 Tests for Layer 3 and 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.3 Near Field Communication (NFC) . . . . . . . . . . . . . . . . . . . . . . . . . . .2.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.3.2 NFC air interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.3.2.1 NFC device as card . . . . . . . . . . . . . . . . . . . . . . . . .2.3.2.2 NFC device as a reader . . . . . . . . . . . . . . . . . . . . . .2.3.2.3 NFC device in ‘active’ mode . . . . . . . . . . . . . . . . . . .pockleEthgiryrto3 RFID Antenna Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.1 Theoretical Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.1.1 Antenna as Resonant Circuit . . . . . . . . . . . . . . . . . . . . . . . . .3.1.2 Transformer Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.1.3 The Biot-Savart Law . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.1.4 Optimal Antenna Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.2 Reader Antennas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.2.1 Antenna Quality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.2.1.1 Data Transmission Bandwidth . . . . . . . . . . . . . . . . .3.2.1.2 Stability Against Detuning . . . . . . . . . . . . . . . . . . . .3.2.2 Electrically Conductive Surfaces in the Vicinityof the Antenna . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.2.2.1 Ferrites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.2.3 Balanced and Unbalanced Antennas . . . . . . . . . . . . . . . . . . .3.2.3.1 Balanced Antenna . . . . . . . . . . . . . . . . . . . . . . . . .3.2.3.2 Unbalanced Antenna . . . . . . . . . . . . . . . . . . . . . . . 0717171727373737779808383838689909293964089028-UK RFID-book 06.indd 427.05.2013 12:15:04

CONTENTS3.3Card Antennas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.3.1 Standard Cards (ID-1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.3.2 Tokens with Smaller Inlays (Smaller than ID-1) . . . . . . . . . . . .3.4 Impedance Measurements with the miniVNA . . . . . . . . . . . . . . . . . .3.4.1 miniVNA User Software . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.4.2 Disadvantages and Limitations of the miniVNA . . . . . . . . . . . .3.4.2.1 Lack of Sign for Imaginary Numbers . . . . . . . . . . . .3.4.2.2 Lack of Calibration and Compensation . . . . . . . . . . .3.4.3 How Do I Find the Correct Compensation? . . . . . . . . . . . . . . .3.4.4 Coil Inductance Measurement . . . . . . . . . . . . . . . . . . . . . . . .98981001011021021021021031054 Security and Cryptography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.1 Protection Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.1.1 Keeping Data Secure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.1.2 Data Integrity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.1.3 Privacy Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.2 Attacks on Smartcards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.2.1 Logical Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.2.1.1 Unauthorized Reading of Data . . . . . . . . . . . . . . . . .4.2.1.2 Unauthorized Manipulation of Data . . . . . . . . . . . . . .4.2.1.3 ‘Replay’ Attack . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.2.1.4 ‘Relay’ Attack . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.2.1.5 ‘Man-in-the-Middle’ Attack . . . . . . . . . . . . . . . . . . . .4.2.1.6 Denial-of-Service Attack . . . . . . . . . . . . . . . . . . . . .4.2.2 Physical Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.2.2.1 Side Channel Attacks and Power Analysis . . . . . . . . .4.2.2.2 Reverse Engineering . . . . . . . . . . . . . . . . . . . . . . . .4.2.2.3 Light and Laser Attacks . . . . . . . . . . . . . . . . . . . . .4.2.2.4 Temperature and Frequency . . . . . . . . . . . . . . . . . .4.2.3 Combined Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.3 Cryptography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.3.1 Asymmetric Cryptography . . . . . . . . . . . . . . . . . . . . . . . . . .4.3.2 Symmetric Cryptography . . . . . . . . . . . . . . . . . . . . . . . . . . .4.3.3 Block and Stream Cipher . . . . . . . . . . . . . . . . . . . . . . . . . . .4.3.4 Encryption Standards: DES and AES . . . . . . . . . . . . . . . . . . .4.3.5 DES Cascading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.3.6 Operation mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.3.6.1 Electronic Code Book (ECB) . . . . . . . . . . . . . . . . . . .4.3.6.2 Cipher Block Chaining (CBC) . . . . . . . . . . . . . . . . . .4.4 Application of Cryptography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.4.1 Mutual Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.4.2 Data Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.4.3 Message Authentication Code (MAC) . . . . . . . . . . . . . . . . . . .4.4.4 Key Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.4.4.1 Dynamic Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.4.4.2 Key Diversification . . . . . . . . . . . . . . . . . . . . . . . . .4.4.5 Secure Application Module (SAM) . . . . . . . . . . . . . . . . . . . . . .4.4.6 Security Assessment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132132135135giryEthpocklerto5089028-UK RFID-book 06.indd 527.05.2013 12:15:04

Contents5 Introduction to Cards and Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.1.1 Memory Cards and Microcontroller Cards . . . . . . . . . . . . . . . .5.1.2 Advantages and Disadvantages of Contactless Cards . . . . . . .5.1.2.1 Robustness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.1.2.2 Longevity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.1.2.3 Usability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.1.2.4 Infrastructure . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.1.2.5 Contact Between Card and Reader . . . . . . . . . . . . . .5.1.3 Dual-Interface Cards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2 MIFARE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2.1 MIFARE Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2.1.1 Success Story . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2.1.2 MIFARE Clone . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2.1.3 MIFARE Hack . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2.1.4 MIFARE Product Overview . . . . . . . . . . . . . . . . . . . .5.2.2 MIFARE Ultralight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2.2.1 Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2.2.2 Memory Organization . . . . . . . . . . . . . . . . . . . . . . .5.2.2.3 Security Functions . . . . . . . . . . . . . . . . . . . . . . . . .5.2.3 MIFARE Ultralight C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2.3.1 Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2.3.2 Memory Organization . . . . . . . . . . . . . . . . . . . . . . .5.2.3.3 Security Functions . . . . . . . . . . . . . . . . . . . . . . . . .5.2.4 MIFARE Classic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2.4.1 Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2.4.2 Memory Organization . . . . . . . . . . . . . . . . . . . . . . .5.2.4.3 Security Functions . . . . . . . . . . . . . . . . . . . . . . . . .5.2.5 MIFARE Plus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2.5.1 Memory Organization . . . . . . . . . . . . . . . . . . . . . . .5.2.5.2 MIFARE Plus S and MIFARE Plus X . . . . . . . . . . . . . .5.2.5.3 Security Levels . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2.6 MIFARE DESFire (EV1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2.6.1 Memory Organization . . . . . . . . . . . . . . . . . . . . . . .5.2.6.2 File Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2.6.3 Data File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1561571576 Reader Antenna Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1 MF RC522 Reader Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1.1 Digital Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1.1.1 UART . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1.1.2 SPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1.1.3 I2C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1.2 Oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1.3 Analog Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1.3.1 Transmitter Outputs . . . . . . . . . . . . . . . . . . . . . . . .6.1.3.2 Receive Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9028-UK RFID-book 06.indd 627.05.2013 12:15:05

CONTENTS6.1.4Test Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1.4.1 MFOUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1.4.2 AUX1 and AUX2 . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1.5 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1.5.1 Power Supply and GND . . . . . . . . . . . . . . . . . . . . . .6.1.5.2 Tolerances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Antenna Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.1 Coil Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.1.1 Measuring the Coil Parameters . . . . . . . . . . . . . . . .6.2.1.2 Determine the Q Factor and the Series Resistance . . . .6.2.2 Matching: Calculating the Initial Values . . . . . . . . . . . . . . . . .6.2.2.1 Parallel Equivalent Circuit . . . . . . . . . . . . . . . . . . . .6.2.2.2 Partitioning and Simplifying the Circuit Diagram . . . .6.2.2.3 Low-Pass Filter . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.2.4 Matching Network . . . . . . . . . . . . . . . . . . . . . . . . .6.2.3 Matching: Simulation and Measurement . . . . . . . . . . . . . . . .6.2.4 Measurements on the Transmitted Pulse . . . . . . . . . . . . . . . .6.2.5 Measurement and Adjustment of the Receive Path . . . . . . . . .6.2.6 Eliminating Interference . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.7 Range Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811831831857 The Elektor RFID Reader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.2 Reader Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.2.1 Power Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.2.2 The P89LPC936 Microcontroller . . . . . . . . . . . . . . . . . . . . . .7.2.3 The MF RC522 Reader IC . . . . . . . . . . . . . . . . . . . . . . . . . . .7.2.4 The FT232R USB/RS-232 Converter . . . . . . . . . . . . . . . . . . . .7.2.4.1 Configuring the FT232R . . . . . . . . . . . . . . . . . . . . .7.2.4.2 USB Driver Modification . . . . . . . . . . . . . . . . . . . . . .7.3 Construction and Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.3.1 Installing the USB Driver . . . . . . . . . . . . . . . . . . . . . . . . . . .7.3.2 Reader Firmware Update . . . . . . . . . . . . . . . . . . . . . . . . . . .7.3.3 Firmware Version Control . . . . . . . . . . . . . . . . . . . . . . . . . . .7.4 Reader Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.4.1 Terminal Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.4.2 PC Reader Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.4.2.1 Activating the PC Reader Mode . . . . . . . . . . . . . . . .7.5 The Firmware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.5.1 The Software Architecture . . . . . . . . . . . . . . . . . . . . . . . . . .7.5.2 The Main Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.5.3 The PC ReaderMode() Function . . . . . . . . . . . . . . . . . . . . . .7.5.3.1 The RS-232 Communication Protocol . . . . . . . . . . . .7.6 The PC Development Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.6.1 Elektor RFID Reader Programming in .NET . . . . . . . . . . . . . . .7.6.2 Smart Card Magic.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.6.2.1 It’s Usable without Programming . . . . . . . . . . . . . . 89028-UK RFID-book 06.indd 727.05.2013 12:15:05

Contents7.6.2.2 A Scripting Tool or a C# Compiler? . . . . . . . . . . . . . .7.6.2.3 Our First Program: “Hello World” . . . . . . . . . . . . . . .7.6.2.4 Compiling and Running . . . . . . . . . . . . . . . . . . . . . .7.6.2.5 User Input from the Console Window . . . . . . . . . . . .7.6.2.6 Are There Really No Breakpoints? . . . . . . . . . . . . . . .7.6.3 Visual C# 2012 Express Edition . . . . . . . . . . . . . . . . . . . . . . .7.6.3.1 Creating a Simple Console Application . . . . . . . . . . .7.6.3.2 Integrating the Elektor RFID Reader Library . . . . . . .2152162192202222232232258 Cards and Tags in Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.1 ISO/IEC 14443 Type A Card Activation . . . . . . . . . . . . . . . . . . . . . .8.1.1 Card Types from the Perspective of Card Activation . . . . . . . .8.1.2 The Activation Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . .8.1.2.1 The Request and Wake-Up Commands . . . . . . . . . . .8.1.2.2 The Anti-collision and Select Commands . . . . . . . . .8.1.2.3 The HALT Command . . . . . . . . . . . . . . . . . . . . . . . .8.1.3 Elektor RFID Reader Library: Card Activation . . . . . . . . . . . .8.1.4 Program Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.1.4.1 Card Activation . . . . . . . . . . . . . . . . . . . . . . . . . . .8.1.4.2 Reader Selection . . . . . . . . . . . . . . . . . . . . . . . . . .8.1.4.3 Polling for Cards . . . . . . . . . . . . . . . . . . . . . . . . . .8.1.4.4 Simplified Card Activation . . . . . . . . . . . . . . . . . . . .8.1.4.5 Testing the Reading Range . . . . . . . . . . . . . . . . . . .8.1.4.6 Listing All Cards in the Reader’s Field . . . . . . . . . . .8.2 MIFARE Card-Type Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.2.1 Program Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.3 The MIFARE Ultralight Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.3.1 Memory Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.3.3 Function of the One-Time-Programmable (OTP) Bytes . . . . . . .8.3.3.1 Lock Bits Functionality . . . . . . . . . . . . . . . . . . . . . .8.3.4 Elektor RFID Reader Library: MIFARE Ultralight . . . . . . . . . . .8.3.5 Program Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.3.5.1 Writing and Erasing Data . . . . . . . . . . . . . . . . . . . . .8.3.5.2 Reading the Entire Memory Contents . . . . . . . . . . .8.3.5.3 Reading and Writing Strings . . . . . . . . . . . . . . . . . .8.3.5.4 A Simple Ticket Application . . . . . . . . . . . . . . . . . . .8.3.5.5 Cloning the Memory Content . . . . . . . . . . . . . . . . . .8.3.5.6 Secure Data Storage . . . . . . . . . . . . . . . . . . . . . . .8.4 The MIFARE Classic Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.4.1 MIFARE Classic 1K Card Memory Organization . . . . . . . . . . . .8.4.2 MIFARE Classic 4K Card Memory Organization . . . . . . . . . . . .8.4.3 MIFARE Mini Card Memory Organization. . . . . . . . . . . . . . . . .8.4.4 Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.4.5 The MIFARE Value Format . . . . . . . . . . . . . . . . . . . . . . . . . .8.4.6 Decrement, Increment, Restore and Transfer . . . . . . . . . . . . .8.4.7 Changing the Keys and Access Condition . . . . . . . . . . . . . . . .8.4.8 Elektor RFID Reader Library: MIFARE Classic . . . . . . . . . . . . 282286289290294giryEthpocklerto8089028-UK RFID-book 06.indd 827.05.2013 12:15:05

CONTENTS8.4.8.1 The MifareClassicUtil Class . . . . . . . . . . . . . . . . . . .8.4.8.2 The IMifareClassic Interface . . . . . . . . . . . . . . . . . .8.4.9 Program and Case Studies . . . . . . . . . . . . . . . . . . . . . . . . . .8.4.9.1 Writing and Erasing Data . . . . . . . . . . . . . . . . . . . . .8.4.9.2 Reading the Entire Memory Contents . . . . . . . . . . . .8.4.9.3 Optimizing the Read and Write Speeds . . . . . . . . . . .8.4.9.4 Optimized Reading of the Entire Memory Contents . . .8.4.9.5 The Problem of Data Corruption . . . . . . . . . . . . . . . .8.4.9.6 The MIFARE Value Format Methods . . . . . . . . . . . . .8.4.9.7 Electronic Purse with Backup Management . . . . . . . .8.5 The MIFARE Ultralight C Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.5.1 Memory Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.5.2 Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.5.3 Triple-DES Authentication . . . . . . . . . . . . . . . . . . . . . . . . . .8.5.4 Elektor RFID Reader Library: MIFARE Ultralight C . . . . . . . . . .8.5.5 Programming Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.5.5.1 The MIFARE Ultralight C Authentication Sequence . . . .8.5.5.2 MIFARE Ultralight C Card Personalization . . . . . . . . .8.6 The T CL Transmission Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . .8.6.1 T CL Protocol Activation and Deactivation . . . . . . . . . . . . . . .8.6.1.1 Multi-Card Activation . . . . . . . . . . . . . . . . . . . . . . .8.6.2 Data Exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.6.2.1 Smart Card Magic.NET – Exchange Mode . . . . . . . . .8.6.2.2 Block Chaining . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.6.2.3 Waiting Time Extension . . . . . . . . . . . . . . . . . . . . .8.6.2.4 Error Detection and Correction . . . . . . . . . . . . . . . .8.6.3 Elektor RFID Reader Library: T CL . . . . . . . . . . . . . . . . . . . .8.6.4 Example Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.6.4.1 T CL Protocol Activation and Deactivation . . . . . . . .8.6.4.2 Multi-Card Activation . . . . . . . . . . . . . . . . . . . . . . .8.7 The MIFARE DESFire EV1 Card . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.7.1 MIFARE DESFire EV1 Commands . . . . . . . . . . . . . . . . . . . . . .8.7.2 DESFire Native Command Structure . . . . . . . . . . . . . . . . . . .8.7.2.1 Card Command Structure . . . . . . . . . . . . . . . . . . . .8.7.2.2 Card Response Structure . . . . . . . . . . . . . . . . . . . . .8.7.2.3 DESFire Block Chaining . . . . . . . . . . . . . . . . . . . . . .8.7.3 The DESFire File System . . . . . . . . . . . . . . . . . . . . . . . . . . .8.7.3.1 File Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.7.3.2 Data File Structure . . . . . . . . . . . . . . . . . . . . . . . . .8.7.3.3 Directory Names . . . . . . . . . . . . . . . . . . . . . . . . . .8.7.3.4 File Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.7.4 Data Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.7.5 Elektor RFID Reader Library: MIFARE DESFire EV1 . . . . . . . . .8.7.6 Example Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.7.6.1 Creating a DESFire Application . . . . . . . . . . . . . . . . .8.7.6.2 Standard Data File: Reading and Writing Data . . . . . .8.8 Application Protocol Data Units (APDUs) . . . . . . . . . . . . . . . . . . . . . .8.8.1 Command APDU Data Structure . . . . . . . . . . . . . . . . . . . . . 633663683689089028-UK RFID-book 06.indd 927.05.2013 12:15:05

Contents8.8.1.1 Class Byte (CLA) . . . . . . . . . . . . . . . . . . . . . . . . . .8.8.1.2 Instruction Byte (INS) . . . . . . . . . . . . . . . . . . . . . .8.8.1.3 Parameter Bytes P1 and P2 . . . . . . . . . . . . . . . . . . .8.8.1.4 Coding of Length Fields Lc and Le . . . . . . . . . . . . . .8.8.2 Response APDU Data Structure . . . . . . . . . . . . . . . . . . . . . .8.8.3 Examples of ISO/IEC 7816-Compatible APDUs . . . . . . . . . . . .8.8.3.1 The SELECT Command . . . . . . . . . . . . . . . . . . . . .8.8.3.2 The READ BINARY Command . . . . . . . . . . . . . . . . .8.8.3.3 The Update Binary Command . . . . . . . . . . . . . . . . .8.8.4 Elektor RFID Reader Library: APDU . . . . . . . . . . . . . . . . . . . .8.8.5 Accessing an ISO/IEC 7816 File System . . . . . . . . . . . . . . . . .8.8.5.1 Example Program . . . . . . . . . . . . . . . . . . . . . . . . . .rto3693693693693713723723733753763783809 Elektor RFID Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.1 Programming the MF RC522 Reader IC . . . . . . . . . . . . . . . . . . . . . .9.1.1 Elektor RFID Reader Library: MF RC522 . . . . . . . . . . . . . . . .9.1.2 Program Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.1.2.1 Changing the RF Parameter Configuration . . . . . . . . .9.1.2.2 MF RC522 SFR Programming — Card Activation . . . .9.2 RFID Access Control Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.2.1 Online Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.2.2 Offline Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.2.3 Elektor RFID Reader as Access Control System . . . . . . . . . . .9.2.3.1 Functional Description . . . . . . . . . . . . . . . . . . . . . .9.2.3.2 Access Control Manager . . . . . . . . . . . . . . . . . . . . .9.2.3.3 Microcontroller Firmware . . . . . . . . . . . . . . . . . . . . .9.2.3.4 Reading and Deleting from theP89LPC936 EEPROM . . . . . . . . . . . . . . . . . . . . . . .9.3 An Electronic ID Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.3.1 Personalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.3.2 Reading the ID Card Data . . . . . . . . . . . . . . . . . . . . . . . . . .9.4 Launching a Windows Application . . . . . . . . . . . . . . . . . . . . . . . . . .38538538638638638739639639639639739839910 Smart Card Reader API Standards . . . . . . . . . . . . . . . . . . . . . . . . . . .10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.2 Card Terminal API (CT-API) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.3 Open Card Framework (OCF) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.4 Personal Computer/Smartcard (PC/SC) . . . . . . . . . . . . . . . . . . . . .10.4.1 The PC/SC Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . .10.4.1.1 Integrate

8.3.4 Elektor RFID Reader Library: MIFARE Ultralight. 263 8. copyright Elektor. copyright Elektor. 2 2 2 .

Related Documents:

ATM18 ist ein gemeinsames Projekt von Elektor und dem Computer:club2 (www.cczwei.de) in Zusammenarbeit mit Udo Jürß, dem Chefentwickler von www.microdrones.de. Elektor un-terstützt dieses Projekt durch Artikel in der Zeitschrift, bestückte Platinen im Elektor-Shop und Zusatzinformationen, Software-Downloads und das Forum auf www.elektor.de.

Elektor is published 11 times a year with a double issue for July & August. Elektor is also published in French, Spanish, American English, German and Dutch. Together with franchised editions the magazine is on circulation in more than 50 countries. International Editor: Wisse Hettinga (w.hettinga@elektor.nl)

RFID reader on the Elektor Electronics website. Get started The double-sided printed circuit board for the Elektor Electronics RFID reader is shown in Figure 5. It is only possi-ble to reflow solder the reader IC, and so we are making the board available 28 elektor electronics - 9/2006 HANDS-

Elektor Magazine: our monthly haymaker – in print and online Elektor Magazine is published both in print and online in English, Dutch, German and French, with a jumbo issue in the winter and summer. Spanish and Portuguese only digital. Elektor Magazine is

r elektor eletrónica . A IMW dMf* Guia de Compras Santa Itinenia . Montagem cio vocoder Elektor Termômetro eletrônico linear Medida de tensão e corrente em de processamento paralelo alimentaçao . A grande novidade desta e das próximas edições é o Guia de Compras Sta. Ifigênia. Ele veio atender uma velha reivindicação

4/2008 - elektor 17 Elektor Internet Radio (EIR) Listening to radio programmes with the latest ICs 16 bits and a sampling rate of 44.1 kHz, using a data transmission rate as low as 192 kbit/s (or even less) instead of the normal rate of around 1.4 Mbit/s. This means that a buffer with a capa-city of approximately 10 seconds can

Detector de metales Universal Elektor Julio/A ugusto 1986 (7/86) PLL P e 07/01/09 Detector de metales Elektor 10 1982 as in other Elektors S e 06/11/02 Bierestowski Rafał Inteligentny wykrywacz metali Praktyczny Elektronik 11/98 p.7-9 one-generator PIC 12C508 based, no code (comm

Dosen Jurusan Pendidikan Akuntansi Fakultas Ekonomi Universitas Negeri Yogyakarta CP: 08 222 180 1695 Email : adengpustikaningsih@uny.ac.id. 23-2. 23-3 PREVIEW OF CHAPTER Intermediate Accounting IFRS 2nd Edition Kieso, Weygandt, and Warfield 23. 23-4 6. Identify sources of information for a statement of cash flows. 7. Contrast the direct and indirect methods of calculating net cash flow from .