From 1eb1f17617134c8cdb23febbe554e5e61d60de8e Mon Sep 17 00:00:00 2001 From: TheK4n Date: Mon, 27 Dec 2021 03:06:55 +0300 Subject: [PATCH] doc: gpg --- doc/gpg.md | 31 +++++++++++++------------ scripts/cryptography/{ => luks}/luks.sh | 0 2 files changed, 16 insertions(+), 15 deletions(-) rename scripts/cryptography/{ => luks}/luks.sh (100%) diff --git a/doc/gpg.md b/doc/gpg.md index 854b8ac..d152f82 100644 --- a/doc/gpg.md +++ b/doc/gpg.md @@ -1,24 +1,25 @@ -### GPG +## GPG Caching passphrases disable: ```bash echo -e "default-cache-ttl 1\nmax-cache-ttl 1" > ~/.gnupg/gpg-agent.conf; echo RELOADAGENT | gpg-connect-agent ``` -\ -Generate key:\ -```gpg --full-generate-key``` +### Encrypt +1. ```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:\ -```gpg -e file.txt``` - -```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 message (one file) +1. ```gpg -u "thek4n" --clear-sign -s file``` -u secret key, --clear-sign message +2. ```gpg -d file.asc``` +### Sign binary (file and sign) +3. ```gpg -u "thek4n" -b file``` -b detached sign +4. ```gpg --verify file.sig file``` \ No newline at end of file diff --git a/scripts/cryptography/luks.sh b/scripts/cryptography/luks/luks.sh similarity index 100% rename from scripts/cryptography/luks.sh rename to scripts/cryptography/luks/luks.sh