0% found this document useful (0 votes)
9 views15 pages

Ex2 - Modern Cryptography - en

The document outlines an exercise on modern cryptography focusing on the DES algorithm, detailing steps for manipulating bits in plaintext and keys to observe changes in encryption results. It includes tables for recording the number of flipped bits and their percentages across multiple rounds of encryption. Additionally, it covers different modes of operation such as ECB, CBC, and CFB, providing examples and expected outputs for each mode using a student's name as input.

Uploaded by

thienvm623
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views15 pages

Ex2 - Modern Cryptography - en

The document outlines an exercise on modern cryptography focusing on the DES algorithm, detailing steps for manipulating bits in plaintext and keys to observe changes in encryption results. It includes tables for recording the number of flipped bits and their percentages across multiple rounds of encryption. Additionally, it covers different modes of operation such as ECB, CBC, and CFB, providing examples and expected outputs for each mode using a student's name as input.

Uploaded by

thienvm623
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

EXERCISE 2

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.

- Click on any bit in initial message to change -> Done

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

% of flipped bits 1.6 4.7 15.6 35.9 50 54.7 62.5 57.8

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

1.1.1 Keep message, change key


- Type student name (only 8 characters) into DES plaintext.

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

% of flipped bits 4.7 28.1 39.1 37.5 50 57.8 50 43.8

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

1.2 Keep message, change key


- Type student name (only 8 characters) into DES plaintext.

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

1.3 Give your conclusion based on the previous change


Modifying the 8th bit in the initial key while maintaining the message key unchanged
will not alter the cryptographic output throughout the encryption rounds. It's important to
note that the 8th bit isn't involved in the computation process; rather, it serves as a storage
mechanism and a means to verify the integrity and nature of the data post-encryption.
Therefore, adjusting this particular bit doesn't affect the encryption process itself but
rather influences the verification and integrity-checking steps afterward.
7
2. MODE OF OPERATION
In this exercise, the template DESVisualization.cwm in folder C:\Program Files (x86)\
CrypTool 2\Templates\Cryptography\Modern\Symmetric is used.

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

2.3 Cipher Feedback (CF)

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)

2 00 00 00 00 (Take 1st byte of output) 67 …XOR


00 00 00 D6

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

You might also like