The Complete PGP Encryption Tutorial | Gpg4win & GnuPG

PGP Encryption Tutorial

What is PGP?

Pretty Good Privacy (PGP) is an encryption program that provides cryptographic privacy and authentication for data communication. PGP is used for signing, encrypting, and decrypting texts, e-mails, files, directories, and whole disk partitions and to increase the security of e-mail.

In essence, allows you to send files and messages securely over the Internet


What is RSA?

RSA (Rivest–Shamir–Adleman) is one of the first public-key cryptosystems and is widely used for secure data transmission.

RSA algorithm is asymmetric cryptography algorithm. Asymmetric cryptography means that it uses two different keys i.e. Public Key and Private Key.

As the name describes that the Public Key is given to everyone and Private key is kept private.


How PGP Works?

  • The public key is used to encrypt the message or text
  • The private key unlocks or decrypts the message or data.
  • You send the public key to the people you want to receive messages from or post it on your site so that they can encrypt sensitive messages that they want to send to you.
  • Once you receive an encrypted message, you use your private key to decrypt it.


Tools Required

Windows – gpg4win

Linux –  GnuPG & Gnu Privacy Assistant or GPA. I like GPA provides you with a neat graphical interface.



  • Download and install gpg4win
  • Generate Keypair with Kleopatra
  • Provide name and email if you want to
  • Advanced settings – Select RSA settings
  • Confirm your settings and enter your passphrase
  • Let it generate the keys – You need to generate entropy so move your cursor around etc. The higher the encryption the  more the entropy required.
  • Once created right click on the key and export public key
  • Then right click and export private key
  • You can open them both with notepad ++
  • You can send or post your public key so that it is accessible to people who want to send you information.
  • Make sure you keep your private key safe and backed up.


Senders perspective

  • Copy the public key
  • In your task bar, right click on the Kleopatra icon, go to ‘Clipboard’, then click ‘Certificate Import’


Encrypting a message

  • Copy the message or text
  • Right click on kleopatra and click on encrypt
  • Select recepient
  • Done, you can now send the message

Decrypting the message

  • Copy the message
  • Right click on Kleopatra and decrypt
  • Enter passphrase and the message will be copied to your clipboard.


  • Terminal – sudo apt-get install gnupg2 gpa
  • Generating keypair – gpg –full-generate-key
  • Using GPA – sudo gpa
  • Right click on key and export public – you can use to send to friends or post
  • For private key backup or export right click on key and select backup and save to a safe directory
  • Importing a key – click on keys and import public key
  • To Encrypt click on windows and clipboard and click on file to encrypt and decrypt.

Links Used In Video:


Liked it? Take a second to support Alexis on Patreon!
Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *