Title: GPG2 cheatsheet
Author: Solène
Date: 06 September 2019
Tags: security
Description:
## Introduction
I don't use gpg a lot but it seems the only tool out there for
encrypting data
which "works" and widely used.
So this is my personal cheatsheet for everyday use of gpg.
In this post, I use the command `gpg2` which is the binary to GPG
version 2.
On your system, "gpg" command could be gpg2 or gpg1.
You can use `gpg --version `if you want to check the real version
behind gpg
binary.
In your *~/.profile* file you may need the following line:
export GPG_TTY=$(tty)
## Install GPG
The real name of GPG is GnuPG, so depending on your system the package
can be
either gpg2, gpg, gnupg, gnugp2 etc...
On OpenBSD, you can install it with: `pkg_add gnupg--%gnupg2`
## GPG Principle using private/public keys
- YOU make a private and a public key (associated with a mail)
- YOU give the public key to people
- PEOPLE import your public key into they keyring
- PEOPLE use your public key from the keyring
- YOU will need your password everytime
I think gpg can do much more, but read the manual for that :)
## Initialization
We need to create a public and a private key.
solene$ gpg2 --gen-key
gpg (GnuPG) 2.2.12; Copyright (C) 2018 Free Software Foundation,
Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
dataswamp.org:70 /~solene/article-gpg2-cheatsheet:56: port field too long