When Mathematical Beauty Protects Your On-line Security and Identity: Point Addition In ECC

--

Much of our on-line privacy is created by Elliptic Curve Cryptography. It is there when we need to negotiate in creating with secret key for HTTPs (with ECDH) and it is there when we want to sign for something (with ECDSA). At the core of what it does is the equation:

We then define a finite field bounded by a prime number p, so that our operations are done with (mod p). Within ECC, we typically have a base point (P), and then add this multiple time (n) to give nP. The value of nP is our public key, and the value of n is our private key.

For ECC, we calculate using x³+ax+b (mod p). For point addition of P (x,y) for the same point (2P). For this we have:

2P=(x_2,y_2)

Let s=(3x²+a)/(2y)

Then:

x_2=s_2−2x

y_2=s(xx_2)−y

And that’s it. So let’s create some Python code to achieve this (I have highlighted the bits that relate to the equations above) [here]:

import sysa=0
b=7
p=37
x=6if (len(sys.argv)>1):
x=int(sys.argv[1])
if (len(sys.argv)>2):
p=int(sys.argv[2])
if (len(sys.argv)>3)…

--

--

Prof Bill Buchanan OBE FRSE
ASecuritySite: When Bob Met Alice

Professor of Cryptography. Serial innovator. Believer in fairness, justice & freedom. Based in Edinburgh. Old World Breaker. New World Creator. Building trust.