Tested procedure for recovery of GPG keys. This is for GnuPG version 2.
-
Preparation
Remove all existing keyrings
rm -rf ~/.gnupg
-
Retrieve private key from secret place, copy contents into a new file
~/restore-key.asc
-
Import the keys
Use GnuPG version 2
gpg --import ~/restore-key.asc
Make sure the keys are installed
gpg --list-keys gpg --list-secret-keys
-
Delete the key that was imported
rm -rf ~/restore-key.asc
-
Test the recovery
-
Clone the blackbox demo
cd /tmp && rm -rf blackbox-demo \ && git clone https://github.com/deepeeess/blackbox-demo.git && cd blackbox-demo
-
Test the ability to decrypt the file
blackbox_decrypt_all_files blackbox_shred_all_files
-