Instructions(8)

instructions(8)

User Manual: Pdf

Open the PDF directly: View PDF PDF.
Page Count: 2

Lab 6: Block Cipher
50.020 Security
Hand-out: March 15
Hand-in: March 22, 9pm
1 Objective
By the end of this lab, you should be able to:
Implement the ultra-lightweight PRESENT block cipher
2 Background
Read on PRESENT: an Ultra-lightweight Block Cipher (Section 3):
Read Netpbm image format:
3 Implementing PRESENT
Use Python script as a template to implement PRESENT block cipher with 80-bit
key and 64-bit block length.
You need to implement both the encryption and decryption portion.
Check your result using Appendix 1 of the above paper. Note that provides those
test cases at the end of the file.
4 Implementing ECB Mode
We are going to encrypt an image ( ). Check whether you can see the image by
typing:
Install ImageMagick if you cannot run display.
1
The above implementation is for a plaintext of 64-bit length. In this section, you need to ex-
tend your code so that it can work with plaintext larger than 64-bit. Use Electronic Codebook
Mode (ECB) for this purpose.
Use your ECB mode block cipher to encrypt the file . Decrypt the file and see
whether you can still see the same image. Use and run the file as the following.
5 Limitation of ECB Mode
ECB mode reveals some side-channel information about the plaintext pattern in the cipher-
text. In this section, we will try to learn information about the plaintext image from its ECB
ciphertext.
Download . This is a secret image, encrypted in ECB mode, with a secret key. Your
task is to recover the plaintext of the original image. The image is stored in PBM format and
has its header information stored in the file (that is known to the attacker, i.e.
you).
Write a Python script to extract the image pattern from . You can use
as a starting point.
Hint: You can ignore the first few characters which represent the header as it has al-
ready been given. The plaintext PBM image is black and white, i.e. the format only
has two values, either 0 or 1. You can assume that there is no space between the data
values.
6 Hand-In
Submit your present.py, ecb.py, and extract.py together with the decrypted letter.e
Make sure to put your username into the header of the submitted file.
2

Navigation menu