Large prime number generation method and apparatus in an RSA encryption algorithm
An encryption algorithm and a technology for generating devices, which are applied in secure communication devices, digital transmission systems, public keys for secure communications, etc., can solve problems such as the difficulty of large prime numbers, time-consuming generation, and the possibility of generating only a close-to-prime number, etc. , to achieve the effects of improving detection efficiency, shortening time, and improving generation efficiency
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0062] Such as figure 2Shown, it is the flowchart of the large prime number generation method in the RSA encryption algorithm of the present invention, wherein, the large prime number generation method in the described RSA encryption algorithm comprises:
[0063] Step S1, searching for a large prime number to generate a pseudo-prime number;
[0064] The distribution of large prime numbers is uneven and the density is small. In order to improve the detection efficiency of prime numbers, it is necessary to choose a better search method. At present, the common search methods mainly include random incremental search and random search. However, the number of random incremental searches is smaller than that of the random search method. Therefore, the random incremental search method is used in the present invention to search for large prime numbers.
[0065] Random incremental search method, that is, randomly generate a number, and test the numbers starting from this number in tu...
Embodiment 2
[0071] As the method for generating large prime numbers in the RSA encryption algorithm described above, the present embodiment is different from it in that, as image 3 As shown, the step S2 includes:
[0072] Step S22, using the small prime number division method to exclude the numbers divisible by small prime numbers in the pseudo prime numbers;
[0073] The small prime number division method is to divide the pseudo prime number by the small prime number in 100, if a certain small prime number can divide a certain pseudo prime number, it shows that the pseudo prime number is not a prime number, and it is excluded.
[0074] Step S23, using the Miller-Rabin algorithm to perform 5 detections on the pseudo-prime numbers, and keep the pseudo-prime numbers that pass the detection.
[0075] The Miller-Rabin algorithm is a probability-based primality testing algorithm. It is a probability algorithm in essence. There is a possibility of misjudgment, but the probability of error is ...
Embodiment 3
[0093] As the method for generating large prime numbers in the RSA encryption algorithm described above, the present embodiment is different from it in that, as Figure 4 As shown, the step S2 also includes:
[0094] Step S21, using an even number exclusion method to exclude even numbers in the pseudo prime numbers;
[0095] Using the even number exclusion method, you only need to test about 0.5lnn integers, which further improves the generation efficiency of large prime numbers; first use the even number exclusion method, then only need to test the remaining about 0.5lnn in the small prime number exclusion method Integers can be divided and excluded by small prime numbers, which reduces the number of integers that need to be tested, greatly improves the detection efficiency, and further improves the production efficiency of large prime numbers.
[0096] In this way, the specific process of preprocessing is as follows: Figure 5 Shown:
[0097] (1) First filter out the even...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


