Week 5 - Anti-Forensics Technique-2
Lab 2 - PGsP Encryption: Secure Communication Using PGP
In this activity, you will learn how to use PGP (Pretty Good Privacy) for secure data communication by generating key pairs, encrypting and decrypting messages, and applying digital signatures.
Overview
PGP was created in the 1990s and provides cryptographic privacy and authentication for data communications and file encryption.
It offers strong security and privacy for protecting sensitive data and is widely used by individuals, businesses, and organizations.
However, PGP implementation requires some technical expertise, and the Web of Trust model may require careful management to maintain trust relationships effectively.
Learning Objectives
- Apply appropriate practices, tools, and techniques in the context of a given investigative scenario.
- Encrypt data in flight.
Task 1: Background
Visit the following websites to familiarise yourself with the basic concept of PGP Encryption:
- Fortinet: PGP Encryption
- Microsoft: PGP Encrypt File
- AT&T Cybersecurity: Explain PGP Encryption - An Operational Introduction
Setup
- Start the Kali Linux virtual machine. If you don't have one you can
- (Recommadnded)You can find a VM in your Cyberlab folder, or
- You can download kali vm from here then deploy. Login credentials:
- Username: kali
- Password: kali
Task 2: PGP Installation and Creating a Key Pair
-
Open a terminal in your Kali VM and install the necessary packages:
sudo apt-get install gnupg2 gpa -
Use the manual to learn about the tool:
man gpg -
Check the version:
gpg --version -
View available command-line options:
gpg --help -
Generate your public and private keys:
gpg --full-generate-key -
Choose key type: (1) RSA and RSA (default)
-
Select key size: 4096 bits (recommended for high strength)
-
Set key validity period (e.g., 1 day or forever).
-
Enter a username, email address, and a strong passphrase (required for decryption).
-
Export your public key to a file:
gpg --export -a "username" > name.pubkey -
Export your private key to a file:
gpg --export-secret-key -a "username" > name.privkey -
Import a public key:
gpg --import name.pubkey -
List all keys in your keyring:
gpg --list-keys
Task 3: Key Exchange and Encrypting/Decrypting Messages
-
Pair up with another person and share your public keys and usernames.
-
Import your partner’s public key into your keyring and confirm it appears in your list.
-
Create a text file (
text.txt) containing any information.
Encrypt it using your key and your partner’s public key:gpg -e -u "sender_username" -r "receiver_username" text.txtUse the
--armoroption if you want to send the message in ASCII format. -
Send the encrypted file to your partner via private email.
-
Decrypt a received encrypted file:
gpg -d filepath/filename.gpgor
gpg -d filepath/filename.asc -
Open and review the decrypted text file.
-
Manage or delete keys:
gpg --delete-secret-keys "username" gpg --delete-keys "username"
Self-Study Task
- Using the links above and
man gpg, investigate how to use gpg to create a digital signature. - Identify advantages and limitations of PGP, including key management and trust models.
- Determine what information can be identified from PGP metadata.
Best,
Ali.