A secure communication method, system, device, and medium

By constructing target asymmetric and symmetric encryption models and combining adversarial neural networks and deep residual networks, the problem of low security in existing secure communication methods is solved, a hybrid encryption method is implemented, and the security and efficiency of data transmission are improved.

CN118713923BActive Publication Date: 2025-10-21GUANGDONG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing secure communication methods use single adversarial neural network symmetric encryption or asymmetric encryption, which has low security and high resource consumption, and cannot meet the strict requirements of modern information security.

Method used

By constructing a target asymmetric encryption model and a target symmetric encryption model, adopting a hybrid encryption method, using adversarial neural networks to train generators and discriminators, and combining deep residual networks and batch normalization layers, the security and efficiency of the encryption system are improved.

Benefits of technology

It realizes the hybrid of symmetric encryption and asymmetric encryption, strengthens the security of network transmission data, prevents key leakage and cracking, improves encryption and decryption efficiency, and provides higher security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118713923B_ABST
    Figure CN118713923B_ABST
Patent Text Reader

Abstract

The application discloses a kind of secure communication method, system, equipment and medium, it is related to computer network technical field.The historical communication data is used to carry out model training to preset asymmetric neural network model and preset symmetric neural network model respectively, and target asymmetric encryption model and target symmetric encryption model are constructed;When receiving the plaintext to be encrypted, plaintext is encrypted based on target symmetric encryption model and target asymmetric encryption model using the key corresponding to plaintext, and target ciphertext data is generated;When receiving the ciphertext to be decrypted, ciphertext is decrypted based on target symmetric encryption model and target asymmetric encryption model using the key corresponding to ciphertext encryption data and plaintext encryption data, and target plaintext is generated.The symmetric encryption and asymmetric encryption mixed encryption mode is realized by target asymmetric encryption model and target symmetric encryption model, which can prevent key leakage or cracking, increase the security of network transmission data encryption, and ensure data security.
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 increasingly complex tasks, they are often trained to meet end-to-end objectives that go beyond simple functional specifications. These objectives include, for example, generating realistic images and solving multi-agent problems. Advancing this work, 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, assuming we know that the original data has a Gaussian distribution, but the parameters of the Gaussian distribution are unknown, we define the Gaussian distribution and then use the data to learn the parameters of the Gaussian distribution to obtain the final model. Another example is defining a classifier, such as an SVM (Support Vector Machine), and then forcing the data to undergo various high-dimensional mappings, ultimately reducing it to a simple distribution. The SVM can easily perform binary classification. In fact, the SVM has relaxed this mapping relationship, but it also provides a model: the kernel mapping (such as radial basis functions). All of these methods directly or indirectly instruct the data how to map, but different mapping methods have different capabilities.

[0004] Many complex encryption algorithms are now widely used to protect confidential information, such as medical and financial information. Modern cryptographic technology can be divided into two categories based on key type: symmetric and asymmetric. Following the successful application of machine learning in fields such as robotic control, autonomous driving, chess, and industrial control, some scholars have conducted research in neurocryptography. Early work in neurocryptography focused on key generation and exchange, providing auxiliary functions for encryption. However, existing technologies rely solely on symmetric encryption against neural networks or asymmetric encryption against neural networks, which leaves much to be desired in today's increasingly stringent information security landscape. Key management for symmetric encryption against neural networks consumes significant system resources, while asymmetric encryption is slower than 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 methods use single antagonistic neural network symmetric encryption or antagonistic neural network asymmetric encryption, which 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, to construct a target asymmetric encryption model and a target symmetric encryption model;

[0008] When receiving a plaintext to be encrypted, encrypting the plaintext using a 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 using 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 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 the asymmetric decrypted plaintext corresponding to the historical plaintext, the first distance value, and the second distance value;

