18
Description of AlphaMAC Attacks on AlphaMAC Conclusion Collision Attacks on AES-based MAC: Alpha-MAC Alex Biryukov 1 , Andrey Bogdanov 2 , Dmitry Khovratovich 1 and Timo Kasper 2 1 University of Luxemburg, Luxemburg {alex.biryukov,dmitry.khovratovich}@uni.lu 2 Chair for Communication Security, Horst-G¨ ortz Institute, Ruhr-University Bochum, Germany {abogdanov,tkasper}@crypto.rub.de CHES’07, Vienna, Austria, 2007 A. Biryukov, A. Bogdanov, D. Khovratovich, T. Kasper Collision Attacks on AES-based MAC: Alpha-MAC

Collision Attacks on AES-based MAC: Alpha-MAC · Description of AlphaMAC Attacks on AlphaMAC Conclusion Collision Attacks on AES-based MAC: Alpha-MAC Alex Biryukov1, Andrey Bogdanov2,

Embed Size (px)

Citation preview

Page 1: Collision Attacks on AES-based MAC: Alpha-MAC · Description of AlphaMAC Attacks on AlphaMAC Conclusion Collision Attacks on AES-based MAC: Alpha-MAC Alex Biryukov1, Andrey Bogdanov2,

Description of AlphaMACAttacks on AlphaMAC

Conclusion

Collision Attacks on AES-based MAC:Alpha-MAC

Alex Biryukov1, Andrey Bogdanov 2, Dmitry Khovratovich1

and Timo Kasper2

1University of Luxemburg, Luxemburg{alex.biryukov,dmitry.khovratovich}@uni.lu

2Chair for Communication Security, Horst-Gortz Institute,Ruhr-University Bochum, Germany

{abogdanov,tkasper}@crypto.rub.de

CHES’07, Vienna, Austria, 2007

A. Biryukov, A. Bogdanov, D. Khovratovich, T. Kasper Collision Attacks on AES-based MAC: Alpha-MAC

Page 2: Collision Attacks on AES-based MAC: Alpha-MAC · Description of AlphaMAC Attacks on AlphaMAC Conclusion Collision Attacks on AES-based MAC: Alpha-MAC Alex Biryukov1, Andrey Bogdanov2,

Description of AlphaMACAttacks on AlphaMAC

Conclusion

Outline

1 Description of AlphaMACSpecificationMotivation

2 Attacks on AlphaMACOutline of Our AttackBasic Collision Attack on AESOur Side-Channel Collision AttacksSelective Forgery Attack

A. Biryukov, A. Bogdanov, D. Khovratovich, T. Kasper Collision Attacks on AES-based MAC: Alpha-MAC

Page 3: Collision Attacks on AES-based MAC: Alpha-MAC · Description of AlphaMAC Attacks on AlphaMAC Conclusion Collision Attacks on AES-based MAC: Alpha-MAC Alex Biryukov1, Andrey Bogdanov2,

Description of AlphaMACAttacks on AlphaMAC

Conclusion

SpecificationMotivation

AlphaMAC Specification and Notation

Full AlphaMAC One injection round

K

0

AES

Round

Round

Round

Round

AES

M1

M2

M3

Mn

· · ·

Tag

Injection

Injection

Injection

Injection

· · ·

K1

K2

K3

K4

SubBytes

ShiftRows

MixColumn

AddRoundKey

It−1 + M

t−1

It

It + M

t

Kt (M t)

A. Biryukov, A. Bogdanov, D. Khovratovich, T. Kasper Collision Attacks on AES-based MAC: Alpha-MAC

Page 4: Collision Attacks on AES-based MAC: Alpha-MAC · Description of AlphaMAC Attacks on AlphaMAC Conclusion Collision Attacks on AES-based MAC: Alpha-MAC Alex Biryukov1, Andrey Bogdanov2,

Description of AlphaMACAttacks on AlphaMAC

Conclusion

SpecificationMotivation

Attack Motivation

Practical Motivation

≈ 2.5 times faster than e.g. CBC-MAC (4 + 20/t instead of 10 rounds)

