RSA password decomposition method and system based on dynamic search
By introducing dynamic distributed parallel search computing network and LCG sampling method into the RSA cryptographic decomposition method, the problem of difficulty in integer decomposition is solved, efficient decomposition of large integers is achieved, and the security of the cryptographic system is enhanced.
Patent Information
- Application Number
- CN202510374919.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-06-27
AI Technical Summary
In the existing RSA cipher decomposition method, integer decomposition is difficult, resulting in low decomposition efficiency of large integers.
A method of RSA cryptography decomposition based on dynamic search is proposed. By constructing a dynamic distributed parallel search calculation network, search calculations are implemented on rectangular areas, and LCG sampling method randomly sample search calculation objects to realize large-scale parallel search calculations to decompose RSA modulus N.
Through dynamic distributed parallel search computing network, the efficiency of RSA password decomposition is improved, large integers can be decomposed more effectively, and the security of the cryptographic system is enhanced.
Smart Images

Figure CN120223314A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cryptography, and in particular, to an RSA cryptographic decomposition method and system based on dynamic search. Background Art
[0002] The RSA cryptographic system is an asymmetric encryption algorithm widely used in data encryption and digital signatures, and its security is based on the difficulty of factoring large integers.
[0003] The security of public-key cryptographic systems (such as RSA) depends on the intractability of mathematical problems, especially the problem of factoring large integers. The core of RSA is that its modulus N = p×q is the product of two large prime numbers, and the key to breaking RSA is to factor N to recover the private key. Therefore, the research on integer factorization algorithms is crucial for the security of public-key cryptography.
[0004] To enhance security, RSA moduli are getting larger and their factorization difficulty is increasing. The trial division method is the earliest known integer factorization method, and the currently commonly used factorization methods are very inefficient for factoring large integers. Summary of the Invention
[0005] In view of this, to solve the technical problem of the large difficulty of integer factorization in the existing RSA cryptographic decomposition methods, in a first aspect, the present invention proposes an RSA cryptographic decomposition method based on dynamic search, and the method includes the following steps:
[0006] Input and define parameters, and construct a rectangular area;
[0007] Construct a dynamic distributed parallel search computing network and perform search computing on the rectangular area;
[0008] Number the computers participating in the calculation in the dynamic distributed parallel search computing network and divide independent sub-regions from the rectangular area;
[0009] In the independent sub-regions, divide independent calculation blocks for each core participating in the calculation;
[0010] Divide the independent calculation blocks into 2 M independent calculation units, and randomly sample them using the LCG sampling method to obtain search computing objects;
[0011] For newly added computers, query the job status and the remaining unallocated columns on the rectangular area from the configuration file;
[0012] If the remaining unallocated columns are 0, the computer exits the calculation;
[0013] If there are unallocated remaining columns, calculate its independent sub - partition from the unallocated remaining columns according to the number of cores contributed by the computer and the core contribution degree, and update the configuration file;
[0014] The configuration file records the task completion status, the allocated and remaining columns on the numbered rectangular area of the current computer;
[0015] When any core or process finds the required result, the task is completed;
[0016] If the current computer fails to find the required result in the searched independent sub - partition, its task is also completed;
[0017] Before exiting the calculation after completing the task, the computer updates the configuration file.
[0018] In a second aspect, the present invention also proposes a dynamic - search - based RSA password decomposition device, including:
[0019] At least one multi - core (multi - processor) computer;
[0020] At least one memory for storing at least one program;
[0021] When the at least one program is executed by the at least one processor, the at least one processor implements a dynamic - search - based RSA password decomposition method as described above.
[0022] Based on the above - mentioned scheme, the present invention provides a dynamic - search - based RSA password decomposition method and system, which proposes a set (aggregate) on a two - dimensional rectangular lattice point; arranged in rows and columns, each row of this aggregate contains integers with p and q as factors, and is almost periodically densely distributed at multiple positions in the column direction. Also, according to the requirements of parallel computing, a method for partitioning the lattice point area and a dynamic distributed parallel computing network structure based on this partitioning are proposed, which can perform large - scale parallel search calculations on the aggregate. Using the search network designed by the present invention together with the classical search method to search the aggregate and find the greatest common divisor of N and the searched element can obtain p or q, realizing the decomposition of N, which is helpful for the subsequent development of the password system. Description of the Drawings
[0023] Figure 1 Is the step flow chart of a dynamic - search - based RSA password decomposition method of the present invention;
[0024] Figure 2 Is the schematic diagram of the rectangular area obtained in the specific embodiment of the present invention with N = 55 and g = 2;
[0025] Figure 3It is a schematic diagram of the distribution of the number of hosts and non-hosts in the rectangular area obtained in the specific embodiment N = 55 and g = 2 of the present invention;
[0026] Figure 4 It is a schematic diagram of the distribution of the number of hosts and non-hosts in the rectangular area obtained in the specific embodiment N = 55 and g = 3 of the present invention;
[0027] Figure 5 It is a small area on the rectangular area in the specific embodiment of the present invention and the number of hosts therein;
[0028] Figure 6 It is a schematic diagram of dividing independent sub-regions in the specific embodiment of the present invention;
[0029] Figure 7 It is a schematic diagram of dividing independent calculation blocks in the specific embodiment of the present invention;
[0030] Figure 8 It is a schematic diagram of dividing independent calculation units in the specific embodiment of the present invention;
[0031] Figure 9 It is a schematic diagram of the operation of the dynamic distributed parallel search computing network in the specific embodiment of the present invention. Specific Embodiments
[0032] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0033] It should be noted that for the convenience of description, only the parts related to the relevant invention are shown in the drawings. Without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.
[0034] As shown in the present application and the claims, unless the context clearly indicates an exceptional situation, words such as "a", "one", "kind" and / or "the" are not specifically singular, but may also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of the clearly identified steps and elements, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements. The element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, commodity or device including the element.
[0035] In the description of the embodiments of the present application, "a plurality" means two or more than two. The following terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features.
[0036] In addition, flowcharts are used in the present application to illustrate the operations performed by the systems according to the embodiments of the present application. It should be understood that the operations before or after do not necessarily need to be executed precisely in sequence. On the contrary, they can be executed in reverse order or simultaneously. At the same time, other operations can also be added to these processes, or one or several steps of operations can be removed from these processes.
[0037] Referring to Figure 1 , which is a schematic flowchart of an optional example of the RSA cryptography decomposition method based on dynamic search proposed by the present invention. This method can be applied to computer devices. The cryptography decomposition method proposed in this embodiment may include but is not limited to the following steps:
[0038] S1. Define parameters: N, and the densification repetition degree g;
[0039] Among them, the densification repetition degree g: the integer x appears continuously adjacent to each other g times in an integer set. For example, in the set {1, 2, 3, 3, 3, 3, 4, 5, 6}, the densification repetition degrees of 1, 2, 4, 5, and 6 are 1, while the densification repetition degree of 3 is 4. The floor function is a function that rounds x downwards, that is: the largest integer not exceeding x, mathematically expressed as For example: if x = 3.12345, then
[0040] S2. Construct a rectangular area;
[0041] S3. Construct a dynamic distributed parallel search computing network and perform search computing on the rectangular area;
[0042] S4. Divide independent sub - partitions from the rectangular area for the computers participating in the computing in the dynamic distributed parallel search computing network;
[0043] S5. In the independent sub - partitions, divide independent computing blocks for each core participating in the computing;
[0044] S6. Divide the independent computing blocks into 2 M independent computing units, and use the LCG sampling method to perform random sampling on them to generate search computing objects;
[0045] S7, Res = Search(iccLeft, iccTop, iccRight, iccBottom) performs a search on the selected independent computing unit; if Res > 1, it proves that the required result is found and the task is completed; if Res = 1, continue the calculation of the next computing object until all independent computing units are traversed. "Search" means a small search, and all the aforementioned search calculations can use small searches, that is, various classic and mature search algorithms, such as brute-force search (BS), simple random walk search (SRW), Brownian motion search (BM), and even machine learning search algorithms. These algorithms are all mature and can be directly applied to the programs of the system.
[0046] Since the rows of ICC are the same, if brute-force search is used, take iccBottom = 1, that is, only search one row. As long as no host number is found in this row, directly return 1; if a host number is found, return the greatest common divisor of the host number and N. The specific operation depends on the small search method used.
[0047] Host number: An alias for multiple. If an integer x is a multiple of an integer y, then x is called the host number of y. For example, 35 is the host number of 5 and 7, and 10 is the host number of 5 and 2.
[0048] S8. Update the configuration file.
[0049] Record the parameters, the ID of the computer that joined the calculation last time, the total number of columns already allocated on the rectangular area, and the remaining unallocated columns in the configuration file.
[0050] In some feasible embodiments, step S2 specifically includes:
[0051] For a given RSA modulus N = pq, where p and q are both odd prime numbers and p < q, take and the densification repetition degree g; restrict the integer variables X and Y within the following ranges:
[0052]
[0053] Let
[0054]
[0055] Then calculate (N - p u )(g(p u - p b - 2) + 2) integers. If X is regarded as the row coordinate changing from top to bottom and Y as the column coordinate changing from left to right, then these integers are arranged row by row and column by column in the N - p u rows and g(p u - pb -2) + 2 columns form a rectangular area. Denote this area as Π.
[0056] Since g can be calculated or set in advance (the specific calculation method does not belong to the content of the present invention), p b , p u are all calculated in advance, so the said Π is an existing aggregate.
[0057] The area Π has the characteristic of a dense host number: all its rows are the same (because the calculation result of (2) has nothing to do with X); according to Mathematical Theorems 1 and 2, if p does not divide then each row contains (p + q) / 2 - 2 hosts of p or q; and if p divides then each row contains (p + q) / 2 - 1 hosts of p or q; each host number appears with a repetition degree of g inside Π.
[0058] Taking N = 55 and g = 2 as an example, calculate p b = 19, p u = 29, and the obtained Π is as shown in 2 Figure 2 shown.
[0059] If the hosts of 5 and 11 in Π are represented by small circles o and the non-hosts are represented by dots., the distribution of the hosts and non-hosts as shown in Figure 2 is obtained. Figure 3 shown.
[0060] If g = 3 is taken, the distribution of the hosts and non-hosts as shown in Figure 4 is obtained.
[0061] The properties of the above-mentioned area Π can be proved mathematically. In fact, the number of host numbers in each row has been given by the aforementioned Mathematical Theorems 1 and 2. The following is the proof:
[0062] 1) Inside a row (i.e., the non-boundary part), if a host number appears, it appears continuously g times.
[0063] 2) Inside a row, among any continuous numbers whose number exceeds gp, there must be g hosts of p or q.
[0064] Proof: First, prove conclusion 1). In equation (2), the change of Y affects the elements of each column. Arbitrarily take a Y and consider the value of the integer , where the integer k ≥ 0. Since According to the property of the floor function:
[0065]
[0066] Or
[0067]
[0068] Since k<g Therefore, when k changes from 0 to g-1, there are g k such that This shows that when considering the boundary, the ω calculated according to formula (2) X,Y There must be g consecutive repeated values each time in the Y direction; however, due to boundary limitations, there may be less than g repeated values on the boundary, which destroys this rule.
[0069] Prove conclusion 2). When the repetition is 1, each row contains continuously distributed integers. According to the properties of integers, any p consecutive integers must contain p host numbers. According to the aforementioned mathematical theorem, the minimum spacing between two host numbers of p or q is 0 and the maximum is p-1. When the repetition is g>1, the corresponding spacing is synchronously magnified by g times. Therefore, conclusion 2) holds.
[0070] The above properties of Π can be simply described as: the number of hosts in it is sparse overall but dense locally. This property makes them more likely to appear in some local areas and easy to find in these small areas through small searches, such as Figure 5 shown.
[0071] It should be noted that before N is decomposed, p and q are unknown. It is impossible to directly find Figure 5 In that case, there will be small areas that just contain the number of hosts, but the distribution pattern of the number of hosts on π will not change. Therefore, it is very important to design a suitable method to partition so that it is easy to find such small areas that contain the number of hosts. In addition, a larger N will produce a huge π. These small partitions are also the basis for implementing parallel search calculations on π.
[0072] In some feasible embodiments, the dynamic distributed parallel search computing network in step S3 is specifically as follows:
[0073] In order to implement efficient search on Π, a dynamic distributed parallel search computing network (D 2 PRX). The network is open to all computers that are willing to contribute computing and perform search computing on the PI. Dynamic means that computers that intend to join the computing can request tasks to join the computing at any time (but cannot exit before completing the requested tasks), unless the PI has been fully allocated or the computing task has been completed.
[0074] In some feasible embodiments, steps S3-S6 specifically include:
[0075] The size and layout of the small area are the two most important factors affecting the partitioning scheme: the size determines the local search efficiency, and the layout determines the complexity of the partitioning process. The simplest partition isFigure 5 As shown, the entire Π is filled with small rectangles. However, such a simple partition has limitations because the overall sparse and locally dense characteristics of the host numbers mean that they may not exist at all in some small regions. Such a partition is suitable for the case where N is small or N contains many factors, resulting in a dense distribution of host numbers everywhere. Since RSA numbers only contain 2 factors and N is large, a simple partition is not appropriate.
[0076] According to the structural characteristics of the rows and columns of Π and the requirements of distributed parallel computing, the present invention adopts the method of "sausage - type column - based three - partition".
[0077] Step S4: Allocate an independent sub - partition (ISS) from the unpartitioned part of Π to each computer participating in the calculation. As Figure 6 shown. After the first machine obtains the sub - partition ISS1, the second machine then allocates the sub - partition ISS2 from the unpartitioned part, and so on until the entire Π is partitioned. This is the first sausage - cutting: each machine corresponds to an ISS.
[0078] Calculation method for the number of columns included in ISS: It is agreed that the machine contribution degree C J is the number of columns included in ISS. If the number of cores participating in the calculation of the computer is m and the core contribution degree is C h = B c H, then the number of columns included in ISS is C J = mB c H.
[0079] The core calculation base B c usually takes the main frequency of the computer, with the unit of GHz. Since 1 GHz = 2 30 Hz ≈ 10 9 Hz, the estimated core - hour calculation ability is:
[0080] C = B c × 2 30 × 3600 ≈ B c × 2 43 (≈ B c × 10 9 × 3600 ≈ 3B c × 10 12 );
[0081] If the core's computing time is 100 hours, then the core contribution degree is:
[0082] C h = B c × 2 30 × 3600 × 100 ≈ B c × 2 48 (≈ 3B c × 10 14).
[0083] If 8 cores are involved in the operation, the contribution degree of the machine is:
[0084] C J = 8 × B c × 2 30 × 3600 × 100 ≈ B c × 2 51
[0085] For the convenience of later software design, the present invention requires expressing the core contribution degree as C h = 2 σ K, where K is an integer in the form of 4x + 1.
[0086] Step S5: The ISS assigns an independent computing block (ISZ) to each core participating in the calculation. Since one machine processes one ISS, that is, m cores jointly process an ISS containing C J = mB c H, the number of columns contained in each independent computing block is equal to the core contribution degree C h = B c H. This is the second sausage cutting, as Figure 7 shown. The second sausage cutting ensures that each core is responsible for the calculation on an independent computing block.
[0087] Step S6: Divide independent computing units (ICC) in the ISZ. For a relatively large N, the ISZ is also large. According to the structural characteristics of Π, there may be a part or even all columns in an ISZ that do not contain host numbers. Since the ISZ is processed by one core, it will take a lot of time to conduct a full - scale search. Therefore, the present invention further divides the ISZ into several ICCs and adopts the LCG sampling method to randomly select an ICC for search each time. This forms the third sausage cutting, as Figure 8 shown. To meet the requirements of the LCG sampling method, the number of ICCs should be an integer in the form of 2 M . The third sausage cutting provides 2 M ICCs for the core to randomly sample among 2 M ICCs and select one as the search and calculation object each time.
[0088] Because the ISS contains C J = 2 σ mK columns and is divided into m ISZs, each ISZ contains 2 σ K columns and can be divided into 2 σ ICCs, each containing K columns.
[0089] The present invention stipulates that the number of rows included in the ICC can be determined according to the adopted search method. Generally, the ICC is regarded as a small square, and at this time, the ICC should include K rows; if brute-force search is adopted, 1 row is taken. This is very easy to handle in program design because both m and C h = 2 σ and K are input as parameters in advance.
[0090] In some feasible embodiments, step S7 specifically includes:
[0091] Search for a point in the independent computing unit, and calculate ω by combining the coordinates of this point and formula (2) x,y , as the element h of this point, calculate the greatest common divisor of h and N, that is, Res = gcd(h, N). If Res > 1, it proves that the required result is found, and the task is completed; if Res = 1, then calculate the next independent computing unit until a point is found such that Res > 1 or the search and calculation of all independent computing units are completed.
[0092] In some feasible embodiments, the job mechanism of the foregoing dynamic distributed parallel search computing network D 2 PRX is specifically as follows:
[0093] Regard the set of all machines participating in the calculation as a machine queue, assign an ID to each multi-core computer participating in the calculation, denoted as cID, and allocate an ISS to each machine according to the queue management principle of first in first out (FIFO), the foregoing ISS allocation principle and method, as Figure 9 shown. In the figure, the arc with an arrow represents the allocation process, and the wavy line represents the omitted part.
[0094] The system designates one machine as the root host, which is responsible for the communication of the entire system. It records the basic parameters g of the system, the cID of the last calculation added, the total number of columns already allocated on Π, and the remaining number of columns in the unallocated part in a configuration file, the rgTable file. Each newly added machine first retrieves this tgTable from the root host to query the job status and the number of columns in the unallocated part on Π. If the number of unallocated columns is 0, there is no need for this machine to participate in the calculation, and it exits directly. If the file does not exist, it creates one and records the corresponding information. Then, it calculates its own ISS from the unallocated part of Π according to the number of cores and contribution degree it contributes, and updates the rgTable with its own cID, the total number of allocated columns, and the new number of unallocated columns. Next, within its ISS, it allocates ISZ for each core according to the number of cores contributed and starts the parallel processes of each core. After each core enters the calculation process, it first plans the ICC it needs, then randomly selects the ICC using the LCG sampling method and selects a suitable search algorithm to search for and calculate p or q (determined by calculating the greatest common divisor of the searched element and N). Once any core or process finds the required result, the task is completed. Immediately, it stores the calculation results (the obtained p or q, the location, the number of operations, etc.) locally, backs up the calculation results on the root host, updates the rgTable of the root host, and exits the operation after notifying the root host. After receiving the successful message, the root host notifies other machines to stop the operation.
[0095] D 2 Each machine in the PRX system uses the same algorithm. The difference lies in the position and size of their respective ISS, because these two data depend on the cID, the number of cores, and the contribution degree of the machine. Therefore, the input parameters of the algorithm are: N, the RSA modulus to be decomposed; m, the number of cores contributed by this machine; C, the core contribution degree (i.e., the core calculation base × calculation time).
[0096] An RSA cryptographic decomposition device based on dynamic search:
[0097] At least one multi-core (multi-processor) computer;
[0098] At least one memory for storing at least one program;
[0099] When the at least one program is executed by the at least one processor, the at least one processor implements an RSA cryptographic decomposition method based on dynamic search as described above.
[0100] The content in the above method embodiments is applicable to the device embodiments of the present invention. The functions specifically implemented in the device embodiments of the present invention are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those in the above method embodiments.
[0101] A storage medium stores instructions executable by a processor. The instructions executable by the processor, when executed by the processor, are used to implement a method for RSA cryptography decomposition based on dynamic search as described above.
[0102] The content in the above method embodiments is applicable to the present storage medium embodiment. The functions specifically implemented by the present storage medium embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.
[0103] The above is a specific description of the preferred embodiments of the present invention. However, the present invention is not limited to the described embodiments. Those skilled in the art can make various equivalent deformations or substitutions without departing from the spirit of the present invention. These equivalent deformations or substitutions are all included within the scope defined by the claims of this application.
Claims
1. A RSA password decomposition method based on dynamic search, characterized in that: The following steps are involved: Definition parameters: N, and densification repetition g; Construct a rectangular region according to the defined parameters; Constructing a dynamic distributed parallel search computing network and performing search computing on the rectangular area; Dividing independent sub-partitions from the rectangular area for computers participating in the calculation in the dynamic distributed parallel search computing network; In the independent sub-partition, an independent computing block is divided for each core involved in computing; Divide the independent calculation block into 2 M An independent computing unit is used, and a LCG sampling method is used to perform random sampling in the independent computing unit to generate a search computing object; When any one core or process finds the required result, the task is completed.
2. According to the RSA password decomposition method based on dynamic search as claimed in claim 1, it is characterized in that: The step of constructing a rectangular area according to the defined parameters specifically includes: according to Calculate multiple integers, the number of integers is calculated as follows: u )(g(p u -p b -2)+2), distributed in Np u Line, g(p u -p b -2)+2 columns form a rectangular area; With X and Y representing the row and column respectively, the integer is calculated.
3. According to the RSA password decomposition method based on dynamic search as claimed in claim 1, it is characterized in that: The partitioning formula for independent sub-partitions is as follows: C J =mB c H Among them, C J represents the number of columns contained in the independent sub-partition, m represents the number of cores involved in the calculation, B c represents the core computing base, and H represents the estimated time the computer participates in the calculation.
4. According to claim 2, a RSA password decomposition method based on dynamic search is characterized in that: The step of dividing the independent computing blocks according to the cores involved in the calculation is specifically that the number of columns contained in each independent computing block is equal to the core contribution, and the calculation formula of the core contribution is as follows: C h =B c H Among them, C h represents the nuclear contribution, B c represents the core computing base, and H represents the estimated time the computer participates in the calculation.
5. According to the RSA password decomposition method based on dynamic search as claimed in claim 1, it is characterized in that: Also includes: Store the calculation results and exit the operation after notifying the root host; When the root host receives the message that the task is completed, it notifies other computers to stop computing.
6. The RSA password decomposition method based on dynamic search according to claim 5, characterized in that: Also includes: The parameters, the ID of the computer that last joined the calculation, the total number of columns that have been allocated on the rectangular area, and the number of remaining unallocated columns are recorded in a configuration file.
7. The RSA password decomposition method based on dynamic search according to claim 6, characterized in that: Also includes: For a newly added computer, query the job status and the number of remaining unallocated columns in the rectangular area from the configuration file; If the number of remaining unallocated columns is 0, then exit the calculation; If there are unallocated remaining columns, the independent sub-partition is calculated from the unallocated remaining columns according to the number of cores contributed by the computer and the core contribution, and the configuration file is updated.
8. A RSA password decomposition device based on dynamic search, characterized in that: include: At least one multi-core (multi-processor) computer; 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 password decomposition method based on dynamic search as described in any one of claims 1 to 7.
