Getting Started with GPG (GnuPG)


In 1991, Phil Zimmerman created an encryption program called Pretty Good Privacy (or, PGP). His creation eventually inspired an encryption standard called OpenPGP. GPG, or GnuPG, is a complete and free implementation of this encryption standard. The official GPG website tells us that

GnuPG allows you to encrypt and sign your data and communications; it features a versatile key management system, along with access modules for all kinds of public key directories. GnuPG, also known as GPG, is a command line tool with features for easy integration with other applications. A wealth of frontend applications and libraries are available. GnuPG also provides support for S/MIME and Secure Shell (ssh).

https://www.gnupg.org/

Here are the basic commands to get started with GPG:

Create new key: gpg --full-generate-key

Delete public key: gpg --delete-keys [name/fingerprint]

Delete private key: gpg --delete-secret-keys [name/fingerprint]

Delete private and public key: gpg --delete-secret-and-public-keys [name/fingerprint]


List private keys: gpg -K

List public keys: gpg -k


Export key to file: gpg --armor --export [name/fingerprint] > [file].asc

Import key from file: gpg --import [file].asc


Encrypt a file: gpg --encrypt --armor --recipient [recipient name/fingerprint] [file]

Decrypt a file: gpg --decrypt [file]


Verify signature: gpg --verify [file].asc


Edit key: gpg --edit-key [name/fingerprint]

Change passphrase: gpg --passwd [name/fingerprint]


Leave a Reply

Your email address will not be published. Required fields are marked *