Symmetric encryption, asymmetric encryption and signing

Symmetric encryption, asymmetric encryption and signature

Before using the fingerprint recognition function formally, it is necessary to understand the related content of symmetric encryption and asymmetric encryption.

Symmetric encryption: The so-called symmetry means that both parties using this encryption method use the same key to encrypt and decrypt. A key is an instruction that controls the encryption and decryption process. An algorithm is a set of rules that dictate how encryption and decryption are performed. Therefore, the security of encryption depends not only on the encryption algorithm itself, but also on the security of key management. Because the same key is used for both encryption and decryption, how to safely deliver the key to the decryptor becomes a problem that must be solved.

Asymmetric encryption: Asymmetric encryption algorithms require two keys: a public key and a private key. The public key and the private key are a pair. If the data is encrypted with the public key, only the corresponding private key can be used to decrypt it; if the data is encrypted with the private key, only the corresponding public key can be used to decrypt the data. decrypt. Because encryption and decryption use two different keys, this algorithm is called an asymmetric encryption algorithm. The basic process of the asymmetric encryption algorithm to realize the exchange of confidential information is: Party A generates a pair of keys and discloses one of them as a public key to other parties; After encrypting, send it to Party A; Party A decrypts the encrypted information with another private key kept by itself.

Signature: Add a piece of content to the back of the message to prove that the message has not been modified. Generally, a hash value is obtained by performing a hash calculation on the information. Note that this process is irreversible, that is to say, the original information content cannot be obtained through the hash value. When sending the message, encrypt the hash value and send it together with the message as a signature.

From the above content, it can be seen that the characteristics of symmetric encryption and asymmetric encryption are as follows:

the advantage of symmetric encryption is that it is fast, suitable for encryption of local data and local databases, and its security is not as good as that of asymmetric encryption. Common symmetric encryption algorithms are DES, 3DES, AES, Blowfish, IDEA, RC5, RC6.
Asymmetric encryption has high security and is suitable for encrypting data that needs to be transmitted over the network, but the speed is not as fast as symmetric encryption. Asymmetric encryption for SSH, HTTPS, TLS, electronic certificates, electronic signatures, electronic ID cards, etc.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326267615&siteId=291194637