ssh-keygen in the browser
Find a file
Patrick Roumanoff 69c2226d8e typo
2018-02-13 17:43:03 +01:00
test ES6 2018-02-13 17:41:00 +01:00
.editorconfig eslint + prettier 2018-02-13 09:45:06 +01:00
.eslintrc.json ES6 2018-02-13 17:41:00 +01:00
.gitignore https 2018-02-13 10:54:21 +01:00
.prettierrc eslint + prettier 2018-02-13 09:45:06 +01:00
base64url.js ES6 2018-02-13 17:41:00 +01:00
CNAME https 2018-02-13 10:54:21 +01:00
index.html typo 2018-02-13 17:43:03 +01:00
js-keygen-ui.js eslint + prettier 2018-02-13 09:45:06 +01:00
js-keygen.css Prettier all the things 2018-02-13 09:30:29 +01:00
js-keygen.js typo 2018-02-13 17:43:03 +01:00
key.png css and favico 2015-09-04 10:48:05 +10:00
package.json surge 2018-02-13 10:49:58 +01:00
README.md eslint + prettier 2018-02-13 09:45:06 +01:00
ssh-util.js ES6 2018-02-13 17:41:00 +01:00

Generate a ssh keypair using the webcrypto API

See the live demo at https://js-keygen.surge.sh

For some explanation see http://blog.roumanoff.com/2015/09/using-webcrypto-api-to-generate-keypair.html

There is no way to generate a ssh keypair on a chromebook, but we have access to chrome and the webcrypto API. I had to do all sorts of gymnastics to convert the generated keypair to something that can be consummed by SSH.

  • I had to learn about the WebCrypto API - which was the initial goal
  • I had to learn about JWK
  • I had to leanr about base64url encoding (thanks JWK) and how to convert it to and form base64 encoding
  • I had to learn about ASN.1 to encode the private key for OpenSSH
  • I had to lean about the open SSH public format to encode the public key for OpenSSH

The end result is a usable single page app that will locally generate a keypair you can save to local drive. Allowing you to do that straight from chrome on a chrome book.

Everywhere else, you should have access to ssh-keygen which is the recommended way to generate keypair for SSH.