Secure recharge of disposable RFID tickets



Similar documents
Gemalto Mifare 1K Datasheet

NFCulT. An easy a nice tool that will make you have fun, or... make profit!

Secure Automatic Ticketing System

Contactless Smart Cards vs. EPC Gen 2 RFID Tags: Frequently Asked Questions. July, Developed by: Smart Card Alliance Identity Council

RF-Enabled Applications and Technology: Comparing and Contrasting RFID and RF-Enabled Smart Cards

Security Evaluation of the disposable OV-chipkaart v1.6

50 ways to break RFID privacy

MF1 IC S General description. Functional specification. 1.1 Contactless Energy and Data Transfer. 1.2 Anticollision. Energy

Exercise 1: Set up the Environment

RFID Security: Threats, solutions and open challenges

Security & Chip Card ICs SLE 44R35S / Mifare

AN mifare Ultralight Features and Hints. Document information. Multiple ticketing, secured data storage, implementation hints

RFID Penetration Tests when the truth is stranger than fiction

Using RFID Techniques for a Universal Identification Device


Chip Card & Security ICs Mifare NRG SLE 66R35

MIFARE CONTACTLESS CARD TECHNOLOLGY AN HID WHITE PAPER

NACCU Migrating to Contactless:

Strengthen RFID Tags Security Using New Data Structure

Secure My-d TM and Mifare TM RFID reader system by using a security access module Erich Englbrecht (info@eonline.de) V0.1draft

Secure upgrade of hardware security modules in bank networks

OBID RFID by FEIG ELECTRONIC. OBID classic / OBID classic-pro. RFID Reader Technology for Security Applications

Electronic Access Control Security. Matteo Beccaro HackInTheBox Amsterdam, May 27 th, 2016

Smart Card- An Alternative to Password Authentication By Ahmad Ismadi Yazid B. Sukaimi

Mobile and Contactless Payment Security

Counter Expertise Review on the TNO Security Analysis of the Dutch OV-Chipkaart. OV-Chipkaart Security Issues Tutorial for Non-Expert Readers

MIFARE ISO/IEC PICC

Karsten Nohl University of Virginia. Henryk Plötz HU Berlin

MF0ICU2. 1. General description. MIFARE Ultralight C. 1.1 Contactless energy and data transfer. 1.2 Anticollision. Rev May

AN1305. MIFARE Classic as NFC Type MIFARE Classic Tag. Application note COMPANY PUBLIC. Rev October Document information

Guard All Security Symposium. Identity and Access Management

RFID Security. April 10, Martin Dam Pedersen Department of Mathematics and Computer Science University Of Southern Denmark

Analysis of the MIFARE Classic used in the OV-Chipkaart project

How Does It Work? Internet of Things

mcard CPK Supported Solutions

RESEARCH SURVEY ON MIFARE WITH RFID TECHNOLOGY

International Journal of Engineering Research & Management Technology

Microtronics technologies Mobile:

SL2 ICS53/SL2 ICS General description I CODE SLI-S/I CODE SLI-S HC. 1.1 Anticollision. 1.2 Contactless energy and data transfer

SALTO Systems I SALTO Carriers. innovation in ID technology. MIFARE DESFire

How To Protect A Smart Card From Being Hacked

ACR880 GPRS Portable Smart Card Terminal

3M Cogent, Inc. White Paper. Beyond. Wiegand: Access Control. in the 21st Century. a 3M Company

Overview of Contactless Payment Cards. Peter Fillmore. July 20, 2015

Relay Attacks on Passive Keyless Entry and Start Systems in Modern Cars

Privacy and Security in library RFID Issues, Practices and Architecture

Contactless Technology for Secure Physical Access: Technology and Standards Choices

Technical Article. NFiC: a new, economical way to make a device NFC-compliant. Prashant Dekate

PUF Physical Unclonable Functions

Getting to know your card: Reverse-Engineering the Smart-Card Application Protocol Data Unit for PKCS#11 Functions

NTAG213/215/216. The mechanical and electrical specifications of NTAG21x are tailored to meet the requirements of inlay and tag manufacturers.

1. Product Overview 2. Product Features 3. Comparison Chart 4. Product Applications 5. Order Information 6. Q & A

Training MIFARE SDK. Public. MobileKnowledge June 2015

Radio Frequency Identification (RFID)

RFID Security and Privacy: A Research Survey. Vincent Naessens Studiedag Rabbit project

OTP circumventing in MIFARE ULTRALIGHT: Who says free rides?

Time & Access System An RFID based technology

INTEGRATED CIRCUITS I CODE SLI. Smart Label IC SL2 ICS20. Functional Specification. Product Specification Revision 3.1 Public. Philips Semiconductors

Ex15x //DATASHEET. Xs4 Mini. Cutting-edge design + Amazing technology:

Introducing etoken. What is etoken?

VASCO Data Security International, Inc. DIGIPASS GO-7. FIPS Non-Proprietary Cryptographic Module Security Policy

THE APPEAL FOR CONTACTLESS PAYMENT 3 AVAILABLE CONTACTLESS TECHNOLOGIES 3 USING ISO BASED TECHNOLOGY FOR PAYMENT 4

USING MIFARE CLASSIC TAGS VERSION

Security by Politics - Why it will never work. Lukas Grunwald DN-Systems GmbH Germany DefCon 15 Las Vegas USA

All You Can Eat. Breaking a Real-World Contactless Payment System

To effectively manage and control a factory, we need information. How do we collect it?

Attacking and Fixing PKCS#11 Security Tokens

AN1304. NFC Type MIFARE Classic Tag Operation. Application note PUBLIC. Rev October Document information

Hacking Mifare Classic Cards. Márcio Almeida

RFID READER 13.56MHz Reader / Writer SL500 User Manual Version 2.6 Nov 2011 StrongLink

Keep Out of My Passport: Access Control Mechanisms in E-passports

Beveiliging van de OV-Chipkaart

How To Secure A Paypass Card From Being Hacked By A Hacker

Secure Remote Photo Identification With ID card

Mobile data carrier TW-L86-54-C-B128

Smartcards and RFID. IPA Security Course Lejla Batina & Erik Poll. Digital Security University of Nijmegen

Computer Architecture

Security Issues in RFID systems. By Nikhil Nemade Krishna C Konda

Enhancing the Contactless Cards UAT. Enabling faster and efficient transactions.

LibRFID: Automation Software for Library Management System Using RFID Technology

E-Blocks Easy RFID Bundle

Complete Technology and RFID

Ensto Chago Master EVM300 and EVM500 Operational description

For Auto Locksmit Association only!!! Key Programmer User s Manual

ACR120 Technical Specifications version 2.9 November 2005

On the Security of RFID

Internet Banking Two-Factor Authentication using Smartphones

Security in Near Field Communication (NFC)

How To Hack An Rdi Credit Card

Smart Card Application Standard Draft

NFC Test Challenges for Mobile Device Developers Presented by: Miguel Angel Guijarro

Training. MIFARE4Mobile. Public. MobileKnowledge April 2015

RFID Hacking. Live Free or RFID Hard. 01 Aug 2013 Black Hat USA 2013 Las Vegas, NV. Presented by: Francis Brown Bishop Fox

Using Contactless Smart Cards for Secure Applications

NEAR FIELD COMMUNICATION

Achieving Universal Secure Identity Verification with Convenience and Personal Privacy A PRIVARIS BUSINESS WHITE PAPER

Bypassing Local Windows Authentication to Defeat Full Disk Encryption. Ian Haken

AN Software Design Guide for POS Development Kit OM5597/RD2663. Rev August Application note COMPANY PUBLIC

Business through Mobile Phone initiated Near Field Communication

Transcription:

Secure recharge of disposable RFID tickets Riccardo Focardi Flaminia Luccio Università Ca Foscari, Venezia {focardi,luccio}@unive.it FAST 2011 15-16 September 2011, Leuven FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 1 / 17

Outline 1 Introduction RFID Tickets 2 Mifare Ultralight Security mechanisms 3 Attacks Cloning/restoring a card Lesson learned 4 A new API Type-based analysis 5 Conclusion and related work FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 2 / 17

RFID technology Introduction Radio Frequency IDentification (RFID) is more an more used 1 transportation and logistics 2 hospitals 3 inventory 4 passports 5 ski resorts 6 race timing 7 animal identification 8 human implant (!?) 9... FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 3 / 17

RFID technology Introduction Radio Frequency IDentification (RFID) is more an more used 1 transportation and logistics 2 hospitals 3 inventory 4 passports 5 ski resorts 6 race timing 7 animal identification 8 human implant (!?) 9... FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 3 / 17

Introduction RFID Tickets RFID tickets RFID cards for public transportation disposable cards 1 chip-on-paper, very cheap 2 one or more tickets of the same kind 3 non-rechargeable 4 minimal security mechanisms personal cards 1 plastic, credit-card like cards 2 tickets or different contracts on the same card 3 rechargeable 4 strong authentication mechanisms FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 4 / 17

