Ex2 - Modern Cryptography - en
Ex2 - Modern Cryptography - en
MODERN CRYPTOGRAPHY
Group: 10
Members:
- ID – Name
- 21522148 – Ngô Quốc Huy
- 21522074 – Lý Gia Hiếu
- 21521619 – Trần Tịnh Minh Tú
1. DES
Students open Avalanche (DES).cwm in folder C:\Program Files (x86)\CrypTool 2\
Templates\Cryptanalysis\Modern. Click on “Enable to change single bit”
1
1.1 Change message, keep key
- Type student name (only 8 characters) into DES plaintext.
2
- Click Continue to see the change from round to round and Encryption result.
- Fill the information from the result into following table (include the figure of
Cryptool to show the input and the result):
Round 1 2 3 4 5 6 7 8
# of flipped bits 1 3 10 23 32 35 40 37
Round 9 10 11 12 13 14 15 16
# of flipped bits 25 25 28 25 23 24 30 34
% of flipped bits 39.1 39.1 43.8 39.1 35.9 37.5 46.9 53.1
3
- Click on 13th bit in initial key to change -> Done
- Click Continue to see the change from round to round and Encryption result.
4
- Fill the information from the result into following table (include the figure of
Cryptool to show the input and the result):
Round 1 2 3 4 5 6 7 8
# of flipped bits 3 18 25 24 32 37 32 28
Round 9 10 11 12 13 14 15 16
# of flipped bits 24 25 29 29 35 36 34 34
% of flipped bits 37.5 39.1 45.3 45.3 54.7 56.3 53.1 53.1
5
- Click on 8th bit in initial key to change -> Done
- Click Continue to see the change from round to round and Encryption result.
6
- Fill the information from the result into following table (include the figure of
Cryptool to show the input and the result):
Round 1 2 3 4 5 6 7 8
# of flipped bits 0 0 0 0 0 0 0 0
% of flipped bits 0 0 0 0 0 0 0 0
Round 9 10 11 12 13 14 15 16
# of flipped bits 0 0 0 0 0 0 0 0
% of flipped bits 0 0 0 0 0 0 0 0
DES algorithm encrypts 64-bit block data, and the input for this template is 64-bit text in
HEX.
To encrypt a message, the input message need to be converted into Hex and be broken
into 64-bit block (16 Hex characters).
- For example, the input message is a full name, Nguyen Van A. The corresponding
hex is 4E 67 75 79 65 6E 20 56 61 6E 20 41 (including “space”), then there are 2
64-bit blocks.
o Block 1: 4E 67 75 79 65 6E 20 56
o Block 2: 61 6E 20 41 00 00 00 00
Fill the following table with your full name and corresponding hex in 64-bit block (there
can be 2 – 4 block 64 bits depending on the length of your full name):
8
Fullname Ngo Quoc Huy
Block 1 4E 67 6F 20 51 75 6F 63
Block 2 20 48 75 79 00 00 00 00
Block 3
9
2.1 Electronic Codebook (ECB)
Using DESVisualization.cwm to encrypt each 64-bit block from above table and fill the
following table with the plaintext and corresponding ciphertext (use the same key for
every block).
10
Input plaintext Output ciphertext
Block 1 4E 67 6F 20 51 75 6F 63 97 3E BE BB D7 2F B2 DF
Block 2 20 48 75 79 00 00 00 00 B9 1E EC A7 0E 9D 6C 0D
Block 3
Final ciphertext (also attach the image from Cryptool 2 for each block):
97 3E BE BB D7 2F B2 DF B9 1E EC A7 0E 9D 6C 0D
Using DES.cwm with your full name as the input message and mode ECB, the ciphertext
is (also attach the image from Cryptool 2 below):
97 3E BE BB D7 2F B2 DF B9 1E EC A7 0E 9D 6C 0D
11
2.2 Cipher Block Chaining (CBC)
Using DESVisualization.cwm and the XOR operation to encrypt the blocks from above
table and fill the following table with the input plaintext and corresponding ciphertext
(use the same key for every block).
12
Input plaintext Output ciphertext
Block 1 4E 67 6F 20 51 75 6F 63 97 3E BE BB D7 2F B2 DF
Block 2 XOR 20 48 75 79 00 00 00 00 F6 62 09 5E 28 F2 ED 91
Ciphertext 1 XOR
97 3E BE BB D7 2F B2 DF
B7 76 CB C2 D7 2F B2 DF
13
Final ciphertext (also attach the image from Cryptool 2 for each block):
97 3E BE BB D7 2F B2 DF F6 62 09 5E 28 F2 ED 91
Using DES.cwm with your full name as the input message and mode CBC (no need of
Initialization Vector in this exercise).
The result from DES.cwm is (also attach the image from Cryptool 2 below):
997 3E BE BB D7 2F B2 DF F6 62 09 5E 28 F2 ED 91
Using DESVisualization.cwm and the XOR operation to encrypt each byte of plaintext
as following table (use the same key for every block).
14
Input Output Plaintext Output ciphertext
1 00 00 00 00 98 E5 86 34 9F 0C 5D B1 4E 98 XOR 4E = D6
00 00 00 00 (Take 1st byte)
Calculate the first 5 byte of the ciphertext (also attach the image from Cryptool 2 for each
byte):
Using DES.cwm with your full name as the input message and mode CFB (no need of
Initialization Vector in this exercise), compare the first 5 bytes.
15