I am working in an environment with strict bandwidth requirements, and we need predictable bit lengths of the stuff we send. We need to broadcast ECDSA public keys, and we are using OpenSSL to generate them.

So will the prublic key lengths vary from private key to private key? Or will they be constant?

I noticed there are many output formats, like DER, and one with base4 encoded public key wrapped in headers. I would like the shortest possible public key, possibly in bit format, with predictable length. What is the best way?

  • $\begingroup$ You get the shortest length if you encode the curve as OID in the public key and if you use DER (which should be binary). The length should be roughly constant although there's a chance that it is one or two bytes shorter. $\endgroup$
    – SEJPM
    Jan 12 '16 at 11:22
  • $\begingroup$ Thanks for responding. I need predictability down to bit level, so unless I add a length descriptor to what I would send (again costing bandwidth) I cannot deal with variations in 1-2 bytes. But since there is a mathematical relationship here dictating what a public key is, I do not understand why this variation needs to occur (except minimization when bits are not needed). If encoding is the problem I would prefer removing this encoding, could I extract the raw components of the public key, as I can extract S and R from the signature through C programming? $\endgroup$
    – BenM
    Jan 12 '16 at 12:23

Browse other questions tagged or ask your own question.