DES Algorithm
DES Algorithm
DES Algorithm
1 57 49 41 33 25 17 9
8 1 58 50 42 34 26 18
15 10 2 59 51 43 35 27
22 19 11 3 60 52 44 36
29 63 55 47 39 31 23 15
36 7 62 54 46 38 30 22
43 14 6 61 53 45 37 29
50 21 13 5 28 20 12 4
Bit 0 1 2 3 4 5
Permuted Choice 2 1 14 17 11 24 1 5
7 3 28 15 6 21 10
13 23 19 12 4 26 8
19 16 7 27 20 13 2
25 41 52 31 37 47 55
31 30 40 51 45 33 48
37 44 49 39 56 34 53
43 46 42 50 36 29 32
DES Key Scheduling Flow Chart
<<< is the operation
of SRT
We will call the
subkeys K[1], K[2], ,
K[16] later
Plaintext Preparation
Cut the plaintext into 64-bit blocks
Each 64-bit block should be permuted
according to Initial Permutation Table (IP
Table)
Besides, we make an Inverse Initial
Permutation Table (IP-1), which has effect
opposite to IP
IP: Initial Permutation
Bit 0 1 2 3 4 5 6 7
1 58 50 42 34 26 18 10 2
9 60 52 44 36 28 20 12 4
17 62 54 46 38 30 22 14 6
25 64 56 48 40 32 24 16 8 Bit 0 1 2 3 4 5 6 7
33 57 49 41 33 25 17 9 1 1 40 8 48 16 56 24 64 32
41 59 51 43 35 27 19 11 3 9 39 7 47 15 55 23 63 31
49 61 53 45 37 29 21 13 5 17 38 6 46 14 54 22 62 30
57 63 55 47 39 31 23 15 7 25 37 5 45 13 53 21 61 29
33 36 4 44 12 52 20 60 28
41 35 3 43 11 51 19 59 27
49 34 2 42 10 50 18 58 26
57 33 1 41 9 49 17 57 25
Rb: 32 bits 48 1 32 1 2 3 4 5
7 4 5 6 7 8 9
bits
13 8 9 10 11 12 13
19 12 13 14 15 16 17
25 16 17 18 19 20 21
31 20 21 22 23 24 25
37 24 25 26 27 28 29
43 28 29 30 31 32 1
Feistel Function Key Mixing
After the expansion operation, just XOR
with subkey K[1]
Feistel Function - Substitution
48-bit buffer becomes eight 6-bit blocks
8 S-boxes have output from 0 to 15 which
can be represented with 4 bits
How do S-boxes work? Wait and see
8 4-bit outputs can be merged, and store it
in a 32-bit buffer
How do S-boxes Work?
Row Column
Use the Row and Column number to find the corresponding output
number from the S-box.
Besides, the n-th block must use the n-th S-box.
S-Box 1: Substitution Box 1
Row / Column 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0 14 4 13 1 2 15 11 8 3 10 6 12 5 9 0 7
1 0 15 7 4 14 2 13 1 10 6 12 11 9 5 3 8
2 4 1 14 8 13 6 2 11 15 12 9 7 3 10 5 0
3 15 12 8 2 4 9 1 7 5 11 3 14 10 0 6 13