Public key encryption (asymmetric encryption ))

Source: Internet
Author: User
Tags asymmetric encryption
Public key encryption (asymmetric encryption)

New: itccp, http://itccp.com

 

Public key encryption uses a private key that must be kept confidential to unauthorized users and a public key that can be made public to anyone. Both the public key and the private key are connected in mathematics. Data Encrypted with the public key can only be decrypted with the private key, while data signed with the private key can only be verified with the public key. The public key can be provided to anyone. The public key is used to encrypt the data to be sent to the Private Key Holder. The two keys are unique for communication sessions. Public key encryptionAlgorithmThis is also called an asymmetric algorithm because one key is needed to encrypt data and another key is needed to decrypt data.

The public key encryption algorithm uses a fixed buffer size, while the private key encryption algorithm uses a variable-length buffer. The Public Key algorithm cannot link data as a stream as the Private Key algorithm, because it can only encrypt a small amount of data. Therefore, asymmetric operations do not use the same stream model as symmetric operations.

Both parties (Xiao Hong and Xiao Ming) can use public key encryption in the following ways. First, XiaoHong generates a public/private key pair. If James wants to send an encrypted message to Xiaohong, he will ask her for her public key. Xiao Hong sends her public key to Xiao Ming through an insecure network. Xiao Ming then uses this key to encrypt the message. (If James receives a red key on an insecure channel, such as a public network, James must verify that he has a correct copy of her public key .) James sends the encrypted message to Xiaohong, and Xiaohong uses her private key to decrypt the message.

However, an unauthorized proxy may intercept the key during the transmission of a small red public key. In addition, the same proxy may intercept encrypted messages from James. However, the proxy cannot use the public key to decrypt the message. The message can only be decrypted with a small red private key, but the private key is not transmitted. Xiaohong does not use her private key to encrypt the reply message sent to James because anyone with a public key can decrypt the message. If Xiao Hong wants to send the message back to Xiao Ming, she will ask Xiao Ming for his public key and use it to encrypt her message. Then, James uses the private key associated with him to decrypt the message.

In an actual solution, Xiao Hong and Xiao Ming use public key (asymmetric) encryption to transmit the private (symmetric) Key, while the rest of their sessions use private key encryption.

Public key encryption has a larger key space (or the possible value range of the Key), so it is not easy to be attacked by trying every possible key. It is easy to distribute because it does not have to protect the public key. The Public Key algorithm can be used to create a digital signature to verify the identity of the Data sender. However, the Public Key algorithm is very slow (compared with the private key algorithm) and is not suitable for encrypting a large amount of data. The Public Key algorithm is only useful for transmitting a small amount of data. Public key encryption is usually used to encrypt the key and IV to be used by a private key algorithm. After the key and IV are transmitted, the rest of the session is encrypted with the private key.

. NET provides the following asymmetric (Public Key/private key) encryption algorithms through the abstract base class (system. Security. Crytography. asyuncricalgorithm:

•Dsacryptoserviceprovider

•Rsacryptoserviceprovider

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.