Skip to content

wadenick/js-keygen

This branch is 1 commit ahead of, 2 commits behind PatrickRoumanoff/js-keygen:master.

Folders and files

NameName
Last commit message
Last commit date
Feb 13, 2018
Feb 13, 2018
Feb 13, 2018
Apr 25, 2019
Feb 13, 2018
Feb 21, 2018
Apr 25, 2019
Feb 16, 2018
Feb 13, 2018
Feb 16, 2018
Apr 25, 2019
Feb 13, 2018
Feb 13, 2018
Feb 13, 2018
Sep 4, 2015
Feb 13, 2018
Feb 21, 2018
Feb 16, 2018
Feb 13, 2018

Repository files navigation

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.

How to convert from OpenSSH public key format to PEM

see https://js-keygen.surge.sh/convert.html for how to convert.

About

ssh-keygen in the browser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 88.3%
  • HTML 7.7%
  • CSS 4.0%