Two ways of building round functions for block ciphers Joan Daemen - - PowerPoint PPT Presentation

two ways of building round functions for block ciphers
SMART_READER_LITE
LIVE PREVIEW

Two ways of building round functions for block ciphers Joan Daemen - - PowerPoint PPT Presentation

Two ways of building round functions for block ciphers Joan Daemen Radboud University ibenik summer school 2016 1 / 44 Outline 1 Block ciphers and statistical attacks 2 Correlation basics 3 Wide trail strategy: strongly-aligned flavor


slide-1
SLIDE 1

Two ways of building round functions for block ciphers

Joan Daemen

Radboud University

Šibenik summer school 2016

1 / 44

slide-2
SLIDE 2

Outline

1

Block ciphers and statistical attacks

2

Correlation basics

3

Wide trail strategy: strongly-aligned flavor

4

Wide trail strategy: weakly-aligned flavor

5

Conclusions

2 / 44

slide-3
SLIDE 3

Block ciphers and statistical attacks

Outline

1

Block ciphers and statistical attacks

2

Correlation basics

3

Wide trail strategy: strongly-aligned flavor

4

Wide trail strategy: weakly-aligned flavor

5

Conclusions

3 / 44

slide-4
SLIDE 4

Block ciphers and statistical attacks

Product cipher [Claude Shannon, 1949] and SPN

4 / 44

slide-5
SLIDE 5

Block ciphers and statistical attacks

Product cipher [Claude Shannon, 1949] and SPN

4 / 44

slide-6
SLIDE 6

Block ciphers and statistical attacks

Product cipher [Claude Shannon, 1949] and SPN

4 / 44

slide-7
SLIDE 7

Block ciphers and statistical attacks

Product cipher [Claude Shannon, 1949] and SPN

4 / 44

slide-8
SLIDE 8

Block ciphers and statistical attacks

Product cipher [Claude Shannon, 1949] and SPN

4 / 44

slide-9
SLIDE 9

Block ciphers and statistical attacks

Iterated block ciphers [DES and later]

5 / 44

slide-10
SLIDE 10

Block ciphers and statistical attacks

Statistical attacks

Exploits Distinguisher Ω over r − 1 rounds Two phases:

  • nline: get many (Ci, Pi)
  • ffline: guess ka

Wrong guess destroys Ω Basic attacks

DC: requires 1/DP couples LC: requires 1/C2 couples

Many variants …

K P C Data Key path rounds sched. rounds

6 / 44

slide-11
SLIDE 11

Block ciphers and statistical attacks

Statistical attacks

Exploits Distinguisher Ω over r − 1 rounds Two phases:

  • nline: get many (Ci, Pi)
  • ffline: guess ka

Wrong guess destroys Ω Basic attacks

DC: requires 1/DP couples LC: requires 1/C2 couples

Many variants …

P C a ka

Distinguisher

6 / 44

slide-12
SLIDE 12

Block ciphers and statistical attacks

Statistical attacks

Exploits Distinguisher Ω over r − 1 rounds Two phases:

  • nline: get many (Ci, Pi)
  • ffline: guess ka

Wrong guess destroys Ω Basic attacks

DC: requires 1/DP couples LC: requires 1/C2 couples

Many variants …

P C a ka ∆a ∆p DP(∆p, ∆a)

6 / 44

slide-13
SLIDE 13

Block ciphers and statistical attacks

Statistical attacks

Exploits Distinguisher Ω over r − 1 rounds Two phases:

  • nline: get many (Ci, Pi)
  • ffline: guess ka

Wrong guess destroys Ω Basic attacks

DC: requires 1/DP couples LC: requires 1/C2 couples

Many variants …

P C a ka ua up C2(up, ua)

6 / 44

slide-14
SLIDE 14

Block ciphers and statistical attacks

Distinguisher: difference propagation

Differential trail: DP(Q) ≈ ∏i DP(Sboxi) and w(Q) = ∑i w(Sboxi) Differential: DP(∆p, ∆a) = ∑∆p→Q→∆a DP(Q)

7 / 44

slide-15
SLIDE 15

Block ciphers and statistical attacks

Distinguisher: difference propagation

Differential trail: DP(Q) ≈ ∏i DP(Sboxi) and w(Q) = ∑i w(Sboxi) Differential: DP(∆p, ∆a) = ∑∆p→Q→∆a DP(Q)

7 / 44

slide-16
SLIDE 16

Correlation basics

Outline

1

Block ciphers and statistical attacks

2

Correlation basics

3

Wide trail strategy: strongly-aligned flavor

4

Wide trail strategy: weakly-aligned flavor

5

Conclusions

8 / 44