⇒ AlphaMAC can be efficiently applied in embedded systems

⇒ Interesting target for side-channel analysis

Theoretical Motivation

Improve traditional side-channel collision attacks

Exploit the existence of collisions in AlphaMAC for selective forgery

Show that the internal state has to be protected against SCA as well

A. Biryukov, A. Bogdanov, D. Khovratovich, T. Kasper Collision Attacks on AES-based MAC: Alpha-MAC

Page 5: Collision Attacks on AES-based MAC: Alpha-MAC · Description of AlphaMAC Attacks on AlphaMAC Conclusion Collision Attacks on AES-based MAC: Alpha-MAC Alex Biryukov1, Andrey Bogdanov2,

Description of AlphaMACAttacks on AlphaMAC

Conclusion

Outline of Our AttackBasic Collision Attack on AESOur Side-Channel Collision AttacksSelective Forgery Attack

General Assumptions and Attack Outline

AssumptionsKeyed AES rounds are perfectly protected against side-channel attacks

Unkeyed message injection AES rounds are not protected

Two Basic Attack Steps

Obtain the 16-byte state I1 by side-channel collision attacks

Mount a selective forgery attack using collisions in AlphaMAC

A. Biryukov, A. Bogdanov, D. Khovratovich, T. Kasper Collision Attacks on AES-based MAC: Alpha-MAC

Page 6: Collision Attacks on AES-based MAC: Alpha-MAC · Description of AlphaMAC Attacks on AlphaMAC Conclusion Collision Attacks on AES-based MAC: Alpha-MAC Alex Biryukov1, Andrey Bogdanov2,

Description of AlphaMACAttacks on AlphaMAC

Conclusion

Outline of Our AttackBasic Collision Attack on AESOur Side-Channel Collision AttacksSelective Forgery Attack

Basic Collision Attack on AES: Outline

Attack Outline (Schramm et al)

Generate random plaintexts of a special form

Perform N measurements and detect simple collisions

16 simple collisions needed(construct 16 nonlinear equations)

Solve the equations using pre-computed tables and test key candidatesusing a plaintext-ciphertext pair

A. Biryukov, A. Bogdanov, D. Khovratovich, T. Kasper Collision Attacks on AES-based MAC: Alpha-MAC

Page 7: Collision Attacks on AES-based MAC: Alpha-MAC · Description of AlphaMAC Attacks on AlphaMAC Conclusion Collision Attacks on AES-based MAC: Alpha-MAC Alex Biryukov1, Andrey Bogdanov2,

Description of AlphaMACAttacks on AlphaMAC

Conclusion

Outline of Our AttackBasic Collision Attack on AESOur Side-Channel Collision AttacksSelective Forgery Attack

Basic Attack on AES: Notation

B = MIXCOLUMN(A), A = SHIFTROWS(SUBBYTES(P ⊕ K ))

b0j

b1j

b2j

b3j

=

02 03 01 0101 02 03 0101 01 02 0303 01 01 02

×

a0j

a1j

a2j

a3j

b00

If P = (pij ) is plaintext and K = (kij) is subkey, then

b00 = 02 · a00 ⊕ 03 · a10 ⊕ 01 · a20 ⊕ 01 · a30 == 02 · S(p00 ⊕ k00) ⊕ 03 · S(p11 ⊕ k11)

⊕ 01 · S(p22 ⊕ k22) ⊕ 01 · S(p33 ⊕ k33).

A. Biryukov, A. Bogdanov, D. Khovratovich, T. Kasper Collision Attacks on AES-based MAC: Alpha-MAC

Page 8: Collision Attacks on AES-based MAC: Alpha-MAC · Description of AlphaMAC Attacks on AlphaMAC Conclusion Collision Attacks on AES-based MAC: Alpha-MAC Alex Biryukov1, Andrey Bogdanov2,

Description of AlphaMACAttacks on AlphaMAC

Conclusion

Outline of Our AttackBasic Collision Attack on AESOur Side-Channel Collision AttacksSelective Forgery Attack

