Coursework 1 Resources
Specification
You need to pick the CW sheet based on your level of studies (3rd year, 4th year, or MSc). Use Vision for your course to get the right coursework sheet.
- Coursework 1 Marking Scheme
- Original picture (Task 2)
- English word list (Task 5)
- Plain text file (Task 5)
- Cipher text file (Task 5)
- line count script (Task 5)
- Makefile (Task 5)
- encrypt0.c (Task 5; stand-alone C example for EVP)
Files to download
Right-click on the following files and "save link as" to download them (full directory)
Other resources
The shell script f21cn.sh is useful to set environment variables, e.g. setting the path for shed. You don't strictly need this script, in which case you need to give the full path when calling shed.
If you are struggling with shell scription, do this Linux Introduction
Downloading the line count script:
wget http://www.macs.hw.ac.uk/~hwloidl/Courses/F21CN/Labs/CryptoI/line_count.sh
Running the line count script:
./line_count.sh words.txt Number of lines: 25143 The last line of the file is: zygote Expected number of lines: 25143 words.txt
For Task 5, modify the line count script by replacing the loop body with a call to openssl and comparing the resulting file with the given cipher-file. The line count example shows how to test the return code of the previous command.
... while read LINE do # add your code here done ...
Using Linux on your laptop
If you want to do the exercises on your laptop, make sure to install both OpenSSL libraries and the header files (you need the latter if you do the C programming option in Task 5). On Fedora/CentOs/Mandriva and other rpm based systems, you'll need these packages: openssl and openssl-devel To install a package, do for example: sudo rpm -ivh opensssl-devel You can check whether you have them already, using this command:
rpm -qa | fgrep openssl
I you use Ubuntu/Debian or another apt-based system, you will need packages: openssl and libssl-dev. To install a package, do for example: sudo apt-get install libssl-dev.
On the Linux lab machines, you don't need special -I or -L pathes when compiling. If the packages install header files and libraries in unusual places (outside /usr/) you should specify them explicitly as shown in the Makefile.