Daily Life for a Secure Product in the Industry
Benoit Feix 3rd June 2011
1 Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
in the Industry Benoit Feix 3 rd June 2011 Albena, Bulgaria, 29 May - - PowerPoint PPT Presentation
Daily Life for a Secure Product in the Industry Benoit Feix 3 rd June 2011 Albena, Bulgaria, 29 May 3 June 2011 1 Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Outline Product Overview Product Design Cycle
Benoit Feix 3rd June 2011
1 Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
2/xxpages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
─ Former name: Inside Contactless ─ Recently acquired Atmel Secure Microcontroller Solutions activity ─ ~340 employees in the world ─ Fabless company
3/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
Integrated Circuit
Appli 1 Appli 2
Operating System Hardware Abstract Layer Cryptographic Libraries
4/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
1)
2)
3)
5/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
Integrated Circuit
Appli 1 Appli 2
Operating System Hardware Abstract Layer
Circuit size (cost) is increased Efficiency/performances decreases
Cryptographic Libraries
6/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
OS Development Integrated Circuit Development CRYPTO Development Applications Development Securisation Tests Production Preparation Photomask Manufacture Foundry Tests Initialisation Pre personnalisation Product Personnalisation SPECIFICAT CIFICATIO IONS NS
7/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
Product on the Field
Field management
End of Life
8/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
9/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
─ CISC or RISC ─ Harvard or Von Neumann ─ 8 bit (CISC): 8051, AVR ─ 16 bits (RISC): proprietary cores ─ 32 bits (RISC): MIPS, ARM7, ARM9, SC100 … new ARM families
─ DES ─ AES ─ CRC ─ Long Integer Arithmetic
10/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
─ DES/TDES: NIST only recommends TDES ─ AES
─ SHA-1, SHA-2 ─ RIPEMD 160 ─ Later .. (2012) SHA-3: competition ongoing
─ RSA CRT – RSA SFM ─ DSA / ECDSA ─ DH / ECDH ─ OBKG
11/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
─ ‘’Closed’’ or dedicated systems
banking cards, health cards, SIM cards for mobile
─ Open systems
software (applets) after the ROM mask step and the personalization; for instance the Java Cards, or the MultOS operating system…
12/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
─ Input / Output data and associated protocol management ─ Memory Management in work areas
─ Basic and principle services for applicative codes
─ Multi applicative mode management ─ Access control management for reading and writing at each memory area ─ Life Cycle Management with security
13/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
─ C ─ Assembly: native and dedicated to each microprocessor ─ C++ ─ Java Card
─ Banking Card (native):
─ SIM Card
─ Multi applicative or open product
14/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
─ Can be burned in ROM and then only instanced
─ Can be downloaded during personalization or later in the life cycle in
an open system: MultOS
─ Can be loaded on any product having a Java Card OS
─ Open platform which manages the loading in a secure manner
15/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
Reverse Engineering Probing FIB (Focused Ion beam)
Timing Attacks Side-Channel Analysis (Power, ElectroMagnetic, RF)
Fault Attacks
16/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
– Reconstitution of the layers – Reading the memories
– Probing the device – Circuit modifications (FIB)
17/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
– Gaining access to the chip (example)
– Remove/cut plastic with a knife – Use chemical to remove resin (nitric acid, acetone…) – Reconnect the chip in another package if needed.
– Layers reconstitution: using plasma machine or chemical
– Each layer image is obtained through an electronic microscope – Each metal level can then be observed – Whole IC reverse engineering is very complex but part of it can be done
18/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
– Depend on the kind of memory: a basic ROM can be directly read on the top metal layer – For diffused memory it is necessary to reach the bulk level and use etching techniques – Much more difficult in practice on other memories: Flash, EEPROM, RAM
– Direct access to internal signals enables observation or modification of internal data (bits): data flow in buses …
– Can be used to add test pads (probing) on sensitive signals – To modify the internal behavior of a device Bypass security features, modify functionalities
19/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
─ Values in a bus for instance …
─ other sensitive values …
20/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
debugging circuits.
─ Access lower signals in circuit ─ modify the chip behavior
21/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
Computer Card Reader Digital Oscilloscope
– In a microprocessor thousands of logical gates switch differently depending on
Power consumption contain information on IC operations and data manipulated
22/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
– Analysis of power curves can then allow recovery of secret data – Simple Power Analysis (SPA): analyze and recover the secret key with a
single curve (Kocher et al.) – Examples: – DES key extraction by SPA on Key Scheduling – RSA key extraction by SPA on Exponentiation
– Differential and Correlation Power Analysis (DPA / CPA): use many
curves and statistical treatment to validate a hypothesis on k bits of key; and k- bit per k-bit recover the whole secret key.
– Template Attacks – Other improvements techniques: Mutual Information Analysis, High Order Attacks …
23/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
24
thousands (or millions) of curves can be needed to recover the key.
reduce the number of curves …
RF curve of AES 128
Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
allows retrieval of the private secrete key!
retrieval of the whole key.
retrieval of the whole key
– Collision Fault Analysis (CFA) – Ineffective Fault Analysis (IFA, Safe Errors)
25 Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
Assets ets
Secret Keys
(DES, AES, RSA, …)
Issuer data User data Embedded software Design Intellectual Property
Invas asive Attacks Passive e Attacks Active e Attacks
Layer reconstruction Reading memory Probing SPA/DPA/TA/EMA FA
X X X X X X X X X X X X X X (X) X X X (X)
26/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
(to hide the type of gates used)
28/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
the IC
29/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
attacker, desynchronized > Noise generators, dummy cycles, clock jitters or power filtering aim at reducing the circuit leakage
> Dual Rail techniques (or triple rail)
> De-correlate power consumption from data manipulated …
30/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
─
Abnormal behavior detection
─
Memory Management Unit
─
Memory integrity checks
─
Redundancy on some HW blocks and operations
31/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
─
Randomize operation executions
(It is like tracks on disc player in random mode).
─
Insert dummy operations
─
Insert fake sensitive data
─
Add software encryption on sensitive data
33/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
─
Implement Constant execution time routines
─
Execute operations in random order
─
Insert dummy cycles
─
Use data masking or blinding to de-correlate data operation from power consumption
─
Hide sensitive operation among fake ones
34/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
─
Don’t use simple values as 0 and 1 for condition results or status values.
─
Execution Redundancy on sensitive operations
─
Initialize status AND to false or exception
Authentication status set to Not-OK
+
Comparison not done = Decline authentication
35/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
─
Check integrity on elements
─
Verify data readings in memories
─
Verify cryptographic calculations
36/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
37/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
─ patented by R. Moreno in 1974 ─ others …
standard … and patents related to tamper resistance …
Cryptography Research (just bought by Rambus) Patents (Kocher etal.)
…
38/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
RSA
─ Blinding of exponent (like RSA) ─ Constant timing execution methods ─ Use of unpredictable numbers to prevent product from observation analysis ─ DES masked calculation: Sbox masked recalculation, using mask values, ─ Balanced Power consumption design for chips
phones, set top box … ?
39/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
40/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
41/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
42/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
─ Depends on the money you spend for hacking … with millions you always can
break a product …
─ Example: months (years) of reverse, FIB … ─ BUT a product has a limited life duration
Compare the cost of the attack WITH The gain the attacker can expect to obtain
1 000 000 € to recover my own bank card key Not interesting not dangerous ! 1 000 000 € to recover a system master key banking, Pay TV …
Interesting for the attacker Dangerous !
43/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
44/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
45/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
─ Message M and key K for calculation C = DES(M,K) ─ M is blinded in two messages M1 and M2 s.t. M = M1
M2
─ K is blinded in two elements K1 and K2 s.t. K = K1
K2
─ Linear calculations are protected with this blinding ─ SBoxes are not linear, then:
─ Process the 16 rounds ─ At the end recombine to obtain the correct ciphertext C
─ DES and Differential Power Analysis (The "Duplication" Method)., Patarin and Goubin,
CHES 1999.
─ An Implementation of DES and AES, Secure against Some Attacks, Akkar and Giraud,
CHES 2000.
46/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
Side-Channel Analysis: Side-Channel Atomicity. IEEE Trans. Computers 2004.
Not SPA resistant (conditional code operation) IN: m, d = (dk-1 … d1 d0), n OUT: s= md mod n
a= MontMul(a, a, n) If di = 1 then a = MontMul(a, b, n)
IN: m, d = (dk-1 … d1 d0), n OUT: s= md mod n
R0= MontMul(R0, Rc, n) c = c di i = i - c
But not DPA resistant
47/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
(not SPA)
S = md mod n
d* = d + r.φ (n) (or d + r.λ(n) )
md* mod n = S
and q are primes.
─ d* = d + r.(e.d -1)
as (ed-1) = k. φ ( n) with k < e.
48/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
S1 = md1 mod n S2 = md2 mod n Compute S = S1.S2 mod n Return S
49/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
m* = m + r1.n mod r2.n S = (m*d mod r2n) mod n
Increase the size of numbers used of the random size.
m* = re.m mod n S = (m*)d . 1/r mod n Need the calculation of r -1 mod n
50/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
51/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
increased a lot …
years …nothing new ..’’ … it is not the case …
52/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
─ Moradi etal., Correlation-Enhanced Power Analysis Collision Attack, CHES 2010 ─ Marc F. Witteman etal., Defeating RSA Multiply-Always and Message Blinding
Countermeasures CT-RSA 2011 … (can be assimilated to Partial Collision Correlation …)
─ Di-Battista etal., When Failure Analysis Meets Side-Channel Attacks, CHES 2010 ─ Clavier etal., Passive and Active Combined Attacks on AES, FDTC 2010.
53/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
─ Exponent blinding not useful, ─ Unique (often) message blinding: allow exhaustive search on random used for
blinding if not big enough.
─ SPA remains a very powerful attack, often underestimated.
─ Need only one execution power curve as the Big Mac Attack, ─ Compute correlation on many segments of the unique curve (Horizontal
Correlation analysis).
─ Random numbers used for blinding MUST BE upper to 32 bits. ─ Multipliers core must be at least 32 bits for Public Key algorithm implementations.
54/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
Two class of attacks:
Analysis, Timing Attacks, …)
glitches …
Protecting a product from these attacks is not an easy task Problem: Each protection is usually focused to protect against SCA
─ Idea: Combine both kind of attacks to defeat classical set of
55/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
Countermeasures : Randomization Scheme / Side-Channel Atomicity / Fault Protection Implementation : Get r1, r2 two non zero small random values R0 = 1 + r1.n R1 = m + r1.n mod r2.n k = 0 for i from k-1 to 0 do
s = R0 mod n mredundancy = se mod n if m ≠ mredundancy then fault detected ! else return (s)
56/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
Mult operations by R1 are now revealed Verification happens too late!
1 1 1 1 1 1 1 1 1 1 1
57/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
58/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
potential attacks and techniques to take into account … then you need to do:
─ Internal challenging activities – challenge yourself – Innovate
─ Evaluation labs, card and chip makers, government institutions, Standards (JIL Attack Methods…)
with respect to industrial confidentiality constraints and rules …
is not as on an FPGA …
59/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011
60/XX pages Design and Security of Cryptographic Algorithms and Devices (ECRYPT II). Albena, Bulgaria, 29 May – 3 June 2011