PGP Encryption & Decryption

Encrypt & decrypt PGP in-browser — RSA + AES-256, no data stored.
OpenPGP RFC 4880 RSA + AES-256 Python Compiler No Data Stored
✏️

Your Message

Type or paste your secret message

💡 Only the recipient with the matching private key can decrypt this message
🔑

Recipient's Public Key

Paste recipient's public key block

📨

Encrypted Message

Paste the PGP message block

⚠️ Include the complete message including BEGIN/END markers
🔐

Your Credentials

Your private key to decrypt

Private key passphrase

🔑

Generate PGP Key Pair

Name or email address (e.g., [email protected])

Protects the private key (min 8 characters recommended)

💡 Keys are generated server-side via CSRNG and never stored. Save the private key locally — losing it means losing access.
🔍

Decode PGP Packet Structure

Paste a public/private key, PGP message, or signature block. The server parses it per RFC 4880 and shows packet tags, algorithms, key sizes, and fingerprints.

💡 Accepted blocks: PGP PUBLIC KEY BLOCK, PGP PRIVATE KEY BLOCK, PGP MESSAGE, PGP SIGNATURE.
📋

Result

PGP Encrypt
Step 1: Symmetric Encryption
Message
ZIP + AES-256
Session Key
Encrypted Body
Step 2: Key Wrapping
Session Key
RSA Encrypt
+ Public Key
Wrapped Key
Encrypted Body + Wrapped Key =
PGP Message

Enter a message, paste a public key, and click Encrypt.

Python Compiler

PGP Encryption Code Examples

Copy-paste PGP encryption and decryption code in Python, Java, Node.js, Go, or OpenSSL. Or click Try It Live above to run PGP code directly in your browser.

Python: PGP Encrypt & Decrypt
import pgpy from pgpy.constants import PubKeyAlgorithm, KeyFlags from pgpy.constants import HashAlgorithm, SymmetricKeyAlgorithm, CompressionAlgorithm # Generate PGP key pair key = pgpy.PGPKey.new(PubKeyAlgorithm.RSAEncryptOrSign, 2048) uid = pgpy.PGPUID.new("Alice", email="[email protected]") key.add_uid(uid, usage={KeyFlags.EncryptCommunications}, hashes=[HashAlgorithm.SHA256], ciphers=[SymmetricKeyAlgorithm.AES256], compression=[CompressionAlgorithm.ZIP]) # Encrypt message = pgpy.PGPMessage.new("Hello, this is a secret message!") encrypted = key.pubkey.encrypt(message) print("Encrypted:", str(encrypted)[:80], "...") # Decrypt decrypted = key.decrypt(encrypted) print("Decrypted:", decrypted.message)

About This PGP Tool & Cryptographic Methodology

This online PGP encryption and decryption tool implements the OpenPGP standard (RFC 4880) using industry-standard Java cryptography libraries (Bouncy Castle). All cryptographic operations are performed server-side using RSA public-key cryptography with configurable key sizes (1024-4096 bits). Messages are encrypted using a hybrid approach: symmetric encryption (AES/3DES) for the message body and RSA public-key encryption for the session key.

How PGP Encryption Works:

  1. Key Generation: RSA keypair (public + private) is generated using cryptographically secure random number generation
  2. Encryption: Message is compressed (ZIP), encrypted with a symmetric key (AES-256), then the symmetric key is encrypted with recipient's RSA public key
  3. Decryption: Private key decrypts the session key, which then decrypts the message body. Passphrase protects the private key using symmetric encryption
  4. Security Model: Even if the encrypted message is intercepted, only the holder of the private key (and passphrase) can decrypt it

Authorship & Expertise

  • Author: Anish Nath
  • Background: Security engineer specializing in cryptographic implementations
  • Reviewed by: 8gwifi.org security team
  • First published: 2018-10-23
  • Last updated: 2025-11-20

Trust & Privacy Guarantees

  • No Data Retention: Messages and keys processed in-memory only
  • HTTPS Only: All data transmission uses TLS 1.2+ encryption
  • Open Standards: Implements RFC 4880 (OpenPGP)
  • Library: Bouncy Castle - peer-reviewed Java crypto provider
  • Support: @anish2good
Security Disclaimer: While this tool implements industry-standard cryptography, for maximum security when handling highly sensitive data (financial, medical, classified), consider using offline PGP implementations (GPG) on air-gapped systems.

Frequently Asked Questions

PGP (Pretty Good Privacy) is a public-key cryptography system that uses RSA asymmetric encryption. It works by generating a keypair (public key for encryption, private key for decryption), encrypting messages with the recipient's public key, and the recipient decrypts with their private key protected by a passphrase. This tool implements the OpenPGP standard (RFC 4880).
Yes, this tool is secure. We implement OpenPGP standard (RFC 4880) using Bouncy Castle cryptography library. All encryption/decryption happens in-memory only. We do NOT store, log, or retain any keys, passphrases, or messages. No software installation required.
To encrypt: Select 'Encrypt' mode, enter your message, paste the recipient's PGP public key (must include BEGIN/END markers), click 'Encrypt Message'. Share the encrypted message via the 'Share URL' feature or copy it directly. You can also run PGP encryption code in the built-in Python compiler.
Yes, PGP with RSA-2048 or higher and AES-256 remains cryptographically secure. No practical attacks exist against properly implemented PGP. For maximum security, use key sizes of 2048 bits or higher and keep your private key and passphrase safe.
PGP and AES-256 serve different purposes. PGP is a hybrid cryptosystem that uses both RSA (asymmetric) for key exchange and AES-256 (symmetric) for message body encryption. AES-256 alone requires both parties to share a secret key beforehand, while PGP solves key distribution using public/private key pairs.
Use the pgpy or python-gnupg library. This tool includes a built-in Python compiler with ready-to-run templates for PGP encryption, decryption, key generation, signing, and verification. Click Try It Live in the output panel to write and execute PGP Python code directly in your browser.
PGP is used for encrypting emails, securing files, creating digital signatures, verifying message authenticity, and protecting sensitive communications. It is the standard for end-to-end encrypted email and is widely used in journalism, security research, and privacy-focused communications.
Yes! This tool includes a built-in Python compiler with PGP templates. Click Try It Live to run PGP encryption, decryption, key generation, signing, and verification code directly in your browser. No installation or setup is needed.

Support This Free Tool

Every coffee helps keep the servers running. Every book sale funds the next tool I'm dreaming up. You're not just supporting a site — you're helping me build what developers actually need.

500K+ users
200+ tools
100% private
Privacy Guarantee: Private keys you enter or generate are never stored on our servers. All tools are served over HTTPS.