Giter Club home page Giter Club logo

js-keygen's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.