310 likes | 442 Views
Sliding Windows Succumbs to Big Mac Attack. Colin D. Walter www.co.umist.ac.uk. Aims. Re-think the power of DPA; Use it on a single exponentiation; Longer keys are more unsafe !. DPA Attack on RSA.
E N D
Sliding Windows Succumbs to Big Mac Attack Colin D. Walter www.co.umist.ac.uk
Aims • Re-think the power of DPA; • Use it on a single exponentiation; • Longer keys are more unsafe! C.D. Walter, UMIST
DPA Attack on RSA Summary: Differential Power Analysis (DPA) is used to determine the secret exponent in an embedded RSA cryptosystem. Assumption: The implementation uses a small multiplier whose power consumption is data dependent and measurable. C.D. Walter, UMIST
History • P. Kocher, J. Jaffe & B. Jun Introduction to Differential Power Analysis and Related Attacks Crypto 99 • T. S. Messerges, E.A. Dabbish & R.H. Sloan Power Analysis Attacks of Modular Exponentiation in Smartcards CHES 99 C.D. Walter, UMIST
Multipliers • Switching a gate in the H/W requires more power than not doing so; • On average, a Mult-Acc opna×b+chas data dependent contributions roughly linear in the Hamming weights of a and b; • Variation occurs because of the initial state set up by the previous mult-acc opn. C.D. Walter, UMIST
First Results • This theory was checked by simulation and found to be broadly correct; • Refinements were made to this model (which will be reported elsewhere); • These give a more precise & detailed partial ordering. C.D. Walter, UMIST
Combining Traces I • The long integer product A×B in an exponentiation contains a large number of small digit multiply-accumulates: ai×bj+ck • Identify the power subtraces of each ai×bj+ck from the power trace of A×B; • Average the power traces for fixed i as jvaries: this gives a trace triwhich depends on ai but only the average of the digits of B. C.D. Walter, UMIST
Combining Traces a0b0 a0b1 a0b2 a0b3 C.D. Walter, UMIST
Combining Traces a0b0 C.D. Walter, UMIST
Combining Traces a0b1 a0b0 C.D. Walter, UMIST
Combining Traces a0b2 a0b1 a0b0 C.D. Walter, UMIST
Combining Traces a0b3 a0b2 a0b1 a0b0 C.D. Walter, UMIST
Combining Traces C.D. Walter, UMIST
Combining Traces Average the traces: a0(b0+b1+b2+b3)/4 C.D. Walter, UMIST
Combining Traces _ • b is effectively an average random digit; • So trace is characteristic of a0 only, not B. tr0 _ a0b C.D. Walter, UMIST
Combining Traces II • The dependence of tri onBis minimal ifBhas enough digits; • Concatenate the average tracestrifor eachaito obtain a tracetrAwhich reflectsproperties ofAmuch more strongly than those ofB; • The smaller the multiplier or the larger the number of digits (or both) then the more characteristic trA will be. C.D. Walter, UMIST
Combining Traces tr0 C.D. Walter, UMIST
Combining Traces tr0 tr1 C.D. Walter, UMIST
Combining Traces tr0 tr1 tr2 C.D. Walter, UMIST
Combining Traces tr3 tr0 tr1 tr2 C.D. Walter, UMIST
Combining Traces • Question: Is the trace trA sufficiently characteristic to determine repeated use of a multiplier A in an exponentiation routine? trA C.D. Walter, UMIST
Distinguish Digits? • Averaging over the digits of B has reduced the noise level; • In m-ary exponentiation we only need to distinguish: • squares from multiplies • the multipliers A(1), A(2), A(3), …, A(m–1) • For small enough m and large enough number of digits they can be distinguished in a simulation of clean data. C.D. Walter, UMIST
Distances between Traces power tr0 tr1 i 0 n n d(0,1) = ( i=0(tr0(i)tr1(i))2)½ C.D. Walter, UMIST
Simulation gate switch count tr0 tr1 i 0 n n d(0,1) = ( i=0(tr0(i)tr1(i))2)½ C.D. Walter, UMIST
Simulation Results 16-bit multiplier, 4-ary expn, 512-bit modulus. d(i,j) = distance between traces for ith and jth multiplications of expn. Av d for same multipliers 2428 gates SD for same multipliers 1183 Av d for different multipliers 23475 gates SD for different multipliers 481 C.D. Walter, UMIST
Simulation Results • Equal exponent digits can be identified – their traces are close; • Unequal exponent digit traces are not close; • Squares can be distinguished from multns: their traces are not close to any other traces; • There are very few errors for typical cases. C.D. Walter, UMIST
Expnt Digit Values • Pre-computations A(i+1) A A(i) mod M provide traces for known multipliers. So: • We can determine which multive opns are squares; • We can determine the exp digit for each multn; • Minor extra detail for i = 0, 1 and m–1; • This can be done independently for each opn. C.D. Walter, UMIST
Some Conclusions • The independence means attack time proportional to secret key length; • Longer modulus means better discrimination between traces; • No greater safety against this attack from longer keys. C.D. Walter, UMIST
Warning • With the usual DPA averaging already done, it may be possible to use a single exponentiationto obtain the secret key; • So using expntd+rφ(M) with random r may be no defence. C.D. Walter, UMIST
Final Conclusions • Sliding Windows expn method may be broken in this way; • Like a Big Mac, you can nibble away at each secret exponent digit in turn and enjoy finding out its value. C.D. Walter, UMIST