# GPG Cheatsheet

## Generate Keypair

* Generating a keypair via gpg
```sh
gpg --gen-key
```

## 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
```

## Encrypt & Sign an eMail

* Encryption and siging via gpg is done in the following way
```sh
gpg --encrypt --sign --armor -r bill.gates@microsoft.com  message.txt
```