[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 executing 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 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 restored data is calculated to generate a fourth distance value corresponding to the historical plaintext.

[0030] Optionally, 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:

[0031] Selecting a distance value in which the first distance value and the second distance value in the training data meet a first preset distance threshold to generate 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, upon 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 includes:

[0036] When receiving 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, upon receiving the ciphertext to be decrypted, decrypting the ciphertext using key-encrypted data and plaintext-encrypted 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 the public key corresponding to the ciphertext and the second preset data to stimulate the 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, configured to, upon receiving a plaintext to be encrypted, encrypt the plaintext using a 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 to be decrypted 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.

[0048] The present invention also provides an electronic device, comprising 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 having a computer program stored thereon, wherein the computer program implements any of the above-mentioned secure communication methods when executed.

[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. Using an asymmetric encryption method to encrypt a key, 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 of low security in existing secure communication methods that use a single adversarial neural network symmetric encryption or adversarial neural network asymmetric encryption. 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 following briefly introduces the drawings required for use in the embodiments or the description of the prior art. 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 any creative work.

[0053] Figure 1 A flowchart of a secure communication method according to the first embodiment of the present invention;

[0054] Figure 2 A flowchart of a secure communication method according to the first embodiment of the present invention;

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

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

[0057] In 2014, an article on generative adversarial networks (GANs) was published on arXiv, titled "Generative Adversarial Nets." Author Ian J. Goodfellow, a leading figure in deep learning, proposed a new framework for estimating generative models: two models are trained simultaneously: a generative model G to capture the data distribution and a discriminative model D to distinguish whether the data is real or generated (pseudo-data). This model is known as a GAN. GAN stands for Generative Adversarial Network (GAN), or adversarial neural network. Adversarial neural networks are essentially a combination of two networks: one generates simulated data (the generator), while the other determines whether the generated data is real or simulated (the discriminator). The generator network continuously optimizes its generated data to confuse the discriminator network, while the discriminator network also optimizes its own data to make its judgments more accurate. This relationship creates an adversarial relationship, hence the name adversarial neural network.

[0058] Traditional machine learning methods all directly or indirectly instruct data how to map, but different mapping methods have varying capabilities. In contrast, in GANs, the generative model can ultimately generate complete, real-world data (such as a face) from noise. This demonstrates that the generative model has mastered the distributional patterns from random noise to facial data. With this pattern, generating faces is straightforward. However, this pattern is clearly unknown at the outset; it's impossible to know in advance what distribution the random noise should follow. It's a complex distribution mapping pattern, formed through layer-by-layer mapping. However, the GAN mechanism can learn this, meaning it learns the data distribution of the real-world sample set.

[0059] What is needed now is an end-to-end neural network that can directly encrypt information, replacing the cumbersome encryption process of traditional encryption algorithms. To solve this problem, GAN adversarial neural networks are a good choice.

[0060] In GAN encryption, different types of neuron models can be used as the basic units of the generator and discriminator 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, 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 existing technology has a slow convergence speed; (2) The existing technology is a single symmetric encryption or asymmetric encryption against the neural network. In today's increasingly stringent information security environment, security needs to be improved; (3) In the existing technology, the key management of the symmetric encryption against the 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 existing technology is extremely prone to neuron death, causing the learning process to stagnate. The Sigmoid function is prone to gradient saturation. 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 disappearance, which makes the neural network unable to effectively learn weights during back propagation.

[0064] Therefore, the embodiments of the present invention provide a secure communication method, system, device and medium to solve the technical problem that the existing secure communication method uses 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 making creative work are within the scope of protection of the present invention.

[0066] Example 1

[0067] See also Figure 1 , Figure 1 A flowchart of the steps of a secure communication method provided in Example 1 of the present invention.

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

[0069] Step 101: 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, and construct a target asymmetric encryption model and a target symmetric encryption model.

[0070] like Figure 2 As shown above, the preset symmetric neural network model is an adversarial neural network symmetric encryption model. The model includes a symmetric generator and a symmetric discriminator. The symmetric generator consists of a symmetric encryption network Alice1 and a symmetric decryption network Bob1. The symmetric discriminator consists 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 consists of an asymmetric encryption network Alice2 and an asymmetric decryption network Bob2. The asymmetric discriminator consists 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, input into the neural network Private Keys Generator to generate a private key .

[0072] Both the pre-set symmetric and asymmetric neural network models are Generative Adversarial Networks (GANs), consisting of two neural networks: a generator and a discriminator. These networks collaborate through adversarial training to train the networks. This combination of training for adversarial neural network symmetric encryption and adversarial neural network asymmetric encryption yields hybrid adversarial neural network encryption, significantly improving message encryption security.

[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, all connected in sequence. The first layer is a fully connected layer (FC), which inputs data. The output is then fed into the residual network, i.e., the first residual network. The output is then fed into a one-dimensional convolutional layer (Conv), i.e., the first one-dimensional convolutional layer, which is then fed into the residual network, i.e., the second residual network, which is then fed into a one-dimensional convolutional layer (Conv), i.e., the second one-dimensional convolutional layer.

[0074] Both the first and second residual networks include a third one-dimensional convolutional layer, a first batch normalization layer, a first activation function, a fourth one-dimensional convolutional layer, and a second activation function in the second batch normalization layer. The BN (Batch Normalization) layer is a batch normalization layer. Both the first and second activation functions are ELU activation functions, or exponential linear functions.

[0075] Specifically, such as Figure 3 As shown in the residual network Resblock on the right, the residual network is composed of first inputting the input data into a one-dimensional convolutional layer (Conv), that is, the third one-dimensional convolutional layer, and then passing through a BN layer, that is, the first BN layer, and then passing through the ELU activation function, that is, the first activation function, and then passing through a one-dimensional convolutional layer (Conv), that is, the fourth one-dimensional convolutional layer, and then passing through a BN layer, that is, 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 passed through the ELU activation function, that is, 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 incorporate a deep residual network (ResNet), also known as a residual network, and a batch normalization (BN) layer into the deep residual network (ResNet). ResNet uses skip connections in the residual block (ResBlock), allowing gradients to propagate back to earlier layers more easily. This solves the vanishing gradient problem in traditional neural networks, allowing deeper networks to be built, meaning that more encrypted content can be trained 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 in the residual network and one-dimensional convolutional layers. Since the Sigmoid activation function has the disadvantage of easily vanishing gradients, while ReLU can solve this problem, it also leads to neuron death. Therefore, the residual network of the present invention chooses to use the ELU activation function to alleviate these problems.

[0078] Furthermore, 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 corresponding to the historical plaintext, the first distance value, and the second distance value.

[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 plaintexts randomly input from the historical communication data for each training, and the number of samples N for each group of plaintexts 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 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 sets of plaintexts, or multiple sets of historical plaintexts, are randomly selected from historical communication data. The neural network parameters of the initial symmetric neural network model and the initial asymmetric neural network model are initialized according to preset model update data, namely, network parameter update requirements for the anti-neural network symmetric encryption model and the anti-neural network asymmetric encryption model, which are pre-set based on actual needs. This results in an initial symmetric encryption model and an initial asymmetric encryption model. Symmetric encryption network Alice1 and symmetric decryption network Bob1 begin learning, inputting the historical key corresponding to the first ciphertext and the historical public key corresponding to the historical key into the asymmetric encryption network of the initial asymmetric encryption model for encryption, thereby obtaining a first ciphertext. At this point, asymmetric encryption network Alice2 and asymmetric decryption network Bob2 begin operation, inputting the historical key corresponding to the first ciphertext and the historical public key corresponding to the historical key into the asymmetric encryption network of the initial asymmetric encryption model for encryption, thereby obtaining a second ciphertext.

[0092] The second ciphertext and the historical key corresponding to the second ciphertext are then input into the initial asymmetric encryption model for decryption and Manhattan distance calculation, resulting in the asymmetric decrypted plaintext, first distance value, and second distance value corresponding to the historical plaintext. The asymmetric decrypted plaintext and the first ciphertext are then input into the initial symmetric encryption model for decryption and Manhattan distance calculation, resulting in the third distance value and fourth distance value corresponding to the historical plaintext. The first, second, third, and fourth distance values ​​corresponding to all historical plaintexts are used to construct training data corresponding to this round of training, and the number of training sessions is counted. When the number of training sessions equals a preset training threshold, training is completed, and then model selection is performed based on the training data to obtain the target asymmetric encryption model and target symmetric encryption model. If the number of training sessions is less than the preset training threshold, training is not yet complete and further training is required. Therefore, execution proceeds to the step of selecting historical plaintexts from the historical communication data according to the preset plaintext selection data to generate multiple sets of historical plaintexts.

[0093] Furthermore, 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 the 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 to 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 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 With asymmetric decryption of plaintext The Manhattan distance between them.

[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 them.

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

[0108]

[0109] in, is 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 using the aforementioned Manhattan distance calculation formula, thereby obtaining a first distance value corresponding to the historical plaintext. The Manhattan distance between the historical key and the key recovery data is calculated using the aforementioned Manhattan distance calculation formula, thereby obtaining a second distance value corresponding to the historical plaintext. After calculating the first and second distance values, the aforementioned asymmetric loss function can be used to calculate the loss value corresponding to decryption using the initial asymmetric encryption model for this training.

[0111] Furthermore, 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 to 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 And 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; Plain text With symmetric decryption plaintext The Manhattan distance between them.

[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; Plain text Recover data with plaintext The Manhattan distance between them.

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

[0124]

[0125] in, is 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 using the aforementioned Manhattan distance calculation formula, thereby obtaining a third distance value corresponding to the historical plaintext. The Manhattan distance between the historical plaintext and the plaintext recovery data is calculated using the aforementioned Manhattan distance calculation formula, thereby obtaining a fourth distance value corresponding to the historical plaintext. After calculating the third and fourth distance values, the aforementioned symmetric loss function can also be used to calculate the loss value corresponding to decryption using the initial symmetric encryption model for this training.

[0127] Furthermore, 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 third distance value and the fourth distance value in the training data whose distance values ​​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%, that is, random guessing. 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 decrypting the information Peve2 accurately, it is hoped that the second distance value 2 The value is 50%. This is because 50% is a random guess. If it were 100%, the inverted result would indicate the correct decryption. Therefore, 50% is necessary. After 25,000 rounds of training, the first and second distance values ​​for the first preset distance threshold are selected from all training data to obtain the first target distance value data. 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 and the asymmetric decryption network Bob2 to decrypt the ciphertext C1, 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 from 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 the symmetric discriminator Eve1 If the decryption is not accurate, the fourth distance value is expected to be The value is 50%. This is because 50% is a random guess. If it were 100%, the inverted result would indicate the correct decryption. Therefore, the 50% value is used. After 25,000 rounds of training, the third and fourth distance values ​​at the second preset distance threshold are selected from all training data to obtain the 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.

[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 to perform asymmetric encryption and encrypt the input key K. It is the public key of asymmetric encryption, and the encryption yields C2. It is an asymmetric private key. The target asymmetric encryption model is used to decrypt C2. After decryption, K is obtained. The target symmetric encryption model can then 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] Furthermore, 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 the 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, which is 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 C1 in the above. 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. Then, the adversarial neural network asymmetric encryption model, i.e., 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] Furthermore, 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 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 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. The private key is then used to decrypt the key-encrypted data corresponding to the ciphertext to obtain the initial plaintext. After the decryption is completed, the key K corresponding to the ciphertext is obtained. Then, the plaintext encrypted data corresponding to the ciphertext and the initial plaintext are input into the symmetric encryption model for decryption. 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 historical communication data is used to respectively train a preset asymmetric neural network model and a preset symmetric neural network model, 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 based on the target symmetric encryption model and the target asymmetric encryption model using the key corresponding to the plaintext to generate target ciphertext data; when the ciphertext to be decrypted is received, the ciphertext is decrypted based on the target symmetric encryption model and the target asymmetric encryption model using the key encryption data corresponding to the ciphertext and the plaintext encryption data to generate the target plaintext. By implementing an encryption method that is a hybrid of adversarial neural network symmetric encryption and adversarial neural network asymmetric encryption through the target asymmetric encryption model and the target symmetric encryption model, it is possible to prevent key leakage or cracking, increase the security of network transmission data encryption, and ensure data security. Using an asymmetric encryption method to encrypt the key, 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. By implementing a hybrid encryption method through the target asymmetric encryption model and the target symmetric encryption model, a more secure encryption system is achieved.

[0154] Existing technologies rely on either single symmetric or asymmetric adversarial neural network encryption, which, in today's increasingly stringent information security landscape, leaves much to be desired. Furthermore, key management for symmetric adversarial neural network encryption consumes significant system resources, while asymmetric encryption is slower than symmetric encryption. The present invention significantly addresses both of these issues by implementing secure communication using a targeted asymmetric encryption model and a targeted symmetric encryption model, improving encryption efficiency and significantly enhancing the security of the encryption system.

[0155] Example 2

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

[0157] A third embodiment of the present invention provides a secure communication system, comprising:

[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 respectively, and construct a target asymmetric encryption model and a target symmetric encryption model.

[0159] The target ciphertext data generating module 402 is configured to, upon 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.

[0160] The target plaintext generation module 403 is used to decrypt the ciphertext to be 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 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 from 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, and obtain the target asymmetric encryption model and the target symmetric encryption model.

[0170] The jump module is used to 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 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 to generate a first distance value corresponding to the historical plaintext;

[0175] Calculate the Manhattan distance between the historical key and the key recovery data 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 to generate the third distance value corresponding to the historical plaintext;

[0180] Calculate the Manhattan distance between the historical plaintext and the plaintext recovery data 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 first distance value and a second distance value in the training data that meet a first preset distance threshold to generate 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 generation 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 second preset data are used to stimulate the private key generator of the target asymmetric encryption model 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, 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 the secure communication method as described in any of the above embodiments.

[0196] The memory may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, a hard disk, or ROM. The memory has storage space for program code for executing any of the method steps described above. For example, the storage space for program code may include individual program codes for implementing various steps in the method described above. 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 hard disks, compact disks (CDs), memory cards, or floppy disks. The program code may be compressed, for example, in a suitable format. When executed by a processing device, these codes cause the processing device to execute the various steps in the secure communication method described above.

[0197] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the secure communication method according to any of the above embodiments is implemented.

[0198] Those skilled in the art will 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 this 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 merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, such as 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 interface, device or unit, which can be electrical, mechanical or other forms.

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

[0201] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0202] If the integrated unit is implemented as 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, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the method of the present invention. The aforementioned storage medium includes various media that can store program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.

[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 they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. 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 various embodiments of the present invention.

Claims

1. A secure communication method, 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, to construct a target asymmetric encryption model and a target symmetric encryption model; When receiving a plaintext to be encrypted, encrypting the plaintext using a 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 a ciphertext to be decrypted, decrypting 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 a target plaintext; 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, and constructing 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 the asymmetric decrypted plaintext corresponding to the historical plaintext, the first distance value, and the second distance value; 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 executing the step of selecting historical plaintexts from the historical communication data according to preset plaintext selection data to generate multiple groups of historical plaintexts.

2. The secure communication method according to claim 1, wherein: 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: 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 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.

3. The secure communication method according to claim 1, wherein: 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 restored data is calculated to generate a fourth distance value corresponding to the historical plaintext.

4. The secure communication method according to claim 1, wherein: 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 a distance value in which the first distance value and the second distance value in the training data meet a first preset distance threshold to generate 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.

5. The secure communication method according to claim 1, wherein: The step of, upon 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, includes: When receiving 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.

6. The secure communication method according to claim 1, wherein: The step of, upon receiving the ciphertext to be decrypted, decrypting 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, includes: When receiving a ciphertext to be decrypted, using the public key corresponding to the ciphertext and the second preset data to stimulate the 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.

7. A secure communication system, applied to the secure communication method according to claim 1, 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, configured to, upon receiving a plaintext to be encrypted, encrypt the plaintext using a 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 to be decrypted 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.

8. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the secure communication method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed, the secure communication method according to any one of claims 1 to 6 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