Using GNU Privacy Guard (GPG)

This is the first a few tutorials I will be posting based on GPG.

What is GNU Privacy Guard:
GPG is an encryption technology. Its first version was designed in 1991 as a public cryptographic system called “Pretty Good Privacy(PGP)”. Then it got rewritten and licensed under the Gnu Public License. This new system because an standard for file and email encryption in linux and unix systems.

The ways GPG Works:
With GPG you generate a public and private key. GPG uses asymmetric key cryptography meaning that one key is used to encrypt and another is used to decrypt. Which would be public, private. You would always keep the private key private meaning only you should have it, as the public key anyone can have it. Then messages and files encrypted with the “public” key can only be decrypted with the private key.

Creating Keys:
To start the key generation process run the command
gpg –gen-key
Now you will need to fill in what you’re prompted for.

  1. The type of key you want
  2. The keysize you want
  3. How long the key should be valid for
  4. If the info you selected is correct
  5. Your real name
  6. Email address
  7. Passphrase

Now that you have generated your keys you can list them by typing the following commands:

For public keys
gpg –list-keys

For private keys
gpg –list-secret-keys

Now that you have created your keys you can share your public key. People can then use this public key to encrypt messages to you which you can then decrypt. To do so you will need to export the public key from your key ring. To export all keys you can use
gpg –export -a

You can also search to narrow down the keys being exported. Using
gpg –export -a site

Please follow and like us: