Iss Homework Period Max of Students: Openssl 2 Weeks From 5/15/2021 1 Student

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

 

ISS Homework OpenSSL


Period 2 weeks from 5/15/2021
Max of Students 1 Student
 
 
1. Objectives
The assignment aims at applying the cryptography techniques. It helps
the student in acquiring the necessary knowledge in understanding
cryptography applications and in securing data using encryption
techniques.
Objectives can be summarized as follows:
Understanding cryptography applications.
Encrypting and decrypting using Triple DES, AES and RSA.
Hashing using MD5.
Using digital certificates.
Using SMIME for securing email.
Purpose
 
 
The purpose is to master OpenSSL, an open source toolkit providing
general purpose cryptography features. It aims at mastering the following
skills:
1. Encryption/Decryption using symmetric cryptography algorithms.
2. Creating Private/Public keys
3. Encryption/Decryption using asymmetric cryptography algorithms.
4. Hashing content.
5. Signing content.
6. Creating and signing certificates.
7. Exchanging secure email messages.
 
To achieve these goals, the assignment asks the student to build a
Certification Authority (CA). The CA responsibilities are:
 Creating and signing its own certificate
 Signing certificates for customers
 
 
 
 
 
2. Tasks
 

2-1. Basic Symmetric and Asymmetric Practices


 

You will use OpenSSL to handle some basic symmetric and asymmetric
functions.
 
1. Create a text file called "message.txt" containing the full name, ID
  1
 

and class of each one of the members of your assignment group.


2. Write a command line in a batch file called "Gen_DES3_Key.bat"
to generate a Triple DES key coded in base64. Run the command
and save the key in a
file called
"DES3_key.txt".
3. Write a command line in a batch file called "Encrypt_DES3.bat" to
encrypt
the file "message.txt" using the Triple DES algorithm and the key
stored in "DES3_key.txt". Run the command and save the result
in a file called "Encrypted_DES3.txt".
4. Write a command line in a batch file called "Decrypt_DES3.bat" to
decrypt
the file "Encrypted_DES3.txt" using the Triple DES algorithm and
the key stored in "DES3_key.txt". Run the command and save
the result in a file called "Decrypted_DES3.txt".
5. Write a command line in a batch file called
"Generate_RSAKeys.bat" to generate RSA public/private keys of
2048-bits' length. Run the command and
save the RSA keys in a file called
"RSAKeys.pem".
6. Write a command line in a batch file called
"Extract_RSAPublic.bat" to extract the RSA public key from the
RSA keys file "RSAKeys.pem". Run the command and save the
public key in a file called "RSA_PublicKey.pem".
7. Write a command line in a batch file called
"Encrypt_RSA_Public.bat" to
encrypt the file "DES3_key.txt" using the RSA public key. Run the
command and save the result in a file called
"Encrypted_RSA_Public.txt".

  2
 

8. Write a command line in a batch file called


"Decrypt_RSA_Private.bat" to decrypt the file
"Encrypted_RSA_Public.txt" using the RSA private key. Run the
command and save the result in a file called
"Decrypted_RSA_Private.txt".
 
2-2. Certification
 

You will create a Certification Authority (CA) and two MIME clients.
You need first to create a subfolder called "newcerts", a text file called
"serial.txt" containing the text "01" and an empty text file called
“index.txt".
 
9. Write a command line in a batch file called
"Generate_CAKeys.bat" to generate the public/private key pair of
the email Certification Authority (MIME CA) in PEM format.
Run the command and save the result in a file called "ca.key".
10. Write a command line in a batch file called "Create_CACert.bat"
to create the auto-signed certificate of the CA in PEM format using
the configuration file "openssl.txt" provided with the assignment.
Run the command and save the result in a file called "ca.pem".
11. Write a command line in a batch file called
"Visualize_CACert.bat" to create a readable version out of
"ca.pem" to visualise the content of the auto- signed certificate of
the CA. Run the command and save the result in a file called
"ca_cert.txt".
12. Write the needed command lines in a batch file called
"Generate_ClientKeys.bat" to generate the public/private key
pairs for two email clients (MIME clients) "C1" and "C2" in
PEM format. Run the commands and save the results in two files
called "C1.key" and "C2.key" respectively.
13. Write the needed command lines in a batch file called
"Generate_ClientRequests.bat" to generate a certificate request for
each client using the configuration file "openssl.txt" provided
with the assignment. Run the commands and save the results in
two files called "C1.crs" and "C2.crs" respectively.
14. The certificate requests should be sent to the CA to be signed,
which should
generate the client certificates. Taking the role of the CA, write
the needed command lines in a batch file called
"Sign_ClientRequests.bat" to sign the requests "C1.crs" and
"C2.crs" of the two MIME clients, in order to generate their
respective identity certificates. Run the commands and save the
results in two files called "Signed_C1_CRS.ca" and
"Signed_C2_CRS.ca" respectively.
  3
 

