Describe your approach to cryptanalysis of the ciphertext

Assignment Help Computer Engineering
Reference no: EM131223671

Laboratory Exercises II: Symmetric and Asymmetric Cryptography

Introduction

In this set of exercises we will study the basics of symmetric (secret key) and asymmetric (public key) cryptography. For this purpose, we will use CrypTool, an excellent program by means of which cryptographic functions and mechanisms can be easily demonstrated and analyzed. We will learn about both classical and modern cryptography. We will begin our study with a couple of exercises related to classical ciphers such as Caesar's and Vernam. Using CrypTool, we will demonstrate their weaknesses and limitations. Then, we will focus on modern ciphers, primarily Data Encryption Standard (DES), and on basic operation modes of block ciphers such as Electronic Codebook (EBC) and Cipher Block Chaining (CBC). The "cut-and-paste" attack against EBC and CBC will be demonstrated. Finally, in the last set of exercises we will study basic public key cryptosystems RSA and Di?e-Hellman.

Exercise 1 -

In this exercise we will demonstrate and study two representatives of classical ciphers, namelly, Caesar's cipher and Vernam (one-time pad) cipher. We will also perform cryptanalysis of a simple permutation cipher.

Recall, Caesar's cipher falls in the category of monoalphabetic substitution ciphers (i.e., each element from the plaintext will be replaced with a unique element from the space of ciphertexts). For this reason, a cipehertext preserves the relative frequency at which plaintext elements appear in the corresponding plaintext. In Vernam cipher encryption is performed by means of eXclusive-OR (XOR) logical operation (plaintext is XORed with an encryption key). If an encryption key is chosen randomly and is at least as long as the plaintext to be encrypted, XOR encryption (one-time pad) is provably (perfectly) secure.

Task 1.1. Caesar's Cipher

1. Given that the Caesar's cipher is used, recover the plaintext that corresponds to the following ciphertext: Sodlqwhaw wr eh hqfubswhg. Describe your approach to cryptanalysis of the ciphertext. (Try to recover the plaintext without assistance of CrypTool.)

2. Use CrypTool to check your answer to the ?rst challenge (task). In order to do this, you should ?rst create a new document in CrypTool by clicking on the icon "New" (or choose "File . New"). Write the challenge ciphertext in a newly open document. In the main menu, under "Analysis" tab, select "Symmetric Encryption (classic) . Ciphertext only . Caesar" and follow the instructions.

3. Assume that we choose M (that is, K=13) as an encryption key in Caesar's cipher. What is the result (Ci) of the following (double) encryption

Ci = E (K,E(K, Mi)),

where Mi is an arbitrary plaintext element? Explain your answer.

How many encryptions with key K=2 is needed before observing the same effect as in the previous example (with K=13)?

Task 1.2. Vernam and One-Time Pad Cipher

1. Consider the following letter encodings:

letter

A

E

I

M

O

R

T

V

encoding

000

001

010

011

100

101

110

111

A message M = MARIO is Vernam encrypted into ciphertext C = AOAMV. Find the corresponding encryption key (please note that the key is 4 letters long). Provide details of your cryptanalysis.

2. Consider the following two ciphertexts C1= MAOEE and C2=RTITR that are obtained by Vernam encrypting messages M1 and M2, respectively, under the same encryption key. The letter encodings is the same as in the ?rst task. Encrypted messages are two names. Let us denote with mi,k the kth  letter in message Mi. The following is known about messages (names): m1,1=R and m2,4=T. Using this information, try to recover messages M1 and M2, as well as the encryption key. Provide details of your cryptanalysis.

Task 1.3. Monoalphabetic Substitution Cipher

This type of a cipher is similar to the Caesar's cipher, i.e. every letter of the plaintext is replaced by a different letter of the alphabet, with the di?erence that the encryption key can be any permutation of the plaintext elements. In this way the key space increases from 26 (in the case of Caesar's cipher) to 26!. This cipher, however, is still vulnerable to the"relative frequency"-based attack.

Your task is to decrypt the following message that was encrypted using a monoalphabetic substitution cipher.

Exercise 2 -

In this exercise we will focus on modern ciphers, primarily on the most prominent block cipher DES. We will study a relationship between DES and its extension 3-DES (triple DES). Recall, 3-DES was introduced in order to compensate for a short encryption key (only 56 bits) in the original DES cipher. 3-DES is still widely used for protection of data con?dentiality. In October 2000, Rijndael encryption algorithm (AES) was chosen as a more robust and more flexible replacement of the DES encryption algorithm. Similar to DES, AES is also a block cipher but it supports a variable block length and a variable key length (i.e., 128, 192 and 256 bits).

We will further study two basic operation modes of block ciphers, namely, ECB and CBC. More speci?cally, we will show that it is possible to rearrange the ECB and CBC ciphertext blocks in such a way that all (or some) of the blocks decrypt correctly. This is a well-known cut-and-paste attack.

Task 2.1. Histogram Analysis of the Data Encryption Standard

In this task we compare a frequency histogram of a document before and after encryption with the DES cipher. We use CrypTool to accomplish this. Quoting CrypTool help: "The histogram of a document expresses the frequency distribution of the characters of a document in graphical form in a corresponding window."

Create a new document in CrtypTool and fill it with a longer English text. Alternatively, open an existing English text. Save this document for later reference.

1. In the main menu, click on the "View" submenu and select "As HexDump". This is to convert ASCII representation of the plaintext document into the corresponding hexadecimal representation.

2. In the main menu, open the "Analysis" submenu and select "Tools for Analysis. Histogram" to obtain the histogram of the plaintext (un-encrypted) document (Figure 4). Save the result.

3. Encrypt the plaintext document (English text) using the DES cipher. In CrypTool click on the window with the plaintext document in order to make it active. In the main menu, under the "Crypt/Decrypt" submenu select "Symmetric (modern). DES CBC...". Enter the encryption key and encrypt the plaintext document.

4. Repeat step 2 above to obtain the histogram of the encrypted text (ciphertext). Compare the result with the histogram obtained in step 2. Describe/explain your observations.

Task 2.2. Histogram Analysis of the Caesar's Cihper

Repeat all the steps from the previous task, while using Caesar's cihper with an arbitrary key instead of the DES cipher. Compare the obtained results with the results from the previous task. Describe/explain your observations.

Task 2.3. Triple DES (3-DES)

1. Assume that a message m is encrypted using 3-DES (in the ECB mode) with the following key (hex value):

K = 11 22 33 44 55 66 77 88 AA BB CC DD EE FF FF FF

The encrypted message is to be decrypted using only regular 1-DES (not 3-DES). Explain how is this done.

2. Use CrypTool and encrypt your name with 3-DES in the ECB mode under the following two encryption keys:

K1 = 11 22 33 44 55 66 77 88 AA BB CC DD EE FF FF FF

K2 = 11 22 33 44 55 66 77 88 11 22 33 44 55 66 77 88

Decrypt resulting ciphertexts using 1-DES cipher. Provide any intermediate results that you obtain. One among the keys K1 and K2 enables "fast" decryption with the 1-DES cipher (a single application of 1-DES).Which one? Please explain your answer.

Task 2.4. "Cut-and-Paste" Attack on ECB and CBC Modes

Let us denote with M1 M2... Mk a message M broken up into k 64 bit segments. Also, let us denote with K the corresponding encryption key. Then, the ECB encryption mode can be mathematically described as follows:

Ci = E(K, Mi), i = {1, 2, . . . , k}

Mi = D(K, Ci), i = {1, 2, . . . , k} .

Similarly, for the CBC mode we have:

C1 = E(K, M1 ⊕ IV)

Ci = E(K, Mi ⊕ Ci-1), i = {2, 3, . . . , k}

M1 = D(K, C1) ⊕ IV

Mi = D(K, Ci) ⊕ Ci-1, i = {2, 3, . . . , k} .

1. Consider the following message M:

M=Bob's salary is $25000--Tom's salary is $15000.

Break the message (plaintext) up into 64 bit long plaintext segments (M1 M2...Mk). Note that each letter in the message is an 8 bit ASCII character; each "space" (blank) counts as a single ASCII character. Use t sign to denote blank characters. For example, the ?rst 64 bit plaintext segment is M1=Bob'stsa.

2. Using CrypTool, encrypt the above message with DES in the ECB mode using key K = 11 22 33 44 55 66 77 88. Write down resulting 64 bit ciphertext blocks C1 C2... Ck.

3. Exchange ciphertext blocks C1 and C4 in the above sequence of ciphertext blocks to obtain the following sequence of ciphertext blocks:

C4 C2 C3 C1 C5... Ck

Decrypt the resulting ciphertext using the key from step 2. What message do you obtain? Please explain.

4. Repeat steps 1-3 but now use DES in the CBC mode. Contrast the decrypted text with the one obtained when the ECB mode is used. Explain your observations.

Task 2.5. Controlled Plaintext Changes in the CBC Mode

Your task is to cause a controlled change in the decrypted message by modifying an appropriate CBC ciphertext block.

1. Use CrypTool and encrypt message

M=Bob's salary is $25000--Tom's salary is $15000.

with DES in the CBC mode. Choose the encryption key at will.

2. In the resulting ciphertext sequence modify an appropriate ciphertext block so that it causes the following change in the decrypted message: $15000 → $.5000.

Provide details of your actions. (Hint: Use CrypTool to accomplish this task.)

3. Do all ciphertext blocks decrypt correctly after this modi?cation? Explain your answer.

4. Does the CBC (and/or ECB) mode of encryption ensure data integrity? Please explain using experience gained from the present and the previous task.

Exercise 3 -

In this exercise we will focus on asymmetric or public key cryptography. We will study some important properties of a (textbook) RSA public key cryptosystem. We will demonstrate certain attacks against RSA - "factoring-based" and "chosen-ciphertext" attack. Finally, we will touch upon the Diffie-Hellman key exchange protocol and its security in face of passive and active attacks.

Task 3.1. RSA Encryption

The RSA encryption algorithm works with numbers. As your task is to encrypt some textual messages, we obviously need a method for coding of a message into numbers. We next describe one such a method that is used in CrypTool. The method is called b-adic (where b is the number of plaintext elements) and works as follows. Suppose that the plaintext alphabet consists the following elements:

<space>ABCDEFGHIJKLMNOPQRSTUVWXYZ,

1. You are asked to encrypt your name using RSA with a small modulus N (that is, N < 100000). Choose N such that the length of the resulting RSA modulus N allows you to work with blocks of length 2.

2. Show that CrypTool RSA encryption works by encrypting the first block of the message "manually". You are allowed to use only multiplication and squaring operations (and of course your calculator). In order to make this process manageable, use "reduction by modulo" property, that is,

(a × b) mod N ≡ ((a mod N) × (b mod N)) mod N.

Provide the steps of your calculation.

3. After decryption of a given ciphertext, we have to decode the result back to its initial plaintext representation. How would you do this? Decode 354 into a plaintext alphabet <space>ABCDEFGHIJKLMNOPQRSTUVWXYZ, assuming the block length of 2 and 27-adic coding.

Task 3.2. Chosen Ciphertext Attack on RSA

This is an attack against the textbook version of the RSA algorithm. In this attack, an attacker first chooses a message and encrypts it the victim's public key. Then, the attacker asks the victim to sign (decrypt) for him a specially crafted related message. Due to the following property of RSA

E(PU, M1) × E(PU, M2) = E(PU, M1 × M2) ,

the attacker can easily recover any message encrypted with the victim's private key, without ever learning this private key.

For example, the attacker wants to decrypt the following ciphertext C = Me mod N, without knowing the private key d. The attacker proceeds as follows. Knowing the victim's public key e, he prepares the following message

X = (C × 2e) mod N,

gives it to the victim and asks her to sign it. The victim signs message X with its private key and sends the result Y back to the attacker.

Y = Xd mod N

Using Y and equation (1), the attacker can retrieve the encrypted message M as follows:

Xd = ((C mod N) × (2e mod N))d

     = ((Me mod N) × (2e mod N))d

        = ((2 ×M)e mod N)d

     = (2 ×M)ed mod N

     = 2 × M.

1. Show by example that equation (1) holds for the RSA encryption algorithm. Please provide details of your solution. Use CrypTool to accomplish this task.

2. Demonstrate by example the chosen ciphertext attack against RSA. Please provide details of your solution. Use CrypTool to accomplish this task.

Task 3.3. Attack on RSA by Factoring Modulus N

By factoring the RSA modulus N, the attacker learn prime numbers p and q. From this, the attack can calculate Euler's Φ(N) function as follows

Φ(N) = (p - 1)(q - 1) .

Furthermore, the public key e is also known by the attacker. Therefore, he can calculate the corresponding private key d, which is the inverse modulo Φ(N) of e, that is,

d = e-1(mod Φ(N)).

1. Decrypt the ciphertext given below knowing that the public key e is 11 and the RSA modulus N is 40741. The plaintext alphabet is encrypted using the block length of 2 and 27-adic coding (for details on encoding please check Task 3.1).

Task 3.4. Diffie-Hellman Key Exchange Protocol

1. The Diffie-Hellman protocol is secure against passive (eavesdropping) attacks. Explain why.

2. Describe a possible man-in-the-middle (MITM) attack on the Diffie-Hellman protocol and explain its consequences.

Attachment:- Symmetric and Asymmetric Cryptography Assignment.rar

Reference no: EM131223671

Questions Cloud

Conflict resolution paper assignment : Read the case study for this unit regarding ExtremeNet and Allen Lopez. As the Chief Executive Officer for ExtremeNet, you are responsible for resolving the conflict between Allen Lopez and ExtremeNet in a manner that demonstrates solid ethical re..
Clear identification of components : Please explain with complete details your answers. Organize your ideas and write your answers with a clear identification of components, relationships, solutions... of the methods, tools, and techniques that you describe Please explain with comple..
Concept that reflects the importance of integrating people : Sociotechnical systems is an organizational behavior concept that reflects the importance of integrating people and technology to create high-performance work systems. As computers and information technologies continue to dominate the modern workp..
Balance-focus on difference between accumulated depreciation : Turn to the balance and focus on the difference between accumulated depreciation at the start and at the end of the year. Where can I go to get depreciation expense information to help complete my restatement activities? Turn to the balance and focus..
Describe your approach to cryptanalysis of the ciphertext : Laboratory Exercises II: Symmetric and Asymmetric Cryptography. Given that the Caesar's cipher is used, recover the plaintext that corresponds to the following ciphertext: Sodlqwhaw wr eh hqfubswhg. Describe your approach to cryptanalysis of the ci..
What are triggering events and strategic decisions : 1. What is strategic management and how does it benefit an organization? How would the strategic management model help evaluate strategy? (Chapter 1) 2. What are triggering events and strategic decisions and how do they relate to each other?Give s..
Find leadership necessary for leading and inspiring : What does your conclusion mean for how we in public administration approach community projects? Remember to ground this discussion in theory, returning to sources you used in prior leadership courses to add support to your position. As always, cit..
Should you alert the physician or office manager : Based on the above scenario what information should the medical staff be aware of to help them interact effectively with the patient? Are there specific guidelines they should follow in terms of cultural diversity? If so, what would those be?
Determine the total of each production cost incurred : Marcelino Co.'s March 31 inventory of raw materials is $80,000. Raw materials purchases in April are $500,000, and factory payroll cost in April is $363,000. Determine the total of each production cost incurred for April (direct labor, direct materia..

Reviews

Write a Review

Computer Engineering Questions & Answers

  Create a detailed diagram or set of diagrams to show how

create a detailed diagram or set of diagrams to show how the letter a is transmitted in an electrical light and radio

  Questiondeveloping requests specification for this

questiondeveloping requests specification for this integration. you have to use all of tools available to you to elicit

  What does algorithm compute eciency

What does algorithm compute - what is its basic operation and how many times is the basic operation executed?

  Questionseparate following c program into appropriate

questionseparate following c program into appropriate lexemes using discussion as a guide.float limitedsquarex float

  Find out the model number of the item

Find out the maker(s) of the PC(s) with the fastest processor among all those PCs that have the smallest amount of RAM.

  If you were designing a wireless network would you spend

a wireless network will only function as well as it is designed to function. outline the four steps involved in

  Create a web page tags.aspx for viewing tags

Create a web page Tags.aspx for viewing tags. Use a GridView control to provide access to the list of tags in the database. Put checkboxes beside each tag.

  Assignment program crawler game

Assignment program Crawler game: Update the Crawler game attached to allow a user to traverse the Cave. They should be prompted in each room to pick an exit or quit

  Description in the last episode of the mafghanistan trilogy

description in the last episode of the mafghanistan trilogy the mamerican forces invaded liberated mafghanistan in

  Write the code for an ordered linked list module

Select Makefile from the file list and hit Compile/Validate. This will compile ordereList.c and main.c, producing an executable named main. If you double click main, the program will execute and should produce the output shown in the example below..

  Declaring a variable using the public, friend, or private

In visual basic.NET, what makes up a component? What are the advantages of components? In addition, what are the types of class data and how do you decide which is appropriate? describe the difference between declaring a variable using the keyword..

  What were the advances in information technology that

prepare a 300- to 500-word paper that answers the following questionwhat were the advances in information technology

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd