DevKits

ECDSA Key Pair Generator — P-256 / P-384 / P-521, PEM & JWK

Generate elliptic-curve key pairs (P-256, P-384, P-521) for ECDSA signatures or ECDH key agreement. Exports PKCS#8 / SPKI PEM, JWK, and DER (hex/base64). Perfect for ES256/ES384/ES512 JWTs. 100% local via the Web Crypto API — the private key never leaves your browser.

Last updated:

Comments

Key generation uses the native Web Crypto API entirely in your browser. Elliptic-curve keys are dramatically smaller than RSA at equivalent strength (256-bit EC ≈ 3072-bit RSA).

Frequently Asked Questions

Which curve should I pick?

P-256 (also called secp256r1 or prime256v1) is the default — fast, widely supported, and provides 128-bit security. Use it unless you have a specific reason to go higher. P-384 gives 192-bit security and is required by some government profiles (Suite B TOP SECRET). P-521 is rarely necessary and has slightly awkward performance because 521 bits doesn't align to word boundaries.

What's the difference between ECDSA and ECDH?

Same key material, different math. ECDSA uses the key pair to produce and verify signatures. ECDH uses two key pairs (yours + the peer's) to derive a shared secret without ever transmitting it — that shared secret is then usually fed into a KDF (HKDF, PBKDF2) and used as a symmetric key. If you need signing, pick ECDSA; if you need key agreement / hybrid encryption, pick ECDH.

How do these curves map to JWT algorithms?

P-256 → ES256, P-384 → ES384, P-521 → ES512. Most JWT libraries detect this automatically from the JWK 'crv' field. Note that ES256K (secp256k1, Bitcoin's curve) is NOT included here — the Web Crypto API doesn't expose it. If you need secp256k1, use a dedicated library like noble-curves.

Why are EC keys so much shorter than RSA keys?

Because elliptic-curve cryptography reaches equivalent security with far smaller keys. A 256-bit EC key gives roughly the same security as a 3072-bit RSA key. Smaller keys mean smaller signatures, less bandwidth, faster handshakes — which is why TLS, SSH, and modern JWTs increasingly default to EC.

Is my private key sent anywhere?

No. crypto.subtle.generateKey() runs entirely in your browser. You can verify with DevTools Network panel — Generate produces no network traffic. Once you close the tab, the private key is gone.

Related Tools