Extracting keys from FPGAs, OTP Tokens and Door Locks
David Oswald david.oswald@rub.de Side-Channel (and other) Attacks in Practice
Extracting keys from FPGAs, OTP Tokens and Door Locks Side-Channel - - PowerPoint PPT Presentation
Extracting keys from FPGAs, OTP Tokens and Door Locks Side-Channel (and other) Attacks in Practice David Oswald david.oswald@rub.de No, I did not do all this stuff alone Christof Paar Benedikt Driessen Timo Kasper Gregor Leander
David Oswald david.oswald@rub.de Side-Channel (and other) Attacks in Practice
2
No, I did not do all this stuff alone
If you wondered about my shirt: http://fb.com/World BeatClubTanzenUndH elfen
3
4
Sabre: Madboy74
5
Ruhr-University Bochum: beautiful.
6
Announcement
https://github.com/skuep/ChameleonMini
8
(The life of) a typical pirate
Pegleg Eye patch Pirate hat Pirate laughter
9
10
11
12
13
15 Based on Skoborogatov
16
Principle of Side-Channel Analysis
(here: listen to sound)
A Bank Robbery
17
Principle of Side-Channel Analysis The world is changing…
18
Principle of Side-Channel Analysis
(Now: measure the power consumption / EM)
The world is changing … … the tools are, too.
19
Side-Channel Analysis: Leakage
Power consumption / EM depends on processed data
Data = 1111 Data = 0000 Data = 1010
20
Evaluation Methods: SPA
Simple Power Analysis: Directly analyze (few) traces, for example RSA:
21
Evaluation Methods: DPA / CPA Differential Power Analysis
Key guess ⟺ Side-channel
22 Source: phdcomics.com
Wrong key candidate(s) Correct key candidate 100 – 1 mio. measurements
24
Case Studies
Locking system Yubikey 2 Altera Stratix II
25
Home Port t Bochu hum
26
27
Case Studies
Locking system Yubikey 2 Altera Stratix II
28
FPGAs widely used in
Problem: FPGA design (bitstream) can be easily copied
FPGAs
29
FPGA 1 Flash Bitstream
FPGA Power-Up
30
FPGA 1 Flash Bitstream FPGA 2
Clone
Problem: Cloning
31
FPGA 1 Flash Encrypted bitstream
Industry‘s Solution
32
FPGA 1 Flash Encrypted bitstream
Industry‘s Solution
33
Related Work
several Xilinx product lines broken
– Virtex 2 (3DES) – Virtex 4 & 5 (AES256) – Spartan 6 (AES256)
34
What about Altera?
uses AES w/ 128-bit key
mechanisms for key derivation and for encryption
35
35
Reverse-Engineering
from Quartus II software
36
KEY1 / KEY2 file for FPGA
37
Key derivation real key = f(KEY1,KEY2) KEY1 / KEY2 file for FPGA
38
Why this key derivation?
programming the FPGA
KEY2 cannot be found Prevent cloning: real key of blank FPGA cannot be set
39
40
40
Good idea?
KEY1*(real key)
41
real key = AESKEY1(KEY2)
KEY1 / KEY2 file for FPGA
42
real key = AESKEY1(KEY2) encreal key(...)
KEY1 / KEY2 file for FPGA
43
44
Reverse-Engineering: Summary
(target: 128-bit real key)
45
46
47
Mean trace for unencrypted and encrypted bitstream
48
Mean trace for unencrypted and encrypted bitstream
49
50
Recover the 128-bit AES key with 30,000 traces (~ 3 hours of measurement)
51
Conclusion
extracted using 30,000 traces (3 hours)
reverse-engineered from software
hardware attack
52
53
54
55
Case Studies
Locking system Yubikey 2 Altera Stratix II
56
57
Token Door lock
Auth. protocol
58
Turning a Black-box into a White-box
Door lock Token
59
Decapping an IC (1)
White Fuming Nitric Acid (99.5%)
60
Decapping an IC (2)
61
Decapping an IC (3)
62
Decapping an IC (4)
63
ASIC
utilized
64
ASIC – Logic Description
65
Turning a Black-box into a White-box
Door lock Token
66
Microscopic View (1)
FLASH RAM
EEPROM
analog
FUSES
67
UV-C: Disable Read-Out Protection (1)
68
UV-C: Disable Read-Out Protection (2)
69
Extraction + Analysis of Embedded Code
readable with standard programmer
70
System Design: Weaknesses and Attacks (1)
Read-out PIC (as explained before) or perform non-invasive side-channel attack
71
System Design: Weaknesses and Attacks (2)
with „bad“ mathematical properties
„random“ numbers
with 3 (unsuccessful) protocol runs with any door
72
Conclusion
– Insecure hardware – Proprietary cryptography – „Bad“ system design
mathematical attacks
73
74
75
76
77
Case Studies
Locking system Yubikey 2 Altera Stratix II
78
Two-Factor Authentication
Past: One factor: Password/PIN Today: Two factors: Password/PIN and additionally
79
Yubikey 2: Overview
Password (OTP) on button press
80
Yubikey OTP Generation (1)
...
dhbgnhfhjcrl rgukndgttlehvhetuunugglkfetdegjd dhbgnhfhjcrl trjddibkbugfhnevdebrddvhhhlluhgh dhbgnhfhjcrl judbdifkcchgjkitgvgvvbinebdigdfd ...
81
Yubikey OTP Generation (2) AES-128 Encryption Modhex Encoding
82
Yubikey Hardware
83
Measurement Setup
the Yubikey
84
Power vs. EM Measurements
1 2 3 4 5 6 7 8 9 10
85
Key Recovery (EM)
Byte 1 Byte 2 Byte 8 Byte 9
86
Implications
(700 EM measurements = 1 hour physical access)
Username and password still needed
Send an OTP with highly increased useCtr → Improved FW version 2.4 for Yubikey 2
88
89
By RedAndr, Wikimedia Commons
90
Responsible Disclosure
– Vendor informed ~ 1 year before – Deployed patch to fix mathematical attacks
– Informed ~ 6 months before – Acknowledged our results
– Informed ~ 9 months before – Improved firmware version 2.4
92
Countermeasures
– Secure hardware (certified devices) – Algorithmic level
– Detect: Shadow accounts, logging – Minimize impact (where possible): Key diversification
93
Different Scenarios, different threats
Yubikey 2
→ Attack does not scale
Locking system
→ Attack scales
94
If you wondered about my shirt: http://fb.com/WorldBeatClubTanzenUndHelfen