knowledge/technology/cryptography/GPG.md

68 lines
999 B
Markdown
Raw Permalink Normal View History

2023-12-04 10:02:23 +00:00
---
aliases: ["PGP", "GnuPG", "OpenPGP"]
website: https://www.gnupg.org/
obj: application
---
# GPG
gpg is the OpenPGP part of the GNU Privacy Guard (GnuPG). It is a tool to provide digital encryption and signing services using the OpenPGP standard. gpg features complete key management and all the bells and whistles you would expect from a full OpenPGP implementation.
## Commands
**Sign:**
```shell
gpg --sign
gpg -s
gpg --clear-sign # Sign with clear text
```
**Encrypt:**
```shell
gpg --encrypt
gpg -e
```
**Symmetric Encryption:**
```shell
gpg --symmetric
gpg -c
```
**Decrypt:**
```shell
gpg --decrypt
gpg -d
```
**Verify:**
```shell
gpg --verify
```
## Keys
**List keys:**
```shell
gpg --list-keys
gpg -k # List public keys
gpg -K # List private keys
```
**Generate key:**
```shell
gpg --generate-key
```
**Import & export keys:**
```shell
gpg --export
gpg --import
```
**Key selection:**
```shell
2024-01-17 08:44:04 +00:00
-r, --recipient KEY # Encrypt for key
-u, --local-user KEY # Use this key
2023-12-04 10:02:23 +00:00
```