Skip to content

ECDSA and Ed25519 key generator

Free, no sign-up Runs in your browser

Generate ECDSA key pairs on P-256, P-384 or P-521, or an Ed25519 pair where your browser supports it. Export as PEM and JWK. Keys never leave the browser.

PEM

Private key (PKCS#8 PEM)
-----BEGIN PRIVATE KEY----- appears here.
Public key (SPKI PEM)
-----BEGIN PUBLIC KEY----- appears here.

JWK

Private key (JWK)
The result appears here.
Public key (JWK)
The result appears here.

The key pair is made by your browser’s Web Crypto and never leaves this page. Generate production keys on the machine that will use them, so the private key is never in a browser tab or a clipboard. Use keys from this page for development, tests and learning.

Everything you type here stays in your browser. Nothing is sent to HardenKit or to anyone else.

How to use the ECDSA and Ed25519 key generator

  1. Choose a curve: P-256 for most uses, or Ed25519 where your tools support it.
  2. Press Generate key pair.
  3. Copy the keys as PEM or as JWK, whichever your software reads.
  4. Use them for development and tests. Generate production keys on the machine that will use them.

About this tool

Elliptic curve keys do the job of RSA keys at a fraction of the size. A 256-bit curve key offers about the security of a 3072-bit RSA key, signs faster and produces small signatures. ECDSA on the NIST curves is what ES256, ES384 and ES512 JSON Web Tokens use, what most TLS certificates now carry, and what passkeys rely on. Ed25519 is the newer design used by SSH and many signing tools.

This tool generates a pair with your browser’s Web Crypto and shows it in the two formats you are likely to be asked for. PEM gives PKCS#8 for the private key and SPKI for the public key, which OpenSSL and most languages read. JWK is the JSON form used by JWT libraries and JWKS endpoints: the curve name, the public point as x and y, and for a private key the secret value d.

P-256 is the right default and is supported everywhere. P-384 is for policies that require a 192-bit level. P-521, with 521 bits and not 512, is rarely required. Ed25519 avoids a classic ECDSA danger, a repeated or biased per-signature random number that reveals the private key, by deriving that number from the key and message. Browser support for Ed25519 is recent, so the page checks for it and tells you when it is missing.

Sources

Questions

Which curve should I choose?

P-256 unless something tells you otherwise: it is fast, supported by every library and required by many standards. Choose P-384 when a compliance profile asks for it. Choose Ed25519 for SSH keys and for new systems whose components all support it.

What is the difference between ECDSA and Ed25519?

Both are elliptic curve signature schemes. ECDSA needs a fresh secret random number for every signature, and a flaw there has leaked private keys in real products. Ed25519 uses a different curve and derives that number deterministically, which removes that failure and makes implementations simpler and usually faster.

Why is it P-521 and not P-512?

The curve is defined over a field whose prime is 2 to the power of 521 minus 1, a Mersenne prime that makes the arithmetic efficient. The JWT algorithm that uses it is named ES512 because it pairs the curve with SHA-512, which adds to the confusion.

Does my browser support Ed25519 in Web Crypto?

Current versions of Chrome, Edge, Firefox and Safari do; older ones do not. The page tries to create an Ed25519 key when it loads and tells you plainly if that fails, in which case you can use a P curve here or run openssl genpkey -algorithm ed25519 on your machine.

Related tools