Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

Cambridge University Press eBooks

Breaking RSA encryption

N. David Mermin

Published Aug 30, 2007• 0 citations
Publisher

Abstract

Period finding, factoring, and cryptography Simon's problem (Section 2.5) starts with a subroutine that calculates a function f(x) , which satisfies f(x) = f(y) for distinct x and y if and only if y = x ⊕ a , where ⊕ denotes the bitwise modulo-2 sum of the n -bit integers a and x . The number of times a classical computer must invoke the subroutine to determine a grows exponentially with n , but with a quantum computer it grows only linearly. This is a rather artificial example, of interest primarily because it gives a simple demonstration of the remarkable computational power a quantum computer can possess. It amounts to finding the unknown period a of a function on n -bit integers that is “periodic” under bitwise modulo-2 addition. A more difficult, but much more natural problem is to find the period r of a function f on the integers that is periodic under ordinary addition, satisfying f(x) = f(y) for distinct x and y if and only if x and y differ by an integral multiple of r . Finding the period of such a periodic function turns out to be the key to factoring products of large prime numbers, a mathematically natural problem with quite practical applications.

DOI
10.1017/cbo9780511813870.005

Related papers

RSA Encryption and Number Theory

Alice Flarend, Robert Hilborn

Abstract This chapter sets the background for the famous Shor algorithm that can allow a sufficiently powerful quantum computer to easily break the current classical RSA encryption method. The RSA algorithm relies on the impossibility of even the most powerful classical computers to factor large numbers in any practical length of time. Before going through the details of the RSA encryption method, the number theory of the modulus or mod function is explained with many examples including exponential ones. The connection between factoring and the periodicity of mod functions is emphasized because it is needed for the RSA and Shor algorithms. The in-depth explanation of the RSA algorithm makes use of number theory to explain how the encryption key can be made public while other information is kept secret to ensure secure communication.

•Jul 9, 2026•0 citations

What has quantum mechanics to do with factoring? April 2007

N. David Mermin

A quantum computer is a digital computer capable of exploiting quantum coherence among the physical two-state systems that store the binary arithmetic information. To factor an integer is to find its (unique) expression as a product of prime numbers. The most impressive, most important, and best-known thing a quantum computer can do is to factor with spectacular efficiency the product of two enormous prime numbers. But what on earth can quantum mechanics have to do with factoring? This question bothered me for four years, from the time I heard about the discovery that a quantum computer was spectacularly good at factoring until I finally took the trouble to find out how it was done. The answer, you will be relieved—but, if you're like me, also a little disappointed—to learn, is that quantum mechanics has nothing at all directly to do with factoring. But it does have a lot to do with waves. Many important waves are periodic, so it is not very surprising that quantum mechanics might be useful in efficiently revealing features associated with periodicity. Quantum mechanics is connected to factoring through periodicity. It turns out, for purely arithmetic reasons having nothing to do with quantum mechanics, that if we have an efficient way to find the period of a periodic function, then, as we shall see below, we can easily factor the product of two enormous prime numbers. And a quantum computer provides an extremely efficient way to find periods. All of the above is of considerable practical importance, because the great difficulty in factoring such a product—where the two enormous prime numbers are typically each several hundred digits long—is the basis for the security of the most widely used encryption scheme (called RSA [1] encryption) for protecting private information sent over the internet. In 1994 Peter Shor discovered [2] that a quantum computer would be super-efficient at period finding and thereby pose a potential threat to innumerable secrets. Whence the explosion of interest in developing quantum computation. The threat is only potential because no quantum computer capable of anything like serious period finding currently exists. I suspect the emphasis has been put on factoring rather than period finding because factoring is more famously associated with RSA code breaking, although, as it happens, period finding can be used directly to crack the RSA code, without any need for a detour into factoring.

Cambridge University Press eBooks•Jan 5, 2016•0 citations

Fundamental Structure of Shor’s Quantum Algorithm for Factoring Integers

Turgut Hanoymak, Akram Chehrazi

One of the most well known mathematically hard problems in number theory is the integer factorization problem, roughly stated that decomposition of a composite number into its prime factors. In modern cryptography, RSA encryption algorithm whose security is based on integer factorization problem is highly practical, widespread and up to date no classical algorithm having polynomial running time for the factorization of large numbers is known. In 1994, Peter Shor proposed an efficient algorithm on quantum computer. In this paper, we  mention about the fundamentals of  Shor's quantum algorithm illustrating a concrete example.

