21
Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary Linear and Differential Properties of S-boxes with Respect to Modular Addition Matúš Jókay Peter Špaˇ cek Pavol Zajac 1 Institute of Computer Science and Mathematics Slovak University of Technology [email protected] Central European Conference on Cryptology 2019 1 Supported by grant VEGA 1/0159/17. Matúš Jókay, Peter Špaˇ cek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 1/22

Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary

Linear and Differential Properties of S-boxeswith Respect to Modular Addition

Matúš Jókay Peter Špacek Pavol Zajac1

Institute of Computer Science and MathematicsSlovak University of Technology

[email protected]

Central European Conference on Cryptology 2019

1Supported by grant VEGA 1/0159/17.

Matúš Jókay, Peter Špacek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 1/22

Page 2: Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary

Outline

Introduction

DefinitionsD-spectrumL-spectrum

Modular affine equivalence (MAE)

Experimental resultsAll MAE classesOptimal S-boxes

Summary

Matúš Jókay, Peter Špacek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 2/22

Page 3: Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary

Introduction

S-boxes are typically studied in the context of Booleanfunctions:

• S : Fn2 → Fm

2 ,• Linear profile: Pr(aT · x = bT · S(x)).• Differential profile: Pr(S(x)⊕ S(x ⊕ δx) = δy ).• Small S-boxes can be easily characterised using affine

equivalence 2 (302 classes):

S2(x) = A1 · S1(A2 · x ⊕ b2)⊕ b1

2Leander, G., Poschmann, A.: On the classification of 4 bit S-boxes. 2007Matúš Jókay, Peter Špacek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 3/22

Page 4: Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary

Modular S-box properties

Research questionWhat properties have small bijective S-boxes with respect tomodular addition?

Research question refinementDo the modular properties depend on the quality of S-box w.r.t.standard S-box criteria?

Matúš Jókay, Peter Špacek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 4/22

Page 5: Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary

Motivation

• Alternative cipher designs:• Rotor machines: clocking can be expressed as S(x + t),

with + over some Zn• GOST, Kalyna (and others): Key addition or linear layer with

+ over some Z2n

• Theoretical generalizations of non-linearity properties3

• Attacks based on alternative4 operations5

3O Grošek, K Nemoga, L Satko: Generalized perfectly nonlinearfunctions.2000

4Calderini M., Sala M.: Elementary abelian regular subgroups as hiddensums for cryptographic trapdoors. 2017

5Civino R, Blondeau C, Sala M. Differential attacks: using alternativeoperations. 2019

Matúš Jókay, Peter Špacek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 5/22

Page 6: Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary

Notation

• We work in ring Z2n = (Z/2nZ)• Addition/subtraction: +/−• Multiplication: ax• Division: x/a = a−1x , for a with gcd(a,2) = 1• Affine permutations:

A(x) = ax + b, with gcd(a,2) = 1

Matúš Jókay, Peter Špacek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 6/22

Page 7: Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary

Differential properties

• Table of differences:

D(dx ,dy ) =∣∣{x ,S(x + dx)− S(x) = dy}

∣∣• D-spectrum: multiset {D(dx ,dy )}• D-criterium: D(S) = max{D(dx ,dy )}• Affine function: D(f ) = 2n

Matúš Jókay, Peter Špacek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 7/22

Page 8: Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary

Linear properties

• Linear approximation:

L(a,b) =∣∣{x ,S(x) = ax + b}

∣∣• L-spectrum: multiset {L(a,b)}• L-criterium: L(S) = max{L(a,b)}• Affine function: L(f ) = 2n

Matúš Jókay, Peter Špacek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 8/22

Page 9: Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary

Modular affine equivalence

To explore (modular) S-box properties, we can use (modular)affine equivalence (MAE):

S1 ≡ S2 iff A1 ◦ S1 = S2 ◦ A2

Explicitly:

∀x : S2(x) = a1 · S1(a2 · x + b2) + b1

S-box criteria L(S) and D(S) are invariant under MAE.

Matúš Jókay, Peter Špacek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 9/22

Page 10: Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary

Modular affine equivalence

• Class size: at most 24n−2

• n = 3: 58 classes• n = 4: 1277100855 classes (≈ 230)

• Representatives:• can always normalize to S(0) = 0, S(1) = 1• representative is the first S-box in lex order

Matúš Jókay, Peter Špacek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 10/22

