m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/gpg.md
blob: 569a91e4cb63a4cadc507a79f8ae82f9b1d22dd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# GPG Crypto

## General options

* `--armor` or `-a`: ASCII armor, output is printable ASCII
* `--local-user` or `-u`: specify which ID to use

## Symmetric encryption

### Encrypt file with passphrase

    gpg --symmetric <file>

Add `--armor` to make it readable-ASCII encoded.

### Decrypt

    gpg --output <out-file> --decrypt <in-file>

## Export private key

    gpg --armor --export-secret-keys <ID>

## Export public key

    gpg --armor --export <ID> [--output <file>]

## Asymmetric crypto

    gpg --encrypt [--sign] [-u <signer>] [--recipient <receipient>] file