GPG stands for GNU Privacy Guard and it is vital tool for everyone who wants to protect the email and files. Like it's inspiration PGP, GPG uses public-key cryptography where each user owns two keys: for decryption (public key) and for encryption (private key).
This cheatsheet is for quick reference and gives a brief description of that could be done with this security tool.
GPG has several switches that allows to generate a public-private keypar, revoke and delete keys. The viewing public and private keys are also supported.
To generate a public-private key pair in the GPG keyring use the –gen-key switch. The below command will prompt for some details such the key-type, key-size, user ID to identify the key and the time period over which the generated key will be valid:
In case if the secret key has been stolen, an existing key could be revoked with –gen-revoke switch. To be able to do this, is is needed for a secret key:
The below commands are used to delete public and private keys from GPG keyring:
To view all types of keys, issue the command:
GPG allows several key manipulation functions such importing and exporting the keys. Sending and receiving keys from server are also supported.
#### Get a Key from a server
GPG allows file encryption and decryption. Another option is support for file signing that makes this program an alternative to PGP.