Simple instructions to use PGP on Ubuntu

Most people don’t have any reasons to encrypt their communication with other people. There is no famous tool yet with which even non-IT people can just enable/disable encryption with one click. For this reason, only some geeks know how to encrypt a message. Let’s see how it works on Ubuntu Desktop:

  1. Install the tools needed
    1. Have ‘gpg’ and ‘Passwords and Keys’ installed
    2. Install OpenGPG
  2. Generate an own key to receive encrypted messages
    1. Open Passwords and Keys
    2. Click on the “+” and select PGP Key
    3. Type in a name (e.g. “your name”) with at least 5 letters, email is optional
    4. Type in a password to protect your private key
    5. It takes a couple of seconds until you see the key under GnuPG keys
  3. Encrypt a message to send it to others or to test your own key
    1. Open Passwords and Keys
    2. Select your key under GnuPG keys
    3. Go to File > Export
    4. Select Armored PGP keys at the bottom right
    5. Export your public key, e.g. “my-public-key.asc”
    6. Go to File > Import and select my-public-key.asc
    7. Open Terminal and make sure your public key is listed:

      > gpg –list-keys
      pub 2048R/D6E1F4F8 2017-07-31
      uid your name
      sub 2048R/7CA82BFA 2017-07-31

    8. Copy some text to your clipboard (ctrl+c)
    9. Open OpenPGP and click on it’s Icon which looks like a clipboard
      1. Select Sign/Encrypt Clipboard with Public Keys
      2. Select your key my making a “hook” on the left of the line & OK
      3. Now you have the encrypted message in your clipboard (ctrl+v)
    10. Notice: When you want to send an encrypted message to others, import their public key and follow these instructions (2.), ending up here. Send the encrypted message from step 2.9 to them (ctrl+v).
  4. Decrypt an encrypted message (needs to be encrypted by your own public key)
    1. Write the encrypted message to a file, e.g.: ~/encrypted.txt
    2. Open Passwords and Keys
      1. Double click your key under GnuPG keys
      2. Click on Details > Export (secret key)
      3. Save e.g. as: my-private-key.asc (you need your protection password, see 1.3.4)
      4. Click on File > Import and select your private key
    3. Open Terminal and make sure your private key is listed:

      > gpg –list-secret-keys
      sec 2048R/D6E1F4F8 2017-07-31
      uid your name
      ssb 2048R/7CA82BFA 2017-07-31

    4. Now you can decrypt the message if it was encrypted with your public key

      > gpg –decrypt encrypted.txt > decrypted.txt

    5. The decrypted.txt contains the message
    6. Notice: When you want to receive encrypted messages, share your public key with others. Do never share your private key so that only you can read these messages!

Puh …. that’s it. This is far fromone click to enable/disable encryption” which is probably needed for non IT people to encrypt sensitive messages by default.

If you such a tool, feel free to post it a as a comment!

Howto: Ubuntu 16.04 on MacBook 7,1 Air
Track your mobile phone and notebook devices

Leave a Reply

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