• [^] # Re: Deux petites questions :)

    Posté par (site web personnel) . En réponse à la dépêche Votre blogue à la maison sur Raspberry Pi. Évalué à 8.

    $ openssl ec -in 001 -pubout -text
    read EC key
    Private-Key: (256 bit)
    priv:
     00:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:
     xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:
     xx:xx:xx
    pub: 
     yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:
     yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:
     yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:
     yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:
     yy:yy:yy:yy:yy
    ASN1 OID: prime256v1
    writing EC key
    -----BEGIN PUBLIC KEY-----
    (snip)
    -----END PUBLIC KEY-----
    $ grep -v -- "---" 001|base64 -d|hexdump -C
    00000000 30 77 02 01 01 04 20 xx xx xx xx xx xx xx xx xx
    00000010 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx
    00000020 xx xx xx xx xx xx xx a0 0a 06 08 2a 86 48 ce 3d
    00000030 03 01 07 a1 44 03 42 00 yy yy yy yy yy yy yy yy
    00000040 yy yy yy yy yy yy yy yy yy yy yy yy yy yy yy yy
    00000050 yy yy yy yy yy yy yy yy yy yy yy yy yy yy yy yy
    00000060 yy yy yy yy yy yy yy yy yy yy yy yy yy yy yy yy
    00000070 yy yy yy yy yy yy yy yy yy

    Bref les parties fixes indiquent des infos comme la taille et le type de la clé.

    cf http://blog.oddbit.com/2011/05/08/converting-openssh-public-keys/ et http://www.openssh.com/specs.html