If I run openssl ec
on a key that I have generated with openssl ecparam -genkey
I get one extra prefixing 0x00 in the private key, and one 0x04 in the public key. While I understand the 0x04 which means uncompressed format, I don't understand the 0x00 in the private one. If I use the openssl asn1parse
that 0x00 gets discarded correctly when showing the 32 bytes of the key.
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:
04: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: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
ASN1 OID: prime256v1