Page 11: Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary

Modular S-box properties and affine equivalence

Research question reformulationWhat is the statistical distribution of L- and D-criterium in MAEclasses of small S-boxes?

Matúš Jókay, Peter Špacek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 11/22

Page 12: Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary

All MAE classes

Statistics of class representatives based on exhaustiveenumeration of 4-bit S-boxes:

Matúš Jókay, Peter Špacek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 12/22

Page 13: Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary

All MAE classes

Modular S-box criteria in numbers:• 30% of S-boxes: D = 4,L = 4• 95% of S-boxes: D,L ∈ {4,5}• 0.5% of S-boxes: D ≥ 8 or L ≥ 8• L = 2,D = 3: 170 classes• L = 3,D = 2: 411 classes

Matúš Jókay, Peter Špacek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 13/22

Page 14: Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary

Selected S-boxes

Selected 4-bit S-boxes from (Saarinen, 2011)6:

• D,L ∈ {3,4,5,6,7}, most of them: L = 4,D = 4• DES S5-1: D = 7, L = 4 (0.53%):

Pr(S(x + 3)− S(x) = 8) = 7/16

• GOST K8: D = 5, L = 7 (0.36%):

Pr(S(x) = 5x + 1) = 7/16

• HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%)

6Saarinen MJ. Cryptographic analysis of all 4 × 4-bit S-boxes. SAC 2011.Matúš Jókay, Peter Špacek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 14/22

Page 15: Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary

Modular S-box properties and optimal S-box classes

Research question reformulationWhat is the statistical distribution of L- and D-criterium in MAEclasses of small S-boxes?

Additional questionWhat is the statistical distribution of L- and D-criterium in caseof optimal S-boxes (in 16 optimal LA classes)?

Matúš Jókay, Peter Špacek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 15/22

Page 16: Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary

Technical note

• To explore all S-boxes in 16 optimal classes would take1303× more time than to explore all class representatives.• Our computation:

• Let Aff = {A;A(x) = A · x ⊕ c},• AffL contains reps. of aA(x) + b — 20160 permutations• AffR contains reps. of A(ax + b) — 20160 permutations• compute AffL ◦ S ◦ AffR

Matúš Jókay, Peter Špacek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 16/22

Page 17: Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary

All optimal classesG0 G1 G2 G3

G4 G5 G6 G7

G8 G9 G10 G11

G12 G13 G14 G15

• Best S-boxes have always (D,L) = (2,3), or (D,L) = (3,2)• Maximum L is 11 (G7, G9, G10, G13), or 12• Maximum D is 12 (G1, G3, G7, G9, G10, G11, G15), or 13

Matúš Jókay, Peter Špacek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 17/22

Page 18: Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary

Class G3 (finite field inverse)

• D and L in range 2 to 12• 95.75% of S-boxes with D,L ∈ {4,5}• 0.34% of S-boxes with D ≥ 8 or L ≥ 8

Matúš Jókay, Peter Špacek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 18/22

Page 19: Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary

S-box distribution within classes

Matúš Jókay, Peter Špacek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 19/22

Page 20: Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary

Summary

Experimental results summary:1. Optimal S-boxes w.r.t. standard linear and differential

cryptanalysis have similar properties w.r.t. modularaddition (with all classes and between them).

2. A small fraction of S-boxes optimal w.r.t. standard linearand differential cryptanalysis have very bad propertiesw.r.t. modular addition.

Matúš Jókay, Peter Špacek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 20/22

Page 21: Linear and Differential Properties of S-boxes with Respect ... · HAMSI, Serpent S2 (G1): D = 7, L = 3 (0.12%) 6Saarinen MJ. Cryptographic analysis of all 4 4-bit S-boxes. SAC 2011

Introduction Definitions Modular affine equivalence (MAE) Experimental results Summary

Open questions

• General theoretical analysis and good algebraicconstructions?• What about other operations, are there S-boxes good

against every approximation?• Can we break standard SL designs with bad modular

S-boxes?• Can weak modular S-boxes be used to backdoor7 cipher

designs?

7A Biryukov, L Perrin, A Udovenko: Reverse-Engineering the S-Box ofStreebog, Kuznyechik and STRIBOBr1, 2016

Matúš Jókay, Peter Špacek, Pavol Zajac, Slovak University of Technology S-boxes and Modular Addition 21/22