Skip to main content

Integer Factorization and RSA

  • Chapter
  • First Online:
  • 32k Accesses

Part of the book series: Undergraduate Texts in Mathematics ((UTM))

Abstract

The Diffie–Hellman key exchange method and the Elgamal public key cryptosystem studied in Sects. 2.3 and 2.4 rely on the fact that it is easy to compute powers \(a^{n}\bmod p\), but difficult to recover the exponent n if you know only the values of a and \(a^{n}\bmod p\). An essential result that we used to analyze the security of Diffie–Hellman and Elgamal is Fermat’s little theorem (Theorem 1.24),

$$\displaystyle{a^{p-1} \equiv 1\ (\mathrm{mod}\ p)\qquad \mbox{ for all $a\not\equiv 0(\mathrm{mod}p)$.}}$$

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   69.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   89.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD   89.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    In the great courthouse of mathematics, witnesses never lie!

  2. 2.

    Unfortunately, although this deduction seems reasonable, it is not quite accurate. In the language of probability theory, we need to compute the conditional probability that n is composite given that the Miller–Rabin test fails 10 times; and we know the conditional probability that the Miller–Rabin test succeeds at least 75 % of the time if n is composite. See Sect. 5.3.2 for a discussion of conditional probabilities and Exercise 5.175 for a derivation of the correct formula, which says that the probability (25 %)10 must be approximately multiplied by ln(n).

  3. 3.

    The Riemann hypothesis is another of the $1,000,000 Millennium Prize problems.

  4. 4.

    We have assumed that \(p \nmid a\) and \(q \nmid a\), since if p and q are very large, this will almost certainly be the case. Further, if by some chance pa and \(q \nmid a\), then we can recover p as p = gcd(a, N).

  5. 5.

    Stirling’s formula says more precisely that \(\ln (n!) = n\ln (n) - n + \frac{1} {2}\ln (2\pi n) + O(1/n)\).

  6. 6.

    Why do we start with a = 3129? The answer is that unless a 2 is larger than N, then there is no reduction modulo N in \(a^{2}\bmod N\), so we cannot hope to gain any information. The value 3129 comes from the fact that \(\sqrt{N} = \sqrt{9788111} \approx 3128.6\).

  7. 7.

    Note: Big-Ω notation as used by computer scientists and cryptographers does not mean the same thing as the big-Ω notation of mathematicians. In mathematics, especially in the field of analytic number theory, the expression \(f(n) =\varOmega {\bigl ( g(n)\bigr )}\) means that there is a constant c such that there are infinitely many integers n such that f(n) ≥ cg(n). In this book we use the computer science definition.

  8. 8.

    In practice when N is large, the t values used in the quadratic sieve are close enough to \(\sqrt{N}\) that the value of t 2N is between 1 and N. For our small numerical example, this is not the case, so it would be more efficient to reduce our values of t 2 modulo N, rather than merely subtracting N from t 2. However, since our aim is illumination, not efficiency, we will pretend that there is no advantage to subtracting additional multiples of N from t 2N.

  9. 9.

    Looking back at the congruences (3.23), you may have noticed that it is even easier to use the fact that 152 is itself congruent to a square modulo 221, yielding \(\gcd (15 - 2, 221) = 13\). In practice, the true power of the quadratic sieve appears only when it is applied to numbers much too large to use in a textbook example.

  10. 10.

    Proposition 3.61 deals only with the case that \(p \nmid a\) and \(p \nmid b\). But if p divides a or b, then p also divides ab, so both sides of (3.33) are zero.

  11. 11.

    If you don’t believe that p and q are prime, use Miller–Rabin (Table 3.2) to check.

  12. 12.

    Goldwasser and Micali were not the first to use the problem of squares modulo pq for cryptography. Indeed, an early public key cryptosystem due to Rabin that is provably secure against chosen plaintext attacks (assuming the hardness of factorization) relies on this problem.

  13. 13.

    The concatenation of 2 bit strings is formed by placing the first string before the second string. For example, \(1101 \| 1001\) is the bit string 11011001.

