Linux OpenPGP - Kleopatra Tutorial
OpenPGP is an encryption and authentication standard based on Phil Zimmermann's first PGP implementation. In this tutorial, we'll look at GnuPG, the native Linux OpenPGP implementation. However, since GnuPG is a command line tool, which may be esoteric to some, we'll use a graphical user interface (GUI) of GnuPG called Kleopatra. If you want to know how PGP works, click here.
1. Installing GnuPG
• First things first, you need to have GnuPG installed on your Linux system. GnuPG is usually pre-installed on most Linux distributions. However, if for some reason it's not, run the command:
sudo apt-get install gnupg
• If you're running a non-Debian-based Linux distro such as Fedora, run:
sudo yum install gnupg
2. Installing Kleopatra
• On Debian-based distros run the following to install Kleopatra:
sudo yum install kleopatra
• On non-Debian-based distros, run:
sudo yum install kleopatra
3. Generating A New Key Pair
• Upon launching Kleopatra, you'll see this window. Click on 'New Key Pair':
• In this screen, we're asked to enter a name and an email (email is optional). Enter a name and click 'Create' on the next window.
• Now we're asked to enter a password. This password is used to guard your PGP private key, which is critical, so make sure it's a decent password.
• At this point, Kleopatra will be generating a key pair for you. Wiggle your mouse a bit to give the tool some randomness to use.
• Now that the pair has been generated, click finish.
4. Exporting Your Public Key
What you will likely need to do now is give your public key to other people so that they could encrypt messages directed at you.
• Kleopatra will be showing a screen with an entry of the key pair you've just created. Right click on the entry and choose 'Export' to export your public key:
• The exported public key file will have a '.asc' extension. You can now give this file for others to communicate securely with them. You can also open the '.asc' file with a text editor and copy/paste the key liberally:
5. Decrypting A Message From The Clipboard
Say we've received a message or an email that was encrypted by the sender with our Public key that we generated in the previous section. A simple way to decrypt the message is copying the whole message into the clipboard and then heading to Kleopatra.
• Here's the encrypted message, we copy it to the clipboard:
• Then we head to Kleopatra, click on tools, choose clipboard from the drop menu, and then decrypt:
• Kleopatra will decrypt the message and store back into the clipboard. We can see the decrypted plain-text message by pasting it anywhere: