Asymmetric Encryption and Decryption - Private Key and Public Key
Source: Internet
Author: User
Keywordsprivate and public keyssymmetric and asymmetric encryptionasymmetric key encryption
Data is the core asset of an enterprise, and each enterprise has its own core sensitive data. These data need to be encrypted to protect them from being stolen by others. Data encryption refers to the transformation of plaintext into ciphertext through encryption algorithm and encryption key, while decryption refers to the restoration of ciphertext into plaintext through decryption algorithm and decryption key. Its core is cryptography. It is the most reliable way for computer systems to protect information. Use cryptographic technology to encrypt information and realize information concealment, thereby protecting the security of information. The so-called data encryption (Data Encryption) technology refers to the conversion of a piece of information (or plain text) through an encryption key (Encryption key) and an encryption function, into a meaningless cipher text (cipher text), and the receiver will This ciphertext is restored to plaintext through a decryption function and a decryption key. Encryption technology is the cornerstone of network security technology.
Public Key and Private Key are a key pair (that is, a public key and a private key, that is, asymmetric encryption) obtained through an encryption algorithm. The public key can encrypt the session and verify the digital signature. Only the corresponding private key can decrypt the session data, thus ensuring the security of data transmission. The public key is the public part of the key, and the private key is the non-public part, which is kept by the user.
The key pair obtained through the encryption algorithm can be guaranteed to be unique in the world. When using a key pair, if one of the keys is used to encrypt a piece of data, only the other key in the key pair can be used to decrypt the data. For example: the data encrypted with the public key must be decrypted with the corresponding private key; if the private key is used for encryption, the corresponding public key must also be used for decryption, otherwise it will not be decrypted successfully.
The first usage: public key encryption, private key decryption. ---Used for encryption and decryption
The second usage: private key signature, public key verification. ---For signature
It’s a bit confusing, don’t memorize it, to summarize:
You just need to think:
Since it is encryption, I definitely don't want others to know my message, so only I can decrypt it, so it can be concluded that the public key is responsible for encryption and the private key is responsible for decryption;
Since it is a signature, I definitely don't want someone to impersonate me to send a message. Only I can publish this signature, so it can be concluded that the private key is responsible for signing and the public key is responsible for verification.
For the same reason, I am trying to put it another way:
The private key and the public key are a pair, anyone can encrypt and decrypt, but whoever encrypts and who decrypts depends on the situation:
The first scenario is signing, using private key encryption and public key decryption, which is used to allow all public key owners to verify the identity of the private key owner and to prevent the content published by the private key owner from being tampered with. But it is not used to guarantee the content. Not acquired by others.
The second scenario is encryption, which uses public key encryption and private key decryption to release information to the public key owner. This information may be tampered with by others but cannot be obtained by others.
Such as encryption scenario:
If A wants to send a safe and confidential data to B, then A and B should each have a private key, and A first encrypts this data with B's public key, and then encrypts this encrypted data with his own private key. Send it to B, which ensures that the content will neither be read nor tampered with.
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.