Reputation: 49
I have the following Elliptic Curve:
y^2 = x^3 + 9x + 17 mod 23 (a = 9, b = 17, p = 23) with a base point G = (16,5)
With this information and using the private key PA = 10, how can I calculate the private key nA? I know the equation is PA = nA * G, but I am not sure how to actually perform the calculation.
Upvotes: 1
Views: 1533
Reputation: 5636
Based on your title, you can use SageMath to find it.
Assuming that the private key is 10, yes it is an integer between 1 and the order of the curve E.order()
.
The public key is then calculated as [10]G
. Here [10]
means add the G
itself 10 times G+G+G+G+G+G+G+G+G+G
. Note that this is not an ordinary addition of tuples. It is an elliptic curve point addition based on the tangent and chord rule.
E = EllipticCurve(GF(23),[9,17])
print(E)
print(E.order())
G = E(16,5)
print(10*G)
prints
Elliptic Curve defined by y^2 = x^3 + 9*x + 17 over Finite Field of size 23
32
(3 : 18 : 1)
Try online at SageMathCell and learn SageMath if you going to study cryptography. SageMath uses Python3 syntax, therefore easy to learn. And, here SageMath reference for Elliptic curves over finite fields and the tutorial of SageMath.
Upvotes: 3