Fault Attacks on Elliptic Curve Cryptosystems
Marc Joye
Thomson Security Labs marc.joye@thomson.net
Fault Attacks on Elliptic Curve Cryptosystems Marc Joye Thomson - - PDF document
Fault Attacks on Elliptic Curve Cryptosystems Marc Joye Thomson Security Labs marc.joye@thomson.net CryptoPuces 2009 Porquerolles, June 26, 2009 Outline Elliptic Curve Cryptography Inducing Faults Fault Attacks Countermeasures
Thomson Security Labs marc.joye@thomson.net
The set E(K) forms an additive group where
O O is the neutral element
P P P + O O O = O O O + P P P = P P P −P P P = (x1, −y1 − a1 x1 − a3) P P P + Q Q Q = (x3, y3) where x3 = λ2 + a1λ − a2 − x1 − x2, y3 = (x1 − x3)λ − y1 − a1x3 − a3 with λ = y1 − y2 x1 − x2 [addition] 3x2
1 + 2a2x1 + a4 − a1y1
2y1 + a1x1 + a3 [doubling]
P P P = (−2.35, −1.86), Q Q Q = (−0.1, 0.836) R R R = (3.89, −5.62)
P P P = (2, 2.65) R R R = (1.11, 2.64)
K = Fq with q = p (a prime) or q = 2m #E(K) = h n with h ∈ {1, 2, 3, 4} and n prime typical size: |n|2 = 160 (≈ |K|2)
a.k.a. Digital Signature Standard – DSS included in IEEE P1363, ANSI X9.62, FIPS 186.2, SECG, and ISO 15946-2 highest security level
finite field Fq elliptic curve E/Fq with #E(Fq) = h n
cryptographic hash function H point G G G ∈ E of prime order n
$
T T = [k]G G G and set r = x(T T T) (mod n)
T T = [u1]G G G + [u2]Y Y Y
T T) (mod n)
Y Y ∈ E
Y Y = O O O
Y Y = O O O
elliptic curve variant of the Diffie-Hellman key exchange Alice Bob a
RA RA RA=[a]G G G
− − − − − − → RA RA RA RB RB RB
RB RB RB=[b]G G G
← − − − − − − b KA KA KA = [a]RB RB RB KB KB KB = [b]RA RA RA cofactor variant: KA KA KA = [h]
RB RB
KB KB = [h]
RA RA
implicit authentication Alice Bob {wA,WA WA WA = [wA]G G G} {wB,WB WB WB = [wB]G G G} a, RA RA RA = [a]G G G
RA RA RA
− − − − − − → RA RA RA RB RB RB
RB RB RB
← − − − − − − b, RB RB RB = [b]G G G sA = a + RA RA RA wA (mod n) sB = b + RB RB RB wB (mod n) KA KA KA = [sA](RB RB RB + [RB RB RB]WB WB WB) KB KB KB = [sB](RA RA RA + [RA RA RA]WA WA WA)
Notation: P P P :=
P P) mod 2|n|2/2 + 2|n|2/2 (= 0)
cofactor variant
proposed by Michel Abdalla, Mihir Bellare and Phillip Rogaway in 2000 submitted to IEEE P1363a highest security level (IND-CCA2)
finite field Fq elliptic curve E/Fq with #E(Fq) = h n “special” hash functions
T T, ℓ)
symmetric encryption algorithm EncK(m) point G G G ∈ E of prime order n
$
U U = [k]G G G and T T T = [k]Y Y Y (resp. T T T = [h][k]Y Y Y )
T T, l)
U U, c, r)
T ′ T ′ = [d]U U U (resp. T ′ T ′ T ′ = [h][d]U U U)
1K ′ 2) = KD(T ′
T ′ T ′, l)
2(c) = r then return m = Enc−1
K ′
1 (c)
September
October
November
Attacks on ECC by I. Biehl, B. Meyer & V. M¨ uller
Attacks on AES (5) by J. Bl¨
J.-P. Seifert, O. Vivilo & S.-M. Yen
random modification of RAM cells stopping read operations in NVMs to work
cheap equipment
allows to precisely target a circuit area
destructive faults the value of a cell is definitely changed
provisional faults the circuit recovers its original behavior after reset or when the fault’s stimulus ceases the code execution or a computation is perturbed: instruction byte a different instruction is executed (call to a routine skipped, test avoided, . . . ) parameter byte a different value or address is considered (operation with another operand, . . . )
The attacker can cause a fault in a single bit Full control over the timing and location of the fault
The attacker can cause a fault in a single byte Full control over the timing but only partial control over the location (e.g., which byte is affected)
The attacker can cause a fault in a single byte Partial control over the timing and location of the fault
Partial control over the timing and no control over the location
i=0 di 2i
if so, then dj = 0 if not, then dj = 1
i=0 di 2i
if the output is m then dj = 0 if the output is ⊥ then dj = 1
i=0 di 2i
2
e.g., NAF-based method gives a speed-up factor of 11.11%
i=0 δi 2i with δi ∈ {0, 1, −1}
additive variant of the square-and-multiply Input: U U U, d = (dℓ−1, . . . , d0)2 Output: T T T = [d]U U U
R0 R0 ← O O O; R1 R1 R1 ← O O O
R0 R0 ← [2]R0 R0 R0
R0 R0 ← R0 R0 R0 + U U U
R0 R0 . . . subject to SPA
additive variant of the square-and-multiply-always Input: U U U, d = (dℓ−1, . . . , d0)2 Output: T T T = [d]U U U
R0 R0 ← O O O; R1 R1 R1 ← O O O
R0 R0 ← [2]R0 R0 R0
Rb Rb ← Rb Rb Rb + U U U
R0 R0 when b = 1, there is a dummy point addition the power trace now appears as a regular succession of doubles and adds
if an invalid ciphertext is notified (i.e., ⊥) then the error was effective ⇒ di = 1 if the result is correct then the point addition was dummy [safe error] ⇒ di = 0
e.g., only signed software can run on a given device
permanent faults in a unknown position, in any system parameter transient fault during parameter transfer
1 + 2a2x1 + a4 − a1y1
E(˜
P ˜ P ˜ P) = t is small
P ˜ P ˜ P
Ei(˜
Pi ˜ Pi ˜ Pi) = ti is small
Pi ˜ Pi ˜ Pi
d (mod ti) for several ti d by Chinese remaindering
d − ˆ
d − a4ˆ
1
d − ˆ
d − a4ˆ
1 − ˆ
1 − a4ˆ
d − ˆ
d − a4ˆ
1 − ˆ
1 − a4ˆ
1 = x3 1 + ˆ
d = ˆ
d + ˆ
memory checks, randomization, duplication, verification Shamir’s trick (redundancy) [rich] mathematical structure
for private and public parameters
e.g., d ← d + r n with n = ordE(P P P)
doubles the running time
ECDSA verification is slower than signing
Q Q Q ∈ E [h]Q Q Q = O O O
(only implies of large order)
security issue
[generalized] Mersenne prime
additive: [d]P P P = [d − r]P P P + [r]P P P multiplicative: [d]P P P = [d r −1]
P P
Write d = ⌊d/r⌋r + (d mod r) for a random r = ⇒ [d]P P P = [d mod r]P P P +
P P
Decisional tests should be avoided Inducing a random fault in the status register flips the value of the zero flag bit with a probability of 50%
1 − x3 1 − a4x1 (mod t) so that
#E(Ft) can be smooth
Input: P P P ∈ E, k Output: Q Q Q = [k]P P P In memory: {Et,Pt Pt Pt ∈ Et, nt = #Et}
1.1 Ppt Ppt Ppt ← CRT(P P P,Pt Pt Pt) and ˜ Ept ← CRT(E, Et) 1.2 Qpt Qpt Qpt ← [k]Ppt Ppt Ppt ∈ ˜ Ept
= (Xpt : Ypt : Zpt)
1.3 Qt Qt Qt ← [k (mod nt)]Pt Pt Pt ∈ Et
= (Xt : Yt : Zt)
1.4
cy ← 1 + θy(YptZt − YtZpt) (mod t) [θx, θy > t]
r cx+(2κ−r)cy)
2κ
Q Q = [γ]Qp Qp Qp (mod p) ∈ E
check that the countermeasures do not introduce new vulnerabilities
perform memory checks
prefer the splitting methods
make use of infective computation
prefer the cofactor variants
forcing-bit attack (safe-error attack): ECDSA and ECIES flipping-bit attack (sign-change fault attack): ECDSA
uller Differential fault analysis of elliptic curve cryptosystems
Sign change attacks on elliptic curve cryptosystems
On the importance of eliminating errors in cryptographic computations
Elliptic curve cryptosystems in the presence of permanent and transient faults Designs, Codes and Cryptography 36(1):33–43, 2005