This homework is assessed. You need to use OpenSSL to perform the following steps. I will test using OpenSSL version 1.0.1 14 Mar 2012 on a virtnet node. Therefore I suggest you perform the steps on a virtnet node. In files/text below, replace ID with your actual student ID.
You must submit four files on Moodle: pubkey-ID.pem, sign-ID.bin, secretkey-ID.bin and ciphertext-ID.bin. In addition you must keep your own private key information (but do not submit it). After the homework deadline I will decrypt your ciphertext and verify your commands.
There are examples of most of the commands you need to complete the tasks in my description of public key encryption with OpenSSL. Note however you may need to make small changes - you cannot necessarily copy-and-paste the exact commands. Examples of generating the random key and encrypting with AES are in my simple introduction to OpenSSL.
A Bash shell script is just a text file containing a set of commands that you run on the command line. However the first line of the file must start with:
#!/bin/bash
Comments can be included by starting a line with #. The Bash script can be executed by typing:
$ bash scriptname.bash
executing all commands in the file. The following is a simple example:
network@node1:~$ cat randomkey.txt
d76fed4e2f464156
network@node1:~$ cat examplescript.bash
#!/bin/bash
pwd
ls /
# This line is a comment
echo "hello"
myvariable=`cat randomkey.txt`
echo "My variable is: $myvariable"
network@node1:~$ bash examplescript.bash
/home/network
bin etc lib mnt root selinux tmp vmlinuz
boot home lost+found opt run srv usr
dev initrd.img media proc sbin sys var
hello
My variable is: d76fed4e2f46415