fjordtools / Security / Key Generator
Key Generator
Generate an Ed25519, ECDSA or RSA key pair in your browser: OpenSSH, PEM and JWK files with fingerprints. Keys never leave this tab and are not stored.
Keys are made in this tab with your browser's WebCrypto. Nothing is sent or saved, and the page makes no requests after it loads (check it yourself). Fine for development, tests and throwaway servers. Make a production key on the machine that will use it.
The comment is written into both files so you can tell keys apart. It is not secret.
ssh-keygen -t ed25519
About Key Generator
How do I generate an SSH key and use it?
Pick Ed25519, add a comment such as you@laptop and press Generate. Download id_ed25519 and id_ed25519.pub. The private file stays on your machine. The one-line public key goes on every server or service you want to log in to. Ed25519 keys are short, fast and the default choice today.
Put the files in ~/.ssh, lock the private one down (ssh refuses a key that other users can read), copy the public line to the server and test the login:
mkdir -p ~/.ssh && chmod 700 ~/.ssh mv ~/Downloads/id_ed25519* ~/.ssh/ chmod 600 ~/.ssh/id_ed25519 ssh-copy-id -i ~/.ssh/id_ed25519.pub user@host ssh -i ~/.ssh/id_ed25519 user@host
Without ssh-copy-id, paste the line from the Public key box at the end of ~/.ssh/authorized_keys on the server. GitHub and GitLab take the same line under SSH keys in your settings. To check a key you already have, use the Key Inspector.
How do I generate an RSA or ECDSA key pair as PEM?
Choose RSA (3072 bits is a good default, and the one ssh-keygen uses) or ECDSA, press Generate and open the PEM tab. The private key is PKCS#8 (BEGIN PRIVATE KEY) and the public key is SPKI (BEGIN PUBLIC KEY), the formats OpenSSL 3, Node and most libraries read. PKCS#1 and SEC1 are there for older software.
The OpenSSL equivalent gives the same two files:
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:3072 -out private.pem openssl pkey -in private.pem -pubout -out public.pem
The SSH tab holds the OpenSSH private file, which Node's createPrivateKey cannot read (error:1E08010C:DECODER routines::unsupported); use the PEM tab for code. The JWK tab gives both keys as JSON for a JWKS, and the JWT decoder shows which kid a token expects.
Is a key made in the browser safe, and how do I add a passphrase?
The key is made by your browser's WebCrypto, stays in this tab and is gone when you close it. Nothing is sent or stored, and the note at the top of the page links to a way to check that yourself. Use it for development, tests, throwaway servers and learning. A production or long-lived key should be generated on the machine that will use it: ssh-keygen -t ed25519.
This page does not set a passphrase. Add one on your own machine, to the OpenSSH file or to the PEM file:
ssh-keygen -p -f ~/.ssh/id_ed25519 openssl pkcs8 -topk8 -v2 aes-256-cbc -in private.pem -out private-encrypted.pem
Each command asks for the new passphrase twice. Need a fresh secret instead of a key? Use the password generator.
Related tools
- Key InspectorRead a PEM, JWK or SSH key, see its fingerprints, convert it and check a key pair.
- Certificate DecoderDecode an X.509 certificate, a chain or a CSR: names, SANs, expiry, public key and fingerprints.
- Password GeneratorRandom passwords, hex and base64url secrets, with entropy shown.
- UUID & ULIDGenerate UUID v4, v7 and ULID, and read the time inside any ID.
- Hash & HMACMD5, SHA-1, SHA-256, SHA-384, SHA-512 and HMAC for text and files.
- JWT DecoderRead the header, payload and expiry of a JSON Web Token.