Jump to content

Integer factorization

From Wikipedia, the free encyclopedia
Unsolved problem in computer science:
Can integer factorization be solved in polynomial time on a classical computer?

Innumber theory,integer factorizationis the decomposition of apositive integerinto aproductof integers. Every positive integer greater than 1 is either the product of two or more integerfactorsgreater than 1, in which case it is called acomposite number,or it is not, in which case it is called aprime number.For example,15is a composite number because15 = 3 · 5,but7is a prime number because it cannot be decomposed in this way. If one of the factors is composite, it can in turn be written as a product of smaller factors, for example60 = 3 · 20 = 3 · (5 · 4).Continuing this process until every factor is prime is calledprime factorization;the result is always unique up to the order of the factors by theprime factorization theorem.

To factorize a small integernusing mental or pen-and-paper arithmetic, the simplest method istrial division:checking if the number is divisible by prime numbers2,3,5,and so on, up to thesquare rootofn.For larger numbers, especially when using a computer, various more sophisticated factorization algorithms are more efficient. A prime factorization algorithm typically involvestesting whether each factor is primeeach time a factor is found.

When the numbers are sufficiently large, no efficientnon-quantuminteger factorizationalgorithmis known. However, it has not been proven that such an algorithm does not exist. The presumeddifficultyof this problem is important for the algorithms used incryptographysuch asRSA public-key encryptionand theRSA digital signature.[1]Many areas ofmathematicsandcomputer sciencehave been brought to bear on the problem, includingelliptic curves,algebraic number theory,andquantum computing.

Not all numbers of a given length are equally hard to factor. The hardest instances of these problems (for currently known techniques) aresemiprimes,the product of two prime numbers. When they are both large, for instance more than two thousandbitslong, randomly chosen, and about the same size (but not too close, for example, to avoid efficient factorization byFermat's factorization method), even the fastest prime factorization algorithms on the fastest computers can take enough time to make the search impractical; that is, as the number of digits of the integer being factored increases, the number of operations required to perform the factorization on any computer increases drastically.

Many cryptographic protocols are based on the difficulty of factoring large composite integers or a related problem—for example, theRSA problem.An algorithm that efficiently factors an arbitrary integer would renderRSA-basedpublic-keycryptography insecure.

Prime decomposition

[edit]
Prime decomposition ofn= 864as25× 33

By thefundamental theorem of arithmetic,every positive integer has a uniqueprime factorization.(By convention, 1 is theempty product.)Testingwhether the integer is prime can be done inpolynomial time,for example, by theAKS primality test.If composite, however, the polynomial time tests give no insight into how to obtain the factors.

Given a general algorithm for integer factorization, any integer can be factored into its constituentprime factorsby repeated application of this algorithm. The situation is more complicated with special-purpose factorization algorithms, whose benefits may not be realized as well or even at all with the factors produced during decomposition. For example, ifn= 171 ×p×qwherep<qare very large primes,trial divisionwill quickly produce the factors 3 and 19 but will takepdivisions to find the next factor. As a contrasting example, ifnis the product of the primes13729,1372933,and18848997161,where13729 × 1372933 = 18848997157,Fermat's factorization method will begin withn⌉ = 18848997159which immediately yieldsb=a2n=4= 2and hence the factorsab= 18848997157anda+b= 18848997161.While these are easily recognized as composite and prime respectively, Fermat's method will take much longer to factor the composite number because the starting value of18848997157⌉ = 137292forais a factor of 10 from1372933.

Current state of the art

[edit]

Among theb-bit numbers, the most difficult to factor in practice using existing algorithms are thosesemiprimeswhose factors are of similar size. For this reason, these are the integers used in cryptographic applications.

In 2019, Fabrice Boudot, Pierrick Gaudry, Aurore Guillevic, Nadia Heninger, Emmanuel Thomé and Paul Zimmermann factored a 240-digit (795-bit) number (RSA-240) utilizing approximately 900 core-years of computing power.[2]The researchers estimated that a 1024-bit RSA modulus would take about 500 times as long.[3]

The largest such semiprime yet factored wasRSA-250,an 829-bit number with 250 decimal digits, in February 2020. The total computation time was roughly 2700 core-years of computing using IntelXeon Gold6130 at 2.1 GHz. Like all recent factorization records, this factorization was completed with a highly optimized implementation of thegeneral number field sieverun on hundreds of machines.

Time complexity

[edit]

Noalgorithmhas been published that can factor all integers inpolynomial time,that is, that can factor ab-bit numbernin timeO(bk)for some constantk.Neither the existence nor non-existence of such algorithms has been proved, but it is generally suspected that they do not exist.[4][5]

There are published algorithms that are faster thanO((1 +ε)b)for all positiveε,that is,sub-exponential.As of 2022,the algorithm with best theoretical asymptotic running time is thegeneral number field sieve(GNFS), first published in 1993,[6]running on ab-bit numbernin time:

For current computers, GNFS is the best published algorithm for largen(more than about 400 bits). For aquantum computer,however,Peter Shordiscovered an algorithm in 1994 that solves it in polynomial time.Shor's algorithmtakes onlyO(b3)time andO(b)space onb-bit number inputs. In 2001, Shor's algorithm was implemented for the first time, by usingNMRtechniques on molecules that provide seven qubits.[7]

In order to talk aboutcomplexity classessuch as P, NP, and co-NP, the problem has to be stated as adecision problem.

Decision problem(Integer factorization)For every natural numbersand,doesnhave a factor smaller thankbesides 1?

It is known to be in bothNPandco-NP,meaning that both "yes" and "no" answers can be verified in polynomial time. An answer of "yes" can be certified by exhibiting a factorizationn=d(n/d)withdk.An answer of "no" can be certified by exhibiting the factorization ofninto distinct primes, all larger thank;one can verify their primality using theAKS primality test,and then multiply them to obtainn.Thefundamental theorem of arithmeticguarantees that there is only one possible string of increasing primes that will be accepted, which shows that the problem is in bothUPand co-UP.[8]It is known to be inBQPbecause of Shor's algorithm.

The problem is suspected to be outside all three of the complexity classes P, NP-complete,[9]andco-NP-complete. It is therefore a candidate for theNP-intermediatecomplexity class.

In contrast, the decision problem "Isna composite number? "(or equivalently:" Isna prime number? ") appears to be much easier than the problem of specifying factors ofn.The composite/prime problem can be solved in polynomial time (in the numberbof digits ofn) with theAKS primality test.In addition, there are severalprobabilistic algorithmsthat can test primality very quickly in practice if one is willing to accept a vanishingly small possibility of error. The ease ofprimality testingis a crucial part of theRSAalgorithm, as it is necessary to find large prime numbers to start with.

Factoring algorithms

[edit]

Special-purpose

[edit]

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. The parameters which determine the running time vary among algorithms.

An important subclass of special-purpose factoring algorithms is theCategory 1orFirst Categoryalgorithms, whose running time depends on the size of smallest prime factor. Given an integer of unknown form, these methods are usually applied before general-purpose methods to remove small factors.[10]For example, naivetrial divisionis a Category 1 algorithm.

General-purpose

[edit]

A general-purpose factoring algorithm, also known as aCategory 2,Second Category,orKraitchikfamilyalgorithm,[10]has a running time which depends solely on the size of the integer to be factored. This is the type of algorithm used to factorRSA numbers.Most general-purpose factoring algorithms are based on thecongruence of squaresmethod.

Other notable algorithms

[edit]

Heuristic running time

[edit]

In number theory, there are many integer factoring algorithms that heuristically have expectedrunning time

inlittle-oandL-notation. Some examples of those algorithms are theelliptic curve methodand thequadratic sieve. Another such algorithm is theclass group relations methodproposed by Schnorr,[11]Seysen,[12]and Lenstra,[13]which they proved only assuming the unprovedgeneralized Riemann hypothesis.

Rigorous running time

[edit]

The Schnorr–Seysen–Lenstra probabilistic algorithm has been rigorously proven by Lenstra and Pomerance[14]to have expected running timeLn[1/2,1+o(1)]by replacing the GRH assumption with the use of multipliers. The algorithm uses theclass groupof positive binaryquadratic formsofdiscriminantΔdenoted byGΔ. GΔis the set of triples of integers(a,b,c)in which those integers are relative prime.

Schnorr–Seysen–Lenstra algorithm

[edit]

Given an integernthat will be factored, wherenis an odd positive integer greater than a certain constant. In this factoring algorithm the discriminantΔis chosen as a multiple ofn,Δ = −dn,wheredis some positive multiplier. The algorithm expects that for onedthere exist enoughsmoothforms inGΔ.Lenstra and Pomerance show that the choice ofdcan be restricted to a small set to guarantee the smoothness result.

Denote byPΔthe set of all primesqwithKronecker symbol(Δ/q)= 1.By constructing a set ofgeneratorsofGΔand prime formsfqofGΔwithqinPΔa sequence of relations between the set of generators andfqare produced. The size ofqcan be bounded byc0(log|Δ|)2for some constantc0.

The relation that will be used is a relation between the product of powers that is equal to theneutral elementofGΔ.These relations will be used to construct a so-called ambiguous form ofGΔ,which is an element ofGΔof order dividing 2. By calculating the corresponding factorization ofΔand by taking agcd,this ambiguous form provides the complete prime factorization ofn.This algorithm has these main steps:

Letnbe the number to be factored.

  1. LetΔbe a negative integer withΔ = −dn,wheredis a multiplier andΔis the negative discriminant of some quadratic form.
  2. Take thetfirst primesp1= 2,p2= 3,p3= 5,...,pt,for sometN.
  3. Letfqbe a random prime form ofGΔwith(Δ/q)= 1.
  4. Find a generating setXofGΔ.
  5. Collect a sequence of relations between setXand{fq:qPΔ}satisfying:
  6. Construct an ambiguous form(a,b,c)that is an elementfGΔof order dividing 2 to obtain a coprime factorization of the largest odd divisor ofΔin whichΔ = −4acorΔ =a(a− 4c)orΔ = (b− 2a)(b+ 2a).
  7. If the ambiguous form provides a factorization ofnthen stop, otherwise find another ambiguous form until the factorization ofnis found. In order to prevent useless ambiguous forms from generating, build up the2-SylowgroupSll2(Δ)ofG(Δ).

To obtain an algorithm for factoring any positive integer, it is necessary to add a few steps to this algorithm such as trial division, and theJacobi sum test.

Expected running time

[edit]

The algorithm as stated is aprobabilistic algorithmas it makes random choices. Its expected running time is at mostLn[1/2,1+o(1)].[14]

See also

[edit]

Notes

[edit]
  1. ^Lenstra, Arjen K. (2011),"Integer Factoring",in van Tilborg, Henk C. A.; Jajodia, Sushil (eds.),Encyclopedia of Cryptography and Security,Boston, MA: Springer US, pp. 611–618,doi:10.1007/978-1-4419-5906-5_455,ISBN978-1-4419-5905-8,retrieved2022-06-22
  2. ^"[Cado-nfs-discuss] 795-bit factoring and discrete logarithms".Archived fromthe originalon 2019-12-02.
  3. ^Kleinjung, Thorsten; Aoki, Kazumaro; Franke, Jens; Lenstra, Arjen K.; Thomé, Emmanuel; Bos, Joppe W.; Gaudry, Pierrick; Kruppa, Alexander; Montgomery, Peter L.; Osvik, Dag Arne; te Riele, Herman J. J.; Timofeev, Andrey; Zimmermann, Paul (2010)."Factorization of a 768-Bit RSA Modulus"(PDF).In Rabin, Tal (ed.).Advances in Cryptology - CRYPTO 2010, 30th Annual Cryptology Conference, Santa Barbara, CA, USA, August 15-19, 2010. Proceedings.Lecture Notes in Computer Science. Vol. 6223. Springer. pp. 333–350.doi:10.1007/978-3-642-14623-7_18.
  4. ^Krantz, Steven G.(2011),The Proof is in the Pudding: The Changing Nature of Mathematical Proof,New York: Springer, p. 203,doi:10.1007/978-0-387-48744-1,ISBN978-0-387-48908-7,MR2789493
  5. ^Arora, Sanjeev;Barak, Boaz (2009),Computational complexity,Cambridge: Cambridge University Press, p. 230,doi:10.1017/CBO9780511804090,ISBN978-0-521-42426-4,MR2500087,S2CID215746906
  6. ^Buhler, J. P.; Lenstra, H. W. Jr.; Pomerance, Carl (1993). "Factoring integers with the number field sieve".The development of the number field sieve.Lecture Notes in Mathematics. Vol. 1554. Springer. pp. 50–94.doi:10.1007/BFb0091539.hdl:1887/2149.ISBN978-3-540-57013-4.Retrieved12 March2021.
  7. ^ Vandersypen, Lieven M. K.; et al. (2001). "Experimental realization of Shor's quantum factoring algorithm using nuclear magnetic resonance".Nature.414(6866): 883–887.arXiv:quant-ph/0112176.Bibcode:2001Natur.414..883V.doi:10.1038/414883a.PMID11780055.S2CID4400832.
  8. ^ Lance Fortnow (2002-09-13)."Computational Complexity Blog: Complexity Class of the Week: Factoring".
  9. ^Goldreich, Oded;Wigderson, Avi(2008), "IV.20 Computational Complexity", inGowers, Timothy;Barrow-Green, June;Leader, Imre(eds.),The Princeton Companion to Mathematics,Princeton, New Jersey: Princeton University Press, pp. 575–604,ISBN978-0-691-11880-2,MR2467561.See in particularp. 583.
  10. ^ab David BressoudandStan Wagon(2000).A Course in Computational Number Theory.Key College Publishing/Springer. pp.168–69.ISBN978-1-930190-10-8.
  11. ^Schnorr, Claus P. (1982)."Refined analysis and improvements on some factoring algorithms".Journal of Algorithms.3(2): 101–127.doi:10.1016/0196-6774(82)90012-8.MR0657269.Archived fromthe originalon September 24, 2017.
  12. ^Seysen, Martin (1987)."A probabilistic factorization algorithm with quadratic forms of negative discriminant".Mathematics of Computation.48(178): 757–780.doi:10.1090/S0025-5718-1987-0878705-X.MR0878705.
  13. ^Lenstra, Arjen K (1988)."Fast and rigorous factorization under the generalized Riemann hypothesis"(PDF).Indagationes Mathematicae.50(4): 443–454.doi:10.1016/S1385-7258(88)80022-2.
  14. ^abLenstra, H. W.; Pomerance, Carl (July 1992)."A Rigorous Time Bound for Factoring Integers"(PDF).Journal of the American Mathematical Society.5(3): 483–516.doi:10.1090/S0894-0347-1992-1137100-0.MR1137100.

References

[edit]
[edit]