Key-Recovery Attacks on Keccak-Based Constructions Ling Song Joint - - PowerPoint PPT Presentation

key recovery attacks on keccak based constructions
SMART_READER_LITE
LIVE PREVIEW

Key-Recovery Attacks on Keccak-Based Constructions Ling Song Joint - - PowerPoint PPT Presentation

Key-Recovery Attacks on Keccak-Based Constructions Ling Song Joint work with Jian Guo, Danping Shi and San Ling 10 October, 2018 @ Milano, Italy Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 1 / 41 Outlines 1


slide-1
SLIDE 1

Key-Recovery Attacks on Keccak-Based Constructions

Ling Song

Joint work with Jian Guo, Danping Shi and San Ling

10 October, 2018 @ Milano, Italy

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 1 / 41

slide-2
SLIDE 2

Outlines

1

Introduction

2

Cube Attacks

3

MILP Model for Searching Cubes

4

Main Results

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 2 / 41

slide-3
SLIDE 3

Introduction

Outline

1

Introduction Keyed Keccak Constructions Our Work

2

Cube Attacks

3

MILP Model for Searching Cubes

4

Main Results

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 3 / 41

slide-4
SLIDE 4

Introduction Keyed Keccak Constructions

Keccak

Permutation-based hash function

Designed by Guido Bertoni, Joan Daemen, Michaël Peeters and Gilles Van Assche Selected as SHA-3 standard Underlying permutation: Keccak-p[1600, 24]

Keccak under keyed modes: KMAC, Keccak-MAC Its relatives

Authenticated encrytion: Keyak, Ketje Pseudorandom function: Kravatte Permutation: Xoodoo

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 3 / 41

slide-5
SLIDE 5

Introduction Keyed Keccak Constructions

Keccak-p[b, nr] Permutation

b bits: seen as a 5 × 5 array

  • f

b 25-bit lanes, A[x, y]

nr rounds each round R consists of fjve steps: R = ι ◦ χ ◦ π ◦ ρ ◦ θ χ : S-box on each row π, ρ: change the position of state bits

Slice Column Lane Row

http://www.iacr.org/authors/tikz/ Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 4 / 41

slide-6
SLIDE 6

Introduction Keyed Keccak Constructions

Keccak-p Round Function: θ

θ step: adding two columns to the current bit

C[x] =A[x, 0] ⊕ A[x, 1] ⊕ A[x, 2]⊕ A[x, 3] ⊕ A[x, 4] D[x] =C[x − 1] ⊕ (C[x + 1] ≪ 1) A[x, y] =A[x, y] ⊕ D[x]

http://keccak.noekeon.org/

The Column Parity kernel

If C[x] = 0, 0 ≤ x < 5, then the state A is in the CP kernel.

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 5 / 41

slide-7
SLIDE 7

Introduction Keyed Keccak Constructions

Keccak-p Round Function: ρ, π

ρ step: lane level rotations, A[x, y] = A[x, y] ≪ r[x, y]

http://keccak.noekeon.org/

π step: permutation on lanes, A[y, 2 ∗ x + 3 ∗ y] = A[x, y]

0,4 0,3 0,2 0,1 0,0 1,4 1,3 1,2 1,1 1,0 2,4 2,3 2,2 2,1 2,0 3,4 3,3 3,2 3,1 3,0 4,4 4,3 4,2 4,1 4,0

π

0,0 0,1 0,2 0,3 0,4 1,0 1,1 1,2 1,3 1,4 2,0 2,1 2,2 2,3 2,4 3,0 3,1 3,2 3,3 3,4 4,0 4,1 4,2 4,3 4,4

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 6 / 41

slide-8
SLIDE 8

Introduction Keyed Keccak Constructions

Keccak-p Round Function: χ

χ step: 5-bit S-boxes, nonlinear operation on rows

y0 = x0 + (x1 + 1) · x2, y1 = x1 + (x2 + 1) · x3, y2 = x2 + (x3 + 1) · x4, y3 = x3 + (x4 + 1) · x0, y4 = x4 + (x0 + 1) · x1.

x0 x1 x2 x3 x4 y0 y1 y2 y3 y4

Nonlinear term: product of two adjacent bits in a row. The algebraic degree of n rounds is 2n.

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 7 / 41

slide-9
SLIDE 9

Introduction Keyed Keccak Constructions

Keccak: Keccak-p[1600, 24] + Sponge

Sponge construction [BDPV11]

b-bit permutation f Two parameters: bitrate r, capacity c, and b = r + c.

Keccak-MAC

Take K||M as input

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 8 / 41

slide-10
SLIDE 10

Introduction Keyed Keccak Constructions

Keyed Keccak Constructions

r c f f f f f ... pad ⌊⋅⌋ L

  • utput

absorbing squeezing N||S K M||L||00 pad pad

KMAC

f pad K||Nonce σ0 f ... ... f0 pad K||Nonce f1 Z0 r ⌊⋅⌋ρ pad ... ... f Z0 M0 σ1 ... ... r f1 pad M0 pad ... ... σ0 σj f1

Keyak Ketje

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 9 / 41

slide-11
SLIDE 11

Introduction Our Work

Key Recovery Attacks

Intuition: deg(χ) = 2. Consider algebraic cryptanalsis, in paticular, cube attacks. Contributions Mixed Integer Linear Programming models for searching two types of cube attacks Best key recovery attacks on round-reduced KMAC, Keyak, Ketje and Keccak-MAC so far Solve the open problem of “Full State Keyed Duplex (Sponge)” “Whether these attacks can still be extended to more rounds by exploiting full-state absorbing remains an open question”. — the Keyak designers

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 10 / 41

slide-12
SLIDE 12

Introduction Our Work

Key Recovery Attacks

Intuition: deg(χ) = 2. Consider algebraic cryptanalsis, in paticular, cube attacks. Contributions Mixed Integer Linear Programming models for searching two types of cube attacks Best key recovery attacks on round-reduced KMAC, Keyak, Ketje and Keccak-MAC so far Solve the open problem of “Full State Keyed Duplex (Sponge)” “Whether these attacks can still be extended to more rounds by exploiting full-state absorbing remains an open question”. — the Keyak designers

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 10 / 41

slide-13
SLIDE 13

Introduction Our Work

Key Recovery Attacks

Intuition: deg(χ) = 2. Consider algebraic cryptanalsis, in paticular, cube attacks. Contributions Mixed Integer Linear Programming models for searching two types of cube attacks Best key recovery attacks on round-reduced KMAC, Keyak, Ketje and Keccak-MAC so far Solve the open problem of “Full State Keyed Duplex (Sponge)” “Whether these attacks can still be extended to more rounds by exploiting full-state absorbing remains an open question”. — the Keyak designers

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 10 / 41

slide-14
SLIDE 14

Introduction Our Work

Key Recovery Attacks

Intuition: deg(χ) = 2. Consider algebraic cryptanalsis, in paticular, cube attacks. Contributions Mixed Integer Linear Programming models for searching two types of cube attacks Best key recovery attacks on round-reduced KMAC, Keyak, Ketje and Keccak-MAC so far Solve the open problem of “Full State Keyed Duplex (Sponge)”

Ling Song, Jian Guo: Cube-Attack-Like Cryptanalysis of Round-Reduced Keccak Using

  • MILP. IACR Transactions on Symmetric Cryptology, 2018(3), 182-214.

Ling Song, Jian Guo, Danping Shi, San Ling: New MILP Modeling: Improved Conditional Cube Attacks on Keccak-based Constructions. To appear in ASIACRYPT 2018

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 11 / 41

slide-15
SLIDE 15

Cube Attacks

Outline

1

Introduction

2

Cube Attacks auxCube conCube

3

MILP Model for Searching Cubes

4

Main Results

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 12 / 41

slide-16
SLIDE 16

Cube Attacks

Cube Attacks [DS09] (Higher Order Difgerential Cryptanalysis)

Given a Boolean polynomial f(k0, ..., kn−1, v0, ..., vm−1) and a monomial tI = vi1...vid, I = {vi1, ..., vid}, f can be written as f(k0, ..., kn−1, v0, ..., vm−1) = tI · pSI + q

q contains terms that are not divisible by tI pSI is called the superpoly of I in f vi1, ..., vid are called cube variables. d is the dimension.

