lecture7 –more on attacks rice elec 528/ comp 538 farinaz koushanfar spring 2009

69
Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Upload: bethanie-jones

Post on 18-Jan-2018

221 views

Category:

Documents


0 download

DESCRIPTION

Simple power analysis (SPA) - example

TRANSCRIPT

Page 1: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Lecture7 –More on Attacks

Rice ELEC 528/ COMP 538 Farinaz Koushanfar

Spring 2009

Page 2: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Outline

• More on side-channel attacks• Fault injection attacks• Generic attacks on cryptosystems

Slides are mostly courtesy of Michael [email protected]

Page 3: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Simple power analysis (SPA) - example

Page 4: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

SPA example (cont’d)

Page 5: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

SPA example (cont’d)• Unprotected modular exponentiation – square

and multiply algorithm

Page 6: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Possible counter measure – randomizing RSA exponentiation

Page 7: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Statistical power analysis

• Two categories– Differential power analysis (DPA)– Correlation power analysis (CPA)

• Based on the relationship b/w power consumption & hamming weight of the data

Page 8: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Modeling the power consumption

• Hamming weight model– Typically measured on a bus, Y=aH(X)+b– Y: power consumption; X: data value; H:

Hamming weight• The Hamming distance model

– Y=aH(PX)+b– Accounting for the previous value on the bus

(P)

Page 9: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Differential power analysis (DPA)

• DPA can be performed in any algo that has operation =S(K), is known and K is the segment key

The waveforms are caotured by a scope and Sent to a computer for analysis

Page 10: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

What is available after acquisition?

Page 11: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

DPA (cont’d)

The bit will classify the wave wi– Hypothesis 1: bit is zero– Hypothesis 2: bit is one– A differential trace will be calculated for each bit!

Page 12: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

DPA (cont’d)

Page 13: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

DPA (cont’d)

Page 14: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

DPA -- testing

Page 15: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

DPA -- testing

Page 16: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

DPA – the wrong guess

Page 17: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

DPA (cont’d)

• The DPA waveform with the highest peak will validate the hypothesis

Page 18: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

DPA curve example

Page 19: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

DPA (cont’d)

Page 20: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Attacking a secret key algorithm

Page 21: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Typical DPA Target

Page 22: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Example -- DPA

Page 23: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Example – hypothesis testing

Page 24: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

DPA (Cont’d)

Page 25: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

DPA on DES algorithm

Page 26: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

DPA on other algorithms

Page 27: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Correlation power analysis (CPA)

• The equation for generating differential waveforms replaced with correlations

• Rather than attacking one bit, the attacker tries prediction of the Hamming weight of a word (H)

• The correlation is computed by:

Page 28: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Statistical PA -- countermeasures

Page 29: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Anti-DPA countermeasures

Page 30: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Anti-DPA

• Internal clock phase shift

Page 31: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

DPA summary

Page 32: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Electromagnetic power analysis

Page 33: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

EMA – probe design

Page 34: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

EMA signal

Page 35: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Spatial positioning

Page 36: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Spatial positioning

Page 37: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Example: SEMA on RSA

Page 38: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

EMA (cont’d)

Page 39: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Counter measures

Page 40: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Fault injection attacks

Page 41: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Fault attacks

Page 42: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Fault injection techniques

• Transient (provisional) and permanent (destructive) faults– Variations to supply voltage– Variations in the external clock– Temperature– White light– Laser light– X-rays and ion beams– Electromagnetic flux

Page 43: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Need some (maybe expensive equipment) – eg, laser

Page 44: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Fault injection steps

Page 45: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Provisional faults

• Single event upsets– Temporary flips in a cell’s logical state to a

complementary state• Multiple event faults

– Several simultaneous SEUs • Dose rate faults

– The individual effects are negligible, but cumulative effect causes fault

• Provisional faults are used more in fault injection

Page 46: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Permanent faults• Single-event burnout faults

– Caused by a parasitic thyristor being formed in the MOS power transistors

• Single-event snap back faults– Caused by self-sustained current by parasitic bipolar transistors

in MOS• Single-event latch-up faults

– Creates a self sustained current in parasitics• Total dose rate faults

– Progressive degradation of the electronic circuit

Page 47: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Fault impacts (model)• Resetting data• Data randomization – could be misleading, no control

over!• Modifying op-code – implementation dependent

Page 48: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Fault attacks – counter measures

Page 49: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Fault attacks – counter measures

Page 50: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Attacks on systems using smart cards

Page 51: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Trusted path

• Normal key validation on a PC

Page 52: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Trusted path• PIN code validation – can you come up with attacks?

Page 53: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Are smart cards good or bad?

Page 54: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Let’s go thru a few common scenarios

Page 55: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

A few common scenarios…

Page 56: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

A few common scenarios…

Page 57: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

A few common scenarios…

Page 58: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

A few common scenarios…

Page 59: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

A few common scenarios…

Page 60: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

A few common scenarios…

Page 61: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

A few common scenarios…

Page 62: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

A few common scenarios…

Page 63: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

A few common scenarios…

Page 64: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

A few common scenarios…

Page 65: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

A few common scenarios…

Page 66: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

Example – fault attack on DES

Page 67: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

15-th round DPA

Page 68: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

15-th round DPA

Page 69: Lecture7 –More on Attacks Rice ELEC 528/ COMP 538 Farinaz Koushanfar Spring 2009

15-th round DES