Factorization: Lenstra Elliptic-Curve Factorization

17 Dec 2021


§ Motivation

We can use some properties of groups formed over elliptic curves to use in a factorization problem.

§ Lenstra's Factorization

The asymptotic complexity of Lenstra's method is O(e2logploglogp)\mathcal{O}\left(e^{\sqrt{2\log p \log\log p}}\right). If n=pqn = pq where p,qp, q prime, and pqp \ll q Lenstra's becomes faster than the quadratic sieve.

Lenstra's Elliptic Curve Factorization Algorithm

Suppose we know that nn is a composite number.

  1. Choose a random A,a,b(modn)A, a, b \pmod{n}
  2. Set P = (a,b)(a, b) and Bnb2a3AaB \equiv_n b^2 - a^3 - A\cdot a, let E:y2=x3+Ax+BE: y^2 = x^3 + Ax + B.
  3. Let j=2j=2, compute QnjPQ \equiv_n jP and set P=QP = Q
    • If this step fails, then there is a non-invertible element modulo nn. Let dd be the GCD between nn and this non-invertible element, if 1<d<n1 \lt d \lt n, then dd is a non-trivial divisor of nn. Stop and return dd.
    • If d=nd = n, restart algorithm with different random parameters.
    • Otherwise, increment jj and repeat.

Lenstra Factorization

Suppose we want to factor n=6887n = 6887 with P=(1512,3166)P = (1512, 3166) and A=14A = 14 and B19B \equiv 19.

Then, our elliptic curve is E:y2=x3+14x+19E : y^2 = x^3 + 14x + 19. We can repeat step 33 from j=2j = 2 to j=6j = 6, thusly computing 6!P6!\cdot P without issue. However, on j=7j = 7 we encounter a non-invertible element

7Q=(Q+2Q)+4Q=(984,589)+(203,2038)(mod6887).7Q = (Q + 2Q) + 4Q = (984, 589) + (203, 2038) \pmod{6887}.

To compute this point addition, we must compute the multiplicative inverse of (203984)(203 - 984) modulo 68876887, which does not exist. Therefore, d=gcd(781,6887)=71d = \gcd(-781, 6887) = 71 is a non-trivial factor of 68876887.