PKI Lab
PKI Lab
Group 1
Date Submitted:
April 15, 2021
The .cnf file extension allows to connect with telnet connection files. These files
mainly store the information which is used to connect with telnet connection.
Provide the screenshot of creating the necessary folder and files for this task: [1 Mark]
-keyout Used to give a path to a filename, where it writes newly created private keys.
-out Specifies the output file where the result will be stored.
-aes128 Encrypts the private key with specified cipher before resulting.
Please provide the screenshot of output for running this command and answer the
questions below?[2 Marks] [0.5 for each questions and 1 for screenshot]
1. What is the output file?[0.5]
The output file generated after running the command:
$ openssl genrsa -aes128 -out server.key 1024
is “server.key” file.
2. What is the role of the output file? [0.5]
The output file “server.key” file stores the public/private RSA key pair generated by
the openssl command.
Please fill out the table below and explain what is this command used for? [2 Marks]
Answer:
rsa Runs the RSA encryption program.
-in filename Specifies the input filename to read for processing the result.
Generating Certificates
Please fill out the table below to explain the related openssl commands parameters :
ca Certificate Authority module is loaded.
-in filename Specifies the input filename to read for processing the result.
server.csr Server.csr is the input filename to read for processing the result.
Please provide the screenshot of how you configure the web server and what is the
result. Then write down your observation. [2 Marks for screenshot and the result + 1 Mark
for observation]
Step1: Configuring the DNS
Go to the file named hosts in the /etc directory.
The /etc/hosts file opens up.
Adding the following entry in /etc/hosts file.
127.0.0.1 SEEDPKILab2020.com
Copy the contents of “server.key” and “server.crt” files into “server.pem” file.
Launch the web server using “server.pem” file.
In the prompt, check mark the option “Trust this CA to identify websites”.
Click “Ok” and we will see the certificate in the Certificate Manager.
Reload the browser and visit the url “https://seedpkilab2020.com:4433” and we can now see
that the browser has accepted the certificate and has also recognised the CA.
Modify a single byte of server.pem, and restart the server, and reload the URL. What do
you observe? Provide the screenshot of the result. [2 Marks]
Observation: When a single byte of server.pem is changed, and we restart the server, the
server gives an error and does not accept the key file. When we reload the URL, the browser
does not establish the connection because the server is not able to set up the webpage.
Screenshots:
Open the file server.pem
The file server.pem is displayed.
We change the single byte of “h” to “p” as shown in the image below.
Save and exit.
Create a directory /cryptopki in /var/www directory. Also, copy the html file (index.html) from
/var/www/html/ directory to /var/www/cryptopki directory that we created.
Create a directory /ssl in /etc/apache2 where the public and private keys of the webpage are
kept.
Copy the server.crt and server.key files into pki_cert.pem and pki_key.pem files respectively.
Then move these .pem files to /etc/apache/ssl directory for the server to access these files.
Provide a screenshot of the changes you have done on each file. [2 Marks]
Go to the /etc/apache2/sites-available directory and open the file named “000-default.conf”.
Changes in the file: 000-default.conf ; Add the <VirtualHost *:80> as shown in the image below:
Next, open the file named default-ssl.conf.
Output of the task: Accessing the url “https://seedpkilab2020.com” is shown in the following
image.
Please explain your observation.
As we have seen in the experiment of this task, we have used a pre built html file (index.html)
as a frontend for the website named SEEDPKILab2020.com and have deployed the certificate
of the website on an apache server and made it a secure webpage. We have also observed that
any changes to the default-ssl.conf file deploys changes in the https webpage, however, any
changes in the 000-default.conf file deploys changes in the http webpage of the website. That
means in order to deploy a certificate to the server, we need to make changes in the default-
ssl.conf file which then makes the connection between the browser and the server secure.
Add the <VirtualHost *:443> element, as shown in the image below, in the file for the website
“instagram.com”.