Proprietary RFID Systems - CanSecWest

29
Proprietary RFID Systems CanSecWest ‘08 Karsten Nohl, Starbug

Transcript of Proprietary RFID Systems - CanSecWest

Page 1: Proprietary RFID Systems - CanSecWest

ProprietaryRFID

Systems

CanSecWest ‘08

Karsten Nohl,

Starbug

Page 2: Proprietary RFID Systems - CanSecWest

RFID tags

• Radio Frequency IDentification

• Tiny computer chips

• Passively Powered

2Karsten Nohl & Starbug - Mifare

Page 3: Proprietary RFID Systems - CanSecWest

RFID Applications

• RFIDs become ubiquitous

• Integrated in many security applications

– Payment

– Access Control

– Car Ignition

3Karsten Nohl & Starbug - Mifare

Page 4: Proprietary RFID Systems - CanSecWest

RFID Trends• Passports

• Implants

• …

RFIDs become universal identifier. Might replace passwords, PINs, and fingerprints.

4Karsten Nohl & Starbug - Mifare

Page 5: Proprietary RFID Systems - CanSecWest

RFID Trends (II)

• Tagging of consumer goods

– Will replace bar-codes!

• Threat to Privacy

– Customer tracking

– Leaks internal business information!

5Karsten Nohl & Starbug - Mifare

Page 6: Proprietary RFID Systems - CanSecWest

RFID-Crypto Mismatch

Passports

RSA

TU Graz [‘05]

AESNo Crypto

Mifare

???6Karsten Nohl & Starbug - Mifare

Page 7: Proprietary RFID Systems - CanSecWest

Mifare Security

• NXP claimed:

– “approved authentication”

– “advanced security levels”

• 48 bit key

Car thefts(source: hldi.org)

7Karsten Nohl & Starbug - Mifare

Page 8: Proprietary RFID Systems - CanSecWest

Our Project

• Reconstruct circuit from photos of chip

• Sniff reader-tag communication

Reverse-engineering of the Mifare crypto and evaluating its security

verify

8Karsten Nohl & Starbug - Mifare

Page 9: Proprietary RFID Systems - CanSecWest

Hardware: OpenPCD (+PICC)

µ-ControllerNXP

Reader ICa) Sniffing datab) Full control over timing!

9Karsten Nohl & Starbug - Mifare

Page 10: Proprietary RFID Systems - CanSecWest

Obtaining Chips

• Extract chip from card or token using chemicals:

– acetone

– fuming nitric acid

• Shortcut: buy blank chips!

10Karsten Nohl & Starbug - Mifare

Page 11: Proprietary RFID Systems - CanSecWest

Mifare RFID tag

11Karsten Nohl & Starbug - Mifare

Page 12: Proprietary RFID Systems - CanSecWest

Getting Ready to Polish

• Embed chip in plastic

– Downside: tilt

Alternative:

• Glue back of chip to plastic plate

– Good results since backside is mostly plane

12Karsten Nohl & Starbug - Mifare

Page 13: Proprietary RFID Systems - CanSecWest

Polishing

• Manual or automatic

– Polishing paper (0.3μm)‏

– Polishing fluid (0.04μm)‏

13Karsten Nohl & Starbug - Mifare

Page 14: Proprietary RFID Systems - CanSecWest

Imaging Chip

• Optical microscope (Zeiss) – 500x magnification– Camera 1 Mpixel– Black and white

• Stitching 2 x 10 images– Panorama software (hugin)– Each image ~100x100 μm

• Align different layers

14Karsten Nohl & Starbug - Mifare

Page 15: Proprietary RFID Systems - CanSecWest

Chip Layer Cover layer

3 interconnection layer

Logic layer

Transistorlayer

Page 16: Proprietary RFID Systems - CanSecWest

Logic Gates

16Karsten Nohl & Starbug - Mifare

Page 17: Proprietary RFID Systems - CanSecWest

Logic Gates Library

select

detect

Chip has severalthousand gates

But only ~70 different types

Detection can be automated

17Karsten Nohl & Starbug - Mifare

Page 18: Proprietary RFID Systems - CanSecWest

Tracing Connections

18Karsten Nohl & Starbug - Mifare

Page 19: Proprietary RFID Systems - CanSecWest

Logic Gates Interconnect

• Connections across all layers

• Traced 1500 (!) connections manually– Tedious, time consuming

– Error-prone, (but errors easily spottable)

19Karsten Nohl & Starbug - Mifare

Page 20: Proprietary RFID Systems - CanSecWest

Automated Tracing

Metal wire

Intra-layer via

20Karsten Nohl & Starbug - Mifare

Page 21: Proprietary RFID Systems - CanSecWest

Encircle Crypto

• Even tiny RFID chip too large to analyze entirely– Crypto <10% of gates!

• Focus on interesting-looking parts:– Strings of flip-flops (registers)

– XOR

– Units around edges that sparsely connected to the rest of the chip

21Karsten Nohl & Starbug - Mifare

Page 22: Proprietary RFID Systems - CanSecWest

Mifare Crypto-1

48-bit LFSR

f(∙)

RNG

Challenge key stream

ID

+

Response

++

22Karsten Nohl & Starbug - Mifare

Page 23: Proprietary RFID Systems - CanSecWest

Random Number Generator

16(!!)-bit random numbers

LFSR –based

Value derived from time of read

Our Attack:

Control timing (OpenPCD)

= control random number (works for tag and reader!)

= break Mifare security :)

23Karsten Nohl & Starbug - Mifare

RNG

Page 24: Proprietary RFID Systems - CanSecWest

24Karsten Nohl & Starbug - Mifare

Page 25: Proprietary RFID Systems - CanSecWest

For Starters: Brute-Force

• Cipher complexity low

– Has probably been aprimary design goal

– Allows for very efficient FPGA implementation

$1000 key cracker finds keyin days! (much faster evenwhen trading space for time)

Source: Pico Comp.

25Karsten Nohl & Starbug - Mifare

Page 26: Proprietary RFID Systems - CanSecWest

Structural Weaknesses

1) Filter function is biased Output bits disclose cipher state

2) No non-linear component in feedback loop

Cipher state discloses key

+

Attack on key faster than brute-force (known-plaintext)

26Karsten Nohl & Starbug - Mifare

Page 27: Proprietary RFID Systems - CanSecWest

Mifare Security

No Crypto

Mifare

Security

Protection perhaps sufficient to protect transactions of very small value

E.g., Micro-payments, privacy

Security too weak for:

Access control, car theft protection, credit cards, …

27Karsten Nohl & Starbug - Mifare

Page 28: Proprietary RFID Systems - CanSecWest

Lessons Learned

• Obscurity and proprietary crypto add security only in the short-run

– (but lack of peer-review hurts later)

• Constraints of RFIDs make good crypto extremely hard

– Where are the best trade-offs?

– How much security is needed?

28Karsten Nohl & Starbug - Mifare

Page 29: Proprietary RFID Systems - CanSecWest

Questions?

Karsten Nohl

[email protected]

Starbug

[email protected]

+

++

29Karsten Nohl & Starbug - Mifare