KitWharfFREEFast & Private Web Apps

The Complete OpenPGP Guide: How In-Browser Key Generation, Message Encryption & Digital Signatures Work Under the Hood

November 8, 202611 min readKitWharf Team

For over three decades, Pretty Good Privacy (PGP) and its vendor-neutral open standard, OpenPGP (standardized in RFC 4880 and modernized in RFC 9580), have served as the foundational bedrock of decentralized cryptographic communication. From investigative journalists safeguarding anonymous sources to Linux kernel maintainers signing software packages and git commits, OpenPGP remains the gold standard for end-to-end confidential data exchange and digital non-repudiation.

Historically, however, working with OpenPGP required installing complex command-line toolchains like GnuPG (gpg), memorizing obscure terminal flags (--armor, --sign-key, --clearsign), and managing local keyring files that were frequently corrupted or inaccessible on mobile devices.

To eliminate this friction while upholding strict cryptographic security, we engineered the KitWharf OpenPGP Suite β€” a 100% in-browser, zero-knowledge tool that generates modern Curve25519 and RSA key pairs, encrypts/decrypts confidential messages, and verifies digital signatures entirely in your browser memory.


1. How OpenPGP Hybrid Encryption Works Under the Hood

A common misconception among developers is that OpenPGP uses asymmetric public-key cryptography to encrypt the entire message. In reality, asymmetric algorithms like RSA or Curve25519 elliptic-curve Diffie-Hellman (ECDH) are computationally demanding and mathematically restricted in the amount of data they can encrypt directly.

To overcome this, OpenPGP implements Hybrid Cryptography, combining the speed of symmetric ciphers with the key-distribution benefits of asymmetric cryptography:

Cryptographic Pipeline Architecture

How OpenPGP Hybrid Encryption & Decryption Works Under the Hood

Pairing hardware-accelerated AES-256 bulk encryption with Curve25519 & RSA asymmetric public-key secrecy β€” 100% inside local browser RAM.

πŸ” OPENPGP HYBRID ENCRYPTION & DIGITAL SIGNATURE PIPELINE RFC 9580 & RFC 4880 β€’ Native SubtleCrypto + OpenPGP.js β€’ 0 Remote Key Exposure ZERO-KNOWLEDGE RAM πŸ“€ SENDER (ALICE) In-Browser Encryption Phase 1. Generate One-Time Ephemeral Session Key crypto.getRandomValues(32) -> 256-bit AES Key 2. Symmetric Bulk Data Encryption Plaintext + AES Key β†’ High-Throughput Ciphertext 3. Asymmetric Key Sealing AES Key + Bob's Public Key (Curve25519/RSA) β†’ Sealed Key 4. Sign & Pack Radix-64 ASCII Armor Ed25519 Sign β†’ Pack -----BEGIN PGP MESSAGE----- ENCRYPTED ARMORED PAYLOAD READY Sealed for Bob's Public Key Only Safe to transmit via email, chat, or public forum TRANSIT πŸ”’ πŸ“₯ RECIPIENT (BOB) In-Browser Decryption Phase 1. Ingest Armored OpenPGP Message De-armor Radix-64 β†’ Key Packet + Ciphertext 2. Unlock Ephemeral Session Key Sealed Key + Bob's Private Key β†’ 256-bit AES Key 3. Bulk Symmetric Decryption Ciphertext + Unlocked AES Key β†’ Plaintext 4. Cryptographic Signature Verification Ed25519 Signature β†’ Origin & Integrity OK CONFIDENTIALITY & AUTHENTICITY CONFIRMED 100% UNTAMPERED PLAINTEXT Verified against Alice's public fingerprint ZERO NETWORK TRANSMISSION All Cryptographic Math Executes Strictly Inside Local Browser RAM Private keys never leave your machine β€’ Zero telemetry or server calls β€’ Ephemeral memory auto-clears on tab close Web Crypto API (SubtleCrypto) β€’ OpenPGP.js (RFC 9580 & RFC 4880) β€’ Pure Client-Side Privacy

Figure 1: The dual-column OpenPGP hybrid cryptography flow. Ephemeral symmetric keys handle multi-megabyte payloads in milliseconds, while asymmetric public keys provide zero-knowledge key distribution.

The Step-by-Step Encryption Flow

  1. Symmetric Session Key Generation: The browser's native crypto.getRandomValues() engine generates a cryptographically secure 256-bit symmetric session key.
  2. Bulk Data Encryption: The message payload is compressed and encrypted with a high-throughput symmetric cipher (such as AES-256-GCM or AES-256-CFB). Because symmetric ciphers execute using hardware AES-NI instructions, encrypting even a 10MB text file takes less than 20 milliseconds.
  3. Session Key Sealing: The 256-bit session key is encrypted using the recipient's asymmetric public key (Curve25519 or RSA).
  4. Armored Packaging: Both the encrypted session key packet and the encrypted message body packet are serialized and encoded into Radix-64 (OpenPGP ASCII Armor) surrounded by standard header delimiters:
-----BEGIN PGP MESSAGE-----
Version: OpenPGP.js v5.11.0
Comment: https://kitwharf.com/pgp-tool/

wcBMA4KzQo9L1FvQAQgAjm7wK...
=r9aD
-----END PGP MESSAGE-----

Only the recipient who holds the corresponding private key can decrypt the session key, and only that decrypted session key can unlock the plaintext message.


2. Curve25519 vs. RSA 4096-bit: Why Modern Elliptic Curves Won

When generating an OpenPGP key pair today, you are presented with two primary cryptographic architectures: modern Elliptic Curve Cryptography (Curve25519) and legacy RSA (Rivest–Shamir–Adleman).