Turkish Journal of Mathematics and Computer Science•Dec 31, 2019•0 citations

Quantum Inspired Technique for Cracking RSA

Nitesh Kumar Rijwani, Brijesh Kumar Chaurasia

This paper explores a quantum-inspired technique for factoring semi-prime integers, a problem central to the security of RSA cryptography. While Shor's algorithm offers a polynomial-time solution on a quantum computer, posing a significant threat to RSA, current quantum hardware limitations hinder its practical implementation. This study simulates Shor's algorithm classically, replacing the quantum period-finding subroutine—the source of the quantum speedup—with a classical method to analyze its performance. The experiments factored semi-primes ranging from 2 to 8 digits, demonstrating that while the technique works, the execution time increases exponentially with the size of the number, escalating from seconds for small integers to an order of minutes for an 8-digit number. This highlights the inefficiency of classical period-finding compared to the quantum approach. The results validate the theoretical framework of Shor's algorithm but underscore the impracticality of classical simulations for cryptographic-scale integers. This work also explores the necessity of advancing quantum computing to realize scalable factorization while classical methods remain confined to pedagogical or small-scale applications. The study emphasizes the urgency of hybrid quantum-classical optimizations and reinforces Shor's algorithm as pivotal for future cryptographic vulnerability assessments and quantum-ready solutions.

International Conference on Information Systems and Computer Networks (ISCON)•Sep 5, 2025•1 citation

Searching with a quantum computer

N. David Mermin

The nature of the search Suppose you know that exactly one n -bit integer satisfies a certain condition, and suppose you have a black-boxed subroutine that acts on the N = 2 n different n -bit integers, outputting 1 if the integer satisfies the condition and 0 otherwise. In the absence of any other information, to find the special integer you can do no better with a classical computer than to apply the subroutine repeatedly to different random numbers until you hit on the special one. If you apply it to M different integers the probability of your finding the special number is M/N . You must test ½ N different integers to have a 50% chance of success. If, however, you have a quantum computer with a subroutine that performs such a test, then you can find the special integer with a probability that is very close to 1 when N is large, using a method that calls the subroutine a number of times no greater than. This very general capability of quantum computers was discovered by Lov Grover, and goes under the name of Grover's search algorithm . Shor's period-finding algorithm and Grover's search algorithm, together with their various modifications and extensions, constitute the two masterpieces of quantum-computational software. One can think of Grover's black-boxed subroutine in various ways. The subroutine might perform a mathematical calculation to determine whether the input integer is the special one. Here is a simple example.

Cambridge University Press eBooks•Aug 30, 2007•0 citations

Shor's Factoring Algorithm and Modular Exponentiation Operators

Robert Singleton

We provide a pedagogical presentation of Shor's factoring algorithm, which is a quantum algorithm for factoring very large numbers (of order of hundreds to thousands of bits) in polynomial time. In contrast, all known classical algorithms for the factoring problem take an exponential time to factor such large numbers. Shor's algorithm therefore has profound implication for public-key encryption such as RSA and Diffie–Hellman key exchange. We assume no prior knowledge of Shor's algorithm beyond a basic familiarity with the circuit model of quantum computing. Shor's algorithm contains a number of moving parts, and can be rather daunting at first. The literature is replete with derivations and expositions of Shor's algorithm, but most of them seem to be lacking in essential details, and none of them provide a pedagogical presentation. They require a thicket of appendices and assume a knowledge of quantum algorithms and classical mathematics with which the reader might not be familiar. We therefore start with first principle derivations of the quantum Fourier transform (QFT) and quantum phase estimation (QPE), which are the essential building blocks of Shor's algorithm. We then go on to develop the theory of modular exponentiation (ME) operators, one of the fundamental components of Shor's algorithm, and the place where most of the quantum resources are deployed. We also delve into the number theory that establishes the link between factorization and the period of the modular exponential function. We then apply the QPE algorithm to obtain Shor's factoring algorithm. We also discuss the post-quantum processing and the method of continued fractions, which is used to extract the exact period of the modular exponential function from the approximately measured phase angles of the ME operator. The manuscript then moves on to a series of examples. We first verify the formalism by factoring N=15, the smallest number accessible to Shor's algorithm. We then proceed to factor larger integers, developing a systematic procedure that will find the ME operators for any semi-prime N=p×q (where q and p are prime). Finally, we factor the composite numbers N=21, 33, 35, 143, 247 using the Qiskit simulator. It is observed that the ME operators are somewhat forgiving, and truncated approximate forms are able to extract factors just as well as the exact operators. This is because the method of continued fractions only requires an approximate phase value for its input, which suggests that implementing Shor's algorithm might not be as difficult as first suspected. Quanta 2023; 12: 41–130.

