Symmetric key and asymmetric key

Source: Internet
Author: User
Tags decrypt asymmetric encryption

(i) Symmetric encryption (symmetric cryptography)

Symmetric key encryption, also known as private key encryption, that is, the sender and receiver of the information with a key to encrypt and decrypt the data. Its biggest advantage is the fast addition/decryption speed, suitable for the large data volume encryption, symmetric encryption is a major drawback is the key management and allocation, in other words, how to send the key to the person who needs to decrypt your message is a problem. In the process of sending the key, there is a great risk that the key will be intercepted by hackers. The common practice in reality is to encrypt the symmetric encrypted key in an asymmetric manner and then pass it on to the person who needs it.

Symmetric encryption typically uses a relatively small key, typically less than the size of a bit. The greater the key, the stronger the encryption, but the slower the encryption and decryption process. If you use only 1 bit to do this key, the hacker can first try to decrypt with the word, no, then use 1 solution, but if your key is 1 MB large, hackers may never crack, but the encryption and decryption process takes a long time. The size of the key is both to take care of the security, but also to take care of the efficiency, is a trade-off.

(ii) Asymmetric encryption (asymmetric cryptography)

Asymmetric key encryption system, also known as public key encryption. Asymmetric encryption provides a very secure way to encrypt and decrypt data, using a pair of keys, public key, and private key. The private key can only be safely kept by one party and cannot be compromised, while the public key may be sent to any person requesting it. Asymmetric encryption uses one of these keys to encrypt, while decryption requires another key. For example, you ask the bank for the public key, the bank sends you the public key, you encrypt the message using the public key, then only the holder of the private key-the bank can decrypt your message. Unlike symmetric encryption, the bank does not need to send the private key over the network, so security is greatly improved. At present, the most common asymmetric encryption algorithm is RSA algorithm. The public key mechanism is flexible, but the encryption and decryption speed is much slower than symmetric key encryption.

Although asymmetric encryption is secure, it is very slow compared to symmetric encryption, so we still use symmetric encryption to deliver the message, but the key we use for symmetric encryption can be sent out by asymmetric encryption. To explain this process, take a look at the following example:

(1) Alice needs to make a deal on the bank's website, and her browser first generates a random number as the symmetric key.

(2) Alice's browser requests the public key from the bank's website.

(3) The bank sends the public key to Alice.

(4) Alice's browser uses the bank's public key to encrypt its own symmetric key.

(5) Alice's browser sends the encrypted symmetric key to the bank.

(6) The bank uses the private key to decrypt the symmetric key from Alice's browser.

(7) Alice and the bank can use the symmetric key to encrypt and decrypt the content of the communication.

650) this.width=650; "alt=" asymmetric key encryption decryption "src=" Http://www.evtrust.com/knowledge/images/key.png "/>

(iii) Summary

(1) Symmetric encryption and decryption using the same key, so fast, but because the need to transfer the key in the network, so security is not high.

(2) Asymmetric encryption uses a pair of keys, public and private keys, so security is high, but encryption and decryption slow.

(3) The solution is to encrypt the symmetric encryption key using the asymmetric encryption of the public key, and then send it out, the receiver uses the private key to decrypt the symmetric encryption key, and then the two sides can use symmetric encryption to communicate

Symmetric key and asymmetric 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.