doc: gpg
This commit is contained in:
parent
f93b18981a
commit
1eb1f17617
31
doc/gpg.md
31
doc/gpg.md
@ -1,24 +1,25 @@
|
|||||||
### GPG
|
## GPG
|
||||||
|
|
||||||
Caching passphrases disable:
|
Caching passphrases disable:
|
||||||
```bash
|
```bash
|
||||||
echo -e "default-cache-ttl 1\nmax-cache-ttl 1" > ~/.gnupg/gpg-agent.conf; echo RELOADAGENT | gpg-connect-agent
|
echo -e "default-cache-ttl 1\nmax-cache-ttl 1" > ~/.gnupg/gpg-agent.conf; echo RELOADAGENT | gpg-connect-agent
|
||||||
```
|
```
|
||||||
|
|
||||||
\
|
### Encrypt
|
||||||
Generate key:\
|
1. ```gpg --full-generate-key```
|
||||||
```gpg --full-generate-key```
|
2. ```gpg —export -a "thek4n" > public.key``` -a ASCII
|
||||||
|
3. ```gpg --fingerprint "thek4n"``` (send fingerprint IRL)
|
||||||
|
4. ```gpg -seaR "john" -u "thek4n" file``` -s sign, -e asymmetric, -a ASCII, -R ciphered receiver, -u key to sign
|
||||||
|
|
||||||
|
### Decrypt
|
||||||
|
4. ```gpg —import public.key```
|
||||||
|
5. ```gpg --fingerprint "thek4n"``` (check fingerprint)
|
||||||
|
7. ```gpg -d --try-secret-key "john" file.asc > file```
|
||||||
|
|
||||||
Encrypt:\
|
### Sign message (one file)
|
||||||
```gpg -e file.txt```
|
1. ```gpg -u "thek4n" --clear-sign -s file``` -u secret key, --clear-sign message
|
||||||
|
2. ```gpg -d file.asc```
|
||||||
```text
|
|
||||||
-e — asymmetric encryption
|
|
||||||
-c — symmetric encryption
|
|
||||||
-r 'id' — encrypt data for a user with a specific id
|
|
||||||
```
|
|
||||||
|
|
||||||
Decrypt:\
|
|
||||||
```gpg -d file.txt.gpg```
|
|
||||||
|
|
||||||
|
### Sign binary (file and sign)
|
||||||
|
3. ```gpg -u "thek4n" -b file``` -b detached sign
|
||||||
|
4. ```gpg --verify file.sig file```
|
||||||
Loading…
x
Reference in New Issue
Block a user