A - Smartcards Hacking
A - Smartcards Hacking
“embedded security”
smartcards & RFID
Erik Poll
Digital Security
Radboud University Nijmegen
1
Security-sensitive hardware: examples
2
Naive attacker model
3
Improved attacker model
Better still: also take into account sloppy users at the end-points
4
Embedded security attacker model
5
I. Verbauwhede, P. Schaumont
Specific threat for security hardware
6
Smartcards
and RFID
7
Example smartcard & RFID uses
• bank cards
• SIMs in mobile phone
• public transport
• identity documents
– modern passports and national ID cards
contain (contactless) chip
• access cards
– to control access to buildings, computer networks,
laptops,...
• pay TV
8
Differences? Commonalities?
9
Differences & Commonalities
10
Authenticity: remember the old things
replaced by new electronic alternatives
11
Differences? Commonalities?
12
Smartcard vs other computers
No fundamental difference !
smartcard does not only offer data storage but also
processing power
Smartcard is restricted in its possibilities
How, for example?
Smartcard can offer security that laptop cannot
What, for example?
eg you cannot remove the hard drive
13
Smartcard technicalities
14
Form factors for smartcards
• traditional credit-card sized plastic card
• contactless cards
– aka proximity card or
RFID transponder/tag
– also possible: dual interface
• USB token
15
What is a smartcard?
16
What does “securely” mean?
• Software and data on card cannot be “messed with”
• The smartcard can implement access control to
restrict access to data or functionality, eg
– deny possibility to read or write some data
– only allowing it after entering password or PIN code
– only allowing it after performing some security protocol
• The smartcard can implement cryptographic checks
to ensure confidentiality or integrity, eg
– encrypt / sign data it provides
– decrypt / check signatures on data it receives
17
Security properties
18
Functionality: 3 types of smartcards
19
Typical use of smartcard for authentication
crypto challenge c
key K CPU
response encK(c)
20
Smartcard hardware
21
Smartcard hardware
A typical card has 512 bytes RAM, 16K ROM,
64K. EEPROM and operates at 13.5 MHz
22
Smart card chip
Crypto Clock/
Test & RNG I/O
Charge
Security coproc.
Pump
23
Test & Security
• Self-test hardware & software
– checking if RAM & EEPROM work
– checksums for ROM and static EEPROM
• Possible additional monitoring and response against attacks
24
Contact cards (ISO 7816)
25
Multi-application & post-issuance
Old-fashioned smartcards contain one program, that can never be
changed
Modern smartcard platforms
are multi-application, ie allow multiple, independent programs
(aka applets) to be installed on one card
allow post-issuance download: applications to be added (or
removed) after the card has been issued to the card holder
This is tightly controlled, by digital signatures
26
Multi-application cards
27
The terminal problem!
no keyboard
28
RFID
29
Inside a metrorio card
chip antenna
RFID
31
Many types of RFID tags
with different read ranges & capabilities, operating at different
frequencies
Many just transmit a fixed code when activated:
Animal identification RFID tags
Item management - RFID bar codes (Global TAG)
Container identification - with battery for large range
Anti-theft systems - one bit of information
advantages
ease of use
no wear & tear of contacts on card and terminal
less maintenance
less susceptible to vandalism
disadvantages
easier to eavesdrop on communication
communication possible without owner's consent
for replay, relay, or man-in-the-middle attacks (more on
that later)
RFID tags often have more limited capabilities to provide
security
33
passive vs active attacks on RFID
35
Anti-collision protocol &
• Needed for terminal to select one card to talk to, if several
cards are in the field of a reader
• For this, cards send out some random number for the reader
to identify them. This number can be
• Usually this number is fixed for a card, which can then lead to
privacy concerns
36
NFC
37
NFC = Near Field Communication
Contactless communication in mobile phones compatible with
RFID (ISO14443)
Phone can be in 3 modes:
• active : phone acts as reader for RFID tag
• passive : phone acts as tag fror RFID reader
• peer-to-peer : phone talks to another phone
38
NFC hardware inside the phone
NFC communication may be handled by 3 different processors in
the phone
1. the SIM card
2. an embedded Secure Element (SE)
3. the phone’s main CPU (which eg runs Android)
Strictly speaking, the SIM is also an SE, but one that can removed.
39
Processors in phone for NFC
SIM
embedded NFC
SE controller
40
NFC use cases ?
• Reading tags in eg posters.
But QR codes work fine for that?
41
business complications & security
• Different companies control the SIM and the SE, namely the
telco (eg Vodaphone) and the handset manufacturer (eg
Google or Samsung).
This complicates use of NFC, as any use of SIM or SE will
require their approval.
• Main CPU offers less security guarantees than SIM and SE.
– You can root your phone, but not the SIM or SE
• Partial remedy: use of TEE (Trusted Execution Environment)
for more secure environment in main OS
– eg ARM TrustZone
42
Reading tags with your own NFC phone?
43