gpg2

GNU Privacy Guard 2. See gpg for GNU Privacy Guard 1. More information: <https://docs.releng.linuxfoundation.org/en/latest/gpg.html>.

Install

All systems
curl cmd.cat/gpg2.sh
Debian Debian
apt-get install gnupg2
Ubuntu
apt-get install gnupg2
Alpine
apk add gnupg
Arch Arch Linux
pacman -S gnupg
image/svg+xml Kali Linux
apt-get install gnupg2
CentOS
yum install gnupg2
Fedora
dnf install gnupg2
Windows (WSL2)
sudo apt-get update sudo apt-get install gnupg2
OS X
brew install gnupg
Raspbian
apt-get install gnupg2
Docker
docker run cmd.cat/gpg2 gpg2 powered by Commando

GNU Privacy Guard 2. See gpg for GNU Privacy Guard 1. More information: <https://docs.releng.linuxfoundation.org/en/latest/gpg.html>.

  • List imported keys:
    gpg2 --list-keys
  • Encrypt a specified file for a specified recipient, writing the output to a new file with `.gpg` appended:
    gpg2 --encrypt --recipient [email protected] path/to/doc.txt
  • Encrypt a specified file with only a passphrase, writing the output to a new file with `.gpg` appended:
    gpg2 --symmetric path/to/doc.txt
  • Decrypt a specified file, writing the result to `stdout`:
    gpg2 --decrypt path/to/doc.txt.gpg
  • Import a public key:
    gpg2 --import path/to/public_key.gpg
  • Export the public key of a specified email address to `stdout`:
    gpg2 --export --armor [email protected]
  • Export the private key with a specified email address to `stdout`:
    gpg2 --export-secret-keys --armor [email protected]

© tl;dr; authors and contributors