Introduction RFID Tickets How do they work? ISO/IEC 14443: very popular HF (13.56 MHz) standard for proximity cards used for identification proximity cards and proximity coupling device, i.e., the reader initialization and anticollision: the reader talks with exactly one card if more are in the field card API: the card implements a set of functions that can be invoked by the reader secure module: the reader may have a Security Access Module (SAM) to perform cryptographic operations and authentication security mechanisms: are specific for a certain card (and its API) FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 5 / 17

Mifare Ultralight cards Mifare Ultralight (a) Memory organization Byte number 0 1 2 3 Page ID ID0 ID1 ID2 Check1 0 ID ID3 ID4 ID5 ID6 1 Check/Lock Check2 Internal Lock0 Lock1 2 OTP OTP OTP OTP OTP 3 Data R/W R/W R/W R/W 4 Data R/W R/W R/W R/W 5 Data R/W R/W R/W R/W... Data R/W R/W R/W R/W 15 (b) Lock bytes Lock0 and Lock1 Lock0 L 7 L 6 L 5 L 4 L 3 BL 1 BL 2 BL OTP Lock1 L 15 L 14 L 13 L 12 L 11 L 10 L 9 L 8 FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 6 / 17

Mifare Ultralight Security mechanisms Security mechanisms very simple API: read/write of pages with some limitations: 1 unique ID: read-only, included in encryptions or MACs to avoid card cloning 2 OTP: One Time Programmable, monotone, prevents ticket reuse 3 lock bytes: for read-only time-based contracts, e.g. skipass 4 block locking bits: prevent locking of pages that need to be modified, e.g., the OTP no security API: security is built on top of the above mechanisms security flaws found in real application, e.g., the OV-chipkaart in Amsterdam and Rotterdam. FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 7 / 17

Attacks Cloning/restoring a card Example (Card cloning) Sample (flawed) code for consuming n tickets from a card read(4 : 7); if (MAC K (p 4, p 6 ) = p 7 ) then p 4 := p 4 n; p 5 := BUS ID(); p 6 := TIMESTAMP(); p 7 := MAC K (p 4, p 6 ); write(4 : 7); 0, 1 Id 2 Lock 3 Otp 4 R 5 D 1 6 D 2 7 MAC K (R, D 2 ) FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 8 / 17

Attacks Cloning/restoring a card Example (Card cloning) Sample (flawed) code for consuming n tickets from a card read(4 : 7); if (MAC K (p 4, p 6 ) = p 7 ) then p 4 := p 4 n; p 5 := BUS ID(); p 6 := TIMESTAMP(); p 7 := MAC K (p 4, p 6 ); write(4 : 7); 0, 1 Id 2 Lock 3 Otp 4 R 5 D 1 6 D 2 7 MAC K (R, D 2 ) 0, 1 Id 2 3 4 5 6 7 FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 8 / 17

Attacks Cloning/restoring a card Example (Card cloning) Sample (flawed) code for consuming n tickets from a card read(4 : 7); if (MAC K (p 4, p 6 ) = p 7 ) then p 4 := p 4 n; p 5 := BUS ID(); p 6 := TIMESTAMP(); p 7 := MAC K (p 4, p 6 ); write(4 : 7); 0, 1 Id 2 Lock 3 Otp 4 R 5 D 1 6 D 2 7 MAC K (R, D 2 ) COPY = 0, 1 Id 2 3 4 R 5 6 D 2 7 MAC K (R, D 2 ) FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 8 / 17

Attacks Cloning/restoring a card Example (double-use) Including the Id in the MAC prevents cloning 0, 1 Id 2 Lock 3 Otp 4 R 5 D 1 6 D 2 7 MAC K (Id, R, D 2 ) read(0 : 7); if (MAC K (p 0, p 1, p 4, p 6 ) = p 7 ) then p 4 := p 4 n; p 5 := BUS ID(); p 6 := TIMESTAMP(); p 7 := MAC K (p 0, p 1, p 4, p 6 ); write(4 : 7) FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 9 / 17

Attacks Cloning/restoring a card Example (double-use) Including the Id in the MAC prevents cloning 0, 1 Id 2 Lock 3 Otp 4 R 5 D 1 6 D 2 7 MAC K (Id, R, D 2 ) read(0 : 7); if (MAC K (p 0, p 1, p 4, p 6 ) = p 7 ) then p 4 := p 4 n; p 5 := BUS ID(); p 6 := TIMESTAMP(); p 7 := MAC K (p 0, p 1, p 4, p 6 ); write(4 : 7) COPY = R, D 2, MAC K (Id, R, D 2 ) FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 9 / 17

