Applications of Symmetric Encryption and Asymmetric Encryption

Original text from: Potter’s personal blog

Summary content

  • What is Symmetric Encryption
  • Symmetric encryption demo
  • What is asymmetric encryption
  • Asymmetric encryption demo
  • Combination of symmetric encryption and asymmetric encryption
  • Introduce a set of feasible hybrid encryption schemes and how to apply them to interface data encryption
  • Demo source code project

What is symmetric encryption

  • Definition: > Symmetric key algorithm (English: Symmetric-key algorithm), also known as symmetric encryption, private key encryption, shared key encryption, is a type of encryption algorithm in cryptography. This type of algorithm uses the same key for encryption and decryption, or uses two keys that can be easily calculated from each other* Advantages: > The algorithm is public, the amount of calculation is small, the encryption speed is fast, and the encryption efficiency is high, suitable for large amounts of data Encrypted scenarios. For example, in HLS (HTTP Live Streaming) general encryption scenarios, AES-128 symmetric encryption algorithm is generally used to encrypt TS slices to ensure the security of multimedia resources* Disadvantages: > The security is not high, as long as you get the secret key, you can encrypt Unlock* The process of symmetric encryption: > The sender uses the key to encrypt the plaintext data into ciphertext, and then sends it out. After receiving the ciphertext, the receiver uses the same key to decrypt the ciphertext into plaintext. Read

    What is asymmetric encryption

    • Definition: > An asymmetric encryption algorithm requires two keys: a public key (publickey: public key for short) and a private key (privatekey: private key for short). The public key and the private key are a pair. If the data is encrypted with the public key, it can only be decrypted with the corresponding private key. Because two different keys are used for encryption and decryption, this algorithm is called an asymmetric encryption algorithm* Advantages: > Higher security, the public key is public, the private key is kept by itself, and there is no need to store the private key Provide the key to others* Disadvantages> Encryption and decryption are slow, only suitable for small data encryption and decryption* Symmetric encryption process: