logo

Proof of the Pollard p-1 Factoring Algorithm 📂Number Theory

Proof of the Pollard p-1 Factoring Algorithm

Algorithm 1

Given a semiprime NN, if pp is a smooth prime, then the factorization N=pqN = pq of NN can be found as follows:


Step 1.

a:=2a := 2 and L:=1L := 1 are set.


Step 2.

d:=gcd(aL1,N)d := \gcd ( a^{L} - 1 , N ) is calculated.


Step 3.

If 1<d<N1< d < N, then d=pd = p, a divisor of NN, is found and we are done. Otherwise, it is updated as L:=(L+1)!L := (L+1)!. If LL becomes too large, revert to L:=1L := 1 and update it as a:=a+1a : = a+ 1. Then return to Step 2.

Explanation

The Pollard p1p-1 factorization algorithm exploits the weakness of smooth primes similar to the Pollig-Hellman algorithm. A single prime number becoming a weakness makes the prime factorization problem easily solvable. Because of this attack method, cryptographic systems that rely on the difficulty of the prime factorization problem cannot use smooth primes as their secret keys.

Principally, it is not necessary to start with a=2a=2 as in Step 1 or to use L=n!L = n! as in Step 2. It’s simply used because, if pp is smooth, then there is a high probability of successfully calculating d:=gcd(aL1,N)d := \gcd ( a^{L} - 1 , N ).

Proof

(p1)L(q1)L (p-1) \mid L \\ (q-1) \nmid L Assuming pp is smooth, it is easy to satisfy the condition for L=n!L = n!. This means for some i,jZi,j \in \mathbb{Z} and kNk \in \mathbb{N}, the following holds. L=i(p1)L=j(q1)+k \begin{align*} L =& i ( p -1 ) \\ L =& j ( q -1 ) + k \end{align*}

Fermat’s Little Theorem: For a prime pp and an integer aa coprime to pp, ap11(modp)a^{p-1} \equiv 1 \pmod{p}

In (modp)\pmod{p}, aLa(p1)i1i1(modp) \begin{align*} a^{L} & \equiv a^{( p - 1 ) i } \\ & \equiv 1^{i} \\ & \equiv 1 \pmod{p} \end{align*} In (modq)\pmod{q}, aLa(q1)j+k1jakak(modq) \begin{align*} a^{L} & \equiv a^{( q - 1 ) j + k } \\ & \equiv 1^{j} a^{k} \\ & \equiv a^{k} \pmod{q} \end{align*} Here, since k0k \ne 0, there is a high probability that ak1(modq)a^{k} \ne 1 \pmod{q}. This means paL1 p \mid a^{L} -1

qaL1 q \nmid a^{L} -1 This implies that pp is a divisor of aL1a^{L} -1, and since pp is also a divisor of NN, calculating the greatest common divisor of the two numbers results in p=gcd(aL1,N) p = \gcd \left( a^{L} - 1 , N \right)

See Also

Security Algorithms Utilizing the Difficulty of Prime Factorization Problem

Attack Algorithms on the Prime Factorization Problem


  1. Hoffstein. (2008). An Introduction to Mathematical Cryptography: p133~135. ↩︎