Free · Private · Client-side

PGP Key Format Demo & GPG Setup

Learn what OpenPGP key blocks look like and how to generate real PGP keys with GPG. The demo below produces structurally-formatted example blocks — not usable keys — so you can explore the format safely.

Generated values never leave this device.
Demo Only — no real keys are generated on this page

These are not usable OpenPGP keys

The blocks this demo produces are structurally-formatted examples that show what armored OpenPGP output looks like. They are not valid OpenPGP packets and cannot be imported into GPG or used for email encryption. To create real keys, run gpg --full-generate-key in your terminal — see the commands below.

Generate Real PGP Keys with GPG

GPG (GNU Privacy Guard) is the standard, free OpenPGP implementation. Generate your key pair locally so the private key never leaves your machine:

Interactive key generation — choose algorithm, key size, expiration, and identity

$gpg --full-generate-key

List your keys and find your key ID

$gpg --list-secret-keys --keyid-format LONG

Export your public key to share with others

$gpg --export --armor [email protected] > public-key.asc

Create a revocation certificate and store it somewhere safe

$gpg --output revocation.asc --generate-revocation YOUR_KEY_ID

Format Demo

Configure the options below to see how the choices you'd make in gpg --full-generate-key shape the armored output. Identity fields are optional — example values are used if you leave them blank.

Using Real GPG Keys

Once you've generated a real key pair with gpg --full-generate-key, these commands cover the everyday OpenPGP workflow:

1. Import Keys into GPG

If you received key files (for example from a backup or another machine), import them into your GPG keyring:

$gpg --import public-key.asc
$gpg --import private-key.asc
$gpg --list-secret-keys --keyid-format LONG

2. Encrypt a Message

Encrypt a message for someone using their public key:

$echo 'Secret message' | gpg --encrypt --armor --recipient [email protected]
$gpg --encrypt --armor --recipient [email protected] message.txt

The encrypted output can be safely sent via email or any insecure channel.

3. Decrypt a Message

Decrypt messages sent to you:

$gpg --decrypt encrypted-message.asc
$echo '-----BEGIN PGP MESSAGE-----...' | gpg --decrypt

4. Sign a Message

Create a digital signature to verify message authenticity:

$gpg --clearsign message.txt
$echo 'Important message' | gpg --clearsign
$gpg --detach-sign --armor document.pdf

5. Verify Signatures

Verify the authenticity of signed messages:

$gpg --verify signed-message.asc
$gpg --verify document.pdf.asc document.pdf

6. Export and Share Keys

Share your public key with others:

$gpg --export --armor [email protected] > public-key.asc
$gpg --send-keys --keyserver keyserver.ubuntu.com YOUR_KEY_ID
$gpg --search-keys [email protected]

Email Client Integration Examples

Thunderbird Setup

  1. Install Thunderbird and set up your email account
  2. Go to Tools → Account Settings → End-to-End Encryption
  3. Click "Add Key" → "Import a personal key from file"
  4. Select your private key file and enter passphrase
  5. Enable "Digital signing" and "Require encryption" as needed

Mailvelope (Web)

  1. Install Mailvelope browser extension
  2. Open Mailvelope Options → Key Management
  3. Click "Import Keys" and paste your private key
  4. Add your email accounts to Mailvelope
  5. Compose encrypted emails directly in your webmail

Apple Mail (macOS)

  1. Import your key into GPG Suite for macOS
  2. Open Apple Mail preferences
  3. Go to Accounts → Select account → Advanced
  4. Enable "Encrypt outgoing mail" and "Sign outgoing mail"
  5. Mail will automatically use your PGP key

Outlook with Gpg4win

  1. Install Gpg4win (includes Kleopatra key manager)
  2. Import your key using Kleopatra
  3. Install GpgOL plugin for Outlook integration
  4. Restart Outlook and look for encryption options
  5. Use encrypt/sign buttons when composing emails

Real-World Use Cases & Examples

Business Communication

Secure client communications and confidential documents:

# Encrypt contract for client review
gpg --encrypt --armor --recipient [email protected] contract-v2.pdf
# Sign press release for authenticity
gpg --clearsign --local-user [email protected] press-release.txt

