killchain-compendium/Cryptography/GPG-Cheatsheet.md

37 lines
652 B
Markdown
Raw Normal View History

2023-02-09 21:31:25 +01:00
# GPG Cheatsheet
2023-03-25 15:31:51 +01:00
## Generate Keypair
* Generating a keypair via gpg
```sh
gpg --gen-key
```
2023-02-09 21:31:25 +01:00
## Encryption via GPG
* Encryption of a file via gpg
```sh
gpg --symmetric --cipher-algo <algorithm> $PLAIN_TEXT
```
### Armored Encryption via GPG
* ASCII armored encryption output is done via
```sh
gpg --armor --symmetric --cipher-algo <algorithm> $PLAIN_TEXT
```
## Decryption via GPG
* Decryption of a file via gpg
```sh
gpg --output original_message.txt --decrypt $CIPHER
```
2023-03-25 15:31:51 +01:00
## Encrypt & Sign an eMail
2023-02-09 21:31:25 +01:00
2023-03-25 15:31:51 +01:00
* Encryption and siging via gpg is done in the following way
```sh
gpg --encrypt --sign --armor -r bill.gates@microsoft.com message.txt
```