Mapping method and system for large integer factorization problem based on Ising model
By introducing auxiliary variables and Hamiltonian expressions of the Isin model in large integer decomposition, combined with iterative strategies, the problem of low efficiency of large integer decomposition in the existing technology is solved, and efficient RSA cipher cracking is achieved.
Patent Information
- Application Number
- CN202211115726.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-14
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2042-09-14
AI Technical Summary
The existing large integer decomposition method, especially when applied to RSA cryptographic systems, has problems of inefficiency and high computational complexity. The existing Isin model method lacks specific program flow and iterative improvements, making it difficult to effectively crack large integers. .
By introducing auxiliary variables to construct loss functions, it is converted into Hamiltonian expressions of the Ising model, and an iterative strategy of updating the spin state from less to more is adopted until the Ising model reaches the spin ground state, thereby achieving large integer decomposition, and Further obtain the private key of the RSA encryption algorithm.
A general large integer decomposition process is implemented, the calculation model is simplified, efficiency is improved, local optimal solutions are avoided, and it is suitable for general computing devices and special computing platforms, promoting the development of cryptography and information security.
Smart Images

Figure CN115514488B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of password cracking, in particular to the technical field of RSA password cracking based on large integer decomposition, and more particularly to a mapping method and system for large integer decomposition problems based on an Ising model. Background Art
[0002] While current computer computing power can easily compute the product of any two finitely large integers, the reverse process remains extremely difficult, making it difficult to accurately factor a large integer within a finite timeframe. Consequently, the difficulty of factoring large integers has been widely exploited in the field of cryptography, particularly in the RSA algorithm, an asymmetric encryption algorithm proposed in 1977 by Ron Rivest, Adi Shamir, and Leonard Adleman. The security of this algorithm stems from the difficulty of factoring the product of two large prime numbers. Despite the theoretical difficulty of cracking the RSA algorithm, many researchers have been searching for effective methods for factoring large integers, which is crucial to the improvement and advancement of current cryptographic systems and even information security. Trial division is the earliest documented integer factorization method, but for large integers used in cryptographic systems, the time required for trial division far exceeds the validity period of typical cryptographic algorithms. The number field sieve (NFS) is currently the best method for factoring large integers, but the process is relatively cumbersome, involving five steps: polynomial selection, number pair screening, matrix generation, matrix solution, and square root solution, and it also exhibits a degree of randomness. In addition, quantum algorithms have emerged in recent years to factor integers. However, due to the current inability to achieve stable control of a large number of quantum bits, the practical application of quantum algorithms is still a long way off.
[0003] The Ising model, originally a physical model describing the ferromagnetism of materials, has evolved into a mathematical computational model with numerous applications. It consists of many spin nodes with spin states of +1 or -1. In this model, two-body interactions and the effects of external magnetic fields alter the spin states of the nodes. Due to this characteristic, the Hamiltonian of the Ising model system gradually decreases until it reaches the ground state. The Ising model is an effective method for solving combinatorial optimization problems. Problem parameters can be converted into interaction strengths and external magnetic field strengths, and then the optimal solution can be obtained by solving the Ising model. Currently, many Ising models have been proposed that represent spin nodes using physical signals (such as electrical or optical signals), offering advantages such as fast computational speed and low energy consumption. Although examples of converting large integer factorization problems into the Ising model have been reported, existing methods only rely on mathematical derivations and lack a general procedural flow. They also require converting many-body interactions into two-body interactions. Furthermore, the conversion of larger integers faces challenges such as excessively large model coefficients and high precision requirements. In addition, after converting the large integer decomposition problem into the Ising model, no further analysis of the model characteristics was made, and no targeted improvements were made to the iterative process.
[0004] Patent document CN101814109A (application number: CN200910078286.4) discloses a method for decomposing large integers based on DNA self-assembly computation. The method includes the following steps: constructing a logical computational architecture for decomposing integers based on DNA self-assembly technology; forming an initial computational tile, including a starting tile, a computational tile, and a data transfer tile; controlling the temperature and solution concentration under pre-set experimental conditions to ensure successful DNA self-assembly; detecting the solution, finding the computationally complete self-assembly structure, separating and extracting the reporter strand within it, and reading the result according to encoding principles. However, this invention does not introduce a specific computational model, nor does it construct a loss function containing only quadratic, linear, and constant terms. Summary of the Invention
[0005] In view of the defects in the prior art, the purpose of the present invention is to provide a mapping method and system for large integer decomposition problems based on the Ising model.
[0006] According to the present invention, a large integer decomposition problem mapping method based on the Ising model is provided, comprising:
[0007] Step S1: Introduce auxiliary variables for each intermediate term in the binary multiplication vertical form to construct auxiliary blocks. Perform formal equivalent replacement on the loss function obtained in each block to make it meet the formal requirements of the Ising model. Add the loss functions of each block and perform variable substitution to simplify and obtain the Hamiltonian expression of the Ising model.
[0008] Step S2: Based on the distribution characteristics of the Hamiltonian values and their ranges under different spin states, a technical solution is adopted to update the spin states from small to large, and the judgment conditions are changed in specific cases to enable it to jump out of the local optimal solution until the Ising model reaches the spin ground state;
[0009] Step S3: Obtain two prime factor information to achieve large integer decomposition, further obtain the private key in the RSA encryption algorithm from the Euler formula and the public key opened in the cryptographic system, use the private key to convert the ciphertext information into the original plaintext information, and crack the RSA cryptographic system.
[0010] Preferably, in step S1:
[0011] A specific loss function is generated for each auxiliary block. The boundary conditions are substituted and a formal equivalent replacement is performed on each loss function to exclude higher-order terms above the quadratic term, thus satisfying the formal requirements of the Ising model. All the loss functions are then summed, variables are substituted, and simplified to obtain the Hamiltonian expression of the Ising model. The interaction matrix J and the external magnetic field vector h are extracted, transforming the large integer decomposition problem into the problem of finding the spin ground state of the Ising model.
[0012] The conversion process is implemented through a fixed process, is applicable to any large integer, and is completed in a computer program. For a specific large integer, there is no need to separately analyze or deduce the intermediate process, and the corresponding Ising model can be directly obtained;
[0013] The auxiliary variable is each middle term a in the binary multiplication vertical formula of two factors. i b j Introduced one by one, that is, y i,j and z i,j , where y i,j The lowest bit of the result obtained by adding the binary variables in the auxiliary block above, z i,j is the carry from the addition of the binary variables in the auxiliary block on the right, a i b j 、y i,j 、z i,j The three items form an auxiliary block that produces the loss function;
[0014] The loss function is in the form of F i,j =(a i b j +y i,j +z i,j -y i+1,j-1 -2z i-1,j ) 2 , the equivalent form after replacement is
[0015] The loss function after the equivalent replacement does not contain any terms higher than quadratic, and no reduction operation is required. In the Hamiltonian expression obtained after adding all of them, simplifying them, and substituting variables, the coefficients of the variables are limited to a preset range, and the element sizes of the interaction matrix J of the obtained Ising model and the external magnetic field vector h are also limited.
[0016] Preferably, step S1.1: expressing the target large integer to be decomposed in binary form, with the number of recorded bits being w;
[0017] Step S1.2: Assume that the binary digits of the two factors of the target large integer are k and h respectively, and their binary forms from high to low are a1, a2, ..., a k and b1,b2,…,b h ;
[0018] Step S1.3: For each middle term a in the vertical binary multiplication of two factors i b j , introduce auxiliary variables y one by one i,j and z i,j , and a i b j 、y i,j 、z i,j Three items serve as an auxiliary block;
[0019] Step S1.4: Generate a loss function for each auxiliary block. For auxiliary blocks on the boundary, introduce additional auxiliary variables according to the form of the loss function and substitute the boundary conditions.
[0020] Step S1.5: Perform a formal equivalent replacement on the loss function obtained for each block so that it only contains quadratic terms;
[0021] Step S1.6: Add the replaced loss functions together and perform variable substitution, then simplify to obtain the Hamiltonian expression of the Ising model.
[0022] Step S1.7: Each variable in the expression is used as a spin node, and the binary quadratic term coefficients and the linear term coefficients are extracted to form the interaction matrix J and the external magnetic field vector h of the Ising model, and the sum of the remaining invariant parts is recorded as C.
[0023] Preferably, in step S2:
[0024] Step S2.1: Randomly generate an initial spin state and calculate the Hamiltonian based on the obtained Ising model;
[0025] Step S2.2: Each time x spins are changed, the initial value of x is 1. As the number of changes to the same spin state increases, x is gradually increased.
[0026] Step S2.3: If the Hamiltonian decreases after the change, accept the change to the spin state and reset x to 1; otherwise, continue to maintain the spin state before the change.
[0027] Step S2.4: If x reaches a certain value and is not reset, then lower the criterion for accepting a spin state change until x is reset;
[0028] Step S2.5: Repeat process steps S2.2 to S2.4 until the Hamiltonian corresponding to the spin state is -C, indicating that the Ising model has reached the spin ground state and contains the two prime factor information of the target large integer, thus achieving large integer decomposition.
[0029] Preferably, the criterion for accepting a spin state change is lowered by setting a judgment energy E_jump required to jump out of the local optimal solution, so that the Hamiltonian corresponding to the current spin state is no longer calculated, but is directly set to E_jump, and then the iterative process is repeated until the Hamiltonian is updated again.
[0030] Preferably, module M1: introduces auxiliary variables into each intermediate term in the binary multiplication vertical formula, constructs auxiliary blocks, performs formal equivalent replacement on the loss function obtained by each block so that it meets the formal requirements of the Ising model, and adds the loss functions of each block to obtain the Hamiltonian expression of the Ising model;
[0031] Module M2: Based on the distribution characteristics of the Hamiltonian values and their ranges under different spin states, a technical solution is adopted to update the spin state from small to large, and the judgment conditions are changed to enable it to jump out of the local optimal solution until the Ising model reaches the spin ground state;
[0032] Module M3: Obtain two prime factor information to achieve large integer decomposition, and further obtain the private key in the RSA encryption algorithm from the Euler formula and the public key opened in the cryptographic system. Use the private key to convert the ciphertext information into the original plaintext information to crack the RSA cryptographic system.
[0033] Preferably, in the module M1:
[0034] A specific loss function is generated for each auxiliary block. The boundary conditions are substituted and a formal equivalent replacement is performed on each loss function to exclude higher-order terms above the quadratic term, thus satisfying the formal requirements of the Ising model. All the loss functions are then summed, variables are substituted, and simplified to obtain the Hamiltonian expression of the Ising model. The interaction matrix J and the external magnetic field vector h are extracted, transforming the large integer decomposition problem into the problem of finding the spin ground state of the Ising model.
[0035] The conversion process is implemented through a fixed process, is applicable to any large integer, and is completed in a computer program. For a specific large integer, there is no need to separately analyze or deduce the intermediate process, and the corresponding Ising model can be directly obtained;
[0036] The auxiliary variable is each middle term a in the binary multiplication vertical formula of two factors. i b j Introduced one by one, that is, y i,j and z i,j , where y i,j The lowest bit of the result obtained by adding the binary variables in the auxiliary block above, z i,j is the carry from the addition of the binary variables in the auxiliary block on the right, a i b j 、y i,j 、z i,j The three items form an auxiliary block that produces the loss function;
[0037] The loss function is in the form of F i,j =(a i b j +y i,j +z i,j -y i+1,j-1 -2z i-1,j ) 2 , the equivalent form after replacement is
[0038] The loss function after the equivalent replacement does not contain any terms higher than quadratic, and no reduction operation is required. In the Hamiltonian expression obtained after adding all of them, simplifying them, and substituting variables, the coefficients of the variables are limited to a preset range, and the element sizes of the interaction matrix J of the obtained Ising model and the external magnetic field vector h are also limited.
[0039] Preferably, module M1.1: represents the target large integer to be decomposed in binary form, with the number of recorded bits being w;
[0040] Module M1.2: Assume that the binary digits of the two factors of the target large integer are k and h respectively, and the binary forms from high to low are a1, a2, ..., a k and b1,b2,…,b h ;
[0041] Module M1.3: For each middle term a in the vertical form of binary multiplication of two factors i b j , introduce auxiliary variables y one by one i,j and z i,j , and a i b j 、yi,j 、z i,j Three items serve as an auxiliary block;
[0042] Module M1.4: Each auxiliary block generates a loss function. For auxiliary blocks on the boundary, additional auxiliary variables are introduced according to the form of the loss function and the boundary conditions are substituted.
[0043] Module M1.5: Perform a formal equivalent replacement on the loss function obtained for each block so that it only contains quadratic terms;
[0044] Module M1.6: Add the replaced loss functions and perform variable substitution, then simplify to obtain the Hamiltonian expression of the Ising model;
[0045] Module M1.7: Each variable in the expression is used as a spin node, and the coefficients of the binary quadratic term and the linear term are extracted to form the interaction matrix J and the external magnetic field vector h of the Ising model, and the sum of the remaining invariant parts is recorded as C.
[0046] Preferably, in the module M2:
[0047] Module M2.1: Randomly generate initial spin states and calculate the Hamiltonian based on the obtained Ising model;
[0048] Module M2.2: Each time x spins are changed, the initial value of x is 1. As the number of changes to the same spin state increases, x gradually increases.
[0049] Module M2.3: If the changed Hamiltonian decreases, accept the change to the spin state and reset x to 1; otherwise, maintain the spin state before the change.
[0050] Module M2.4: If x reaches a certain value and is not reset, lower the criterion for accepting a spin state change until x is reset;
[0051] Module M2.5: Repeat the process of modules M2.2 to M2.4 until the Hamiltonian corresponding to the spin state is -C, indicating that the Ising model has reached the spin ground state and contains the two prime factors of the target large integer, thus achieving large integer decomposition.
[0052] Preferably, the criterion for accepting a spin state change is lowered by setting a judgment energy E_jump required to jump out of the local optimal solution, so that the Hamiltonian corresponding to the current spin state is no longer calculated, but is directly set to E_jump, and then the iterative process is repeated until the Hamiltonian is updated again.
[0053] Compared with the prior art, the present invention has the following beneficial effects:
[0054] 1. This invention fully demonstrates a general process for mapping large integer decomposition problems into Ising model solution problems;
[0055] 2. Compared with other large integer decomposition methods, the present invention introduces a specific computational model. The decomposition process only includes the above two main parts, which is simpler and more intuitive overall. The conversion process in the first part is directly applicable to any target large integer and is universal, and can be directly programmed in a computer. The calculation and iterative process in the second part can be completed on general-purpose computing devices or dedicated computing platforms, which has a wider range of hardware implementation scenarios.
[0056] 3. Compared with other examples of using the Ising model to solve large integer decomposition problems, the present invention directly constructs a loss function containing only quadratic terms, linear terms, and constant terms, avoiding the reduction operation. At the same time, for any large integer, the interaction between the converted Ising model and the external magnetic field is limited to a limited range, making its physical implementation and calculation easier;
[0057] 3. The present invention further improves the general iterative process for the obtained Ising model, which can find or approach the optimal solution more quickly, avoid falling into a local optimal solution, and improve the efficiency of large integer decomposition;
[0058] 4. Currently, with the development of specialized computing equipment related to the Ising model, it is expected that the method of the present invention will be used to achieve a breakthrough in the record of large integer factorization, thereby promoting the development of cryptography, information security and other fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Other features, objects and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments with reference to the following drawings:
[0060] Figure 1 The overall flow chart of the large integer decomposition problem mapping method provided by the present invention;
[0061] Figure 2 A flow chart of the method for converting a large integer decomposition problem into an Ising model solution problem in the present invention;
[0062] Figure 3 Schematic diagram of the principle of constructing auxiliary blocks in the vertical binary multiplication formula according to an embodiment of the present invention;
[0063] Figure 4 A flow chart of the method for iteratively searching for the spin ground state of the Ising model in the present invention;
[0064] Figure 5 This is an example diagram of the iteration results of an embodiment of the present invention. DETAILED DESCRIPTION
[0065] The present invention will be described in detail below with reference to specific embodiments. The following examples will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those skilled in the art, several changes and improvements can be made without departing from the scope of the present invention. These all fall within the scope of protection of the present invention.
[0066] Example 1:
[0067] The present invention introduces a new computational model to realize the mapping of large integer decomposition problems. The overall process is simple and intuitive. The iterative process can be implemented on general computing devices or on a dedicated computing platform for the Ising model, enriching the method ideas and implementation scenarios for solving large integer decomposition problems.
[0068] A mapping method for large integer factorization problems based on the Ising model, such as Figure 1-Figure 5 As shown, by introducing auxiliary variables into the vertical form of binary multiplication of prime factors, auxiliary blocks are constructed one by one with the intermediate terms, and a specific form of loss function is generated for each auxiliary block. The boundary conditions are substituted and each loss function is formally replaced so that it does not contain higher-order terms above the quadratic term, which meets the formal requirements of the Ising model. Then, all the loss functions are added, the variables are replaced and simplified to obtain the Hamiltonian expression of the Ising model. The interaction matrix J and the external magnetic field vector h are extracted, and the large integer decomposition problem is transformed into a problem of finding the spin ground state of the Ising model. Subsequently, the spin ground state of the Ising model is iteratively searched, and an iterative strategy of changing the current spin state from small to large is adopted. If the changed Hamiltonian decreases, the spin state is updated. At the same time, the judgment condition is changed under certain conditions so that it can jump out of the local optimal solution until the Ising model reaches the spin ground state.
[0069] The conversion process is implemented through a fixed process, is applicable to any large integer, and can be completed in a programmed manner within a computer. For a specific large integer, the corresponding Ising model can be directly obtained without the need for separate analysis or derivation of intermediate processes.
[0070] The auxiliary variable is each middle term a in the binary multiplication vertical formula of two factors. i b j Introduced one by one, that is, y i,j and z i,j , where y i,j The lowest bit of the result obtained by adding the binary variables in the auxiliary block above, z i,j is the carry from the addition of the binary variables in the auxiliary block on the right, a i b j 、y i,j 、zi,j The three items form an auxiliary block and generate the loss function.
[0071] The loss function is in the form of F i,j =(a i b j +y i,j +z i,j -y i+1,j-1 -2z i-1,j ) 2 , the equivalent form after replacement is
[0072] The loss function after the equivalent replacement does not contain any terms higher than quadratic, and no reduction operation is required. In the Hamiltonian expression obtained after adding all of them, simplifying them, and substituting variables, the coefficients of the variables are limited to a certain range, so that the element sizes of the interaction matrix J of the Ising model and the external magnetic field vector h are also limited.
[0073] The Ising model is suitable for a specific iteration strategy, which can reach the ground state faster than completely random iteration and avoid falling into a local optimal solution.
[0074] The specific process of the iterative strategy is as follows:
[0075] 1) Randomly generate an initial spin state and calculate the Hamiltonian based on the Ising model obtained in the first part;
[0076] 2) Each time x spins are changed, the initial value of x is 1. As the number of changes to the same spin state increases, x gradually increases.
[0077] 3) If the Hamiltonian decreases after the change, accept the change to the spin state and reset x to 1; otherwise, continue to maintain the spin state before the change;
[0078] 4) If x reaches a certain value and is not reset, lower the criterion for accepting a spin state change until x is reset;
[0079] 5) Repeat steps 2) to 4) until the Hamiltonian corresponding to the spin state is -C, indicating that the Ising model has reached the spin ground state and contains the two prime factors of the target large integer, thus achieving large integer decomposition.
[0080] The aforementioned lowering of the criterion for accepting a spin state change is achieved by setting a criterion energy E_jump required to jump out of the local optimal solution, so that the Hamiltonian corresponding to the current spin state is no longer calculated, but is directly set to E_jump, and then the iterative process is repeated until the Hamiltonian is updated again.
[0081] The private key in the RSA encryption algorithm is further obtained from the Euler formula and the public key opened in the cryptographic system. The private key is used to convert the ciphertext information into the original plaintext information, thereby cracking the RSA cryptographic system.
[0082] Example 2:
[0083] Example 2 is a preferred example of Example 1 and is used to illustrate the present invention in more detail.
[0084] The purpose of the present invention is to propose a new technical solution for decomposing large integers into two prime factors, realize the mapping of the large integer decomposition problem to the Ising model solution problem, form a relatively simple but complete solution process, so that general computing devices (such as electronic computers, etc.) and various special computing devices for the Ising model (such as optical Ising machines, etc.) can be directly applied to solve the large integer decomposition problem, and then realize the cracking of the RSA encryption algorithm.
[0085] The present invention can be divided into two parts, sequentially. The first part is the conversion process from the large integer factorization problem to the target Ising model. The technical solution is to introduce auxiliary variables into each intermediate term in the binary multiplication vertical form, construct auxiliary blocks, and perform formal equivalent replacement on the loss function obtained for each block to ensure that it meets the formal requirements of the Ising model. Finally, the loss functions of each block are summed and variable substitution is performed to simplify the Hamiltonian expression. The second part is a suitable iterative process designed for the obtained Ising model. Based on the distribution characteristics of the Hamiltonian values and ranges under different spin states, a technical solution is adopted to update the spin state from small to large. Under certain conditions, the judgment criteria are changed to enable it to escape the local optimal solution. This iterative process enables the Ising model to find or approach the spin ground state more quickly.
[0086] The conversion of the large integer factorization problem to the target Ising model is implemented as follows:
[0087] 1) Express the target large integer to be decomposed in binary form, with the number of bits recorded as w;
[0088] 2) Assume that the binary digits of the two factors of the target large integer are k and h respectively, and the binary forms from high to low are a1, a2, ..., a k and b1,b2,…,b h ;
[0089] 3) For each middle term a in the vertical binary multiplication of two factors i b j , introduce auxiliary variables y one by one i,j and z i,j , and a i b j 、yi,j 、z i,j Three items serve as an auxiliary block;
[0090] 4) Each auxiliary block generates a loss function. For auxiliary blocks on the boundary, additional auxiliary variables are introduced according to the form of the loss function and the boundary conditions are substituted;
[0091] 5) Perform a formal equivalent replacement on the loss function obtained for each block so that it only contains quadratic terms;
[0092] 6) Add the replaced loss functions and perform variable substitution, and then simplify to obtain the Hamiltonian expression of the Ising model;
[0093] 7) Each variable in the expression is used as a spin node, and the binary quadratic term coefficient and the linear term coefficient are extracted to form the interaction matrix J and the external magnetic field vector h of the Ising model, and the sum of the remaining invariant parts is recorded as C.
[0094] The iterative process designed for the obtained Ising model is implemented as follows:
[0095] 1) Randomly generate an initial spin state and calculate the Hamiltonian based on the Ising model obtained in the first part;
[0096] 2) Each time x spins are changed, the initial value of x is 1. As the number of changes to the same spin state increases, x gradually increases.
[0097] 3) If the Hamiltonian decreases after the change, accept the change to the spin state and reset x to 1; otherwise, continue to maintain the spin state before the change;
[0098] 4) If x reaches a certain value and is not reset, lower the criterion for accepting a spin state change until x is reset;
[0099] 5) Repeat steps 2) to 4) until the Hamiltonian corresponding to the spin state is -C, indicating that the Ising model has reached the spin ground state and contains the two prime factors of the target large integer, thus achieving large integer decomposition.
[0100] The present invention proposes a new technical solution for decomposing a large integer into two prime factors. After obtaining the two prime factors, the two prime factors can be further substituted into Euler's formula and combined with the open public key to obtain the private key information in the RSA encryption algorithm. The private key is then used to convert the transmitted ciphertext information into plaintext information, that is, the encrypted original data, thereby achieving the cracking of the RSA cryptographic system.
[0101] Example 3:
[0102] Example 3 is a preferred example of Example 1 and is used to illustrate the present invention in more detail.
[0103] like Figure 1 As shown, the present invention maps the large integer factorization problem to the Ising model solution problem and provides a complete solution process. The main idea is to obtain the corresponding Ising model for the target large integer through a predetermined program step. Then, through the computing platform, the spin ground state of the model is obtained through iteration, and the two prime factors of the target large integer are obtained. In the first part, the interaction matrix J and the external magnetic field vector h are obtained from the target large integer. This is mainly based on the loss function determined by the multiplication vertical form. If the loss function reaches 0, it means that the values of the variables at this time are exactly the two prime factors to be found. After converting to the Ising model, this state is also the ground state of the model. The second part is a further optimization of the Ising model obtained in the first part. It designs an iterative strategy for finding the spin ground state of the Ising model. The Ising model can quickly approach or find the spin ground state and avoid falling into local optimal solutions. It should be noted that the first part is a deterministic program flow that can be implemented in a computer program. The Ising model obtained by converting the same large integer is fixed. The process of the second part has a certain degree of randomness, but the optimal solution of the model is determined. The implementation method of each part is described in detail below. It is assumed that the public modulus N in the RSA encryption algorithm is 143. Therefore, the decomposition of 143 is used as a specific example to assist in the explanation. It should be understood that the public modulus in the RSA algorithm used in actual application is of a larger magnitude. 143 is used as the public modulus here to facilitate the explanation of the method principle of the present invention. For integers of a larger magnitude, the principle and implementation steps are the same.
[0104] like Figure 2 As shown in the first part, first express the large integer to be decomposed in binary form, record its binary digits as w, determine the binary digits of the two prime factors as k and h, and set them from high to low as a1, a2, ..., a k and b1,b2,…,b h , where a1, a k ,b1,b h It can be determined as a constant 1; introduce the auxiliary variable y in the vertical binary multiplication of two prime factors i,j and z i,j , and the corresponding a in the multiplication vertical form i b j Together as an auxiliary block; for each auxiliary block, a loss function F can be determined i,j , which is of the form F i,j =(a i b j +y i,j +z i,j -y i+1,j-1-2z i-1,j ) 2 For the auxiliary blocks at the boundary of the multiplication vertical form, it is necessary to generate additional auxiliary variables required in the loss function but not introduced, and substitute the auxiliary variables in the loss function with non-auxiliary variables or known constants, that is, substitute the boundary conditions; perform formal equivalent replacement on each loss function without changing the function variables, and obtain the new F i,j The form does not include terms higher than the quadratic; the replaced loss functions are added together and the variables are substituted so that the values of the variables change from binary "1" and "0" to "+1" and "-1" representing the spin state, and then the Hamiltonian expression that satisfies the Ising model conditions is simplified; finally, the variables in the expression are represented as the spin state of the Ising model, and the coefficients are extracted, where the quadratic coefficients between different spins constitute the interaction matrix J, and the linear coefficients constitute the external magnetic field vector h. The part other than J and h in the expression is the invariant part, and its value is independent of the spin state. Its value is recorded as C, which is used to determine whether the Ising model has reached the spin ground state in the second part.
[0105] In the determination of the binary digits of the two prime factors, k and h satisfy k+h=w or k+h=w+1, and in general, the difference between the two prime factors of a large integer in actual application is small, and the possibility of the same binary digits is very high. Therefore, the digits can be initially set to k=h=w / 2 or k=h=(w+1) / 2. If the correct result cannot be obtained, the digits of the two prime factors are adjusted. If there is additional digit information in the large integer decomposition problem, the binary digits of the two prime factors can be determined based on the additional information.
[0106] like Figure 3 As shown, in the multiplication vertical form of the embodiment described, an auxiliary block is constructed, and for each intermediate term a i b j , introduce auxiliary variable y i,j and z i,j , and a i b j 、y i,j 、z i,j The three items serve as an auxiliary block, where y i,j The lowest bit of the result obtained by adding the binary variables in the auxiliary block above, z i,j It should be noted that the multiplication vertical formula is listed here only to illustrate the principle of the present invention more clearly. When solving the large integer decomposition problem in practice, the large integer to be decomposed is directly substituted into the following formula: Figure 2 In the program flow shown, the transformed Ising model can be obtained without listing the multiplication formula.
[0107] For the boundary conditions described above, if \(k + h = w\), assume that the binary form of the target large integer from the highest bit to the lowest bit is \(t_1, t_2, \ldots, t\) w ; if \(k + h = w + 1\), assume that the highest bit \(t_1\) of the target large integer is 0, and its actual binary form from the highest bit to the lowest bit is \(t_2, \ldots, t\) w+1 , then there are the following boundary conditions: \(y\) i,0 = \(t\) i ; \(y\) k+1,j-1 = \(t\) k+j ; \(y\) i,h = 0; \(z\) i,h = 0; \(z\) k,j = 0; \(y\) 1,h-1 = 0; \(z\) 0,j = \(y\) 1,j-1 ; \(y\) k+1,h = 0.
[0108] For the formal equivalent replacement of the loss function, the equivalent replacement form is
[0109] As Figure 4 shown, in the second part, first set a discriminant energy \(E_{jump}\) required to jump out of the local optimal solution. The range of \(E_{jump}\) is determined by \(C\), greater than \(-C\) but close to \(-C\); randomly generate an initial spin state, and calculate the Hamiltonian in the initial spin state according to the Ising model obtained in the first part; set the number of spin state changes per iteration to \(x\), with an initial value of 1, and then start the iteration; randomly change \(x\) spin states each iteration, and judge whether the Hamiltonian of the model decreases after the change. If it decreases, accept this change, update the spin state and the corresponding Hamiltonian, and reset \(x\) to 1. If it does not decrease, enter the following judgment process:
[0110] Judge whether the value of \(x\) has not been reset after a certain number of iterations \(K(x)\). If not, perform the next iteration. If so, increase the value of \(x\) by 1, and then judge whether the current state is in the local optimal solution according to the value of \(x\). Set the judgment criterion for the local optimal solution as a positive integer \(P\). If \(x < P\), it means that it is not in the local optimal solution, and perform the next iteration. If \(x \geq P\), it means that the current state is already in the local optimal solution. Decrease \(x\) by 1, and lower the judgment criterion for updating the current spin state, so that the Hamiltonian corresponding to the current spin state is no longer calculated, but directly set to \(E_{jump}\), and then perform the next iteration.
[0111] Repeat the above iteration process until the Hamiltonian value of the current spin state is \(-C\), indicating that the Ising model has reached the spin ground state at this time, and two prime factor information can be obtained to complete the large integer factorization.
[0112] The number of iterations K(x) for determining whether to increase x is an exponential function with x as a variable, and its coefficient should be positively correlated with the number of spins in the Ising model.
[0113] The judgment criterion P of the local optimal solution should maintain a small value. Specifically, the logarithm with a base of 2 is taken for the binary digits of the decomposed large integer, and the obtained value is the approximate value of P.
[0114] For the functions or parameters such as E_jump, K(x), and P in the second part, the present invention only provides the standards and references for their definitions or values. Their specific formulas or values vary with the change of the target large integer and need to be fine-tuned according to the iterative results, but should not deviate from the definitions or value ranges given in the present invention.
[0115] like Figure 5 As shown in the figure, the number of spins of the Ising model obtained in the embodiment of the present invention is 24, and the C value is 44. It can be seen from the figure that after about 47893 iterations, the Hamiltonian is -44, and the Ising model reaches the spin ground state, thereby obtaining two prime factor information. The number of iterations 47893 is much less than the total number of spin states 2 24 , it can be seen that the iterative strategy is effective.
[0116] The two prime factor information is obtained by checking the spin state of the Ising model after reaching the ground state. The first four ground state spin states of this embodiment are "+1, -1, -1, +1" or "-1, +1, +1, -1". From this, it can be determined that the two prime factors are 11 and 13 respectively. The spin after the fourth digit represents an auxiliary variable and has no direct relationship with the value of the prime factor. After obtaining the two prime factors, substitute them into the Euler formula to get The private key exponent d in the RSA encryption algorithm and the open public key exponent e satisfy Substitute the private key exponent d and use the private key to convert the transmitted ciphertext information S into plaintext information M. The conversion formula is M≡S d mod N, M is the encrypted original data, and the RSA cryptographic system has been cracked.
[0117] Those skilled in the art will appreciate that, in addition to implementing the system, device, and various modules provided by the present invention in purely computer-readable program code, it is entirely possible to implement the same program in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, embedded microcontrollers, and the like by logically programming the method steps. Therefore, the system, device, and various modules provided by the present invention can be considered a hardware component, and the modules included therein for implementing various programs can also be considered structures within the hardware component; the modules for implementing various functions can also be considered both software programs for implementing the method and structures within the hardware component.
[0118] The above describes specific embodiments of the present invention. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art may make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. The embodiments of this application and the features in the embodiments may be combined with each other in any manner unless there is a conflict.
Claims
1. A mapping method for large integer decomposition problem based on Ising model, characterized in that: include: Step S1: introduce auxiliary variables into each intermediate term in the binary multiplication vertical formula, construct auxiliary blocks, perform formal equivalent replacement on the loss function obtained by each block so that it meets the formal requirements of the Ising model, add the loss functions of each block and perform variable substitution to simplify and obtain the Hamiltonian expression of the Ising model; Step S2: According to the distribution characteristics of the Hamiltonian values and their ranges under different spin states, a technical solution of updating the spin state from small to large is adopted, and the judgment condition is changed under certain circumstances so that it can jump out of the local optimal solution until the Ising model reaches the spin ground state; Step S3: Obtain two prime factor information to achieve large integer decomposition, further obtain the private key in the RSA encryption algorithm from the Euler formula and the public key opened in the cryptographic system, use the private key to convert the ciphertext information into the original plaintext information, and crack the RSA cryptographic system; In step S1: Generate a loss function of a specific form for each auxiliary block, substitute the boundary conditions, and perform formal equivalent replacement on each loss function so that it does not contain higher-order terms above the quadratic term and meets the formal requirements of the Ising model. Then, add all the loss functions, replace variables, and simplify them to obtain the Hamiltonian expression of the Ising model, extract the interaction matrix J and the external magnetic field vector h, and transform the large integer decomposition problem into the problem of finding the spin ground state of the Ising model. The conversion process is implemented through a fixed process, is applicable to any large integer, and is completed in a computer program. For a specific large integer, there is no need to analyze or derive the intermediate process separately, and the corresponding Ising model can be directly obtained; The auxiliary variable is based on each middle term a in the binary multiplication vertical formula of two factors. i b j Introduced one by one, that is, y i,j and z i,j , where y i,j is the lowest bit result of adding the binary variables in the auxiliary block above, z i,j is the carry from adding the binary variables in the auxiliary block on the right, a i b j ,y i,j 、z i,j The three items form an auxiliary block and generate the loss function; The loss function is in the form of F i,j =(a i b j +y i,j +z i,j -y i+1,j-1 -2z i-1,j ) 2 , the equivalent form after substitution is The loss function after equivalent replacement does not contain terms higher than quadratic, and does not require a degree reduction operation. In the Hamiltonian expression obtained after adding all of them, simplifying, and replacing variables, the coefficients of the variables are limited to a preset range, and the element sizes of the interaction matrix J of the obtained Ising model and the external magnetic field vector h are also limited. Step S1.1: Represent the target large integer to be decomposed in binary form, with the number of recorded bits being w; Step S1.2: Assume that the binary digits of the two factors of the target large integer are k and h respectively, and the binary forms from high to low are a1, a2, …, a k and b1,b2,…,b h ; Step S1.3: For each intermediate term a in the vertical form of binary multiplication of two factors i b j , introduce auxiliary variables y one by one i,j and z i,j , and a i b j ,y i,j 、z i,j Three items serve as a secondary block; Step S1.4: Each auxiliary block generates a loss function. For the auxiliary blocks on the boundary, additional auxiliary variables are introduced according to the form of the loss function and the boundary conditions are substituted; Step S1.5: Perform a formal equivalent replacement on the loss function obtained for each block so that it only contains quadratic terms; Step S1.6: Add the replaced loss functions and perform variable substitution, and then simplify to obtain the Hamiltonian expression of the Ising model; Step S1.7: Each variable in the expression is used as a spin node, and the binary quadratic term coefficients and the linear term coefficients are extracted to form the interaction matrix J and the external magnetic field vector h of the Ising model, and the sum of the remaining invariant parts is recorded as C; In step S2: Step S2.1: randomly generate an initial spin state and calculate the Hamiltonian based on the obtained Ising model; Step S2.2: Each time x spins are changed, the initial value of x is 1, and as the number of changes of the same spin state increases, x is gradually increased; Step S2.3: If the Hamiltonian after the change decreases, accept the change to the spin state and reset x to 1, otherwise continue to maintain the spin state before the change; Step S2.4: If x reaches a certain value and is still not reset, then lower the criterion for accepting a spin state change until x is reset; Step S2.5: Repeat the process steps S2.2 to S2.4 until the Hamiltonian corresponding to the spin state is -C, indicating that the Ising model has reached the spin ground state and contains two prime factor information of the target large integer, thus achieving large integer decomposition; The lowering of the judgment standard for accepting a spin state change is achieved by setting a judgment energy E_jump required to jump out of the local optimal solution, so that the Hamiltonian corresponding to the current spin state is no longer calculated, but is directly set to E_jump, and then the iterative process is repeated until the Hamiltonian is updated again.
2. A mapping system for large integer decomposition problems based on the Ising model, characterized in that: include: Module M1: Introduce auxiliary variables for each intermediate term in the binary multiplication vertical form, construct auxiliary blocks, perform formal equivalent replacement on the loss function obtained in each block to make it meet the formal requirements of the Ising model, add the loss functions of each block and make variable substitutions to simplify the Hamiltonian expression of the Ising model; Module M2: Based on the distribution characteristics of the Hamiltonian value and its range under different spin states, a technical solution is adopted to update the spin state from small to large, and the judgment conditions are changed under specific circumstances so that it can jump out of the local optimal solution until the Ising model reaches the spin ground state; Module M3: Obtain two prime factor information to achieve large integer decomposition, and further obtain the private key in the RSA encryption algorithm from the Euler formula and the public key opened in the cryptographic system. Use the private key to convert the ciphertext information into the original plaintext information to crack the RSA cryptographic system; In the module M1: Generate a loss function of a specific form for each auxiliary block, substitute the boundary conditions, and perform formal equivalent replacement on each loss function so that it does not contain higher-order terms above the quadratic term and meets the formal requirements of the Ising model. Then, add all the loss functions, replace variables, and simplify them to obtain the Hamiltonian expression of the Ising model, extract the interaction matrix J and the external magnetic field vector h, and transform the large integer decomposition problem into the problem of finding the spin ground state of the Ising model. The conversion process is implemented through a fixed process, is applicable to any large integer, and is completed in a computer program. For a specific large integer, there is no need to analyze or derive the intermediate process separately, and the corresponding Ising model can be directly obtained; The auxiliary variable is based on each middle term a in the binary multiplication vertical formula of two factors. i b j Introduced one by one, that is, y i,j and z i,j , where y i,j is the lowest bit result of adding the binary variables in the auxiliary block above, z i,j is the carry from adding the binary variables in the auxiliary block on the right, a i b j ,y i,j 、z i,j The three items form an auxiliary block and generate the loss function; The loss function is in the form of F i,j =(a i b j +y i,j +z i,j -y i+1,j-1 -2z i-1,j ) 2 , the equivalent form after substitution is The loss function after equivalent replacement does not contain terms higher than quadratic, and does not require a degree reduction operation. In the Hamiltonian expression obtained after adding all of them, simplifying, and replacing variables, the coefficients of the variables are limited to a preset range, and the element sizes of the interaction matrix J of the obtained Ising model and the external magnetic field vector h are also limited. Module M1.1: Represent the target large integer to be decomposed in binary form, with the number of bits recorded being w; Module M1.2: Assume that the binary digits of the two factors of the target large integer are k and h respectively, and the binary forms from high to low are a1, a2, …, a k and b1,b2,…,b h ; Module M1.3: For each middle term a in the vertical form of binary multiplication of two factors i b j , introduce auxiliary variables y one by one i,j and z i,j , and a i b j ,y i,j 、z i,j Three items serve as a secondary block; Module M1.4: Each auxiliary block generates a loss function. For auxiliary blocks on the boundary, additional auxiliary variables are introduced according to the form of the loss function and the boundary conditions are substituted; Module M1.5: Perform a formal equivalent replacement on the loss function obtained for each block so that it only contains quadratic terms; Module M1.6: Add the replaced loss functions and perform variable substitution, then simplify to obtain the Hamiltonian expression of the Ising model; Module M1.7: Each variable in the expression is used as a spin node, and the coefficients of the binary quadratic term and the linear term are extracted to form the interaction matrix J and the external magnetic field vector h of the Ising model, and the sum of the remaining invariant parts is recorded as C; In the module M2: Module M2.1: Randomly generate the initial spin state and calculate the Hamiltonian based on the obtained Ising model; Module M2.2: Each time x spins are changed, the initial value of x is 1. As the number of changes to the same spin state increases, x gradually increases. Module M2.3: If the Hamiltonian decreases after the change, accept the change to the spin state and reset x to 1, otherwise continue to maintain the spin state before the change; Module M2.4: If x reaches a certain value and is not reset, lower the criterion for accepting a spin state change until x is reset; Module M2.5: Repeat the process from module M2.2 to module M2.4 until the Hamiltonian corresponding to the spin state is -C, indicating that the Ising model has reached the spin ground state and contains the two prime factors of the target large integer, thus achieving large integer decomposition; The lowering of the judgment standard for accepting a spin state change is achieved by setting a judgment energy E_jump required to jump out of the local optimal solution, so that the Hamiltonian corresponding to the current spin state is no longer calculated, but is directly set to E_jump, and then the iterative process is repeated until the Hamiltonian is updated again.
Citation Information
Patent Citations
Method and system for decomposing large integer based on DNA self-assembly calculation
CN101814109A
Method for realizing Isin model
CN114444016A
Calculation system, calculation method, and computer program
JP2021117911A