5 DES

DES was developed in 1975 by IBM. Successing Lucifer, it is the most widely spread cryptosystem.

DES encrypts a plaintext bitstring x of length 64 with a key of length 56. The gained ciphertext is 64 bits long.
The calculation of the 16 single keys for point (2) is very tedious and is described in 5.1 DES Key.

The algorithm has three steps:
  1. Given a plaintext x, a bitstring x0 is constructed by reordering the bits of x according to a fixed initial permutation IP. We write x0 = IP(x) = L0 R0 , where L0 contains the first 32 Bits of x0, and R0 the last ones.
  2. Now, 16 repetitions of a certain function are executed. We determine LiRi, i = 1,...,16, after the following rule: where [+] stands for the exklusive OR of two bitstrings. f is described further below, and K1, K2 , ... , K16 are bitstrings of length 48, which are determined as a function of the key K.
  3. Apply the inverse permutation IP-1 on the bitstring R16 L16; this yields the ciphertext y, that is y = IP-1(R16 L16). (Regard the inverse order of L16 and R16).

The function f takes as input the first argument A (bitstring of length 32) and as the second J (bitstring of length 48), and returns a bitstring of length 32:
  1. The first argument A is expanded to a bitstring of length 48 by a fixed expansion function E. E(A) consisting of 32 bits from A, permuted in a certain way, where 16 of the bits occur twice.
  2. Determine E(A) [+] J and write the result as a concatenation of eight strings of six bit each,
    B = B1B2 B3 B4 B5 B6 B7 B8.
  3. Each Bi is now permuted in the so-called S-boxes Sj into Cj, i.e. Cj = Sj (Bj ), j = 1,...,8.
    The S-boxes are 4x16-matrices with entries between 0 and 15. Let Bj = b1b2 b3 b4 b5 b6. Then the wto bits b1b6 correspond with the binary representation of a row r from Sj (0 <= r <= 3), and the four bits b2 b3 b4 b5 determine the number of the column c from Sj (0 <= c <= 15).
    Then Sj (Bj) is the entry Sj (r,c), written as bitstring of length 4.
  4. The bitstring C = C1C2 C3 C4 C5 C6 C7 C8 of length 32 is now reordered according to the fixed permutation P. The gained bitstring P(C) is f(A,J).


Start applet in new window


Initial Permutation IP:
58504231261810 2
60524436282012 4
62544638302214 6
64564840322416 8
5749413325179 1
59514335271911 3
61534537292113 5
63554739312325 7

Final Permutation IP-1:
40 8481656246432
39 7471555236331
38 6461454226230
37 5451353216129
36 4441252206028
35 3431151195927
34 2421050185826
33 141949175725

Bit Table  E:
3212345
456789
8910111213
121314151617
161718192021
202122232425
242526272829
28293031321

Permutation P:
1672021
29122817
1152326
5183110
282414
322739
1913306
2211425


5.1 DES key