This project is mainly for people using Tor Browser and Firefox where PGP messages are common, especially on sites where you must decrypt a message to log in or encrypt one before sending it. Many people are correctly taught: “Do not install random Tor extensions.” That warning is important. But this extension was built to reduce risk while still helping with a real problem people face every day. Think of it like a lockbox that stays inside your browser:
Your keys and messages are handled inside the extension, not sent to some mystery website or saved to your computer (it's easy to forget delete message files, decrypted messages and private keys should always be encrypted/behind an admin password)
The extension asks for very limited permissions (storage and downloads). Storage is for saving private keys, public keys and the master password.
The code is open and readable, with no hidden/packed tricks, so anyone can inspect what it does.
It uses OpenPGP.js, a widely reviewed crypto library used by many developers.
So, in simple terms for a 10-year-old: this tool is like doing your secret-note math in your own notebook at home (and locked in a safe if the master password is enabled, which it should be!), instead of saving all keys, messages(encrypted and decrypted) on your hard-drive. It still follows the golden rule (be careful with extensions), but it is designed to be transparent, minimal, and focused on keeping your private messages private.
- If you want to have Tor Browser on a USB stick and want your PGP keys to be portable as well TODO: Make a tutorial for how to create a portable USB TOR drive (They will simply be saved the regular Firefox profile directory, depends on what OS you are running)
- If you want to create a LIVE USB with a privacy-oriented operating system with encrypted root partition and include a portable version of TOR with the extension
- If you are using Windows and outdated versions of PGP programs (Yes, I'm talking about you, GPG4USB) This extensions uses a library of OpenPGP which is much more up to date and much safer to use
- Just for simplicity. No need to remember nugpg arguments or anything else - It's super-easy to use
Complete PGP Functionality
- Generate RSA key pairs
- Encrypt messages with public keys
- Decrypt messages with private keys
- Sign messages (cleartext and detached)
- Verify signatures
- Import/Export keys (both private and public)
- Auto-detect key type during import
- Separate storage for imported public keys
- Handle encrypted, signed, and encrypted+signed messages
- Auto-detect PGP content on web pages
User-Friendly Interface
- Clean sidebar interface
- Tab-based navigation
- Public key dropdown selectors for easy encryption
- Signature verification dropdown in decrypt tab
- Toggle between dropdown and manual key entry
- Dedicated section for imported public keys
- Copy-to-clipboard functionality
- Context menu integration
- Real-time status feedback
Developer-Friendly
- Extensive code comments
- Debug logging (toggleable)
- No minification or obfuscation
- Clean, maintainable code structure
This extension requires the OpenPGP.js library for cryptographic operations.
- Visit the OpenPGP.js releases page: https://github.com/openpgpjs/openpgpjs/releases
- Download the latest version (e.g.,
openpgp.min.js) - Place it in the
lib/directory of this extension asopenpgp.min.js
Or use this direct command:
# Create lib directory
mkdir -p lib
# Download OpenPGP.js (version 5.x)
curl -L -o lib/openpgp.min.js https://unpkg.com/openpgp@5/dist/openpgp.min.jsInstall openpgp.js library
npm install openpgp
nvm run build.js
#This scripts will take the version number from the file __version__ and increment it with one, then replace __VERSION__ in index.html and manifest.json with the version number. Thats all it does basically, then it builds the archive.
./make.shCreate placeholder icon files in the icon/ directory:
mkdir -p iconYou can use any PNG images (19x19, 38x38, and 64x64 pixels) or create simple placeholders.
- Open Firefox
- Type
about:debuggingin the address bar - Click "This Firefox" in the left sidebar
- Click "Load Temporary Add-on"
- Navigate to the extension directory and select
manifest.json
- Package the extension:
zip -r OpenPGP.xpi * - Open Firefox
- Go to
about:addons - Click the gear icon → "Install Add-on From File"
- Select the
OpenPGP.xpifile
Note: For production use, you'll need to sign the extension through Mozilla's Add-on store.
- Click the OpenPGP icon in the toolbar, OR
- Go to View → Sidebar → OpenPGP
- Open the sidebar
- Go to the "Keys" tab
- Fill in your name, email, and a strong passphrase
- Click "Generate Key Pair"
- Wait about 30-60 seconds for key generation to complete
The extension automatically detects whether you're importing a private key or a public key:
To Import a Private Key:
- Go to the "Keys" tab
- Scroll to "Import/Export" section
- Paste your private key
- Enter the passphrase
- Click "Import Key"
To Import a Public Key:
- Go to the "Keys" tab
- Scroll to "Import/Export" section
- Paste the public key
- Leave passphrase field empty (not needed for public keys)
- Click "Import Key"
- The public key will appear in "Imported Public Keys" section
Using Imported Public Keys (Recommended):
- Go to the "Encrypt" tab
- Select recipient from the "Recipient's Public Key" dropdown
- Type your message
- Optionally check "Sign message with my key"
- Click "Encrypt Message"
- Copy the encrypted output
Using Manual Key Entry:
- Go to the "Encrypt" tab
- Check "Use manual key entry instead"
- Paste the recipient's public key in the textarea
- Type your message
- Click "Encrypt Message"
- Go to the "Decrypt" tab
- Paste the encrypted message
- Select your private key
- Enter your passphrase
- (Optional) Select sender's public key from dropdown for signature verification
- Click "Decrypt Message"
Note: The extension now properly handles:
- Encrypted messages
- Signed-only messages
- Encrypted + signed messages
- Go to the "Sign" tab
- Type your message
- Select your private key
- Enter your passphrase
- Choose signature type (cleartext or detached)
- Click "Sign Message"
- Go to the "Verify" tab
- Paste the signed message
- Paste the signer's public key
- Click "Verify Signature"
The extension automatically detects PGP content on web pages and adds action buttons:
- " Decrypt with OpenPGP" for encrypted messages
- " Verify with OpenPGP" for signed messages
- " Import with OpenPGP" for public keys
OpenPGP/
│
├── manifest.json # Extension configuration (Manifest V3)
├── index.html # Main sidebar UI
│
├── js/ # JavaScript modules
│ ├── pgp-handler.js # Core PGP operations (1,080 lines)
│ ├── ui.js # UI controllers (780 lines)
│ ├── background.js # Background service worker (220 lines)
│ └── content.js # Content script for page integration (480 lines)
│
├── css/
│ └── styles.css # Complete styling (570 lines)
│
├── lib/
│ └── openpgp.min.js # OpenPGP.js cryptography library
│
├── icon/
│ ├── icon_gray.png # Toolbar icon (19x19)
│ └── icon64.png # Sidebar icon (64x64)
│
├── README.md # Complete documentation
├── QUICKSTART.md # Quick start guide
├── setup.sh # Automated setup script
└── verify-setup.sh # Setup verification script
-
pgp-handler.js - Core PGP functionality
- Key generation, encryption, decryption
- Signing and verification
- Key storage management
- Uses OpenPGP.js library
-
ui.js - User interface controller
- Tab management
- Form handling
- Event listeners
- Status messages
-
background.js - Extension lifecycle
- Installation/update handling
- Message passing
- Context menu creation
- Storage monitoring
-
content.js - Web page integration
- Auto-detect PGP content
- Add action buttons
- Context menu support
- Monitor dynamic content
Keys are stored in Firefox's local storage API (browser.storage.local):
{
// User's own private/public key pairs
MiniPGP_keys: [
{
name: "User Name",
email: "user@example.com",
privateKey: "-----BEGIN PGP PRIVATE KEY BLOCK-----...",
publicKey: "-----BEGIN PGP PUBLIC KEY BLOCK-----...",
fingerprint: "ABCD1234...",
keyID: "1234ABCD",
created: "2024-01-01T00:00:00.000Z"
}
],
// Imported public keys (encryption recipients)
MiniPGP_public_keys: [
{
name: "Recipient Name",
email: "recipient@example.com",
publicKey: "-----BEGIN PGP PUBLIC KEY BLOCK-----...",
fingerprint: "EFGH5678...",
keyID: "5678EFGH",
created: "2024-01-01T00:00:00.000Z",
imported: true
}
],
debugMode: false
}Enable debug mode for detailed logging:
- Scroll to the bottom of the sidebar
- Check "Enable Debug Logging"
- Open Firefox Developer Tools (F12)
- View console logs prefixed with
[OpenPGP]
Important Security Notes:
-
Passphrase Storage: This extension does NOT store your passphrases. You must enter them each time you use your private key.
-
Private Key Storage: Private keys are stored encrypted (by the passphrase) in Firefox's local storage. While this is relatively secure, for maximum security consider:
- Using strong passphrases
- Not storing highly sensitive keys in the browser
- Regularly backing up keys to secure offline storage
-
Memory Security: Passphrases and decrypted keys exist briefly in browser memory during operations. Close the browser to clear memory.
-
Web Page Access: Content scripts can detect PGP content on pages but cannot access your keys without explicit user action.
- Firefox Developer Edition (recommended) or Firefox
- Basic knowledge of JavaScript, HTML, CSS
- Understanding of PGP/PGP concepts
- Edit the source files
- Reload the extension in
about:debugging - Test your changes
- Check the console for errors and debug logs
- Extensive comments explaining functionality
- Debug logging throughout
- No minification or obfuscation
- Clear variable and function names
- Modular class-based architecture
- Ensure
lib/openpgp.min.jsexists - Check Firefox console for errors
- Verify manifest.json is valid JSON
- Check debug logs
- Ensure all fields are filled
- Try a shorter key size (2048 instead of 4096)
- Verify you have the correct private key
- Check passphrase is correct
- Ensure message was encrypted for your public key
- For signed-only messages, they will be processed even without encryption
- If message is only signed (not encrypted), you don't need to provide a private key
- Ensure you have imported at least one public key
- Go to Keys tab and import a public key
- Check the "Imported Public Keys" section to verify keys are stored
- Check debug logs
- Verify PGP blocks have correct formatting
- Try manual refresh of the page
Potential improvements:
- Support for ECC keys
- Key server integration
- Bulk operations
- Settings/preferences page
- Key expiration handling
- Subkey management
- Web Crypto API integration for better performance
- Search/filter functionality for imported public keys
- Key nicknames or labels for easier identification
- Export all keys at once
- QR code generation for public keys
Recently Completed:
- Separate storage for imported public keys
- Auto-detect key type during import
- Public key dropdown selectors
- Handle signed-only messages (not just encrypted)
- Toggle between dropdown and manual key entry
This extension is provided as-is for educational and personal use.
- Built with OpenPGP.js
- Compatible with PGP/PGP standard (RFC 4880)
Public Key Management & Message Type Handling
- ✨ Separate storage and display for imported public keys
- ✨ Auto-detect key type during import (private vs public)
- ✨ Public key dropdown selectors in Encrypt tab
- ✨ Public key dropdown selectors in Decrypt tab for signature verification
- ✨ Toggle between dropdown and manual key entry
- ✨ Dedicated "Imported Public Keys" section with export/delete actions
- 🐛 Fixed decrypt function to properly handle signed-only messages
- 🐛 Fixed "Session key decryption failed" error for non-encrypted messages
- 🔧 Improved message type detection (encrypted, signed, encrypted+signed)
- 🔧 Enhanced signature verification for all message types
- Previous stable release
- Basic key management
- Encryption, decryption, signing, verification
- Master password protection
- Key backup/restore functionality
- Initial MVP release
- Key generation, encryption, decryption
- Signing and verification
- Auto-detection of PGP content
- Sidebar interface
- Debug logging
Made with for secure communications