Software Development

Sign git commits and release packages:

# Configure git to sign commits
git config --global user.signingkey YOUR_KEY_ID git config --global commit.gpgsign true
# Sign a software release
gpg --detach-sign --armor myapp-v1.2.3.tar.gz

Healthcare & Legal

HIPAA-compliant communication and legal document verification:

# Encrypt patient records for transfer
gpg --cipher-algo AES256 --encrypt --recipient [email protected] patient-file.pdf
# Sign legal document with timestamp
gpg --clearsign --local-user [email protected] legal-brief.txt

Personal Privacy

Secure personal communications and file backup:

# Encrypt backup files
tar czf - important-docs/ | gpg --symmetric --cipher-algo AES256 > backup.tar.gz.gpg
# Secure email to family member
echo "Family news..." | gpg --encrypt --armor --recipient [email protected]

About PGP Encryption

Pretty Good Privacy (PGP) is a data encryption and decryption program that provides cryptographic privacy and authentication for data communication. PGP uses a combination of symmetric-key cryptography and public-key cryptography.

Key Features

  • • End-to-end encryption for emails
  • • Digital signatures for authenticity
  • • Key distribution and management
  • • Cross-platform compatibility
  • • Open source implementations (GPG)

Use Cases

  • • Secure email communication
  • • File encryption and signing
  • • Software distribution verification
  • • Secure messaging applications
  • • Document authentication

Algorithm Comparison

AlgorithmKey SizePerformanceSecurity LevelRecommended For
RSA 20482048 bitsFastGoodGeneral use, compatibility
RSA 40964096 bitsSlowerExcellentLong-term security
ECC P-256256 bitsVery FastGoodMobile, IoT devices
ECC P-384384 bitsFastExcellentHigh security applications

Frequently Asked Questions

Does this page generate real PGP keys?

No. The demo blocks are structurally-formatted examples that show what armored OpenPGP output looks like — they contain no usable OpenPGP key material and cannot be imported into GPG. Generate real keys locally with gpg --full-generate-key.

What is the difference between RSA and ECC keys?

RSA keys are widely supported and use larger key sizes (2048-4096 bits). ECC keys are newer, more efficient, and provide equivalent security with smaller key sizes (256-384 bits). Choose RSA for maximum compatibility, ECC for better performance.

How do I use real PGP keys once I have them?

After generating a key pair with GPG, configure your email client (Thunderbird, Apple Mail) or use browser extensions like Mailvelope for webmail. Always keep your private key secure and never share it.

Should my PGP key expire?

Yes, setting an expiration date is recommended for security. You can always extend the expiration later if needed. If you lose access to your key, expiration prevents it from being used indefinitely. Choose 1-2 years for personal use, shorter for high-security contexts.

Is it safe to generate PGP keys in a browser?

Real PGP keys should be generated offline with GPG — for high-value keys, on an air-gapped computer. That is why this page is a format demo rather than a real key generator: pasting or generating real private keys in a browser adds unnecessary risk.

What should I do with the revocation certificate?

Store your revocation certificate in a safe place separate from your private key. If your private key is ever compromised or lost, you can use the revocation certificate to notify others that the key should no longer be trusted.

Can I use PGP for file encryption, not just email?

Absolutely! PGP can encrypt any type of file or data. Use gpg --encrypt to encrypt files, documents, backups, or any sensitive data. Many backup tools and applications also support PGP encryption natively.

How to get real PGP keys

01
Generate real keys with GPG
Run gpg --full-generate-key in your terminal. GPG walks you through algorithm, key size, expiration, and identity — everything this demo illustrates.
02
Study the format with the demo
Use the demo blocks below to see how armored OpenPGP public keys, private keys, and revocation certificates are structured.
03
Back up and share correctly
Export your real public key to share it, keep the private key and revocation certificate offline and secure.

Security notice

Real PGP private keys should be generated offline with GPG — ideally on an air-gapped computer for high-value keys — and never pasted into a browser or transmitted over the network. Store your private key and revocation certificate securely: losing them means losing access to encrypted data. The demo blocks on this page contain no usable key material.