Public keys, private keys, and digital signatures it's best to understand

Source: Internet
Author: User
Tags decrypt

First, public key encryption
Let's say I've looked for two numbers, one is 1, the other is 2. I like the number 2, I keep it, I don't tell you (the private key), and then I tell you that 1 is my public key.

I have a file that I can't let anyone else see, I'm using 1 encryption. Others found this file, but he did not know that 2 is the decryption of the private key ah, so he can't open, only I can use
The number 2, is my private key, to decrypt. So I can protect the data.

My good friend X encrypted the character A with my public key 1, encrypted it into B, and put it on the Internet. Someone else stole the file, but others can't, because nobody knows 2 is my private key,
I'm the only one who can decrypt it and get a after it's decrypted. In this way, we can transfer encrypted data.


Second, the private key signature
If I encrypt a piece of data with the private key (only I can encrypt it with the private key, because I know that 2 is my private key), all people see my content, because they know
The way my public key is 1, what is the use of this encryption?

But my good friend X said someone was impersonating me and sending him a letter. How to do it. I sent my letter, the content is C, with my private key 2, encrypted, encrypted content is D, to X, and then tell him
Decryption look is not C. He decrypted it with my public key 1 and found that it was c.
At this point, he would think that the data that can be decrypted with my public key must be encrypted with my private key. Only I knew I had the private key, so he could confirm that it was really my hair.
So we can confirm the sender's identity. This process is called a digital signature. Of course, the specific process is slightly more complicated. Use the private key to encrypt the data, which is the digital signature .

Summary: The public and private keys are paired, and they decrypt each other.

Public key encryption, private key decryption.

Private key digital signature, public key authentication.

Example

For example, there are two users Alice and Bob,alice want to send a piece of plaintext through two-key encryption technology to Bob,bob has a pair of public and private keys, then the process of encrypting decryption is as follows: Bob sends his public key to Alice. Alice encrypts her message with Bob's public key and sends it to Bob. Bob decrypts Alice's message with his private key.

The above procedure can be shown in the following illustration, Alice uses Bob's public key for encryption, and Bob decrypts his private key.


Examples and figures from the second edition of Basic applications and standards for cybersecurity

RSA Algorithm

RSA Public Key cryptography was developed in 1977 by Ron Rivest, Adi Shamirh and Lenadleman (Massachusetts Institute of America). RSA is named after the names of the three people who developed them. RSA is currently the most influential public-key encryption algorithm, it is able to resist all known password attacks so far, has been recommended by the ISO public key data Encryption standard. The RSA algorithm is based on a very simple number theory fact: it is easy to multiply two large primes, but it is extremely difficult to factorization the product at that time, so it is possible to expose the product 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.