Generate a key pair
The pair is generated in this page by the Web Crypto API. Nothing is uploaded, and nothing is stored — reload and it is gone.
Do these two keys match?
Both BEGIN PUBLIC KEY (SPKI) and BEGIN RSA PUBLIC KEY (PKCS#1) are accepted, and likewise BEGIN PRIVATE KEY and BEGIN RSA PRIVATE KEY. Only RSA keys can be checked — the matching test works by signing a throwaway message with the private key and asking the public key to verify it, and a signature never leaves this page.
Learn
History for this tool
The most recent data you entered in this tool, stored only in this browser.
Save what you type here, in this browser? Your work would go into this browser's local storage, so a refresh or a trip to another tool does not wipe it. You also get a short list of previous entries under the form, each one restorable with a click. Nothing is ever uploaded, and there is no account.
Being straight about the trade-off: anything kept there can be read by anyone who can use this browser profile, and by any script that later runs on this site. A tool page can hold a private key, a password or a signed token. Saving is convenient; it is not private.
About this tool
Generate an RSA key pair in the browser with WebCrypto, in PEM form, ready to paste into an SSH or TLS configuration — and check whether a public key and a private key you already have are actually a pair. The private key never leaves the page unless you copy it out.Questions
- How many bits should the key be?
- 2048 is the accepted minimum today. 4096 is slower to generate and to use for a modest margin, and 1024 should be treated as broken.
- How do you tell whether two keys match?
- WebCrypto cannot derive one key from the other, so the check signs a fixed throwaway message with the private key and asks the public key to verify it. If the signature verifies, the two halves share a modulus and are a genuine pair. The probe message is a constant, so the same two keys always give the same answer.
- Which key formats are accepted for the check?
- PKCS#8 and PKCS#1 for private keys, SPKI and PKCS#1 for public keys — that is BEGIN PRIVATE KEY, BEGIN RSA PRIVATE KEY, BEGIN PUBLIC KEY and BEGIN RSA PUBLIC KEY. The PKCS#1 forms are what openssl genrsa and openssl rsa -RSAPublicKey_out print, so they are wrapped into PKCS#8 or SPKI before WebCrypto sees them rather than rejected.
- Is a key generated in a browser trustworthy?
- WebCrypto generates the key material in your browser, but the private key is displayed as unencrypted text. The safety of a real key also depends on the browser, device, page integrity, storage, and how you later use it. Follow your organization’s key-generation and handling policy.