This commit is contained in:
TheK4n 2021-12-27 03:06:55 +03:00
parent f93b18981a
commit 1eb1f17617
2 changed files with 16 additions and 15 deletions

View File

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