Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

-Ayesha Arshad

MSIS-14
10/09/15

CRYPTOGRAPHY ASSIGNMENT 1 - DES


PT :
Key:

195AF1234786BD43
21212A212B212C21

Key in 64-bits
00100001 00100001 00101010 00100001 00101011 00100001 00101100
00100001
Key Schedule
Round
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

Keys
010000
010000
110000
111000
101000
101000
001001
000001
000001
000011
000011
000110
000110
000100
000100
010100

000010
001010
001000
001000
001001
000001
000101
100101
100100
110100
110000
110000
010000
000010
000010
000010

110000
010000
010000
001000
001000
001001
001001
000101
000101
000100
000110
000010
100010
100010
110000
110000

100100
100100
100110
100010
100010
010010
010000
010000
010001
010001
001001
001001
001000
001100
000100
000100

001110
000000
000000
000000
010000
010000
000000
010000
001010
001000
101011
100001
000101
100100
000010
000000

000110
100001
100000
010000
110000
010000
000001
000001
001110
000110
000000
000100
001000
001000
001010
000001

010000
100000
100110
100100
000000
000100
000010
000010
000000
010000
000000
001001
001001
010001
011000
000010

000000
100101
110000
010001
010000
001100
001100
100101
000000
000010
000010
000010
000000
000000
000000
101001

1) PART I
First obtain cipher text CT of above PT and key.
PT in 64-bits
00011001 01011010 11110001 00100011 01000111 10000110 10111101
01000011
Encryption
Roun
Output
ds
1
01100100
10011000
2
11101010
00111100
3
00000011
01100010
4
10001010
00111101
5
01110010
00010101
6
00110011
11110100
7
00110100
10101110
8
00110100
11111101
9
01100001
10100100
10
11100100
11100001
11
00110001
01001000
12
01011000
00110111
13
11011010
00111000
14
00100111
11110111
15
10011001
10010101
16
11100111
10010101

01001100 01000011 10111010 11101010 01101101 00110001


01101101 00110001 10011000 00000011 11000111 11111110
11000111 11111110 00111100 10001010 10110111 10010110
10110111 10010110 01100010 01110010 11111101 00010111
11111101 00010111 00111101 00110011 11011110 11110111
11011110 11110111 00010101 00110100 01000001 01011111
01000001 01011111 11110100 00110100 10111011 11110110
10111011 11110110 10101110 01100001 00010010 10000110
00010010 10000110 11111101 11100100 11000001 10011010
11000001 10011010 10100100 00110001 11111100 10001010
11111100 10001010 11100001 01011000 00010001 10100111
00010001 10100111 01001000 11011010 00010000 01000011
00010000 01000011 00110111 00100111 00000100 01111000
00000100 01111000 00111000 10011001 11000100 10110101
11000100 10110101 11110111 01001101 10011101 10110010
10100011 00001011 10001011 01001101 10011101 10110010

Cipher Text
11110111 01011101 11100010 10100101 00101010 01011000 11000000
01111011
CT in HEX
F75DE2A52A58C07B

2) PART II
Each student will alter ith bit of PT and get the respective CTi. Compare CT
and CTi to analyze how many bits of CT are changed when 1 bit is altered.
My assigned ith bit is 38.
PT in 64-bits
00011001 01011010 11110001 00100011 01000011 10000110 10111101
01000011
PT in Hex
195AF1234386BD43
Encryption
Roun
Output
ds
1
01100100
10011000
2
11101010
10110100
3
00010010
11101101
4
11101110
10011111
5
00111010
00100111
6
00011000
10001111
7
00101001
10110011
8
10100111
00010100
9
10111010
10001111
10
10110011
10000110
11
11100010
01111111
12
01000001
11110001
13
10100111
10110110
14
00010111
10000110
15
10111111

01001100 01000011 10111010 11101010 01101101 00100001


01101101 00100001 10011000 00010010 11100111 11011110
11100111 11011110 10110100 11101110 10001000 10001100
10001000 10001100 11101101 00111010 11010000 00100001
11010000 00100001 10011111 00011000 10111011 10011101
10111011 10011101 00100111 00101001 11010010 01100010
11010010 01100010 10001111 10100111 11010010 11010010
11010010 11010010 10110011 10111010 11110001 01010001
11110001 01010001 00010100 10110011 01001110 01000011
01001110 01000011 10001111 11100010 11000001 00011110
11000001 00011110 10000110 01000001 10001010 00010110
10001010 00010110 01111111 10100111 00110000 00000001
00110000 00000001 11110001 00010111 00010010 10001011
00010010 10001011 10110110 10111111 01111010 01000000
01111010 01000000 10000110 11000000 01000000 00010101

16

01011111
10110000 00111101 00110010 11101110 11000000 01000000 00010101
01011111

CT in hex: F75DE2A52A58C07B
CT in hex: 1A071B135E55A3C1
CT: 11110111 01011101 11100010 10100101 00101010 01011000 11000000
01111011
CT: 00011010 00000111 00011011 00010011 01011110 01010101 10100011
11000001
With 1-bit change in plain text, we get total of 37 bits change in cipher text.

