
Block ciphers and the data encryption st andard 187
The S- boxes (“S” stands for “substitution”) are defined by the tables:
0 1 2 3
0 1 0 3 2
1 3 2 1 0
2 0 2 1 3
3 3 1 3 2
S-box S
0
0 1 2 3
0 0 1 2 3
1 2 0 1 3
2 3 0 1 0
3 2 1 0 3
S-box S
1
To apply an S-box, say S
0
, suppose the 4 input bits are x
0
x
1
x
2
x
3
. The outer
two bits give the row number; the inner two bits the column number. So for
example, 1011 has row 11, or 3, and column 01, or 1. At row 3 and column 1
is the value 1, or 01 in binary. Another example: 0001. The row value is 01,
or 1, and the column value 00, or 0. At row 1 and column 0 of S
0
is the value
3, or 11 in binary.
The entire mixing function is