This post is part of COSIC’s Guide to Crypto, in which researchers from COSIC are informally writing about different concepts in cryptography. Our aim is to introduce the reader to these concepts with explanations, illustrations and examples. Today’s topic: factoring using algebraic groups!
In an earlier post we discussed the factor-base method, which is our most powerful tool when it comes to cracking an RSA modulus \( N = pq \). Recall that the goal was to produce an element \( a \in \mathbf{Z}_N \) with significant odds of having exactly one zero component when viewed under the Chinese remainder theorem
\( \mathbf{Z}_N \cong \mathbf{F}_p \times \mathbf{F}_q. \)
This allows to recover \( p \) or \( q \) as \( \gcd(a,N) \), which is easily computed using Euclid’s algorithm. The factor-base method achieves this goal in sub-exponential time.
In view of the notorious difficulty of integer factorization, it is remarkable that there exists a second, totally different method that breaks through the exponential-time barrier. This method uses algebraic groups and, while asymptotically slower than the factor-base method, stands out in terms of elegance. The key ingredient is the following consequence to Lagrange’s theorem: if \( G \) denotes a finite group with neutral element \( e \), then for all \( g \in G \) and all multiples \( M \) of \( \#G \) we have that \( g^M = e \).
Pollard’s method
The basic idea was discovered by Pollard in 1974. By restricting to invertible elements, the Chinese remainder theorem implies that
\( \mathbf{Z}_N^\times \cong \mathbf{F}_p^\times \times \mathbf{F}_q^\times \)
on the level of unit groups. Imagine that we manage to find an integer \( M\) that is a multiple of \( \# \mathbf{F}_p^\times = p-1\) but not of \( \# \mathbf{F}_q^\times = q-1\). Then by taking a random \( b \in \mathbf{Z}_N^\times\) and raising it to the power \( M\), we are implicitly computing
\( (b^M \bmod p, b^M \bmod q).\)
This is where Lagrange kicks in: by our choice of \( M\), the left component equals the neutral element \( 1\), while the right component most likely does not. Thus \( a := b^M – 1\) has good odds of being divisible by \( p\) and not by \( q\), allowing us to compute \( p\) as \( \gcd(a, N)\).
How do we find such an \( M \)? The honest answer is: in general, we do not know. But in the unlikely event that \( p-1 \) is powersmooth, meaning that all prime powers dividing \( p-1 \) are bounded by some small \( B \), it is an easy exercise to show that \( p-1 \mid B! \). So in that case, if we assume that \( q-1 \) is not powersmooth, we can take \( M = B! \).
Let us illustrate this method by factoring the RSA modulus \( N = 181451 \) using \( B = 7 \). We simply try \( b = 2 \) and calculate that
\( b^{B!} = 2^{7!} \equiv 178084 \bmod N \)
through a repeated modular exponentiation. We then let \( a := b^{B!} – 1 = 178083 \) and compute \( \gcd(a, N) \) to reveal \( p = 421 \); the other factor is \( q = N/p = 431 \). The reason why this works, in retrospect, is that \( p-1 = 2^2 \cdot 3 \cdot 5 \cdot 7 \) is powersmooth while \( q-1 = 2 \cdot 5 \cdot 43 \) is not.
Algebraic groups
Informally spoken, an algebraic group over a ring \( R \) is a group whose elements can be viewed as tuples with entries in \( R \), such that the composition law can be described in terms of the basic ring operations. The most elementary examples are the additive group of \( R \) and the unit group \( R^\times \). More fancy examples include algebraic tori and various kinds of matrix groups. On each of these, one can unleash Pollard’s idea.
E.g., for invertible \( 2 \times 2 \) matrices the Chinese remainder theorem tells us that
\( \text{GL}_2(\mathbf{Z}_N) \cong \text{GL}_2(\mathbf{F}_p) \times \text{GL}_2(\mathbf{F}_q), \)
allowing for a break of RSA moduli for which \( \# \text{GL}_2(\mathbf{F}_p) = (p^2 – 1)(p^2 – p) \) is powersmooth and \( \# \text{GL}_2(\mathbf{F}_q) = (q^2 – 1)(q^2 – q) \) is not. But the former event is impossible (because of the factor \( p \))!
The situation is better for algebraic tori, leading to successful attacks when \( p + 1 \) is powersmooth, when \( p^2 + p + 1 \) is powersmooth, when \( p^3 + p^2 + p + 1 \) is powersmooth, and so on. But all these events remain very unlikely.
Lenstra’s elliptic curve method
Pollard’s method is a one-time shot: it works well if \( p -1, p + 1, p^2 + p + 1, \ldots \) happens to be powersmooth, but with an overwhelming probability this is not the case, and then the method is futile.
This was remedied by Lenstra in 1985, who proposed the use of another kind of algebraic groups: elliptic curves, not listed above for the sake of avoiding spoilers. Here we are looking at the set of solutions \( (x,y) \in \mathbf{Z}_N^2 \) to an equation of the form
\( E : y^2 = x^3 + \alpha x + \beta \)
where \( \alpha, \beta \in \mathbf{Z}_N \) satisfy \( \gcd(4\alpha^3 + 27\beta^2, N) = 1 \). We can work with this as if we were working over a field. In particular, the group operations again amount to tangent-chord arithmetic:

This leads, for example, to the familiar formula
\( (x,y) \mapsto (\lambda^2 – 2x, \lambda(3x – \lambda^2) – y), \qquad \lambda = \frac{3x^2 + \alpha}{2y} \)
for point doubling. As in the field case, if \( y = 0 \) then our point is mapped to infinity.
But here’s a subtlety: even if \( y \) is non-zero then it might not admit an inverse modulo \( N \), in which case the doubling formula fails. E.g., \( y \) might be divisible by \( p \) but not by \( q \). Where does doubling take us in this case? This is best understood using the Chinese remainder theorem: our equation implicitly defines an elliptic curve over \( \mathbf{F}_p \) and an elliptic curve over \( \mathbf{F}_q \). We can write this as
\( E(\mathbf{Z}_N) \cong E(\mathbf{F}_p) \times E(\mathbf{F}_q). \)
We see that this phenomenon occurs precisely when we are hitting the point at infinity on \( E(\mathbf{F}_p) \) but not on \( E(\mathbf{F}_q) \). But that’s exactly what Pollard’s method tries to achieve!
So, in more detail, here is how to proceed: take a random elliptic curve \( E \) over \( \mathbf{Z}_N \) along with a random point \( P \) on it; in practice, this is done by first taking random \( \alpha \in \mathbf{Z}_N \) and \( P=(x,y) \in \mathbf{Z}_N^2 \), and then simply letting \( \beta = y^2 – x^3 – \alpha x \). One then tries to compute
\( B! \cdot P \)
using a repeated scalar multiplication. If \( \# E(\mathbf{F}_p) \) is powersmooth and \( \# E(\mathbf{F}_q) \) is not, then it is likely that along the way we will run into a non-zero denominator \( a \) which is not invertible. This allows us to recover \( p \) as \( \gcd(a,N) \).
What is the chance of success? It is fair to think of \( \#E(\mathbf{F}_p) \) as a random integer in the Hasse interval
\( [p+1-2\sqrt{p}, p+1+2\sqrt{p}]. \)
Just like \( p-1, p+1, \ldots \), it is very unlikely that such an integer is powersmooth, in which case the method will fail to factor \( N \). But the main difference is that it’s no longer a one-time shot! Indeed, in the event of a failure, we can try our luck with a new elliptic curve over \( \mathbf{Z}_N \), again and again, until \( \#E(\mathbf{F}_p) \) is powersmooth and \( \#E(\mathbf{F}_q) \) is not, or vice versa.
This brings us to the role of \( B \): the larger we take it, the higher the probability that a random integer in the Hasse interval is powersmooth, but the longer it takes to compute \( B! \cdot P \). As it turns out, the optimal value lies in the subexponential range, leading to a factorization algorithm which heuristically takes time \( L_N(\frac{1}{2}; 1) \). This is the same complexity as that of the quadratic sieve. It’s worse than that of the number field sieve.
Other algebraic groups?
What about other algebraic groups? They exist: the options are classified by Chevalley’s structure theorem. One natural class of new candidates are jacobians of curves of genus \( g \geq 2 \). Unfortunately, in this case the Hasse interval needs to be replaced by an interval centered around \( p^g + 1 \), negatively affecting the probability of powersmoothness. Although this can be mitigated to some extent, none of the alternatives have managed to overthrow elliptic curves.
A concluding remark
By focusing on RSA moduli, we have swept a very important selling point under the rug: the running time of the algebraic-group methods depends on the size of the smallest prime factor \( p \) of \( N \), rather than the size of \( N \) itself. Ignoring some polynomial factors, the time complexity of Lenstra’s elliptic curve method can actually be estimated as \( L_p(\frac{1}{2}; \sqrt{2}) \), rather than the aforementioned \( L_N(\frac{1}{2}; 1) \). This is a major advantage over the factor-base method. For finding large prime factors of astronomical numbers, such as Fermat numbers, the elliptic curve method has proven to be more useful than the number field sieve.


