Suppose is a number we wish to factor. Choose a random elliptic curve mod 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 and a coefficient Then choose so that lies on the curve This is much more efficient than choosing and and then trying to find a point.
For example, let Take and Since we want we take Therefore, our curve is
We calculated in a previous example. Note that during the calculation, we needed to find This required that and used the extended Euclidean algorithm, which was essentially a gcd calculation.
Now let’s calculate The line through the points and has slope 702/1770. When we try to invert 1770 mod 2773, we find that 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
Here’s what happened. Using the Chinese remainder theorem, we can regard as a pair of elliptic curves, one mod 59 and the other mod 47. It turns out that while Therefore, when we tried to compute 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 you cannot separate and 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 reached faster mod 59 than mod 47. Since in general the primes and should act fairly independently of each other, one would expect that for most curves and points the multiples of would reach mod and mod at different times. This will cause the gcd to find either or
Usually, it takes several more steps than 3 or 4 to reach mod or mod In practice, one multiplies 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 is either mod or mod This is very much the analog of the method of factoring. However, recall that the method (see Section 9.4) usually doesn’t work when has a large prime factor. The same type of problem could occur in the elliptic curve method just outlined when the number such that 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 This curve will be independent of the previous curve and the value of such that should have essentially no relation to the previous After several tries (or if several curves are treated in parallel), a good curve is often found, and the number is factored. In contrast, if the method fails, there is nothing that can be changed other than using a different factorization method.
We want to factor Choose
Suppose we try to compute There are many ways to do this. One is to compute If we do this, everything is fine through but requires inverting Since we can factor as
Let’s examine this more closely. A computation shows that has points and has points. Moreover, 640 is the smallest positive such that on and 777 is the smallest positive such that on Since is a multiple of 640, it is easy to see that on as we calculated. Since is not a multiple of it follows that on Recall that we obtain when we divide by 0, so calculating asked us to divide by 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 for some prime The smallest positive such that on this curve divides the number of points on (if you know group theory, you’ll recognize this as a corollary of Lagrange’s theorem), so Quite often, will be or a large divisor of In any case, if is a product of small primes, then will be a multiple of for a reasonably small value of Therefore,
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 then it is called B-smooth. This concept played a role in the method and the factoring method (Section 9.4), and the index calculus attack on discrete logarithms (Section 10.2).
Recall from Hasse’s theorem that is an integer near 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 then there is a reasonable chance that the number is smooth. This means that the elliptic curve factorization method should find for this choice of the curve. If we try several curves where then it is likely that at least one of the curves or will have its number of points being smooth.
In summary, the advantage of the elliptic curve factorization method over the method is the following. The method requires that is smooth. The elliptic curve method requires only that there are enough smooth numbers near so that at least one of some randomly chosen integers near is smooth. This means that elliptic curve factorization succeeds much more often than the 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).
In practice, the case where the cubic polynomial has multiple roots rarely arises. But what happens if it does? Does the factorization algorithm still work? The discriminant is zero if and only if there is a multiple root (this is the cubic analog of the fact that has a double root if and only if ). Since we are working mod the result says that there is a multiple root mod if and only if the discriminant is 0 mod Since is composite, there is also the intermediate case where the gcd of and the discriminant is neither 1 nor But this gives a nontrivial factor of so we can stop immediately in this case.
Let’s look at an example:
Given a point on this curve, we associate the number
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 Where does this come from? The two lines tangent to the curve at are and This number is simply the ratio of these two expressions.
Since we need to work mod we give an example mod 143. We choose 143 since 3 is a square mod 143; in fact, 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 on Look at its multiples:
When trying to compute 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 Therefore, the number corresponding to is We can compute the numbers for all the points above:
Let’s compare with the powers of 80 mod 143:
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 but not mod 13. This corresponds to the fact that 5 times the point 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 is essentially the same as using the classical 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
To a point on this curve, associate the number Let’s start with the point and compute its multiples:
Note that the corresponding numbers are Adding the points on the curve corresponds to adding the numbers
If we are using the curve to factor we need to change the points to integers mod which requires finding inverses for and mod This is done by the extended Euclidean algorithm, which is essentially a gcd computation. We find a factor of when Therefore, this method is essentially the same as computing in succession 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 of is usually computed. This is equivalent to factoring by computing a method that is often used to test for prime factors up to
In summary, we see that the method and trial division are included in the elliptic curve factorization algorithm if we allow singular curves.