Basic Attack on AES: Simple Collisions

b00 = b′00

Second round:S(b00 ⊕ k00) = S(b′

00 ⊕ k00) detected ⇒

b00 ⊕ k00 = b′

00 ⊕ k00 ⇒

b00 = b′

00

Collision equation

For two plaintexts P and P′ with p00 = p11 = p22 = p33 = δ andp′

00 = p′

11 = p′

22 = p′

33 = ǫ, δ 6= ǫ, one obtains the following, providedb00 = b′

00:02 · S(k00 ⊕ δ) ⊕ 03 · S(k11 ⊕ δ) ⊕ 01 · S(k22 ⊕ δ) ⊕ 01 · S(k33 ⊕ δ)= 02 · S(k00 ⊕ ǫ) ⊕ 03 · S(k11 ⊕ ǫ) ⊕ 01 · S(k22 ⊕ ǫ) ⊕ 01 · S(k33 ⊕ ǫ)

A. Biryukov, A. Bogdanov, D. Khovratovich, T. Kasper Collision Attacks on AES-based MAC: Alpha-MAC

Page 9: Collision Attacks on AES-based MAC: Alpha-MAC · Description of AlphaMAC Attacks on AlphaMAC Conclusion Collision Attacks on AES-based MAC: Alpha-MAC Alex Biryukov1, Andrey Bogdanov2,

Description of AlphaMACAttacks on AlphaMAC

Conclusion

Outline of Our AttackBasic Collision Attack on AESOur Side-Channel Collision AttacksSelective Forgery Attack

Basic Attack on AES: Attack Complexity

Collision probability

The probability that after N executions at least one collision b00 = b′

00 occursin a single byte is:

pN = 1 −QN−1

l=0 (1 − l/28)

ComplexityThe attacker needs at least 16 collisions, 4 for each column of B, sop16

N ≥ 1/2 and N ≈ 40

About 540 MByte pre-computed tables

Chosen-plaintext possibility needed

A. Biryukov, A. Bogdanov, D. Khovratovich, T. Kasper Collision Attacks on AES-based MAC: Alpha-MAC

Page 10: Collision Attacks on AES-based MAC: Alpha-MAC · Description of AlphaMAC Attacks on AlphaMAC Conclusion Collision Attacks on AES-based MAC: Alpha-MAC Alex Biryukov1, Andrey Bogdanov2,

Description of AlphaMACAttacks on AlphaMAC

Conclusion

Outline of Our AttackBasic Collision Attack on AESOur Side-Channel Collision AttacksSelective Forgery Attack

Our Modifications to the Standard Collision Attacks

What We Do

Several byte collisions:

Consider them as nonlinear equations over GF (28)Solve these systems by brute-force⇒ No precomputations and only negligible memory

Look for collisions in 3 injection rounds:

Instead of working with only a single roundPossible due to the fact that no entropy is introduced in theinjection roundsA lower number of measurements needed

A. Biryukov, A. Bogdanov, D. Khovratovich, T. Kasper Collision Attacks on AES-based MAC: Alpha-MAC

Page 11: Collision Attacks on AES-based MAC: Alpha-MAC · Description of AlphaMAC Attacks on AlphaMAC Conclusion Collision Attacks on AES-based MAC: Alpha-MAC Alex Biryukov1, Andrey Bogdanov2,

Description of AlphaMACAttacks on AlphaMAC

Conclusion

Outline of Our AttackBasic Collision Attack on AESOur Side-Channel Collision AttacksSelective Forgery Attack

Collisions in the Second Round

2nd Injection RoundAfter MIXCOLUMNS & message addition in the 2nd injection round:

02 ·S(i100 +m1

00)+S(i122 +m1

22)+m200 = 02 ·S(i1

00 +z100)+S(i1

22 +z122)+z2

00,

M1, Z 1, M2, Z 2 = some message blocks

After a further collision in another byte of the 0th column:

Two nonlinear equations over GF (28) with variablesi100, i1

22 ∈ GF (28).Solve them by brute-force ⇒ i1

00 and i122

Do the same for i102 and i1

20 ⇒ i102 and i1

20

A. Biryukov, A. Bogdanov, D. Khovratovich, T. Kasper Collision Attacks on AES-based MAC: Alpha-MAC

Page 12: Collision Attacks on AES-based MAC: Alpha-MAC · Description of AlphaMAC Attacks on AlphaMAC Conclusion Collision Attacks on AES-based MAC: Alpha-MAC Alex Biryukov1, Andrey Bogdanov2,

Description of AlphaMACAttacks on AlphaMAC

Conclusion

Outline of Our AttackBasic Collision Attack on AESOur Side-Channel Collision AttacksSelective Forgery Attack

Collisions in the Third Round

3rd Injection Round

A collision detected in i300 + k3

00, the following relation holds:

02 · S(03 · S(i111) + S(i1

33) + c1 + m200)

+S(S(i113) + 03 · S(i1

31) + c2 + m222) + m3

00 =

02 · S(03 · S(i111) + S(i1

33) + c′

1 + z200)

+S(S(i113) + 03 · S(i1

31) + c′

2 + z222) + z3

00

Z 2, M2, Z 3, M3 = some injected message blocksc1, c2, c′

1, c′

2 = some known constants

2 collisions in two bytes of the 0th column⇒ 03 · S(i1

11) + S(i133) and S(i1

13) + 03 · S(i131)

2 further collisions in the 2rd column⇒ 03 · S(i1

13) + S(i131) and S(i1

11) + 03 · S(i133)

These 4 relations ⇒ i111, i1

33, i113 and i1

31

A. Biryukov, A. Bogdanov, D. Khovratovich, T. Kasper Collision Attacks on AES-based MAC: Alpha-MAC

Page 13: Collision Attacks on AES-based MAC: Alpha-MAC · Description of AlphaMAC Attacks on AlphaMAC Conclusion Collision Attacks on AES-based MAC: Alpha-MAC Alex Biryukov1, Andrey Bogdanov2,

Description of AlphaMACAttacks on AlphaMAC

Conclusion

Outline of Our AttackBasic Collision Attack on AESOur Side-Channel Collision AttacksSelective Forgery Attack

Collisions in the Fourth Round

4th Injection Round

By now 8 bytes of I1 are known

The collisions equations are more complex ...

02 · S(03 · S(f2) + S(g4) + c00 + m300)+

03 · S(S(f1) + 03 · S(g3) + c10)+

S(S(g2) + 03 · S(f4) + c20 + m322)+

S(S(g1) + 03 · S(f3) + c30) + m400

=

02 · S(03 · S(f2) + S(g4) + c′

00 + z300)+

03 · S(S(f1) + 03 · S(g3) + c′

10)+

S(S(g2) + 03 · S(f4) + c′

20 + z322)+

S(S(g1) + 03 · S(f3) + c′

30) + z400

... nonetheless allowing to recover the remaining eight I1 bytes!

A. Biryukov, A. Bogdanov, D. Khovratovich, T. Kasper Collision Attacks on AES-based MAC: Alpha-MAC

Page 14: Collision Attacks on AES-based MAC: Alpha-MAC · Description of AlphaMAC Attacks on AlphaMAC Conclusion Collision Attacks on AES-based MAC: Alpha-MAC Alex Biryukov1, Andrey Bogdanov2,

Description of AlphaMACAttacks on AlphaMAC

Conclusion

Outline of Our AttackBasic Collision Attack on AESOur Side-Channel Collision AttacksSelective Forgery Attack

Side-Channel Collision Attack Properties

Success Probability, Complexity, AssumptionsOur side-channel attack works ...

... with a probability of 0.56

... for 29 known random messages (40 chosen plaintexts for AES)

... if one-byte collisions are detectable

A. Biryukov, A. Bogdanov, D. Khovratovich, T. Kasper Collision Attacks on AES-based MAC: Alpha-MAC

