RSA algorithm
The most famous, the most widely used public key system RSA is in 1978, the Ron Rudest, Adi Shamir and Leonard Adleman entitled "Method for obtaining digital signatures and public key cryptosystems) It is proposed in the paper. It is a non-symmetrical (public key) cryptographic system based on the ratio, is a packet password system. Its name is from the three inventors. Its security is based on the difficulty of generic factor decomposition, and the problem of large integer factor decomposition is a mathematical difficult problem. So far, there is no effective way to solve it, so it can ensure the security of the RSA algorithm. The RSA system is the most typical method of the public key system, and most of the products and standards that use public key passwords encrypt and digital signatures are RSA algorithms. The RSA algorithm is the first algorithm that can be used for data encryption and digital signatures, so it provides a basic method for encryption and authentication of information on public networks. It is usually a pair of RSA keys, one of which is the confidential key, saved by the user; the other is the public key, open to the outside, can even register in the network server, people send it to individuals with public key encryption files Individuals can decrypt accept with private key. In order to improve the confidentiality strength, the RSA key is at least 500 seats, which is generally recommended for 1024 bits. This algorithm is based on the following two facts guarantee the security and effectiveness of the RSA algorithm: 1. Determine a number of rapid algorithms that are not a rigidity; 2. The rapid algorithm of the determination of a compass is not found.
Working Principle 1) Two different large numbers P and Q are selected, calculate the product R = P * q; 2) An arbitrary election E, E and (P-1) * (Q-1) mutual, integer E makes the encryption key. Note: The selection of E is easy, for example, all the prime numbers greater than p and q are available. 3) Determine the decryption key D: D * E = 1 modulo (p - 1) * (Q - 1) According to E, P and Q can be easily calculated to calculate D. 4) Open integer R and E, but not disclosed D; 5) Encrypt the express text P (assuming the integer of P is an integer of a smaller than R) into ciphertext C, the calculation method is: c = pe modulo R 6) Red Decrypt Cipheet C For the express text p, the calculation method is: p = CD MODULO R However, it is not possible to calculate that D is calculated according to R and E (not p and q). Therefore, anyone can encrypt the plaintext, but only the authorized user (know D) can only decrypt the ciphertext. Mathematics principle
If P, Q is P, Q is a meticulous number, Rm == 1 mod (p-1) (Q-1), A is any positive integer, b == a ^ m mod pq, c == b ^ r MOD PQ, then C == a mod pq proof process, will be used to the Maima mini, describing the following: m is either, N is any integer, then n ^ m == n mod M (change another sentence If n and m are mutually, n ^ (m-1) == 1 mod m) use some basic groupual knowledge, it can be easily certified for the horse's small theorem ....... Prove that because rm == 1 mod (P-1) (Q-1), RM = K (P-1) (Q-1) 1, where K is an integer because in modulo is preserve multiplication (X == y mod z => xu == yV mod z), so c == b ^ r == (a ^ m) ^ r == a ^ (rm) == a ^ (k (p-1) (Q-1) 1) MOD PQ 1. If a multiple of P is not a multiplier, a ^ (p-1) == 1 mod p (Ma Xia Theorem) => a ^ (k (p-1) (q-1)) == 1 mod p A ^ (q-1) == 1 mod = => a ^ (k (p) -1) (q-1)) == 1 mod p, the p, q can be eliminated by A ^ (k (p-1) (q-1)) - 1 => pq | a ^ (k (p-1 (q-1)) - 1 A ^ (k (p-1) (q-1)) == 1 mod pq => c == a ^ (k (p-1) (Q-1) 1) == a mod pq 2. If a is a multiple of P, but is not a multiple of Q, then a ^ (q-1) == 1 mod = 马 小 定))) => a ^ (k (p) -1) (q-1)) == 1 mod => c == a ^ (k (p-1) (q-1) 1) == a mod => Q | C - A factor P | A => c == a ^ (k (p-1) (Q-1) 1) == 0 mod p => P | c - a, PQ | C - a => C == A MOD PQ 3. If A is the multiple of Q, but is not a multiple of P, it demonstrates the same 4. If a is the multiple of P and Q, PQ | A => c == a ^ (k (k) P-1) (Q-1) 1) == 0 MOD PQ => PQ | C - a => c == a mod pq => This Theorem Description A After the encoding is b, then decoded is c, A = = C MOD N (n = pq) .... But when we do coding decoding, limit 0 <= a n, so this is to say A is equal to C, so this process does achieve encoding decoded features ..... In order to explain the working process of the algorithm, we will give a simple example below, apparent that we can only take very small. The number, but as mentioned above, in order to ensure safety, the number we use is much larger in the actual application. Example: P = 3, q = 5, then R = 15, (P-1) * (Q-1) = 8. Select E = 11 (greater than P and Q), calculate D = 3 by D * 11 = 1 modulo 8. It is assumed that it is an integer 13. Then Cipen C is c = pe modulo r = 1311 modulo 15 = 1, 792, 160, 394, 037 modulo 15 = 7 restoration plain text P is: p = cd modulo r = 73 modulo 15 = 343 modulo 15 = 13 Because E and D mutual reverse, public key The encryption method also allows the encryption information to "sign" in such a manner to determine whether the signature is not forged. Two people communicating in an insecurity channel, assuming to Alice and Bob (sender), they hope to be able to communicate safely without damaging their enemy OSCAR. Alice thought of it, she used a lock (equivalent to the public key), which can be locked if anyone can lock, but only the Alice key (equivalent to private key) can be opened. Then Alice has sent countless ways such locks. When anyone wants to give her a letter, if you want to give her a letter, then use a Alice lock to send it to Alice, then anyone (including bob) I can't open the box in addition to the Alice with the key, so that even if Oscar can find Alice lock, even if oscar can intercept this box during communication, there is no alice, but he is not possible to open the box, and Alice's key and No need to distribute, so OSCAR will not get this "private key". Advantages The RSA algorithm is the first algorithm that can be used for encryption and digital signatures, and is also easy to understand and operate. RSA is the most widely studied public key algorithm. From now on, it has been in the past two decades. It has experienced various attacks, and gradually accepts people, and is generally one of the best public key schemes. The encryption key and encryption algorithm of the algorithm are separated, making the key allocation easier. It is especially compliant with a computer network environment. For a large number of users on the Internet, the encryption key can be printed by phone book. If a user wants to communicate with another user, simply use the other party's encryption key from the public key to use it to encrypt the transmitted information. After the other party receives the information, the information is detached with only the decryption key known to know, understand the contents of the message. It can be seen that the RSA algorithm solves the problem of a large number of network user key management, which is the most prominent advantage of the public key cryptographic system relative to the symmetric cryptographic system. Disadvantages 1) It is very troublesome to generate a key, and is limited by the number of technologies, so it is difficult to achieve one pass. 2) Safety, the security of RSA depends on the factor decomposition of the large number, but has no in theory to deal with the difficulty of deciphering RSA and the equivalent of the large number of decomposition, and most people in the cryptography are not NPC issues. At present, people have decomposed more than 140 decimal places, which requires a longer key, slower speed; in addition, people are actively looking for methods of attacking RSA, such as choosing secret attack, general attackers It is a message to make a message to sign the entity with the private key. Then, the information it wants can be obtained after calculation. In fact, the attack is the same weakness, that is, there is a fact that the power retains the input multiplication structure: (XM) D = XD * MD MOD N has been mentioned, this inherent problem comes from the public key The most useful feature of the cryptographic system - everyone can use the public key. However, from the algorithm to solve this problem, there are two main measures: one is a good public key protocol to ensure that the entity does not decrypt the information generated by other entities during the work, and is not known for the information you know nothing. One is never sent to the random document signature sent by the stranger, first use One-Way Hash Function for the document as a Hash process, or simultaneously using different signature algorithms. In addition to utilizing public analog numbers, people also try some attacks using decryption index or φ (n), etc .. 3) The speed is too slow, because the packet length of RSA is too large, to ensure safety, n at least 600 bitx or more, The calculation is very high, especially slower, more symmetrical cryptographic algorithms slowly, and with the development of large decomposition techniques, this length is also increasing, not conducive to standardization of data format. Currently, CAs are required in the SET (Secure Electronic Transaction) protocol to use a 2048-bit key, and other entities use 1024 bits of keys. For speed problems, people are currently widely used, and the public key password is used. The advantages and disadvantages are complementary: the single key password is fast, people use it to encrypt longer files, and then use RSA to encrypt the file key, extreme Good solution to the key distribution problem of the single key password. The most widely used in public key plus algorithms is RSA. The initial philosophy and goal development of the RSA algorithm is to make the Internet safe and reliable, intended to solve the problem of utilizing public channel transmission distribution using the DES algorithm secret key. The actual results not only solve this problem well; also use RSA to complete the digital signature of the electronic text to resist the denial of the IC, and you can use the digital signature to find the attacker to the illegal tampering of the attacker. To protect the integrity of data information. So far, many encryption technologies have used RSA algorithms that have also been widely used in many ways of the Internet, including the security interface layer (SSL) standard (this standard must be used when the web browser establishes a secure Internet connection. Application. In addition, the RSA encryption system can also be applied to intelligent IC cards and network security products. However, the patent period of the RSA algorithm is about to end, and it is replaced by a cryptographic scheme based on an elliptic curve (ECC algorithm). Compared with the RSA algorithm, ECC has a relatively advantage, which makes the characteristics of ECC more suitable for the development trend of rapid response of today's e-commerce. In addition, a new quantum password is also in development.