arXiv:2306.09122•Quanta•Sep 15, 2023•8 citations
Period finding, factoring, and cryptography Simon's problem (Section 2.5) starts with a subroutine that calculates a function f(x) , which satisfies f(x) = f(y) for distinct x and y if and only if y = x ⊕ a , where ⊕ denotes the bitwise modulo-2 sum of the n -bit integers a and x . The number of times a classical computer must invoke the subroutine to determine a grows exponentially with n , but with a quantum computer it grows only linearly. This is a rather artificial example, of interest primarily because it gives a simple demonstration of the remarkable computational power a quantum computer can possess. It amounts to finding the unknown period a of a function on n -bit integers that is “periodic” under bitwise modulo-2 addition. A more difficult, but much more natural problem is to find the period r of a function f on the integers that is periodic under ordinary addition, satisfying f(x) = f(y) for distinct x and y if and only if x and y differ by an integral multiple of r . Finding the period of such a periodic function turns out to be the key to factoring products of large prime numbers, a mathematically natural problem with quite practical applications.
Abstract This chapter sets the background for the famous Shor algorithm that can allow a sufficiently powerful quantum computer to easily break the current classical RSA encryption method. The RSA algorithm relies on the impossibility of even the most powerful classical computers to factor large numbers in any practical length of time. Before going through the details of the RSA encryption method, the number theory of the modulus or mod function is explained with many examples including exponential ones. The connection between factoring and the periodicity of mod functions is emphasized because it is needed for the RSA and Shor algorithms. The in-depth explanation of the RSA algorithm makes use of number theory to explain how the encryption key can be made public while other information is kept secret to ensure secure communication.
A quantum computer is a digital computer capable of exploiting quantum coherence among the physical two-state systems that store the binary arithmetic information. To factor an integer is to find its (unique) expression as a product of prime numbers. The most impressive, most important, and best-known thing a quantum computer can do is to factor with spectacular efficiency the product of two enormous prime numbers. But what on earth can quantum mechanics have to do with factoring? This question bothered me for four years, from the time I heard about the discovery that a quantum computer was spectacularly good at factoring until I finally took the trouble to find out how it was done. The answer, you will be relieved—but, if you're like me, also a little disappointed—to learn, is that quantum mechanics has nothing at all directly to do with factoring. But it does have a lot to do with waves. Many important waves are periodic, so it is not very surprising that quantum mechanics might be useful in efficiently revealing features associated with periodicity. Quantum mechanics is connected to factoring through periodicity. It turns out, for purely arithmetic reasons having nothing to do with quantum mechanics, that if we have an efficient way to find the period of a periodic function, then, as we shall see below, we can easily factor the product of two enormous prime numbers. And a quantum computer provides an extremely efficient way to find periods. All of the above is of considerable practical importance, because the great difficulty in factoring such a product—where the two enormous prime numbers are typically each several hundred digits long—is the basis for the security of the most widely used encryption scheme (called RSA [1] encryption) for protecting private information sent over the internet. In 1994 Peter Shor discovered [2] that a quantum computer would be super-efficient at period finding and thereby pose a potential threat to innumerable secrets. Whence the explosion of interest in developing quantum computation. The threat is only potential because no quantum computer capable of anything like serious period finding currently exists. I suspect the emphasis has been put on factoring rather than period finding because factoring is more famously associated with RSA code breaking, although, as it happens, period finding can be used directly to crack the RSA code, without any need for a detour into factoring.
One of the most well known mathematically hard problems in number theory is the integer factorization problem, roughly stated that decomposition of a composite number into its prime factors. In modern cryptography, RSA encryption algorithm whose security is based on integer factorization problem is highly practical, widespread and up to date no classical algorithm having polynomial running time for the factorization of large numbers is known. In 1994, Peter Shor proposed an efficient algorithm on quantum computer. In this paper, we  mention about the fundamentals of  Shor's quantum algorithm illustrating a concrete example.
This paper explores a quantum-inspired technique for factoring semi-prime integers, a problem central to the security of RSA cryptography. While Shor's algorithm offers a polynomial-time solution on a quantum computer, posing a significant threat to RSA, current quantum hardware limitations hinder its practical implementation. This study simulates Shor's algorithm classically, replacing the quantum period-finding subroutine—the source of the quantum speedup—with a classical method to analyze its performance. The experiments factored semi-primes ranging from 2 to 8 digits, demonstrating that while the technique works, the execution time increases exponentially with the size of the number, escalating from seconds for small integers to an order of minutes for an 8-digit number. This highlights the inefficiency of classical period-finding compared to the quantum approach. The results validate the theoretical framework of Shor's algorithm but underscore the impracticality of classical simulations for cryptographic-scale integers. This work also explores the necessity of advancing quantum computing to realize scalable factorization while classical methods remain confined to pedagogical or small-scale applications. The study emphasizes the urgency of hybrid quantum-classical optimizations and reinforces Shor's algorithm as pivotal for future cryptographic vulnerability assessments and quantum-ready solutions.
The nature of the search Suppose you know that exactly one n -bit integer satisfies a certain condition, and suppose you have a black-boxed subroutine that acts on the N = 2 n different n -bit integers, outputting 1 if the integer satisfies the condition and 0 otherwise. In the absence of any other information, to find the special integer you can do no better with a classical computer than to apply the subroutine repeatedly to different random numbers until you hit on the special one. If you apply it to M different integers the probability of your finding the special number is M/N . You must test ½ N different integers to have a 50% chance of success. If, however, you have a quantum computer with a subroutine that performs such a test, then you can find the special integer with a probability that is very close to 1 when N is large, using a method that calls the subroutine a number of times no greater than. This very general capability of quantum computers was discovered by Lov Grover, and goes under the name of Grover's search algorithm . Shor's period-finding algorithm and Grover's search algorithm, together with their various modifications and extensions, constitute the two masterpieces of quantum-computational software. One can think of Grover's black-boxed subroutine in various ways. The subroutine might perform a mathematical calculation to determine whether the input integer is the special one. Here is a simple example.
We provide a pedagogical presentation of Shor's factoring algorithm, which is a quantum algorithm for factoring very large numbers (of order of hundreds to thousands of bits) in polynomial time. In contrast, all known classical algorithms for the factoring problem take an exponential time to factor such large numbers. Shor's algorithm therefore has profound implication for public-key encryption such as RSA and Diffie–Hellman key exchange. We assume no prior knowledge of Shor's algorithm beyond a basic familiarity with the circuit model of quantum computing. Shor's algorithm contains a number of moving parts, and can be rather daunting at first. The literature is replete with derivations and expositions of Shor's algorithm, but most of them seem to be lacking in essential details, and none of them provide a pedagogical presentation. They require a thicket of appendices and assume a knowledge of quantum algorithms and classical mathematics with which the reader might not be familiar. We therefore start with first principle derivations of the quantum Fourier transform (QFT) and quantum phase estimation (QPE), which are the essential building blocks of Shor's algorithm. We then go on to develop the theory of modular exponentiation (ME) operators, one of the fundamental components of Shor's algorithm, and the place where most of the quantum resources are deployed. We also delve into the number theory that establishes the link between factorization and the period of the modular exponential function. We then apply the QPE algorithm to obtain Shor's factoring algorithm. We also discuss the post-quantum processing and the method of continued fractions, which is used to extract the exact period of the modular exponential function from the approximately measured phase angles of the ME operator. The manuscript then moves on to a series of examples. We first verify the formalism by factoring N=15, the smallest number accessible to Shor's algorithm. We then proceed to factor larger integers, developing a systematic procedure that will find the ME operators for any semi-prime N=p×q (where q and p are prime). Finally, we factor the composite numbers N=21, 33, 35, 143, 247 using the Qiskit simulator. It is observed that the ME operators are somewhat forgiving, and truncated approximate forms are able to extract factors just as well as the exact operators. This is because the method of continued fractions only requires an approximate phase value for its input, which suggests that implementing Shor's algorithm might not be as difficult as first suspected. Quanta 2023; 12: 41–130.