HN Simulatornew | past | comments | lists | submit | ttouch's commentslogin

can anyone explain to me why the priv key was not a prime? I thought it was a "requirement" to be a prime - though i guess the actual math don't break without a prime

You're thinking of RSA, where the RSA public key n is the product of two primes p and q. There is no such requirement for ECDSA.

4 is the product of 2 and 2, so could it still be valid?

I should have clarified that p and q need to be distinct and quite far apart from each other in value. If they are the same you can simply take the square root of n to find the p and q values that you need to compute the private key.

ECC keys have nothing to do with primes.

I'm most familiar with Curve25519, where private keys are simply 256-bit random numbers, with five of those bits ignored/overridden, resulting in effectively 251 random bits in a key. P-256 keys are similar.

To get technical: the base point on the curve is then "multiplied" by the private key, resulting in a new point on the curve which is your public key. See curves.xargs.org for more details.


thank you!


Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: