Reasoning about Aggregation of Information in Timing Attacks Boris - - PowerPoint PPT Presentation

reasoning about aggregation of information in timing
SMART_READER_LITE
LIVE PREVIEW

Reasoning about Aggregation of Information in Timing Attacks Boris - - PowerPoint PPT Presentation

Reasoning about Aggregation of Information in Timing Attacks Boris Kpf Itsaka Rakotonirina Microsoft Research INRIA Nancy Grand-Est Choose a letter: A or B. Choose a letter: A or B. Does it occur more than 10 times in TARATATATARATATATA ?


slide-1
SLIDE 1

Reasoning about Aggregation of Information in Timing Attacks

Itsaka Rakotonirina Boris Köpf

INRIA Nancy Grand-Est Microsoft Research

slide-2
SLIDE 2
slide-3
SLIDE 3

Choose a letter: A or B.

slide-4
SLIDE 4

Choose a letter: A or B. Does it occur more than 10 times in TARATATATARATATATA ?

slide-5
SLIDE 5

Choose a letter: A or B. Does it occur more than 10 times in TARATATATARATATATA ?

🤕

slide-6
SLIDE 6

Choose a letter: A or B. Does it occur more than 10 times in TARATATATARATATATA ? No.

🤕

slide-7
SLIDE 7

Choose a letter: A or B. Does it occur more than 10 times in TARATATATARATATATA ? Q : Which letter was chosen? No.

🤕

slide-8
SLIDE 8

3

Timing attacks

24

  • n RSA (Kocher)
  • n RSA (Dhem et al.)

Meltdown (Lipp et al.) Spectre (Kocher et al.)

  • n AES (Bernstein)
  • n AES (Acıiçmez et al.)
  • n ECDH (Kaufmann et al.)

Lucky Thirteen (AlFardan, Paterson) RIDL (van Schaik et al.) 1996 1998 2005 2007 2013 2016 2018 2018 2019 2014 Flush+Reload (Yarom, Falkner) ZombieLoad (Schwarz et al.) 2019

slide-9
SLIDE 9

3

Timing attacks

24

A long-term secret, and queries to an oracle O : public input ↦ execution time of a program

Remote measurements

  • n RSA (Kocher)
  • n RSA (Dhem et al.)

Meltdown (Lipp et al.) Spectre (Kocher et al.)

  • n AES (Bernstein)
  • n AES (Acıiçmez et al.)
  • n ECDH (Kaufmann et al.)

Lucky Thirteen (AlFardan, Paterson) RIDL (van Schaik et al.) 1996 1998 2005 2007 2013 2016 2018 2018 2019 2014 Flush+Reload (Yarom, Falkner) ZombieLoad (Schwarz et al.) 2019

slide-10
SLIDE 10

3

Timing attacks

24

Exploit timing variations, and not the absolute execution time

Differential measurements

A long-term secret, and queries to an oracle O : public input ↦ execution time of a program

Remote measurements

  • n RSA (Kocher)
  • n RSA (Dhem et al.)

Meltdown (Lipp et al.) Spectre (Kocher et al.)

  • n AES (Bernstein)
  • n AES (Acıiçmez et al.)
  • n ECDH (Kaufmann et al.)

Lucky Thirteen (AlFardan, Paterson) RIDL (van Schaik et al.) 1996 1998 2005 2007 2013 2016 2018 2018 2019 2014 Flush+Reload (Yarom, Falkner) ZombieLoad (Schwarz et al.) 2019

slide-11
SLIDE 11

3

Timing attacks

24

Exploit timing variations, and not the absolute execution time

Differential measurements

A long-term secret, and queries to an oracle O : public input ↦ execution time of a program

Remote measurements

The secret is recovered chunk by chunk

Compositionality

  • n RSA (Kocher)
  • n RSA (Dhem et al.)

Meltdown (Lipp et al.) Spectre (Kocher et al.)

  • n AES (Bernstein)
  • n AES (Acıiçmez et al.)
  • n ECDH (Kaufmann et al.)

Lucky Thirteen (AlFardan, Paterson) RIDL (van Schaik et al.) 1996 1998 2005 2007 2013 2016 2018 2018 2019 2014 Flush+Reload (Yarom, Falkner) ZombieLoad (Schwarz et al.) 2019

slide-12
SLIDE 12

4

Attacker model Under what hypotheses?

Timing attacks

24

Exploit timing variations, and not the absolute execution time

Differential measurements

A long-term secret, and queries to an oracle O : public input ↦ execution time of a program

Remote measurements

The secret is recovered chunk by chunk

Compositionality

slide-13
SLIDE 13

5

Contributions

24

A model of timing attacks

capturing the essence of compositional attacks

Core hypotheses giving rise to efficient attacks

under the form of independence properties

Generic attack descriptions + cost analyses

slide-14
SLIDE 14

A model for timing leakage

slide-15
SLIDE 15

7 24

Program

k

Long-term secret

m

Public input

  • Observation

constant across all invocations

  • f the program

chosen by the attacker e.g. timing as a real number

slide-16
SLIDE 16

8

A simple example

24

for i = 0 to n — 1 do if k[i] ≠ m[i] then g() done

1 2 3

slide-17
SLIDE 17

8

A simple example

24

t(k,m) = Σi=1 k[i] ⊕ m[i] Hamming distance execution time proportional to: = nb of bits where k and m differ

n

for i = 0 to n — 1 do if k[i] ≠ m[i] then g() done

1 2 3

slide-18
SLIDE 18

9

Aggregation of information

24

Hamming distance potential values of the long-term secret t(k,m) = Σi=1 k[i] ⊕ m[i]

3

k

slide-19
SLIDE 19

9

Aggregation of information

24

Hamming distance potential values of the long-term secret t(k,m) = Σi=1 k[i] ⊕ m[i]

3

000

  • = t(k,000) ∈ {0,1,2,3}

⟼ k

slide-20
SLIDE 20

9

Aggregation of information

24

Hamming distance potential values of the long-term secret t(k,m) = Σi=1 k[i] ⊕ m[i]

3

000

  • = t(k,000) ∈ {0,1,2,3}

⟼ ⇒ k ∈ { k’ | t(k’,000) = o } k

slide-21
SLIDE 21

9

Aggregation of information

24

Hamming distance potential values of the long-term secret t(k,m) = Σi=1 k[i] ⊕ m[i]

3

000

  • = t(k,000) ∈ {0,1,2,3}

⟼ ⇒ k ∈ { k’ | t(k’,000) = o } k

slide-22
SLIDE 22

9

Aggregation of information

24

Hamming distance potential values of the long-term secret t(k,m) = Σi=1 k[i] ⊕ m[i]

3

000

  • = t(k,000) ∈ {0,1,2,3}

⟼ 001

  • ’ = t(k,001)

⟼ ⇒ k ∈ { k’ | t(k’,000) = o } k

slide-23
SLIDE 23

9

Aggregation of information

24

Hamming distance potential values of the long-term secret t(k,m) = Σi=1 k[i] ⊕ m[i]

3

000

  • = t(k,000) ∈ {0,1,2,3}

⟼ 001

  • ’ = t(k,001)

⟼ ⇒ k ∈ { k’ | t(k’,000) = o } k

slide-24
SLIDE 24

9

Aggregation of information

24

Hamming distance potential values of the long-term secret t(k,m) = Σi=1 k[i] ⊕ m[i]

3

000

  • = t(k,000) ∈ {0,1,2,3}

⟼ 001

  • ’ = t(k,001)

⟼ 010

  • ’’ = t(k,010)

⟼ ⇒ k ∈ { k’ | t(k’,000) = o } k

slide-25
SLIDE 25

9

Aggregation of information

24

Hamming distance potential values of the long-term secret t(k,m) = Σi=1 k[i] ⊕ m[i]

3

000

  • = t(k,000) ∈ {0,1,2,3}

⟼ 001

  • ’ = t(k,001)

⟼ 010

  • ’’ = t(k,010)

⟼ ⇒ k ∈ { k’ | t(k’,000) = o } k

slide-26
SLIDE 26

k

10

Aggregation of information

24

potential values of the long-term secret

slide-27
SLIDE 27

k

10

Aggregation of information

24

Compute this equivalence relation

  • ver the set of secrets

static approach

(security bounds) potential values of the long-term secret

slide-28
SLIDE 28

k

10

Aggregation of information

24

Compute this equivalence relation

  • ver the set of secrets

static approach

(security bounds)

Given an oracle to t(k, . ), retrieve the class enclosing k dynamic approach

(attacks) potential values of the long-term secret

slide-29
SLIDE 29

A more practical model for timing leakage

slide-30
SLIDE 30

12 24

Program

k

Long-term secret

m1,m2

Two public inputs

  • 1-o2

Difference of timings

slide-31
SLIDE 31

13

Differential measurements

24

Program

k m1,m2

  • 1-o2

Less powerful attacker, but… Compositionality Closer to the models used in actual attack research

slide-32
SLIDE 32

Compositionality for differential measurements

slide-33
SLIDE 33

15

Compositional attacks

24

recovering k?

with oracle to execution time m ↦ t(k,m)

for i = 0 to n — 1 do if k[i] ≠ m[i] then g() done

1 2 3

slide-34
SLIDE 34

15

Compositional attacks

24

recovering k?

with oracle to execution time m ↦ t(k,m)

if t(k,0) < t(k,2i) for i = 0 to n — 1 do if k[i] ≠ m[i] then g() done

1 2 3

slide-35
SLIDE 35

15

Compositional attacks

24

recovering k?

with oracle to execution time m ↦ t(k,m)

if t(k,0) < t(k,2i) then K := K ∩ { k | k[i] = 1 } else K := K ∩ { k | k[i] = 0 } Exploiting the ith iteration for i = 0 to n — 1 do if k[i] ≠ m[i] then g() done

1 2 3

slide-36
SLIDE 36

16

Sequential composition

24

for i = 0 to n — 1 do if Testi(k,x) = 1 then g() done x = m x = fi(k,x)

1 2 3 4 5

slide-37
SLIDE 37

16

Sequential composition

24

for i = 0 to n — 1 do if Testi(k,x) = 1 then g() done x = m x = fi(k,x)

1 2 3 4 5

p = p0; p2 ; … ; pn-1 Goal: writing this code under the form

slide-38
SLIDE 38

16

Sequential composition

24

for i = 0 to n — 1 do if Testi(k,x) = 1 then g() done x = m x = fi(k,x)

1 2 3 4 5

p = p0; p2 ; … ; pn-1 Goal: writing this code under the form

pi computes fi : K x M →M with execution time Testi : K x M → {0,1}

slide-39
SLIDE 39

17

Sequential composition

24

pcomp = p1 ; p2

slide-40
SLIDE 40

17

Sequential composition

24

pcomp = p1 ; p2

pℓ computes fℓ : K x M →M with execution time tℓ : K x M →O

slide-41
SLIDE 41

17

Sequential composition

24

pcomp = p1 ; p2 fcomp = f2 ◦ f1 States are composed

pℓ computes fℓ : K x M →M with execution time tℓ : K x M →O

slide-42
SLIDE 42

17

Sequential composition

24

pcomp = p1 ; p2 fcomp = f2 ◦ f1 States are composed

pℓ computes fℓ : K x M →M with execution time tℓ : K x M →O composition of public values, i.e. (f ◦ g)(k,m) = f(k, g(k,m))

slide-43
SLIDE 43

17

Sequential composition

24

pcomp = p1 ; p2 fcomp = f2 ◦ f1 States are composed tcomp = t1 + (t2 ◦ f1) Timings are summed

pℓ computes fℓ : K x M →M with execution time tℓ : K x M →O composition of public values, i.e. (f ◦ g)(k,m) = f(k, g(k,m))

slide-44
SLIDE 44

18

Key hypothesis: independence

24

slide-45
SLIDE 45

18

Key hypothesis: independence

24

Theorem Hypotheses Leak(t+t’) = Leak(t) ⋂ Leak(t’) t,t’ timing functions

slide-46
SLIDE 46

18

Key hypothesis: independence

24

Theorem Hypotheses Leak(t+t’) = Leak(t) ⋂ Leak(t’) t,t’ timing functions

  • Leak(t) = the equivalence relation on

secrets characterising timing leakage

slide-47
SLIDE 47

18

Key hypothesis: independence

24

Theorem Hypotheses Leak(t+t’) = Leak(t) ⋂ Leak(t’) t,t’ timing functions

  • X distribution of public inputs
  • for all secrets k,k’, the distributions

