Lihat halaman ini dalam Bahasa IndonesiaVer esta página en españolVer esta página em portuguêsDiese Seite auf Deutsch ansehen

RSA & SSH Key Pair Generator

Create a public and private key pair in a few seconds: RSA, ECDSA or Ed25519, ready as PEM for your code, as OpenSSH keys for servers and Git hosting, or as JWK for JWKS endpoints. The keys are made by your browser's Web Crypto and never leave your device.

Runs 100% in your browser: keys and data are never uploaded
Loading the tool…

How to use this tool

  1. Pick a key type. Ed25519 is short and fast for SSH; RSA 2048 or larger works everywhere; ECDSA P-256 is common for JWT (ES256).
  2. Optionally type a comment such as you@laptop. It is added to the end of the OpenSSH lines.
  3. Press "Generate key pair".
  4. Choose the format you need (PEM, PKCS#1, OpenSSH or JWK), then copy or download the private and public key.

What this tool can do

RSA, ECDSA and Ed25519

RSA with 2048, 3072 or 4096 bits and exponent 65537, ECDSA on the P-256 and P-384 curves, and Ed25519 where the browser supports it.

PEM, PKCS#1 and JWK

Private keys as PKCS#8 ("BEGIN PRIVATE KEY") and public keys as SPKI ("BEGIN PUBLIC KEY"), the formats OpenSSL, Node.js, Java, Go and Python read. RSA keys are also given as PKCS#1, and every key as JWK.

SSH keys

The OpenSSH public line for authorized_keys, GitHub and GitLab, the matching "BEGIN OPENSSH PRIVATE KEY" file for ~/.ssh, and the SHA256 fingerprint that ssh-keygen -l shows.

Made on your device

Generation uses the Web Crypto API with the operating system random generator. Keys are not uploaded, logged or stored: once you leave the page they are gone.

Tips and common problems

Which key type should I choose?

For SSH, Ed25519. For JWT signing, RS256 needs RSA 2048 or more and ES256 needs ECDSA P-256. If a service does not say, RSA 2048 is accepted almost everywhere.

SSH says the permissions are too open

Save the private key as ~/.ssh/id_ed25519 (or id_rsa, id_ecdsa) and run chmod 600 on it. On Windows, keep it in your user folder, where other accounts cannot read it.

A library wants "BEGIN RSA PRIVATE KEY"

That is PKCS#1. Generate an RSA key and choose the PKCS#1 format, which holds the same key in the older wrapper.

The key goes into an environment variable

Use "Copy as one line" for a version with \n escapes, or the PEM to One Line tool for other one-line styles.

Frequently asked questions

Is it safe to generate a private key in a browser?

The key is created by the Web Crypto API on your own device, with the same random generator the operating system uses, and it is never sent anywhere. For keys that guard production systems you can still prefer generating them on the machine that uses them.

How do I use the key for SSH?

Choose OpenSSH, save the private key as ~/.ssh/id_ed25519 with chmod 600, and add the public line to ~/.ssh/authorized_keys on the server or to your GitHub or GitLab SSH keys.

What is the difference between PKCS#8 and PKCS#1?

Both hold the same RSA key. PKCS#8 ("BEGIN PRIVATE KEY") works for every key type and is the modern default; PKCS#1 ("BEGIN RSA PRIVATE KEY") is the older RSA-only format.

Can I use these keys for JWT?

Yes. Sign with the private PEM and publish the public PEM or the public JWK. Use RSA for RS256 or PS256, ECDSA P-256 for ES256 and Ed25519 for EdDSA.

Is the private key encrypted with a passphrase?

No, the keys are given unencrypted. To add a passphrase to an SSH key, run ssh-keygen -p -f ~/.ssh/id_ed25519 after saving it.