Chapter 5 Order-Finding and Factoring The inverse quantum Fourier transform and the quantum Fourier transform are the quantum circuits of implementing the Fourier transform and they can be applied to solve a variety of interesting questions. In this chapter, we now introduce two of the most interesting of those questions that are respectively the order-finding problem and the factoring problem. Miller in 1976 proved that solving the order-finding problem is equivalent to solve the factoring problem. For the RSA public-key cryptosystem, People have currently installed more than 400,000,000 copies of its algorithms and it is the primary cryptosystem used for security on the Internet and World Wide Web. The security of the RSA public-key cryptosystem is dependent on that the problem of factoring a big nature number into the production of two large prime numbers is intractable on a classical computer. Shor’s order-finding algorithm can solve the problems of order-finding and factoring exponential faster than any conventional computer. By means of using Shor’s algorithm to factor a big nature number with 1024 bits into the production of two prime numbers with 512 bits each, Imre and Ferenc in (Imre and Ferenc 2005) indicate that the execution time is approximately 0.01 s. This is to say that Shor’s algo- rithm will make the RSA public-key cryptosystem obsolete once its reliable physical implementation becomes available on the market. In this chapter, we first introduce a little background in number theory. Next, we explain how the order-finding problem implies the ability to factor as well. We also explain how shor’s algorithm solves the order-finding problem. Next, we describe how to write quantum algorithms to imple- ment Shor’s algorithm for solving the simplest case in the problems of order-finding and factoring. © The Author(s), under exclusive license to Springer Nature Switzerland AG 2021 W.-L. Chang and A. V.Vasilakos, Fundamentals of Quantum Programming in IBM’s Quantum Computers, Studies in Big Data 81, https://doi.org/10.1007/978-3-030-63583-1_5 219