(Ancient heritage) cryptography - RSA algorithm full resolution (Chapter III)

The third chapter on how to improve and optimize the RSA algorithm
This chapter does, I want to talk about the practical application of emerging issues and understanding.
Due to the recent start of a variety of busy, so after a short time I wrote this chapter does not intend what the data = - = (anyway, usually there is no data out of habit.)
In the first chapter talking about when I mention had two functions in the real application discard, why do you say?
Because, in practice, the size of the data is generated and two key E N D can operate with the RSA algorithm, when applying a RSA requires only a ^ b% c modulus arithmetic function, the optimization of the focus point on the type of data encryption and data decryption speed.
Note RSA function has a feature that generated the source data must fall within the ciphertext n, because once data is encrypted would cause greater than n ciphertext is not unique (congruence when k is not unique arbitrary integer), based on this property it shows that this function is a one to one function, that is to say works RSA is actually shuffle (you can also get to act is not repeated RSA random number generator function to use oh).
Then we will talk about optimizing it, first determine good data to be encrypted single scale, which is the bit length encryption, using C language's words, once encryption is a byte (char) do or four bytes ( int) it? This algorithm depends on the execution environment, the selection of this type may occur in the development of the microcontroller, such as microcontroller 51 defaults are processed one byte, the data should be used corresponding to the type from the processing speed optimization perspective, that is, each encryption char data, but in general intel home is more than a 32-bit, if there are still estimated to be sudden death of char waste treatment program (already can handle more but you bring four non one sub-out process), so the 32-bit machine would be the direct application of int.
However, the students do not know have not noticed a problem, the problem is that a ^ b% c modulus arithmetic functions designed for conventional algorithms that perform the mod operation on the results of a ^ b. But we know that a ^ b is extremely easy to exceed the maximum value itself, then it will not calculate the correct value and result in data confusion, the solution had to replace a larger data type or the use of variable length data types (operator of large numbers ), as well as to improve the library gmp like algorithm, but today I will not speak in front of two programs, and directly say it the third option, the third option is actually hidden in my other one log, accordingly click portal ~
at this point we say that the security of RSA is right, it is mainly reflected in where? Then how will it improve safety?
If we want to improve a cryptographic algorithm, it is necessary to expand from how to break it to think, to crack the RSA algorithm, we can start from the data size N with two key E and D.
First make sure that all values of the RSA algorithm is not known to outsiders, if I start from the data size N, because the Internet most of the code (people) like to use two prime numbers p and q to generate the data size of N (the special nature of the Euler function ), which causes the [Phi] N (N) satisfies P = N Q, [Phi] (N) = (. 1-P)(q-1). So we need to do is to factoring N, broken down into the product of two prime numbers, it appears that this is a drudge in the computer ah, because the average computer processing problems and most of the ordinary people, the best at brute force to solve problems, such as 6 to count a few of which can be decomposed into the product of two numbers there (1,6) (2,3), it is simple for you right now 65536 change it, you can write how much of the product? Of course, replaced by a quantum computer's parallel computing that they are fundamentally not a problem, and the difficulty of RSA only here, but it seems that in today's computers really no more difficult. So we have to break the data size N can take advantage of a prime table to get two prime numbers as the product of all the possible number of prime N, and then use the sieve method to obtain that E and φ (N) co-prime multiplicative inverse D, and finally through about the man in the middle attack (between a and B forwards monitor guy) record a and B two RSA cipher text communication, as long as the data have recorded no coincidence then decrypt it can be based on the amount of data to indicate the extent to crack but once the phenomenon of coincidence, then returned to the upper change key E to re-generate the key D again to try, if not enough to generate N data only for the size of two prime numbers p and q, so for this is quite easy to crack of.
In order to increase the likelihood of trial division of the difficulty of guessing we should not use special Euler function to generate the data size, the standard Euler function to generate data that can be tested although the scale is out of the sieve method, but it means that third-party crackers data more substantial, it is not only possible but around all around integer prime table. But for now, there are applications Shor algorithm on a quantum computer has been ignoring this problem, encountered such a compromised is normal, do we just give up yet, no, we can for the man in the middle attacks re-encrypted ciphertext, because as long as there is no available ciphertext source you simply can not expand the crack, so from this point on we can use other methods to confuse the ciphertext, such as the use of these and other AES symmetric key encryption algorithms, these algorithms We rely solely on a private public key to encrypt and decrypt data. Of course, once the key is to know the basic GG outsider, but when the time to do this, to break outside of the center of gravity shifts to the AES, which is equivalent to RSA on a wall. Day night just anti-anti, home thief difficult to prevent. For direct crack decompile the code (reverse engineering) open source of static data (direct access to key data and scale E N) anti-how should we do?
The question I will try to explain later Diffie-Hellman algorithm as well as the use of several discrete knowledge (ECC question), they have an amazing feature is that you can only specify the data generated by any of the data, the disadvantage is the need for large numbers support library, because it will lead to one mapping of data to be encrypted necessarily have to have scale N scale N is greater than the current data more number, ECC algorithm has now started to gradually replace RSA in some state organs, there is in our country State Encryption management office called commercial sites, and issued a public key cryptography algorithm file SM2 curve parameters and recommended elliptic curve http://www.oscca.gov.cn/News/201012/News_1197.htm, which is ECC algorithm file , ah, beside the point, when you give us some information science of cryptography it = - =.
All chapters have been finished so far, do not know if the students feel a bit mean or harvest it (the code), I hope to have more back-end technical education students a lot of attention, because the front end is playing to passers-by and those trained people . If you want to have more advantages in programming than others, according to I see it, we can learn from the operating system, compiler theory, algorithm design, mathematical modeling, cryptography, machine, computer vision, computer networks, high concurrency cluster design, mathematics aspects of function realization start, hope you students get excellent results while also capable of a lot of hands-on programming, the most Finally, attach the word: loaded to force in order before the people, we must first people suffer after.

Guess you like

Origin www.cnblogs.com/juwan/p/11449045.html