Symmetric encryption
Symmetric encryption refers to the use of the same secret key for encryption and decryption, so it is called symmetric encryption. Symmetric encryption has only one secret key as the private key.
Simple Application Server USD1.00 New User Coupon
* Only 3,000 coupons available.
* Each new user can only get one coupon(except users from distributors).
* The coupon is valid for 30 days from the date of receipt.
Specific algorithms are: DES, 3DES, TDEA, Blowfish, RC5, IDEA. Common ones are: DES, AES, 3DES and so on.
advantage:
The
algorithm is open, the amount of calculation is small, the encryption speed is fast, and the encryption efficiency is high.
Disadvantages:
The management and distribution of secret keys are very difficult and not secure enough. Before data transmission, the sender and receiver must agree on the secret key, and then both parties must keep the secret key. If the secret key of one party is leaked, the encrypted information will be insecure. In addition, every time each pair of users uses a symmetric encryption algorithm, they need to use a unique secret key that others do not know. This will make the receiving and sending parties have a huge number of keys, and key management becomes a burden on both parties.
Asymmetric encryption
Asymmetric encryption refers to the use of different secret keys for encryption and decryption, one as the public key and the other as the private key. Information encrypted by the public key can only be decrypted by the private key. Information encrypted by the private key can only be decrypted by the public key (this is very important). The private key can only be safely kept by one party and cannot be leaked, while the public key can be sent to anyone who requests it. Asymmetric encryption uses one of this pair of keys for encryption, while decryption requires another key.
Our common digital certificates and dongles use asymmetric encryption to complete security verification.
Main algorithms: RSA, Elgamal, knapsack algorithm, Rabin, HD, ECC (elliptic curve encryption algorithm). Common ones are: RSA, ECC
advantage:
The security is higher, the public key is public, the secret key is kept by yourself, and there is no need to give the private key to others.
Disadvantages:
Encryption and decryption takes a long time and is slow, and is only suitable for encrypting a small amount of data.
Difference between the two
Compared with asymmetric encryption algorithms, symmetric encryption algorithms have much higher encryption and decryption efficiency. But the shortcoming lies in the management of secret keys and when communicating in non-secure channels, the security of key exchange cannot be guaranteed. So in the actual network environment, the two will be mixed.
For example, for the C/S model,
The
server calculates a pair of secret keys pub/pri. Keep the private key secret and make the public key public.
When the client requests the
server, it gets the public key pub of the
server.
The client uses AES to calculate a symmetric encryption key X. Then use pub to encrypt X.
The client sends the encrypted ciphertext to the server. The server obtains X through pri decryption.
Then the communication content on both sides is encrypted and decrypted by the symmetric key X with the symmetric encryption algorithm.
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.