preface

Shared key encryption has the problem of key allocation that cannot transmit the security key, and public key encryption has the problem of slow encryption and decryption. The combination of these two methods can achieve a complementary method “hybrid encryption”, this article will be illustrated in the form of mixed encryption processing process, welcome interested developers to read this article.

concept

Public key encryption is used when transmitting the key and shared key encryption is used when transmitting the dataMixed encryption.

Process diagram

Assume that user A intends to send data to user B over the Internet, and encrypts the data using the fast-processing shared key encryption. The encryption key also needs to be decrypted. Therefore, USER A needs to send the key to user B.

  • After encrypting the key with the public key, A can safely send it to B. Therefore, as the receiver, B needs to generate public key P and private key S in advance.
  • B sends the public key to A
  • A Encrypts the shared key using the received public key.
  • User A sends the encrypted key to user B.
  • B Decrypts the key using the private key
  • In this way, USER A securely sends the key used in the shared key encryption to user B.
  • Next, A simply sends the data encrypted with the key to B. Data is encrypted with a shared key that is fast in processing.

Write in the last

  • The pictures used in this article are from “my first algorithm book”, if infringement, please leave a message in the comment section, the author immediately delete the relevant pictures.
  • If there are any errors in this article, please correct them in the comments section. If this article helped you, please like it and follow 😊
  • This article was first published in nuggets. Reprint is prohibited without permission 💌