Sids' blog

[ gpg ]

🌱 ~ Info around GPG

📝 Info

📋 Commands

Encrypt Directory Using Symmetric Key

gpgtar --encrypt --symmetric --output {NAME_OF_TO_BE_ENCRYPTED_FOLDER}.gpg --gpg-args="--passphrase={CHOSEN_PASSPHRASE} --batch" {NAME_OF_DIRECTORY_TO_ENCRYPT}

Decrypting an Encrypted Directory

mkdir {NAME_OF_DIRECTORY_TO_PUT_DECRYPTED_CONTENTS}

gpgtar --decrypt --directory {NAME_OF_DIRECTORY_TO_PUT_DECRYPTED_CONTENTSv} {ENCRYPTED_FOLDER}.gpg

⚠️ Errors

“gpg failed to sign the data … waiting for lock”

The example of the error below is due to a freezing during the git commit. Removing the lock file, solves it immediately. Simply rm .gnupg/public-keys.d/pubring.db.lock.

error: gpg failed to sign the data:
gpg: WARNING: unsafe permissions on homedir '/home/x/.gnupg'
gpg: Note: database_open 134217901 waiting for lock (held by 2126) ...
gpg: Note: database_open 134217901 waiting for lock (held by 2126) ...
gpg: Note: database_open 134217901 waiting for lock (held by 2126) ...
gpg: Note: database_open 134217901 waiting for lock (held by 2126) ...
gpg: Note: database_open 134217901 waiting for lock (held by 2126) ...
gpg: keydb_search failed: Connection timed out
gpg: skipped "x": Connection timed out
[GNUPG:] INV_SGNR 0 x
[GNUPG:] FAILURE sign 134250628
gpg: signing failed: Connection timed out