, 2
Lab 1.1: Securing Email Communications (RSA)
This lab demonstrates asymmetric encryption using RSA key pairs. Pasha generates a key
pair, shares the public key with Rina, and Rina uses it to encrypt a file that only Pasha can
decrypt .
Step 1: Generate Pasha's RSA Key Pair (on ZYWIN01)
The private key is generated first, then the public key is derived from it .
• Private Key: openssl genrsa -out privateKey.key 4096 (The search results show a
4096-bit key was used in a passed submission) .
• Public Key: openssl rsa -in privateKey.key -pubout -out PublicKey.key .
Step 2: Share the Public Key
Pasha emails the PublicKey.key file to Rina using Thunderbird .
Step 3: Encrypt the File (on ZYWIN02 as Rina)
Rina uses Pasha's public key to encrypt creditCardInfo.txt. The -pubin flag tells OpenSSL to
use a public key file for encryption .
• Command: openssl rsautl -encrypt -inkey PublicKey.key -pubin -in
creditCardInfo.txt -out creditCardInfoEncrypted.txt .
Step 4: Send and Decrypt
Rina emails the encrypted file back to Pasha. Pasha decrypts it using his private key (not
the public key) .