I have implemented a ECC key generation scheme successfully. Now I need to find ECC key sizes of each generating key pairs. I assumed that ECC key size is the size of the ECC private Key.

So I would like to to know whether this is correct?

  • 4
    $\begingroup$ When talking about the size in ECC we generally refer to the field size. $\endgroup$ Jun 2, 2014 at 7:58
  • $\begingroup$ Then key size of keys generated using secp160r1 elliptic curve is 160 bits? $\endgroup$ Jun 2, 2014 at 9:08
  • 1
    $\begingroup$ Yes, it would be 160 bits. Note that a 160 bit elliptic curve can be broken with approximately $2^{80}$ operations. $\endgroup$
    – poncho
    Jun 2, 2014 at 14:37
  • $\begingroup$ If you use the private key value $S$ itself (which you shouldn't), then you should definitively not treat it as an integer. There is nothing to prevent the private key to start with 00 or 0000 to my knowledge. So using integer(S).bitlength() or similar may give you the wrong result. $\endgroup$
    – Maarten Bodewes
    Jun 2, 2014 at 17:47

2 Answers 2


The size we speak of with regard to elliptic curves is the size of the field over which the elliptic curve is defined. This is not necessarily exactly the size of the private key.

For example: Curve25519 is a 255-bit elliptic curve and has, effectively, 252-bit private keys, though they are usually encoded as 256-bit values with four fixed bits. Public keys are 256-bit values, but only contain 255 bits of information since the last bit is always 0.

  • 2
    $\begingroup$ Nit: Curve25519 has effectively 252 bit private keys; each encoded 256 bit value with 4 bits fixed will map to a distinct member of the 252 bit subgroup that they actually use. $\endgroup$
    – poncho
    Jul 23, 2016 at 13:48

ECC public keys are (X,Y) points where X and Y are elements in a given field (e.g. Fp or F2m).

For example, secp160r1 uses a 160-bit prime field. X and Y can be up to 160 bits long. So (X,Y) is 320 bits.

The (X,Y) point can be represented in compressed form where only the X value and a bit of information is given, since Y is a function of X.

X.962 encoding can be used for these 3 cases. Note that X and Y are zero-padded to the prime modulus size in the case they are smaller:


0x04 | X | Y

Compressed (Y is even):

0x02 | X

Compressed (Y is odd):

0x03 | X

  • 1
    $\begingroup$ Hi new user and welcome. Unfortunately this is in my opinion not what was asked. I guess the question is: "Given a key, what parameter(s) should I use to retrieve the key size?" $\endgroup$
    – Maarten Bodewes
    Jun 2, 2014 at 17:38
  • 1
    $\begingroup$ Whatever you say. $\endgroup$
    – user13741
    Jun 2, 2014 at 19:31
  • 5
    $\begingroup$ No need for that kind of comment, please re-read the question and ask yourself if your answer matches. $\endgroup$
    – Maarten Bodewes
    Jun 2, 2014 at 19:42

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.