Secure communication method, system, device and medium

By constructing a target asymmetric encryption model and a target symmetric encryption model, combined with Manhattan distance calculation and key recovery mechanism, the problems of low security and resource consumption in the existing technology are solved, an efficient and secure hybrid encryption method is achieved, and the Information Security.

CN118713923AActive Publication Date: 2024-09-27GUANGDONG UNIV OF TECH

Patent Information

Application Number
CN202411107833.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-09-27
Estimated Expiration
2044-08-13

AI Technical Summary

Technical Problem

Existing secure communication methods use a single adversarial neural network symmetric encryption or asymmetric encryption, which has low security, and the key management of adversarial neural network symmetric encryption consumes system resources. Asymmetric encryption is slow and cannot meet the needs of modern information security. strict requirements.

Method used

By obtaining historical communication data, we train the preset asymmetric neural network model and symmetric neural network model, build the target asymmetric encryption model and the target symmetric encryption model, and combine the Manhattan distance calculation and key recovery mechanism to achieve symmetric encryption and asymmetric encryption. Encrypted hybrid encryption method improves the security and efficiency of the encryption system.

Benefits of technology

It implements a hybrid encryption method of symmetric encryption and asymmetric encryption to prevent key leakage and cracking, increases the encryption security of network transmission data, reduces the transmission process, improves encryption and decryption efficiency, and provides higher security encryption. system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118713923A
    Figure CN118713923A
Patent Text Reader

Abstract

The invention discloses a secure communication method, system and device and a medium, and relates to the technical field of computer networks. Performing model training on a preset asymmetric neural network model and a preset symmetric neural network model by adopting historical communication data, and constructing a target asymmetric encryption model and a target symmetric encryption model; when a to-be-encrypted plaintext is received, encrypting the plaintext by using a key corresponding to the plaintext based on the target symmetric encryption model and the target asymmetric encryption model, and generating target ciphertext data; and when a to-be-decrypted ciphertext is received, decrypting the ciphertext by using the key encryption data and the plaintext encryption data corresponding to the ciphertext based on the target symmetric encryption model and the target asymmetric encryption model, and generating a target plaintext. Through the target asymmetric encryption model and the target symmetric encryption model, a symmetric encryption and asymmetric encryption mixed encryption mode is realized, a secret key can be prevented from being leaked or cracked, the security of network transmission data encryption is improved, and the data security is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer network technology, and in particular to a secure communication method, system, device and medium. Background Art

[0002] As neural networks are applied to more and more complex tasks, they are often trained to meet end-to-end goals that go beyond simple functional specifications. These goals include, for example, generating realistic images and solving multi-agent problems. Advancing these works, we show that neural networks can learn to protect their communications to meet the specific policies of an adversary.

[0003] Traditional machine learning methods generally define a model for the data to learn. For example, if we know that the original data belongs to a Gaussian distribution, but we don't know the parameters of the Gaussian distribution, we can define the Gaussian distribution and then use the data to learn the parameters of the Gaussian distribution to get the final model. Another example is to define a classifier, such as SVM (Support Vector Machine), and then force the data to change in various ways and perform various high-dimensional mappings, and finally turn it into a simple distribution. SVM can easily separate the two categories. In fact, SVM has relaxed this mapping relationship, but it also provides a model, which is the kernel mapping (radial basis function, etc.). All of these methods are directly or indirectly telling the data how to map, but different mapping methods have different capabilities.

[0004] Many complex encryption algorithms are now widely used for confidentiality protection, such as medical and financial information protection. Modern cryptographic technology can be divided into two categories according to the key type: symmetric encryption algorithm and asymmetric encryption algorithm. After machine learning has been successfully applied in the fields of robot control, unmanned driving, chess, industrial control, etc., some scholars have conducted research in neurocryptography. The early work of neurocryptography mainly focused on key generation and key exchange, providing some auxiliary functions for encryption. However, the existing technology is a single adversarial neural network symmetric encryption or adversarial neural network asymmetric encryption. In modern times, where information security is increasingly stringent, security needs to be improved. The key management of adversarial neural network symmetric encryption consumes a lot of system resources, and the speed of asymmetric encryption is slower than that of symmetric encryption. Summary of the invention

[0005] The present invention provides a secure communication method, system, device and medium, which solves the technical problem that the existing secure communication method adopts a single adversarial neural network symmetric encryption or adversarial neural network asymmetric encryption and has low security.

[0006] The present invention provides a secure communication method, comprising:

[0007] Acquire historical communication data, use the historical communication data to perform model training on a preset asymmetric neural network model and a preset symmetric neural network model, respectively, and construct a target asymmetric encryption model and a target symmetric encryption model;

[0008] When receiving the plaintext to be encrypted, encrypting the plaintext using the key corresponding to the plaintext based on the target symmetric encryption model and the target asymmetric encryption model to generate target ciphertext data;

[0009] When a ciphertext to be decrypted is received, the ciphertext is decrypted based on the target symmetric encryption model and the target asymmetric encryption model using key encryption data and plaintext encryption data corresponding to the ciphertext to generate a target plaintext.

[0010] Optionally, the step of using the historical communication data to perform model training on a preset asymmetric neural network model and a preset symmetric neural network model respectively to construct a target asymmetric encryption model and a target symmetric encryption model includes:

[0011] Selecting historical plaintexts from the historical communication data according to preset plaintext selection data to generate multiple groups of historical plaintexts;

[0012] According to the preset model update data, the preset symmetric neural network model and the preset asymmetric neural network model are respectively updated to generate an initial symmetric encryption model and an initial asymmetric encryption model;

[0013] Inputting the historical plaintext and the historical key corresponding to the historical plaintext into the symmetric encryption network in the initial symmetric encryption model for encryption to generate a first ciphertext;

[0014] Inputting the historical key corresponding to the first ciphertext and the historical public key corresponding to the historical key into the asymmetric encryption network in the initial asymmetric encryption model for encryption to generate a second ciphertext;

[0015] Inputting the second ciphertext and the historical key corresponding to the second ciphertext into the initial asymmetric encryption model for decryption and performing Manhattan distance calculation to obtain an asymmetric decrypted plaintext, a first distance value, and a second distance value corresponding to the historical plaintext;

[0016] Inputting the asymmetric decrypted plaintext and the first ciphertext into the initial symmetric encryption model for decryption and performing Manhattan distance calculation to obtain a third distance value and a fourth distance value corresponding to the historical plaintext;

[0017] Using the first distance value, the second distance value, the third distance value and the fourth distance value corresponding to all the historical plaintexts, constructing training data and counting the number of training times;

[0018] When the number of training times is equal to a preset training threshold, a model is selected based on the training data to obtain a target asymmetric encryption model and a target symmetric encryption model;

[0019] When the number of training times is less than the preset training threshold, the process jumps to the step of selecting historical plaintexts from the historical communication data according to preset plaintext selection data to generate multiple groups of historical plaintexts.

[0020] Optionally, the step of inputting the second ciphertext and the historical key corresponding to the second ciphertext into the initial asymmetric encryption model for decryption and performing Manhattan distance calculation to obtain the asymmetric decrypted plaintext corresponding to the historical plaintext, the first distance value, and the second distance value includes:

[0021] Inputting the second ciphertext and the historical public key corresponding to the second ciphertext into the asymmetric discriminator in the initial asymmetric encryption model to perform key recovery and generate key recovery data;

[0022] Inputting the second ciphertext and the historical private key corresponding to the second ciphertext into the asymmetric decryption network in the initial asymmetric encryption model for decryption to generate an asymmetric decrypted plaintext;

[0023] Calculating the Manhattan distance between the historical key and the asymmetric decrypted plaintext to generate a first distance value corresponding to the historical plaintext;

[0024] The Manhattan distance between the historical key and the key recovery data is calculated to generate a second distance value corresponding to the historical plaintext.

[0025] Optionally, the step of inputting the asymmetric decrypted plaintext and the first ciphertext into an initial symmetric encryption model for decryption and performing Manhattan distance calculation to obtain a third distance value and a fourth distance value corresponding to the historical plaintext includes:

[0026] Inputting the first ciphertext into a symmetric discriminator in an initial symmetric encryption model to perform plaintext recovery to generate plaintext recovery data;

[0027] Inputting the asymmetric decrypted plaintext and the first ciphertext into a symmetric decryption network in an initial symmetric encryption model for decryption to generate symmetric decrypted plaintext;

[0028] Calculating the Manhattan distance between the historical plaintext and the symmetric decrypted plaintext to generate a third distance value corresponding to the historical plaintext;

[0029] The Manhattan distance between the historical plaintext and the plaintext recovery data is calculated to generate a fourth distance value corresponding to the historical plaintext.

[0030] Optionally, the step of performing model selection based on the training data to obtain a target asymmetric encryption model and a target symmetric encryption model includes:

[0031] Selecting the distance values ​​of the first distance value and the second distance value in the training data that meet the first preset distance threshold, and generating first target distance value data;

[0032] Using the initial asymmetric encryption model corresponding to the first target distance value data as the target asymmetric encryption model;

[0033] Selecting the distance values ​​of the third distance value and the fourth distance value in the training data that meet the second preset distance threshold to generate second target distance value data;

[0034] The initial symmetric encryption model corresponding to the second target distance value data is used as the target symmetric encryption model.

[0035] Optionally, when receiving the plaintext to be encrypted, the step of encrypting the plaintext using the key corresponding to the plaintext based on the target symmetric encryption model and the target asymmetric encryption model to generate target ciphertext data includes:

[0036] When receiving the plaintext to be encrypted, inputting the plaintext and the key corresponding to the plaintext into the target symmetric encryption model to encrypt the plaintext and generate plaintext encrypted data;

[0037] Using the first preset data to stimulate the public key generator of the target asymmetric encryption model to generate a public key corresponding to the plaintext;

[0038] Inputting the public key and the key corresponding to the plaintext into the target asymmetric encryption model for key encryption to generate key-encrypted data;

[0039] The target ciphertext data is constructed using the plaintext encrypted data and the key encrypted data.

[0040] Optionally, when receiving the ciphertext to be decrypted, the step of decrypting the ciphertext using the key encryption data and the plaintext encryption data corresponding to the ciphertext based on the target symmetric encryption model and the target asymmetric encryption model to generate the target plaintext includes:

[0041] When receiving a ciphertext to be decrypted, using a public key corresponding to the ciphertext and a second preset data to stimulate a private key generator of the target asymmetric encryption model to generate a private key corresponding to the ciphertext;

[0042] Inputting the private key and the key-encrypted data corresponding to the ciphertext into the target asymmetric encryption model for decryption to generate initial plaintext;

[0043] The plaintext encrypted data corresponding to the ciphertext and the initial plaintext are input into the target symmetric encryption model for decryption to generate the target plaintext.

[0044] The present invention also provides a secure communication system, comprising:

[0045] A target encryption model construction module is used to obtain historical communication data, use the historical communication data to perform model training on a preset asymmetric neural network model and a preset symmetric neural network model, and construct a target asymmetric encryption model and a target symmetric encryption model;

[0046] A target ciphertext data generation module is used to, when receiving the plaintext to be encrypted, encrypt the plaintext using the key corresponding to the plaintext based on the target symmetric encryption model and the target asymmetric encryption model to generate target ciphertext data;

[0047] The target plaintext generation module is used to decrypt the ciphertext based on the target symmetric encryption model and the target asymmetric encryption model using the key encryption data and plaintext encryption data corresponding to the ciphertext to generate the target plaintext when receiving the ciphertext to be decrypted.

[0048] The present invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of implementing any of the above-mentioned secure communication methods.

[0049] The present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed, any of the above-mentioned secure communication methods is implemented.

[0050] It can be seen from the above technical solutions that the present invention has the following advantages:

[0051] The present invention implements a hybrid encryption method of symmetric encryption and asymmetric encryption through a target asymmetric encryption model and a target symmetric encryption model, which can prevent key leakage or cracking, increase the security of network transmission data encryption, and ensure data security. The key is encrypted using an asymmetric encryption method, and the decryption party does not need to obtain the key separately, which reduces the transmission communication process and improves the efficiency of encryption and decryption. The present invention implements a hybrid encryption method through a target asymmetric encryption model and a target symmetric encryption model to achieve a more secure encryption system, solving the technical problem that the existing secure communication method uses a single adversarial neural network symmetric encryption or adversarial neural network asymmetric encryption, and has low security. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0053] Figure 1 A flowchart of a secure communication method provided in accordance with the first embodiment of the present invention;

[0054] Figure 2 A flowchart of a secure communication method provided in Embodiment 1 of the present invention;

[0055] Figure 3 A schematic diagram of the structure of a neural network infrastructure model provided in the first embodiment of the present invention;

[0056] Figure 4 This is a structural block diagram of a secure communication system provided in Embodiment 2 of the present invention. DETAILED DESCRIPTION

[0057] In 2014, an article about generative adversarial networks was published on arXiv, titled "Generative Adversarial Nets", written by Ian J. Goodfellow, a big name in the field of deep learning. The article proposed a new framework for estimating generative models: training two models at the same time, namely the generative model G used to capture data distribution and the discriminative model D used to determine whether the data is real data or generated data (pseudo data). This model is GAN. The full name of GAN is Generative adversarial network, which is an adversarial neural network. The adversarial neural network is actually a combination of two networks, which can be understood as one network generating simulated data (Generator), and the other network judging whether the generated data is real or simulated (Discriminator). The generative network must continuously optimize the data it generates so that the discriminative network cannot judge it, and the discriminative network must also optimize itself to make its judgment more accurate. The relationship between the two forms an adversarial relationship, so it is called an adversarial neural network.

[0058] Traditional machine learning methods all tell the data directly or indirectly how to map, but different mapping methods have different capabilities. In GAN, the generative model can finally generate a complete real data (such as a face) through noise, which means that the generative model has mastered the distribution law from random noise to face data. With this law, it is not easy to generate faces. However, this law is obviously unknown at the beginning. It is impossible to know in advance what distribution should be followed from random noise to face. This is a very complex distribution mapping law combined after layers of mapping. However, the mechanism of GAN can be learned, that is, GAN learns the data distribution of the real sample set.

[0059] What is needed now is an end-to-end neural network that can directly implement information encryption and replace the cumbersome encryption process of traditional encryption algorithms. In order to solve this problem, GAN adversarial neural network is a good choice.

[0060] In GAN encryption, different types of neuron models can be used as the basic units of generators and discriminators to achieve different trade-offs between accuracy and computational complexity. The following are some common neuron models: Hodgkin-Huxley (HH) model, Izhikevich (IZH) model, Leaky Integrate-and-Fire (LIF) model: LIF model, recurrent neural network (RNN), convolutional neural network (CNN), etc.

[0061] Since convolutional neural networks (CNNs) have the advantages of efficient feature extraction, spatial invariance, and deep representation learning, CNNs can be used as the basic unit of GANs to train adversarial neural network encryption.

[0062] Existing secure communication methods have the following disadvantages:

[0063] (1) The neural network used in the prior art converges slowly; (2) The prior art is a single symmetric encryption or asymmetric encryption of a neural network. In today's world where information security is increasingly demanding, security needs to be improved; (3) In the prior art, the key management of symmetric encryption of a neural network consumes a lot of system resources, and the speed of asymmetric encryption is slower than that of symmetric encryption; (4) The activation function Relu in the prior art is extremely prone to neuron death, causing the learning process to stagnate. Sigmoid (S-shaped function) is prone to gradient saturation problems. When the input of the Sigmoid function is very large or very small, the gradient is close to zero, which leads to the problem of gradient vanishing, which makes it impossible for the neural network to effectively learn weights during back propagation.

[0064] Therefore, the embodiments of the present invention provide a secure communication method, system, device and medium, which are used to solve the technical problem that the existing secure communication methods use a single adversarial neural network symmetric encryption or adversarial neural network asymmetric encryption, which has low security.

[0065] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0066] Embodiment 1

[0067] See also Figure 1 , Figure 1 A flowchart of a secure communication method provided in accordance with the first embodiment of the present invention.

[0068] A secure communication method provided in Example 1 of the present invention includes:

[0069] Step 101: Obtain historical communication data, use the historical communication data to perform model training on a preset asymmetric neural network model and a preset symmetric neural network model, and construct a target asymmetric encryption model and a target symmetric encryption model.

[0070] like Figure 2 As shown, the above is a preset symmetric neural network model, which is an adversarial neural network symmetric encryption model, and the model includes a symmetric generator and a symmetric discriminator. Among them, the symmetric generator is composed of a symmetric encryption network Alice1 and a symmetric decryption network Bob1. The symmetric discriminator is composed of a symmetric eavesdropping network Eve1.

[0071] Below is the preset asymmetric neural network model, which is an adversarial neural network asymmetric encryption model. The model includes an asymmetric generator and an asymmetric discriminator. The asymmetric generator is composed of an asymmetric encryption network Alice2 and an asymmetric decryption network Bob2. The asymmetric discriminator is composed of an asymmetric eavesdropping network Eve2. Unlike symmetric encryption, its key is a random number RN (Random Number) as an incentive, which is input into the neural network Public Keys Generator to generate a public key. , and the private key It is composed of RN (RandomNumber) and public key As an incentive, it is fed into the neural network Private Keys Generator to generate a private key .

[0072] The preset symmetric neural network model and the preset asymmetric neural network model are both adversarial neural networks (GANs), which use a model composed of two neural networks, including a generator and a discriminator. They train the network through adversarial training. The adversarial neural network symmetric encryption and adversarial neural network asymmetric encryption are trained. The combination of the two trains adversarial neural network hybrid encryption, which greatly improves the security of message encryption.

[0073] Furthermore, the neural network infrastructure models corresponding to the symmetric encryption network Alice1, the symmetric decryption network Bob1, the symmetric eavesdropping network Eve1, the asymmetric encryption network Alice2, the asymmetric decryption network Bob2 and the asymmetric eavesdropping network Eve2 are all as follows: Figure 3 As shown, the neural network infrastructure model includes a fully connected layer, a first residual network, a first one-dimensional convolutional layer, a second residual network, and a second one-dimensional convolutional layer connected in sequence. The first layer is a fully connected layer (FC, Fully Connected Layer), which inputs data. Then the output result is input to the residual network, i.e., the first residual network. Then the output result is input to a one-dimensional convolutional layer (Conv), i.e., the first one-dimensional convolutional layer, and then the output result is input to the residual network, i.e., the second residual network, and then the output result is input to a one-dimensional convolutional layer (Conv), i.e., the second one-dimensional convolutional layer.

[0074] The first residual network and the second residual network both include a third one-dimensional convolution layer, a first BN layer, a first activation function, a fourth one-dimensional convolution layer, and a second BN layer second activation function. The BN (Batch Normalization) layer is a batch normalization layer. The first activation function and the second activation function are both ELU activation functions, i.e., exponential linear functions.

[0075] Specifically, Figure 3 As shown in the residual network Resblock on the right, the residual network is composed of first inputting the input data to a one-dimensional convolutional layer (Conv), i.e. the third one-dimensional convolutional layer, and then passing through a BN layer, i.e. the first BN layer, and then passing through the ELU activation function, i.e. the first activation function, and then passing through a one-dimensional convolutional layer (Conv), i.e. the fourth one-dimensional convolutional layer, and then passing through a BN layer, i.e. the second BN layer. At this time, the input of the initial residual network is added to the output of the second Bn layer, and then passing through the ELU activation function, i.e. the second activation function, to obtain the data processed by the residual network.

[0076] Both the preset symmetric neural network model and the preset asymmetric neural network model have added a deep residual network (ResNet) network, and added a batch normalization (BN) layer to the deep residual network (ResNet). ResNet uses jump connections in residual blocks (ResBlock) to allow gradients to propagate back to early layers more easily. It solves the gradient vanishing problem in traditional neural networks, making it possible to build deeper networks, which means that more content can be trained to encrypt without compromising performance. BN normalizes the input of each batch to have zero mean and unit variance. This helps eliminate internal covariate shift, making training more stable and faster.

[0077] The ELU activation function is used on the residual network and the one-dimensional convolutional layer. Since the Sigmoid activation function has the disadvantage of easy gradient vanishing, Relu can solve the disadvantage of gradient vanishing, but it also leads to neuron death. Therefore, the residual network of the present invention chooses to use the ELU activation function to alleviate the problems of gradient vanishing and neuron death.

[0078] Further, step 101 may include the following sub-steps S11-S19:

[0079] S11. Select historical plaintexts from historical communication data according to preset plaintext selection data to generate multiple groups of historical plaintexts.

[0080] S12. Update the preset symmetric neural network model and the preset asymmetric neural network model according to the preset model update data to generate an initial symmetric encryption model and an initial asymmetric encryption model.

[0081] S13: Input the historical plaintext and the historical key corresponding to the historical plaintext into the symmetric encryption network in the initial symmetric encryption model for encryption to generate a first ciphertext.

[0082] S14: Input the historical key corresponding to the first ciphertext and the historical public key corresponding to the historical key into the asymmetric encryption network in the initial asymmetric encryption model for encryption to generate a second ciphertext.

[0083] S15. Input the second ciphertext and the historical key corresponding to the second ciphertext into the initial asymmetric encryption model for decryption and perform Manhattan distance calculation to obtain the asymmetric decrypted plaintext, the first distance value and the second distance value corresponding to the historical plaintext.

[0084] S16. Input the asymmetric decrypted plaintext and the first ciphertext into the initial symmetric encryption model for decryption and perform Manhattan distance calculation to obtain a third distance value and a fourth distance value corresponding to the historical plaintext.

[0085] S17. Use the first distance value, the second distance value, the third distance value and the fourth distance value corresponding to all historical plaintexts to construct training data and count the number of training times.

[0086] S18. When the number of training times is equal to a preset training threshold, a model is selected based on the training data to obtain a target asymmetric encryption model and a target symmetric encryption model.

[0087] S19. When the number of training times is less than a preset training threshold, jump to the step of selecting historical plaintexts from historical communication data according to preset plaintext selection data to generate multiple groups of historical plaintexts.

[0088] The preset plaintext selection data is 256 groups of plaintext randomly input from the historical communication data for each training, and the number of samples N of each group of plaintext is 16.

[0089] The preset model update data is the network parameter update requirement data of the anti-neural network symmetric encryption model and the anti-neural network asymmetric encryption model which are set in advance based on actual needs.

[0090] The preset training threshold refers to the pre-set training step size, which is usually set to 25,000 rounds.

[0091] In an embodiment of the present invention, 256 groups of plaintexts and multiple groups of historical plaintexts are randomly selected from the historical communication data, and the neural network parameters of the initial symmetric neural network model and the initial asymmetric neural network model are initialized according to the preset model update data, that is, the network parameter update requirement data of the anti-neural network symmetric encryption model and the anti-neural network asymmetric encryption model that are pre-set based on actual needs, to obtain the initial symmetric encryption model and the initial asymmetric encryption model. The symmetric encryption network Alice1 and the symmetric decryption network Bob1 start learning, and the historical key corresponding to the first ciphertext and the historical public key corresponding to the historical key are input into the asymmetric encryption network in the initial asymmetric encryption model for encryption to obtain the first ciphertext. At this time, the asymmetric encryption network Alice2 and the asymmetric decryption network Bob2 start working, and the historical key corresponding to the first ciphertext and the historical public key corresponding to the historical key are input into the asymmetric encryption network in the initial asymmetric encryption model for encryption to obtain the second ciphertext.

[0092] Then, the second ciphertext and the historical key corresponding to the second ciphertext are input into the initial asymmetric encryption model for decryption and Manhattan distance calculation is performed to obtain the asymmetric decrypted plaintext, the first distance value and the second distance value corresponding to the historical plaintext. The asymmetric decrypted plaintext and the first ciphertext are input into the initial symmetric encryption model for decryption and Manhattan distance calculation is performed to obtain the third distance value and the fourth distance value corresponding to the historical plaintext. The first distance value, the second distance value, the third distance value and the fourth distance value corresponding to all historical plaintexts are used to construct the training data corresponding to this round of training and count the number of training times. When the number of training times is equal to the preset training threshold, the training is completed, and then the model is selected based on the training data to obtain the target asymmetric encryption model and the target symmetric encryption model. When the number of training times is less than the preset training threshold, it means that the training has not ended and training needs to be continued. Therefore, the execution is jumped to select the historical plaintext in the historical communication data according to the preset plaintext selection data to generate multiple groups of historical plaintexts.

[0093] Further, step S15 may include the following sub-steps S151-S154:

[0094] S151. Input the second ciphertext and the historical public key corresponding to the second ciphertext into an asymmetric discriminator in the initial asymmetric encryption model to perform key recovery and generate key recovery data.

[0095] S152: Input the second ciphertext and the historical private key corresponding to the second ciphertext into the asymmetric decryption network in the initial asymmetric encryption model for decryption to generate an asymmetric decrypted plaintext.

[0096] S153. Calculate the Manhattan distance between the historical key and the asymmetric decrypted plaintext to generate a first distance value corresponding to the historical plaintext.

[0097] S154. Calculate the Manhattan distance between the historical key and the key recovery data, and generate a second distance value corresponding to the historical plaintext.

[0098] In the embodiment of the present invention, Figure 2 As shown, the second ciphertext and the historical public key corresponding to the second ciphertext are input into the asymmetric discriminator Eve2 in the initial asymmetric encryption model for key recovery to obtain key recovery data. The asymmetric decryption network Bob2 in the initial asymmetric encryption model uses the private key corresponding to the second ciphertext, that is, the historical private key, to decrypt the second ciphertext to obtain an asymmetric decrypted plaintext. The L1 distance, also known as the Manhattan distance, is used to represent the distance between information. The Manhattan distance calculation formula is:

[0099]

[0100] in, is the Manhattan distance; is the sample size; is the i-th element of the predicted value tensor x; is the i-th element of the target value tensor y.

[0101] The calculation formula for the first distance value corresponding to the adversarial neural network asymmetric encryption model is:

[0102]

[0103] in, is the first distance value; For the key Decrypting plaintext with asymmetric The Manhattan distance between .

[0104] The calculation formula for the second distance value corresponding to the adversarial neural network asymmetric encryption model is:

[0105]

[0106] in, is the second distance value; For the key Recover data with key The Manhattan distance between .

[0107] The asymmetric loss function corresponding to the adversarial neural network asymmetric encryption model is:

[0108]

[0109] in, The loss value corresponding to the adversarial neural network asymmetric encryption model; is the first distance value; is the second distance value.

[0110] The Manhattan distance between the historical key and the asymmetric decrypted plaintext is calculated by the above Manhattan distance calculation formula, thereby obtaining the first distance value corresponding to the historical plaintext. The Manhattan distance between the historical key and the key recovery data is calculated by the above Manhattan distance calculation formula, thereby obtaining the second distance value corresponding to the historical plaintext. After calculating the first distance value and the second distance value, the above asymmetric loss function can also be used to calculate the loss value corresponding to the decryption using the initial asymmetric encryption model in this training.

[0111] Further, step S16 may include the following sub-steps S161-S164:

[0112] S161. Input the first ciphertext into the symmetric discriminator in the initial symmetric encryption model to perform plaintext recovery to generate plaintext recovery data.

[0113] S162: Input the asymmetric decrypted plaintext and the first ciphertext into the symmetric decryption network in the initial symmetric encryption model for decryption to generate symmetric decrypted plaintext.

[0114] S163. Calculate the Manhattan distance between the historical plaintext and the symmetric decrypted plaintext, and generate a third distance value corresponding to the historical plaintext.

[0115] S164. Calculate the Manhattan distance between the historical plaintext and the plaintext recovery data to generate a fourth distance value corresponding to the historical plaintext.

[0116] In the embodiment of the present invention, Figure 2 As shown, the first ciphertext C1 is input into the symmetric discriminator Eve1 in the initial symmetric encryption model to recover the plaintext, and the plaintext recovery data is obtained. . Asymmetric decryption of plaintext The first ciphertext C1 is input into the symmetric decryption network in the initial symmetric encryption model for decryption to obtain the symmetric decrypted plaintext .

[0117] The calculation formula for the third distance value corresponding to the adversarial neural network symmetric encryption model is:

[0118]

[0119] in, is the third distance value; For plain text With symmetric decryption plaintext The Manhattan distance between .

[0120] The calculation formula for the fourth distance value corresponding to the adversarial neural network symmetric encryption model is:

[0121]

[0122] in, is the fourth distance value; For plain text Recover data with plaintext The Manhattan distance between .

[0123] The symmetric loss function corresponding to the adversarial neural network symmetric encryption model is:

[0124]

[0125] in, The loss value corresponding to the adversarial neural network symmetric encryption model; is the third distance value; is the fourth distance value.

[0126] The Manhattan distance between the historical plaintext and the symmetric decrypted plaintext is calculated by the above Manhattan distance calculation formula, thereby obtaining the third distance value corresponding to the historical plaintext. The Manhattan distance between the historical plaintext and the plaintext recovery data is calculated by the above Manhattan distance calculation formula, thereby obtaining the fourth distance value corresponding to the historical plaintext. After calculating the third distance value and the fourth distance value, the above symmetric loss function can also be used to calculate the loss value corresponding to the decryption using the initial symmetric encryption model in this training.

[0127] Further, step S18 may include the following sub-steps S181-S184:

[0128] S181, selecting a first distance value and a second distance value in the training data whose distance values ​​meet a first preset distance threshold, and generating first target distance value data.

[0129] S182. Use the initial asymmetric encryption model corresponding to the first target distance value data as the target asymmetric encryption model.

[0130] S183: Select the distance values ​​of the third distance value and the fourth distance value in the training data that meet the second preset distance threshold, and generate second target distance value data.

[0131] S184. Use the initial symmetric encryption model corresponding to the second target distance value data as the target symmetric encryption model.

[0132] The first preset distance threshold means that the first distance value is equal to 0, and the second distance value is 50%.

[0133] The second preset distance threshold means that the third distance value is equal to 0, and the fourth distance value is 50%.

[0134] In the embodiment of the present invention, the decrypted asymmetric decrypted plaintext The difference between the key K and the key K is 0, and the key recovered by the asymmetric discriminator Eve2 is recovered data The difference from the original key is 50%, which is a random guess. Since the purpose of training is to enable Pbob2 to correctly decrypt the information, the training strategy is to make the first distance value Equal to 0. In order to prevent the attacker Eve2 from accurately decrypting the information Peve2 finally decrypted, it is hoped that the second distance value 2 It is 50%. Because 50% is a random guess, if it is 100%, the inverse of the result is the correct decryption, so 50% is needed. After 25,000 rounds of training, the first distance value and the second distance value of the first preset distance threshold are selected from all the training data obtained from the training to obtain the first target distance value data. And the initial asymmetric encryption model corresponding to the first target distance value data is used as the target asymmetric encryption model.

[0135] Then, we start to use the symmetric decryption network Bob1 to decrypt the ciphertext C1 using the PBob2 obtained by the asymmetric decryption network Bob2, so that the difference between the decrypted PBob1 and the plaintext is 0, and the plaintext recovered by the discriminator Eve1 is the plaintext recovery data The difference with the original plaintext P is 50%, which is a random guess.

[0136] Since the purpose of training is to allow symmetric decryption of plaintext Can correctly decrypt the information. So the training strategy is to make the third distance value Equal to 0. In order to allow the attacker to recover the plaintext data finally decrypted by Eve1 If the decryption is not accurate, the fourth distance value is expected It is 50%. Because 50% is a random guess, if it is 100%, the inverse of the result is the correct decryption, so 50% is needed. After 25,000 rounds of training, the third distance value and the fourth distance value of the second preset distance threshold are selected from all the training data obtained from the training to obtain the second target distance value data. And the initial symmetric encryption model corresponding to the second target distance value data is used as the target symmetric encryption model.

[0137] like Figure 2 As shown in the flowchart of the secure communication method, the target symmetric encryption model is used to encrypt the input plaintext P, K is the key used for the symmetric network encryption, and the encryption obtains C1. The target asymmetric encryption model is used for asymmetric encryption to encrypt the input key K. It is the public key of asymmetric encryption, which is encrypted to obtain C2. It is an asymmetric private key. The target asymmetric encryption model is used to decrypt C2. After decryption, K is obtained. Then, the target symmetric encryption model can be used to decrypt C1 to obtain the plaintext P. This scheme can greatly improve the security of the encryption system.

