Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
21 views

Week 1 Open SSL

The document discusses OpenSSL and how to use it for encryption, decryption, hashing and digital signatures. It provides examples of encrypting and decrypting files using RSA public/private key pairs as well as signing and verifying messages. It also presents quiz scenarios requiring the use of OpenSSL for different security requirements.

Uploaded by

sc.hassann
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Week 1 Open SSL

The document discusses OpenSSL and how to use it for encryption, decryption, hashing and digital signatures. It provides examples of encrypting and decrypting files using RSA public/private key pairs as well as signing and verifying messages. It also presents quiz scenarios requiring the use of OpenSSL for different security requirements.

Uploaded by

sc.hassann
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

Week 2. Security Labs OPenSSL.

Understanding basic security requirement.


Able to configure various security requirement.

Download the OPENSSL for windows from


http://slproweb.com/products/Win32OpenSSL.html

You need to install two files into your computer.


Win32 OpenSSL v1.0.1h Light

And Visual C++ 2008 Redistributables


1. Symmetric encryption. Google to find the answer
Encryption using symmetric key

2. Decryption using symmetric key. Google to find the answer


Note: you must use the same encryption algorithm to decrypt. There are few type of encryption
algorithm such as des, des3, idea, aes etc. and each with various options. In total there are about
58 combinations.
3. Hashing. Google to find the answer

4. Asymmetric encryption RSA.


st
1 you need to generate the key first. First you need to generate the key pair for each person
involved.

First generate the private key


openssl genrsa -out testkey.private 2048
then from the private key, generate the public key
openssl rsa -in testkey.private -pubout -out testkey.public

You can use 1024, 2048 or 4096 key length. Longer key will take an exponential time to
produce.
You can check the file by
C:\OPENSS~1\bin>type testkey.private
-----BEGIN RSA PRIVATE KEY-----
MIIEpgIBAAKCAQEAzPeFU1aM+jGRGqPqIrpd/fHu3AloBpQ7z2mRptVMJH21JQVG
z3+0SC3fXzORuAV5XMnx/53Axs/EcT08ab1FRBtJEPxaSBubxTNcZ37lgjRR7JA9
…./* output too long omitted */
eN6yC2LZx01BvOVc9rDNiWyjIa9MoY5VNxglwsFcubZljq41hQwak4zb
-----END RSA PRIVATE KEY-----

C:\OPENSS~1\bin>type testkey.public
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzPeFU1aM+jGRGqPqIrpd
/fHu3AloBpQ7z2mRptVMJH21JQVGz3+0SC3fXzORuAV5XMnx/53Axs/EcT08ab1F
RBtJEPxaSBubxTNcZ37lgjRR7JA9cv/hmiwohGSYoUxy/cnb16Jk38ehXNrmtDVa
…./* output too long omitted */
OE5A76da8m9IgMRN+lSqyv5qfBOGZzlGgM1B+EeP4Q4k0gPw2DlDyKKEaCu1sePi
TwIDAQAB
-----END PUBLIC KEY-----
Let said for Bob and Alice and the keys are Bob.priv, Bob.pub, Alice.priv and Alice.pub

openssl genrsa -out Bob.priv 2048


openssl rsa -in Bob.priv -pubout -out Bob.pub
openssl genrsa -out Alice.priv 2048
openssl rsa -in Alice.priv -pubout -out Alice.pub

Special Note:
openssl rsautl is used to do RSA encryption and decryption
when a public key is used as input –pubin option must be included.

Scenario 1.
Alice want to send an encrypted message to Bob. Only bob can read the message.
The filename is file1.txt

The content of file1.txt is “ For the first time, MMU student boleh encrypt/decrypt”.

C:\OPENSS~1\bin>type file1.txt
For the first time, MMU student boleh encrypt/decrypt

Encryption command. Google to find the answer

Decryption command. Google to find the answer


Scenario 2.
Alice wants to make a public announcement. Bob need to verify that the message is coming
from Alice and non-body else. The file is file1.txt

Encryption . Google to find the answer

Decryption Google to find the answer

Quizes: Many different scenario will be given such as how to use OpenSSL to do a digital
certificate. DO some googling before quiz ok.

E.g. Scenario 3.
Alice wants to send an encrypted message (file1.txt) which only Bob can decrypt it.
At the same time, Bob needs to verify that the message is sent by Alice and not anyone else.
Write down the encryption steps and show a working solution to the lecturer using openssl
command as shown in Lab 10 Security Lab.

Let said it for Bob and Alice and the keys are Bob.priv, Bob.pub, Alice.priv and Alice.pub. List
down the security (encrypt, decrypt, sign) steps done by Alice and Bob.
Possible LAB TEST.

Alice wants to send a message to Bob with the following requirement. There are 16 scenarios with different
requirement. Some requirement may not make any senses at all. Please list down all the possible encryption,
decryption, hashing steps and command for Bob and Alice. Assume all message are large and cannot be
encrypted/verified by RSA.

The initial RSA keys used are Alice.public, Alice.private, Bob.public and Bob.private.
Nevertheless, you can generate other keys such as session key, symmetry keys from the random number
generator and the RSA keys.

No Secrecy Message Non- Replay List down the possible steps for Alice and
Integrity repudiation Protection Bob
1 No No No No
2 No No No Yes
3 No No Yes No
4 No No Yes Yes
5 No Yes No No
6 No Yes No Yes
7 No Yes Yes No
8 No Yes Yes Yes
9 Yes No No No
10 Yes No No Yes
11 Yes No Yes No
12 Yes No Yes Yes
13 Yes Yes No No
14 Yes Yes No Yes
15 Yes Yes Yes No
16 Yes Yes Yes Yes

You might also like