Attacks Cloning/restoring a card Example (double-use) Including the Id in the MAC prevents cloning 0, 1 Id 2 Lock 3 Otp 4 R n 5 D 1 6 D 2 7 MAC K (Id, R n, D 2 ) read(0 : 7); if (MAC K (p 0, p 1, p 4, p 6 ) = p 7 ) then p 4 := p 4 n; p 5 := BUS ID(); p 6 := TIMESTAMP(); p 7 := MAC K (p 0, p 1, p 4, p 6 ); write(4 : 7) COPY = use tickets R, D 2, MAC K (Id, R, D 2 ) FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 9 / 17

Attacks Cloning/restoring a card Example (double-use) Including the Id in the MAC prevents cloning 0, 1 Id 2 Lock 3 Otp 4 R 5 D 1 6 D 2 7 MAC K (Id, R, D 2 ) read(0 : 7); if (MAC K (p 0, p 1, p 4, p 6 ) = p 7 ) then p 4 := p 4 n; p 5 := BUS ID(); p 6 := TIMESTAMP(); p 7 := MAC K (p 0, p 1, p 4, p 6 ); write(4 : 7) COPY = use tickets R, D 2, MAC K (Id, R, D 2 ) RESTORE = reuse the card arbitrarily FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 9 / 17

Attacks Cloning/restoring a card Example (the OTP) Use the OTP to count resources on the card (initialized as 32 R) 0, 1 Id 2 Lock 3 Otp 4 5 D 1 6 D 2 7 MAC K (Id, Otp, D 2 ) read(0 : 7); if (MAC K (p 0, p 1, p 3, p 6 ) = p 7 ) then p 3 := incotp n (p 3 ); p 5 := BUS ID(); p 6 := TIMESTAMP(); p 7 := MAC K (p 0, p 1, p 3, p 6 ); write(3 : 7) FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 10 / 17

Attacks Cloning/restoring a card Example (the OTP) Use the OTP to count resources on the card (initialized as 32 R) 0, 1 Id 2 Lock 3 Otp 4 5 D 1 6 D 2 7 MAC K (Id, Otp, D 2 ) read(0 : 7); if (MAC K (p 0, p 1, p 3, p 6 ) = p 7 ) then p 3 := incotp n (p 3 ); p 5 := BUS ID(); p 6 := TIMESTAMP(); p 7 := MAC K (p 0, p 1, p 3, p 6 ); write(3 : 7) COPY = Otp, D 2, MAC K (Id, Otp, D 2 ) FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 10 / 17

Attacks Cloning/restoring a card Example (the OTP) Use the OTP to count resources on the card (initialized as 32 R) read(0 : 7); if (MAC K (p 0, p 1, p 3, p 6 ) = p 7 ) then p 3 := incotp n (p 3 ); p 5 := BUS ID(); p 6 := TIMESTAMP(); p 7 := MAC K (p 0, p 1, p 3, p 6 ); write(3 : 7) 0, 1 Id 2 Lock 3 Otp + n 4 5 D 1 6 D 2 7 MAC K (Id, Otp + n, D 2 ) COPY = use Otp, D 2, MAC K (Id, Otp, D 2 ) FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 10 / 17

Attacks Cloning/restoring a card Example (the OTP) Use the OTP to count resources on the card (initialized as 32 R) 0, 1 Id 2 Lock 3 Otp + n 4 5 D 1 6 D 2 7 MAC K (Id, Otp, D 2 ) read(0 : 7); if (MAC K (p 0, p 1, p 3, p 6 ) = p 7 ) then p 3 := incotp n (p 3 ); p 5 := BUS ID(); p 6 := TIMESTAMP(); p 7 := MAC K (p 0, p 1, p 3, p 6 ); write(3 : 7) COPY = use Otp, D 2, MAC K (Id, Otp, D 2 ) RESTORE = FAIL! FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 10 / 17

Attacks Lesson learned Summary the unique ID, if in the MAC, prevents cloning the OTP can be used to store the number of tickets on the card monotonicity of OTP ensures that tickets cannot be reused NOTE 1 cards cannot be recharged (the OTP is irreversible) NOTE 2 cards cannot store different kind of tickets (one OTP) NOTE 3 code can become complex leading to security flaws motivated by the above issues 1 we propose a new way of using the OTP which admits recharges and different kind of tickets on the same card 2 we develop a typing-discipline to develop secure APIs on top of the insecure card APIs FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 11 / 17

