PGP Key Pair Generator - Create RSA OpenPGP Keys Online
Generate PGP/GPG key pairs (RSA 2048/4096) directly in your browser. Export ASCII-armored public & private keys with fingerprint. No server, fully client-side.
About
PGP (Pretty Good Privacy) key pairs form the basis of asymmetric cryptography used in email encryption, software signing, and identity verification. A misconfigured key - wrong algorithm, insufficient bit length, or a leaked private block - renders the entire trust chain void. This tool generates RFC 4880-compliant OpenPGP key packets using the browser's native Web Crypto API (crypto.subtle), producing RSA keys at 2048 or 4096 bits. The output includes ASCII-armored public and secret key blocks with proper CRC24 checksums, a 160-bit SHA-1 fingerprint, and the 64-bit Key ID. No data leaves your browser. All entropy is sourced from the operating system's CSPRNG via getRandomValues.
Limitations: this generator produces Version 4 key packets without subkeys or advanced signature subpackets (key expiration, preferred algorithms). For production use in high-security environments, validate output against GnuPG (gpg --import). The private key block is unencrypted (S2K not applied); protect it with filesystem-level encryption or import into a keyring immediately. RSA 2048 provides approximately 112 bits of security strength per NIST SP 800-57; choose 4096 for long-term archival signatures.
Formulas
RSA key generation selects two large primes p and q, then computes the modulus and private exponent:
n = p ร q
ฯ(n) = (p โ 1)(q โ 1)
d โก eโ1 mod ฯ(n)
The public key is the pair (n, e) where e = 65537. The private key includes d, p, q, and the CRT coefficient u โก pโ1 mod q.
The OpenPGP v4 fingerprint is computed as:
fingerprint = SHA-1(0x99 ‖ len ‖ pubkey_packet_body)
The CRC24 armor checksum uses the generator polynomial:
g(x) = x24 + x23 + x18 + x17 + x14 + x11 + x10 + x7 + x6 + x5 + x4 + x3 + x + 1
where n = RSA modulus, e = public exponent, d = private exponent, p, q = prime factors, u = CRT coefficient, len = 2-byte packet body length.
Reference Data
| Parameter | RSA-2048 | RSA-4096 | Notes |
|---|---|---|---|
| Key Size (bits) | 2048 | 4096 | Modulus length n |
| Security Strength (bits) | 112 | 140 | NIST SP 800-57 |
| Public Exponent e | 65537 (0x10001) | Fermat prime F4 | |
| Packet Version | v4 (RFC 4880) | Tag 6 / Tag 5 | |
| Fingerprint Algorithm | SHA-1 (160 bit) | Hash of key material packet | |
| Key ID | Low 64 bits of fingerprint | 16 hex chars | |
| Armor Checksum | CRC24 | Polynomial 0x1864CFB | |
| Armor Line Length | 76 characters | Base64 per RFC 4880 ยง6.3 | |
| Generation Time (typical) | < 1s | 2 - 8s | Browser & hardware dependent |
| MPI Encoding | Big-endian, bit-count prefix | RFC 4880 ยง3.2 | |
| User ID Packet | Tag 13, UTF-8 | "Name <email>" format | |
| Signature Packet | Tag 2, Type 0x13 | Positive certification | |
| Hash for Signature | SHA-256 | Algorithm ID 8 | |
| NIST Recommended Until | 2030 | Beyond 2030 | SP 800-57 Part 1 Rev 5 |
| Typical Public Key Block Size | ~1.2KB | ~3.1KB | ASCII-armored |
| Typical Secret Key Block Size | ~3.5KB | ~9.5KB | ASCII-armored, unencrypted |