Your task is to use OpenSSL to perform a set of cryptographic operations. When performing…
Your task is to use OpenSSL to perform a set of cryptographic operations. When performing
cryptographic operations you must be very careful, as a small mistake (such as a typo) may
mean the result is an insecure system. Read the instructions carefully, understand the examples,
and where possible, test your approach (e.g. if you encrypt a file, test it by decrypting it and
comparing the original to the decrypted). It is recommended you use virtnet to perform the
Perform the following steps:
(a) For all the following steps, record the command(s) you used in a file called
[studentID]-commands.bash. This file should be a Bash shell script, containing only
commands that can be executed and optionally comments (starting with # character).
(b) Generate your own RSA 2048-bit key pair. Use the public exponent of 65537. Save
your key pair as [studentID]-keypair.pem.
(c) Extract your public key and save it as [studentID]-pubkey.pem.
(d) Create a text file called [studentID]-message.txt and include your student ID and
full name inside the file. This file is referred to as the message or plaintext.
(e) Sign your message file using SHA256, saving the signature as [studentID]-
(f) Generate a 128 bit random value using OpenSSL. This value will be used as a secret
key. Store the key as a 32 hex digit string in a file [studentID]-key.txt.
(g) Encrypt your message file using AES-128-CBC and the key generated in step (f). Use
an IV of all 0’s (that is, 32 hex 0’s). Save the ciphertext as [studentID]-
(h) Encrypt your [studentID]-key.txt file using RSA so that only the Unit Coordinator
can view the contents. Save the encrypted key as [studentID]-secretkey.bin.