Public key, private key and the digital signature of understanding

In general:

You can determine a private key to encrypt the data message sender.

Data encrypted with the public, only to use their private key to see the data, thus protecting data.

Examples:

1 on behalf of my public key, 2 on behalf of my private, public and private key pairs, and decrypts them with each other.

1. Public key encryption

PeopleA with my public key 1 to encrypt data a, the data is encrypted b passed to me, I can only use my private key 2 b and then recover, said a, while others do not know my private key, so PeopleA encrypted data can be transmitted between me and protect data. RSA algorithm is a very effective public key encryption algorithm

2. The private key signature

I use my private key 2 encrypted data a (I can only use my private key), I only know the public key can decrypt, I can determine this data is issued

Using a private key to encrypt data, use a digital signature is

3. For Li

Example, two users Alice and Bob, Alice wants to send some plaintext through the dual key encryption technology Bob, Bob has a public and private key, the encryption and decryption process is as follows:

    • Bob his public key to the Alice.
    • Alice with encrypted her message to Bob's public key and send it to Bob.
    • Bob uses his private key to decrypt Alice's message.

Deepen understanding: 

The purpose of using the public key and private key:

      1. I send to your content must be encrypted during transmission can not be seen.

      2. must ensure that sent me, not someone else posing as me.

      The public key is for everyone to use, you can publish via e-mail, through the website so that others can download, in fact, the public key is used to encrypt / experience with the chapter. The private key is to own, be very careful to save, the best plus password, the private key is used to decrypt / signature, first Key terms of ownership, only private individual ownership. Public and private key role is: a public key encrypted content can only be decrypted with the private key, the private key can only be decrypted with the public key used to encrypt the content.

      For example, I give you send an encrypted message. First of all, I must have your public key, you must also have my public key.

      First, I use your public key to encrypt the message, thus ensuring that the message is not to be seen, but also to ensure that the message has not been modified in transit. After you receive an email with your private key can decrypt, you can see the contents.

      Secondly, I use my private key to encrypt the message, after sending to your hands, you can use my public key to decrypt. Because I was the only private hands there, thus ensuring that the message is what I sent.

      When the A-> B when data, A uses B public-key encryption, so as to ensure that only B can unlock, otherwise the general public can unlock an encrypted message that went to the confidentiality of the information. Validation is the use of sign mechanisms mortem chapter, A pass information is for everyone, it will do its own private key signature, so anyone that receives the message can use A to carry out inspection of the public key chapter, you can confirm the message by a issued to the.

 

Guess you like

Origin www.cnblogs.com/mianbaoshu/p/11781376.html