In the previous section, symmetric encryption (resolution:Confidentiality of), one-way encryption (resolves:completeness), key exchange (resolution:completeness)。 But is it always possible to be disruptive by e, is there a way to resolve the identity of the other way?
This time the public key encryption algorithm comes out. It is well known that public key cryptography is a key pair: Public key (publicly available, extracted from the private key in accordance with an algorithm or mechanism); the private key (randomly generated by itself, the general key is very long, 1024,2056, etc.).
Public Key cryptography itself can also be used for information encryption , assuming that a information is encrypted with its own private key, and passed to b,b with a's public key decryption, since it is the public key, then on the network transmission, e this bad guy can also get a public key, so e can also decrypt a sent to B information. This will not resolve the confidentiality of the information.
So to achieve the confidentiality of the information sent to B , a will take B's public key for information encryption, and send to B, then B with his private key to decrypt, E this guy can not open a sent to B information. But e can use the public key of B to forge a message sent to B. This does not resolve the authentication.
Let's think about:
1, with their own private key to encrypt, the other side can realize the problem of authentication , but unable to achieve data confidentiality problems.
2, with the other side of the public key to encrypt, the other side can achieve data confidentiality problems, but unable to implement the problem of authentication.
But in fact, the public key is rarely used to encrypt information because the key is too long and the encryption is extremely slow. So it is generally used for authentication. So how can you quickly implement authentication? method of using one-way encryption + Public key encryption
1, a first use one-way encryption to calculate the fingerprint
2, A and then use their own private key to encrypt the fingerprint
Consider:
If e this guy intercepted a sent message, E can decrypt it? Yes!!! Can e tamper with information? Yes!!!
But e want to tamper with the information after the "fingerprint" also modified, only with E own private key encryption, then B can use a's public key to decrypt the data do not? No!!!
E only modifies the contents of the information, B decrypts the "fingerprint" with the public key of a, can the content and the "fingerprint" horse right? No!!!
Although the confidentiality of information is not guaranteed, this completes the integrity of the information and authentication issues.
so it's all right? No!! A and B have never had a communication before, E this guy can fly in the middle to disguise A and B (before so many times E, we can call this guy "man-in-the-middle attack", Man-in-the-middleattack, abbreviated as "MITM attack"). Then it fell into the pit again. Life is full of pits, isn't it? ^_^ Our aim is to find a way to solve these "pits". For the next method, please listen to tell. ^_^
Types of encryption and their associated algorithms-public-key cryptography (Asymmetric encryption)