(a)³ Agora, anarchy, action!

How to generate keys, encrypt and sign messages with PGP

If you want to send a secure and private message, use PGP encryption. You can use PGP anywhere (email, social media, messengers, apps and more) — just paste the ASCII-armored encrypted message into the message box and click send. You can also encrypt files with PGP, e.g. for backups or email attachments.

Using the command-line may seem difficult, but the PGP commands are simple. You can use GPG’s CLI software in Windows (CMD), Mac (Terminal), Linux (Terminal) and Android (Termux). Try out the commands listed in this article to see how easy it is.

In addition, consider to use Tor for better privacy. Tor’s secure 3-hop design (consisting of an entry node, relay node and exit node) prevents your ISP from seeing what you access and prevent websites (or other users in P2P software) from finding your location. You can use Tor Browser for websites, Torsocks for software, Orbot on Android or a specialized OS like a Tails USB or Whonix VM. Tor is open-source and you can download it for free here: https://www.torproject.org/

Install GPG for Ubuntu/Debian/Whonix/Mint/PopOS: For Windows, visit https://www.gnupg.org/download/

sudo apt install gpg

Generate your key pair:

gpg --generate-key

List keys:

gpg --list-keys

Export your public key (You can share this):

gpg --export --armor my@email.com > my_key.asc

Display your public key (Copy and paste or send as an attachment):

cat my_key.asc

Backup your private key (Don’t share this):

gpg --export-secret-key --armor my@email.com > private_key.asc

Import someone’s public key:

gpg --import recipient_key.asc

Encrypt a message to someone (Write your message in a text file first, e.g. message.txt):

gpg --encrypt --armor --recipient recipient@email.com message.txt

Encrypt a message with a password instead of PGP key (You will be asked to enter the password in the next step):

gpg --symmetric --armor message.txt

Display the encrypted message (Copy and paste or send as an attachment):

cat message.txt.asc

Decrypt a message (E.g. you have saved it under message.txt.asc):

gpg --decrypt message.txt.asc

Sign a message:

gpg --clear-sign --armor message.txt

Display the signed message (Copy and paste or send as an attachment):

cat message.txt.asc

Verify a signature (Import the public key first):

gpg --verify message.txt.asc

You can share your PGP public key on your website, social media or upload it to a PGP key server such as https://pgp.mit.edu/ or https://keyserver.ubuntu.com.