GPG / OpenPGP File Encryption Workflow (ASCII Armored)

, 475 words, 3 minutes read

Table of contents

  1. Verify the recipient’s identity using a trusted, independent channel (not email alone).
  2. Obtain the recipient’s public key from a trusted source (direct transfer, verified website, or keyserver).
  3. Import the recipient’s public key into your local GPG keyring.
  4. Verify the recipient’s key fingerprint against a value confirmed via a separate communication channel.
  5. Decide whether to mark the key as trusted in your local trust database (this affects GPG behavior, not cryptographic security).
  6. Encrypt the file for the recipient and sign it with your private key using ASCII-armored output.
  7. Send the resulting .asc file to the recipient over any transport (email, file share, etc.).
  8. Recipient decrypts the file with their private key and automatically verifies the signature.

Detailed Workflow

Generate your own keypair (one-time setup)

gpg --full-generate-key

Notes:

Export and share your public key

gpg --armor --export your@email.com > my-public-key.asc

Notes:

Obtain recipient public key

Possible sources:

Notes:

Import recipient public key

gpg --import recipient-public-key.asc

Notes:

Verify fingerprint

gpg --fingerprint recipient@example.com

Notes:

(Optional) Set trust level

gpg --edit-key recipient@example.com

Then:

Notes:

gpg --armor --sign --encrypt \
    --recipient recipient@example.com \
    document.pdf

Notes:

Send encrypted file

Notes:

Recipient decrypts and verifies

gpg --decrypt document.pdf.asc > document.pdf

Notes:

Key rotation / expiration handling

Notes:

Troubleshooting / utility commands

gpg --list-keys
gpg --list-secret-keys
gpg --fingerprint
#gpg #pgp #OpenPGP #encryption