Crypto tools

ECDSA key pair generate

Generate an ECDSA key pair, on your device; the private key never leaves your browser.

Runs on your device. The file is never uploaded.

ECDSA key pair generate builds a named-curve pair on P-256, P-384 or P-521 and prints the SPKI public block and the PKCS8 secret block as PEM text. P-256 is the default, and the curve fixes the signing hash. The pair carries sign and verify usages only, so it encrypts nothing and no key agreement tool here reads it.

Options

Questions

Which curve should I pick?

P-256 by default, with P-384 and P-521 also offered. Whatever you choose has to be repeated on the ECDSA sign and ECDSA verify tools, because Web Crypto needs the curve name to import the key. The curve also fixes the hash those tools use: SHA-256 for P-256, SHA-384 for P-384, SHA-512 for P-521. There is no option to mix a curve with a different hash.

Does the private key leave my browser?

No. crypto.subtle.generateKey makes the pair inside this tab and the PEM blocks are built in the page. Nothing is uploaded, nothing is saved, and the site can do this offline. The key exists only in the text you copy out, so save the private block before closing the tab. Nobody, this site included, can regenerate the same pair.

What am I given?

Two PEM blocks in one result: the public key as SPKI under BEGIN PUBLIC KEY, a blank line, then the private key as PKCS8 under BEGIN PRIVATE KEY. Both are standard forms that OpenSSL and most libraries read. The private key is not encrypted or password protected, so the copied text is the secret itself.

Can I use this key for encryption?

No. The pair is generated for the ECDSA algorithm with sign and verify usages only. ECDSA signs; it does not encrypt. There is no ECDH key agreement tool on this site either. If you need to encrypt something, use AES-GCM encrypt with a password, or RSA-OAEP encrypt for a small message.

Is an ECDSA key better than an RSA key?

This site takes no position on that. What the code does fix is the pairing: ECDSA keys work with ECDSA sign and ECDSA verify, RSA keys work with RSA-PSS sign and RSA-PSS verify, and neither imports into the other. Pick whichever the system you are working with expects, and generate it here.

Can I use it for SSH or a certificate?

Not directly. You get a bare key pair, with no certificate, no CSR and no OpenSSH formatting. The PKCS8 and SPKI PEM blocks are the raw material those steps consume, but building a certificate signing request or converting to the OpenSSH key format happens with other tools. What you have here is the key itself, in the two standard container formats.

Related Crypto tools