References

  1. M. Agrawal, N. Kayal, N. Saxena, PRIMES is in P. Ann. Math. (2) 160(2), 781–793 (2004)

    Google Scholar 

  2. W.R. Alford, A. Granville, C. Pomerance, There are infinitely many Carmichael numbers. Ann. Math. (2) 139(3), 703–722 (1994)

    Google Scholar 

  3. T.M. Apostol, Introduction to Analytic Number Theory. Undergraduate Texts in Mathematics (Springer, New York, 1976)

    Google Scholar 

  4. E. Bach, Explicit bounds for primality testing and related problems. Math. Comput. 55(191), 355–380 (1990)

    Article  MathSciNet  MATH  Google Scholar 

  5. E. Bach, J. Shallit, Algorithmic Number Theory: Efficient Algorithms. Foundations of Computing Series, vol. 1 (MIT, Cambridge, 1996).

    Google Scholar 

  6. J. Blömer, A. May, Low secret exponent RSA revisited, in Cryptography and Lattices, Providence, 2001. Volume 2146 of Lecture Notes in Computer Science (Springer, Berlin, 2001), pp. 4–19

    Google Scholar 

  7. D. Boneh, G. Durfee, Cryptanalysis of RSA with private key d less than N 0. 292, in Advances in Cryptology—EUROCRYPT ’99, Prague. Volume 1592 of Lecture Notes in Computer Science (Springer, Berlin, 1999), pp. 1–11

    Google Scholar 

  8. D. Boneh, G. Durfee, Cryptanalysis of RSA with private key d less than N 0. 292. IEEE Trans. Inf. Theory 46(4), 1339–1349 (2000)

    Google Scholar 

  9. D. Boneh, R. Venkatesan, Breaking RSA may not be equivalent to factoring (extended abstract), in Advances in Cryptology—EUROCRYPT ’98, Espoo. Volume 1403 of Lecture Notes in Computer Science (Springer, Berlin, 1998), pp. 59–71

    Google Scholar 

  10. E.R. Canfield, P. Erdős, C. Pomerance, On a problem of Oppenheim concerning “factorisatio numerorum”. J. Number Theory 17(1), 1–28 (1983)

    Article  MathSciNet  MATH  Google Scholar 

  11. H. Cohen, A Course in Computational Algebraic Number Theory. Volume 138 of Graduate Texts in Mathematics (Springer, Berlin, 1993)

    Google Scholar 

  12. D. Coppersmith, Solving homogeneous linear equations over GF(2) via block Wiedemann algorithm. Math. Comput. 62(205), 333–350 (1994)

    MathSciNet  MATH  Google Scholar 

  13. R. Crandall, C. Pomerance, Prime Numbers (Springer, New York, 2001)

    Book  Google Scholar 

  14. H. Davenport, The Higher Arithmetic (Cambridge University Press, Cambridge, 1999)

    MATH  Google Scholar 

  15. M. Dietzfelbinger, Primality Testing in Polynomial Time: From Randomized Algorithms to “PRIMES is in P”. Volume 3000 of Lecture Notes in Computer Science (Springer, Berlin, 2004)

    Google Scholar 

  16. W. Diffie, M.E. Hellman, New directions in cryptography. IEEE Trans. Inf. Theory IT-22(6), 644–654 (1976)

    Google Scholar 

  17. G.H. Hardy, E.M. Wright, An Introduction to the Theory of Numbers, 5th edn. (The Clarendon Press/Oxford University Press, New York, 1979)

    MATH  Google Scholar 

  18. K. Ireland, M. Rosen, A Classical Introduction to Modern Number Theory. Volume 84 of Graduate Texts in Mathematics (Springer, New York, 1990)

    Google Scholar 

  19. B.A. LaMacchia, A.M. Odlyzko, Solving large sparse linear systems over finite fields, in Advances in Cryptology—CRYPTO ’90, Santa Barbara, 1990. Lecture Notes in Computer Science (Springer, Berlin, 1990)

    Google Scholar 

  20. H.W. Lenstra jr., C. Pomerance, Primality testing with Gaussian periods (2011). https://www.math.dartmouth.edu/~carlp/PDF/complexity12.pdf

  21. G.L. Miller, Riemann’s hypothesis and tests for primality. J. Comput. Syst. Sci. 13(3), 300–317 (1976). Working papers presented at the ACM-SIGACT Symposium on the Theory of Computing, Albuquerque, 1975

    Google Scholar 

  22. I. Niven, H.S. Zuckerman, H.L. Montgomery, An Introduction to the Theory of Numbers (Wiley, New York, 1991)

    Google Scholar 

  23. C. Pomerance, A tale of two sieves. Not. Am. Math. Soc. 43(12), 1473–1485 (1996)

    MathSciNet  MATH  Google Scholar 

  24. H. Riesel, Prime Numbers and Computer Methods for Factorization. Volume 126 of Progress in Mathematics (Birkhäuser, Boston, 1994)

    Google Scholar 

  25. K.H. Rosen, Elementary Number Theory and Its Applications, 4th edn. (Addison-Wesley, Reading, 2000)

    MATH  Google Scholar 

  26. V. Shoup, A Computational Introduction to Number Theory and Algebra (Cambridge University Press, 2005). http://shoup.net/ntb/ntb-b5.pdf

  27. J.H. Silverman, A Friendly Introduction to Number Theory, 4th edn. (Pearson, Upper Saddle River, 2013)

    Google Scholar 

  28. A.E. Western, J.C.P. Miller, Tables of Indices and Primitive Roots. Royal Society Mathematical Tables, vol. 9 (Published for the Royal Society at the Cambridge University Press, London, 1968)

    Google Scholar 

  29. M.J. Wiener, Cryptanalysis of short RSA secret exponents. IEEE Trans. Inf. Theory 36(3), 553–558 (1990)

    Article  MathSciNet  MATH  Google Scholar 

  30. S.Y. Yan, Primality Testing and Integer Factorization in Public-Key Cryptography. Volume 11 of Advances in Information Security (Kluwer Academic, Boston, 2004)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer Science+Business Media New York

About this chapter

Cite this chapter

Hoffstein, J., Pipher, J., Silverman, J.H. (2014). Integer Factorization and RSA. In: An Introduction to Mathematical Cryptography. Undergraduate Texts in Mathematics. Springer, New York, NY. https://doi.org/10.1007/978-1-4939-1711-2_3

Download citation

Publish with us

Policies and ethics