I. Overview
Asymmetric encryption algorithms, the keys are paired, the public key (public, can be seen on the network), the private key (private key, only know). Each server is made up of a pair of secret keys
Public key encryption, decrypted with the private key (key pair):
Private key encryption, decrypted with the public key (secret key pair) :
Apply in different scenarios
Two
Alice wants to send an email to Bob. Third party Eve exists on the network
Alice sends the email data in two pieces: part of the data itself, the email itself, and the other part is the eigenvalues that are encrypted with Alice's own private key.
Eve intercepts the data from Alice, and it's two operations.
Just tamper with the data itself and send it to Bob. After Bob gets the data, it decrypts the eigenvalue with Alice's public key. Can decrypt it (because Eve was not tampered with and was encrypted with Alice's public key), it means that the data was actually sent by Alice. When Bob decrypts, get the eigenvalues. Then the data itself is encrypted and compared with the eigenvalues, found inconsistent, indicating that the data itself has been modified.
Tamper with data while tampering with eigenvalues. Eve gets the email, decrypts it with Alice's public key (which is sure to decrypt it, because it is encrypted with Alice's private key), and then tamper with the data and regenerate the eigenvalues. But at this point, Eve could no longer encrypt the feature with Alice's private key (since Alice's private key was only known to Alice herself), so Eve would have to encrypt its own private key. Send it to Bob again. When Bob gets an email, he tries to decrypt it with Alice's public key, but it cannot be decrypted at this point because it is encrypted with Eve's private key, so Bob immediately knew that the data was not sent by Alice.
But the question is, how does Bob get Alice's public key, and Bob gets Alice's public key right?
Asymmetric encryption algorithm