Page 15: Collision Attacks on AES-based MAC: Alpha-MAC · Description of AlphaMAC Attacks on AlphaMAC Conclusion Collision Attacks on AES-based MAC: Alpha-MAC Alex Biryukov1, Andrey Bogdanov2,

Description of AlphaMACAttacks on AlphaMAC

Conclusion

Outline of Our AttackBasic Collision Attack on AESOur Side-Channel Collision AttacksSelective Forgery Attack

Measurements (S-box)

Unequalarguments

Equalarguments

Power curves

0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7

x 10−5

0.2

0.22

0.24

0.26

0.28

0.3

0.32

0.34

0.36

0.38

0.4

0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7

x 10−5

0.2

0.22

0.24

0.26

0.28

0.3

0.32

0.34

0.36

0.38

0.4

Differences

0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7

x 10−5

−0.1

−0.08

−0.06

−0.04

−0.02

0

0.02

0.04

0.06

0.08

0.1

0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7

x 10−5

−0.1

−0.08

−0.06

−0.04

−0.02

0

0.02

0.04

0.06

0.08

0.1

A. Biryukov, A. Bogdanov, D. Khovratovich, T. Kasper Collision Attacks on AES-based MAC: Alpha-MAC

Page 16: Collision Attacks on AES-based MAC: Alpha-MAC · Description of AlphaMAC Attacks on AlphaMAC Conclusion Collision Attacks on AES-based MAC: Alpha-MAC Alex Biryukov1, Andrey Bogdanov2,

Description of AlphaMACAttacks on AlphaMAC

Conclusion

Outline of Our AttackBasic Collision Attack on AESOur Side-Channel Collision AttacksSelective Forgery Attack

Selective Forgery AttackFacts

Lemma 1 [DR05, FSE’05]

Given I1, the state value before iteration 1, the map

s : (M1, M2, M3, M4) → I5

from the sequence of 4 message blocks (M1, M2, M3, M4) to the state valuebefore iteration 5 is a bijection.

Lemma 2

There exists an algorithm of complexity 211 computing (M1, M2, M3, M4) fromI5 for a given initial internal state I1 (inverting s is simple!)

A. Biryukov, A. Bogdanov, D. Khovratovich, T. Kasper Collision Attacks on AES-based MAC: Alpha-MAC

Page 17: Collision Attacks on AES-based MAC: Alpha-MAC · Description of AlphaMAC Attacks on AlphaMAC Conclusion Collision Attacks on AES-based MAC: Alpha-MAC Alex Biryukov1, Andrey Bogdanov2,

Description of AlphaMACAttacks on AlphaMAC

Conclusion

Outline of Our AttackBasic Collision Attack on AESOur Side-Channel Collision AttacksSelective Forgery Attack

Selective Forgery AttackOutline

Attack StepsPreliminaries:

I1 is known,(M, σ) is a victim message-tag pair (4-byte M),M ′ is a message to authenticate (4-byte M ′)

Step 1: Compute the intermediate states I for M and I′ for M ′

Step 2: Compute the 16-byte suffix δ = s−1(I) for I′

Result: (M ′||δ, σ) is the forged message-tag pair

A. Biryukov, A. Bogdanov, D. Khovratovich, T. Kasper Collision Attacks on AES-based MAC: Alpha-MAC

Page 18: Collision Attacks on AES-based MAC: Alpha-MAC · Description of AlphaMAC Attacks on AlphaMAC Conclusion Collision Attacks on AES-based MAC: Alpha-MAC Alex Biryukov1, Andrey Bogdanov2,

Description of AlphaMACAttacks on AlphaMAC

Conclusion

Conclusions

Conclusions

New type of side-channel collision attacks(recovery of the AlphaMAC internal state):

29 measurements needed only (instead of 40)Known-message scenario (instead of selected plaintext)

Internal hash of AlphaMAC is not collision resistant

New 4-to-1 collisionsSelective forgery attack

OutlookApply the improved collision attacks (Andrey Bogdanov, SAC’07)

A. Biryukov, A. Bogdanov, D. Khovratovich, T. Kasper Collision Attacks on AES-based MAC: Alpha-MAC