Cryptography Reference
In-Depth Information
Thus, for example if
x
=(
x
1
x
2
x
3
x
4
) = (1101) is our input bitstring of
length 4, then if we wish to employ the first S-Box, we get
S
0
(1101) = (11),
since (
x
1
x
4
) = (11) represents the fourth row, and (
x
2
x
3
) = (10) represents the
third column, the entry at the intersection of which is 11. Similarly, if we want
to use the S-Box
S
1
, then
S
1
(1101) = (00).
Perhaps the most complicated part of S-DES is the function that does the
combining of permutation and substitution.
The S-DES Round Function
First, we need to describe a mapping
F
that takes bitstrings of length 4
using a subkey
SK
, and outputs bitstrings of length 4.
Let
x
=(
x
1
x
2
x
3
x
4
) be the input. Then
F
first uses the expansion
EP
to
produce
EP
(
x
), as described on page 119. Then this 8-bit result is added to the
subkey
SK
, modulo 2. Recall that addition modulo 2 is denoted by
⊕
.Thus,
this result is denoted by
EP
(
x
)
SK
=(
y
1
y
2
y
3
y
4
y
5
y
6
y
7
y
8
)=
y
. For the sake
of convenience, we will denote the left four bits of a given byte, such as
y
,by
⊕
L
(
y
)=(
y
1
y
2
y
3
y
4
) and the right four bits by
R
(
y
)=(
y
5
y
6
y
7
y
8
)
.
The next action of
F
is to feed
L
(
y
)into
S
0
to produce
S
0
(
L
(
y
)) = (
z
1
z
2
), and
feed
R
(
y
)into
S
1
to get
S
1
(
R
(
y
))=(
z
3
z
4
). Thus, under this action
y
gets
sent to (
S
0
(
L
(
y
))
S
1
(
R
(
y
)))=(
z
1
z
2
z
3
z
4
)=
z
. Next, we apply the following
permutation to
z
.
P
4
j
1234
P
4
(
j
) 2431
Therefore, we get
P
4
(
z
)=(
z
2
z
4
z
3
z
1
)=
Z
, which is the final outcome for
F
,
namely,
F
(
x,SK
)=
Z
.
Now, the definition of the round function, denoted by
f
SK
, which takes an
8-bit plaintext
t
and a subkey
SK
, is given as follows.
f
SK
(
t
)=(
L
(
t
)
⊕
F
(
R
(
t
)
,SK
)
,
R
(
t
))
.
Thus, the round function only alters
L
(
t
), the left four bits of
t
, leaving
R
(
t
)
unaltered. However, there is a reason for
f
SK
being called a round function,
since there are two rounds. The next mechanism, the penultimate one, is a
means of swapping left and right bits.
The Switch/Swap Function
The switch function, denoted by
SW
, merely exchanges the left and right
four bits of an input
m
. Hence, if
m
=(
L
(
m
)
,
R
(
m
)) is an 8-bit input, then
SW
(
m
)=(
R
(
m
)
,
L
(
m
))
.
Search WWH ::
Custom Search