Re: Converting private key from OpenSSH to lsh (or the other way around)

[email protected] (Niels Möller) Sun, 03 Jun 2007 22:27:03 +0200
Newsgroups gmane.network.lsh.bugs
Message-ID <[email protected]>
Kaloian Doganov <[email protected]> writes:

> Indeed, I've managed to convert OpenSSH RSA key pair to GNU lsh by the
> following steps:
>
>   1. Decrypt OpenSSH key:
>
>      $ openssl rsa -inform PEM -outform DER -in ~/.ssh/id_rsa \
>                -out /tmp/id_rsa.nopass
>
>   2. Convert OpenSSH key to GNU lsh:
>
>      $ cat /tmp/id_rsa.nopass | pkcs1-conv --private-rsa-key | \
>            sexp-conv -s advanced | sed -e "s/rsa/rsa-pkcs1/" | \
>            sexp-conv -s canonical | lsh-writekey

Nice. BTW, pkcs1-conv is intended to work also with PEM-formatted input, if
you had any problem with that, I'd like to hear. You still need to use
openssl for decrypting the key, though.

> I've done it using GNU lsh version lsh-2.9-exp, secsh protocol version
> 2.0.

You're brave, trying to play around with the experimental release ;-)

I use the client parts of the latest version daily. The server is less
tested.

Happy hacking,
/Niels