t(k, X) and t’(k’, X) are independent

  • Leak(t) = the equivalence relation on

secrets characterising timing leakage

slide-48
SLIDE 48

19

Randomised compositional attack

24

slide-49
SLIDE 49

19

Randomised compositional attack

24

Inputs

  • racle to t(k*, .) execution time of (p1;…;pn)

independent blocks p1 = (f1,t1) ,…,pn = (fn,tn) for some k*

slide-50
SLIDE 50

19

Randomised compositional attack

24

Inputs

  • racle to t(k*, .) execution time of (p1;…;pn)

independent blocks p1 = (f1,t1) ,…,pn = (fn,tn) for some k*

Output

equivalence class of k* in Leak(t)

slide-51
SLIDE 51

K := set of all secrets M := sample of r random messages for i=1 to n do K := K ∩ Attack (t̄i | K x M) done return K

19

Randomised compositional attack

24

Inputs

  • racle to t(k*, .) execution time of (p1;…;pn)

independent blocks p1 = (f1,t1) ,…,pn = (fn,tn) for some k*

Output

equivalence class of k* in Leak(t)

Algorithm

slide-52
SLIDE 52

K := set of all secrets M := sample of r random messages for i=1 to n do K := K ∩ Attack (t̄i | K x M) done return K

19

Randomised compositional attack

24

Inputs

  • racle to t(k*, .) execution time of (p1;…;pn)

independent blocks p1 = (f1,t1) ,…,pn = (fn,tn) for some k*

Output

equivalence class of k* in Leak(t)

Algorithm

timing attack on t̄i = ti ◦ fi-1 ◦ … ◦ f1 with oracle to t(k*, . )

slide-53
SLIDE 53

Applications

slide-54
SLIDE 54

21

for simple bit-serial operations, n bits Bruteforce O(2n) measurements

  • Random. attack

O(n log(n/ε)) random measurements

(to guarantee proba of success 1 – ε)

Cost analysis

24

slide-55
SLIDE 55

21

for simple bit-serial operations, n bits Bruteforce O(2n) measurements

  • Random. attack

O(n log(n/ε)) random measurements

(to guarantee proba of success 1 – ε)

Cost analysis

24

complexity gain by exploiting the program structure

slide-56
SLIDE 56

22

Explaining documented attacks

24

as instances of the randomised attack VS independent blocks

slide-57
SLIDE 57

22

Explaining documented attacks

24

as instances of the randomised attack VS independent blocks

  • n RSA (Dhem et al.)

1998 Targets: Extracts: Exploits:

  • implem. of modular exponentiation

with Montgomery multiplications all bits of the secret exponent but one timing variations of squaring operations

slide-58
SLIDE 58

22

Explaining documented attacks

24

as instances of the randomised attack VS independent blocks

  • n RSA (Dhem et al.)

1998 Targets: Extracts: Exploits:

  • implem. of modular exponentiation

with Montgomery multiplications all bits of the secret exponent but one timing variations of squaring operations

1 block = 1 multiplication Decomposition:

slide-59
SLIDE 59

22

Explaining documented attacks

24

as instances of the randomised attack VS independent blocks

Targets: Extracts: Exploits:

  • n AES (Acıiçmez et al.)

2007

  • implem. of AES with precomputed tables

all bits of the encryption key timing variations due to cache

1 block = 1 table lookup Decomposition:

slide-60
SLIDE 60

Conclusion

slide-61
SLIDE 61

24

Conclusion

24

A formal model for reasoning about timing attacks

slide-62
SLIDE 62

24

Conclusion

24

A formal model for reasoning about timing attacks Compositionality results

slide-63
SLIDE 63

24

Conclusion

24

A formal model for reasoning about timing attacks Compositionality results Generic description of attacks / cost analysis

slide-64
SLIDE 64

24

Conclusion

24

A formal model for reasoning about timing attacks Compositionality results Captures several documented attacks Generic description of attacks / cost analysis

slide-65
SLIDE 65

24

Conclusion

24

A formal model for reasoning about timing attacks Compositionality results Captures several documented attacks Generic description of attacks / cost analysis Future: use as a basis for automating attack synthesis