A new API Our proposal explicit resource counters, as in the first examples OTP incremented by 1 when (even n) resources are consumed the OTP does not represent the number of resources 1 it is initialized as 0 2 it is incremented at any irreversible event FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 12 / 17

A new API Our proposal explicit resource counters, as in the first examples OTP incremented by 1 when (even n) resources are consumed the OTP does not represent the number of resources 1 it is initialized as 0 2 it is incremented at any irreversible event read(0 : 7); if (MAC K (p 0, p 1, p 3, p 4, p 6 ) = p 7 ) then p 3 := incotp(p 3 ); p 4 := p 4 n; p 5 := BUS ID(); p 6 := TIMESTAMP(); p 7 := MAC K (p 0, p 1, p 3, p 4, p 6 ); write(3 : 7) 0,1 Id 2 Lock 3 Otp 4 R 5 D 1 6 D 2 7 MAC K (Id, Otp, R, D 2 ) FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 12 / 17

A new API Our proposal explicit resource counters, as in the first examples OTP incremented by 1 when (even n) resources are consumed the OTP does not represent the number of resources 1 it is initialized as 0 2 it is incremented at any irreversible event read(0 : 7); if (MAC K (p 0, p 1, p 3, p 4, p 6 ) = p 7 ) then p 3 := incotp(p 3 ); p 4 := p 4 n; p 5 := BUS ID(); p 6 := TIMESTAMP(); p 7 := MAC K (p 0, p 1, p 3, p 4, p 6 ); write(3 : 7) 0,1 Id 2 Lock 3 Otp + 1 4 R n 5 D 1 6 D 2 7 MAC K (Id, Otp + 1, R n, D 2 ) FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 12 / 17

Type-based analysis A new API Type-based analysis A linear type-and-effect system with judgement Γ c Γ FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 13 / 17

A new API Type-based analysis Type-based analysis A linear type-and-effect system with judgement Γ c Γ 1 we model production and consumption of resources via special annotations produce(r), consume(r) FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 13 / 17

A new API Type-based analysis Type-based analysis A linear type-and-effect system with judgement Γ c Γ 1 we model production and consumption of resources via special annotations produce(r), consume(r) 2 critical operations always performed after the MAC check FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 13 / 17

Type-based analysis A new API Type-based analysis A linear type-and-effect system with judgement Γ c Γ 1 we model production and consumption of resources via special annotations produce(r), consume(r) 2 critical operations always performed after the MAC check Γ(p i ) = Mac[i 0,..., i m ] Γ(p i0 ),..., Γ(p im ) = Γ{p i0 : Γ(i 0 ),..., p im : Γ(i m )} c 1 Γ Γ c 2 Γ Γ if MAC K (p i1,..., p im ) = p i then c 1 else c 2 Γ FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 13 / 17

Type-based analysis A new API Type-based analysis A linear type-and-effect system with judgement Γ c Γ 1 we model production and consumption of resources via special annotations produce(r), consume(r) 2 critical operations always performed after the MAC check Γ(p i ) = Mac[i 0,..., i m ] Γ(p i0 ),..., Γ(p im ) = Γ{p i0 : Γ(i 0 ),..., p im : Γ(i m )} c 1 Γ Γ c 2 Γ Γ if MAC K (p i1,..., p im ) = p i then c 1 else c 2 Γ 3 production and consumption controlled via linear effects; OTP incremented and written back to the card before consumption FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 13 / 17

Type-based analysis A new API Type-based analysis A linear type-and-effect system with judgement Γ c Γ 1 we model production and consumption of resources via special annotations produce(r), consume(r) 2 critical operations always performed after the MAC check Γ(p i ) = Mac[i 0,..., i m ] Γ(p i0 ),..., Γ(p im ) = Γ{p i0 : Γ(i 0 ),..., p im : Γ(i m )} c 1 Γ Γ c 2 Γ Γ if MAC K (p i1,..., p im ) = p i then c 1 else c 2 Γ 3 production and consumption controlled via linear effects; OTP incremented and written back to the card before consumption Γ(p i ) = R iotp Γ W 3 Γ Γ p i := p i n Γ, R n + W i Γ, R n consume(r) n Γ FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 13 / 17

