V E N K A T E S H R A M A M O O R T H Y , M A R I U S C . S I L A G H I , T O S H I H I R O M A T S U I , K A T S U T O S H I H I R A Y A M A , a n d M A K O T O Y O K O O
The Design of Cryptographic S-Boxes using CSPs
1
The Design of Cryptographic S-Boxes using CSPs 1 V E N K A T E S H - - PowerPoint PPT Presentation
The Design of Cryptographic S-Boxes using CSPs 1 V E N K A T E S H R A M A M O O R T H Y , M A R I U S C . S I L A G H I , T O S H I H I R O M A T S U I , K A T S U T O S H I H I R A Y A M A , a n d M A K O T O Y O K O O
V E N K A T E S H R A M A M O O R T H Y , M A R I U S C . S I L A G H I , T O S H I H I R O M A T S U I , K A T S U T O S H I H I R A Y A M A , a n d M A K O T O Y O K O O
1
Proposed by Claude Shannon
[1948].
All Feistel Ciphers
Data Encryption Standard, 3-DES Blowfish, Twofish, Camellia, RC5
Advanced Encryption Standard International Data Encryption
Algorithm (IDEA)
Linear Permutations – Diffusion Nonlinear Substitution – Confusion
(S-Boxes)
2
S-P Network
Invertible substitution Permutation Feistel F function needs not be invertible. Any F leads to a “sound” cipher. Needs more rounds
3
S(L,R) L F(R),R S 1(L',R') L' F(R'),R'
The eight S-Boxes Expansion
4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 13 2 8 4 6 15 11 1 10 9 3 14 5 12 7 1 1 15 13 8 10 3 7 4 12 5 6 11 14 9 2 2 7 11 4 1 9 12 14 2 6 10 13 15 3 5 8 3 2 1 14 7 4 10 8 13 15 12 9 3 5 6 11
5
Early Feistel cipher (Lucifer) weakness found [„74] [DES;76]
not new in 1993, but had been classified [Coppersmith; 1994] still somewhat successful on DES because its avoidance
we model it as a CSP!
A more efficient exploit of the same weaknesses (with minor
Same avoidance strategy (hard combinatorial design problem)
6
The Criteria labeled S-1 to S-7, are stated as follows
S-1: Each S-box has six bits of input and four bits of output
S-2: No output bit of an S-box should be close to a linear function of the input bits.
S-3: If we fix the leftmost and rightmost input bits of the S-box and vary the four middle bits, each possible 4-bit output is attained exactly once as the middle four input bits range over their 16 possibilities.
S-4: If two inputs to an S-box differ in exactly one bit, the outputs must differ in at least two bits. (Avalanche)
S-5: If two inputs to an S-box differ in the two middle bits exactly, the outputs must differ in at least two bits
S-6: If two inputs to an S-box differ in their first two bits and are identical in their last two bits, the two outputs must not be the same
S-7: For any nonzero 6-bit difference between inputs, ΔIi,j, no more than eight of the 32 pairs of inputs exhibiting ΔIi,j may result in the same output difference ΔOi,j.
7
They form the only nonlinear operation in an encryption
Each successful linearization approximation can help break a
Toy instances solved fast, but not real world instances
They did not find the “strongest” S-boxes as we illustrate using CSPs
8
Example: 3-DES
Example: GF2k Inversion (AES), Bent Functions
Using Genetic Algorithms (with Hill Climbing and Simulated
Capturing randomness from security protocols, keys [2008] Using Cellular Automata [2010]
9
Set of variables: Domains (identical): The constraints model the security criteria Any solution to the CSP can be used as an S-Box Security to known attacks optimized with a soft constraint An assignment of a value from D to a variable xi
in X Represents the S-Box output for input i In the sample 3-DES S-Box S8, for example, x44 = 14
m
10
n input bits 2n variables. m output bits domain size 2m. 11
Gives rise to Matsui‟s quality metric of an S-Box Linearization Effectiveness:
X( )
X – a set of variables Φ – the S-box function (assignment to variables in X)
some linear function “=“ selected outputs (for all inputs) some linear function “≠“ selected outputs (for all inputs)
any linear function “=“ selected outputs (for half of inputs)
12
Take the function : {0,1} × {0,1}
Count the number of linearization hits: Function Φ(x0,x1)1,0,1,1 has score
X( ) = 1
x0 x1 y0 1 1 1 1 1 1 1 a0 a1 x=00 x=01 x=10 x=11 # #-22/2 score 0≠1 0=0 0≠1 0≠1 1
1 1 0≠1 1≠0 0≠1 1=1 1
1 1 0≠1 0=0 1=1 1=1 3 1 1 1 1 0≠1 1≠0 1=1 0≠1 1
1
2
13
X( ) ≤
14
S-3: If we fix the leftmost and rightmost input bits of the S-box and
vary the four middle bits, each possible 4-bit output is attained exactly
AllDiff(x0, x2, …, x28,x30), AllDiff(x1, x3, …, x29, x31), AllDiff(x32, x34, …, x60,x62), AllDiff(x33, x35, …, x61, x63)
16
17
( i,j) 0 ≤ i,j < 64 |i ≠ j| |i j| = 0011002
wt(xi xj) ≥ 2
18
( i,j) 0 ≤ i<j < 64 (|i j| 1100112) = 1100002
xi ≠ xj
19
S-7: For any nonzero 6-bit difference between inputs, ΔIi,j, no more
than eight of the 32 pairs of inputs exhibiting ΔIi,j may result in the same output difference ΔOi,j.
Global constraint, projected on any subset of at least 17 variables.
20
Not well supported in first tried conventional CP solvers
We employed a MAC solver based on AC2001
We quantified the search space traversed on given ordering
21
n m
X i 1 i 0 X ' 1
HS(64, ) – n-ary constraints evaluated at the end HC(64, ) – an incremental n-ary (projections of S-2 and S-7) HI(64, ) – an incremental n-ary, that skips the less promising
22
HC(64, 16) proceeded 20 – 200 times faster than HS(64,16)
23
HI(64,10) yielded a number of S-Boxes with a score equal to 8 Score “better” (more secure) than the “worst” 3-DES S-Box S7 The score of S-Box S7 is found to be equal to 18 Best previous score was 10 3,600 such S-Boxes found in 1 hour Increased to more than 13,500 in 5 hours The score 8 proves to be easy for the CSP search with incomplete heuristic!! unreachable for the complete heuristics, prior techniques
24
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 5 6 9 10 15 12 7 4 14 13 2 1 8 11 1 3 6 5 10 9 12 15 4 7 13 14 1 2 11 8 2 3 15 12 5 9 10 6 4 8 11 7 14 2 1 13 3 9 5 15 3 12 6 10 7 11 8 4 2 14 13 1 S-Box with Score = 8
25
CSP is the natural way to model S-Box criteria CSPs model complex requirements such as 3-DES security
Particularly nonlinearity
CSPs aid us in obtaining “stronger” (more secure) S-Boxes
Easily extensible to include
various special security requirements as newer constraints, other S-box sizes
26
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 13 2 8 4 6 15 11 1 10 9 3 14 5 12 7 1 1 15 13 8 10 3 7 4 12 5 6 11 14 9 2 2 7 11 4 1 9 12 14 2 6 10 13 15 3 5 8 3 2 1 14 7 4 10 8 13 15 12 9 3 5 6 11
27