DES: Main Algorithm

Posted by attriel June 5th, 2008

Given the initial L(0) and R(0), we then develop L(1) and R(1)

L(i+1) = R(i)
R(i+1) = L XOR f(R(i),K(i+1))

For function f, R(i) is expanded from 32-bit to 48-bit R’(i)

32 1 2 3 4 5
4 5 6 7 8 9
8 9 10 11 12 13
12 13 14 15 16 17
16 17 18 19 20 21
20 21 22 23 24 25
24 25 26 27 28 29
28 29 30 31 32 1

R’(i) XOR K(i+1) (RK(i))is then broken into 8 6-bit chunks and permuted through S tables. (See S-Table post)

This permutation is then FURTHER permuted, which gives us the result (F(i)) of f(R(i),K(i+1))

16 7 20 21
29 12 28 17
1 15 23 26
5 18 31 10
2 8 24 14
32 27 3 9
19 13 30 6
22 11 4 25

F(i) is then XOR’d with L(i) (from WAAAY back), giving us the R(i+1).

Comments are closed.