GNU Privacy Guard (GnuPG or GPG) is a free and open-source software application that allows users to encrypt and sign their data and communications. It complies with the OpenPGP standard (RFC 4880), which is widely used for secure data encryption. GnuPG provides a way to secure files, emails, and other communications through the use of cryptographic techniques such as symmetric and asymmetric encryption.
Generate public private key, test encrypt and test decrypt:
# Create your pubkey.
gpg --gen-key
gpg --armor --output pubkey.gpg --export <myemail>
# Encrypt using someone's pubkey.
gpg --import pubkey2.gpg
echo 'hello world' > hello.txt
gpg --output hello.txt.gpg --encrypt --recipient <other-email> hello.txt
# Double check it is not plaintext in the encrypted message.
grep hello hello.txt.gpg
# Decrypt.
gpg --output hello.decrypt.txt --decrypt --recipient <myemail> hello.txt.gpg
diff -u hello.decrypt.txt hello.txt
New to topics? Read the docs here!