B 10: Encryption/Decryption using GPG
10.1 Using GNU Privacy Guard
(GnuPG) to encrypt and Decrypt emails
10.2 Using GNU Privacy Guard
(GnuPG) to encrypt and Decrypt Files
10.3 Lab Exercise
CLO6. Use software libraries to efficiently
apply cryptographic techniques
10.1 Using GNU Privacy Guard (GnuPG) to encrypt and
Decrypt emails
Step 1: Download the Gpg4win on windows machine
and install it.
Step 2: Go ahead and after successful
installation, close the window.
Generating your PGP pair key:
Step 3: Now open Kleopatra tool (A GUI
GPG Key Manager) to create a new asymmetric key pair (public &
private). Click on File -> New
Certificate.
Step 4: In the key generation wizard, click on
"Create a personal OpenPGP key pair" and in the next
window enter your basic details:
Step 5: In the next window, once review your
details and click "Create Key". It will prompt you for
entering a passphrase. Set a strong password and confirm it once
again in the next window.
Step 6: Within a few seconds (depending on your
system speed), Your Key pair will be generated (as shown).
Step 7: You should "Make a backup of your
file pair" somewhere safe. You can also export the public key
to the public directory by clicking on the Upload Certificate to
Directory Service.
Step 8: Once done, the key manager main
interface will show your certificate as shown:
Step 9: Select your newly generated certificate
-> Right click -> click on Export Certificates to
save your Public keys on the desktop.
You will have to exchange your public keys with whom you want to
make secure communication via mails. Many people post their
public keys to their personal websites. You can send it as
attachments to everyone you email, just so they have them.
Once your friends will have your Public keys, they can import it
Kleoptra software via 'Import Certification' option from
the menu.
Composing an encrypted email:
Step 1: Open Outlook -> Compose a new mail
and write the recipient’s address, Subject and your message.
Note: You should already have your email ID configured
over Outlook software on windows machine and if your Outlook
doesn't have OpenPGP, then you can install 'Outlook Privacy
Plugin' to enable it.
Step 2: Under GpgOL menu (as shown), click on
'Encrypt'. The software will automatically import the
public keys of the recipient from the Key Manager (only if
exists or imported before).
Step 3: If you also want to attach some files
to this encrypted email, then under GpgOL menu, click
Encrypted File and select the file to be attached and SEND
mail.
When you or the recipient will receive the encrypted mail,
one should first decrypt it using private keys.
Step 4: Under GpgOL menu, click
on 'Decrypt' to convert the email into readable form. To
proceed, It will ask for the secret passphrase entered at the
time of creation of key pair.
That's it! Other than Outlook you can also use various
desktop email clients (Thunderbird or Postbox) or web mail, that
also support PGP encryption. You can import your key pair to other
software also in order to manage the same account.
9.2 Using GNU Privacy Guard (GnuPG) to encrypt and
Decrypt Files
Step 1: Right click on the file you want to encrypt. In GPGEx
options Choose Encrypt.
Click on Encrypt and choose Next
Step2: Enter the Recipients Public Key and choose Encrypt
Step3: To decrypt the file
Right click on the file and choose Decrypt
9.3: Lab Exercise
1. Create a file called “Confidential_yourname”. Encrypt
it using your friends Public Key and send to your friend.
2. Generate a key pair for you and send your public key to your
friend.
Receive a file “Confidential_your_friendsname” Decrypt it and
read the message.
B 10: Encryption/Decryption using GPG 10.1 Using GNU Privacy Guard (GnuPG) to encrypt and Decrypt emails 10.2 Using GNU
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am