Al-Imam Mohammad Ibn Saud Islamic University
College of Computer and Information Sciences
Computer Science Department
Course Title Network Security
Course Code CS 337
Course Instructor Dr. Feras Aljumah
Assignment 1
Submission Date: 2024/5/14
Section :171
Student name:
Abdulkreem Alshunifi
441016459
1
Introduction to PGP Assignment:
In this assignment, you will learn how to protect your emails using
Pretty Good Privacy (PGP).
PGP is a technology that encrypts and signs your emails to keep them
safe from prying eyes and ensure the confidentiality, integrity, and
authenticity of your emails.
First, we create a file:
file named "kreem.txt" and put the text "abdulkreem" inside the file.
This is a file we will use for encryption and decryption.
2
generate-key:
here will use (gpg--full-generate-key)
Please select what kind of key you want:
Your selection: RSA
RSA keys may be between 1024 and 4096 bits long.
keysize: (3072)
Please specify how long the key should be valid.
Key is valid for: key does not expire.
GnuPG needs to construct a user ID to identify your key.
Real name: abdulkreem alshunifi
Email address: k2-u@hotmail.com
3
Passphrase:
a passphrase for a key is like a password that you set to protect your private key
in encryption systems, adding an extra layer of security.
Our Passphrase is "VoiDNeT1" .
4
Here our key:
5
create a file for key:
The file "myKey.txt" we created is empty because we plan to use it for a key.
Export public key:
We use (gpg –export -a -o myKey.txt k2-u@hotmail.com).
6
Encryption:
Here, we encrypt the file by using the key.
Now we have a new encrypted file named "kreem.txt.gpg" and the original
unencrypted file "kreem.txt".
Delete file:
(rm kreem.txt)
Here we delete the original unencrypted file "kreem.txt".
Now we only have the encrypted file "kreem.txt.gpg".
7
Decryption:
(gpg -d kreem.txt.gpg > krem.txt)
Here, we decrypt "kreem.txt.gpg" and save it as a new file named "krem.txt".
He will ask about passphrase "VoiDNeT1".
Here, you'll see the file, and the encrypted text was
"abdulkreem".