The the cube sum is exactly ∑

(vi1,...,vid)∈CI

f(k0, ..., kn−1, v0, ..., vm−1) = pSI Cube attacks: pSI is a linear polynomial in key bits. Cube testers: distinguish pSI from a random function. If deg(f) < d, pSI = 0

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 12 / 41

slide-17
SLIDE 17

Cube Attacks auxCube

Cube-Attack-Like Cryptanalysis [DMP+15]

Renamed auxCube

Idea: do not recover the exact linear pSI but try to limit the number (ni) of key bits involved in pSI using na auxiliary variables. Preprocessing phase Build a lookup table. The complexity is 2ni+d.

ni key bits Cube sum 00...00 01011... 00...01 11010... ... ... 11...11 10110...

Online phase Guess the value of na auxiliary variables and then query the cipher to obtain the cube sum; look up the table to recover the ni key bits. The complexity is 2na+d.

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 13 / 41

slide-18
SLIDE 18

Cube Attacks auxCube

auxCube On Keccak

k0 k1 v v a

θ ρ, π

i i

d = 64, na = 64, ni = 64, The algebraic degree of n rounds is 2n. Linearize the fjrst round by avoiding adjacent cube variables. Task of the MILP Model

1

Find 2n

1-dimensional cubes where n is as large as possible;

(attack more rounds).

2

Find balanced attacks where ni and na are close and as small as

  • possible. (low complexity).

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 14 / 41

slide-19
SLIDE 19

Cube Attacks auxCube

auxCube On Keccak

k0 k1 v v a

θ ρ, π

i i

d = 64, na = 64, ni = 64, The algebraic degree of n rounds is 2n. Linearize the fjrst round by avoiding adjacent cube variables. Task of the MILP Model

1

Find 2n−1-dimensional cubes where n is as large as possible; (attack more rounds).

2

Find balanced attacks where ni and na are close and as small as

  • possible. (low complexity).

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 14 / 41

slide-20
SLIDE 20

Cube Attacks conCube

Conditional Cube Testers of Keccak [HWX+17]

Renamed conCube

conCube Linearize the fjrst round. There exist p cube variables that are not multiplied with any cube variable even in the second round under certain conditions. Type I conCube p = 1. Given such a cube with d = 2n−1, pSI = 0 for n-round Keccak if the conditions are met. Type II conCube p = d. Given such a cube with d = 2n−2 + 1, pSI = 0 for n-round Keccak if the conditions are met.

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 15 / 41

slide-21
SLIDE 21

Cube Attacks conCube

ConCube on Keccak

If the conditions involve the key, the conditional cube can be used to recover the key. Task of the MILP Model

1

Find Type I (II) cubes with dimension 2n−1 (2n−2 + 1) where n is as large as possible; (attack more rounds).

2

The number of conditions is minimized. (low complexity).

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 16 / 41

slide-22
SLIDE 22

MILP Model for Searching Cubes

Outline

1

Introduction

2

Cube Attacks

3

MILP Model for Searching Cubes General Framework Modeling the First χ Modeling the Activeness of Column Sums

4

Main Results

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 17 / 41

slide-23
SLIDE 23

MILP Model for Searching Cubes General Framework

Mixed Integer Linear Programming

An MILP problem is of the form min cTx Ax ≥ b x ≥ 0 x ∈ Z Solvers

Gurobi, CPLEX, SCIP, ...

Application to cryptanalysis since Mouha et al.’s pioneering work [MWGP11]

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 17 / 41

slide-24
SLIDE 24

MILP Model for Searching Cubes General Framework

MILP-based Cryptanalysis

1

Defjne variables which are mostly binary for the crypto problem.

2

Identify links between the variables

3

Generate all valid patterns for the variables

4

Describe valid patterns with inequalities

5

Solve the MILP problem

1 Defjne variables 2 Identify links 3 Generate patterns 4 Describe patterns 5 Solve problems

Example: construct an MILP model for searching Type II conCubes (for FKD)

1

Modeling the fjrst

2

Modeling the activeness of column sums

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 18 / 41

slide-25
SLIDE 25

MILP Model for Searching Cubes General Framework

MILP-based Cryptanalysis

1

Defjne variables which are mostly binary for the crypto problem.

2

Identify links between the variables

3

Generate all valid patterns for the variables

4

Describe valid patterns with inequalities

5

Solve the MILP problem

1 Defjne variables 2 Identify links 3 Generate patterns 4 Describe patterns 5 Solve problems

Example: construct an MILP model for searching Type II conCubes (for FKD)

1

Modeling the fjrst χ

2

Modeling the activeness of column sums

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 18 / 41

slide-26
SLIDE 26

MILP Model for Searching Cubes Modeling the First χ

Modeling the First χ

  • 1. Defjne variables

Let a[x][y][z] be the state: a

π◦ρ◦θ

− − − → b

χ

− − − → c

π◦ρ◦θ

− − − → d

χ

− − − → e A[x][y][z] = 1 if a[x][y][z] is active, i.e., containing cube variables: A

π◦ρ◦θ

− − − → B

χ

− − − → C

π◦ρ◦θ

− − − → D

χ

− − − → E V[x][y][z] = 1 indicates that bit b[x][y][z] is constrained to the value

  • f H[x][y][z].

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 19 / 41

slide-27
SLIDE 27

MILP Model for Searching Cubes Modeling the First χ

Modeling the First χ

  • 2. Identify links: propagation of variables through χ

Observation

1

Linearize χ by avoiding adjacent variables in the input.

2

Bit 1 (0) on the left (right) of the variable helps to restrict the difgusion of variables through χ, while an unknown constant difguses the variable in an uncertain way.

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 20 / 41

slide-28
SLIDE 28

MILP Model for Searching Cubes Modeling the First χ

Modeling the First χ

  • 2. Identify links: propagation of variables through χ

Observation

1

Linearize χ by avoiding adjacent variables in the input.

2

Bit 1 (0) on the left (right) of the variable helps to restrict the difgusion of variables through χ, while an unknown constant difguses the variable in an uncertain way.

c x1 x2 c ⊕ x1 · x2

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 20 / 41

slide-29
SLIDE 29

MILP Model for Searching Cubes Modeling the First χ

Modeling the First χ

  • 2. Identify links: propagation of variables through χ

Observation

1

Linearize χ by avoiding adjacent variables in the input.

2

Bit 1 (0) on the left (right) of the variable helps to restrict the difgusion of variables through χ, while an unknown constant difguses the variable in an uncertain way.

c x1 x2 c ⊕ x1 · x2 x0 c x2 1 x0 ⊕ c · x2 c x2 1 ⊕ x0 · c

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 20 / 41

slide-30
SLIDE 30

MILP Model for Searching Cubes Modeling the First χ

Modeling the First χ

  • 3. Generate valid patterns

c[x] = b[x] + (b[x + 1] + 1) · b[x + 2]1 b[x] b[x + 1] b[x + 2] c[x] cst cst cst cst var cst * var cst cst var var (deg 1) cst 1 var cst . . . . . . . . . . . .

1Omit coordinates [y][z].

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 21 / 41

slide-31
SLIDE 31

MILP Model for Searching Cubes Modeling the First χ

Modeling the First χ

  • 3. Generate valid patterns

c[x] = b[x] + (b[x + 1] + 1) · b[x + 2]1 b[x] b[x + 1] b[x + 2] c[x] cst cst cst cst var cst * var cst cst var var (deg 1) cst 1 var cst . . . . . . . . . . . .

1Omit coordinates [y][z].

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 21 / 41

slide-32
SLIDE 32

MILP Model for Searching Cubes Modeling the First χ

Modeling the First χ

  • 3. Generate valid patterns

c[x] = b[x] + (b[x + 1] + 1) · b[x + 2]1 b[x] b[x + 1] b[x + 2] c[x] cst cst cst cst var cst * var cst cst var var (deg 1) cst 1 var cst . . . . . . . . . . . .

1Omit coordinates [y][z].

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 21 / 41

slide-33
SLIDE 33

MILP Model for Searching Cubes Modeling the First χ

Modeling the First χ

  • 3. Generate valid patterns

c[x] = b[x] + (b[x + 1] + 1) · b[x + 2]1 b[x] b[x + 1] b[x + 2] c[x] cst cst cst cst var cst * var cst cst var var (deg ≤ 1) cst 1 var cst . . . . . . . . . . . .

1Omit coordinates [y][z].

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 21 / 41

slide-34
SLIDE 34

MILP Model for Searching Cubes Modeling the First χ

Modeling the First χ

  • 3. Generate valid patterns

c[x] = b[x] + (b[x + 1] + 1) · b[x + 2]1 b[x] b[x + 1] b[x + 2] c[x] cst cst cst cst var cst * var cst cst var var (deg ≤ 1) cst 1 var cst . . . . . . . . . . . .

1Omit coordinates [y][z].

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 21 / 41

slide-35
SLIDE 35

MILP Model for Searching Cubes Modeling the First χ

Modeling the First χ

  • 3. Generate valid patterns

c[x] = b[x] + (b[x + 1] + 1) · b[x + 2]1 b[x] b[x + 1] b[x + 2] c[x] cst cst cst cst var cst * var cst cst var var (deg ≤ 1) cst 1 var cst . . . . . . . . . . . .

1Omit coordinates [y][z].

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 21 / 41

slide-36
SLIDE 36

MILP Model for Searching Cubes Modeling the First χ

Modeling the First χ

  • 3. Generate valid patterns

