CSC8520 Open SSL and Bash Scripting for Cryptography :
The objective of the assessment is to assess the understanding of basics of Symmetric Key Cryptography. There are two questions in Assignment 1. Assignment 1 has weight 20% in the overall assessment of the course.
Question 1: Substitution Cipher. Full marks: 8 marks
You are given a substitution-box (ie. S-box) as shown below:
- Your task: for full marks, you must list all the steps of finding the substitutions for the decimal numbers 14, 8, and 3.
- Submission: a .pdf file listing all the steps of finding the substitutions for the decimal numbers 14, 8, and 3.
Question 2 (12 marks): Write a bash script to check the hash value of a file (using the openssl toolkit).
You are given a folder hash files.zip containing five binary files (named as hash val i.bin for i = 1, 2, 3, 4, 5), which contain five different hash values (you can read the values by opening the files). Out of the five files, we’re looking for a specific file which matches the hash value returned by implementing the hashing al- gorithm SHA1 on the file rainbrowcrack−1.7−linux64.zip. (Note: this question is not about rainbow cracking, but about hashing the file rainbrowcrack−1.7−linux64.zip.)
- Your task: Please write a bash script to find the correct file. More specifically, you have to generate the SHA1 value of the file rainbrowcrack−1.7−linux64.zip, and then go through each the five files to determine which file contains the SHA1 value you generated. An expected output is shown in Figure. 1 below (yes, the correct file is hash val 3.bin).
Figure 1: An expected output for Question 2
• Submission for CSC8520 Open SSL and Bash Scripting for Cryptography:
- your bash script file with proper and sufficient comments.
- your testing result, i.e., the output after running your bash script. An expected output is shown in Figure. 1.CSC8520 Opening SSL and Bash Scripting for Cryptography
- The folder hash files.zip can be downloaded by using the command:
$ wget ’https://docs.google.com/uc?export=download&id=1gqDEuYMdpJP3X5-CkMXX4Ggyt1j_4aAD’ -O hash_files.zip
- The file rainbrowcrack−1.7−linux64.zip can be downloaded by (the same as Step 1 of Question 3 in Practicum 2)
Assignment 1 Marking Rubrics for Bash Scripting
- Question 1:
- 1 marks for retrieving correct binary numbers of 14, 8, and 3
- 1 marks for retrieving correct decimal numbers after substitution.
- 6 marks for correct steps for each number 14, 8, and 3. (You have to list the steps for each number)
- Question 2:
- 8 marks for writing a bash script to go through the five hash value files and find the correct file before ending the program. This includes 2 marks for generating the SHA1 value of the file rainbrowcrack−1.7−linux64.zip, 2 marks for writing a loop, and 4 marks for finding the correct file.
- 1 mark for proper and sufficient comments
- 3 marks for displaying the output as shown in Figure. 1.
- CSC8520 Opening SSL and Bash Scripting for Cryptography