Ciphertext decryption method based on quantum computing and related device
Through quantum computing technology, the public key and plaintext parameters of the ciphertext are converted into square matrix to build the target quantum circuit, which solves the problem of slow ciphertext cracking speed in traditional cryptography, realizes rapid decryption, and significantly improves the efficiency of ciphertext cracking.
Patent Information
- Application Number
- CN202310618875.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-25
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2043-05-25
AI Technical Summary
It is difficult for the prior art to quickly crack ciphertexts based on discrete logarithmic encryption, especially in the field of traditional cryptography, where the cracking speed of ciphertexts is slow and cannot meet the needs of modern computing.
Through quantum computing technology, the public key and plaintext parameters corresponding to the ciphertext are converted into square matrix, the target quantum circuit is constructed, and the private key is determined using the superposition and entanglement characteristics of quantum computing, thereby achieving rapid decryption of the ciphertext.
The ciphertext cracking speed based on discrete logarithmic encryption has been significantly improved, and the time required to decompose binary numbers represented by 795 bits is shortened from more than 3,000 years to an acceptable level compared to the traditional number domain sieve method.
Smart Images

Figure CN119030695A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of quantum computing, and in particular to a ciphertext decryption method and related devices based on quantum computing. Background Art
[0002] Quantum computers are physical devices that follow the laws of quantum mechanics to perform high-speed mathematical and logical operations, store and process quantum information. When a device processes and calculates quantum information and runs quantum algorithms, it is a quantum computer. Quantum computers have become a key technology under research because they can process mathematical problems more efficiently than ordinary computers. For example, they can speed up the time it takes to crack a key from hundreds of years to just a few hours.
[0003] Discrete logarithms are regarded as one of the three foundations of contemporary cryptography. They rely on the difficulty of calculating discrete exponents over finite fields to ensure their security. The discrete logarithm problem is: given a prime number p and a positive integer b, knowing that b = a x (mod p) to solve for x. In the encryption method based on discrete logarithms, x is the private key, a is the public key, and the plaintext parameter is b. Given a and b, it is difficult to solve for x. Even if the most efficient number field sieve method is used to decompose the binary number represented by 795 bits, it will take more than 3,000 years. The ELGamal encryption algorithm, DSA digital signature scheme, ECDSA signature algorithm, SM3 signature algorithm, identity-based cryptographic algorithm (IBE, IBS), SM9 identification cryptographic algorithm, etc. are all based on the assumption of the difficulty of discrete logarithm problems. Therefore, how to achieve rapid cracking of ciphertext based on discrete logarithm encryption in the field of traditional cryptography based on quantum computing is a difficult problem. Summary of the invention
[0004] The purpose of the present invention is to provide a ciphertext decryption method and related devices based on quantum computing, so as to solve the ciphertext cracking based on discrete logarithm encryption that has troubled the traditional cryptography field through quantum computing, and improve the speed of ciphertext cracking.
[0005] An embodiment of the present invention provides a ciphertext decryption method based on quantum computing, which is applied to ciphertext based on discrete logarithm encryption, and the method includes:
[0006] Obtain the public key and plaintext parameters corresponding to the ciphertext, both of which belong to the finite field GF(2 t ) in the element;
[0007] Determine the square matrix corresponding to the public key and the plaintext parameters;
[0008] Constructing a target quantum circuit based on the square matrix;
[0009] Determining a private key corresponding to the ciphertext based on the operation result of the target quantum circuit;
[0010] The ciphertext is decrypted based on the private key.
[0011] Optionally, constructing a target quantum circuit based on the square matrix includes:
[0012] Performing a square operation on the square matrix corresponding to the public key a preset number of times to obtain a plurality of first square matrices; and performing a square operation on the square matrix corresponding to the plaintext parameter a preset number of times to obtain a plurality of second square matrices;
[0013] Determine a square matrix corresponding to the public key and a plurality of first modulus polynomial exponential operation quantum circuits corresponding to the first square matrix, and a square matrix corresponding to the plaintext parameter and a plurality of second modulus polynomial exponential operation quantum circuits corresponding to the second square matrix;
[0014] The quantum Fourier transform circuit, the first modulus polynomial exponential operation quantum circuit, the second modulus polynomial exponential operation quantum circuit and the quantum inverse Fourier transform circuit are sequentially cascaded to obtain a target quantum circuit.
[0015] Optionally, the quantum Fourier transform circuit includes an H gate acting on a first auxiliary bit and a second auxiliary bit, the first modulus polynomial exponential operation quantum circuit is controlled by the second auxiliary bit, the second modulus polynomial exponential operation quantum circuit is controlled by the first auxiliary bit, and the quantum inverse Fourier transform circuit includes quantum inverse Fourier transform modules each acting on the first auxiliary bit and the second auxiliary bit.
[0016] Optionally, the determining of the private key corresponding to the ciphertext based on the operation result of the target quantum circuit, wherein the operation result of the target quantum circuit includes a good number pair, includes:
[0017] Determine a first good number vector based on one of the good number pairs, and determine a second good number vector based on the other of the good number pairs;
[0018] Determine the inverse element of each element in the second good number vector to obtain a third good number vector;
[0019] determining a tensor product of the first good number vector and the third good number vector;
[0020] A private key corresponding to the ciphertext is determined from the tensor product.
[0021] Optionally, determining the first good number vector based on one of the good number pairs includes:
[0022] One of the good number pairs is extended to both sides to obtain a first good number vector.
[0023] Optionally, the determining of the square matrix corresponding to the public key and the first modulus polynomial exponential operation quantum circuits corresponding to the plurality of the first square matrices includes:
[0024] Perform LUP decomposition on the square matrix corresponding to the public key and each of the first square matrices to obtain L-type, U-type and P-type matrices;
[0025] Determine the quantum circuits corresponding to the L-type and U-type matrices based on the CNOT gate, and determine the quantum circuit corresponding to the P-type matrix based on the SWAP gate;
[0026] Applying quantum logic gates corresponding to each of the P-type matrices and the U-type and L-type matrices corresponding to the P-type matrices to the quantum bits in sequence to obtain a square matrix corresponding to the public key or a quantum circuit corresponding to each of the first square matrixes;
[0027] The square matrix corresponding to the public key and the quantum circuits corresponding to the first square matrixes are sequentially cascaded to obtain a first modular polynomial exponential operation quantum circuit.
[0028] Optionally, determining the quantum circuit corresponding to the P-type matrix based on the SWAP gate includes:
[0029] Determine the non-zero elements a in the P-type matrix except the diagonal mn ;
[0030] If m is less than n, the SWAP gate is applied to the mth and nth qubits;
[0031] If m is greater than n, determine the non-zero element a m′n′ , and apply the SWAP gate to the mth and nth ′ On qubits, m ′ is less than m, and n ′ greater than m;
[0032] If m is equal to n or n ′ , no action is performed;
[0033] The quantum circuit corresponding to the P-type matrix is determined.
[0034] Another embodiment of the present invention provides a ciphertext decryption device based on quantum computing, which is applied to ciphertext based on discrete logarithm encryption, and the device includes:
[0035] An acquisition unit is used to acquire a public key and a plaintext parameter corresponding to the ciphertext, wherein the public key and the plaintext parameter both belong to a finite field GF(2 t ) in the element;
[0036] A determination unit, used to determine the square matrix corresponding to the public key and the plaintext parameter;
[0037] A construction unit, used for constructing a target quantum circuit based on the square matrix;
[0038] The determining unit is further used to determine the private key corresponding to the ciphertext based on the operation result of the target quantum circuit;
[0039] A decryption unit is used to decrypt the ciphertext based on the private key.
[0040] Yet another embodiment of the present invention provides a storage medium, wherein the storage medium stores a computer program, wherein the computer program is configured to execute any of the above methods when running.
[0041] Yet another embodiment of the present invention provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute any of the above methods.
[0042] It can be seen that the present invention converts the public key and plaintext parameters corresponding to the obtained ciphertext into a square matrix. The ciphertext is a ciphertext based on discrete logarithm encryption. The public key and plaintext parameters belong to the finite field GF(2 t ) elements; then, based on the square matrix, a target quantum circuit is constructed and operated, the private key is determined by the operation result of the target quantum circuit, and the ciphertext is decrypted by the private key; the prior art requires more than 3,000 years to decompose a binary number represented by 795 bits using the most efficient number field sieve method. Compared with the prior art, the present invention greatly realizes the ciphertext cracking speed based on discrete logarithm encryption through the superposition and entanglement characteristics of quantum computing. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A network block diagram of a ciphertext decryption system based on quantum computing provided by an embodiment of the present invention;
[0044] Figure 2 A schematic diagram of a flow chart of a ciphertext decryption method based on quantum computing provided in an embodiment of the present invention;
[0045] Figure 3 A schematic diagram of the structure of a quantum circuit corresponding to an L-type matrix provided in an embodiment of the present invention;
[0046] Figure 4 A schematic diagram of the structure of a quantum circuit corresponding to a P-type matrix provided in an embodiment of the present invention;
[0047] Figure 5 A schematic diagram of the structure of a quantum circuit corresponding to another P-type matrix provided in an embodiment of the present invention;
[0048] Figure 6A schematic diagram of the structure of a target quantum circuit provided by an embodiment of the present invention;
[0049] Figure 7 A schematic diagram of the structure of a ciphertext decryption device based on quantum computing provided by an embodiment of the present invention;
[0050] Figure 8 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0051] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, but should not be construed as limiting the present invention.
[0052] Figure 1 1 is a network block diagram of a ciphertext decryption system based on quantum computing provided by an embodiment of the present invention. The ciphertext decryption system based on quantum computing may include a network 110, a server 120, a wireless device 130, a client 140, a storage 150, a classical computing unit 160, a quantum computing unit 170, and may also include additional memories, classical processors, quantum processors, and other devices not shown.
[0053] Network 110 is a medium used to provide communication links between various devices and computers connected together in a quantum computing-based ciphertext decryption system, including but not limited to the Internet, corporate intranets, local area networks, mobile communication networks and combinations thereof. The connection method can be wired, wireless communication links or optical fiber cables, etc.
[0054] The server 120, the wireless device 130 and the client 140 are conventional data processing systems, which may contain data and applications or software tools for performing conventional computing processes. The client 140 may be a personal computer or a network computer, so the data may also be provided by the server 120. The wireless device 130 may be a smart phone, a tablet, a laptop, a smart wearable device, etc. The storage unit 150 may include a database 151, which may be configured to store data such as quantum bit parameters, quantum logic gate parameters, quantum circuits, quantum programs, etc.
[0055] The classical computing unit 160 (quantum computing unit 170) may include a classical processor 161 (quantum processor 171) for processing classical data (quantum data) and a memory 162 (memory 172) for storing classical data (quantum data). The classical data (quantum data) may be a boot file, an operating system image, and an application 163 (application 173). The application 163 (application 173) may be used to implement a quantum algorithm compiled by a ciphertext decryption method based on quantum computing provided in an embodiment of the present invention.
[0056] Any data or information stored or generated in the classical computing unit 160 (quantum computing unit 170) can also be configured to be stored or generated in another classical (quantum) processing system in a similar manner, and any application program executed by it can also be configured to be executed in another classical (quantum) processing system in a similar manner.
[0057] It should be noted that a true quantum computer is a hybrid structure, which includes at least Figure 1 There are two major parts in it: the classical computing unit 160, which is responsible for performing classical computing and control; the quantum computing unit 170, which is responsible for running quantum programs and thus realizing quantum computing.
[0058] The classical computing unit 160 and the quantum computing unit 170 may be integrated into one device or distributed in two different devices. For example, the first device including the classical computing unit 160 runs a classical computer operating system, on which quantum application development tools and services are provided, as well as storage and network services required for quantum applications. Users develop quantum programs through the quantum application development tools and services thereon, and send quantum programs to the second device including the quantum computing unit 170 through the network services thereon. The second device runs a quantum computer operating system, and the code of the quantum program is parsed and compiled into instructions that can be recognized and executed by the quantum processor 170 through the quantum computer operating system. The quantum processor 170 implements the quantum algorithm corresponding to the quantum program according to the instructions.
[0059] The computing unit of the classic processor 161 in the classic computing unit 160 is a CMOS tube based on a silicon chip. This computing unit is not limited by time and coherence, that is, this computing unit is not limited by the length of use and can be used at any time. In addition, in the silicon chip, the number of such computing units is also sufficient. At present, the number of computing units in a classic processor 161 is tens of thousands. The number of computing units is sufficient and the computing logic that can be selected by the CMOS tube is fixed, such as: AND logic. When calculating with the help of CMOS tubes, a large number of CMOS tubes are combined with limited logic functions to achieve the calculation effect.
[0060] The basic computing unit of the quantum processor 171 in the quantum computing unit 170 is a quantum bit, and the input of the quantum bit is limited by coherence and coherence time, that is, the quantum bit is limited by the use time and is not available at any time. Making full use of the quantum bit within the available use time of the quantum bit is a key problem in quantum computing. In addition, the number of quantum bits in a quantum computer is one of the representative indicators of the performance of a quantum computer. Each quantum bit realizes the computing function through the logical function configured on demand. In view of the limited number of quantum bits, the logical functions in the field of quantum computing are diverse, such as: Hadamard gate (Hadamard gate, H gate), Pauli-X gate (X gate), Pauli-Y gate (Y gate) Pauli-Z gate (Z gate), X gate, RY gate, RZ gate, CNOT gate, CR gate, iSWAP gate, Toffoli gate, etc. During quantum computing, it is necessary to use limited quantum bits combined with a variety of logical functions to achieve the computing effect.
[0061] Based on these differences, the design of CMOS tubes by classical logic functions and the design of quantum bits by quantum logic functions are significantly and essentially different. The design of CMOS tubes by classical logic functions does not need to consider the individuality of CMOS tubes. For example, the representation of CMOS tubes in silicon chips is the individual identification, position, and usable life of each CMOS tube. Therefore, the classical algorithm composed of classical logic functions only expresses the operational relationship of the algorithm, but does not express the algorithm's dependence on individual CMOS tubes.
[0062] When quantum logic functions act on qubits, the individuality of qubits needs to be considered, such as the individual identification of the qubit in the quantum chip, its position, its relationship with surrounding qubits, and the usable time of each qubit. Therefore, the quantum algorithm composed of quantum logic functions not only expresses the computational relationship of the algorithm, but also expresses the algorithm's dependence on individual qubits.
[0063] Exemplary:
[0064] Quantum algorithm 1: H1, H2, CNOT(1,3), H3, CNOT(2,3);
[0065] Quantum Algorithm 2: H1, H2, CNOT(1,2), H3, CNOT(2,3);
[0066] Among them, 1 / 2 / 3 represent three sequentially connected quantum bits Q1, Q2, Q3 or mutually connected quantum bits Q1, Q2, Q3 respectively;
[0067] An exemplary explanation of how quantum algorithms are affected by the coherence time of qubits is as follows:
[0068] Define the execution time of a single-qubit logic gate as t, and the execution time of a two-qubit logic gate acting on adjacent bits as 2t; then:
[0069] When Q1, Q2, and Q3 are interconnected, the calculation of quantum algorithm 1 takes 6t, which is divided into 4 time periods. The duration of each time period is t, 2t, t, and 2t respectively. The operations performed in each time period are: H1, H2; CNOT(1,3); H3; CNOT(2,3);
[0070] The calculation of quantum algorithm 1 takes 5t, which is divided into 3 time periods. The duration of each time period is t, 2t, and 2t respectively. The operations performed in each time period are: H1, H2, H3; CNOT(1,2); CNOT(2,3);
[0071] When Q1, Q2, and Q3 are connected in sequence, the quantum algorithm 1 needs to be equivalent to: H 1, H2; swap(1,2), CNOT(2,3), swap(1,2); H3; CNOT(2,3); the calculation of the equivalent quantum algorithm 1 requires 10t, which is divided into 4 time periods, and the duration of each time period is t, 6t, t, and 2t respectively. The operations performed in each time period are: H1, H2; swap(1,2), CNOT(2,3), swap(1,2); H3; CNOT(2,3).
[0072] Therefore, the design of the quantum logic function acting on the quantum bit (including the design of whether the quantum bit is used or not and the design of the efficiency of each quantum bit) is the key to improving the computing performance of the quantum computer, and requires special design. This is also the uniqueness of the quantum algorithm based on the quantum logic function, which is essentially and significantly different from the classical algorithm based on the classical logic function. The above-mentioned design for quantum bits is a technical problem that ordinary computing devices do not need to consider or face. The present invention proposes a ciphertext decryption method and related devices based on quantum computing, which solves the ciphertext cracking based on discrete logarithm encryption that has plagued the traditional cryptography field through quantum computing, and improves the speed of ciphertext cracking.
[0073] See also Figure 2 , Figure 2 A flowchart of a ciphertext decryption method based on quantum computing provided in an embodiment of the present invention is applied to ciphertext based on discrete logarithm encryption. The method includes:
[0074] Step 201: Obtain the public key and plaintext parameters corresponding to the ciphertext, both of which belong to the finite field GF(2 t ) in the element;
[0075] Among them, GF(2t ) are polynomials with coefficients of 0 and 1, or more precisely, the remainder class of polynomials, where the equivalence relation is characterized by modulo division (modulo division means dividing a polynomial and taking the remainder) an irreducible polynomial of degree t. An irreducible polynomial is one that has no other polynomials as factors except 1 and the polynomial itself in the current number field.
[0076] For current binary system computers, GF(2 t ) is particularly important. Many encryption standard algorithms use bytes as processing units. For example, each byte can be regarded as GF(2 8 )(k=8), each corresponding to a polynomial of degree not exceeding 7, a 7 a 6 a 5 a 4 a 3 a 2 a 1 a 0 =a 7 x 7 +a 6 x 6 +a 5 x 5 +a 4 x 4 +a 3 x 3 +a 2 x 2 +a 1 x 1 +a 0 .
[0077] Step 202: Determine the square matrix corresponding to the public key and the plaintext parameter;
[0078] Specifically, determining the square matrix corresponding to the public key includes:
[0079] Determining the degree corresponding to the highest term in a preset irreducible polynomial, wherein the preset irreducible polynomial is a modulus;
[0080] Determine a first modular multiplication result of the public key and each term of a lower degree than the highest term;
[0081] A square matrix corresponding to the public key is determined based on the first modular multiplication result.
[0082] For example, the preset irreducible polynomial is f=1+x+x 4 , the public key is the polynomial 1+x, and the first modular multiplication results of the public key and each term with a lower degree than the highest term are:
[0083] (1+x)×1modf=1+x
[0084] (1+x)×xmodf=x+x 2
[0085] (1+x)×x 2 modf=x 2 +x 3
[0086] (1+x)×x 3 modf=x 3 +x 4 modf=1+x+x 3
[0087] Translating the above expression into the language of linear algebra:
[0088] (1,1,0,0)×(1,0,0,0)=(1,1,0,0)
[0089] (1, 1, 0, 0) × (0, 1, 0, 0) = (0, 1, 1, 0)
[0090] (1,1,0,0)×(0,0,1,0)=(0,0,1,1)
[0091] (1,1,0,0)×(0,0,0,1)=(1,1,0,1)
[0092] Putting the above four equations together we get:
[0093]
[0094] Thus, the square matrix corresponding to the public key to be determined can be obtained as:
[0095]
[0096] The square matrix corresponding to the public key is left-multiplied by a vector in the field, which is equivalent to (1+x) multiplied by its elements. This is obvious because polynomial operations follow the distribution rate of multiplication to addition.
[0097] Similarly, the square matrix corresponding to the plaintext parameter is determined, including:
[0098] Determining the degree corresponding to the highest term in a preset irreducible polynomial, wherein the preset irreducible polynomial is the obtained modulus;
[0099] Determine a result of a second modular multiplication of the plaintext parameter with each term of a lower degree than that corresponding to the highest term;
[0100] A square matrix corresponding to the plaintext parameter is determined based on the second modular multiplication result.
[0101] Here, you only need to replace the public key with the plaintext parameter to determine the square matrix corresponding to the plaintext parameter. For the specific implementation process, please refer to the implementation process of the square matrix corresponding to the public key mentioned above.
[0102] Step 203: constructing a target quantum circuit based on the square matrix;
[0103] The mathematical representation of a quantum logic gate is a matrix, so the matrix can be processed, such as decomposing it, to obtain a quantum logic gate. Then, the quantum logic gate can be applied to the corresponding quantum bits to obtain the target quantum circuit.
[0104] Step 204: Determine the private key corresponding to the ciphertext based on the operation result of the target quantum circuit;
[0105] The target quantum circuit runs on a quantum computing unit, which can be on a quantum computer or a quantum virtual machine. The classical computing unit sends the target quantum circuit to the quantum computing unit, which excites the quantum bits in the target quantum circuit to an initial state, and then applies corresponding analog signals to the quantum bits based on the quantum logic gates in the target quantum circuit, so that the initial state of the quantum bits evolves, and finally applies analog signals to measure the quantum bits, determines the operation result of the target quantum circuit, and feeds the result back to the classical computing unit.
[0106] The quantum computing unit executes the target quantum circuit for a specified number of times. The measured operation result may be in the form of an array. For example, for two quantum bits and 1024 execution times, the measurement results may be "00": 251, "01": 213, "10": 260, "11": 300, where "00", "01", "10", "11" are the measured quantum states, and "251, 213, 260, 300" are the times corresponding to the measured quantum states.
[0107] Step 205: Decrypt the ciphertext based on the private key.
[0108] To determine the private key corresponding to the ciphertext based on the running result, and to decrypt the ciphertext based on the private key, you can refer to the patent document with application number "202111365914.4" and invention name "Ciphertext decryption method and related equipment"; or refer to the patent document with application number "202111365902.1" and invention name "Ciphertext decryption method and related equipment".
[0109] It can be seen that the present invention converts the public key and plaintext parameters corresponding to the obtained ciphertext into a square matrix. The ciphertext is a ciphertext based on discrete logarithm encryption. The public key and plaintext parameters belong to the finite field GF(2 t) elements; then, based on the square matrix, a target quantum circuit is constructed and operated, the private key is determined by the operation result of the target quantum circuit, and the ciphertext is decrypted by the private key; the prior art requires more than 3,000 years to decompose a binary number represented by 795 bits using the most efficient number field sieve method. Compared with the prior art, the present invention greatly realizes the ciphertext cracking speed based on discrete logarithm encryption through the superposition and entanglement characteristics of quantum computing.
[0110] Optionally, constructing a target quantum circuit based on the square matrix includes:
[0111] Performing a square operation on the square matrix corresponding to the public key a preset number of times to obtain a plurality of first square matrices; and performing a square operation on the square matrix corresponding to the plaintext parameter a preset number of times to obtain a plurality of second square matrices;
[0112] Determine a square matrix corresponding to the public key and a plurality of first modulus polynomial exponential operation quantum circuits corresponding to the first square matrix, and a square matrix corresponding to the plaintext parameter and a plurality of second modulus polynomial exponential operation quantum circuits corresponding to the second square matrix;
[0113] The quantum Fourier transform circuit, the first modulus polynomial exponential operation quantum circuit, the second modulus polynomial exponential operation quantum circuit and the quantum inverse Fourier transform circuit are sequentially cascaded to obtain a target quantum circuit.
[0114] Specifically, the square of the square matrix corresponding to the public key is iteratively calculated until t-1 first square matrices are obtained, where the first square matrix is 2 of the square matrix corresponding to the public key. q For example, when q=1, then (1+x) 2 The corresponding first square matrix is the square of the square matrix corresponding to the public key:
[0115]
[0116] According to the above method, iterative calculation can also get The first corresponding matrix.
[0117] The method for determining the second matrix is the same as the method for determining the first matrix, except that the square parameters are different, which will not be described here.
[0118] Specifically, the determining of the square matrix corresponding to the public key and the first modulus polynomial exponential operation quantum circuits corresponding to the plurality of the first square matrices includes:
[0119] Perform LUP decomposition on the square matrix corresponding to the public key and each of the first square matrices to obtain L-type, U-type and P-type matrices;
[0120] Determine the quantum circuits corresponding to the L-type and U-type matrices based on the CNOT gate, and determine the quantum circuit corresponding to the P-type matrix based on the SWAP gate;
[0121] Applying quantum logic gates corresponding to each of the P-type matrices and the U-type and L-type matrices corresponding to the P-type matrices to the quantum bits in sequence to obtain a square matrix corresponding to the public key or a quantum circuit corresponding to each of the first square matrixes;
[0122] The square matrix corresponding to the public key and the quantum circuits corresponding to the first square matrixes are sequentially cascaded to obtain a first modular polynomial exponential operation quantum circuit.
[0123] Among them, decomposing a square matrix A into the product of the lower triangular matrix L and the upper triangular matrix U is called LU decomposition. LUP decomposition is to add a permutation matrix P on the basis of LU decomposition. The square matrix A is first subjected to the permutation matrix to obtain AP, and then the new matrix is decomposed by LU, that is, AP = LU.
[0124] Among them, the elements of the P-type, U-type, and L-type matrices are all taken from {0,1}, so the quantum circuit corresponding to the P-type matrix can be realized by the SWAP gate, and the quantum circuits corresponding to the U-type and L-type matrices can be realized by the CNOT gate.
[0125] Specifically, the quantum circuit corresponding to the L-type matrix is constructed based on the CNOT gate, including:
[0126] Determine the non-zero elements a in the L-type matrix except the diagonal ij , apply the CNOT gate to the i-th and j-th quantum bits to obtain the quantum circuit corresponding to the L-type matrix, the i-th quantum bit is the controlled bit, the j-th quantum bit is the control bit, and i and j are the number of rows and columns of the L-type matrix respectively.
[0127] like Figure 3 As shown, Figure 3 A schematic diagram of the structure of a quantum circuit corresponding to an L-type matrix provided in an embodiment of the present invention. For example, the L-type matrix is:
[0128]
[0129] The non-zero elements of the L-type matrix other than the diagonal are a 20 、a 21 、a 30 , then according to the order of the non-zero elements from small to large and then from small to large, the CNOT gate is applied to the second and zeroth quantum bits (q 2 and q 0 ), the second quantum bit q 2 is the controlled bit, the 0th quantum bit q0 To control the bit, apply the CNOT gate to the second and first qubits (q 2 and q 1 ), the second quantum bit q 2 is the controlled bit, the first quantum bit q 1 To control the bit; apply the CNOT gate to the 3rd and 0th quantum bits (q 3 and q 0 ), the third quantum bit q 3 is the controlled bit, the 0th quantum bit q 0 For control bits.
[0130] Specifically, the quantum circuit corresponding to the U-shaped matrix is constructed based on the CNOT gate, including:
[0131] Determine the non-zero elements a in the U-shaped matrix except the diagonal ij , apply the CNOT gate to the i-th and j-th quantum bits to obtain the quantum circuit corresponding to the U-type matrix, the j-th quantum bit is the controlled bit, the i-th quantum bit is the control bit, and i and j are the number of rows and columns of the U-type matrix respectively.
[0132] The specific implementation process of the quantum circuit corresponding to the U-type matrix is similar to the specific implementation process of the quantum circuit corresponding to the L-type matrix. Please refer to the specific implementation process of the quantum circuit corresponding to the above L-type matrix, which will not be repeated here.
[0133] In one of the embodiments provided by the present invention, the quantum circuit corresponding to the P-type matrix is constructed based on the SWAP gate, and the dimension of the P-type matrix is t×t, including:
[0134] The quantum state of the t qubits corresponding to the number of rows is transferred to the quantum state of the t qubits corresponding to the number of columns, and the non-zero elements a in the P-type matrix other than the diagonal are determined. mn , m and n are the number of rows and columns of the P-type matrix respectively;
[0135] The SWAP gate is applied to the m-th qubit among the t qubits corresponding to the number of rows and the n-th qubit among the t qubits corresponding to the number of columns to obtain a quantum circuit corresponding to the P-type matrix.
[0136] Furthermore, the step of transferring the quantum state of t quantum bits corresponding to the number of rows to the quantum state of t quantum bits corresponding to the number of columns includes:
[0137] The SWAP gate is applied to the qubits corresponding to the row number and the qubits corresponding to the column number with the same serial number, and there are t qubits corresponding to both the row number and the column number.
[0138] For example, Figure 4 As shown, Figure 4 A schematic diagram of a quantum circuit structure corresponding to a P-type matrix provided in an embodiment of the present invention. If t=4, the quantum circuit includes four quantum bits corresponding to the number of rows: q Line0 ,q Line1 ,q Line2 ,q Line3 , the number of columns corresponds to the four quantum bits: q Row0 ,q Row1 ,q Row2 ,q Row3 . You can first use SWAP(q Line0 ,q Row0 )、SWAP(q Line1 ,q Row1 )、SWAP(q Line2 ,q Row2 )、SWAP(q Line3 ,q Row3 ) transfers the quantum state of the qubit corresponding to the row number to the quantum state of the qubit corresponding to the column number. Here, the four SWAP gates act on different qubits, so their action sequence is not affected. Figure 4 Just one example.
[0139] If the P-type matrix is:
[0140]
[0141] Then the non-zero elements have a 01 、a 12 、a 23 、a 30 , so there exists SWAP(q Line0 ,q Row1 )、SWAP(q Line1 ,q Row2 )、SWAP(q Line2 ,q Row3 )、SWAP(q Line3 ,q Row0 ). Similarly, the four SWAP gates act on different quantum bits, so it does not affect their timing. Figure 4 Just one example.
[0142] In another embodiment provided by the present invention, the step of determining the quantum circuit corresponding to the P-type matrix based on the SWAP gate includes:
[0143] Determine the non-zero elements a in the P-type matrix except the diagonal mn ;
[0144] If m is less than n, the SWAP gate is applied to the mth and nth qubits;
[0145] If m is greater than n, determine the non-zero element a m′n′ , and apply the SWAP gate to the mth and n′th qubits, m′ is less than m, and n′ is greater than m;
[0146] If m is equal to n or n′, no operation is performed;
[0147] The quantum circuit corresponding to the P-type matrix is determined.
[0148] For example, Figure 5 As shown, Figure 5 A schematic diagram of the structure of a quantum circuit corresponding to another P-type matrix provided in an embodiment of the present invention.
[0149] If the P-type matrix is:
[0150]
[0151] The non-zero elements are a 03 、a 10 、a 21 、a 32 , for non-zero elements a o3 , 0<3, then the SWAP gate acts on the 0th and 3rd quantum bits (q 0 and q 3 ); for non-zero element a 10 , 1>0, then search upward to get a 03 , m = 1 > m' = 0 and n' = 3 > m = 1, the SWAP gate is applied to the first and third qubits (q 1 and q 3 ); Similarly, for non-zero elements a 21 , apply the SWAP gate to the second and third qubits (q 2 and q 3 ); for non-zero element a 32 , no operation is performed; after all non-zero elements are traversed, the quantum circuit corresponding to the P-type matrix is determined.
[0152] It can be seen that in the embodiment of the present invention, the number of quantum bits required is 2t, which is less than the number of quantum bits t required in the previous embodiment. The previous embodiment involves less computational complexity in classical calculations, and the logic is more direct, but the number of quantum bits called is larger. The advantages and disadvantages of the embodiment of the present invention are opposite to those of the previous embodiment.
[0153] Optionally, the quantum Fourier transform circuit includes an H gate acting on a first auxiliary bit and a second auxiliary bit, the first modulus polynomial exponential operation quantum circuit is controlled by the second auxiliary bit, the second modulus polynomial exponential operation quantum circuit is controlled by the first auxiliary bit, and the quantum inverse Fourier transform circuit includes quantum inverse Fourier transform modules each acting on the first auxiliary bit and the second auxiliary bit.
[0154] Among them, the quantum circuits corresponding to the L-type, U-type, and P-type matrices require at least t quantum bits, so the first-mode polynomial exponential operation quantum circuit and the second-mode polynomial exponential operation quantum circuit also require at least t quantum bits.
[0155] The first modulus polynomial exponential operation quantum circuit is controlled by the second auxiliary bit, and the first polynomial exponential operation quantum circuit includes t items, each of which is controlled by a second auxiliary bit, so t second auxiliary bits are needed for control. Similarly, t first auxiliary bits are needed for control.
[0156] Among them, the H gate is a single gate, and the H gate acts on the first auxiliary bit and the second auxiliary bit, so 2t H gates are needed.
[0157] Specifically, the quantum inverse Fourier transform circuit includes quantum inverse Fourier transform modules each acting on the first auxiliary bit and the second auxiliary bit, including: the quantum inverse Fourier transform circuit includes 2 quantum inverse Fourier transform modules, one of which acts on t first auxiliary bits, and the other acts on t second auxiliary bits.
[0158] like Figure 6 As shown, Figure 6 A schematic diagram of the structure of a target quantum circuit provided by an embodiment of the present invention. The target quantum circuit includes t first auxiliary bits, t second auxiliary bits, and t quantum bits. The initial quantum states of the t first auxiliary bits and the t second auxiliary bits are both |0>, and the initial quantum states of the other t-1 quantum bits are |0>, except that the initial quantum state of the lowest quantum bit among the t quantum bits is |1>.
[0159] Among them, the square matrix corresponding to the public key a is A, and the first square matrix is A 2 , A 3 ···A t-1 , A t , the quantum circuit corresponding to the matrix A is Mat A, and the quantum circuits corresponding to the first matrix are MatA 2 Mat A 3 ···MatA t-1 Mat A t, each square matrix or the quantum circuit corresponding to the first square matrix is controlled by the corresponding second auxiliary bit, and together constitutes the first modular polynomial exponential operation quantum circuit.
[0160] Among them, the square matrix corresponding to the plaintext parameter b is B, and the second square matrix is B 2 , B 3 ···B t-1 , B t , the quantum circuit corresponding to the matrix B is Mat B, and the quantum circuits corresponding to the second matrix are MatB 2 MatB 3 ···Mat B t-1 Mat B t The quantum circuit corresponding to each square matrix or the second square matrix is controlled by the corresponding second auxiliary bit, and together constitutes a second modular polynomial exponential operation quantum circuit.
[0161] The quantum Fourier transform operation is performed by an H gate acting on each first auxiliary bit and each second auxiliary bit, wherein a quantum inverse Fourier transform operation Acting on t first auxiliary bits, another quantum inverse Fourier transform operation Acts on t second auxiliary bits.
[0162] Optionally, the determining of the private key corresponding to the ciphertext based on the operation result of the target quantum circuit, wherein the operation result of the target quantum circuit includes a good number pair, includes:
[0163] Determine a first good number vector based on one of the good number pairs, and determine a second good number vector based on the other of the good number pairs;
[0164] Determine the inverse element of each element in the second good number vector to obtain a third good number vector;
[0165] determining a tensor product of the first good number vector and the third good number vector;
[0166] A private key corresponding to the ciphertext is determined from the tensor product.
[0167] Among them, the good number is the classical data obtained after good-state decoding of the quantum data, the good state is the quantum state obtained by measuring the first auxiliary bit or the second auxiliary bit, and the good number pair includes two good numbers, which are two good numbers corresponding to the two good states obtained by measuring the first auxiliary bit and the second auxiliary bit.
[0168] run Figure 6 The quantum circuit shown in the figure measures the t first auxiliary bits and t second auxiliary bits in the quantum circuit, and can obtain the good number pair l and k of the binary string and convert it into decimal. Then the discrete logarithm problem can be transformed into solving the congruence equation:
[0169] k×x=lmod2 t
[0170] The solution to the above equation is not necessarily unique, and considering the measurement error (errors in l and k), it is necessary to expand the calculation range of the polynomial size.
[0171] Without considering the error, and assuming that the k measured above is not an even number, then 2 t and k are relatively prime, so there exists an integer k -1 ,satisfy:
[0172] k×k -1 =1 mod2 t
[0173] Thus:
[0174] x=k×x×k -1 =l×k -1 mod2 t
[0175] The computational simulation can use the extended Euclidean algorithm, whose time complexity is log = 2 t = t, even if polynomial modular inverses are calculated, the above complexity can ensure that the total time complexity is at the polynomial level. Compared with traditional algorithms, its time complexity is greatly reduced.
[0176] Taking into account the measurement error (errors in l and k), it is necessary to expand the calculation range of the polynomial size. Specifically, determining the first good number vector based on one of the good number pairs includes: extending one of the good number pairs to both sides to obtain the first good number vector, for example, l and k can be extended to both sides to obtain the good number vector, for example, the first good number vectors long l and long k are as follows:
[0177] longl=[l-tl-t+1…l-1 ll+1…l+t-1 l+t]
[0178] longk=[k-tk-t+1…k-1 kk+1…k+t-1 k+t]
[0179] Specifically, determine the inverse element of each element in the second good number vector long k to obtain a third good number vector long k -1 :
[0180] longk -1 =[(kt) -1 …k -1 …(k+t) -1 ]
[0181] longl and longk -1 The tensor product of is:
[0182]
[0183] Finally, from the above tensor product 4t 2 Determine the appropriate element from the elements as the private key x corresponding to the ciphertext.
[0184] See also Figure 7 , Figure 7 A schematic diagram of the structure of a ciphertext decryption device based on quantum computing provided in an embodiment of the present invention, which is applied to ciphertext based on discrete logarithm encryption, the device comprising:
[0185] The acquisition unit 701 is used to obtain the public key and plain text parameters corresponding to the ciphertext, wherein the public key and plain text parameters belong to the finite field GF(2 t ) in the element;
[0186] A determination unit 702, configured to determine a square matrix corresponding to the public key and the plaintext parameter;
[0187] A construction unit 703, configured to construct a target quantum circuit based on the square matrix;
[0188] The determining unit 702 is further configured to determine a private key corresponding to the ciphertext based on the operation result of the target quantum circuit;
[0189] The decryption unit 704 is configured to decrypt the ciphertext based on the private key.
[0190] Regarding the specific functions and effects achieved by the ciphertext decryption device based on quantum computing, you can refer to other embodiments of this specification for comparison and explanation, and will not repeat them here. Each module in the ciphertext decryption device based on quantum computing can be implemented in whole or in part by software, hardware, and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0191] See also Figure 8 The present specification also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the ciphertext decryption method based on quantum computing in any of the above embodiments when executing the computer program. Figure 8 , the computer device may be a classical computer. The computer device may also be a quantum computer.
[0192] The embodiments of this specification also provide a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a computer, the computer executes the ciphertext decryption method based on quantum computing in any of the above embodiments.
[0193] The embodiments of this specification also provide a computer program product including instructions, which, when executed by a computer, enables the computer to execute the ciphertext decryption method based on quantum computing in any of the above embodiments.
[0194] It should be understood that the specific examples in this specification are only intended to help those skilled in the art to better understand the implementation methods of this specification, rather than to limit the scope of the present invention.
[0195] It can be understood that in the various implementations of this specification, the size of the sequence number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the implementation methods of this specification.
[0196] It can be understood that the various embodiments described in this specification can be implemented individually or in combination, and the embodiments of this specification are not limited to this.
[0197] Unless otherwise specified, all technical and scientific terms used in the embodiments of this specification have the same meaning as those generally understood by those skilled in the art of the technical field of this specification. The terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit the scope of this specification. The term "and / or" used in this specification includes any and all combinations of one or more related listed items. The singular forms of "a", "above", and "the" used in the embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0198] It can be understood that the processor of the embodiment of this specification can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method implementation can be completed by the hardware integrated logic circuit or software instructions in the processor. The above processor can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiment of this specification can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of this specification can be directly embodied as a hardware decoding processor to perform, or the hardware and software modules in the decoding processor are combined and executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0199] It is understood that the memory in the embodiments of this specification may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (programmable ROM, PROM), an erasable programmable read-only memory (erasablePROM, EPROM), an electrically erasable programmable read-only memory (EEPROM) or a flash memory. The volatile memory may be a random access memory (RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0200] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this specification.
[0201] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method implementation methods and will not be repeated here.
[0202] In the several embodiments provided in this specification, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0203] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0204] In addition, each functional unit in each embodiment of the present specification may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0205] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this specification, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of this specification. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0206] The above is only a specific implementation of this specification, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in this specification, which should be included in the protection scope of this specification. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A ciphertext decryption method based on quantum computing, characterized in that: Applied to ciphertext based on discrete logarithm encryption, the method comprises: Obtain the public key and plaintext parameters corresponding to the ciphertext, both of which belong to the finite field GF(2 t ) in the element; Determine the square matrix corresponding to the public key and the plaintext parameters; Constructing a target quantum circuit based on the square matrix; Determining a private key corresponding to the ciphertext based on the operation result of the target quantum circuit; The ciphertext is decrypted based on the private key.
2. The method according to claim 1, characterized in that The step of constructing a target quantum circuit based on the square matrix includes: Performing a square operation on the square matrix corresponding to the public key a preset number of times to obtain a plurality of first square matrices; and performing a square operation on the square matrix corresponding to the plaintext parameter a preset number of times to obtain a plurality of second square matrices; Determine a square matrix corresponding to the public key and a plurality of first modulus polynomial exponential operation quantum circuits corresponding to the first square matrix, and a square matrix corresponding to the plaintext parameter and a plurality of second modulus polynomial exponential operation quantum circuits corresponding to the second square matrix; The quantum Fourier transform circuit, the first modulus polynomial exponential operation quantum circuit, the second modulus polynomial exponential operation quantum circuit and the quantum inverse Fourier transform circuit are sequentially cascaded to obtain a target quantum circuit.
3. The method according to claim 2, characterized in that The quantum Fourier transform circuit includes an H gate acting on a first auxiliary bit and a second auxiliary bit, the first modulus polynomial exponential operation quantum circuit is controlled by the second auxiliary bit, the second modulus polynomial exponential operation quantum circuit is controlled by the first auxiliary bit, and the quantum inverse Fourier transform circuit includes quantum inverse Fourier transform modules each acting on the first auxiliary bit and the second auxiliary bit.
4. The method according to claim 1, characterized in that The private key corresponding to the ciphertext is determined based on the operation result of the target quantum circuit, and the operation result of the target quantum circuit includes a good number pair, including: Determine a first good number vector based on one of the good number pairs, and determine a second good number vector based on the other of the good number pairs; Determine the inverse element of each element in the second good number vector to obtain a third good number vector; determining a tensor product of the first good number vector and the third good number vector; A private key corresponding to the ciphertext is determined from the tensor product.
5. The method according to claim 4, characterized in that The determining a first good number vector based on one of the good number pairs comprises: One of the good number pairs is extended to both sides to obtain a first good number vector.
6. The method according to claim 2, characterized in that The step of determining the square matrix corresponding to the public key and the first modulus polynomial exponential operation quantum circuits corresponding to the first square matrixes comprises: Perform LUP decomposition on the square matrix corresponding to the public key and each of the first square matrices to obtain L-type, U-type and P-type matrices; Determine the quantum circuits corresponding to the L-type and U-type matrices based on the CNOT gate, and determine the quantum circuit corresponding to the P-type matrix based on the SWAP gate; Applying quantum logic gates corresponding to each of the P-type matrices and the U-type and L-type matrices corresponding to the P-type matrices to the quantum bits in sequence to obtain a square matrix corresponding to the public key or a quantum circuit corresponding to each of the first square matrixes; The square matrix corresponding to the public key and the quantum circuits corresponding to the first square matrixes are sequentially cascaded to obtain a first modular polynomial exponential operation quantum circuit.
7. The method according to claim 6, characterized in that The step of determining the quantum circuit corresponding to the P-type matrix based on the SWAP gate includes: Determine the non-zero elements a in the P-type matrix except the diagonal mn ; If m is less than n, the SWAP gate is applied to the mth and nth qubits; If m is greater than n, determine the non-zero element a m′n′ , and apply the SWAP gate to the mth and nth ′ On qubits, m ′ is less than m, and n ′ greater than m; If m is equal to n or n ′ , no action is performed; The quantum circuit corresponding to the P-type matrix is determined.
8. A ciphertext decryption device based on quantum computing, characterized in that: Applied to ciphertext based on discrete logarithm encryption, the device comprises: An acquisition unit is used to acquire a public key and a plaintext parameter corresponding to the ciphertext, wherein the public key and the plaintext parameter both belong to a finite field GF(2 t ) in the element; A determination unit, used to determine the square matrix corresponding to the public key and the plaintext parameter; A construction unit, used for constructing a target quantum circuit based on the square matrix; The determining unit is further used to determine the private key corresponding to the ciphertext based on the operation result of the target quantum circuit; A decryption unit is used to decrypt the ciphertext based on the private key.
9. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Polynomial point expressed low expansion ratio anti-quantum-attack file encryption and decryption method
CN107682140A
Quantum encryption method based on quantum power function confusion
CN114422130A
Method for solving discrete logarithm problem and related equipment
CN116136969A
Ciphertext decryption method and related equipment
CN116137565A
Homomorphic evaluation including key switching, modulus switching, and dynamic noise management
US20130216044A1
