<s>
In	O
cryptography	O
,	O
an	O
S-box	B-Algorithm
(	O
substitution-box	O
)	O
is	O
a	O
basic	O
component	O
of	O
symmetric	B-Algorithm
key	I-Algorithm
algorithms	I-Algorithm
which	O
performs	O
substitution	O
.	O
</s>
<s>
In	O
block	O
ciphers	B-Application
,	O
they	O
are	O
typically	O
used	O
to	O
obscure	O
the	O
relationship	O
between	O
the	O
key	O
and	O
the	O
ciphertext	O
,	O
thus	O
ensuring	O
Shannon	O
's	O
property	O
of	O
confusion	O
.	O
</s>
<s>
Mathematically	O
,	O
an	O
S-box	B-Algorithm
is	O
a	O
nonlinear	O
vectorial	O
Boolean	O
function	O
.	O
</s>
<s>
In	O
general	O
,	O
an	O
S-box	B-Algorithm
takes	O
some	O
number	O
of	O
input	O
bits	O
,	O
m	O
,	O
and	O
transforms	O
them	O
into	O
some	O
number	O
of	O
output	O
bits	O
,	O
n	O
,	O
where	O
n	O
is	O
not	O
necessarily	O
equal	O
to	O
m	O
.	O
An	O
m×n	O
S-box	B-Algorithm
can	O
be	O
implemented	O
as	O
a	O
lookup	B-Data_Structure
table	I-Data_Structure
with	O
2m	O
words	O
of	O
n	O
bits	O
each	O
.	O
</s>
<s>
Fixed	O
tables	O
are	O
normally	O
used	O
,	O
as	O
in	O
the	O
Data	B-Algorithm
Encryption	I-Algorithm
Standard	I-Algorithm
(	O
DES	B-Algorithm
)	O
,	O
but	O
in	O
some	O
ciphers	B-Application
the	O
tables	O
are	O
generated	O
dynamically	O
from	O
the	O
key	O
(	O
e.g.	O
</s>
<s>
the	O
Blowfish	B-Algorithm
and	O
the	O
Twofish	B-Algorithm
encryption	I-Algorithm
algorithms	I-Algorithm
)	O
.	O
</s>
<s>
One	O
good	O
example	O
of	O
a	O
fixed	O
table	O
is	O
the	O
S-box	B-Algorithm
from	O
DES	B-Algorithm
(	O
S5	O
)	O
,	O
mapping	O
6-bit	O
input	O
into	O
a	O
4-bit	O
output	O
:	O
</s>
<s>
When	O
DES	B-Algorithm
was	O
first	O
published	O
in	O
1977	O
,	O
the	O
design	O
criteria	O
of	O
its	O
S-boxes	B-Algorithm
were	O
kept	O
secret	O
to	O
avoid	O
compromising	O
the	O
technique	O
of	O
differential	O
cryptanalysis	O
(	O
which	O
was	O
not	O
yet	O
publicly	O
known	O
)	O
.	O
</s>
<s>
As	O
a	O
result	O
,	O
research	O
in	O
what	O
made	O
a	O
good	O
S-boxes	B-Algorithm
was	O
sparse	O
at	O
the	O
time	O
.	O
</s>
<s>
Rather	O
,	O
the	O
eight	O
S-boxes	B-Algorithm
of	O
DES	B-Algorithm
were	O
the	O
subject	O
of	O
intense	O
study	O
for	O
many	O
years	O
out	O
of	O
a	O
concern	O
that	O
a	O
backdoor	O
(	O
a	O
vulnerability	O
known	O
only	O
to	O
its	O
designers	O
)	O
might	O
have	O
been	O
planted	O
in	O
the	O
cipher	B-Application
.	O
</s>
<s>
As	O
the	O
S-boxes	B-Algorithm
are	O
the	O
only	O
nonlinear	O
part	O
of	O
the	O
cipher	B-Application
,	O
compromising	O
those	O
would	O
compromise	O
the	O
entire	O
cipher	B-Application
.	O
</s>
<s>
The	O
S-box	B-Algorithm
design	O
criteria	O
were	O
eventually	O
published	O
(	O
in	O
)	O
after	O
the	O
public	O
rediscovery	O
of	O
differential	O
cryptanalysis	O
,	O
showing	O
that	O
they	O
had	O
been	O
carefully	O
tuned	O
to	O
increase	O
resistance	O
against	O
this	O
specific	O
attack	O
such	O
that	O
it	O
was	O
no	O
better	O
than	O
brute	O
force	O
.	O
</s>
<s>
Biham	O
and	O
Shamir	O
found	O
that	O
even	O
small	O
modifications	O
to	O
an	O
S-box	B-Algorithm
could	O
significantly	O
weaken	O
DES	B-Algorithm
.	O
</s>
<s>
Any	O
S-box	B-Algorithm
where	O
any	O
linear	O
combination	O
of	O
output	O
bits	O
is	O
produced	O
by	O
a	O
bent	O
function	O
of	O
the	O
input	O
bits	O
is	O
termed	O
a	O
perfect	O
S-box	B-Algorithm
.	O
</s>
<s>
S-boxes	B-Algorithm
can	O
be	O
analyzed	O
using	O
linear	O
cryptanalysis	O
and	O
differential	O
cryptanalysis	O
in	O
the	O
form	O
of	O
a	O
Linear	O
approximation	O
table	O
(	O
LAT	O
)	O
or	O
Walsh	B-Algorithm
transform	I-Algorithm
and	O
Difference	O
Distribution	O
Table	O
(	O
DDT	O
)	O
or	O
autocorrelation	O
table	O
and	O
spectrum	O
.	O
</s>
