20
GSIS, TOHOKU UNIVERSITY A Multiple-fault Injection Attack by Adaptiv e Timing Control under Black-box Conditi ons and a Countermeasure Sho Endo1 , Naofumi Homma1, Yu-ichi Hayashi1, Junko Takahashi2, Hitoshi Fuji2 and Takafumi Aoki1 1Tohoku University, Japan 2NTT Secure Platform Laboratories, Japan April 15, 2014 COSADE2014

April 15, 2014 COSADE2014 A Multiple-fault Injection ...€¦ · Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: April 15, 2014 COSADE2014 A Multiple-fault Injection ...€¦ · Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips

GSIS, TOHOKU UNIVERSITY

A Multiple-fault Injection Attack by Adaptive Timing Control under Black-box Conditions and a Countermeasure

Sho Endo1, Naofumi Homma1, Yu-ichi Hayashi1,

Junko Takahashi2, Hitoshi Fuji2 and Takafumi Aoki11Tohoku University, Japan

2NTT Secure Platform Laboratories, Japan

April 15, 2014 COSADE2014

Page 2: April 15, 2014 COSADE2014 A Multiple-fault Injection ...€¦ · Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips

GSIS, TOHOKU UNIVERSITY

Fault injection attacks against microcontrollers

Fault Injection attacks Injects faults in cryptographic operation Obtain a secret key from faulty

ciphertexts or other information

Countermeasures against the attacks by software Fault detection by recalculation Adding random delay before encryption

Multiple fault injection attacks in microcontrollers Involves Multiple fault injections into single cryptographi

c operation

April 15, 20142

?

Page 3: April 15, 2014 COSADE2014 A Multiple-fault Injection ...€¦ · Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips

GSIS, TOHOKU UNIVERSITY

Multiple fault injection attacks

Experiments against RSA software Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips branch instruction in recalculation routine

Conventional attacks were performed in a white-box setti

ng Execution timing of critical instructions are known Black-box condition (execution timing is not known) w

as not considered in literature

April 15, 20143

Page 4: April 15, 2014 COSADE2014 A Multiple-fault Injection ...€¦ · Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips

GSIS, TOHOKU UNIVERSITY

Goal of this work

Scanning appropriate fault injection timing Controlling fault injection timing adaptively according t

o the output of microcontrollers Attack can be applied without knowledge of program

An experiment of attack against AES with recalculation Demonstrates that we can obtain faulty ciphertext for

DFA

Proposal of a countermeasure

April 15, 2014

Investigating multiple-fault injection attack in black-box setting and countermeasure

4

Page 5: April 15, 2014 COSADE2014 A Multiple-fault Injection ...€¦ · Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips

GSIS, TOHOKU UNIVERSITY

Outline

Background

Concept of the proposed attack

Scanning algorithm

Experiment of proposed attack against AES program wit

h recalculation

Countermeasure against the proposed attack

Conclusion and future works

April 15, 20145

Page 6: April 15, 2014 COSADE2014 A Multiple-fault Injection ...€¦ · Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips

GSIS, TOHOKU UNIVERSITY

Multiple fault injection attack against recalculation

April 15, 20146

Page 7: April 15, 2014 COSADE2014 A Multiple-fault Injection ...€¦ · Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips

GSIS, TOHOKU UNIVERSITY

Assumption of our attack

Countermeasure by recalculation is presentWe can observe start and end timings of cryptographic op

eration through communication signal

April 15, 2014 7

Page 8: April 15, 2014 COSADE2014 A Multiple-fault Injection ...€¦ · Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips

GSIS, TOHOKU UNIVERSITY

Scanning fault timing

April 15, 20148

Page 9: April 15, 2014 COSADE2014 A Multiple-fault Injection ...€¦ · Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips

GSIS, TOHOKU UNIVERSITY

Obtaining faulty ciphertext for DFA

Example of faulty ciphertext

Estimating position of Fault A from ciphertext

April 15, 2014 9

Page 10: April 15, 2014 COSADE2014 A Multiple-fault Injection ...€¦ · Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips

GSIS, TOHOKU UNIVERSITY

Experiment

April 15, 2014

Experimental setup

10

Page 11: April 15, 2014 COSADE2014 A Multiple-fault Injection ...€¦ · Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips

GSIS, TOHOKU UNIVERSITY

Experimental conditions

Conditions

Output to seek: Ciphertext with four-byte error One byte in the input of 9th round is affected Can be exploited by Piret’s DFA

April 15, 201411

Cryptographic algorithm

128-bit AES with recalculation

Microcontroller AVR ATmega163 ( 8-bit)Compiler gcc 4.3.3 -OsFPGA Xilinx XC6SLX150Clock frequency of microcontroller

3.6 MHz

Plaintext (00112233445566778899aabbccddeeff)16

Key (000102030405060708090a0b0c0d0e0f)16

Page 12: April 15, 2014 COSADE2014 A Multiple-fault Injection ...€¦ · Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips

GSIS, TOHOKU UNIVERSITY

Number of trials in our attack

April 15, 2014

Steps Fault position # of trialsStart End

Step I  (Scanning preliminary fault)

pp=0 pp=3 4

Step II (Scanning Fault B) pB=30530(=cp)

pB=30527

4

Step III (Scanning Fault A) pA=3 pA=9996 9994

Total 10002

12

Page 13: April 15, 2014 COSADE2014 A Multiple-fault Injection ...€¦ · Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips

GSIS, TOHOKU UNIVERSITY

Instruction that was skipped in the experiment

April 15, 201413

Page 14: April 15, 2014 COSADE2014 A Multiple-fault Injection ...€¦ · Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips

GSIS, TOHOKU UNIVERSITY

Application of proposed attack

Attacks against conventional countermeasures for fault i

njection Duplication of instructions can be defeated by injectin

g faults into all the duplicated instructions Random delay before the encryption can be defeated

by skipping random number generation code

Proposed countermeasure Rearrange instructions of main function so that faulty

ciphertext is not output when critical instructions are skipped

April 15, 201414

Page 15: April 15, 2014 COSADE2014 A Multiple-fault Injection ...€¦ · Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips

GSIS, TOHOKU UNIVERSITY

Countermeasure for the skip of branch instruction

Output routine was moved to the address less than that of encrypt

ion

Branch condition was flipped

April 15, 201415

Page 16: April 15, 2014 COSADE2014 A Multiple-fault Injection ...€¦ · Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips

GSIS, TOHOKU UNIVERSITY

Attack on test (TST) instruction

Program may jumps to Line 2 when Line 7 was skipped

and Z = 1

April 15, 201416

Page 17: April 15, 2014 COSADE2014 A Multiple-fault Injection ...€¦ · Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips

GSIS, TOHOKU UNIVERSITY

Proposed countermeasure

Initialize Zero (Z) flag before executing test instruction

April 15, 201417

Page 18: April 15, 2014 COSADE2014 A Multiple-fault Injection ...€¦ · Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips

GSIS, TOHOKU UNIVERSITY

Conclusion and future works

Proposal of scanning method to find appropriate fault positi

on Tuning the fault position adaptively according to output

Experiment against AES program with recalculation Successfully obtained faulty ciphertext

Proposal of countermeasure against proposed attack

Future works Experiment on microcontrollers with other architectures Implementation of compiler applies the proposed counte

rmeasure automatically

April 15, 201418

Page 19: April 15, 2014 COSADE2014 A Multiple-fault Injection ...€¦ · Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips

GSIS, TOHOKU UNIVERSITY

Thank you!Any questions?

April 15, 2014 19

Page 20: April 15, 2014 COSADE2014 A Multiple-fault Injection ...€¦ · Injects faults into both encryption and recalculation Power glitches [Kim 2007] Laser shots [Trichina 2010] Skips

GSIS, TOHOKU UNIVERSITY

Screenshot during fault injection

April 15, 201420