The
majority of scholars think that Shor’s algorithm is a unique and
powerful quantum algorithm for the cryptanalysis of RSA. Therefore, the
current state of the post quantum cryptography (constructing post
quantum public key cryptosystems that would be secure against quantum
computers) research has exclusively studied the potential threats to
Shor’s algorithm.
The security of the RSA cryptography system is
based on the high complexity and security of the integer factorization
problem. Shor’s algorithm1 can attack the RSA cryptosystem in polynomial time. There have been many simulations about quantum computers2 and attempts to implement Shor’s algorithm on quantum computing hardware3,4,5,6,7.
Researchers have developed classic emulators based on reconfigurable
technology, enabling efficient simulation of various quantum algorithms
and circuits, and they have the potential to simulate number of quits
than software based simulators2.
Nuclear Magnetic Resonance (NMR) is the technology that we have for the
implementation of small quantum computers. Vandersypen et al.8 and Lu et al.9 applied Shor’s algorithm to factor the integer 15 via NMR and an optical quantum computer, respectively. Enrique et al. implemented a scalable version of Shor’s algorithm via the iterative approach to factor 2110. Based on the characteristics of the Fermat number11, Geller et al. used 8 qubits to successfully factor 51 and 85.
The
real physical realizations of Shor’s algorithm cannot breakthrough the
scale of factorization beyond 100 for the moment, as shown by
principle-of-proof simulations and experiments12.
Actually, the number of qubits for performing Shor’s algorithm to
factor an n-bit integer still remains approximately 2n qubits13.
Shor’s algorithm requires not only a large number of qubits but also a
general-purpose quantum computer with high precision. Achieving
practical quantum applications will take longer, perhaps much longer, as
said by John Martinis, the physicist who leads Google’s efforts14, and Science15 commented that it will be years before code-cracking is achieved.
Matthias Troyer said that “code-cracking and searching databases, are
not good enough”16.
The newest report by the National Academies of Sciences, “Quantum
Computing: Progress and Prospects”, stated that the current state of
quantum computing and progress is highly unlikely to be able to attack
RSA 2048 within the next decade. Therefore, in the case where Shor’s
algorithm cannot be practically applied, it is of great importance to
find a more generalized and scalable way with the potential for
practical attacks on integers while using fewer quantum resources.
The quantum adiabatic theorem was first introduced in 2001 by Burges17. The main idea is to construct the corresponding Hamiltonian based on the multiplication table18,19,20. Xu, N. et al. realized an experimental realization of factoring 143 via an NMR quantum processor18. By further employing the properties of some class of large integers, Dattani et al. factored the integer 56153 with only 4 qubits19 and Li et al. factored 291311 with 3 qubits by combining the theoretical reductions and Hamiltonian transformation20.
However, these methods are only available for integers with special
properties and cannot be generalized to large integers, which can merely
be seen as a principle-of-proof experiment. In adiabatic quantum
computation, some researchers21,22 realize the reduction of multiple terms to quadratic terms without
introducing auxiliary qubits, but too many restrictions increase the
complexity of the model. Thus, it is of great importance to find a more
generalized way to conduct prime factorization.
D-Wave quantum
computer is based on the quantum annealing principle. It has been widely
used in sampling, optimization, machine learning, etc.23,24,25,26,27,28,29. Raouf Dridi et al.27 applied the computational algebraic geometry to transform the
factorization problem to the QUBO model to be solved by the cell
algorithm and the column algorithm respectively. The experiments via the
D-Wave 2X show that dividing the columns to construct the Hamiltonian
that is to be solved via quantum annealing can factor the integer
200099. Jiang et al.30 constructed a general model to factor the integer 376289 with 94
logical qubits via a D-Wave 2000Q System. However, it is still limited
by the hardware restrictions of the quantum machine31. Peng et al.32 further promoted Jiang et al.’s work by reducing the number of qubits according to the constraints of
the target values and the number of carrying numbers involved in the
multiplication table. XinMei Wang33 commented that Peng et al.32 supported the optimistic potential of a D-Wave quantum computer for
deciphering the RSA cryptosystem in the future. In 2019, Lockheed
Martin’s Warren, R.H.34 proposed a chain factorization algorithm to factor all integers within
1000 by setting the upper limit of the factorability. However, this
model uses more logical qubits, which means there is qubit redundancy.
with Shor’s algorithm, the work of Shuxian Jianget al.
(376289), and the maximum scale (7781) of Lockheed Martin’s Warren,
R.H. It supports the optimistic potential of the quantum annealing
algorithm and D-Wave quantum computer for deciphering the RSA
cryptosystem in the future. The D-Wave provides a new (second) way,
which is a completely different way than Shor’s algorithm, and may be
closer to cracking practical RSA codes than a general-purpose quantum
computer using Shor’s algorithm.
The rest of this paper is
organized as follows. First, we describe the basic ideas of quantum
annealing and the multiplication table for factorization. Second, we
compare the methods and results with those of Shor’s algorithm, NMR, and
integer factorization by a D-Wave. Third, we illustrate the optimistic
potential of the quantum annealing algorithm and D-Wave quantum computer
for deciphering the RSA cryptosystem. Finally, we point out that post
quantum cryptography should not only consider the potential attacks from
universal quantum algorithms, such as Shor’s algorithm but also
consider real attacks from a D-Wave quantum computer in the near future.
Quantum
annealing, as the core algorithm of a D-Wave quantum computer, has the
potential to approach or even achieve the global optima in an
exponential solution space, corresponding to the quantum evolution
towards the ground state of the Hamiltonian problem24.
The quantum processing units (QPUs), which are the core components for
performing quantum annealing, are designed to solve quadratic
unconstrained binary optimization (QUBO) problems25,26, where each qubit represents a variable, and the couplers between qubits represent the costs associated with qubit pairs.
The objective form of the QUBO that the QPU is designed to minimize is as follows:
real-valued matrix characterizing the relationship between the
variables. Thus, any problem given in such a form can be solved by the
D-Wave quantum annealer.
in the equations are binary.
. Adding each column leads to the following equations:
. By applying similar judgments, we can get a simplified set of equations, as follows:
. The objective function is defined as the sum of squares of the three equations. It can be given as follows:
represent the solution to the factorization problem.
are the carried bits from the previous column. All the variables have a value of 0 or 1. Shuxian Jianget al.30 divided the multiplication table into 4 columns (from right to left are
column 1, column 2, column 3, and column 4), as shown in Table 2.
The equation for each column is as follows:
Equations (13)–(15) are further simplified to the following
We define the objective function as the sum of the squares of all the columns as follows:
are 0 or 1), Eq. (19) is expanded and simplified, and the polynomials of more than 2-local term are replaced by the following equation30 (for more information about factorization refer to ref. 30):
, Eq. (19) finally simplifies to the following:
variables. The final model can be given as follows:
Then, the model given in Eqs. (22)-(23) can be directly solved by the D-Wave machine or the qbsolv software environment can be used to perform the quantum annealing
algorithm. In this way, the model for the factorization can be
generalized to any integer. Furthermore, it is a scalable model for any
large integer in theory and it is a real potential application for
D-Wave.
In the case when the factorization increases in Shuxian Jiang et al.30,
the growing number of qubits and the huge coupler strength in the
theoretical quantum model will result in a nontrivial impact on the QA
precision in the real D-Wave machine. Especially for limit-connectivity
hardware, too high of costs regarding the number of qubits greatly
limits the generalization and scalability of the factorization in large
cases. In addition, the reduction from the 3-local term to the 2-local
term increases the coupler strength and local field coefficient,
especially for large integers.
This paper proposes a new model
that addresses two perspectives: saving qubit resources and simplifying
the quantum model to factor larger integers with fewer qubits. Using
this way, we can reduce the number of involved qubits and the range of
the coupler strength between qubits without any loss of generalization.
It is expected to solve larger integers with fewer qubits so that the
D-Wave can provide a more powerful capacity to factor large integers in
the future.
In Ising model in ref. 30,
they did not consider the restrictions on the final model derived from
the target values, which may cause too many carries to be involved in
the model. Here we introduce the constraints derived from the difference
between the target values and the maximal output of each column. The
carries involved can be directly removed in some cases.
,
respectively. Finally, the factorization of 143 only requires 5 qubits,
a significant improvement compared to the original model with 12 qubits30.
Based on the optimization of ref. 32, the final parameters of the model are as follows:
Actually, the method of ref. 32 is designed to reduce the number of qubits, and thus the improvements
to the complexity of the model are limited. The main reason is that
there is a “2” in Eq. (20),
which leads to many high coupler strengths and local field coefficients
in the final Hamiltonian resulting in fragile quantum states.
Therefore, another optimization should be proposed to solve the above
problem without the loss of generalization and scalability.
As mentioned above, we mainly focus on the optimization of the model parameters. Jiang et al.30 a way to reduce the 3-local term to a 2-local term, which increased the
local field coefficient and coupler strength parameters, especially for
large integers. In the integer factorization problem based on quantum
annealing, the reduction of the model parameters is beneficial to
reducing the hardware requirements and the precision of quantum
annealing. To reduce the 3-local term to a 2-local term in the integer
factorization process, inspired by ref. 35, we optimize Eq. (20) of ref. 32 and form a new dimension reduction method from the 3-local term to 2-local term, as shown in Eq. (26)
holds.
). Take the first two rows of the Table 3 as an example for the following illustration.
.
The
dimension reduction method in this paper is not only applicable to the
integer 143, but it is also applicable to the case where the polynomial
of the objective function of any integer is greater than the quadratic
term, such as the factorization of the 20-bit integer 1028171. A
detailed analysis of the factorization is shown in the supplemental
material. The method is universal and extensible. We do the following
analysis. Assume that the objective function of the integer
factorization is as follows:
are polynomials composed of two-local terms and 3-local terms, respectively. Then, it can be transformed based on Eq. (27) as follows:
.
is used again to obtain the following:
Finally, the final 4-local term is reduced to a 2-local term as follows:
In this way, the minimum value of the
3-local term and 4-local term can be transformed to a simpler polynomial
with simple connections characterized by quadratic terms. The coupler
strength and local field coefficient can be reduced further and the
theoretical model can work better to describe the original problem with
high precision in the simulations.
All the simulations are performed via MATLAB 2014 and Python 3.6 with the qbsolv software environment (provided by D-Wave), which can successfully
factor 1028171. For more information about the integer 1028171, please
refer to the supplemental material. Table S1 of the supplemental material shows the factorization of integer 1028171. The qbsolv software environment is a decomposition solver that finds the minimum
value given by a QUBO problem by splitting it into pieces that are
solved either via a D-Wave system or a classical tabu solver. For more
information about the tool, please refer to http://github.com/dwavesystems/qbsolv.
The simulations are based on the combination of the two optimizations, which can be divided into the following steps.
.
.
.
.
.
.
This algorithm realizes the hybrid computing structure of quantum and
classical, and exerts the optimal computing power of the distributed
processing problem of both quantum and classical.
Take the factorization on 143 as an example, the final input is given as follows:
Due
to the accuracy of the error correcting and quantum manipulation
technique, the short-time decoherence, the susceptibility to various
noises, etc., the progress of universal quantum devices is slow, which
limits the development and practical applications of Shor’s algorithm.
The maximum factorization ability of Shor’s algorithm is currently the
integer 85. However, D-Wave quantum computers have rapidly developed,
and the number of qubits has been doubling every other year. Based on
the quantum annealing method, we factor the integer 1028171. Although
our method requires more qubits than Shor’s algorithm to factor the same
integer, Shor’s algorithm is highly dependent on high-precision
hardware. Actually, Science, Nature, and the National Academies of
Sciences (NAS) are consistent in that it will be years before
code-cracking by a universal quantum computer is achieved.
The
existing works based on NMR utilize the special properties of certain
primes to perform principle-of-proof experiments. The maximum integer of
factorization based on an NMR platform is 291311. The integer
factorization method based on the NMR platform is not applicable to all
integers and is not universal and scalable.
if it can run Shor’s algorithm.
Table 4 shows the parameter values of Jiang et al.’s method30 for integer factorization (please note that all the data of ref. 30 are given via our simulations, just for reference). Table 5 shows the factorization results of our method for the integers 143,
59989, 376289, 1005973 and 1028171. It can be seen from Table 5 that our method can successfully factor the integers 1005973 and 1028171. Jiang et al.’s method can factor up to the integer 376289, whereas ours method can
achieve the factorization of the integer 1028171, making it superior to
the results obtained by any other physical implementations. The
reduction of the qubits can reduce the hardware requirements of the
quantum annealing machine and further boost the accuracy of quantum
annealing, which has great practical significance. In the case of the
hardware restrictions of the quantum machine, our goal is to achieve the
factorization of a larger-scale integer 1028171 with fewer qubits,
which is the best integer factorization result solved by the quantum
algorithm.
Tables 4 and 5 show that the optimization model can further reduce the weight of the
qubits and the range of the coupler strength involved in the problem
model, which can advance the large-scale integers in the D-Wave machine.
.
, reduces the ranges of the coefficients of Ising model, and uses far fewer qubits than Warren, R.H.34.
The reduction of the parameter value ranges can reduce the demand for
qubit coupling strength, make the physical qubit flip unified,
effectively increase the possibility of quantum annealing reaching the
global optimal, and improve the success rate of integer factorization.
In the case of insufficient precision and the immature development of
existing quantum devices, the proposed method can effectively reduce the
hardware requirements and improve the success rate of deciphering RSA
via quantum annealing. In addition, our method successfully factors all
integers within 10000, whereas Warren, R.H.34 traversed and factored all integers within 1000.
The
integer factorization method based on the NMR platform uses the special
properties of integers, and the method is not universal. The quantum
annealing method based on a D-Wave quantum computer for integer
factorization is limited by the hardware connection limitations of the
D-Wave quantum computer, which are not enough to apply the method to
larger integers.
of Ising model, which can effectively improve the upper bounds of the decomposed integers.
From
the perspective of practical code-cracking and generalization, we
proposed a new general quantum spin model, which is a novel and further
scalable way to conduct prime factorization with few qubits and QA.
Lockheed Martin’s Warren, R.H.34 traversed and factored all integers within 1000. Our method
successfully factors all integers within 10000 and has obtained the best
index (20-bit integers (1028171)) of quantum computing for factoring
integers. The result exceeded the work of Shuxian Jiang et al. (factor up to 376289)30 and Warren, R.H.34 (factor up to 7781).
is the number to be factored. In terms of theoretical complexity, the
complexity of Shor’s algorithm is better than the algorithm proposed in
this paper. In terms of factoring the maximum integer index, due to the
slow development of general quantum devices, Shor’s algorithm currently
factor up to integer 85, and the maximum number that can be factored by
the integer factorization method based on quantum annealing of our
method is integer 1028171. To achieve the factorization of the integer
1028171, Shor’s algorithm requires more than 40 universal qubits, and
the number of qubits and the precision of the quantum bits are far
beyond the current hardware level. Therefore, through the analysis of
the factored maximum integer index, the integer factorization method
based on quantum annealing has more realistic attack power than Shor’s
algorithm, which is expected to result in more advantages when using the
real D-Wave quantum computing platform.
The current state of post
quantum cryptography research exclusively referred to the potential
threatens of Shor’s algorithm. From the above analysis, it can be seen
that quantum annealing (the core principle of the D-Wave quantum
computer) for prime factorization may be closer to cracking practical
RSA codes than Shor’s algorithm. Furthermore, the experts of the post
quantum cryptography international standard organization (in the 6th
ETSI/IQC Quantum Safe Workshop) expressed great interest in our method.
They analyzed the reason for neglecting the attacks from the D-Wave
machine in post quantum cryptography research since the D-Wave
computers, which have been purchased by Lockheed Martin, Google, etc.,
have been initially used for image processing, machine learning,
combinatorial optimization, software verification, etc. Thus, post
quantum cryptography research should further consider the potential of
the D-Wave quantum computer for deciphering the RSA cryptosystem in
future.
The structure of large integers will have an impact on the
complexity of the model. Future research work will further study the
effects of the structure of large integers on the model and the
scalability of the integer factorization when using a D-Wave quantum
computer to achieve larger-scale integer factorization.
All other data used in this study are available from the corresponding authors upon reasonable request.
Shor P W. Algorithms for quantum computation: Discrete logarithms and factoring. Proceedings 35th annual symposium on foundations of computer science 1, 124–134 (Murray Hill, NJ, USA, 1994).
Mahmud,
N., El-Araby, E. & Caliga, D. Scaling reconfigurable emulation of
quantum algorithms at high precision and high throughput. Quantum Engineering 1, e19 (2019).
Lucero, E. et al. Computing prime factors with a josephson phase qubit quantum processor. Nat. Phys. 8, 719–723 (2012).
Politi, A., Matthews, J. C. & O’brien, J. L. Shoras quantum factoring algorithm on a photonic chip. Science 325, 1221–1221 (2009).
Lanyon, B. et al. Experimental demonstration of a compiled version of shor’s algorithm with quantum entanglement. Phys. Rev. Lett. 99, 250505 (2007).
Monz, T. et al. Realization of a scalable shor algorithm. Science 351, 1068–1070 (2016).
Dang, A., Hill, C. D. & Hollenberg, L. C. L. Optimising Matrix Product State Simulations of Shor’s Algorithm, arXiv:1712.07311v2 (2017).
Vandersypen, L. M. et al. Experimental realization of shoras quantum factoring algorithm using nuclear magnetic resonance. Nature 414, 883–887 (2001).
Lu,
C. Y., Browne, D. E., Yang, T. & Pan, J. W. Demonstration of a
compiled version of shor’s quantum factoring algorithm using photonic
qubits. Phys. Rev. Lett. 99, 250504 (2007).
Martíin-López, E. et al. Experimental realization of shor’s quantum factoring algorithm using qubit recycling. Nat. Photonics 6, 773–776 (2012).
Geller, M. R. & Zhou, Z. Factoring 51 and 85 with 8 qubits. Sci. reports 3 (2013).
Smolin, J. A., Smith, G. & Vargo, A. Oversimplifying quantum factoring. Nature 499, 163–165 (2013).
Gidney, C. Factoring with n + 2 clean qubits and n-1 dirty qubits, arXiv:1706.07884 (2017).
Adrian, C. DOE pushes for useful quantum computing. Science 359, 141–142 (2018).
What’s coming up in 2018. Science 359, 10–12 (2018).
Gibney, E. Quantum Computer Quest. Nature 516, 24 (2014).
Farhi, E. et al. A quantum adiabatic evolution algorithm applied to random instances of an np-complete problem. Science 292, 472–475 (2001).
Xu, N. et al. Quantum factorization of 143 on a dipolar-coupling nuclear magnetic resonance system. Phys. Rev. Lett. 108, 130501 (2012).
Dattani, N. S. & Bryans, N. Quantum factorization of 56153 with only 4 qubits. arXiv:1411.6758 (2014).
Li, Z. et al.
High-fidelity adiabatic quantum computation using the intrinsic
Hamiltonian of a spin system: Application to the experimental
factorization of 291311. arXiv:1706.08061 (2017).
Tanburn,
R., Okada, E. & Dattani, N. S. Reducing multi-qubit interactions in
adiabatic quantum computation without adding auxiliary qubits. part 1:
The “deduc-reduc” method and its application to quantum factorization of
numbers. arXiv:1508.04816 (2015).
Okada,
E., Tanburn, R. & Dattani, N. S. Reducing multi-qubit interactions
in adiabatic quantum computation without adding auxiliary qubits. part
2: The “split-reduc” method and its application to quantum determination
of ramsey numbers. arXiv:1508.07190 (2015).
King, A. D. et al. Observation of topological phenomena in a programmable lattice of 1,800 qubits. Nature 560, 456–460 (2018).
Das, A. & Chakrabarti, B. K. Colloquium: Quantum annealing and analog quantum computation. Reviews of Modern Physics 80, 1061 (2008).
Neukart, F. et al. Traffic flow optimization using a quantum annealer. Frontiers in ICT 4, 29 (2017).
Perdomo-Ortiz,
A., Dickson, N., Drew-Brook, M., Rose, G. & Aspuru-Guzik, A.
Finding low-energy conformations of lattice protein models by quantum
annealing. Sci. Reports 2, 571 (2012).
Dridi, R. & Alghassi, H. Prime factorization using quantum annealing and computational algebraic geometry. Sci. Reports 7 (2017).
Hu, F., Wang, B., Wang, N. & Wang, C. Quantum machine learning with D-wave quantum computer. Quantum Engineering 1, e12 (2019).
Wang,
B., Zhang, H. F., Wang, H. & From, C. Evolutionary Cryptography to
Quantum Artificial Intelligent Cryptography (in Chinese). Journal of Computer Research and Development 56, 2112–2134 (2019).
Jiang, S., Britt, K. A., McCaskey, A. J., Humble, T. S. & Kais, S. Quantum Annealing for Prime Factorization. Sci. Reports 8, 17667 (2018).
Hu, F. et al. Quantum computing cryptography: Unveiling cryptographic Boolean functions with quantum annealing. arXiv: 1806.08706 (2018).
Peng, W. et al. Factoring larger integers with fewer qubits via quantum annealing with optimized parameters. SCIENCE CHINA Physics, Mechanics & Astronomy. 62, 60311 (2019).
Wang, X. Quest towards “factoring larger integers with commercial D-Wave quantum annealing machines”. SCIENCE CHINA Physics, Mechanics & Astronomy. 62, 960331 (2019).
Warren, R. H. Factoring on a quantum annealing computer. Quantum Information and Computation 19, 0252–0261 (2019).
Boros, E. & Hammer, P. L. Pseudo-boolean optimization. Discret. applied mathematics 123, 155–225 (2002).
This
work was supported by the Key Program of National Natural Science
Foundation of China (Grant No. 61332019), the National Natural Science
Foundation of China (Grant Nos. 61572304, 61272096), Open Research Fund
of State Key Laboratory of Cryptology, and the grant of the Special Zone
Project of National Defense Innovation.
Key
laboratory of Specialty Fiber Optics and Optical Access Networks, Joint
International Research Laboratory of Specialty Fiber Optics and
Advanced Communication, Shanghai Institute for Advanced Communication
and Data Science, Shanghai University, Shanghai, 200444, China
Baonan Wang, Feng Hu, Haonan Yao & Chao Wang
State Key Laboratory of Cryptology, P. O. Box 5159, Beijing, 100878, China
Baonan Wang, Feng Hu, Haonan Yao & Chao Wang
Center for Quantum Computing, Peng Cheng Laboratory, Shenzhen, 518000, China
Chao Wang
B.W.
designed the algorithm. B.W. and H.Y. conceived the experiments and
analysed the results. B.W., F.H., H.Y. and C.W. wrote and reviewed the
manuscript.
Correspondence to Chao Wang.
The authors declare no competing interests.
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.