This document describes a term project to implement the Pollard-rho algorithm for factoring large integers. The project involves factoring integers of increasing size using Pollard-rho and analyzing the runtime. It provides background on integer factoring algorithms, describes how Pollard-rho works based on the birthday paradox and Floyd's cycle-finding algorithm, outlines the implementation in C++ using GMP, and presents results factoring several large integers along with the number of Pollard-rho iterations required.
This document describes a term project to implement the Pollard-rho algorithm for factoring large integers. The project involves factoring integers of increasing size using Pollard-rho and analyzing the runtime. It provides background on integer factoring algorithms, describes how Pollard-rho works based on the birthday paradox and Floyd's cycle-finding algorithm, outlines the implementation in C++ using GMP, and presents results factoring several large integers along with the number of Pollard-rho iterations required.
This document describes a term project to implement the Pollard-rho algorithm for factoring large integers. The project involves factoring integers of increasing size using Pollard-rho and analyzing the runtime. It provides background on integer factoring algorithms, describes how Pollard-rho works based on the birthday paradox and Floyd's cycle-finding algorithm, outlines the implementation in C++ using GMP, and presents results factoring several large integers along with the number of Pollard-rho iterations required.
Problem Definition ● Given an integer with two prime factors, find the prime factors – The integer can be arbitrarily large Motivation ● Learn how an NP problem with no known polynomial time algorithm can be practically solved ● Learn how to deal with arbitrarily large numbers in computer programming Requirements ● Part I: To implement Pollard-rho algorithm for factoring small integers ● Part II: To implement Pollard-rho algorithm for arbitrarily factoring large integers ● Discuss algorithm iterations for factoring some large integers ● Input/Output: – Input: Number to be factorized – Output: Two prime factors Factoring Algorithms ● No polynomial time algorithm exists ● Algorithms can broadly classified into – Special purpose ● Running time depends on smaller prime factor – General purpose ● Running time depends on size of the integer ● General Number Field Sieve (GNFS) has sub- exponential time complexity Pollard-rho Algorithm ● Basically a heuristic – Neither running time, nor success guaranteed ● Effective for huge integers with at least one small prime factor Pollard-rho Algorithm ● Concepts Employed – Birthday paradox: In a group of people, probability of two people having same birthday is unexpectedly high – Floyd’s cycle algorithm: A hare and tortoise moving in circle with hare twice as fast as tortoise, will eventually meet up Pollard-rho Algorithm Pollard-rho(N) Randomly select x = 2 to N-1 Set y = x Randomly select c = 1 to N-1 while(d == 1) a = (x2+c) mod N // Tortoise move b= (y2+c) mod N b=(b2+c)mod N // Hare move d=GCD(|b-a|, N) x=a y=b factor1=d factor2=N/d print factor1, factor2 Euclidean Algorithm for GCD GCD(a, b) if(b==0) return a GCD(b,a%b) Implementation ● Implementation in C++ – GNU g++ compiler – Ubuntu OS ● GNU GMP big number library Time and Space Complexity ● Time complexity – For a given N, upto N1/4 iterations – In terms of input length, O(2n/4) – In terms of smaller factor, O(sqrt(smaller factor)) ● Space complexity – O(1), fixed amount of memory required Results ● Inputs Ser Integer Factor 1 Factor 2