[0138] Step 102: When the plaintext to be encrypted is received, the plaintext is encrypted using the key corresponding to the plaintext based on the target symmetric encryption model and the target asymmetric encryption model to generate target ciphertext data.

[0139] Further, step 102 may include the following sub-steps S21-S24:

[0140] S21. When the plaintext to be encrypted is received, the plaintext and the key corresponding to the plaintext are input into the symmetric encryption model to encrypt the plaintext and generate plaintext encrypted data.

[0141] S22. Use the first preset data to stimulate the public key generator of the asymmetric encryption model to generate a public key corresponding to the plaintext.

[0142] S23. Input the public key and the key corresponding to the plaintext into an asymmetric encryption model for key encryption to generate key-encrypted data.

[0143] S24. Use the plaintext encrypted data and the key encrypted data to construct the target ciphertext data.

[0144] The first preset data is a random number RN (Random Number) as an incentive, input into the neural network Public Keys Generator of the asymmetric encryption model to generate a public key .

[0145] In the embodiment of the present invention, when the plaintext to be encrypted is received from the sender, the adversarial neural network symmetric encryption model, i.e., the symmetric encryption model, is used to encrypt the plaintext with a key, and the obtained plaintext encrypted data is equivalent to Figure 2 The public key generator of the asymmetric encryption model is stimulated by the first preset data to obtain the public key corresponding to the plaintext, and then the adversarial neural network asymmetric encryption model, that is, the asymmetric encryption model, is used to encrypt the key corresponding to the plaintext using the public key to obtain the key-encrypted data equivalent to Figure 2 The target ciphertext data corresponding to the encrypted plaintext includes plaintext encrypted data and key encrypted data.

[0146] Step 103: When the ciphertext to be decrypted is received, the ciphertext is decrypted using the key encryption data and plaintext encryption data corresponding to the ciphertext based on the target symmetric encryption model and the target asymmetric encryption model to generate the target plaintext.

[0147] Further, step 103 may include the following sub-steps S31-S33:

[0148] S31. When receiving a ciphertext to be decrypted, the public key corresponding to the ciphertext and the second preset data are used to stimulate a private key generator of the asymmetric encryption model to generate a private key corresponding to the ciphertext.

[0149] S32. Input the key-encrypted data corresponding to the private key and the ciphertext into the asymmetric encryption model for decryption to generate initial plaintext.

[0150] S33. Input the plaintext encrypted data corresponding to the ciphertext and the initial plaintext into the symmetric encryption model for decryption to generate the target plaintext.

[0151] The second preset data incentive is to use RN (Random Number) and the public key as incentives, input the neural network Private Keys Generator of the asymmetric encryption model to generate a private key .

[0152] In the embodiment of the present invention, Figure 2 As shown, after the key K is encrypted into the ciphertext C2, it can be decrypted based on the adversarial neural network asymmetric encryption model, that is, the asymmetric encryption model. Specifically, the public key corresponding to the ciphertext and the second preset data are used to stimulate the private key generator of the asymmetric encryption model to generate the private key corresponding to the ciphertext, and then the private key is used to decrypt the key encrypted data corresponding to the ciphertext to obtain the initial plaintext. After the decryption is completed, it is equivalent to obtaining the key K corresponding to the ciphertext, and then the plaintext encrypted data corresponding to the ciphertext and the initial plaintext are input into the symmetric encryption model for decryption, and the plaintext encrypted data is decrypted to obtain the target plaintext corresponding to the target plaintext. Figure 2 In .

[0153] In an embodiment of the present invention, by acquiring historical communication data, the preset asymmetric neural network model and the preset symmetric neural network model are trained using the historical communication data, and a target asymmetric encryption model and a target symmetric encryption model are constructed; when the plaintext to be encrypted is received, the plaintext is encrypted using the key corresponding to the plaintext based on the target symmetric encryption model and the target asymmetric encryption model to generate target ciphertext data; when the ciphertext to be decrypted is received, the ciphertext is decrypted using the key encryption data corresponding to the ciphertext and the plaintext encryption data based on the target symmetric encryption model and the target asymmetric encryption model to generate the target plaintext. The hybrid encryption method of adversarial neural network symmetric encryption and adversarial neural network asymmetric encryption is implemented by the target asymmetric encryption model and the target symmetric encryption model, which can prevent key leakage or cracking, increase the security of network transmission data encryption, and ensure data security. The use of asymmetric encryption to encrypt the key does not require the decryption party to obtain the key separately, which reduces the transmission communication process and improves the efficiency of encryption and decryption. The hybrid encryption method is implemented by the target asymmetric encryption model and the target symmetric encryption model to achieve a more secure encryption system.

[0154] The prior art is a single symmetric encryption against a neural network or an asymmetric encryption against a neural network. In the modern world where information security is increasingly stringent, the security needs to be improved. Moreover, in the prior art, the key management of the symmetric encryption against a neural network consumes a lot of system resources, and the speed of asymmetric encryption is slower than that of symmetric encryption. The present invention significantly solves these two problems by performing secure communication through a target asymmetric encryption model and a target symmetric encryption model, thereby improving the efficiency of encryption and greatly improving the security of the encryption system.

[0155] Embodiment 2

[0156] See also Figure 4 , Figure 4 This is a structural block diagram of a secure communication system provided in Embodiment 2 of the present invention.

[0157] A secure communication system provided in Example 3 of the present invention includes:

[0158] The target encryption model construction module 401 is used to obtain historical communication data, use the historical communication data to perform model training on a preset asymmetric neural network model and a preset symmetric neural network model, and construct a target asymmetric encryption model and a target symmetric encryption model.

[0159] The target ciphertext data generating module 402 is used to encrypt the plaintext using the key corresponding to the plaintext based on the target symmetric encryption model and the target asymmetric encryption model to generate target ciphertext data when receiving the plaintext to be encrypted.

[0160] The target plaintext generation module 403 is used to decrypt the ciphertext using the key encryption data and plaintext encryption data corresponding to the ciphertext based on the target symmetric encryption model and the target asymmetric encryption model to generate the target plaintext when receiving the ciphertext to be decrypted.

[0161] Optionally, the target encryption model building module 401 includes:

[0162] The historical plaintext generation module is used to select historical plaintexts in historical communication data according to preset plaintext selection data to generate multiple groups of historical plaintexts.

[0163] The initial symmetric encryption model and the initial asymmetric encryption model generation module are used to update the preset symmetric neural network model and the preset asymmetric neural network model according to the preset model update data, and generate the initial symmetric encryption model and the initial asymmetric encryption model.

[0164] The first ciphertext generation module is used to input the historical plaintext and the historical key corresponding to the historical plaintext into the symmetric encryption network in the initial symmetric encryption model for encryption to generate the first ciphertext.

[0165] The second ciphertext generation module is used to input the historical key corresponding to the first ciphertext and the historical public key corresponding to the historical key into the asymmetric encryption network in the initial asymmetric encryption model for encryption to generate a second ciphertext.

[0166] The asymmetric decrypted plaintext, first distance value and second distance value obtaining module is used to input the second ciphertext and the historical key corresponding to the second ciphertext into the initial asymmetric encryption model for decryption and Manhattan distance calculation to obtain the asymmetric decrypted plaintext, first distance value and second distance value corresponding to the historical plaintext.

[0167] The third distance value and the fourth distance value obtaining module are used to input the asymmetric decrypted plaintext and the first ciphertext into the initial symmetric encryption model for decryption and Manhattan distance calculation to obtain the third distance value and the fourth distance value corresponding to the historical plaintext.

[0168] The training data and training times generating module is used to construct training data and count the training times by using the first distance value, the second distance value, the third distance value and the fourth distance value corresponding to all historical plaintexts.

[0169] The target encryption model construction submodule is used to select a model based on the training data when the number of training times is equal to a preset training threshold, so as to obtain a target asymmetric encryption model and a target symmetric encryption model.

[0170] The jump module is used to jump to the step of selecting historical plaintexts in historical communication data according to preset plaintext selection data to generate multiple groups of historical plaintexts when the number of training times is less than a preset training threshold.

[0171] Optionally, the module for obtaining the asymmetric decryption plaintext, the first distance value, and the second distance value may perform the following steps:

[0172] Inputting the second ciphertext and the historical public key corresponding to the second ciphertext into the asymmetric discriminator in the initial asymmetric encryption model to perform key recovery and generate key recovery data;

[0173] Inputting the second ciphertext and the historical private key corresponding to the second ciphertext into the asymmetric decryption network in the initial asymmetric encryption model for decryption to generate an asymmetric decrypted plaintext;

[0174] Calculate the Manhattan distance between the historical key and the asymmetric decrypted plaintext, and generate a first distance value corresponding to the historical plaintext;

[0175] The Manhattan distance between the historical key and the key recovery data is calculated to generate a second distance value corresponding to the historical plaintext.

[0176] Optionally, the module for obtaining the third distance value and the fourth distance value may perform the following steps:

[0177] Inputting the first ciphertext into the symmetric discriminator in the initial symmetric encryption model to perform plaintext recovery to generate plaintext recovery data;

[0178] Inputting the asymmetric decrypted plaintext and the first ciphertext into the symmetric decryption network in the initial symmetric encryption model for decryption to generate symmetric decrypted plaintext;

[0179] Calculate the Manhattan distance between the historical plaintext and the symmetric decrypted plaintext, and generate the third distance value corresponding to the historical plaintext;

[0180] The Manhattan distance between the historical plaintext and the plaintext recovery data is calculated to generate a fourth distance value corresponding to the historical plaintext.

[0181] Optionally, the target encryption model building submodule can perform the following steps:

[0182] Selecting a distance value in which the first distance value and the second distance value in the training data satisfy a first preset distance threshold, and generating first target distance value data;

[0183] Using the initial asymmetric encryption model corresponding to the first target distance value data as the target asymmetric encryption model;

[0184] Selecting the distance values ​​of the third distance value and the fourth distance value in the training data that meet the second preset distance threshold to generate second target distance value data;

[0185] The initial symmetric encryption model corresponding to the second target distance value data is used as the target symmetric encryption model.

[0186] Optionally, the target ciphertext data generating module 402 may perform the following steps:

[0187] When receiving the plaintext to be encrypted, the plaintext and the key corresponding to the plaintext are input into the target symmetric encryption model to encrypt the plaintext and generate plaintext encrypted data;

[0188] Using the first preset data to stimulate the public key generator of the target asymmetric encryption model to generate a public key corresponding to the plaintext;

[0189] Input the public key and the key corresponding to the plaintext into the target asymmetric encryption model for key encryption to generate key-encrypted data;

[0190] Use plaintext encrypted data and key encrypted data to construct target ciphertext data.

[0191] Optionally, the target plaintext generation module 403 may perform the following steps:

[0192] When receiving the ciphertext to be decrypted, the public key corresponding to the ciphertext and the private key generator of the target asymmetric encryption model stimulated by the second preset data are used to generate the private key corresponding to the ciphertext;

[0193] Input the key-encrypted data corresponding to the private key and ciphertext into the target asymmetric encryption model for decryption to generate the initial plaintext;

[0194] The plaintext encrypted data corresponding to the ciphertext and the initial plaintext are input into the target symmetric encryption model for decryption to generate the target plaintext.

[0195] An embodiment of the present invention further provides an electronic device, the electronic device comprising: a memory and a processor, wherein a computer program is stored in the memory; when the computer program is executed by the processor, the processor executes a secure communication method as described in any of the above embodiments.

[0196] The memory may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk or a ROM. The memory has a storage space for program codes for executing any method step in the above method. For example, the storage space for program codes may include individual program codes for implementing the various steps in the above method, respectively. These program codes may be read from or written to one or more computer program products. These computer program products include program code carriers such as a hard disk, a compact disk (CD), a memory card or a floppy disk. The program code may be compressed, for example, in an appropriate form. When these codes are run by a computing and processing device, the computing and processing device performs the various steps in the secure communication method described above.

[0197] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the secure communication method as described in any of the above embodiments is implemented.

[0198] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0199] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0200] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0201] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0202] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0203] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A secure communication method, It is characterized in that include: Acquire historical communication data, use the historical communication data to perform model training on a preset asymmetric neural network model and a preset symmetric neural network model, respectively, and construct a target asymmetric encryption model and a target symmetric encryption model; When receiving the plaintext to be encrypted, encrypting the plaintext using the key corresponding to the plaintext based on the target symmetric encryption model and the target asymmetric encryption model to generate target ciphertext data; When a ciphertext to be decrypted is received, the ciphertext is decrypted based on the target symmetric encryption model and the target asymmetric encryption model using key encryption data and plaintext encryption data corresponding to the ciphertext to generate a target plaintext.

2. The secure communication method according to claim 1, It is characterized in that The step of using the historical communication data to respectively perform model training on a preset asymmetric neural network model and a preset symmetric neural network model to construct a target asymmetric encryption model and a target symmetric encryption model comprises: Selecting historical plaintexts from the historical communication data according to preset plaintext selection data to generate multiple groups of historical plaintexts; According to the preset model update data, the preset symmetric neural network model and the preset asymmetric neural network model are respectively updated to generate an initial symmetric encryption model and an initial asymmetric encryption model; Inputting the historical plaintext and the historical key corresponding to the historical plaintext into the symmetric encryption network in the initial symmetric encryption model for encryption to generate a first ciphertext; Inputting the historical key corresponding to the first ciphertext and the historical public key corresponding to the historical key into the asymmetric encryption network in the initial asymmetric encryption model for encryption to generate a second ciphertext; Inputting the second ciphertext and the historical key corresponding to the second ciphertext into the initial asymmetric encryption model for decryption and performing Manhattan distance calculation to obtain an asymmetric decrypted plaintext, a first distance value, and a second distance value corresponding to the historical plaintext; Inputting the asymmetric decrypted plaintext and the first ciphertext into the initial symmetric encryption model for decryption and performing Manhattan distance calculation to obtain a third distance value and a fourth distance value corresponding to the historical plaintext; Using the first distance value, the second distance value, the third distance value and the fourth distance value corresponding to all the historical plaintexts, constructing training data and counting the number of training times; When the number of training times is equal to a preset training threshold, a model is selected based on the training data to obtain a target asymmetric encryption model and a target symmetric encryption model; When the number of training times is less than the preset training threshold, the process jumps to the step of selecting historical plaintexts from the historical communication data according to preset plaintext selection data to generate multiple groups of historical plaintexts.

3. The secure communication method according to claim 2, It is characterized in that The step of inputting the second ciphertext and the historical key corresponding to the second ciphertext into the initial asymmetric encryption model for decryption and performing Manhattan distance calculation to obtain the asymmetric decrypted plaintext, the first distance value and the second distance value corresponding to the historical plaintext includes: Inputting the second ciphertext and the historical public key corresponding to the second ciphertext into the asymmetric discriminator in the initial asymmetric encryption model to perform key recovery and generate key recovery data; Inputting the second ciphertext and the historical private key corresponding to the second ciphertext into the asymmetric decryption network in the initial asymmetric encryption model for decryption to generate an asymmetric decrypted plaintext; Calculating the Manhattan distance between the historical key and the asymmetric decrypted plaintext to generate a first distance value corresponding to the historical plaintext; The Manhattan distance between the historical key and the key recovery data is calculated to generate a second distance value corresponding to the historical plaintext.

4. The secure communication method according to claim 2, It is characterized in that The step of inputting the asymmetric decrypted plaintext and the first ciphertext into the initial symmetric encryption model for decryption and performing Manhattan distance calculation to obtain the third distance value and the fourth distance value corresponding to the historical plaintext includes: Inputting the first ciphertext into a symmetric discriminator in an initial symmetric encryption model to perform plaintext recovery to generate plaintext recovery data; Inputting the asymmetric decrypted plaintext and the first ciphertext into a symmetric decryption network in an initial symmetric encryption model for decryption to generate symmetric decrypted plaintext; Calculating the Manhattan distance between the historical plaintext and the symmetric decrypted plaintext to generate a third distance value corresponding to the historical plaintext; The Manhattan distance between the historical plaintext and the plaintext recovery data is calculated to generate a fourth distance value corresponding to the historical plaintext.

5. The secure communication method according to claim 2, It is characterized in that The step of selecting a model based on the training data to obtain a target asymmetric encryption model and a target symmetric encryption model includes: Selecting the distance values ​​of the first distance value and the second distance value in the training data that meet the first preset distance threshold, and generating first target distance value data; Using the initial asymmetric encryption model corresponding to the first target distance value data as the target asymmetric encryption model; Selecting the distance values ​​of the third distance value and the fourth distance value in the training data that meet the second preset distance threshold to generate second target distance value data; The initial symmetric encryption model corresponding to the second target distance value data is used as the target symmetric encryption model.

6. The secure communication method according to claim 1, It is characterized in that The step of encrypting the plaintext to be encrypted using the key corresponding to the plaintext based on the target symmetric encryption model and the target asymmetric encryption model to generate target ciphertext data when the plaintext to be encrypted is received includes: When receiving the plaintext to be encrypted, inputting the plaintext and the key corresponding to the plaintext into the target symmetric encryption model to encrypt the plaintext and generate plaintext encrypted data; Using the first preset data to stimulate the public key generator of the target asymmetric encryption model to generate a public key corresponding to the plaintext; Inputting the public key and the key corresponding to the plaintext into the target asymmetric encryption model for key encryption to generate key-encrypted data; The target ciphertext data is constructed using the plaintext encrypted data and the key encrypted data.

7. The secure communication method according to claim 1, It is characterized in that The step of decrypting the ciphertext using the key encryption data and the plaintext encryption data corresponding to the ciphertext based on the target symmetric encryption model and the target asymmetric encryption model to generate the target plaintext when the ciphertext to be decrypted is received includes: When receiving a ciphertext to be decrypted, using a public key corresponding to the ciphertext and a second preset data to stimulate a private key generator of the target asymmetric encryption model to generate a private key corresponding to the ciphertext; Inputting the private key and the key-encrypted data corresponding to the ciphertext into the target asymmetric encryption model for decryption to generate initial plaintext; The plaintext encrypted data corresponding to the ciphertext and the initial plaintext are input into the target symmetric encryption model for decryption to generate the target plaintext.

8. A secure communication system, It is characterized in that include: A target encryption model construction module is used to obtain historical communication data, use the historical communication data to perform model training on a preset asymmetric neural network model and a preset symmetric neural network model, and construct a target asymmetric encryption model and a target symmetric encryption model; A target ciphertext data generation module is used to, when receiving the plaintext to be encrypted, encrypt the plaintext using the key corresponding to the plaintext based on the target symmetric encryption model and the target asymmetric encryption model to generate target ciphertext data; The target plaintext generation module is used to decrypt the ciphertext using the key encryption data and plaintext encryption data corresponding to the ciphertext based on the target symmetric encryption model and the target asymmetric encryption model when receiving the ciphertext to be decrypted, so as to generate the target plaintext.

9. An electronic device, It is characterized in that It comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the secure communication method as claimed in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed, the secure communication method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Equivalent key acquisition method and device and computer readable storage medium

    CN110071798A

  • GAN game confrontation encryption system (method) based on chaotic model

    CN110324147A

  • Adversarial neural network encryption training method with low bit error rate

    CN110598861A

  • PMS data transmission system and method based on 5G network module

    CN114389839A

  • Neural network federation modeling method and device employing transfer learning, and storage medium

    WO2020029585A1

Cited By

  • Medical image encryption system and method based on double adversarial neural network

    CN119583725A

  • Encryption and decryption method based on generative neural network model

    CN122247726A