admin@likeapro.dev: ~/keygen — zsh

// admin tools · 07

Key-pair generator

RSA, ECDSA P-256/384/521, Ed25519 and X25519 key pairs from WebCrypto — exported as PKCS#8 and SPKI PEM, JWK with an RFC 7638 kid, and an OpenSSH authorized_keys line with its SHA256 fingerprint.

// runs locally — private keys are generated in this tab and never leave it

Private keys are generated in this tab and never leave it. Nothing is uploaded, stored or logged; keys are wiped when you leave or press wipe. Still: for production servers, prefer generating keys on the machine that will use them.
algorithm

OpenSSH's own private-key format isn't produced. You don't need it: OpenSSH 10.0 (tested) reads these PKCS#8 files directly — chmod 600 key.pem, then ssh -i key.pem or ssh-keygen -y -f key.pem. To rewrite one in OpenSSH format, run ssh-keygen -p -f key.pem (it prompts for a passphrase). ssh-keygen -i -m PKCS8 -f public.pem converts RSA and ECDSA public keys, but not Ed25519. Older OpenSSH releases may reject PKCS#8 Ed25519 keys.

GENERATE local only · 0 bytes sent --:--:--

How it works

What it does

This generator creates asymmetric key pairs with your browser's built-in WebCrypto API and hands you every common encoding at once: the private key as PKCS#8 PEM, the public key as SPKI PEM, both as JWK with a standard kid, and the public key as an OpenSSH authorized_keys line with the same SHA256 fingerprint ssh-keygen -l prints. The --inspect tab works the other way: paste a public key in any of those formats and it reports the type, size or curve and fingerprints, and converts it to the others.

Keys are generated locally by crypto.subtle.generateKey. They are never uploaded, stored or written to the URL, and the page drops them when you leave.

Which algorithm?

Ed25519
The modern default for SSH and signatures: tiny keys, fast, no parameter choices to get wrong. Needs a browser whose WebCrypto supports it; the page checks and tells you.
ECDSA P-256
Widely supported for JWT (ES256), TLS and SSH. P-384 and P-521 trade speed for larger security margins.
RSA 3072
Maximum compatibility with older systems. 2048 bits is still the common floor; 3072 matches 128-bit security. The WebCrypto usage (PSS, PKCS#1 v1.5, OAEP) only changes the JWK alg; the key material and its SSH form are the same.
X25519
Diffie-Hellman key agreement, not signing. It has a JWK form but no SSH public-key type.

Fingerprints explained

  • kid is the RFC 7638 JWK thumbprint: SHA-256 over the key's required members in a fixed order, base64url-encoded. Any library computes the same value for the same key.
  • ssh-keygen -l is SHA-256 over the OpenSSH key blob, in unpadded base64, exactly as OpenSSH prints it.
  • spki pin is SHA-256 over the DER public key, the format curl --pinnedpubkey expects.

The SSH encodings were checked against OpenSSH 10.0: ssh-keygen -l reports identical fingerprints and ssh-keygen -y derives the same public key from the PKCS#8 file.

FAQ

Why no OpenSSH private key file?

WebCrypto exports PKCS#8, and current OpenSSH reads PKCS#8 PEM private keys directly. To convert one to OpenSSH format, run ssh-keygen -p -f key.pem and set a passphrase. Very old OpenSSH builds may not accept Ed25519 in PKCS#8.

Is a browser-generated key safe to use?

The randomness comes from the operating system's CSPRNG via WebCrypto, the same source native tools use. The bigger risk is handling: a private key that has been copied, synced or pasted around is harder to account for. For long-lived production keys, generate them on the target machine.

How do I add the key to a server?

Append the authorized_keys line to ~/.ssh/authorized_keys on the server, save the private PEM locally with chmod 600, then connect with ssh -i key.pem user@host.

Can I protect the private key with a passphrase?

Not in the browser. Encrypt it afterwards with ssh-keygen -p -f key.pem or openssl pkey -in key.pem -aes256 -out key.enc.pem.