Typing the example A new API Type-based analysis Γ read(0 : 7); Γ, Γ Γ, Γ if (MAC K (p 0, p 1, p 2, p 3, p 4, p 6) = p 7) Γ, Γ p 3 := incotp(p 3); Γ, Γ, iotp, W 3 Γ, Γ, iotp, W 3 write(3) Γ, Γ, iotp Γ, Γ, iotp p 4 := p 4 n; Γ, Γ, R n, W 4 Γ, Γ, R n, iotp, W 4 p 5 := BUS ID(); Γ, Γ, R n, iotp, W 4,5 Γ, Γ, R n, iotp, W 4,5 p 6 := TIMESTAMP(); Γ, Γ, R n, iotp, W 4,5,6 Γ, Γ, R n, iotp, W 4,5,6 p 7 := MAC K (p 0, p 1, p 2, p 3, p 4, p 6); Γ, Γ, R n, iotp, W 4,5,6,7 Γ, Γ, R n, iotp, W 4,5,6,7 write(4 : 7) Γ, Γ, R n, iotp Γ, Γ, R n, iotp consume(r) n ; Γ, Γ FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 14 / 17

Typing the example A new API Type-based analysis Γ read(0 : 7); Γ, Γ Γ, Γ if (MAC K (p 0, p 1, p 2, p 3, p 4, p 6) = p 7) Γ, Γ p 3 := incotp(p 3); Γ, Γ, iotp, W 3 Γ, Γ, iotp, W 3 write(3) Γ, Γ, iotp Γ, Γ, iotp p 4 := p 4 n; Γ, Γ, R n, W 4 Γ, Γ, R n, iotp, W 4 p 5 := BUS ID(); Γ, Γ, R n, iotp, W 4,5 Γ, Γ, R n, iotp, W 4,5 p 6 := TIMESTAMP(); Γ, Γ, R n, iotp, W 4,5,6 Γ, Γ, R n, iotp, W 4,5,6 p 7 := MAC K (p 0, p 1, p 2, p 3, p 4, p 6); Γ, Γ, R n, iotp, W 4,5,6,7 Γ, Γ, R n, iotp, W 4,5,6,7 write(4 : 7) Γ, Γ, R n, iotp Γ, Γ, R n, iotp consume(r) n ; Γ, Γ i Γ 0 Id 1 Id 2 Lock 3 Otp 4 R T 5 Data 6 Data 7 Mac[0, 1, 2, 3, 4, 6] Γ Γ p 0 Id p 1 Id p 2 Lock p 3 Otp p 4 R T p 5 Data Data p 6 Data p 7 Mac[0, 1, 2, 3, 4, 6] Mac[0, 1, 2, 3, 4, 6] FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 14 / 17

A new API Type-based analysis Results Attacker model any untrusted code not using K any well-typed program (API) possibly using K For well-typed programs we formally prove that 1 any time a resource is consumed the OTP on the card has been incremented 2 after an arbitrary number of well-typed programs and attacker runs the number of resources R on the card is less than or equal to the number of resources recharged and not yet consumed, i.e., #produce(r) #consume(r) 3 cards with no valid MACs can never originate a consume(r) FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 15 / 17

Conclusion and related work Conclusion Mifare Ultralight cards very cheap, implement minimal security mechanisms application-level security is completely up to the programmer a new way of using the OTP enabling the recharge of cards and different kinds of tickets on the same card a type-checkable simple language to develop security APIs applications can build on top of these type-checked APIs future work: we intend to implement a type-checker on real programming languages and test APIs on working applications (possible collaboration with public transport company in Venice) FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 16 / 17

References Conclusion and related work Mifare ultralight contactless single-ticket IC, 2010. Product data sheet. Rev. 3.8 22 December 2010. Available at www.nxp.com/documents/data_sheet/mf0icu1.pdf. M. Bugliesi, S. Calzavara, F. Eigner, and M. Maffei. Resource-aware Authorization Policies for Statically Typed Crypto Protocols. In Proceedings of IEEE CSF 11. M. Centenaro, R. Focardi, F. Luccio, and G. Steel. Type-based analysis of PIN processing APIs. In Proceedings of ESORICS 09. P. Siekerman and M. van der Schee. Security evaluation of the disposable ov-chipkaart v1.7, 2007. Research Project for a Master Thesis, University of Amsterdam. A. Tanenbaum. Dutch public transit card broken, 2008. Available at http://www.cs.vu.nl/~ast/ov-chip-card/. FAST 2011 ()Secure recharge of disposable RFID tickets September 2011, Leuven 17 / 17