Lab4-Symmetric Key Encryption
Lab4-Symmetric Key Encryption
1 Overview
This lab is a continuation from last week’s cryptography content.
2 Lab Tasks
2.1 Task 1: Encryption Mode – Corrupted Cipher Text
To understand the properties of various encryption modes, we would like to do the following exercise:
2. Unfortunately, a single bit of the 30th byte in the encrypted file got corrupted. You can achieve this
corruption using a hex editor.
3. Decrypt the corrupted file (encrypted) using the correct key and IV.
Please answer the following questions: (These answers contribute to the lab4 assignment)
(1) How much information can you recover by decrypting the corrupted file, if the encryption
mode is ECB, CBC, CFB, or OFB, respectively? Please answer this question before you conduct this
task, and then find out whether your answer is correct or wrong after you finish this task. (2) Please
explain why. (3) What are the implication of these differences?
1. The openssl manual says that openssl uses PKCS5 standard for its padding. Please design
an experiment to verify this. In particular, use your experiment to figure out the paddings in the
AES encryption when the length of the plaintext is 20 octets and 32 octets.
2. Please use ECB, CBC, CFB, and OFB modes to encrypt a file (you can pick any cipher). Please
report which modes have paddings and which ones do not. For those that do not need paddings,
please explain why. (Include the explanation in your lab4 assignment)