Exclusive Exponent Blinding May Not Suffice to Prevent Timing Exclusive Exponent Blinding May Not Suffice Attacks on RSA to Prevent Timing Attacks on RSA Werner Schindler Bundesamt f¨ ur Sicherheit in der Werner Schindler Information- stechnik Bundesamt f¨ ur Sicherheit in der Informationstechnik (BSI) (BSI) Bonn, Germany State of the art and motivation A new timing attack Saint-Malo, September 15, 2015 Counter- measures Conclusion
Outline Exclusive Exponent Blinding May Not Suffice to Prevent Timing Attacks on State of the art and motivation RSA A new timing attack Werner Schindler Attack scenario Bundesamt f¨ ur Sicherheit Theoretical Background in der Information- Attack algorithm stechnik (BSI) Empirical Results Countermeasures State of the art and Conclusion motivation A new timing attack Counter- measures Conclusion
Timing Attacks on RSA Exclusive Exponent Blinding May Timing attacks on RSA without CRT Not Suffice to Prevent Kocher (Crypto 1996) [pioneer work] Timing Attacks on Dhem, Koeune, Leroux, Mestr´ e, Quisquater, Willems RSA (Cardis 1998) Werner Schindler Schindler, Koeune, Quisquater (Cryptography and Coding Bundesamt 2001) f¨ ur Sicherheit in der Timing attacks on RSA with CRT Information- stechnik Schindler (CHES 2000) (BSI) Brumley, Boneh (Usenix 2003) State of the Acıi¸ cmez, Schindler, Quisquater (CCS 2005) art and motivation A new timing attack NOTE: All these timing attacks are only applicable to Counter- unprotected implementations. measures Conclusion
Algorithmic countermeasures against side channel attacks Exclusive Exponent Blinding May Not Suffice Base blinding (Kocher 1996) to Prevent Timing Attacks on Exponent blinding (Kocher 1996) RSA Werner Modulus blinding Schindler Bundesamt Combination of blinding techniques f¨ ur Sicherheit in der . . . Information- stechnik (BSI) Crucial question in the context of security State of the art and evaluations: motivation Are these blinding techniques effective against side A new timing attack channel attacks? Counter- measures Conclusion
Side channel Attacks on blinded implementations Exclusive Exponent Acıi¸ cmez, Schindler (2007, 2008): Instruction cache attack Blinding May Not Suffice on OpenSSL v.0.9.8e, RSA with CRT, base blinding to Prevent Timing Attacks on Fouque et al. (2006), Bauer (2012): Power attacks on RSA RSA without CRT, exponent blinding Werner Schindler Schindler, Itoh (2011), Schindler, Wiemers (2014, 2015): Bundesamt f¨ ur Sicherheit Generic power attacks on exponent blinding (RSA, with in der Information- and without CRT) and scalar blinding (ECC), also in stechnik (BSI) combination with base blinding State of the art and motivation It has widely been assumed that blinding techniques would A new timing effectively prevent (pure) timing attacks. attack Counter- For exponent blinding this assumption is not true in measures general. Conclusion
(Additive) exponent blinding Exclusive Exponent Blinding May Not Suffice to Prevent RSA with CRT Timing Attacks on n = p 1 p 2 RSA d = private exponent Werner d i = d (mod ( p i − 1)) Schindler Bundesamt r i , j ∈ { 0 , . . . , 2 eb − 1 } ( eb -bit random number = j th f¨ ur Sicherheit in der blinding factor for the exponentiation modulo p i ) Information- stechnik for i = 1 , 2 compute y d i + r i , j ( p i − 1) (mod p i ) (BSI) in place of y d i (mod p i ) State of the art and motivation Exponent blinding shall prevent that an attack can focus A new timing on particular exponent bits. attack Counter- measures Conclusion
Montgomery’s multiplication algorithm (MM) Exclusive Exponent Blinding May Input: M modulus, a , b ∈ Z M := { 0 , 1 , . . . , M − 1 } Not Suffice to Prevent Output: MM ( a , b ; M ) := abR − 1 (mod M ) Timing Attacks on M < R = 2 x ( R = Montgomery constant) RSA Werner Schindler Bundesamt s := 0 1 f¨ ur Sicherheit in der for i = 0 to v − 1 do { 2 Information- stechnik u := ( s + a i b 0 ) m ∗ (mod r ) /* r -adic representation*/ (BSI) /* r = 2 ws */ s := ( s + a i b + uM ) / r State of the } art and If ( s ≥ M ) then s := s − M [= extra reduction (ER)] 3 motivation return MM ( a , b ; M ) 4 A new timing attack Counter- measures The extra reduction causes timing differences. Conclusion
Pseudoalgorithm: RSA with CRT, MM, exponent blinding Exclusive Exponent Blinding May 1 Not Suffice to Prevent y 1 := y (mod p 1 ) and d 1 := d (mod ( p 1 − 1)) Timing Attacks on (Exponent blinding) Generate the blinded exponent RSA d 1 , b := d 1 + r 1 φ ( p 1 ) = d 1 + r 1 ( p 1 − 1). Werner Compute v 1 := y d 1 , b Schindler (mod p 1 ) (expo algorithm with MM). 1 Bundesamt f¨ ur Sicherheit 2 in der Information- y 2 := y (mod p 2 ) and d 2 := d (mod ( p 2 − 1)) stechnik (Exponent blinding) Generate the blinded exponent (BSI) d 2 , b := d 2 + r 2 φ ( p 2 ) = d 2 + r 2 ( p 2 − 1). State of the Compute v 2 := y d 2 , b (mod p 2 ) (expo algorithm with MM). art and 2 motivation A new timing attack 3 (Recombination) Compute v := y d (mod n ) from ( v 1 , v 2 ), Counter- e.g. with Garner’s algorithm measures Conclusion
Theoretical background (I) Exclusive Exponent Blinding May Not Suffice Our attack targets the exponentiation steps to Prevent Timing Compute v 1 := y d 1 , b (mod p 1 ) Attacks on 1 RSA Compute v 2 := y d 2 , b (mod p 2 ) 2 Werner Schindler In the following we assume Bundesamt f¨ ur Sicherheit in der Time ( MM ( a , b ; p i )) ∈ { c , c + c ER } for all a , b ∈ Z p i Information- stechnik (BSI) c = time for MM without extra reduction c ER = time for an extra reduction State of the art and motivation Time ( v i := y d i , b (mod p i )) = A new timing i attack const + c ∗ #(squarings and multiplications) + c ER ∗ #ERs. Counter- measures Conclusion
Theoretical background (II) Exclusive Exponent Blinding May Not Suffice to Prevent Timing Attacks on Central task: Understand how the blinding and the input RSA data affect the number of squarings, multiplications and Werner Schindler ERs. Bundesamt f¨ ur Sicherheit in der Information- Problems & Difficulties: The moduli p i and the bases stechnik (BSI) y i = y (mod p i ) are unknown. Addititionally to the State of the unblinded case the secret exponents d i , b change in every art and motivation exponentiation. A new timing attack Counter- measures Conclusion
Theoretical background (III) Exclusive Our attack is an adaptive chosen-input attack with input Exponent Blinding May values y u := uR − 1 (mod n ). Not Suffice to Prevent The execution times Time (( y u ) d (mod n )) are interpreted Timing Attacks on RSA as realizations of a random variable Z ( u ). Werner The computation of E ( Z ( u )) and Var ( Z ( u )) requires Schindler Bundesamt extensive calculations (details: paper). f¨ ur Sicherheit in der Information- stechnik (BSI) We assume 0 < u 1 < u 2 < n and u 2 − u 1 ≪ p 1 , p 2 . Three cases are possible: State of the art and Case A: The interval { u 1 + 1 , . . . , u 2 } does not contain a motivation multiple of p 1 or p 2 . A new timing attack Case B: The interval { u 1 + 1 , . . . , u 2 } contains a multiple Counter- of p s but not of p 3 − s . measures Case C: The interval { u 1 + 1 , . . . , u 2 } contains a multiple Conclusion of p 1 and p 2 .
Theoretical background (IV) Exclusive Exponent For square & multiply exponentiation we have Blinding May Not Suffice to Prevent Timing E ( Z ( u 2 ) − Z ( u 1 )) Attacks on RSA 0 for Case A Werner √ n � � Schindler − 1 (log 2 ( R ) + eb − 1) R − 1 for Case B c ER ≈ Bundesamt 4 f¨ ur Sicherheit √ n � � − 1 in der (log 2 ( R ) + eb − 1) R − 1 c ER for Case C Information- 2 stechnik (BSI) This property allows to construct a distinguisher to decide State of the whether some interval ( u 1 , u 2 ] contains a multiple of p 1 or art and motivation p 2 . The decision boundary is given by A new timing √ n attack � � decbound := − 1 (log 2 ( R ) + eb − 1 ) R − 1 c ER Counter- measures 8 Conclusion
The distinguisher Exclusive Exponent Blinding May Since Var ( Z ( u 2 ) − Z ( u 1 )) is large each individual decision Not Suffice to Prevent requires many timing measurements. Timing Attacks on RSA N MeanTime ( u , N ) := 1 Werner � Time( y d j (mod n )) Schindler N Bundesamt j = 1 f¨ ur Sicherheit in der with y j := uR − 1 (mod n ) Information- stechnik (BSI) Decision rule: State of the If ( MeanTime ( u 2 , N ) − MeanTime ( u 1 , N ) > decbound ) art and motivation decide for A new timing ’( u 1 , u 2 ] does not contain a multiple of p 1 or p 2 ’ attack else decide for Counter- ’ ( u 1 , u 2 ] contains a multiple of p 1 or p 2 ’. measures Conclusion
The Attack: Phase 1 Exclusive Exponent Blinding May Not Suffice Goal: Find an interval, which contains the larger prime p 2 . to Prevent Timing Set (e.g.) u 1 := ⌊√ n ⌋ and ∆ := 2 − 6 R Attacks on RSA u 2 := u 1 + ∆ Werner Schindler while ( MeanTime ( u 2 , N ) − MeanTime ( u 1 , N ) > decbound ) Bundesamt f¨ ur Sicherheit do ∗ { in der u 1 := u 2 , u 2 := u 2 + ∆ Information- stechnik } (BSI) State of the art and * ≡ The attacker believes that Case A is correct motivation A new timing attack Status: The interval ( u 1 , u 2 ] contains p 2 . Counter- measures Conclusion
Recommend
More recommend