Cryptography Reference
In-Depth Information
Algorithm 10.1
The DES encryption algorithm.
(
m, k
)
m ← IP
(
m
)
L
0
←
leftmost 32 bits of
m
R
0
←
rightmost 32 bits of
m
for
i
=1to 16 do
L
i
← R
i−
1
R
i
← L
i−
1
⊕ f
k
i
(
R
i−
1
)
c ← IP
−
1
(
R
16
,L
16
)
(
c
)
2. A 16-round Feistel cipher is applied to
IP
(
m
). The corresponding round
function
f
is addressed later.
3. The inverse initial permutation (
IP
−
1
) as illustrated in Table 10.3 is applied.
If (
L
16
,R
16
) is the output of step 2, then
c
=
IP
−
1
(
R
16
,L
16
).
Table 10.2
The Initial Permutation
IP
of the DES
58
50
42
34
26
18
10
2
60
52
44
36
28
20
12
4
62
54
46
38
30
22
14
6
64
56
48
40
32
24
16
8
57
49
41
33
25
17
9
1
59
51
43
35
27
19
11
3
61
53
45
37
29
21
13
5
63
55
47
39
31
23
15
7
The DES round function
f
operates on blocks of 32 bits and uses a 48-bit
key
k
i
in each round (i.e.,
f
k
i
48
).
The working principle of the DES round function
f
is illustrated in Figure 10.2.
First, the 32-bit argument
R
is expanded to 48 bits using the expansion function
E
:
32
32
for every
k
i
∈{
:
{
0
,
1
}
→{
0
,
1
}
0
,
1
}
48
. As shown in Table 10.4, the expansion function basically
works by doubling some bits. If
R
=
r
1
r
2
...r
31
r
32
,then
E
(
R
)=
r
32
r
1
...r
32
r
1
.
Afterward, the string
E
(
R
) is added modulo 2 to the 48-bit key
k
. The result is split
into 8 blocks
B
1
,...,B
8
32
{
0
,
1
}
→{
0
,
1
}
of 6 bits each (i.e.,
E
(
R
)
⊕
k
=
B
1
B
2
B
3
B
4
B
5
B
6
B
7
B
8
6
for
i
=1
,...,
8). Next, each 6-bit block
B
i
is transformed into a 4-
bit block
C
i
for
i
=1
,...,
8 using a function
S
i
:
and
B
i
∈{
0
,
1
}
4
(this function
is called
S-box
and explained later). For
i
=1
,...,
8,wehave
C
i
=
S
i
(
B
i
),and
hence
C
=
C
1
C
2
...C
8
. Each
C
i
(
i
=1
,...,
8) is 4 bits long, so the total length
6
{
0
,
1
}
−→ {
0
,
1
}