21.3 Factoring with Elliptic Curves

Suppose n=pq is a number we wish to factor. Choose a random elliptic curve mod n and a point on the curve. In practice, one chooses several (around 14 for numbers around 50 digits; more for larger integers) curves with points and runs the algorithm in parallel.

How do we choose the curve? First, choose a point P and a coefficient b. Then choose c so that P lies on the curve y2=x3+bx+c. This is much more efficient than choosing b and c and then trying to find a point.

For example, let n=2773. Take P=(1, 3) and b=4. Since we want 3213+41+c,  we take c=4. Therefore, our curve is

E:y2x3+4x+4(mod2773).

We calculated 2P=(1771, 705) in a previous example. Note that during the calculation, we needed to find 61(mod2773). This required that gcd(6, 2773)=1 and used the extended Euclidean algorithm, which was essentially a gcd calculation.

Now let’s calculate 3P=2P+P. The line through the points 2P=(1771, 705) and P=(1, 3) has slope 702/1770. When we try to invert 1770 mod 2773, we find that gcd(1770, 2773)=59,  so we cannot do this. So what do we do? Our original goal was to factor 2773, so we don’t need to do anything more. We have found the factor 59, which yields the factorization 2773=5947.

Here’s what happened. Using the Chinese remainder theorem, we can regard E as a pair of elliptic curves, one mod 59 and the other mod 47. It turns out that 3P=(mod59),  while 4P=(mod47). Therefore, when we tried to compute 3P,  we had a slope that was infinite mod 59 but finite mod 47. In other words, we had a denominator that was 0 mod 59 but nonzero mod 47. Taking the gcd allowed us to isolate the factor 59.

The same type of idea is the basis for many factoring algorithms. If n=pq,  you cannot separate p and q as long as they behave identically. But if you can find something that makes them behave slightly differently, then they can be separated. In the example, the multiples of P reached faster mod 59 than mod 47. Since in general the primes p and q should act fairly independently of each other, one would expect that for most curves E(modpq) and points P,  the multiples of P would reach mod p and mod q at different times. This will cause the gcd to find either p or q.

Usually, it takes several more steps than 3 or 4 to reach mod p or mod q. In practice, one multiplies P by a large number with many small prime factors, for example, 10000!. This can be done via successive doubling (the additive analog of successive squaring; see Exercise 21). The hope is that this multiple of P is either mod p or mod q. This is very much the analog of the p1 method of factoring. However, recall that the p1 method (see Section 9.4) usually doesn’t work when p1 has a large prime factor. The same type of problem could occur in the elliptic curve method just outlined when the number m such that mP equals has a large prime factor. If this happens (so the method fails to produce a factor after a while), we simply change to a new curve E. This curve will be independent of the previous curve and the value of m such that mP= should have essentially no relation to the previous m. After several tries (or if several curves are treated in parallel), a good curve is often found, and the number n=pq is factored. In contrast, if the p1 method fails, there is nothing that can be changed other than using a different factorization method.

Example

We want to factor n=455839. Choose

E:y2x3+5x5, P=(1, 1).

Suppose we try to compute 10!P. There are many ways to do this. One is to compute 2!P, 3!P=3(2!P), 4!P=4(3!P), . If we do this, everything is fine through 7!P,  but 8!P requires inverting 599(modn). Since gcd(599, n)=599,  we can factor n as 599×761.

Let’s examine this more closely. A computation shows that E(mod599) has 640=27×5 points and E(mod761) has 777=3×7×37 points. Moreover, 640 is the smallest positive m such that mP= on E(mod599),  and 777 is the smallest positive m such that mP= on E(mod761). Since 8! is a multiple of 640, it is easy to see that 8!P= on E(mod599),  as we calculated. Since 8! is not a multiple of 777,  it follows that 8!P on E(mod761). Recall that we obtain when we divide by 0, so calculating 8!P asked us to divide by 0(mod599). This is why we found the factor 599.

For more examples, see Examples 45 and 46 in the Computer Appendices.

In general, consider an elliptic curve E(modp) for some prime p. The smallest positive m such that mP= on this curve divides the number N of points on E(modp) (if you know group theory, you’ll recognize this as a corollary of Lagrange’s theorem), so NP=. Quite often, m will be N or a large divisor of N. In any case, if N is a product of small primes, then B! will be a multiple of N for a reasonably small value of B. Therefore, B!P=.

A number that has only small prime factors is called smooth. More precisely, if all the prime factors of an integer are less than or equal to B,  then it is called B-smooth. This concept played a role in the x2y2 method and the p1 factoring method (Section 9.4), and the index calculus attack on discrete logarithms (Section 10.2).

Recall from Hasse’s theorem that N is an integer near p. It is possible to show that the density of smooth integers is large enough (we’ll leave small and large undefined here) that if we choose a random elliptic curve E(modp),  then there is a reasonable chance that the number N is smooth. This means that the elliptic curve factorization method should find p for this choice of the curve. If we try several curves E(modn),  where n=pq,  then it is likely that at least one of the curves E(modp) or E(modq) will have its number of points being smooth.

In summary, the advantage of the elliptic curve factorization method over the p1 method is the following. The p1 method requires that p1 is smooth. The elliptic curve method requires only that there are enough smooth numbers near p so that at least one of some randomly chosen integers near p is smooth. This means that elliptic curve factorization succeeds much more often than the p1 method.

The elliptic curve method seems to be best suited for factoring numbers of medium size, say around 40 or 50 digits. These numbers are no longer used for the security of factoring-based systems such as RSA, but it is sometimes useful in other situations to have a fast factorization method for such numbers. Also, the elliptic curve method is effective when a large number has a small prime factor, say of 10 or 20 decimal digits. For large numbers where the prime factors are large, the quadratic sieve and number field sieve are superior (see Section 9.4).

21.3.1 Singular Curves

In practice, the case where the cubic polynomial x3+bx+c has multiple roots rarely arises. But what happens if it does? Does the factorization algorithm still work? The discriminant 4b3+27c2 is zero if and only if there is a multiple root (this is the cubic analog of the fact that ax2+bx+c has a double root if and only if b24ac=0). Since we are working mod n=pq,  the result says that there is a multiple root mod n if and only if the discriminant is 0 mod n. Since n is composite, there is also the intermediate case where the gcd of n and the discriminant is neither 1 nor n. But this gives a nontrivial factor of n,  so we can stop immediately in this case.

Example

Let’s look at an example:

y2=x33x+2=(x1)2(x+2).

Given a point P=(x, y) on this curve, we associate the number

(y+3(x1))/(y3(x1)).

It can be shown that adding the points on the curve corresponds to multiplying the corresponding numbers. The formulas still work, as long as we don’t use the point (1, 0). Where does this come from? The two lines tangent to the curve at (1, 0) are y+3(x1)=0 and y3(x1)=0. This number is simply the ratio of these two expressions.

Since we need to work mod n,  we give an example mod 143. We choose 143 since 3 is a square mod 143; in fact, 8223(mod143). If this were not the case, things would become more technical with this curve. We could easily rectify the situation by choosing a new curve.

Consider the point P=(1, 2) on y2=x33x+2(mod143). Look at its multiples:

P=(1, 2), 2P=(2, 141), 3P=(112, 101), 4P=(10, 20).

When trying to compute 5P,  we find the factor 11 of 143.

Recall that we are assigning numbers to each point on the curve, other than (1,1). Since we are working mod 143, we use 82 in place of 3. Therefore, the number corresponding to (1, 2) is (2+82(11))/(282(11))=80(mod143). We can compute the numbers for all the points above:

P80, 2P108, 3P60, 4P81.

Let’s compare with the powers of 80 mod 143:

80180, 802108, 80360, 80481, 80545.

We get the same numbers. This is simply the fact mentioned previously that the addition of points on the curve corresponds to multiplication of the corresponding numbers. Moreover, note that 451(mod11),  but not mod 13. This corresponds to the fact that 5 times the point (1, 2) is mod 11 but not mod 13. Note that 1 is the multiplicative identity for multiplication mod 11, while is the additive identity for addition on the curve.

It is easy to see from the preceding that factorization using the curve y2=x33x+2 is essentially the same as using the classical p1 factorization method (see Section 9.4).

In the preceding example, the cubic equation had a double root. An even worse possibility is the cubic having a triple root. Consider the curve

y2=x3.

To a point (x, y)(0, 0) on this curve, associate the number x/y. Let’s start with the point P=(1, 1) and compute its multiples:

P=(1, 1), 2P=(14, 18), 3P=(19, 127), , mP=(1m2, 1m3).

Note that the corresponding numbers x/y are 1, 2, 3, , m. Adding the points on the curve corresponds to adding the numbers x/y.

If we are using the curve y2=x3 to factor n,  we need to change the points mP to integers mod n,  which requires finding inverses for m2 and m3 mod n. This is done by the extended Euclidean algorithm, which is essentially a gcd computation. We find a factor of n when gcd(m, n)1. Therefore, this method is essentially the same as computing in succession gcd(2, n), gcd(3, n), gcd(4, n),  until a factor is found. This is a slow version of trial division, the oldest factorization technique known. Of course, in the elliptic curve factorization algorithm, a large multiple (B!)P of P is usually computed. This is equivalent to factoring by computing gcd(B!, n),  a method that is often used to test for prime factors up to B.

In summary, we see that the p1 method and trial division are included in the elliptic curve factorization algorithm if we allow singular curves.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset