From 63864cdca6d002223b2bdd694317c6a206bf7e32 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 30 Jul 2019 21:46:00 +0200 Subject: [PATCH] gpg/fun --- in/public/security/gpg/fun.rst | 50 ++++++++++++++++++++++++++++++++ in/public/security/gpg/index.rst | 1 + 2 files changed, 51 insertions(+) create mode 100644 in/public/security/gpg/fun.rst diff --git a/in/public/security/gpg/fun.rst b/in/public/security/gpg/fun.rst new file mode 100644 index 0000000..1ad7782 --- /dev/null +++ b/in/public/security/gpg/fun.rst @@ -0,0 +1,50 @@ +“Choose” fingerprint +==================== + +.. code:: bash + + #! /bin/bash + + mkdir --parents _ + + while true; do + + gpg \ + --batch \ + --passphrase '' \ + --quick-generate-key \ + 'First Last ' \ + ed25519 \ + cert \ + 1y \ + &> /dev/null + + gpg \ + --armor \ + --export-secret-keys \ + 'First Last' > "tmp.gpg" + + name=$(\ + cat tmp.gpg \ + | gpg --list-packets \ + | grep v4 \ + | awk -F ' ' '{print $9}' \ + | awk -F ')' '{print $1}' \ + ) + + name="${name:24:4}_${name:28:4}__${name:32:4}_${name:36}" + echo "${name}" + mv tmp.gpg "_/${name}" + + rm openpgp-revocs.d/* + rm private-keys-v1.d/* + + gpg \ + --batch \ + --yes \ + --delete-keys 'First Last' + + rm pubring.kbx* + rm trustdb.gpg + + done diff --git a/in/public/security/gpg/index.rst b/in/public/security/gpg/index.rst index 1a2506f..3b93a21 100644 --- a/in/public/security/gpg/index.rst +++ b/in/public/security/gpg/index.rst @@ -8,3 +8,4 @@ GnuPG configure generate servers + fun