Public Key, private key, and digital signature.

Source: Internet
Author: User

I,Public KeyEncryption
Assume that I have two numbers: 1 and 2. I like the number 2 and keep it. I won't tell you (Private Key), and I will tell you that 1 is my public key.

I have a file that cannot be viewed by others. I use 1 for encryption. Someone else finds this file, but he does not know that 2 is the decryption private key, so he cannot undo it. Only I can use it.
The number 2 is my private key for decryption. In this way, I can protect the data.

My good friend X used my public key 1 to encrypt character a, encrypted it into B, and put it online. Someone else steals this file, but someone else cannot solve it, because others don't know that 2 is my private key,
Only I can decrypt it. After decryption, I will get. In this way, we can transmit encrypted data.

 

II,Private KeySignature
If I encrypt a piece of data with a private key (of course, only I can use the private key to encrypt it, because only I know that 2 is my private key ), as a result, all people will see my content, because they all know
My public key is 1, so what is the use of this encryption?

But my good friend x said someone impersonates me to send a mail to him. What should we do? I sent the letter I want to send. The content is C. I used my private key 2 to encrypt it. The encrypted content is D. I sent it to X and told him again.
Decrypt to check whether it is C. He decrypted it with my public key 1 and found it was C.
At this time, he will think that the data that can be decrypted with my public key must be encrypted with my private key. Only I know my private key, so he can confirm that it is actually what I sent.
In this way, we can confirm the sender's identity. This process is called digital signature. Of course, the specific process is a little more complicated. The private key is used to encrypt data.Digital Signature.

 

Summary: The public and private keys are paired and decrypted.

Public key encryption and Private Key decryption.

Private Key digital signature, public key verification.

 

Example

For example, two users Alice and Bob, Alice want to send a piece of plain text to bob through the two-key encryption technology. Bob has a pair of public and private keys, the encryption and decryption process is as follows:

    1. Bob transfers his public key to Alice.
    2. Alice encrypted her message with Bob's public key and sent it to Bob.
    3. Bob uses his private key to decrypt Alice's message.

The above process can be used to indicate that Alice uses Bob's public key for encryption and Bob uses his own private key for decryption.

Examples and figures from basic network security applications and standards Version 2

 

RSAAlgorithm

The RSA public key encryption algorithm was developed in 1977 by Ron Rivest, Adi shamirh, and lenadleman at the Massachusetts Institute of Technology. The names of RSA come from the names of the three developers. RSA is currently the most influential public key encryption algorithm. It can resist all known password attacks so far and has been recommended as the Public Key Data Encryption Standard by ISO. The RSA algorithm is based on a very simple number theory fact: it is very easy to multiply two large prime numbers, but at that time it is extremely difficult to break down the product, so the product can be published as an encryption key.

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.