Thought of by the TV series "Dark computing"-mathematical principles of cryptography
I watched the TV series "Dark computing" a while ago and liked its ideas and performances. One story mentions cryptography. the story itself is good, but it is a bit confusing. However, it is true that today's cryptography is based on mathematics. (I have not seen the readers can look at the introduction, http://ent.sina.com.cn/v/2005-10-17/ba866985.shtml
Because we will mention this TV series many times later .)
The history of cryptography can be roughly pushed up to two thousand years ago. It is said that, to prevent the enemy from intercepting intelligence, the famous Caesar uses a password to send intelligence. Caesar's practice is very simple, that is, to create a corresponding table for more than 20 Roman letters, such
In this way, if you do not know the password book, you will not be able to understand it even if you intercept a piece of information. For example, if you receive an ebktbp message, it seems meaningless to the enemy, the word Caesar is the name of Caesar. This encoding method is known as Caesar. Of course, people who have learned information theory know that as long as they intercept more intelligence and count the frequency of letters, they can crack the password. Corrandal introduced this kind of trick in his story of "Dancing villain" in his "Sherlock Holmes prophet. For a long time, people tried to find some good encoding methods so that the decrypted could not calculate the statistical information of the plaintext from the password. However, it was basically based on experience. Experienced coders map frequently-used words into multiple passwords, making it difficult for the attacker to figure out any rule. For example, if the word "yes" in Chinese is mapped to the only code 0543, then the translator will find that 0543 appears a lot. However, if it is mapped to ten passwords, such as 0543,3737 and 2947, each random use will not appear too many times, in addition, deciphering also cannot know that these passwords actually correspond to one word. Although the theory of probability theory is simple, it is not scientific. In addition, a good password must not deduce the new ciphertext content based on the known plaintext and ciphertext. There are many examples of poorly designed passwords in history. In the Second World War, the password design of the Japanese military was very problematic. The US military cracked many passwords in Japan. Before the Battle of Midway Island, the Japanese army's Mi Dian intercepted by the US army often had such a place name as AF, which should be an island in the Pacific Ocean, but the US army had no idea which one it was. As a result, the US military published fake news one by one on every island under its control. After the US military issued the false news "the water supply system in Midway Island is broken", the US military determined that Midway Island is AF after seeing the message about the problem of AF water supply from the Japanese army's intelligence. Facts have proved correct. The US military successfully ambush the main Japanese fleet there.
In fact, in the Second World War, many top scientists, including Shannon, who proposed information theory, were working for the US Military Intelligence Department. Information Theory was actually a direct product of information science. After Shannon proposed information theory, it brought a new atmosphere to the Development of cryptography. According to the information theory, the highest level of the password is that after the enemy intercepts the password, there is no increase in our understanding. In the terminology of information theory, there is no increase in the amount of information. Generally, when passwords are evenly distributed and statistics are independent, the minimum information is provided. Even Distribution makes the enemy unable to collect statistics, while independent statistics make sure that the enemy cannot decrypt another password even after seeing a piece of password and a clear code. This is also the reason why traditional interpreter Chen deciphered the secret report in the dark calculation, but it cannot be promoted, and mathematician Huang Yiyi expected this result, because she knows that the ciphertext produced by the new password system of the enemy is statistically independent. With the information theory, the design of passwords has a theoretical basis. The common public key methods, including the "Guangfu 1" password in "Dark computing", are based on this theory.
The principle of making a public key is actually very simple. We will describe how it works by encrypting and decrypting the above word Caesar. First, we need to convert it into a set of numbers. For example, its ASCII code X = 099097101115097114 (each three represents a letter) is used as an explicit code. Now let's design a password system to encrypt this plaintext.
1, find two large prime numbers (prime number) p and q, the bigger the better, such as 100 long, and then calculate their product N = p × Q, M = (P-1) X (Q-1 ).
2. Find an integer e with M, that is, M and E have no appointment except 1.
3. Find an integer d so that e x D is divided by m plus 1, that is, e x D mod m = 1.
Now, the world's most advanced and commonly used cryptographic systems have been designed. e is the public key which can be used for encryption, and D is the private key for decryption. You must save it yourself. The product N is public, even if the enemy knows it.
Now, we use the following formula to encrypt X and obtain the password y.
Now there is no key d, and the fairy cannot recover X from Y. If D is known, according to The ferma's theorem, X can be easily obtained from Y as long as the following formula is used.
The process can be summarized as follows:
The following are the benefits of public keys:
1. Simple.
2. Reliable. The public key method ensures that the generated ciphertext is statistically independent and evenly distributed. That is to say, no matter how many plain text and the corresponding ciphertext are given, the next ciphertext cannot be deciphered based on the corresponding known plain text and ciphertext. More importantly, N, e can be disclosed to anyone for encryption, but only those who master key D can decrypt it, even if the encryptor itself cannot decrypt it. In this way, the entire password system is still safe even if the encryptor is attacked and changed. (The encryption method of Caesar was disclosed by a person who knew the password, and the entire password system was made public .)
3. Flexible, you can generate a lot of public key e and private key D combinations for different Encryptors.
Finally, let's take a look at the difficulty of cracking this password. First, declare that there is no password that can never be broken in the world. The key is how long it will last. To break through the encryption method of public keys, the results of current research show that the best way is to break down the big word N, that is, find p and q through N in turn, so that the password is broken. However, to find p and q, you only need to use a computer to try all the numbers. This is actually the speed of computer competition, which is why p and q both need to be very large. One encryption method is satisfactory only when the computer cannot be broken for 50 years. The RSA-158 password cracked a few years ago is such a factor decomposition
395058745832651445264197678006144819960207764603049364541393760515793556265294
50683609727842468219535093544305870490251995655335710209799226484977949442955603
= 3388495837466721394368393204672181522815830368604993048084925840555281177 × 11658823406671259903148376558383270818131012258146392600439520994131344334162924536139
Now, let's go back to "Dark computing". After a series of calculations, Huang Yiyi finds that the result cannot be zero. That is to say, the Division is not enough. I guess she may try to break down a large number N and fail. The second calculation result is zero, indicating the decomposition method of N = p × Q. Of course, I don't know if this can be done with an abacus, but I think it is exaggerated. In addition, I still don't understand this TV series, that is, the error in the password "Guangfu 1" mentioned in it. There is no error in a password; otherwise, some keys cannot be decoded. I think it may be that when constructing a password, one of p and q is not correct, and one (or even two) accidentally finds a combination, the password's confidentiality is much worse. If anyone knows what error is in the TV series, please let me know. In addition, the TV series mentioned Feng nuoman, who said he was the ancestor of modern cryptography. I think it was wrong. It should be Shannon. Von noriman's contribution lies in the invention of computers and the introduction of game theory ).
In any case, the mathematical principle of the so-called most reliable encryption method we use today is actually so simple and mysterious, we can simply find a few large prime numbers and perform some multiplication and division operations.
From: http://hi.baidu.com/xiaoxiaolq/blog/item/8529f0feeb13c53b5d600879.html