Reading metrix67's RSA algorithm that spans thousands of years

Source: Internet
Author: User

If I have studied in college, I forget to continue learning and then I forget to continue learning. Because you don't know this.AlgorithmWhat is the essence. This time I finally understood it. If you are looking for abuse, please visit the original matrix document. I think you are not a hacker. Read the blog of matrix. It makes you realize that it is an idiot in one minute. I feel that every word is known in five minutes, but every sentence cannot be understood.
Matrix67's blog once searched for information. It looked good and RSS was gone. Basically, it is a status that has been subscribed and never understood ...... I feel like an idiot every time. In order to avoid Alzheimer's disease, in order to escape lessons, to quarrel with white people, not to talk with dummies, to the tribe, to the Alliance ...... I spoke nonsense. I spent N hours reading matrix57'sHttp://www.matrix67.com/blog/archives/5100An RSA algorithm that spans thousands of years.

Martix has a lot of input and output. Below is a summary of the lite version ...... (All the numbers mentioned below are positive integers + 0. Is this like a natural number ?)

The essence is the ferma's theorem. It is better to change the name of Fei Ma GE to Fei brain ). Simply put, this theorem is: There are two prime numbers p and q (both of them are good friends), and their product is N. Then for any positive integer A, the result of the I power mod n of a will certainly be a periodic cycle (p-1 cycle may not be the smallest, but it will certainly take this cycle ). The essence ends.
This clearly charges the brain but has to be called the small theorem of ferma, that is, a square mod n = a (PM) (q-1) + 1 power mode n = a (pm) (q-1) * random integer + 1. So this is called the I power mod n of a. The result of mod n is cyclically cyclical in (p-1) (q-1.
(Explain why the above equations need to be added with 1. Because a is the first party of A, the cycle is P-1) (q-1), plus a 1 can be equal to a mod n .)

According to the above niuqiang theorem. We are not ashamed to pay patent fees for computer science. It is so cumbersome to encrypt data:

First, we will introduce the role M and N, P and Q, and E and D. Their relationship is n = p * q. M = (p-1) (q-1 ). (So m is the cycle for adding a few words to the power without changing the MOD result ). E * D mod m = 1. Here, the p and q numbers are found. M and n are calculated by simple multiplication. E and D are indeed troublesome, because they are required to be prime numbers and must be multiplied by mod m = 1. In short, there is a theorem that can be calculated (good friends, pull hands, calculate and walk together ).


The following describes the tedious encryption process:
1) make public e and N, which are called public keys. However, D must be kept confidential, and D and n are called private keys (from now on, E and D can only be decrypted through encryption and decryption ). A is the data to be encrypted, and the number must be less than n. In fact, this is not a problem, because in actual use, n is an integer of hundreds of thousands.
2) the encryption party calculates the E Power mod n of a as the encrypted value, which is called B. Pass B to the decryption party.
3) The decryption party calculates the D Power mod n of B, and the result is definitely a bird.

The derivation is as follows: B's D Power mod n = (A's E Power mod n)'s D Power mod n. The last mod N is required, and the power is nothing more than multiplication. Therefore, no matter how many n are there, it is a floating cloud, that is, the power of E * D of a mod n = m + 1 of a mod n. Because m is the cycle, so = A's 1 Power mod n = a mod n. A is less than N, so a mod n =. The decryption bird finally decrypts the bird.

Therefore, this RSA is called asymmetric encryption, because one of the two friends is used for encryption and can only be decrypted by the other. The symmetric encryption algorithm uses the same number for encryption and decryption.

The following analyzes why this algorithm is not easily cracked:
Recall the actors. Mn, PQ, Ed. E and n are published. The decryption requires D and N. Therefore, it is not easy to calculate d Based on E and N. P and q are the key elements behind the scenes. Because we can say that all the numbers come from them. M and n are. E and D are calculated by an algorithm. The algorithm is not a secret. That is to say, if we know p and q, we can certainly get E and D.
N = p * q. However, if you know this, you also know that p and q are prime numbers, which means it is hard to calculate what p and q are. In fact, it is not difficult to calculate. N is public, and the Division is calculated from 1 to n in a big loop. Therefore, the size of N determines the difficulty of cracking. P and q must be relatively large, and N will be very large. Suppose n is an integer of one thousand bits (I don't know how many bits are actually used ......). So how long does the real cycle take to break p and q:
Currently, the mainstream CPU is 3 GHz, which is good. That is to say, the calculation is about 1 billion times in one second = 9 0 after 1, less than seconds in a day, and the calculation is 10 W, 5 0. That is to say, one day is probably counted as 14 zeros after 1. An integer of one thousand digits is the first zero after 1. 14 0 is the dregs RZ ....... It doesn't make sense if it is converted into years. It is estimated that the universe has been annihilated several times ......

The root cause of RSA is the product of two awesome prime numbers. It is difficult to find out what these two numbers are. The prime number is so embarrassing.


I have to lament that knowledge and wisdom are two things. In fact, the entire article is only an integer addition, subtraction, multiplication, division, and pupils can understand it. But looking at these patterns, we really need wisdom, not knowledge.

I have to lament that piano music may actually help improve intelligence in the short term. I kept my eyes open for a long time and didn't understand the remainder theorem.

I have to sigh again. If we knew that the prime number was so embarrassing, we should also pretend that when B is changing the mobile phone number, it would not be required.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.