SSH Key Generator

Get a public key line for GitHub or authorized_keys and a private key file in OpenSSH’s own format. The keys are made on this device by your browser’s own WebCrypto and never leave it.

How it works

Your browser’s WebCrypto makes the key pair: Ed25519 by default, or RSA with a 4096-bit modulus. This page then writes the two halves in the formats OpenSSH uses. The public key becomes one line of text. The private key becomes an "openssh-key-v1" file, the same layout ssh-keygen writes.

Our tests feed the files this page makes to the real ssh-keygen. It reads the private key, derives the public key from it, and gets exactly the line shown here. The fingerprint is worked out the same way ssh-keygen -l does it, so you can compare the two.

Nothing is sent to a server and nothing is stored. The private key is written without a passphrase, because OpenSSH encrypts keys with bcrypt_pbkdf, which WebCrypto does not have. Add a passphrase with ssh-keygen once the file is saved.

How to use it

  1. 1 Pick a Key type: Ed25519 (recommended) or RSA 4096.
  2. 2 Type a Comment, such as you@laptop. It is a label to help you tell keys apart.
  3. 3 Download the private key as id_ed25519 (or id_rsa) and the public key as id_ed25519.pub, into ~/.ssh.
  4. 4 Run chmod 600 ~/.ssh/id_ed25519, or ssh will refuse to use the file.
  5. 5 Add a passphrase with ssh-keygen -p -f ~/.ssh/id_ed25519.
  6. 6 Paste the Public key line into GitHub under Settings, SSH and GPG keys, or into a server’s ~/.ssh/authorized_keys.

Good to know

  • Ed25519 keys are short, fast and supported by every OpenSSH from 6.5 (2014) on. Use RSA only for old servers that refuse Ed25519.
  • The private key has no passphrase until you add one. Anyone who copies the file can log in as you.
  • Check a key with ssh-keygen -lf ~/.ssh/id_ed25519.pub. The fingerprint should match the one shown here.
  • The comment is not secret and is not part of the key. Changing it later does not change the fingerprint.
  • Ed25519 in WebCrypto needs Chrome or Edge 137, Firefox 129 or Safari 17. Older browsers can still make RSA keys here.

Browser support

  • Chrome 94 and later · full speed from 137
  • Firefox 93 and later · full speed from 129
  • Safari 16.4 and later · full speed from 17
  • Edge 94 and later · full speed from 137

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Reading an SSH public key byte by byte

An SSH public key looks like noise, but it is a tiny, regular structure, and reading one by hand takes a minute. Here is one made by ssh-keygen for a throwaway account: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBHDITbwfL74HWVxdOb3me/I4ZgTEoiw+0Qw4DE9VuUa jane@laptop. It has three parts separated by spaces: the key type, the key in Base64, and a comment. The comment is only a label. The middle part is the key.

Decode that Base64 and you get exactly 51 bytes. SSH writes every field as a 4-byte length followed by the bytes. The first four bytes are 00 00 00 0b, which is 11, and the next 11 bytes spell "ssh-ed25519". The type is stored inside the key as well as in front of it, so the key cannot be mistaken for another kind. Then come 00 00 00 20, which is 32, and the 32 bytes of the Ed25519 public key. That is 4 + 11 + 4 + 32 = 51.

This is why every Ed25519 public key begins AAAAC3NzaC1lZDI1NTE5. Base64 spells 3 bytes as 4 characters, and the first 15 bytes, the length and the type name, are the same in every Ed25519 key, so their 20 characters are the same too. RSA keys start AAAAB3NzaC1yc2E for the same reason, with "ssh-rsa" inside. If a key you were sent starts differently, it was damaged in copying, or it is not the kind of key it claims to be.

The fingerprint is the SHA-256 hash of those 51 bytes, written in Base64 with the trailing = removed, and prefixed with "SHA256:". For this key it is SHA256:/RG/jjKDyBkLgg3e/3jtsK+/FroIezRUGDiaKATz0gM, the same value ssh-keygen -l printed for it. Because the hash covers only the 51 bytes, the comment is not part of it. You can rename jane@laptop to anything and the fingerprint stays put. This is the value GitHub shows next to each key in your settings, so it is the quickest way to check which key is which.

The private key file is the same idea, longer. After a fixed "openssh-key-v1" header it records the cipher ("none" here), the public key again, then a private section that starts with two copies of a random check number, then the key type, the public key, 64 bytes of private key (the 32-byte seed followed by the 32-byte public key), the comment, and padding bytes 1, 2, 3 up to a multiple of 8. When a passphrase is set, that private section is what gets encrypted, and the matching check numbers are how ssh knows the passphrase was right.

That last point is the one limit of this page. Encrypting the private section needs bcrypt_pbkdf, which browsers do not offer, so the file is written unencrypted. Save it, run chmod 600, then ssh-keygen -p -f with the file name to add a passphrase. Nothing on this page is stored or sent, so once you close the tab the only copy of the private key is the one you saved.

Frequently asked questions

Is it safe to make an SSH key in a browser?

The key material comes from WebCrypto, which uses the operating system’s random number generator, the same source ssh-keygen uses. This page sends nothing anywhere and works offline once loaded. Still, if ssh-keygen is already on your computer, running ssh-keygen -t ed25519 there is just as good.

Why is there no passphrase option?

OpenSSH encrypts private keys with bcrypt_pbkdf and AES, and browsers do not provide bcrypt_pbkdf. Rather than ship a home-made version, the page writes the key unencrypted and you add the passphrase with ssh-keygen -p, which does it properly.

Ed25519 or RSA?

Ed25519, unless a server is too old to accept it. It gives about the same security as 3072-bit RSA with a key and signature a fraction of the size, and it is GitHub’s recommendation.

ssh says "UNPROTECTED PRIVATE KEY FILE". What do I do?

The file is readable by other users. Run chmod 600 on it. ssh refuses keys that others can read, on purpose.

Can I use this key for Git commit signing?

Yes. Git 2.34 and later can sign commits with an SSH key: set gpg.format to ssh and user.signingkey to the .pub file, then add the same public key on GitHub as a signing key.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.