2-3. Sending Secure


Messages
 
Client “C1” will send a message to client “C2” securely. Client “C1”
will encrypt and sign his/her message and send it to client “C2”.
 
15. Choose a password of 12 characters at least and store it in a
file called "pwd.txt".
16. Write a command line in a batch file called "Encrypt_AES.bat" to
encrypt the
Message "message.txt" using the password stored in "pwd.txt"
and the AES algorithm. Run the command and save the
result in a file called
"message.enc".
17. Use the command "smime" to write a command line in a batch
file called "Encrypt_pwd.bat" to encrypt the password stored in
"pwd.txt" using the public key of the client "C2" (his/her
certificate). Run the command and save the result in a file called
"pwd.enc".
18. Write a command line in a batch file called
"Generate_HashC1.bat" to generate a hash value out of the
message "message.txt" using the MD5 algorithm. Run the
command and save the result in a file called "message_hash.txt".
19. Use the command "smime" to write a command line in a batch
file called "Sign_Message.bat" to sign the hash value stored in
"message_hash.txt" using your private key. Run the command and
save the result in a file called "message.sig".
 
2-4. Receiving Secure Messages
 

Client “C2” will receive the encrypted and signed message sent by client
“C1”. He/she will receive the encrypted message text "message.enc",
the encrypted password "pwd.enc" and the message signature
"message.sig". Client “C2” will decrypt and verify the received message.
 
20. Use the command "smime" to write a command line in a batch
file called "Decrypt_Pwd.bat" to decrypt the encrypted password
"pwd.enc" using the private key of client “C2”. Run the command
and save the result in a file called "pwd_dec.txt".
21. Write a command line in a batch file called "Decrypt_AES.bat" to
decrypt the
Encrypted message "message.enc" using the password stored in
the file "pwd_dec.txt" and the AES algorithm. Run the command
and save the result in a file called "message_dec.txt".
22. Write a command line in a batch file called
"Generate_HashC2.bat" to
  4
 

Generate a hash value out of the message "message_dec.txt"


using the MD5 algorithm. Run the command and save the result
in a file called "message_dec_hash.txt".
23. Use the command "smime" to write a command line in a batch
file called
"Verify_Message.bat" to verify the signature stored in the file
"message.sig" using the public key of the client "C1" (using
his/her certificate). Run the command and save the result in a
file called "message_verify_hash.txt".
24. Explain in a Word document called "Mail_Security.doc" the
security objectives (Confidentiality, Integrity and Availability) and
functions (Authentication, Authorization and Non-repudiation)
that this secure mail exchange model achieves. Also identify if any
vulnerabilities could exist.
 
 The OpenSSL package can be downloaded from:
 
http://www.slproweb.com/products/Win32OpenSSL.html
 
 To read about OpenSSL go to the official website
 
http://www.openssl.org/
 
Notes:
The student should deliver a one-folder ZIP package containing – in
addition to the subfolder "newcerts", the text file "serial.txt", the text file
"index.txt" and the configuration file "openssl.txt" – the following files:
1. Message.txt
2. Gen_DES3_Key.bat
3. DES3_key.txt
4. Encrypt_DES3.bat
5. Encrypted_DES3.txt
6. Decrypt_DES3.bat
7. Decrypted_DES3.txt
8. Generate_RSAKeys.bat
9. RSAKeys.pem
10. Extract_RSAPublic.bat
11. RSA_PublicKey.pem
12. Encrypt_RSA_Public.bat
13. Encrypted_RSA_Public.txt
14. Decrypt_RSA_Private.bat
15. Decrypted_RSA_Private.txt
16. Generate_CAKeys.bat
17. ca.key
18. Create_CACert.bat
  5
 

19. ca.pem
20. Visualize_CACert.bat
21. ca_cert.txt
22. Generate_ClientKeys.bat
23. C1.key
24. C2.key
25. Generate_ClientRequests.bat
26. C1.crs
27. C2.crs
28. Sign_ClientRequests.bat
29. Signed_C1_CRS.ca
30. Signed_C2_CRS.ca
31. pwd.txt
32. Encrypt_AES.bat
33. message.enc
34. Encrypt_pwd.bat
35. pwd.enc
36. Generate_HashC1.bat
37. Message_hash.txt
38. Sign_Message.bat
39. message.sig
40. Decrypt_Pwd.bat
41. pwd_dec.txt
42. Decrypt_AES.bat
43. Message_dec.txt
44. Generate_HashC2.bat
45. Message_dec_hash.txt
46. Verify_Message.bat
47. Message_verify_hash.txt
48. Mail_Security.doc
 
 
 
Good Luck
AA

  6

You might also like