Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Advances in Computational Research ISSN: 0975-3273 & E-ISSN: 0975-9085, Volume 7, Issue 1, 2015, pp.-250-252 Available online at http://www.bioinfopublication.org/jouarchive.php?opt=&jouid=BPJ0000187 STUDY OF INTEGER FACTORIZATION ALGORITHMS JAYBHAY N.* AND JADHAV P. MCA Department, Marathwada Institute of Technology, Aurangabad- 431 028, MS, India. *Corresponding Author: Email- [email protected] Received: December 18, 2014; Revised: January 05, 2015; Accepted: January 15, 2015 Abstract- Integer factorization means to obtain factors of large numbers by using some methods. In cryptography the algorithms like PollardRho, Pollard’s P-1, quadratic sieve etc are used to find the factors of large integers. The ability of these different algorithm varies according to the input given to it. This paper gives introduction to Integer Factorization, methodologies used for factorization, implementation of Quadratic sieve algorithm in c++ and comparisons between efficiency of algorithms according to their computing time. Keywords- Pollard’s Rho, Pollard’s P-1, Quadratic sieve Citation: Jaybhay N. and Jadhav P. (2015) Study of Integer Factorization Algorithms. Advances in Computational Research, ISSN: 0975-3273 & E-ISSN: 0975-9085, Volume 7, Issue 1, pp.-250-252. Copyright: Copyright©2015 Jaybhay N. and Jadhav P. This is an open-access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution and reproduction in any medium, provided the original author and source are credited. Introduction Integer factorization requires great computational powers compared to primality testing which does not require the same computations, and the history of primality testing starts earlier and in 1876 Lucas was able to verify the primality of a 39 digit number in comparison it was not until 1970 and by using computers that Morrison and Brill hart were able to factor a 39 digit composite integer [5,7-10]. Mathematicians have been attempting to find better and faster ways to factor composite numbers since the beginning of time. Initially this involved dividing a number by larger and larger primes until you had the factorization. Algorithms for integer factorization can be split into two groups, the special and the general algorithms. The special algorithms are those targeted at a special class of numbers, for example if the number has one or more small factors. The general algorithms are those not targeted at a special class of numbers, i.e. it takes the same time to split a 100 bit number into a 1 and a 99 bit factor as it takes to split it into two 50 bit factors.All algorithms described depends on that the number n to be factored is a composite, so it should be tested for primality before attempting to factor it [5,7-10]. Methodologies used for Factorization Basically there are two type of techniques which are used for Integer Factorization, one is Special purpose and other is General purpose.In this paper we are focusing on both the tech. Special-purpose A special-purpose factoring algorithm's running time depends on the properties of the number to be factored or on one of its unknown factors: size, special form, etc. That is the numbers on which these algorithms performs operations are of some special class. So that the running time depends on varies between algorithms. Given an integer of unknown form, these methods are usually applied before general-purpose methods to remove small factors [4,8-11].. Following are some special algorithms used for integer factorization. Trial Division Trial division is a fast method for small composites, and as its name indicates it trial divides possible factors to see if the remainder is zero. It does not fail for hard composites, it just takes a long time. Trial division is useless for composites with only large factors, but for smaller composites it is definitely a usable algorithm and it is a good exercise to implement it .The time complexity of trial division is O( sqrt(n)), where n is the number to be factored. For example, the product 24 has several factors. 24 = 1 x 24 24 = 2 x 12 24 = 3 x 8 24 = 4 x 6 So, the factors are 1, 2, 3, 4, 6, 8, 12, 24. Pollard’s P-1 Pollard’s P-1 factoring algorithm is a special purpose factoring algorithm, that can be use to efficiently find any prime factor P of a composite integer n for which (p-1) is a B-smooth [5,6,8-10]. B-smooth: Let B be a positive integer then an integer n is said to be B-smooth with respect to a bound if all its prime factors are less than equal to B. e.g. if n=153 then, n=3^2*17 then 153 is said to be B-smooth to 17. Advances in Computational Research ISSN: 0975-3273 & E-ISSN: 0975-9085, Volume 7, Issue 1, 2015 || Bioinfo Publications || 250 Study of Integer Factorization Algorithms Algorithm Input: A composite integer n. Output: Non-trivial factor d of n. Step 1: Select a smoothness bound B. Step 2: Select a random integer a, 2<=a<=n-1, compute gcd (a,n) If d>=2 then return (d). Step 3: For each prime q<=B do the following: 3.1 Compute l=|ln(n)/ln(q)| 3.2 Compute a=a^q^l (mod n) Step 4: Compute d=gcd (a-1,n) Step 5: If d=1 or d=n, then terminate the algorithm with failure. e.g.: n=221 , a=2 , B=3. Q ln(q) l=[ln(n)/ln(q)] a=a^q^l (mod n) d=gcd(a-1,n) 2 0.6931 7 30 1 3 1.0986 4 118 13 Factor 1 is 13. Factor 2 is 221/13=17. Pollard’s Rho Pollard’s Rho algorithm is a special purpose factoring algorithm for finding small factors of composite integer. It is useful to find nontrivial factors of n[6][11]. Algorithm Input: A composite integer n that is not prime power. Output: A non-trivial factor d of n. Step 1: set a=2,b=2. Step 2: for i=1,2,3,… do the following 2.1 Compute a=a^2+1 (mod n) b=b^2+1 (mod n) b=b^2+1 (mod n) 2.2 Compute d=gcd (a-b, n). 2.3 if 1<d<n then return (d) and terminate with success. 2.4 if d=n then terminate the algorithm. e.g. n=455459 A 5 26 677 2871 44380 179685 121634 155260 44567 B 26 2871 179685 155260 416250 436701 164403 247944 68343 d=[gcd (a-b , n)] 1 1 1 1 1 1 1 1 743 ly on the size of the integer to be factored. This is the type of algorithm used to factor RSA numbers. Most general-purpose factoring algorithms are based on the congruence of squares method Quadratic Sieve The quadratic sieve algorithm (QS) is an integer factorization algorithm and, in practice, the second fastest method known (after the general number field sieve). It is still the fastest for integers under 100 decimal digits or so, and is considerably simpler than the number field sieve. It is a general-purpose factorization algorithm, meaning that its running time depends solely on the size of the integer to be factored, and not on special structure or properties. It was invented by CarlPomerance in 1981 as an improvement to Schroeppel's linear sieve[4,8-11]. Proposed Algorithm for Quadratic Sieve Input: n , The number which is to be factorized.//n=221 Output: Factors of n. Step 1: Find smallest number whose square is larger than n. i.e. T= sqrt(n) +1 //sqrt(221)+1=15 Step 2: Use polynomial function f(T) = T^2-n//15^2-221=4 Step 3: Now sieve the numbers from f(T) [f(15)] to f(T+x) [f(30)] using successively the prime power from 2 to 7; where the x is a random positive integer. Remember the numbers from T to T+x is the original list of numbers. //15 16 17…30. Sieve is nothing but the following operation in c++; Step 4: Update the list of numbers by dividing each number with prime factor 2 to 7 respectively ; such that the reminder is 0. Step 5: List the numbers from the original list which remains as 1 after all the sieve operations.// 1 1 17 103 1….197. Step 6: List the square modulo of above listed numbers; So that 743 is one factor and hence the non trivial factors of 455459 are 743 and n/d i.e. 455459/743 = 613. Drawbacks of Special purpose algorithms is these algorithms are restricted only for special class of numbers for e.g. Pollard’s Rho algorithm works for 5 to 11 digit numbers only. General Purpose A general-purpose factoring algorithm's running time depends sole- Step 7: Now calculate the factors by using following code Advances in Computational Research ISSN: 0975-3273 & E-ISSN: 0975-9085, Volume 7, Issue 1, 2015 || Bioinfo Publications || 251 Jaybhay N. and Jadhav P. [8] Eldershaw C. & Brent R.P. (1995) Proceedings of Neural, Parallel and Scientific Computations, 1, 143-148. [9] Rabah K. (2006) Journal of Applied Sciences, 6(1), 458-481. Step 8: Stop. Output Conclusion Integer factorization is very important concept in mathematics used in cryptography. In this paper we focused on methodologies used for integer factorization and their limitations. We proposed a new algorithm for Quadratic sieve with its implementation in c++. Conflicts of Interest: None declared. References [1] Menezes A.J., Van Oorschot P.C. & Vanstone S.A. (2010) Handbook of applied cryptography, CRC press. [2] Jensen P.L. (2005) Integer factorization, Thesis, Department of Computer science, University of Copenhagen. [3] Katz J. & Lindell Y. (2007) Introduction to modern cryptography: principles and protocols, CRC Press. [4] Menezes A.J., Van Oorschot P.C. & Vanstone S.A. (2010) Handbook of applied cryptography, CRC Press. [5] Koundinya A.K., Harish G., Srinath N.K., Raghavendra G.E. Pramod Y.V., Sandeep R. & Kumar G.P. (2013) International Journal of Computer Science & Information Technology, 5(2). [6] Bressoud D.M. (1989) Factorization and primality testing, New York. [7] Barnes C. (2004) Integer Factorization Algorithms, Oregon State University. Advances in Computational Research ISSN: 0975-3273 & E-ISSN: 0975-9085, Volume 7, Issue 1, 2015 || Bioinfo Publications || 252