Symmetric encryption

Explanation: Encrypt and decrypt with a key

For example:

After A and B determine the key or transfer the key in A secure channel, A encrypts the plaintext (unencrypted information to be transmitted) with the key and sends it to B. B decrypts the text with the known key, and vice versa.Copy the code

Advantages:

  1. High efficiency

Disadvantages:

  1. How to determine the key between two users who are not convenient for face-to-face communication and have no secure channel
  2. Manage and update keys when the number of users increases

Algorithm:

DES,IDEA,3DES encryption algorithmCopy the code

Asymmetric algorithm

Explanation:

Each user has two keys for mutual encryption and decryption. One is public and the other is private. Both the public key and the private key can be encrypted.Copy the code

For example,

Both A and B have A pair of keys. A sends A's public key to B. B encrypts its own public key with A's public key and sends it to A. A obtains B's public key with its own key.Copy the code

Advantages:

  1. security

Disadvantages:

  1. Encryption and decryption are time-consuming and inefficient compared with symmetric encryption
  2. If C sends an error message to A using A’s public key, A cannot identify the error message.

Algorithm:

RSA, ECC (for mobile devices), Diffie-Hellman, El Gamal, DSA (for digital signature)Copy the code

Hash algorithm (digest algorithm)

Explanation:

The hash algorithm is unidirectional and irreducible. The hash algorithm results in unique values using different data, and the source data cannot be calculated. Verify common important information.Copy the code

Algorithm:

MD2, MD4, MD5, HAVAL, SHACopy the code

A digital signature

Explanation:

It is used to verify the integrity of the message, verify the identity of the sender, and prevent backtracking.Copy the code

For example:

A transmits the encrypted plaintext and the hash algorithm of the plaintext. B decrypts the plaintext with the key and compares the hash algorithm of the plaintext with the hash algorithm of the plaintext to know whether the plaintext has been modified.Copy the code