Week 1 Open SSL
Week 1 Open SSL
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
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
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