The identity \(\infty\) is a point at infinity (think “up”), so the inverse of \(P = (x,y)\) is \(-P = (x,-y)\).
Geometric definition: To add two points \(P_1\) and \(P_2\):
Consequently, there is a more elegant way to state the addition law.
Elliptic Curve Addition Law. If \(X, Y, Z\) are the three points on the intersection of an elliptic curve with a secant line, then \(X + Y + Z = \infty\).
If \(P\) is any point on an elliptic curve, then \(P + \infty = P = \infty + P\). Let \(P_1 = (x_1,y_1)\) and \(P_2 = (x_2,y_2)\) be points on the elliptic curve \(y^2 = x^3 + bx +c\).
If \(P_1 = P_2\) and \(y_1 = 0\), or if \(P_1 \neq P_2\) and \(x_1 = x_2\), then \(P_1+P_2 = \infty\).
Otherwise, \(P_1 + P_2 = P_3 = (x_3,y_3)\), where \[ \begin{aligned} x_3 &= m^2 -x_1 -x_2 \\ y_3 &= m(x_1-x_3)-y_1 \end{aligned} \] and \[ m = \left\{\begin{array}{cl} (y_2-y_1)/(x_2-x_1) & \mbox{if } P_1 \neq P_2 \\ (3x_1^2+b)/(2y_1) & \mbox{if } P_1 = P_2 \end{array} \right. \] where all computations are performed in \(\mathbb{R}\).
If \(P\) is any point on an elliptic curve, then \(P + \infty = P = \infty + P\). Let \(P_1 = (x_1,y_1)\) and \(P_2 = (x_2,y_2)\) be points on the elliptic curve \(y^2 = x^3 + bx +c\).
If \(P_1 = P_2\) and \(y_1 = 0\), or if \(P_1 \neq P_2\) and \(x_1 = x_2\), then \(P_1+P_2 = \infty\).
Otherwise, \(P_1 + P_2 = P_3 = (x_3,y_3)\), where \[ \begin{aligned} x_3 &= m^2 -x_1 -x_2 \\ y_3 &= m(x_1-x_3)-y_1 \end{aligned} \] and \[ m = \left\{\begin{array}{cl} (y_2-y_1)(x_2-x_1)^{-1} & \mbox{if } P_1 \neq P_2 \\ (3x_1^2+b)(2y_1)^{-1} & \mbox{if } P_1 = P_2 \end{array} \right. \] where all computations are performed in \(\mathbb{Z}_p\).
Problem: To use elliptic curve groups for cryptography, we have to be able to represent messages as points on the curves.
One Idea: Make the message the \(x\)-component of a point on an elliptic curve.
Problem with this idea: It will work about half the time.
Better Idea: Add some digits to the end of your message. Tweak them so you can find a point on the curve.
Alice wants to send the message \(m = 9230923203240394234\) using a cryptosystem based on the elliptic curve \(y^2 = x^3 + 7x + 9\) modulo \(p = 34588345934850984359911\).
Alice wants to send the message \(m = 9230923203240394234\) using a cryptosystem based on the elliptic curve \(y^2 = x^3 + 7x + 9\) modulo \(p = 34588345934850984359911\).
m <- as.bigz("9230923203240394234")
p <- as.bigz("34588345934850984359911")
powm(m^3 + 7*m+ 9, (p-1)/2, p)
Big Integer ('bigz') :
[1] 34588345934850984359910
So \(m^3+7m+9\) is not a perfect square. So there can’t be a point \((m,y)\) on this curve.
Encode \(m\) as a point on this curve by adding a digit. That is, find a point of the form \((10m+k, y)\) on this curve, for some value of \(k\) between 0 and 9.
Big Integer ('bigz') object of length 10:
[1] 34588345934850984359910 34588345934850984359910 34588345934850984359910 1
[5] 1 34588345934850984359910 1 34588345934850984359910
[9] 34588345934850984359910 34588345934850984359910
It looks like \(k = 4\) will work.
Instead of using \(m = 9230923203240394234\), we use \(10m + 4 = 92309232032403942344\). By the theorem on square roots, the corresponding \(y\) is \(\pm[(10m+4)^3+7(10m+4)+9]^{(p+1)/4}\).
Big Integer ('bigz') :
[1] 25242717473860864844684
Big Integer ('bigz') :
[1] 25242717473860864844684
Question: What goes wrong if \(p = 2\)?
\[ m = \left\{\begin{array}{cl} (y_2-y_1)(x_2-x_1)^{-1} & \mbox{if } P_1 \neq P_2 \\ (3x_1^2+b)(2y_1)^{-1} & \mbox{if } P_1 = P_2 \end{array} \right. \]
Let \(p(x)\) be a degree \(n\) irreducible polynomial in \(\mathbb{Z}_2[x]\).
An elliptic curve \(E\) over \(\mbox{GF}(2^n)\) satisfies \(y^2 + xy = x^3 + ax^2 + b\), where \(a,b \in \mbox{GF}(2^n)\).
Look at your ssh keys.
Given \(\alpha^e\) in \(U(p)\), finding \(e\) is difficult.
Given \(n\alpha\) in an elliptic curve mod \(p\) group \(E\), finding \(n\) is difficult.
To solve \(\alpha^x = \beta\) in \(U(p)\): Choose large \(N > \sqrt{p-1}\)
If a match is found in these two lists, \(x=j+Nk\) is a solution.
To solve \(\alpha^x = \beta\) in \(U(p)\): Choose large \(N > \sqrt{p-1}\)
If a match is found in these two lists, \(x=j+Nk\) is a solution.
Use the Baby Step Giant Step algorithm to solve \(2^x = 37\) in \(U(53)\).
[1] NA 8 NA NA NA NA NA NA NA 2
[1] 4 17
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
l1 2 4 8 16 32 11 22 44 35 17
l2 24 17 1 25 42 43 15 4 47 9
Big Integer ('bigz') :
[1] 37
Big Integer ('bigz') :
[1] 37
To solve \(n\alpha = \beta\) in \(E\): Choose large \(N\).
If a match is found in these two lists, \(x=j+Nk\) is a solution.
Alice and Bob wish to create a shared secret \(K\) (e.g., to make an AES key) using unencrypted communication.
Decryption: In \(U(p)\), Bob uses the secret \(a\) to compute \[ tr^{-a} = \beta^km(\alpha^k)^{-a} = (\alpha^a)^km\alpha^{-ak} = m \]
Decryption: In \(E\), Bob decrypts using the secret \(a\) by computing \(t-ar\).
To verify the signature, Bob does the following:
Suppose \(m\) is a hashed message we want to sign. Find an elliptic curve and basepoint \(G\) of order \(n\) (prime), so \(nG = \infty\). Alice chooses a secret integer \(d_A\) and makes \(Q_A=d_AG\) public. To sign:
To verify, Bob computes \(u_1 = ms^{-1}\) and \(u_2 = rs^{-1}\) in \(U(n)\). Signature is valid is \(u_1G + u_2Q_A = kG\) on the elliptic curve.
See FIPS PUB 186-4, e.g., pages 34, 92ff.