Dpaecc
Dpaecc
1 Introduction
The use of elliptic curve in cryptography was rst proposed by Miller [17] and
Koblitz [12] in 1985. Since that time, a lot of attention has been paid to elliptic
curves for cryptographic applications and it has become increasingly common to
implement public-key protocols on elliptic curves over large nite eld. Elliptic
curves (EC) provide a group structure, which can be used to translate existing
discrete-logarithm cryptosystems into the context of EC. The discrete logarithm
problem in a cyclic group G of order n with generator g refers to the problem of
nding x given some element y = g of G. The discrete logarithm problem over
x
form :
y2 + xy = x3 + ax2 + b
with a; b 2 K .
The set of points on an elliptic curve, together with a special point O called
the point at in nity can be equipped with an Abelian group structure by the
following addition operation :
Addition formula [16] for char K 6= 2; 3 :
Let P = (x1 ; y1 ) 6= O be a point, the inverse of P is ?P = (x1 ; ?y1). Let
Q = (x2 ; y2 ) 6= O be a second point with Q 6= ?P , the sum P + Q = (x3 ; y3)
can be calculated as :
x3 = 2 ? x1 ? x2
y3 = (x1 ? x3 ) ? y1
with
8 y2 ? y1
>< if P 6= Q,
x ?x ;
= > 3x2 2 + a1
: 21y ; if P = Q.
1
To subtract the point P = (x; y), one adds the point ?P .
Addition formula for char K = 2 :
Let P = (x1 ; y1 ) 6= O be a point, the inverse of P is ?P = (x1 ; x1 + y1 ). Let
Q = (x2 ; y2 ) 6= O be a second point with Q 6= ?P , the sum P + Q = (x3 ; y3 )
can be calculated as :
x3 = 2 + + x1 + x2 + a
y3 = (x1 + x3 ) + x3 + y1
= xy1 +
+ y2
x
1 2
if P 6= Q and :
x3 = 2 + + a
y3 = x21 + ( + 1)x3
= x1 + xy1
1
if P = Q.
2.2 Computing a multiple of a point
The operation of adding a point P to itself d times is called scalar multiplica-
tion by d and denoted dP . Scalar multiplication is the basic operation for EC
protocols. Scalar multiplication in the group of points of an elliptic curve is the
analogous of exponentiation in the multiplicative group of integers modulo a
xed integer m.
Computing dP can be done with the straightforward double-and-add ap-
proach based on the binary expansion of d = (d ?1 ; : : : ; d0 ) where d ?1 is the
` `
most signi cant bit of d (the method is the analogous of the square-and-multiply
algorithm for exponentiation) :
Algorithm 1 (Double-and-add)
input P
Q P
for i from ` ? 2 to 0 do
Q 2Q
if d = 1 then Q
i Q+P
output Q
Various techniques exist to speed-up scalar multiplication by reducing the
number of elementary point operations : see [9] for a good survey. If the point P
is known in advance, it may be advantageous to precompute a table of multiples
of P [2]. Because elliptic curve subtraction has the same cost as addition, the pre-
vious double-and-add algorithm can be improved with the addition-subtraction
algorithm which uses a signed binary expansion of d :
X
?1
`
d= c2
i
i
=0
i
NAF of d has the fewest nonzero coecients of any signed binary expansion of d
[9]. [18] describes an algorithm that generates the NAF of any positive integer.
Algorithm 2 (Addition-subtraction method)
input P
Q P
for i from ` ? 2 to 0 do
Q 2Q
if c = 1 then Q
i Q+P
if c = ?1 then Q
i Q?P
output Q
for d gives the fewest number of elliptic group operations for computing dP by
computing a1 P; a2 P; : : : a P = dP .
r
output Q[0]
memory during computation and select a particular bit (the same for all points)
of this representation. When point Q is processed, power consumption will be
correlated to this speci c bit of Q. No correlation will be observed with a point
not computed inside the card. Thus it is possible to successively recover the bits
of the exponent by guessing which points are computed by the card.
The second most signi cant bit d ?2 of d can be recovered by computing
`
the correlation between power consumption and any speci c bit of the binary
representation of 4P . If d ?2 = 0, 4P is computed during algorithm 1', and
`
This gives d ?2 . The following bits of d can be recursively recovered in the same
`
way.
Assume that algorithm 1' is performed k times with distinct P1 ; P2 ; : : : ; P k
sumption associated with the i-th execution of the algorithm for 1 i k. Let
s be any speci c bit of the binary representation of 4P for 1 i k. The
i i
C (t1 ) will then be correlated with the speci c bit s of the binary representation
i i
will be di erent from the power consumption for the points 4P for which s = 0, i i
and function g(t) will present a "peak" at time t = t1 . If the points 4P are never i
r i i j k
1 Real power consumption curves were voluntarily excluded from this paper to avoid
straightforward product identi cation.
1
0.75
0.5
0.25
5 10 15 20
-0.25
-0.5
-0.75
-1
Fig. 1. Simulated correlation function g(t) between the points 4Pi and power consump-
tion Ci (t) when d`?2 = 0. A peak is observed corresponding to the computation of 4Pi
inside the card.
0.75
0.5
0.25
5 10 15 20
-0.25
-0.5
-0.75
-1
Fig. 2. Simulated correlation function g(t) between the points 4Pi and power consump-
tion Ci (t) when d`?2 = 1. No peak is observed since the points 4Pi are never computed
by the card.
for all 0 k j < i, and for each a0 2 A computes the correlation function
g(t) between the point a0 P and power consumption. If a peak can be observed
i i
in g(t), this will indicate that the point a0 P has been computed by the device
i
i i r
Public key : Q = dP .
Encryption of a message m :
Pick k 2 [1; q ? 1].
R
The attack described before enables to recover d when the device decrypts
the ciphertext (x1 ; y1 ; c) for various points (x1 ; y1 ).
The attack described in the previous section recovers Alice's secret key when
she computes the point P = sW for Bob's public key W .
5 Countermeasures against DPA
In this section we describe three countermeasures that prevent from the attack
described in section 3. Recall that the attack enables to recover d when Q = dP
i i
are computed inside the card for various P for 1 i k. These three counter-
i
at each new execution. This makes the previous attack infeasible since the point
P 0 = P + R to be multiplied by d is not known to the attacker.
6 Conclusion
We have shown that unless protected, implementations of elliptic curve cryp-
tosystems such as El-Gamal type encryption or Die-Hellman key exchange
are vulnerable to Di erential Power Analysis. We have introduced three coun-
termeasures that address speci cally these attacks. Those countermeasures are
easy to implement and do not impact eciency in a signi cant way. However, we
do not pretend that those countermeasures thwart from all kinds of power at-
tacks, since it may be possible to exploit the information leakage through power
consumption in a di erent way.
References
1. E. Biham, A. Shamir. Power analysis of the key scheduling of the AES candidates,
Proceedings of the second AES Candidate Conference, March 1999, pp. 115-121.
2. E. Brickell, D. Gordon, K. McCurley, D. Wilson. Fast Exponentiation with Pre-
computation (Extended Abstract), Advances in Cryptology - Eurocrypt '92, LNCS
658 (1993), Springer-Verlag, pp. 200-207.
3. S. Chari, C. Jutla, J.R. Rao, P. Rohatgi. A cautionary note regarding evalua-
tion of AES candidates on smart-cards, Proceedings of the second AES Candidate
Conference, March 1999, pp. 133-147.
4. D. Chaum. Security without identi cation : transaction systems to make Big
Brother obsolete, Communications of the ACM, vol. 28, n. 10, Oct 1985, pp. 1030-
1044.
5. J. Daemen, V. Rijmen. Resistance against implementation attacks A comparative
study of the AES proposals, Proceedings of the second AES Candidate Conference,
March 1999, pp. 122-132.
6. FIPS 46, Data encryption standard, Federal Information Processing Standards
Publication 46, U.S. Department of Commerce/National Bureau of Standards, Na-
tional Technical Information Service, Spring eld, Virginia, 1977.
7. W. Die and M. Hellman. New directions in cryptography, IEEE Trans. Info.
Theory, IT-22, 1976, pp 644-654.
8. T. El Gamal. A public key cryptosystem and a signature scheme based on discrete
logarithms, IEEE Trans. Info. Theory, IT-31, 1985, pp 469-472.
9. D.M. Gordon. A Survey of Fast Exponentiation Methods, Journal of Algorithms
27, 129-146 (1998).
10. IEEE P1363/D7. Standard Speci cations for Public Key Cryptography. September
11, 1998.
11. D.E. Knuth, Seminumerical Algorithms, The Art of Computer Programming, 2
Addison Wesley, 1969.
12. N. Koblitz. Elliptic Curve Cryptosystems, Mathematics of Computation, vol. 48,
1987, pp. 203-209.
13. Paul Kocher. Timing attacks on implementations of Die-Hellman, RSA, DSS and
other systems, Advances in Cryptology, Proceedings of Crypto' 96, LNCS 1109, N.
Koblitz, Ed., Springer-Verlag, 1996, pp. 104-113.
14. Paul Kocher, Joshua Ja e, and Benjamin Jun, Introduction to Di erential Power
Analysis and Related Attacks, http://www.cryptography.com/dpa/technical,
1998.
15. K. Koyama, Y. Tsuruoka, Speeding up elliptic cryptosystems by using a signed
binary window method, Advances in Cryptology - Proceedings of Crypto '92, LNCS
740, pp. 345-357, Springer-Verlag, Berlin/New-York, 1993.
16. A. J. Menezes, "Elliptic Curve Public Key Cryptosystems", Kluwer Academic Pub-
lishers, 1993.
17. V.S. Miller. Use of Elliptic Curves in Cryptography, Proceedings of Crypto 85,
LNCS 218, Springer, 1986, pp. 417-426.
18. F. Morain, J. Olivos. Speeding up the computation of an elliptic curve using
addition-subtraction chains, Inform. Theory Appl. 24 (1990), 531-543.
This article was processed using the LATEX macro package with LLNCS style