Block cipher invariants as eigenvectors of correlation matrices Tim - - PowerPoint PPT Presentation

block cipher invariants
SMART_READER_LITE
LIVE PREVIEW

Block cipher invariants as eigenvectors of correlation matrices Tim - - PowerPoint PPT Presentation

Block cipher invariants as eigenvectors of correlation matrices Tim Beyne COSIC / ESAT, KULeuven December 3, 2018 COSIC Joan Daemen 2 Joan Daemen 2 Invariant subspaces and nonlinear invariants [Leander et al., 2011] x y E K K is a weak


slide-1
SLIDE 1

Block cipher invariants

as eigenvectors of correlation matrices

Tim Beyne

COSIC / ESAT, KULeuven

December 3, 2018

COSIC

slide-2
SLIDE 2

Joan Daemen

2

slide-3
SLIDE 3

Joan Daemen

2

slide-4
SLIDE 4

Invariant subspaces and nonlinear invariants

[Leander et al., 2011]

Fn

2

a + V x Fn

2

a + V y EK K is a weak key

3

slide-5
SLIDE 5

Invariant subspaces and nonlinear invariants

[Todo et al., 2016]

Fn

2

S x Fn

2

S y EK1

  • r

Fn

2

S x Fn

2

S y EK2

4

slide-6
SLIDE 6

Three problems

  • 1. Improve understanding (theory)
  • 2. Invariants which are not invariant under the round function
  • 3. Attacks based on invariants that work for all round constants
  • cf. [Beierle et al., 2017]

5

slide-7
SLIDE 7

Representing the state

F4

2

{(0, 1)⊤, (1, 0)⊤}

x p(x)     1/2 1/2     ← → ← → x p x

6

slide-8
SLIDE 8

Representing the state

F4

2

{(0, 1)⊤, (1, 0)⊤}

x p(x)     1/2 1/2     ← → ← → F4

2

{(0, 1)⊤, (1, 0)⊤}

x p(x)     −1/4 1/4 1/4 −1/4     ← → ← →

6

slide-9
SLIDE 9

Operations on the state

0 0 1 0

0 0 0 1 1 0 0 0 0 1 0 0

  • · 1

2 1 1

  • = 1

2

1

1

  • x

p(x) y q(y) u

  • p(u)

v

  • q(v)

1 0 0

0 1 0 0 0 −1 0 0 0 0 −1

  • 1

−1

  • =

1

1

  • y = x + c

(1, 0)⊤ F F

7

slide-10
SLIDE 10

Operations on the state

0 0 1 0

0 0 0 1 1 0 0 0 0 1 0 0

  • · 1

2 1 1

  • = 1

2

1

1

  • x

p(x) y q(y) u

  • p(u)

v

  • q(v)

1 0 0

0 1 0 0 0 −1 0 0 0 0 −1

  • 1

−1

  • =

1

1

  • y = x + c

(1, 0)⊤ F F

7

slide-11
SLIDE 11

Operations on the state

0 0 1 0

0 0 0 1 1 0 0 0 0 1 0 0

  • · 1

2 1 1

  • = 1

2

1

1

  • x

p(x) y q(y) u

  • p(u)

v

  • q(v)

1 0 0

0 1 0 0 0 −1 0 0 0 0 −1

  • 1

−1

  • =

1

1

  • y = x + c

(1, 0)⊤ F F

7

slide-12
SLIDE 12

Operations on the state

  T F    p   =  q   x p(x) y q(y) u

  • p(u)

v

  • q(v)

  CF     p   =   q   Correlation matrix F y = F(x) y = F(G(x)) F F F

8

slide-13
SLIDE 13

Operations on the state

  T FT G    p   =  q   x p(x) y q(y) u

  • p(u)

v

  • q(v)

  CFCG     p   =   q   Correlation matrix F ◦ G y = F(x) y = F(G(x)) F ◦ G F F

8

slide-14
SLIDE 14

Eigenvectors of correlation matrices

u

  • p(u)

u CEK p(u) u CEK p(u) EK

  • r

CEK p p The invariants of a block cipher EK are the eigenvectors of CEK .

9

slide-15
SLIDE 15

Eigenvectors of correlation matrices

u

  • p(u)

u CEK p(u) u CEK p(u) EK

  • r

  CEK     p   = λ   p   The invariants of a block cipher EK are the eigenvectors of CEK .

9

slide-16
SLIDE 16

Rank one states in Midori-64

x1 x5 x9 x13 x2 x6 x10 x14 x3 x7 x11 x15 x4 x8 x12 x16 Midori-64 state ∈ R264 ∼ = (R24)⊗16 Independence: p(x1, x2, . . . , x16) =

16

  • i=1

pi(xi) Equivalently: p =

16

  • i=1

pi

  • r
  • p =

16

  • i=1
  • pi

10

slide-17
SLIDE 17

Overview of Midori-64

K0 + K1 R1 K0 R2 K1 . . . R15 K0 S K0 + K1 S P M K1 γ2

11

slide-18
SLIDE 18

Overview of Midori-64

K0 + K1 R1 K0 R2 K1 . . . R15 K0 S K0 + K1 S P M K1 γ2

11

slide-19
SLIDE 19

Key addition

Correlation matrix for addition of K = (k1, k2, . . . , kn) ∈ Fn

2:

     1 · · · (−1)k1 · · · . . . . . . ... . . . · · · (−1)

n

i=1 ki

     =

n

  • i=1

1 (−1)ki

  • 12
slide-20
SLIDE 20

Boxed mappings

  • q1 = CS

p1

CS = (CS)⊗16

⊗16

i=13

qi = CM ⊗16

i=13

pi

  • CM = (CM)⊗4

x1 x5 x9 x13 x2 x6 x10 x14 x3 x7 x11 x15 x4 x8 x12 x16

13

slide-21
SLIDE 21

Three problems

  • 1. Improve understanding (theory)

eigenvectors of correlation matrices

  • 2. Invariants which are not invariant under the round function
  • 3. Attacks based on invariants that work for all round constants

14

slide-22
SLIDE 22

Invariants in the intersection of eigenspaces

◮ We want to solve CEK v = λ v ◮ To simplify things, let’s assume v = w⊗16 ◮ Require invariance under S, M and key addition: (CS)⊗16 w⊗16 = λ1 w⊗16 (CM)⊗4 w⊗16 = λ2 w⊗16 CKi+γi w⊗16 = λ3 w⊗16 → Invariants from [Guo et al., 2016, Todo et al., 2016].

15

slide-23
SLIDE 23

Somewhat more general invariants

· · · M ◦ P ◦ S M ◦ P ◦ S · · · K1 ⊕ γi−1 K0 ⊕ γi K1 ⊕ γi+1 u⊗16 → v⊗16 → u⊗16 CSu = v CMu⊗4 = u⊗4, CMv⊗4 = v⊗4 Most important solution: (Perfect linear approximation) u v

16

slide-24
SLIDE 24

Somewhat more general invariants

· · · M ◦ P ◦ S M ◦ P ◦ S · · · K1 ⊕ γi−1 K0 ⊕ γi K1 ⊕ γi+1 u⊗16 → v⊗16 → u⊗16 CSu = v CMu⊗4 = u⊗4, CMv⊗4 = v⊗4 Most important solution: (Perfect linear approximation) u = (0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)⊤ v = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, −1, −1, 0, 0, 1, −1)⊤/2

16

slide-25
SLIDE 25

Midori-64 round constants

Midori-64 0001 0101 1011 0011 0111 1000 1100 0000 1010 0100 0011 0101 0110 0010 0001 0011 0001 0000 0100 1111 1101 0001 0111 0000 0000 0010 0110 0110 0000 1011 1100 1100 1001 0100 1000 0001 0100 0000 1011 1000 · · · → 264 weak keys

17

slide-26
SLIDE 26

Midori-64 round constants

Midori-64 0001 0101 1011 0011 0111 1000 1100 0000 1010 0100 0011 0101 0110 0010 0001 0011 0001 0000 0100 1111 1101 0001 0111 0000 0000 0010 0110 0110 0000 1011 1100 1100 1001 0100 1000 0001 0100 0000 1011 1000 · · · → 264 weak keys “Almost” Midori-64 0008 0808 8088 0088 0888 8000 8800 0000 8080 0800 0088 0808 0880 0080 0008 0088 0008 0000 0800 8888 8808 0008 0888 0000 0000 0080 0880 0880 0000 8088 8800 8800 8008 0800 8000 0008 0800 0000 8088 8000 · · · → 296.02 weak keys

17

slide-27
SLIDE 27

Midori-64 round constants