Metric Curve25519 (Ed25519 / Cv25519) RSA 4096-bit Legacy RSA 2048-bit
IETF Standard RFC 9580 (OpenPGP v6) & RFC 4880bis RFC 4880 (OpenPGP v4) RFC 4880 (OpenPGP v4)
Security Level ~128 bits (Equivalent to 3072-bit RSA) ~140 bits ~112 bits (Deprecating)
Public Key Size ~800 bytes (Fits in a QR code or text bio) ~3,100 bytes (Bulkier blocks) ~1,700 bytes
In-Browser KeyGen Speed < 40 milliseconds 1,500 – 4,500 milliseconds 400 – 800 milliseconds
Side-Channel Immunity Complete constant-time execution Susceptible to microarchitectural timing leaks Susceptible to microarchitectural timing leaks
Software Support GnuPG 2.1+, Sequoia, Proton Mail, KitWharf Universal across legacy systems Universal

Why We Default to Curve25519 on KitWharf

In 2024 and 2026, the IETF ratified RFC 9580, making Curve25519 the standard curve for OpenPGP.

  • Edwards-curve Digital Signature Algorithm (Ed25519) handles digital signatures and message authentication.
  • Curve25519 Diffie-Hellman (Cv25519 / X25519) handles key agreement and hybrid message encryption.

Generating an RSA 4096 key in browser JavaScript requires finding two enormous 2048-bit prime numbers, which can freeze low-end mobile devices for several seconds. In contrast, Curve25519 key generation executes virtually instantly with deterministic security.


3. Cleartext Digital Signatures: Proving Identity & Preventing Tampering

Encryption guarantees confidentiality (only Bob can read the text), but it does not guarantee authenticity (Bob has no cryptographic proof that the text actually originated from Alice and wasn't spoofed by an attacker).

To achieve non-repudiation and tamper-proofing, OpenPGP provides Cleartext Digital Signatures:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

This is an official announcement from KitWharf Security:
All tools execute 100% locally in browser memory without server uploads.
-----BEGIN PGP SIGNATURE-----
Version: OpenPGP.js v5.11.0

wsBzBAEBCAAGBQJm...
-----END PGP SIGNATURE-----

How Signature Verification Works

  1. Hashing the Canonical Text: The message body is normalized (stripping trailing whitespace and converting newlines to CRLF) and hashed with SHA-256.
  2. Private Key Signing: The signer's private key uses Ed25519 or RSA to compute a digital signature over that SHA-256 digest.
  3. Verification: Anyone with the signer's public key recalculates the hash over the plaintext body and checks whether the signature mathematically corresponds to the signer's public key.
  4. Tamper Detection: If even a single punctuation mark, space, or letter is changed in transit, the calculated hash will not match the decrypted signature digest, and the verification engine will immediately flag the message as UNAUTHENTIC / TAMPERED.

4. Why You Must Save Your Emergency Revocation Certificate

When you generate an OpenPGP key pair on KitWharf, you will notice an Emergency Revocation Certificate generated alongside your public and private keys.

-----BEGIN PGP SIGNATURE-----
Comment: KitWharf Emergency Revocation Certificate
...
-----END PGP SIGNATURE-----

The Immutable Nature of Keyservers

OpenPGP was designed before centralized cloud databases existed. Public keys are distributed through a decentralized mesh network of keyservers (such as keys.openpgp.org and the SKS keyserver pool). By design, keyservers are append-only: you cannot contact an administrator or click a "Delete Account" button to remove an uploaded public key.

If your laptop is stolen, your hard drive fails, or your private key passphrase is forgotten, your Revocation Certificate is the only cryptographic mechanism recognized by OpenPGP clients worldwide to mark the key as dead. When uploaded to a keyserver, the certificate instructs software like Thunderbird, GnuPG, and Mailvelope to display a prominent red KEY REVOKED / UNTRUSTED warning, preventing correspondents from encrypting new sensitive data with the abandoned key.


5. Zero-Knowledge in the Browser: How KitWharf Protects Your Keys

Many web-based cryptographic utilities claim to be secure but secretly send keys and passwords to their backend servers for processing.

KitWharf was built on a zero-knowledge architectural promise:

  1. Local Browser RAM Execution: The KitWharf OpenPGP Suite loads the compiled OpenPGP.js engine directly into your browser's runtime. All key generation, AES-256 session encryption, and Curve25519 math execute inside your client machine's CPU and memory.
  2. Zero Server Network Requests: No API calls, webhooks, analytics pings, or telemetry headers are triggered when you generate keys or decrypt messages. You can disconnect from the internet or toggle Airplane Mode β€” the tool remains fully functional offline.
  3. Ephemeral Volatility: When you close or refresh your browser tab, the private keys and plaintexts residing in browser RAM are instantly erased by the browser's garbage collector.

πŸ›‘οΈ Zero-Knowledge Client Suite

Generate OpenPGP Keys or Decrypt Confidential Messages Now

Everything executes 100% locally inside your browser memory using WebCrypto and OpenPGP.js. Zero server uploads, zero logging, and complete airgap safety.

Summary: Recommended Workflow for New Users

  1. Generate: Visit /pgp-tool/, choose Curve25519, enter your name/email, set a strong passphrase, and click Generate PGP Key Pair.
  2. Store Safely: Download your private_key.asc and revocation.asc and store them in an encrypted offline vault (like KitWharf Password Vault).
  3. Publish: Download your public_key.asc and publish it to keys.openpgp.org or add it to your personal website and GitHub profile.
  4. Communicate: Use the Encrypt and Decrypt tabs anytime you need to exchange sensitive credentials, API keys, or confidential statements without installing desktop command-line software.
Found this guide helpful? Share it with your team: