RSA factorization method and system based on three-dimensional space search
By employing a 3D spatial search method to perform a quadratic search on the RSA modulus N within a 3D cube, the problem of low efficiency in RSA factorization is solved, thus improving the security of the RSA public-key cryptosystem.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU INST OF APPLIED SCI & TECH
- Filing Date
- 2025-08-04
- Publication Date
- 2026-05-08
AI Technical Summary
Existing technologies for RSA factorization are not efficient and struggle to efficiently factor large integer prime factors, which affects the security of RSA public-key cryptosystems.
A three-dimensional spatial search method is adopted to transform the RSA modulus N into a three-dimensional cube that can be represented within a height not exceeding log2N. The quad search method is then used to recursively search and decompose the RSA modulus N into two factors p and q.
This achieves efficient factorization of the RSA modulus N, improving the efficiency of RSA factorization and enhancing the security of the RSA public-key cryptosystem.
Smart Images

Figure CN120974034B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cryptography, and in particular to an RSA factorization method and system based on three-dimensional spatial search. Background Technology
[0002] Integer factorization in cryptography refers to the process of factoring an integer into the product of two or more prime numbers. This process is central to modern cryptography, especially for the security of encryption algorithms such as the RSA public-key cryptosystem.
[0003] The difficulty of integer factorization depends on the size, form, and distribution of prime factors of the given numbers. For large integers, especially semiprime numbers (i.e., the product of two distinct prime numbers), the factorization process is extremely difficult. Currently, there is no known polynomial-time algorithm that can efficiently perform integer factorization. Therefore, integer factorization is considered a "one-way problem," meaning it is easy to generate but difficult to solve in reverse.
[0004] The difficulty of factoring large integers is the theoretical foundation for the security of many modern cryptographic systems. For example, the RSA public-key cryptosystem is designed based on the difficulty of factoring large integers. In the RSA system, key generation involves choosing two large prime numbers p and q and calculating their product n = pq. Encryption and decryption operations rely on modulo n operations. Because recovering p and q from n is extremely difficult, RSA's security is guaranteed. Currently, factoring large integers remains a difficult problem, and no efficient factorization method has yet emerged. Summary of the Invention
[0005] In view of this, in order to solve the technical problem of low factorization efficiency in existing integer factorization methods, this invention proposes an RSA factorization method based on three-dimensional space search, the method comprising the following steps:
[0006] Obtain the RSA modulus N;
[0007] Set the maximum number of iterations k max , Let the current iteration number k = k max Proceed to the iteration step:
[0008] Random selection Calculate S + =F + (k,p,q)=2 k pq+q and S-=F-(k,p,q)=2 k pq-q;
[0009] According to the quadtree partitioning principle, with S+ and S - Using the hyperboloid F as the base point, + (k,p,q) and F - (k, p, q) are each divided into four sub-surfaces, such as as well as
[0010] Decision: If N is in Above, that is, there exists a set (k, p, q) such that N = 2 k pq+q or N=2 k If pq - q, output (k, p, q), stop the calculation; otherwise, recursively continue the calculation. Repeat the process of partitioning, searching, and judging until N is found or the search limit is reached;
[0011] If N is not found, the value of k is considered a failure, and the value of k is decremented by one before entering the next loop.
[0012] If N is still not found when k becomes 1, then the decomposition of N is considered to have failed.
[0013] In some embodiments, the RSA factorization method can be performed serially or in parallel.
[0014] Based on the above scheme, the present invention provides an RSA factorization method and system based on three-dimensional spatial search. By converting the RSA modulus N into data that can be represented in a three-dimensional cube with a height not exceeding log2N, this data is divided into log2N layers. A quad search method is implemented in each layer for recursive search, which can efficiently search for the factors of N. Attached Figure Description
[0015] Figure 1 This is the three-dimensional search space of a specific embodiment of the present invention. Detailed Implementation
[0016] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0017] It should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings. Unless otherwise specified, the embodiments and features described in this application can be combined with each other.
[0018] It should be understood that the terms "system," "apparatus," "unit," and / or "module" used in this application are a method of distinguishing different components, elements, parts, sections, or assemblies at different levels. However, if other terms can achieve the same purpose, they may be replaced by other expressions.
[0019] As indicated in this application and claims, unless the context clearly indicates otherwise, the words "a," "an," "a," and / or "the" are not specifically singular and may include the plural. Generally, the terms "comprising" and "including" only indicate the inclusion of expressly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements. An element defined by the phrase "comprising an..." does not exclude the presence of other identical elements in the process, method, product, or apparatus that includes the element.
[0020] In the description of the embodiments of this application, "a plurality of" refers to two or more. The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
[0021] Furthermore, flowcharts are used in this application to illustrate the operations performed by the system according to embodiments of this application. It should be understood that the preceding or following operations are not necessarily performed precisely in sequence. Instead, the steps can be processed in reverse order or simultaneously. Additionally, other operations can be added to these processes, or one or more steps can be removed from them.
[0022] Before providing specific embodiments of the present invention, the terminology and mathematical principles used herein are disclosed.
[0023] The symbol a|b indicates that b divides a, and the symbol (a,b) indicates the greatest common divisor of a and b. All odd numbers described in this invention are greater than 1. Notation Let X represent the floor function, which is the largest integer not exceeding x. O(X) represents the computation time for searching in no more than X steps.
[0024] Theorem 1. Positive integer k and real number x must satisfy...
[0025]
[0026] Proof. According to the properties of the floor function, we have:
[0027]
[0028] Therefore, this is proven.
[0029] Theorem 2. Let p be an odd number greater than 1, then and It is impossible for both numbers to be even.
[0030] Proof: Let If is an even number, then there exists an integer k such that Therefore, p = 4k + 1, and thus It is an odd number. Similarly, it can be proven that: if If it is an even number, then It is an odd number. Therefore, the theorem is proved.
[0031] Theorem 3. A theorem of the form 2 k Odd numbers with +1 can always be represented in the form of 2. α The form p-1, where k > 1, α is a positive integer, and p > 1 is an odd number. A number of the form 2 k Odd numbers of -1 can always be represented as 2. β The form is q+1, where k>2, β is a positive integer, and q>1 is an odd number.
[0032] prove:
[0033] With 2 k Taking +1 as an example. When k=2, 2 2 +1 = 2 × 3 - 1, the conclusion holds. Assume k = n holds, let 2 n +1 = 2 β p n -1, where β is positive integer, p n If it is an odd number, then 2 n+1 =1=2(2) n )+1=2(2 β p n -2)+1=2(2 β p n -1)-1. According to the principle of mathematical induction, this also holds true when k = n+1.
[0034] Theorem 4. Let p and s be odd numbers and p > 1, p|s; then if If it is an odd number greater than 1, then like If it is an odd number
[0035] Proof. Without loss of generality, let s = pt, where t is an odd number greater than 1; then we have st = (p-1)t and s+t = (p+1)t. Since s and t are both odd, ... and All are integers. Because use Even if the theorem is proven, replacing t will prove it.
[0036] From the aforementioned theorem, it is not difficult to derive the following conclusion:
[0037] Conclusion 1. Let p and s be odd numbers satisfying p > 1 and p < s; then, if p | s, then we must have and Here, k is an integer greater than 0.
[0038] Conclusion 2. Given an odd number N, if there exist odd numbers p and s such that p|s, or Then (2) k p-1)|N or (2 k p+1)|N.
[0039] Conclusion 3. Let k be a positive integer, and p and s be positive odd numbers satisfying s≥3; if for some odd number N greater than 3, ... but and
[0040] Proof of this conclusion: Depend on We get k > log2N, and then This is F. - >N, so there is obviously also F + >N.
[0041] Based on conclusion 3 above, available Let s = pq satisfy q > 1; then N = 2 k pq±q=(2 k p±1)q. From conclusion 1 above, this means that... lead to and then Another situation is lead to Therefore, p, q, and k are in the range When the internal structure changes, a spatial cube can be obtained, such as... Figure 1 As shown. Find a point (p, q, k) within this cube such that N = 2. k pq+q or N=2 k pq-q can decompose N.
[0042] make:
[0043] F + (k,p,q)=2 k pq+q, F - (k,p,q)=2 k pq-q
[0044] Therefore, given a k, the above two equations can yield two non-intersecting hyperboloids formed by the transformations of p and q. In fact, with F...+ Taking (k,p,q) as an example, since k1>k2, Therefore, the range of k can be determined by F. + (k,p,q) or F - The minimum and maximum values of (k, p, q) are determined. Because F + (k,p,q) and F - A bilinear function of p and q that is symmetric to (k, p, q), whose maximum value is near the center of the surface, can be concluded that: if min(F + (k,p,q))≤max(F + (k,p,q)), then N in F + On (k,p,q); if min(F) - (k,p,q))≤max(F - (k,p,q) then N lies in F - (k,p,q) on.
[0045] The RSA factorization method based on 3D spatial search proposed in this invention may include, but is not limited to, the following steps:
[0046] Input: RSA modulus N;
[0047] Step S1, Calculation and Where K max Indicates the maximum number of iterations;
[0048] Step S2: Let the current iteration number k = k max ;
[0049] Step S3, Randomly select Calculate S + =F + (k,p,q)=2 k pq+q and S - =F - (k,p,q)=2 k pq-q;
[0050] Step S4: According to the quadtree partitioning principle, with S... + and S - Using the hyperboloid F as the base point, + (k,p,q) and F - (k, p, q) are each divided into four sub-surfaces, such as as well as
[0051] Step S5: Determine the subsurface where N is located, such as... If N is Above, that is, there exists a set (k, p, q) such that N = 2k pq+q or N=2 k If pq - q, output (k, p, q), stop the calculation; otherwise, in Repeat steps S4 and S5 until N is found or the search baseline is reached to terminate the search.
[0052] Step S6: If N is not found, this k value fails. Execute k = k-1 and enter the loop for the next k.
[0053] Step S7: If N is not found even after k reaches 1, then all k have failed, and the N decomposition is declared a failure.
[0054] Based on the above scheme, and referring to Figure 1 The specific 3D search space is given, and this algorithm can be performed serially or in parallel.
[0055] example:
[0056] / / unsigned long N=47871; / / OK 591*81
[0057] / / unsigned long N=152703; / / OK 2679*57
[0058] / / unsigned long N=462679; / / OK 66097*7
[0059] / / unsigned long N=229501; / / Ok 12079*19
[0060] / / unsigned long N=400789; / / Ok 877*457
[0061] / / unsigned long N=429496729; / / OK 22605091*19
[0062] / / unsigned long N=371811; / / OK 6523*57
[0063] Table 1 shows the decomposition of Mersenne and Fermat numbers.
[0064]
[0065]
[0066] Table 2. Some examples of RSA number decomposition
[0067]
[0068] An RSA factorization system based on 3D spatial search:
[0069] At least one processor;
[0070] At least one memory for storing at least one program;
[0071] When the at least one program is executed by the at least one processor, the at least one processor implements the RSA factorization method based on 3D spatial search as described above.
[0072] The content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0073] A storage medium storing processor-executable instructions, which, when executed by a processor, are used to implement an RSA factorization method based on 3D spatial search as described above.
[0074] The content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0075] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.
Claims
1. A method for RSA factorization based on 3D spatial search, characterized in that, Includes the following steps: Obtain the RSA modulus N; Set the maximum number of iterations Entering the loop step: The initial value of the loop variable k is k. max ; exist Choose any number from the interval, denoted as p; Choose any number from the interval, denoted as q; calculate S. + =F + (k,p,q)=2 k pq+q and S - =F - (k,p,q)=2 k pq-q; According to the quadtree partitioning principle, with S + and S - Using the hyperboloid F as the base point, + (k,p,q) and F - (k, p, q) are each divided into four subsurfaces; Execution decision: If there exists a set (k, p, q) such that N = 2 k pq+q or N=2 k If pq-q, it means that N is found on the corresponding surface, and (k, p, q) is output; if it does not exist, the surface is re-divided on the sub-surface for judgment, and the surface division step and judgment step are repeated until N is found or the search limit is reached. If N is not found when the search limit is reached, then k = k-1, and the next iteration begins; The iteration loop continues until N is found or k = 1 is reached.
2. The RSA factorization method based on 3D spatial search according to claim 1, characterized in that, The method described above employs a parallel search approach.
3. The RSA factorization method based on 3D spatial search according to claim 1, characterized in that, The search method described above is a serial search.
4. An RSA factorization system based on three-dimensional spatial search, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the RSA factorization method based on 3D spatial search as described in any one of claims 1-3.
Citation Information
Patent Citations
Efficient RSA encryption and decryption method and efficient RSA encryption and decryption coprocessor
CN101599828A
RSA public key decomposition method and system
CN115314210A