Categories

# DES algorithm Encryption Method

Given: Plain text= 10101001, Key=1011100110

p10=3 5 2 7 4 10 1 9 8 6,

p8=6 4 7 4 8 5 10 9,

p4=2 4 3 1,

IP=2 6 3 1 4 8 5 7,

Ep=4 1 2 3 2 3 4 1

S1 and s0 is the matrix respectively:

solution,

Changing p10 as per its encryption method with the key. now p10 becomes:

p10: 11001 01110

we do, left shift by 1 by dividing p10 in two halves like:

p10: 11001 01110

left shift by 1: 10011 11100

we do p8 for this so p8 becomes:

p8= 10111100——– key1

again we will do left shift by 2 to left shift by 1:

left shift 2= 01110 10011

we do p8 for this so p8 becomes:

p8=11010011—— key2

Now, we find IP from the plain text:

IP= 0011 0110 ( this is divided into two halves first part we say is LSB, and Second part as MSB)

LSB    MSB

we take LSB of IP: 0110

we find Ep of LSB:   00111100

we do XOR with key 1 to Ep :  10111100–key1

the result will be: 1000 0000( we divide it in two equal halves and name s0 and s1 respectively.)

so, s0=1000 ( for matrix representation r(1,4) and c(2,3) will be taken)

r(1,4)=(1,0)=2 ( converting binary into decimal)

c=(2,3)=(0,0)=0

s0(2,0)=00 ( seeing matrix in s0)

similarly for s1 also we do same thing: s1=0000, r(1,4)=(0,0)=0, c(2,3)=(0,0)=0

s1(0,0)=00

then, we take s0 s1 together: 0000 ( from this we find p4)

p4= 0000

we do XOR with MSB of IP we found out before that is: 0011

the result will be= 0011( in this we add LSB of IP so the IP will be: 0011 0110 and swap it dividing it into two equal halves we will get new IP after first round)

IP= 0110 0011—- 1st round complete.

for second round we take this IP and repeat the same process again:

as per method of encryption in IP given we find new IP is:

1010 0101 ( where first part is MSB and second part is LSB)

LSB of IP:0101 we get EP: 10101010

we do XOR with key2: 11010011

the result is: 0110 1001 ( first part is s0 and second part is s1)

s0=0111, r(1,4)=(0,1)=1,c(2,3)=(1,1)=3

s0(1,3)=00

s1=1001,r(1,4)=(1,1)=3, c(2,3)=(0,0)=0, s1(3,0)=10

we take both s0 and s1 0010

p4 will be 0010

we do XOR for MSB of IP 1010 with p4 we get

the result will be 1000

we take this result and LSB of IP: 1000 0101

swapping it with we get IP 0101 1000

for finding cipher text we do inverse of this IP and we get: 10100111

cipher text of plain text is: 10100111