Simplified DES or SDES is an encryption algorithm which
follows feistal cipher structure. In this tutorial, we will take an example of
SDES. Let’s get started.
We need plaintext and key to start with. For this example, let’s
consider 01001000 be the 8bit plaintext and 1110001110 be the 10bit key.
Key Generation:
The first step in SDES process is key generation. From the
10bit key that we give as input, it generates 2 1bit keys called k1 and k2.
Following is the process:
1.
Pass the 10bit input key into the P10 table:
3

5

2

7

4

10

1

9

8

6

This gives: 1011001110. (For example, take the 3^{rd} bit from
input key which is 1. It becomes the first bit for our new key)
2.
Divide the new key into two halves and left
shift each half’s bits by one. So by dividing we get 10110 and 01110. We
perform left shift so the left most bit becomes the right most bit and
remaining each bit is shifted to its left. This gives: 01101 and 11100. Or you
can think of it as the left most bit is taken to the right while other bits
keep their position.
3.
Pass both of these halves into P8 table as given
bellow:
6

3

7

4

8

5

10

9

This gives: 01111001. This gives our first key. Second key is generated
similarly.
4.
Now for Key 2 we take as input the key which was
shifted by 1 in the previous process: 01101 and 11100. We shift it two times to the left: 10101, 10011.
5.
We pass this with P8 given above: 11000111. This is our key 2.
We are done with key generation part. Next is encryption:
Encryption:
1.
We pass the plaintext (01001000) which is given
as input to the initial permutation table given bellow:
2

6

3

1

4

8

5

7

This gives: 10000010.
2.
We break the result into two halves (four bits
each): 1000 and 0010.
3.
Pass the right half into E/P table given below:
4

1

2

3

2

3

4

1

This gives: 00010100
4.
Now XOR the result with the key 1 that we got
from the key generation process:
00010100
01111001
01101101
5.
Again divide the result into two halves: 0110 and 1101. After that for both the halves, take 1^{st} and last
bit, convert it into decimal, call it row: 00 for first half. 11 for second. Take
the middle two bits for both halves and call them column: 11 for first half and
10 for second. Convert them into decimal: 1^{st} half gives row = 0,
col = 3. 2^{nd} half gives row = 3, col = 2.
6.
Identify the entry from the following sbox 0
table by selecting the first row and first column you identified in previous
step and do the same with second row and column that you identified with
passing it into s1:
S0

C0

C1

C2

C3

R0

1

0

3

2

R1

3

2

1

0

R2

0

2

1

3

R3

3

1

3

2

S1

C0

C1

C2

C3

R0

0

1

2

3

R1

2

0

1

3

R2

3

0

1

0

R3

2

1

0

3

This gives: 2 and 0. Converting into
binary gives: 1000.
7.
Apply permutation P4 to the result:
2

4

3

1

This gives: 0001.
8.
XOR the result with the left half of what we got
after passing plaintext into IP table from above:
1000
0001
1001
9.
Make a new byte by adding the result that we got
in previous result to the left and right half from the IP table above to the
right: 10010010. Swap them and
divide into two halves: 0010 and 1001 (We are going to repeat the
process for key 2).
10.
Pass the right 4 bit into the E/P Table:
4

1

2

3

2

3

4

1

11000011.
11.
XOR it with key 2:
10000010
11000011
01000001
12.
divide the result into two halves: 0100 and 0001. After that for both the halves, take 1^{st} and last
bit, convert it into decimal, call it row: 00 for first half. 01 for second.
Take the middle two bits for both halves and call them column: 10 for first
half and 00 for second. Convert them into decimal: 1^{st} half gives
row = 0, col = 2. 2^{nd} half gives row = 1, col = 0.
13.
Identify the entry from the following sbox 0
table by selecting the first row and first column you identified in previous
step and do the same with second row and column that you identified with
passing it into s1:
S0

C0

C1

C2

C3

R0

1

0

3

2

R1

3

2

1

0

R2

0

2

1

3

R3

3

1

3

2

S1

C0

C1

C2

C3

R0

0

1

2

3

R1

2

0

1

3

R2

3

0

1

0

R3

2

1

0

3

This gives: 3 and 2. Converting into
binary gives: 1110.
14.
Apply permutation P4 to the result:
2

4

3

1

This gives: 1011.
15.
XOR the result with the above swapped result:
0010
1011
1001
16.
Make a new byte by adding the result that we got
in previous result to the left and right half from the swapped byte above to
the right: 10010010.
17.
Finally pass result into IP^{1}
Table:
4

1

3

5

7

2

8

6

11001000.
We presented an example of a
simplified DES encryption. First we look at key generation process and then the
encryption process.
Comments
Post a Comment