Public key storage format in OpenSSH - SSH

This is a discussion on Public key storage format in OpenSSH - SSH ; OpenSSH stores public keys in totally different formats, depending on whether version 1.5 or version 2 of the protocol is being used. Can anybody explain the difference? For 1.5 the format is obvious; for 2, it is not....

+ Reply to Thread
Results 1 to 3 of 3

Thread: Public key storage format in OpenSSH

  1. Public key storage format in OpenSSH

    OpenSSH stores public keys in totally different formats, depending on
    whether version 1.5 or version 2 of the protocol is being used. Can
    anybody explain the difference? For 1.5 the format is obvious; for 2, it
    is not.



  2. Re: Public key storage format in OpenSSH

    >>>>> "JSS" == James S Singleton writes:

    JSS> OpenSSH stores public keys in totally different formats,
    JSS> depending on whether version 1.5 or version 2 of the protocol is
    JSS> being used. Can anybody explain the difference?

    The first format was defined by the first implementation of SSH-1 by Tatu
    Ylönen in 1995. A new format was needed for SSH-2, as SSH-1 only allowed
    RSA keys whereas SSH-2 can have any number of key types, and OpenSSH
    implements two: RSA and DSA.

    JSS> For 1.5 the format is obvious; for 2, it is not.

    some datatype definitions:

    length = 4 bytes, 32-bit integer (big-endian)

    string = [length L] [L bytes: the string]

    bignum = string N (binary, length <= 8192)
    where N = BIGNUM type as defined in the OpenSSL crypto library (openssl/bn.h)
    (multiprecision [large] integer)

    An OpenSSH public key line consists of:

    key-type [base64 encoded string] comment

    This is the format of base64-decoded bytes:

    [string: key type in ASCII ("ssh-rsa"|"ssh-dsa"|"rsa"|"dsa")]
    (yes, the key type is repeated inside the encoded portion)
    (case RSA key)
    bignum: public exponent (e)
    bignum: modulus (n)
    (case DSA key)
    bignum: p
    bignum: q
    bignum: g
    bignum: y
    ( DSA key parameters as defined e.g. here:
    http://en.wikipedia.org/wiki/Digital...ture_Algorithm)

    --
    Richard Silverman
    res@qoxp.net


  3. Re: Public key storage format in OpenSSH

    On Fri, 24 Feb 2006 23:16:51 -0500, Richard E. Silverman wrote:

    >>>>>> "JSS" == James S Singleton writes:

    >
    > JSS> OpenSSH stores public keys in totally different formats, JSS>
    > depending on whether version 1.5 or version 2 of the protocol is JSS>
    > being used. Can anybody explain the difference?
    >
    > The first format was defined by the first implementation of SSH-1 by Tatu
    > Ylönen in 1995. A new format was needed for SSH-2, as SSH-1 only allowed
    > RSA keys whereas SSH-2 can have any number of key types, and OpenSSH
    > implements two: RSA and DSA.
    >
    > JSS> For 1.5 the format is obvious; for 2, it is not.
    >
    > some datatype definitions:
    >
    > length = 4 bytes, 32-bit integer (big-endian)
    >
    > string = [length L] [L bytes: the string]
    >
    > bignum = string N (binary, length <= 8192)
    > where N = BIGNUM type as defined in the OpenSSL crypto library
    > (openssl/bn.h) (multiprecision [large] integer)
    >
    > An OpenSSH public key line consists of:
    >
    > key-type [base64 encoded string] comment
    >
    > This is the format of base64-decoded bytes:
    >
    > [string: key type in ASCII ("ssh-rsa"|"ssh-dsa"|"rsa"|"dsa")]
    > (yes, the key type is repeated inside the encoded portion)
    > (case RSA key)
    > bignum: public exponent (e)
    > bignum: modulus (n)
    > (case DSA key)
    > bignum: p
    > bignum: q
    > bignum: g
    > bignum: y
    > ( DSA key parameters as defined e.g. here:
    > http://en.wikipedia.org/wiki/Digital...ture_Algorithm)


    OK, thanks so much.



+ Reply to Thread