PGP/GPG Usage Guide
This comprehensive guide covers practical usage of PGP/GPG across different platforms and applications, including key creation, encryption, decryption, and key management.
Prerequisites
Before following this guide, ensure you have:
- PGP/GPG software installed (Installation Guide)
- Basic understanding of PGP concepts (PGP Overview)
- Administrative access (for some operations)
Create PGP Key Pair
Creating a secure key pair is the foundation of PGP usage. We recommend using 4096-bit RSA keys for maximum security.
Kleopatra is the recommended tool for Windows as it supports 4096-bit RSA keys.
Launch Kleopatra
- Open Kleopatra from Start Menu or desktop shortcut
Start Certificate Creation
- Click File → New Certificate...
- Select Create a personal OpenPGP key pair
- Click Next
Enter Personal Information
Name: Your Name (or pseudonym for anonymity) Email: your.email@example.com (or anonymous email) Comment: Optional descriptionConfigure Advanced Settings
- Click Advanced Settings...
- In Key Material section:
- Select RSA radio button
- Choose 4,096 bits from dropdown
- Set expiration date (recommended: 2-4 years)
- Click OK
Create the Key
- Verify your information is correct
- Click Create Key
Set Passphrase
- Enter a strong passphrase (minimum 12 characters)
- Include uppercase, lowercase, numbers, and symbols
- Re-enter to confirm
- Click OK
Generate Entropy
- Move mouse randomly and type random text
- This creates randomness for key generation
- Process completes automatically
Finish Creation
- Click Finish when generation is complete
- Your key pair is now ready for use
Export Public Key
Your public key needs to be shared with others for them to send you encrypted messages.
Select Your Key
- Open Kleopatra
- Right-click your key in My Certificates tab
Export Certificate
- Click Export Certificates...
- Choose save location
- Filename:
yourname-public.asc - Click Save
Verify Export
- Open the .asc file in text editor
- Should start with
-----BEGIN PGP PUBLIC KEY BLOCK----- - Should end with
-----END PGP PUBLIC KEY BLOCK-----
Export Private Key
⚠️ SECURITY WARNING: Private keys should be exported only for backup purposes and stored securely.
Select Your Key
- Right-click your key in My Certificates tab
Export Secret Key
- Select Export Secret Keys...
- Choose secure location (encrypted drive recommended)
- Check ASCII armor option
- Enter filename:
yourname-private.asc - Click OK
Security Confirmation
- Confirm export in dialog box
- Enter your passphrase when prompted
Publish Key to Key Server
Publishing your public key to key servers makes it discoverable by others.
Select Your Key
- Right-click your key in Kleopatra
Publish to Server
- Select Publish on Server...
- Choose key server (default is usually fine)
- Click OK
Verify Publication
- Search for your key on key server to confirm
Import Public Keys
Before encrypting messages for others, you need their public keys.
Import from File
- Click File → Import Certificates...
- Browse to .asc file containing public key
- Click Open
Import from Clipboard
- Copy public key text to clipboard
- Click File → Import Certificates from Clipboard
Verify Import
- Check Other Certificates tab
- Imported key should be listed
Encrypt Messages
Encryption ensures only the intended recipient can read your message.
Prepare Your Message
- Open Notepad or text editor
- Type your message
- Select all text and copy (Ctrl+C)
Encrypt via System Tray
- Right-click Kleopatra icon in system tray
- Navigate to Clipboard → Encrypt...
Select Recipients
- Click Add Recipient...
- Switch to Other Certificates tab
- Select recipient's public key
- Click OK
Complete Encryption
- Verify recipient is listed
- Click Next
- Encryption completes automatically
Send Encrypted Message
- Encrypted text is now in clipboard
- Paste (Ctrl+V) into email, chat, or any application
- Send to recipient
Decrypt Messages
Decryption requires your private key and passphrase.
Copy Encrypted Message
- Select entire encrypted message block
- Include
-----BEGIN PGP MESSAGE-----and-----END PGP MESSAGE----- - Copy to clipboard (Ctrl+C)
Decrypt via System Tray
- Right-click Kleopatra icon in system tray
- Navigate to Clipboard → Decrypt/Verify...
Enter Passphrase
- Enter your private key passphrase
- Click OK
View Decrypted Message
- Decrypted text is copied to clipboard
- Paste into text editor to read
- Message is also displayed in verification window
Sign Messages
Digital signatures provide authentication and integrity verification.
Prepare Message
- Create message in text editor
- Copy message to clipboard
Sign Message
- Right-click Kleopatra system tray icon
- Select Clipboard → Sign...
- Choose your signing key
- Enter passphrase
- Click OK
Send Signed Message
- Signed message is in clipboard
- Paste into email or communication method
Verify Signatures
Signature verification confirms message authenticity and integrity.
Copy Signed Message
- Include entire message with signature blocks
- Copy to clipboard
Verify Signature
- Right-click Kleopatra system tray icon
- Select Clipboard → Decrypt/Verify...
Review Results
- Verification window shows signature status
- Green checkmark indicates valid signature
- Red X indicates invalid or missing signature
Key Management
Trust Levels
Understanding and setting appropriate trust levels is crucial for PGP security.
Trust Levels Explained:
- Unknown: No trust information
- None: Explicitly marked as not trusted
- Marginal: Some confidence in key ownership
- Full: High confidence in key ownership
- Ultimate: Your own keys
Access Key Properties
- Right-click on key
- Select Details...
Change Trust Level
- Click Change Owner Trust...
- Select appropriate trust level
- Click OK
Best Practices
Security Recommendations
Strong Passphrases
- Minimum 12 characters
- Include uppercase, lowercase, numbers, symbols
- Consider using passphrases instead of passwords
Key Size
- Use 4096-bit RSA keys minimum
- Consider Ed25519 for new keys (newer algorithm)
Key Expiration
- Set expiration dates (2-4 years recommended)
- Regularly extend or replace keys
Backup Strategy
- Create secure backups of private keys
- Store revocation certificates safely
- Test backup restoration periodically
Operational Security
Key Verification
- Always verify key fingerprints through secure channels
- Use multiple verification methods when possible
Software Updates
- Keep PGP software updated
- Monitor security advisories
Environment Security
- Use secure, updated operating systems
- Avoid public/shared computers for key operations
- Consider using dedicated hardware for key generation
Common Mistakes to Avoid
- Weak Passphrases: Using dictionary words or personal information
- Unverified Keys: Trusting keys without proper verification
- Insecure Backups: Storing private keys without encryption
- Key Reuse: Using same keys across multiple identities
- Outdated Software: Using vulnerable PGP implementations
Troubleshooting
Common Issues
Error: "No public key"
# Solution: Import recipient's public key
gpg --keyserver hkps://keys.openpgp.org --search-keys recipient@example.com
Error: "Bad passphrase"
- Verify caps lock status
- Try typing passphrase in text editor first
- Check for special character issues
Error: "Key expired"
# Check key expiration
gpg --list-keys
# Extend expiration if it's your key
gpg --edit-key your.email@example.com
GPG Agent Issues
# Restart GPG agent
gpgconf --kill gpg-agent
gpgconf --launch gpg-agent
This comprehensive usage guide should cover all essential PGP/GPG operations across different platforms and interfaces.