TritonDataCenter / node-sshpk

Parse, convert, fingerprint and use SSH keys in pure node.js
MIT License
189 stars 49 forks source link

Add support for PuTTY PPK format #27

Open fidian opened 7 years ago

fidian commented 7 years ago

It would be wonderful to be able to use PuTTY's PPK format. I have a UI where users can generate SSH keys and paste them into a text area for upload to the server. The server only allows for openssh style keys, so PuTTY users are cranky about needing to do conversion.

I've generated three keys, all encrypted with the password "asdf". According to the documentation I've found, the public portion is always unencrypted. The private portion may be encrypted and the hash at the end is a hash of both the public and private portions.

I've generated these with puttygen, available as the Ubuntu package. I can generate more keys if that helps. The format seems very straightforward, with either a "Key-name: value" or "key-name-lines: count" style format.

putty-dsa.ppk.txt putty-dsa-as-private-openssh.txt putty-dsa-as-public-openssh.txt putty-rsa.ppk.txt putty-rsa1.ppk.txt

arekinath commented 7 years ago

Note to myself, seems like the best documentation of this format is in the code: https://github.com/KasperDeng/putty/blob/master/putty-src/sshpubk.c#L382

goloroden commented 6 years ago

Are there any plans for this?