Re: Converting SSH2-RSA key to RSA numbers

From: Unruh (unruh-spam_at_physics.ubc.ca)
Date: 04/02/05


Date: 2 Apr 2005 17:16:40 GMT


"Dro Kulix" <peter.s.may@gmail.com> writes:

>I am working on a lightweight program that will use a simplistic
>version of RSA for short encrypted transmissions. Of course it's a
>dangerous thing to do when I'm not a crypto expert, but for the moment
>that's beside the point. What I have in hand is a basic RSA
>implementation that's already been written, which encrypts using an
>encryption exponent E and a modulus M, and decrypts using a decryption
>exponent D and the same modulus M. I assume, then, than E and M make
>up the private key, D and M make up the public key.

Uh, no, unless you want to be the only one who can encrypt and anyone in
the world can decrypt your messages. Usually people want anyone to be able
to encrypt and only you decrypt.

>Anyway, while I do have the encryption/decryption code, I don't have a
>key generator to go with it. I decided that this wasn't going to be a
>problem because there are plenty of good programs that will generate an
>(unencrypted) OpenSSH SSH2 RSA key, and that I'd only have to find out
>how to decode that format.

>I've downloaded PuTTY's source to see if I could figure it out from
>that. Turns out it's not trivial, so before I actually attempt to do
>all the code chasing necessary to figure it out, I wanted to know if
>anyone already knew enough about the key file format to save me some
>trouble. Specifically, I'm looking to write a routine that converts
>the key in an OpenSSH SSH2 RSA private key file into the aforementioned
>E, D, and M.

Look at teh source code for ssh-keygen. It will have all of the details.
That is the key generation program from openssh.



Relevant Pages

  • Re: rsa encryption with stonybrook modula
    ... > can't wait to get a solution - thank you for the insides and your ... RSA cannot know what the destination ... Encrypt that. ... When you decrypt take the last byte and if the buffer bytes are not the ...
    (comp.lang.modula2)
  • Re: Asp.net 2.0 deployment with encryption
    ... I guesss I will create a rsa key on the production server. ... Export the public xml/key to a common location on some server. ... As for the ASP.NET 2.0 configuration section protection, ... encryption which use a single shared session key to encrypt and decrypte ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: What is exponent?
    ... For simple description of RSA algorithm ... I also have the receiver's certificate (public key only). ... Use RSA to encrypt the session key ...
    (microsoft.public.dotnet.security)
  • Re: Decrypt RSA using D
    ... We are planning on using RSA with WSE, so it only uses RSA to encrypt the symmetric key used for the SOAP body--the same scenario you outlined below. ... owner of the private key can decrypt it. ... always embedded inside the CSP key container and never passed out into the ...
    (microsoft.public.dotnet.framework)
  • Re: RSA - Public vs. Private Keys
    ... machine, and have it decrypted on another machine (say, the target ... My idea was to take a message, encrypt it using RSA, and dumping the ... Public Key and Decrypt with a Private key. ...
    (microsoft.public.dotnet.security)