Midori-64 0001 0101 1011 0011 0111 1000 1100 0000 1010 0100 0011 0101 0110 0010 0001 0011 0001 0000 0100 1111 1101 0001 0111 0000 0000 0010 0110 0110 0000 1011 1100 1100 1001 0100 1000 0001 0100 0000 1011 1000 · · · → 264 weak keys “Almost” Midori-64 082a 2888 028a 0a80 01cc 510f 2b77 349a 0280 880a a22a 8a2a a374 8d6a dd67 62eb 0a80 822a 80a2 0a82 6182 5031 b4ed 0c0d 8028 a888 0aa2 a202 410d 5161 db17 8b17 0aa0 a088 0088 2a22 0a64 c6cf ee81 14a4 · · · → 296 weak keys

17

slide-28
SLIDE 28

Three problems

  • 1. Improve understanding (theory)

eigenvectors of correlation matrices

  • 2. Invariants which are not invariant under the round function

real-world example: modifjed Midori-64

  • 3. Attacks based on invariants that work for all round constants

18

slide-29
SLIDE 29

Attacks on Midori-64 and MANTIS

◮ Independent of the round constants ◮ 10 rounds of Midori-64

◮ 296 (out of 2128) weak keys ◮ ∼ 1.25 · 221 chosen plaintexts

◮ MANTIS-4

◮ 232 (out of 264) weak tweaks ◮ ∼ 640 chosen plaintexts

Both attacks: block cipher calls, but

bits of the key almost for free Guess the remaining bits (no optimizations)

19

slide-30
SLIDE 30

Attacks on Midori-64 and MANTIS

◮ Independent of the round constants ◮ 10 rounds of Midori-64

◮ 296 (out of 2128) weak keys ◮ ∼ 1.25 · 221 chosen plaintexts

◮ MANTIS-4

◮ 232 (out of 264) weak tweaks ◮ ∼ 640 chosen plaintexts

◮ Both attacks: 256 block cipher calls, but

◮ 40 + 32 bits of the key almost for free ◮ Guess the remaining 56 bits (no optimizations)

19

slide-31
SLIDE 31

Attack on 10 rounds of Midori-64

R1 R2 R3 R4 R5 R6 R7 R8 R9 S K0 ≃ γ7 K0 + K1 K0 + K1 Integral property f (x) = 16

i=1 fi(x4i−3, x4i−2, x4i−1, x4i)

with fi balanced g(x) = 16

i=1 gi(x4i−3, . . . , x4i)

I1 A1 C C C C A2 C C C C A3 C C C C A4 I2 A A A A A A A A A A A A A A A A

  • x∈I2

f (x) = 0

20

slide-32
SLIDE 32

Attack on 10 rounds of Midori-64

R1 R2 R3 R4 R5 R6 R7 R8 R9 S K0 ≃ γ7 K0 + K1 K0 + K1 Integral property f (x) = 16

i=1 fi(x4i−3, x4i−2, x4i−1, x4i)

with fi balanced g(x) = 16

i=1 gi(x4i−3, . . . , x4i)

I1 A1 C C C C A2 C C C C A3 C C C C A4 I2 A A A A A A A A A A A A A A A A

  • x∈I2

f (x) = 0 ⇒

  • x∈EK(I1)

g(x) = 0

20

slide-33
SLIDE 33

Attack on 10 rounds of Midori-64

R1 R2 R3 R4 R5 R6 R7 R8 R9 S K0 ≃ γ7 K0 + K1 K0 + K1 Integral property f (x) = 16

i=1 fi(x4i−3, x4i−2, x4i−1, x4i)

with fi balanced g(x) = 16

i=1 gi(x4i−3, . . . , x4i)

I1 A1 C C C C A2 C C C C A3 C C C C A4 I2 A A A A A A A A A A A A A A A A

  • x∈I2

f (x) = 0 ⇒

  • x∈EK(I1)

g(x+K0+K1) = 0

20

slide-34
SLIDE 34

Conclusions

  • 1. Improve understanding (theory)

eigenvectors of correlation matrices

  • 2. Invariants which are not invariant under the round function

real-world example: modifjed Midori-64

  • 3. Attacks based on invariants that work for all round constants

attacks on 10 rounds of Midori-64 and on MANTIS-4 More to explore: ◮ “statistical variant” (part of my master’s thesis) ◮ complex eigenvalues / partitioning ◮ improving the attacks

  • https://homes.esat.kuleuven.be/~tbeyne/
  • tim.beyne@student.kuleuven.be

21