The private and public key meanings generated by OpenSSL

Source: Internet
Author: User
Tags decrypt openssl

OpenSSL makes it easy to generate a pair of private keys and public keys, noting that the private key and public key are paired.

Private key: Refers to a string that only you know

Public key: Provides a string for everyone to know

There are two types of operations on private and public keys: 1. Public key encryption data, private key decryption data 2. Private key signature data, public key validation data

Let's analyze it one by one:

1. Public key encryption, private key decryption

A lot of friends want to send me messages, they send the message only want to give me a person to see, other people get this information is not to see. In order to satisfy this demand, we use public key encryption, private key decryption this way.

Friends sent me the information with everyone knows the public key to encrypt, and then sent to me, to decrypt the information must be the public key corresponding to the private key to decrypt the information, but only I know the private key, so friends sent over the message, only I can be solved by a person, but I can see only one person, Because other people do not have a private key, they cannot decrypt the information.

The illustrations are as follows:


2. Private key signature, public key authentication

Suppose I want to send a message to one of my friends, but there may be other people pretending to be me, and then sending messages to my friend, then my friend is not sure if the message sent to him or not I sent him, in order to meet this demand, use the private key signature, public key authentication.

I have to send the information, with only I know the private key to the signature, it is equivalent to the information on a my own unique tag, other people because there is no private key, so there is no such token, the message after the signature, sent to the friend, the friend know my private key corresponding to the public key, So to send his message with the public key to verify that the success of the verification, it means that this message I personally sent him.

The illustrations are as follows:


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.