Encryption is complicated. People don’t pay too much attention because the process and tools are often cumbersome. In this post, I show you how to encrypt data effortlessly by combining tools like GPG and Docker (or Podman) containers. Your privacy in this wild wild internet is guaranteed!
TL;DR
The goal is for anyone to encrypt a message from anywhere addressed to a recipient (in this case myself):
Show me how
The intent is to provide a good experience by abstracting the use of GPG with Docker Linux containers.
The container image that I use is lightweight, has GPG installed and imports my public PGP key.
About PGP/GPG
So far it has been assumed a PGP key pair exists so you have a public key for encryption and “hopefully” its private counterpart for decryption.
Creating a key pair with GPG is easy, and there are several resources available.
Once you’ve got your keys, you can build and distribute your container image so anyone can send encrypted messages to you. You still need to deal with GPG to decrypt them yourself.
Usage examples
- Encrypt a text message or a text file:
- Save encrypted output to a file:
- Copy encrypted output to the clipboard (MacOS only):
- Encrypt binary (non-text) files:
- Use Podman containers instead of Docker:
Summary
The source code for this project can be found at juliaaano/encrypt.
If you like it, comment with an encrypted message down below :-)