slide-17
SLIDE 17

Correlation basics

Boolean function

Mapping from GF(2n) to GF(2) Input is a vector x = (x1, x2, . . . xn) Algebraic expression: y = x1x2 + x1x3x4 + x2x4 + 1 Truth table: 2n bit array or vector: x1 x2 x3 x4 y x1 x2 x3 x4 y 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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

9 / 44

slide-18
SLIDE 18

Correlation basics

Correlation between two Boolean functions

C(f, g) = 2Pr (f(x) = g(x)) − 1 Real-valued counterpart of a Boolean function: ˆ f(x) = (−1)f(x) We define an inner product: < ˆ f, ˆ g >= ∑

x

ˆ f(x)ˆ g(x) …and norm ||ˆ f|| = √ < ˆ f, ˆ f > The correlation now becomes C(f, g) = < ˆ f, ˆ g > ||ˆ f|| · ||ˆ g||

10 / 44

slide-19
SLIDE 19

Correlation basics

Correlation between Boolean functions geometrically

✟✟✟✟✟✟✟✟✟✟✟ ✟ ✯ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✕

ˆ f ˆ g α C(f, g) = cos α Vector space: R2n

11 / 44

slide-20
SLIDE 20

Correlation basics

Linear functions and selection vectors

Linear Boolean function with mask w: wTx If u ̸= v: < (−1)uTx, (−1)vTx >= 0 Linear functions form an orthogonal basis of R2n x: x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 w: 1 1 1 1 wTx: x1 + x4+x5 + x8

12 / 44

slide-21
SLIDE 21

Correlation basics

Spectrum of a Boolean function

We can represent ˆ f(x) with respect to the basis of linear functions: ˆ f(x) = ∑

w

F(w)(−1)wTx with coordinates given by: F(w) = 2−n ∑

x

ˆ f(x)(−1)wTx This is called the Walsh-Hadamard transform F(w) = W(f(x)) So simply: F(w) = C(f(x), wTx) Orthogonal transformation in R2n Consequence: Parseval’s Theorem ∑ F(w)2 = 1

13 / 44

slide-22
SLIDE 22

Correlation basics

Adding Boolean functions in GF(2)

Let h(x) = f(x) + g(x)

From ˆ h(x) = ˆ f(x)ˆ g(x) follows H(w) = ∑v F(v + w)G(v)

Spectrum of sum equals convolution of spectra Special cases:

Constant function: g(x) = 1 : H(w) = −F(w) Linear function: g(x) = uTx : H(w) = F(w + u) Disjunct functions f and g : H(v + w) = F(v)G(w)

14 / 44

slide-23
SLIDE 23

Correlation basics

Multiplying Boolean functions in GF(2)

Let h(x) = f(x)g(x). Then: ˆ h(x) = 1 2 ( 1 + ˆ f(x) + ˆ g(x) − ˆ f(x)ˆ g(x) ) From this it follows W(fg) = 1 2 (δ(w) + W(f) + W(g) + W(f + g)) with δ(w) = 1 iff w = 0

15 / 44

slide-24
SLIDE 24

Correlation basics

Correlation matrices [Daemen 1994]

m-bit vector Boolean function: h(x) = (h1(x), h2(x) . . . hm(x)) Correlation matrix Ch:

2m rows and 2n columns element at row u, column v: C(uTh(x), vTx)

Homomorphism: x ⇕ L X with Xu = (−1)xTu

h

C(h) y = h(x) ⇕ L Y = C(h)X If h is permutation: C(h−1) = (C(h))

−1 = (C(h)) T

16 / 44

slide-25
SLIDE 25

Correlation basics

Correlation matrices of special functions

Adding a constant: f(x) = x + k Cu,u = (−1)uTk and Cu,v̸=u = 0 Linear function: f(x) = Mx Cu,w = 1 iff MTu = w and 0 otherwise Parallel composition: b = (b1, b2, . . .) = (h1(a1), h2(a2), . . .) = h(a) C(h)

u,w = ∏ i

C(hi)

u(i),w(i)

If wi = 0 then C(hi)

u(i),w(i) = 1

C(h)

u,w is product of correlation over active S-boxes

17 / 44

slide-26
SLIDE 26

Correlation basics

Correlation matrices: serial composition

a ⇕ L A

f

C(f) f(a) ⇕ L C(f)A

g

C(g) g(f(a)) ⇕ L C(g)C(f)A C(g◦f)(u, v) = ∑

w

C(g)(u, w)C(f)(w, v)

18 / 44

slide-27
SLIDE 27

Correlation basics

Linear trails and correlation

Linear trail: Cp(Q) = ∏i C(Sboxi) Correlation: C(uTβ(a), wTa) = ∑w→Q→u Cp(Q)

19 / 44

slide-28
SLIDE 28

Wide trail strategy: strongly-aligned flavor

Outline

1

Block ciphers and statistical attacks

2

Correlation basics

3

Wide trail strategy: strongly-aligned flavor

4

Wide trail strategy: weakly-aligned flavor

5

Conclusions

20 / 44

slide-29
SLIDE 29

Wide trail strategy: strongly-aligned flavor

Replacing the permutation in SPN by a mixing layer

21 / 44

slide-30
SLIDE 30

Wide trail strategy: strongly-aligned flavor

Replacing the permutation in SPN by a mixing layer

21 / 44

slide-31
SLIDE 31

Wide trail strategy: strongly-aligned flavor

Mixing layer criterion: Branch number B

22 / 44

slide-32
SLIDE 32

Wide trail strategy: strongly-aligned flavor

Mixing layer criterion: Branch number B

22 / 44

slide-33
SLIDE 33

Wide trail strategy: strongly-aligned flavor

Mixing layer criterion: Branch number B

22 / 44

slide-34
SLIDE 34

Wide trail strategy: strongly-aligned flavor

Mixing layer and error-correcting codes

23 / 44

slide-35
SLIDE 35

Wide trail strategy: strongly-aligned flavor

Mixing layer and error-correcting codes

23 / 44

slide-36
SLIDE 36

Wide trail strategy: strongly-aligned flavor

B active S-boxes in each sequence of 2 rounds

24 / 44

slide-37
SLIDE 37

Wide trail strategy: strongly-aligned flavor

Recursion: four-round theorem

B1 × B2 active S-boxes per 4 rounds

25 / 44

slide-38
SLIDE 38

Wide trail strategy: strongly-aligned flavor

Recursion: four-round theorem

B1 × B2 active S-boxes per 4 rounds

25 / 44

slide-39
SLIDE 39

Wide trail strategy: strongly-aligned flavor

Recursion: four-round theorem

B1 × B2 active S-boxes per 4 rounds

25 / 44

slide-40
SLIDE 40

Wide trail strategy: strongly-aligned flavor

Recursion: four-round theorem

B1 × B2 active S-boxes per 4 rounds

25 / 44

slide-41
SLIDE 41

Wide trail strategy: strongly-aligned flavor

Rijndael [Daemen, Rijmen 1998]

Trails: 25 active S-boxes per 4 rounds Clustering of trails but not alarming Costly S-box and mixing Byte-alignment leads to structural properties

26 / 44

slide-42
SLIDE 42

Wide trail strategy: weakly-aligned flavor

Outline

1

Block ciphers and statistical attacks

2

Correlation basics

3

Wide trail strategy: strongly-aligned flavor

4

Wide trail strategy: weakly-aligned flavor

5

Conclusions

27 / 44

slide-43
SLIDE 43

Wide trail strategy: weakly-aligned flavor

Some years earlier: 3-Way and BaseKing [Daemen 1993-1994]

Only bitwise instructions and shifts 4-layer round function alternated with key addition θ mixing π1 transposition 1: shifts of words γ non-linear π2 transposition 2: shifts of words Additional θ at the end Round key = cipher key ⊕ round constant Cipher and inverse same, mod round constants and word order 96-bit (3-Way) and 192-bit (BaseKing) ciphers

28 / 44

slide-44
SLIDE 44

Wide trail strategy: weakly-aligned flavor

The γ S-box

x 000 001 010 100 110 101 011 111 y 111 010 100 001 011 110 101 000

χ of Keccak, complemented: yi = xi + 1 + (xi+1 + 1)xi+2 Differentially uniform: all differentials have probability 1/4 Uniform correlation: all correlations have amplitude 1/2 Positions of non-zero correlations and differentials coincide

29 / 44

slide-45
SLIDE 45

Wide trail strategy: weakly-aligned flavor

The mixing layer θ: operates on 12-bit slices

Mθ =                    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 · 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 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 1 1 · · 1 · · · 1 1 · 1 1 1 1                   

Orthogonal: M−1

θ

= MT

θ, so differences and masks propagate same way

30 / 44

slide-46
SLIDE 46

Wide trail strategy: weakly-aligned flavor

Diffusion properties of θ

|y|\|x| 1 2 3 4 5 6 7 8 9 10 11 1

  • 12
  • 2
  • 60
  • 6
  • 3
  • 180
  • 40
  • 4
  • 255
  • 240
  • 5
  • 180
  • 600
  • 12

6

  • 60
  • 804
  • 60
  • 7

12

  • 600
  • 180
  • 8
  • 240
  • 255
  • 9
  • 40
  • 180
  • 10
  • 6
  • 60
  • 11
  • 12
  • (Hamming weight) branch number B = 8

implies a [24, 12, 8] code: the binary extended Golay code

31 / 44

slide-47
SLIDE 47

Wide trail strategy: weakly-aligned flavor

Resulting block ciphers

Two instances:

3-Way: 96-bit block and key BaseKing: 192-bit block and key

Symmetry

equivalence of differential and linear trails propagation ← same als → with order of bits permuted

Implementation

small number of operations per bit same circuit for cipher and inverse suitable for bit-slice

32 / 44

slide-48
SLIDE 48

Wide trail strategy: weakly-aligned flavor

Noekeon [Daemen, Peeters, Rijmen and Van Assche, 2000]

Block cipher

128-bit blocks 128-bit keys security claim: PRP 2−128µN

Porting of 3-Way to 128 bits See http://gro.noekeon.org/

33 / 44

slide-49
SLIDE 49

Wide trail strategy: weakly-aligned flavor

The Noekeon state

Two-dimensional 4 × ℓ array

4 rows ℓ columns

Additional partitioning of the state: slices

ℓ/4 slices

ℓ = 32

34 / 44

slide-50
SLIDE 50

Wide trail strategy: weakly-aligned flavor

Round transformation

γ: nonlinear layer

4-bit S-box operating on columns Involution

θ: combines mixing layer and round key addition

Linear 16-bit mixing layer operating on slices Involution

π: dispersion between slices

Rotation of bits within ℓ-bit rows Two instances that are each others inverse

ι: round constant addition for asymmetry

35 / 44

slide-51
SLIDE 51

Wide trail strategy: weakly-aligned flavor

The round and its inverse

Round: π2 ◦ γ ◦ π1 ◦ θ[k] Inverse round:

θ[k]−1 ◦ π−1

1

  • γ−1 ◦ π−1

2

θ[k] ◦ π2 ◦ γ ◦ π1

θ[k] as final transformation:

Regrouping: round of inverse cipher = cipher round round constants prevent involution

Noekeon: 16 rounds and a final transformation

Inverse cipher equal to cipher itself Asymmetry provided by round constants only

36 / 44

slide-52
SLIDE 52

Wide trail strategy: weakly-aligned flavor

Nonlinear layer γ

Two identical nonlinear steps with a linear step in between

37 / 44

slide-53
SLIDE 53

Wide trail strategy: weakly-aligned flavor

Mixing layer θ

High average diffusion and low cost

38 / 44

slide-54
SLIDE 54

Wide trail strategy: weakly-aligned flavor

Mixing layer θ cont’d

Branch number B only 4 due to symmetry Invariant sparse states in kernel, e.g.:

39 / 44

slide-55
SLIDE 55

Wide trail strategy: weakly-aligned flavor

Transposition steps π

π1 and π2 are each others inverses

40 / 44

slide-56
SLIDE 56

Wide trail strategy: weakly-aligned flavor

Trail bounds

Bounds on 4-round trails

Differential trails: probability ≤ 2−48 Linear trails: correlation squared ≤ 2−48

rounds over more than 11 rounds are unusable Powerful bounds thanks to

High average diffusion in θ and π Kernel addressed in γ S-box

Determining bounds:

Non-trivial exercise but one-time effort See http://gro.noekeon.org/Noekeon-spec.pdf

41 / 44

slide-57
SLIDE 57

Wide trail strategy: weakly-aligned flavor

Lightweight aspect

Round function: 5 XOR, 1 AND/OR per bit

Compare to AES: 16 XOR, 5 AND per bit

Hardware

# gates: [640 − 1050] XOR, 64 AND, 64 NOR, 128 MUX Gate delay: 7 XOR, 1 AND, 1 MUX Coprocessor architecture: speed/area trade-off

Software: e.g. numbers for ARM7:

code size 332 bytes, 44.5 cycles/byte code size 3688 bytes, 30 cycles/byte RAM usage: everything in registers

Cipher and inverse are equal: re-use of circuit and code

42 / 44

slide-58
SLIDE 58

Conclusions

Outline

1

Block ciphers and statistical attacks

2

Correlation basics

3

Wide trail strategy: strongly-aligned flavor

4

Wide trail strategy: weakly-aligned flavor

5

Conclusions

43 / 44

slide-59
SLIDE 59

Conclusions

Conclusions

Wide trail strategy is a way to design round functions Strong alignment

simple proofs for trail weights

  • ther distinguishers more likely

Weak alignment

proofs for trail weights require computer assistance

  • ther distinguishers less likely

44 / 44