3) PART III
i.

Comparison between PT and PT - Analyze after how many rounds


avalanche effect is achieved.

Rou
nds

Original PT

01100100
10111010
00110001
11101010
10011000
11111110
00000011
00111100
10010110
10001010
01100010
00010111
01110010
00111101
11110111
00110011
00010101
01011111
00110100
11110100
11110110
00110100
10101110
10000110
01100001
11111101
10011010
11100100
10100100
10001010
00110001
11100001
10100111
01011000

10

11

12

01001100
11101010
10011000
01101101
00000011
00111100
11000111
10001010
01100010
10110111
01110010
00111101
11111101
00110011
00010101
11011110
00110100
11110100
01000001
00110100
10101110
10111011
01100001
11111101
00010010
11100100
10100100
11000001
00110001
11100001
11111100
01011000
01001000
00010001

1-Bit changed PT

01000011
01101101
00110001
11000111
11111110
10110111
10010110
11111101
00010111
11011110
11110111
01000001
01011111
10111011
11110110
00010010
10000110
11000001
10011010
11111100
10001010
00010001
10100111

01100100
10111010
00100001
11101010
10011000
11011110
00010010
10110100
10001100
11101110
11101101
00100001
00111010
10011111
10011101
00011000
00100111
01100010
00101001
10001111
11010010
10100111
10110011
01010001
10111010
00010100
01000011
10110011
10001111
00011110
11100010
10000110
00010110
01000001

01001100
11101010
10011000
01101101
00010010
10110100
11100111
11101110
11101101
10001000
00111010
10011111
11010000
00011000
00100111
10111011
00101001
10001111
11010010
10100111
10110011
11010010
10111010
00010100
11110001
10110011
10001111
01001110
11100010
10000110
11000001
01000001
01111111
10001010

01000011
01101101

No
of
bits
Cha
nge
d
1

00100001
11100111

11011110
10001000

23

10001100
11010000

30

00100001
10111011

28

10011101
11010010

34

01100010
11010010

33

11010010
11110001

36

01010001
01001110

41

01000011
11000001

37

00011110
10001010

35

00010110

30

13

14

15

16

01001000
01000011
11011010
00110111
01111000
00100111
00111000
10110101
10011001
11110111
10110010
11100111
10001011
01001101
10010101

11011010
00110111
00010000
00100111
00111000
00000100
10011001
11110111
11000100
01001101
10010101
10100011

00010000
01000011
00000100
01111000
11000100
10110101
10011101
00001011

10011101 10110010

01111111
00000001
10100111
11110001
10001011
00010111
10110110
01000000
10111111
10000110
00010101
10110000
11101110
11000000
01011111

10100111
11110001
00110000
00010111
10110110
00010010
10111111
10000110
01111010
11000000
01011111
00111101

00110000
00000001
00010010

28

10001011
01111010

34

01000000
01000000

38

00110010

37

01000000 00010101

Avalanche Affect: Number of flipped bits in ciphered text = 37/64 = 0.57


Number of bits in ciphered text
This means that change in 1.56% of plain text creates 57% of change in cipher text
and thus achieved the Avalanche affect. Significant changes occur as early as third
round. At ninth round, avalanche affect is the greatest with 64% change. In nine
rounds, Avalanche affect is greater than or equal to 50%.
ii.

Analyze after how many rounds the CT will have 50 % bits changed
from the staring PT

Rou
nds

1-Bit changed PT

01100100
00100001
11101010
11011110
00010010
10001100
11101110
00100001
00111010
10011101
00011000
01100010
00101001
11010010

2
3
4
5
6
7

01001100
10011000
01101101
10110100
11100111
11101101
10001000
10011111
11010000
00100111
10111011
10001111
11010010
10110011

No of
bits
Change
d
01000011 10111010 11101010 01101101
00100001 10011000 00010010 11100111

30

11011110 10110100 11101110 10001000

34

10001100 11101101 00111010 11010000

29

00100001 10011111 00011000 10111011

37

10011101 00100111 00101001 11010010

41

01100010 10001111 10100111 11010010

36

8
9
10
11
12
13
14
15
16

10100111
01010001
10111010
01000011
10110011
00011110
11100010
00010110
01000001
00000001
10100111
10001011
00010111
01000000
10111111
00010101
10110000
00010101

11010010
00010100
11110001
10001111
01001110
10000110
11000001
01111111
10001010
11110001
00110000
10110110
00010010
10000110
01111010
01011111
00111101
01011111

11010010 10110011 10111010 11110001

26

01010001 00010100 10110011 01001110

33

01000011 10001111 11100010 11000001

26

00011110 10000110 01000001 10001010

38

00010110 01111111 10100111 00110000

29

00000001 11110001 00010111 00010010

37

10001011 10110110 10111111 01111010

30

01000000 10000110 11000000 01000000

31

00110010 11101110 11000000 01000000

30

Seven rounds have > = 50 % bits change from the staring PT. Most significant
change is in sixth round with total of 41 bits change. At final round, bit change is
less than 50%.

You might also like