How to send an encrypted email
Apr 07, 2025Email providers claim that your emails are private. But they are not, because email providers themself can read your emails. It means that governments can force them to turn over your emails, or corporations could buy them, which makes them public by default. Today I will show you how to send an actually encrypted email using GPG. This method doesn’t require any special client software, it will work on Outlook, Gmail, Yahoo, etc.
Flow
- Sender gets receiver’s public GPG key.
- Sender encrypts email with receiver’s public GPG key.
- Receiver decrypts email with his private GPG key.
Install GPG
Windows
Install Gpg4win.
Linux
Debian/Ubuntu:
sudo apt install gnupg2
Arch Linux:
sudo pacman -S gnupg
Fedora:
sudo dnf install gnupg2
MacOS
brew install gnupg
Send encrypted email
First, you need to get receiver’s public key file (if he doesn’t have one, send him a link to this guide: https://svoboda.center/blog/how-to-send-an-encrypted-email#generate-your-gpg-key).
This guide assumes that you have a .txt file with email’s content.
Hint: if you generate your GPG key, you can attach it in the email. That way you can exchange encrypted messages back and forth.
Windows
- Open Powershell.
- Import receiver’s public key:
gpg --import receiver-public-key.asc
. You can find receiver’s email in output of this command. - Encrypt email’s content:
cat C:\path\to\email.txt | gpg --encrypt --armor --recipient receiver_email@gmail.com
- Send the output of previous command to receiver. It should start with
-----BEGIN PGP MESSAGE-----
and end with-----END PGP MESSAGE-----
.
Linux
- Import receiver’s public key:
gpg2 --import receiver-public-key.asc
. You can find receiver’s email in output of this command. - Encrypt email’s content:
cat /path/to/email.txt | gpg2 --encrypt --armor --recipient receiver_email@gmail.com
- Send the output of previous command to receiver. It should start with
-----BEGIN PGP MESSAGE-----
and end with-----END PGP MESSAGE-----
.
MacOS
- Open Terminal.
- Import receiver’s public key:
gpg --import receiver-public-key.asc
. You can find receiver’s email in output of this command. - Encrypt email’s content:
cat /path/to/email.txt | gpg --encrypt --armor --recipient receiver_email@gmail.com
- Send the output of previous command to receiver. It should start with
-----BEGIN PGP MESSAGE-----
and end with-----END PGP MESSAGE-----
.
Decrypt encrypted email
Windows & MacOS
- Copy encrypted email’s content to encrypted-email.asc file.
- Decrypt email:
gpg --decrypt encrypted-email.asc
Linux
- Copy encrypted email’s content to encrypted-email.asc file.
- Decrypt email:
gpg2 --decrypt encrypted-email.asc
Generate your GPG key
First, install GPG.
Windows
- Open Powershell.
- Generate GPG key:
gpg --full-generate-key
. Make sure to enter your email when asked. - Export GPG key:
gpg --export --armor > my-public-key.asc
Linux
- Open Terminal.
- Generate GPG key:
gpg2 --full-generate-key
. Make sure to enter your email when asked. - Export GPG key:
gpg2 --export --armor > my-public-key.asc
MacOS
- Open Terminal.
- Generate GPG key:
gpg --full-generate-key
. Make sure to enter your email when asked. - Export GPG key:
gpg --export --armor > my-public-key.asc
Send me an encrypted email
My email: svobodacenter@mailum.com
My public GPG key: Key
Send me your darkest secrets. If you attach your public key, I will answer you back with an encrypted email.