Assignment 2 - Secret-Key Encryption Lab

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Assignment 2 - Secret-Key Encryption Lab

All tasks in this assignment are based on SEED Labs – Secret-Key Encryption Lab tasks and
you should use the original lab for more information.
https://seedsecuritylabs.org/Labs_16.04/Crypto/Crypto_Encryption/

The learning objective of this lab is for students to get familiar with the concepts in the
secret-key encryption.
For performing these tasks you can either use​ iris.nyit.edu shell​ or download and run
SEEDUbuntu16.04 pre-built VM. All needed tools are installed on both.

All your results and screenshots should be included in your report. Please submit the
documents separately on Blackboard by the deadline. NO ZIPPED FILES ALLOWED

Task 1: Frequency Analysis Against Monoalphabetic Substitution Cipher. [10 marks]


There is a ciphertext file on this assignment’s attachment (ciphertext1.txt). Your job is to use the
frequency analysis to figure out the encryption key and the original plaintext.
You can use the following online tool:
http://www.brianveitch.com/maze-runner/frequency-analysis/index.html

Please report the encryption key (mapping table) and the original plaintext.

Task 2: Encryption using Different Ciphers and Modes. [10 marks]


Try to use ​openssl​ tool to encrypt/decrypt a file for 3 different ciphers: -aes-128-cbc, -bf-cbc,
-aes-128-cfb. You can choose any plaintext message and store it in a file as openssl
encryption’s input.

Please include your commands, screenshots, and results in the report.

Task 3: Encryption Mode – ECB vs. CBC [10 marks]


Select a bmp picture of your choice, encrypt the picture with ​openssl​ by des-cbc and des-ecb,
display the encrypted picture using a picture viewing program, and decrypt it again.

Please include your commands and screenshots in the report and explain your
observations. Also, upload your input and output files

Task 4: Padding [10 marks]


Use DES with ECB, CBC, CFB, and OFB modes to encrypt three files, which contain 5 bytes,
10 bytes, and 16 bytes, respectively. Please report which modes have paddings and which ones
do not. Please display what paddings are added to the three files. It should be noted that
padding data may not be printable, so you need to use a hex tool to display the content.
Please include your commands, screenshots, and results in the report and upload your
inputs and outputs.

Task 5: Error Propagation – Corrupted Cipher Text [10 marks]


Create a text file that is at least 1000 bytes long. Encrypt the file using the AES-128 cipher with
ECB, CBC, CFB, and OFB mode. Alter a bit of the encrypted files using a hex editor (bless,
Vim).

How much information can you recover by decrypting the corrupted file, if the encryption
mode is ECB, CBC, CFB, or OFB, respectively? Please provide justification.
Please include your commands, screenshots, and results in the report.

Task 6: Programming using the Crypto Library [20 marks]


You are given a plaintext and a ciphertext, and your job is to find the keys that are used for the
encryption.
You should use an English word list, we attached one to this assignment(words.txt). The
plaintext, ciphertext, and IV are listed in the following:

plain text: "This is a top secret."


algorithm: -aes-128-cbc
iv: 010203040506070809000a0b0c0d0e0f
ciphertext: ciphertext6.bin

key:?

Submit the following documents separately on Blackboard by the deadline.


1) All your code files
3) A MAKEFILE that automates the building/compiling of your code.
4) Include your answer and test results with screenshots in the report

Appendix
How to edit a binary or hexadecimal data of a file using Vim editor
https://askubuntu.com/questions/786658/how-do-i-edit-the-binary-or-hexadecimal-data-of-a-file-i
n-ubuntu

You might also like