I have this ECDSA private key that isn't very important, but I do not have it in any other format.


I also need it in public form with a size of 0x3C. I don't know how to start with this. Of course, OpenSSL chokes on it, but that's because it isn't in ASN.1 format, and again I don't know where to start with that.

  • 1
    $\begingroup$ Is this just the private key number? I hope this is not a real-life entry but rather a dummy for the sake of illustration? About which curve are we talking here? $\endgroup$
    – SEJPM
    Commented Aug 5, 2017 at 13:28
  • $\begingroup$ It's a 28 byte / 224 bit value in hexadecimals, the size requested is 60 bytes, which would mean 4 bytes overhead for, for instance, two ASN.1 encoded integers but without the SEQUENCE. It is however unclear from the question if that would be the acceptable format. Both NIST and Brainpool have 224 bit (prime) curves, of course and there are others. $\endgroup$
    – Maarten Bodewes
    Commented Aug 5, 2017 at 13:37

1 Answer 1


Without knowing which domain parameters were used this question is impossible to answer. The problem is that the value of the private key is random within the domain.

So although we know that the key size is about 224 bits, there is no way to validate any public key value, because the public key is calculated using the random private key as input in the first place. To be precise, it is the multiplication of the private key with base point $G$ of the curve. This means that we generate a valid public key whichever curve / set of domain parameters we use.

Another issue is the required key size. Normally a public key is identified using a compressed or uncompressed key point. An uncompressed point would add 1 byte for an identifier. However, this in turn is usually put into an ASN.1 BIT STRING, which adds 3 bytes if we assume DER encoding.

So in that case we would for instance get:


for P-224 and


for brainpoolP224r1, however with no method to distinguish between either two, and there may be more candidates.

Verifying any previously generated signature should of course enable you to select the correct value.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.