m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/gpg.md
blob: 00a6850ebecf640bfce68ba317139a1b4f2fed9f (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
# 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>

`--armor` makes it readable-ASCII encoded.

## Asymmetric crypto

    gpg --encrypt [--sign] [-u USER] file