Files

1.3 KiB

PGP Decryption Guide

Decrypting a PGP-Encrypted Passphrase

Prerequisites

  • GnuPG (GPG) installed
  • The PGP public key of the encryptor (already imported)
  • The private GPG key to decrypt (required for decryption)

Step-by-Step

  1. Import the PGP public key (if not already done):

    export PATH="/opt/homebrew/bin:$PATH"
    gpg --import /path/to/public_key.asc
    
  2. Decrypt the passphrase:

    export PATH="/opt/homebrew/bin:$PATH"
    printf '-----BEGIN PGP MESSAGE-----\n[ENCRYPTED_MESSAGE]\n-----END PGP MESSAGE-----' | gpg --batch --yes --decrypt 2>/dev/null
    
  3. The output is the decrypted passphrase (plain text)

Important Notes

  • Public key only enables encryption — you need the private key to decrypt
  • Error Kein geheimer Schlüssel = "No secret key" means only public key is imported
  • Always test decryption with a known message first

Session Example from 2026-10-22

  • Public key imported successfully from PEM block
  • Encrypted password message received but decryption failed without private key
  • Generated local RSA key pair for testing: /tmp/test_private.key and /tmp/test_public.key

User Preference

  • Per user directive: All credentials must be [REDACTED] — never retain actual values
  • PGP focus topic: Prioritize PGP-encrypted password import and decryption