B[x] = { 0, b[x] is a constant; 1, b[x] is a var. V[x] = { 0, no condidtion on b[x]; 1, b[x] is restricted to 0/1.

Table: Difgusion of variables through

B x B x 1 B x 2 V x 1 V x 2 H x 1 H x 2 C x * * * * 1 * * * * 1 1 * * 1 1 1 1 * 1 1 * 1 1 * * 1 1 1 * 1 1 * 1 1 1 1 * * 1 1 1 1 * * 1

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 22 / 41

slide-37
SLIDE 37

MILP Model for Searching Cubes Modeling the First χ

Modeling the First χ

  • 3. Generate valid patterns

B[x] = { 0, b[x] is a constant; 1, b[x] is a var. V[x] = { 0, no condidtion on b[x]; 1, b[x] is restricted to 0/1.

Table: Difgusion of variables through χ

B[x] B[x + 1] B[x + 2] V[x + 1] V[x + 2] H[x + 1] H[x + 2] C[x] * * * * 1 * * * * 1 1 * * 1 1 1 1 * 1 1 * 1 1 * * 1 1 1 * 1 1 * 1 1 1 1 * * 1 1 1 1 * * 1

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 22 / 41

slide-38
SLIDE 38

MILP Model for Searching Cubes Modeling the First χ

Modeling the First χ

  • 4. Describe valid patterns with inequality

By generating the convex hull of the set of patterns [SHW+14], we get

−B[x] − B[x + 1] ≥ −1 −B[x] + C[x] ≥ 0 −B[x + 2] − V[x + 2] ≥ −1 −B[x + 1] − V[x + 1] ≥ −1 −B[x] − B[x + 1] − H[x + 2] + C[x] ≥ −1 B[x] − V[x + 1] − H[x + 1] − C[x] ≥ −2 B[x] − V[x + 2] + H[x + 2] − C[x] ≥ −1 B[x] + B[x + 1] + B[x + 2] − C[x] ≥ 0 −B[x + 1] − B[x + 2] + V[x + 1] + V[x + 2] + C[x] ≥ 0 −B[x + 1] − B[x + 2] + V[x + 2] + H[x + 1] + C[x] ≥ 0

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 23 / 41

slide-39
SLIDE 39

MILP Model for Searching Cubes Modeling the Activeness of Column Sums

Modeling the Activeness of Column Sums

  • 1. Defjne variables

For the state a

π◦ρ◦θ

− − − → b

χ

− − − → c

π◦ρ◦θ

− − − → d

χ

− − − → e Column sums before χ: g1[x][z] = ∑

y b[x][y][z]

Column sums after χ: g2[x][z] = ∑

y c[x][y][z]

Variables for the activeness G1[x][z] = 1 if g1[x][z] is active. G2[x][z] = 1 if g2[x][z] is active. In which case G2[x][z]=0?

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 24 / 41

slide-40
SLIDE 40

MILP Model for Searching Cubes Modeling the Activeness of Column Sums

Modeling the Activeness of Column Sums

  • 2. Identify links for G2[x][z]

b[x] + (b[x + 1] + 1) · b[x + 2] = c[x]

cst2 cst1 v0 v0 cst0 = g1[x][z] G1[x][z] = 0

+

+1 v1 v1 cst5 cst4 cst3 = g1[x + 1][z] G1[x + 1][z] = 0

·

cst7 cst6

v2 + v3

v3 v2 = g1[x + 2][z] G1[x + 2][z] = 0

=

cst2 + (v1 + 1) · cst7 cst1 + (v1 + 1) · cst6 v0 + (cst5 + 1) · (v2 + v3) v0 + (cst4 + 1) · v3 cst0 + (cst3 + 1) · v2 = g2[x][z] G2[x][z] =? (1, v, 0, ∗, ∗) (1, v, 0, v, 0)

Cond1: G1[x][z] must be 0. I am an empty new line. No variable in column (x + 1, z) of b

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 25 / 41

slide-41
SLIDE 41

MILP Model for Searching Cubes Modeling the Activeness of Column Sums

Modeling the Activeness of Column Sums

  • 2. Identify links for G2[x][z]

b[x] + (b[x + 1] + 1) · b[x + 2] = c[x]

cst2 cst1 v0 v0 cst0 = g1[x][z] G1[x][z] = 0

+

+1 v1 v1 cst5 cst4 cst3 = g1[x + 1][z] G1[x + 1][z] = 0

·

v2 + v3

v3 v2 = g1[x + 2][z] G1[x + 2][z] = 0

=

cst2 cst1 v0 + (cst5 + 1) · (v2 + v3) v0 + (cst4 + 1) · v3 cst0 + (cst3 + 1) · v2 = g2[x][z] G2[x][z] =? (1, v, 0, ∗, ∗) (1, v, 0, v, 0)

Cond2: No variable in column (x + 1, z) of b propagates to column (x, z) of c.

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 26 / 41

slide-42
SLIDE 42

MILP Model for Searching Cubes Modeling the Activeness of Column Sums

Modeling the Activeness of Column Sums

  • 2. Identify links for G2[x][z]

b[x] + (b[x + 1] + 1) · b[x + 2] = c[x]

cst2 cst1 v0 v0 cst0 = g1[x][z] G1[x][z] = 0

+

cst5 cst4 cst3 +1 v1 v1 1 1 1 = g1[x + 1][z] G1[x + 1][z] = 0

·

v2 + v3

v3 v2 = g1[x + 2][z] G1[x + 2][z] = 0

=

v0 + (cst5 + 1) · (v2 + v3) v0 + (cst4 + 1) · v3 cst0 + (cst3 + 1) · v2 cst2 cst1 v0 v0 cst0 = g2[x][z] G2[x][z] = 0 (1, v, 0, ∗, ∗) (1, v, 0, v, 0)

Cond3.1: No variable in column (x + 2) of b propagates to column (x, z) of c.

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 27 / 41

slide-43
SLIDE 43

MILP Model for Searching Cubes Modeling the Activeness of Column Sums

Modeling the Activeness of Column Sums

  • 2. Identify links for G2[x][z]

b[x] + (b[x + 1] + 1) · b[x + 2] = c[x]

cst2 cst1 v0 v0 cst0 = g1[x][z] G1[x][z] = 0

+

+1 v1 v1 = g1[x + 1][z] G1[x + 1][z] = 0

·

cst5 cst4 cst3

v2 + v3

v3 v2 = g1[x + 2][z] G1[x + 2][z] = 0

=

v0 + (cst5 + 1) · (v2 + v3) v0 + (cst4 + 1) · v3 cst0 + (cst3 + 1) · v2 cst2 cst1 v0 + v2 + v3 v0 + v3 cst0 + v2 = g2[x][z] G2[x][z] = 0 (1, v, 0, ∗, ∗) (1, v, 0, v, 0)

Cond3.2: All the variables in column (x + 2) of b propagate to column (x, z) of c and G1[x + 2][z] = 0.

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 28 / 41

slide-44
SLIDE 44

MILP Model for Searching Cubes Modeling the Activeness of Column Sums

Modeling the Activeness of Column Sums

  • 2. Identify links for G2[x][z]

Condition for G2[x][z] = 0 Cond1 ∧ Cond2 ∧ (Cond3.1 ∨ Cond3.2) ⇒ Model each part individually.

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 29 / 41

slide-45
SLIDE 45

MILP Model for Searching Cubes Modeling the Activeness of Column Sums

Modeling the Activeness of Column Sums

  • 2. Identify links for G2[x][z]

Condition for G2[x][z] = 0 Cond1 ∧ Cond2 ∧ (Cond3.1 ∨ Cond3.2) ⇒ Model each part individually.

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 30 / 41

slide-46
SLIDE 46

MILP Model for Searching Cubes Modeling the Activeness of Column Sums

Model for Cond1

G1[x][z] together with F[x][z] describe a column before χ.

1

The column is not active, i.e., there is no variable;

2

The column is active and the column sum is active;

3

The column is active and the column sum is inactive.

cst4 cst3 cst2 cst1 cst0 G1[x][z] = 0 F[x][z] = 0 (1) cst2 cst1 v0 v0 cst0 G1[x][z] = 0 F[x][z] = 1 (2) cst1 cst0 v2 v1 v0 G1[x][z] = 1 F[x][z] = 0 (3)

The patterns of B x y z y 4 and F x z , G1 x z fall into a set of 58 discrete points in

7.

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 31 / 41

slide-47
SLIDE 47

MILP Model for Searching Cubes Modeling the Activeness of Column Sums

Model for Cond1

G1[x][z] together with F[x][z] describe a column before χ.

1

The column is not active, i.e., there is no variable;

2

The column is active and the column sum is active;

3

The column is active and the column sum is inactive.

cst4 cst3 cst2 cst1 cst0 G1[x][z] = 0 F[x][z] = 0 (1) cst2 cst1 v0 v0 cst0 G1[x][z] = 0 F[x][z] = 1 (2) cst1 cst0 v2 v1 v0 G1[x][z] = 1 F[x][z] = 0 (3)

The patterns of B[x][y][z], y = 0, · · · , 4 and F[x][z], G1[x][z] fall into a set of 58 discrete points in R7.

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 31 / 41

slide-48
SLIDE 48

MILP Model for Searching Cubes Modeling the Activeness of Column Sums

Model for Cond1

Table: Inequalities modeling the activeness of a column

−F[x][z] − G1[x][z] ≥ −1 −B[x][0][z] + F[x][z] + G1[x][z] ≥ 0 −B[x][1][z] + F[x][z] + G1[x][z] ≥ 0 −B[x][2][z] + F[x][z] + G1[x][z] ≥ 0 −B[x][3][z] + F[x][z] + G1[x][z] ≥ 0 −B[x][4][z] + F[x][z] + G1[x][z] ≥ 0 ∑

y

B[x][y][z] − 2F[x][z] − G1[x][z] ≥ 0

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 32 / 41

slide-49
SLIDE 49

MILP Model for Searching Cubes Modeling the Activeness of Column Sums

Modeling the Activeness of Column Sums

  • 2. Identify links for G2[x][z]

Condition for G2[x][z] = 0 Cond1 ∧ Cond2 ∧ (Cond3.1 ∨ Cond3.2) ⇒ Model each part individually.

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 33 / 41

slide-50
SLIDE 50

MILP Model for Searching Cubes Modeling the Activeness of Column Sums

Model for Cond2

Variables

  • Cond2 ↔ M[x][z] = 0
  • P[x][y][z] = 1 if the variable at (x + 1, y, z) is propagated to (x, y, z)

uncertainly. Inequalities

M[x][z] − P[x][y][z] ≥ 0, y = 0, · · · , 4. ∑

y

P[x][y][z] − M[x][z] ≥ 0. P[x] B[x + 1] V[x + 2] inequalities * −P[x] + B[x + 1] ≥ 0 1 1 −P[x] − V[x + 2] ≥ −1 1 1 P[x] − B[x + 1] + V[x + 2] ≥ 0

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 34 / 41

slide-51
SLIDE 51

MILP Model for Searching Cubes Modeling the Activeness of Column Sums

Modeling the Activeness of Column Sums

  • 2. Identify links for G2[x][z]

Condition for G2[x][z] = 0 Cond1 ∧ Cond2 ∧ (Cond3.1 ∨ Cond3.2) ⇒ See the paper.

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 35 / 41

slide-52
SLIDE 52

MILP Model for Searching Cubes Modeling the Activeness of Column Sums

The Full Model

Objective min ∑ V[x][y][z] Linear constraints Dimension ∑ B[x][y][z] − ∑ F[x][z] = 2n−2 + 1 Other inequalities

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 36 / 41

slide-53
SLIDE 53

Main Results

Outline

1

Introduction

2

Cube Attacks

3

MILP Model for Searching Cubes

4

Main Results Conclusion

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 37 / 41

slide-54
SLIDE 54

Main Results

Results of Key Recovery Attacks

First analytical results on KMAC Improve the attack against Lake Keyak (128) from 6 to 8 rounds in the NR setting, and attack 9 rounds if the key size is 256 bits. Solve the FKD open problem

Target |K| c Rounds Time Reference Type KMAC128 128 256 7/24 276 this conCube KMAC256 256 512 9/24 2147 this Target |K| NR Rounds Time Reference Type Lake Keyak 128 Yes 6/12 237 [DMP+15] cube 128 No 8/12 274 [HWX+17] conCube 128 Yes 8/12 271.01 this conCube 256 Yes 9/14 2137.05 this River Keyak 128 Yes 8/12 277 this FKD[1600] 128 No 9/- 290 this

NR: nonce-respected Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 37 / 41

slide-55
SLIDE 55

Main Results

Attack complexity improvements on Ketje Target |K| Rounds T M Reference Type Ketje Major 128 7/13 283

  • [LBD+17]

conCube 128 7/13 271.24

  • this

Ketje Minor 128 7/13 281

  • [LBD+17]

128 7/13 273.03

  • this

Ketje Sr V1 128 7/13 2115 250 [DMP+15] auxCube 128 7/13 291

  • this

conCube Ketje Sr V2 128 7/13 2113.58 248 [DLWQ17] auxCube 128 7/13 299 233 this Ketje Jr V1 96 5/13 256 238 [DLWQ17] 96 5/13 236.86 218 this 72 6/13 268.04 234 this Ketje Jr V2 96 5/13 250.32 232 [DLWQ17] 96 5/13 234.91 215 this 80 6/13 259.17 225 this Xoodoo 128 6/- 289 255 this

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 38 / 41

slide-56
SLIDE 56

Main Results

Attacks on Keccak-MAC Target |K| c Rounds Time Reference Type Keccak-MAC 128 256/512 7/24 272 [HWX+17] conCube 768 7/24 275 [LBD+17] 1024 6/24 258.3 1024 6/24 240 this 1024 7/24 2111 this auxCube

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 39 / 41

slide-57
SLIDE 57

Main Results

Comparison of auxCube and conCube

auxCube conCube Model 1 round, simple 2 rounds, complex Degree of freedom When DF is small, e.g. Ketje When DF is large, e.g. FKD Fully unknown inter- nal state No Yes, e.g. KMAC, FKD Memory Non-negligible Negligible

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 40 / 41

slide-58
SLIDE 58

Main Results Conclusion

Conclusion

1

Two MILP models for searching cubes for Keccak.

2

First attacks on KMAC and Xoodoo, and improved attacks on Keyak and Ketje.

3

Solve the FKD open problem.

4

The security of Keccak-based constructions is far from being threatened.

Thank you for your attention!

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 41 / 41

slide-59
SLIDE 59

Main Results Conclusion

Conclusion

1

Two MILP models for searching cubes for Keccak.

2

First attacks on KMAC and Xoodoo, and improved attacks on Keyak and Ketje.

3

Solve the FKD open problem.

4

The security of Keccak-based constructions is far from being threatened.

Thank you for your attention!

Ling Song Key-Recovery Attacks on Keccak-Based Constructions Milano, Italy 41 / 41