b2KIT

PGP Key Generator

Generate PGP/GPG public and private key pairs with configurable key size and algorithm using OpenPGP.js.

Tested tool guide Tested browser tools Checked August 16, 2026

What PGP Key Generator does and how it behaves

This tool generates an OpenPGP key pair - a public key you can share and a private key only you should hold - entirely in the browser, using the OpenPGP.js library. You choose the algorithm (RSA or elliptic curve), the RSA key size, the name and email the key is bound to, and a passphrase that encrypts the private key. Both keys come back as ASCII-armored text you save as files and import into GPG or a mail client. The part users most often miss: the pair exists only in page memory until you save it, and the public key is useless until you distribute it to the people who should encrypt to you.

How the result is produced

1

How the key pair is produced

The OpenPGP.js library runs in the page and builds a key around your inputs: a user ID (name and email), the chosen algorithm, and a size. RSA generation finds primes and computes the public modulus and private exponents; elliptic-curve generation (EdDSA or ECDSA) derives a private scalar and a public curve point. The key material is then serialized into the ASCII-armored OpenPGP format defined by RFC 4880.

2

What the passphrase actually does

The passphrase never becomes part of the key. OpenPGP stretches it into a symmetric key using the string-to-key mechanism (RFC 4880) - a random salt plus iterative hashing - and uses that to encrypt the private key material before serialization. Forget the passphrase and the private key is permanently unrecoverable, by you or anyone else. Leave the field empty and the private key is written in plaintext, protected only by whoever can access the file.

Good uses

  • Set up encrypted email or signed messages: generate a personal key, import the private key into your mail client, and publish the public key so contacts can encrypt to you.
  • Create a signing key for software releases, package uploads, or git commit signing, publishing the public key so others can verify your signatures.
  • Produce throwaway test keys while developing or debugging OpenPGP integrations, key servers, or encryption features, without installing a command-line GPG tool.

Limits and checks

  • The passphrase is the entire protection for the private key, and recovery is impossible. If you forget it, or you lose the private key file itself, the pair is gone - there is no recovery service and nothing is stored server-side.
  • The key exists only in the open page's memory. Refreshing or closing the tab destroys an unsaved key, so save both armored blocks to files immediately and treat the private key file like credentials.
  • Not every algorithm works everywhere. Older clients and RFC 4880-era software may refuse elliptic-curve or version-6 keys, and some services expect specific key formats. For maximum compatibility with dated recipients, choose RSA.

Common questions

Is it safe to generate a private key in a browser tab?

Generation runs locally in the page and the key material is never uploaded - nothing leaves your browser. That makes the generation itself sound, provided the page is served over HTTPS. The weak points are on your side afterwards: a weak passphrase, the private key file falling into other hands, or malware on the machine that read the tab.

Can I use the generated key with GPG on the command line?

Yes, if you chose a supported algorithm. Save each armored block to a file and run gpg --import on the private key on your own machine and on the public key wherever your identity should be trusted. Most mail clients import the same files directly. If an import is rejected, regenerate with RSA, which nearly everything accepts.

References and verification

The behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools