A secure communication method and system based on adversarial neural network

By employing multi-layer convolutional neural networks and a network update protocol, the adversarial neural network system addresses gradient attack susceptibility and text sequence processing weaknesses, achieving high accuracy and robust security.

CN118214540BActive Publication Date: 2024-12-10CHONGQING UNIV
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410430617.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-09
Publication Date
2024-12-10
Estimated Expiration
2044-04-09

AI Technical Summary

Technical Problem

The existing adversarial neural networks for secure communication, as proposed by Coutinho et al., are susceptible to gradient attacks, have high learning costs, and exhibit weak capabilities in processing text sequences due to the use of feedforward neural networks.

Method used

The solution involves using multi-layer convolutional neural networks for the encoder and decoder in the adversarial neural network, combined with a chaotic algorithm to enhance security and resist forward attacks, and incorporating a network update protocol based on PGP, KDC, and TCP protocols to ensure secure communication.

Benefits of technology

This approach improves network convergence, reduces training difficulty, enhances text sequence processing capabilities, and achieves near 100% bit accuracy while providing robust defense against gradient attacks and forward attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118214540B_ABST
    Figure CN118214540B_ABST
Patent Text Reader

Abstract

The present invention provides a secure communication method and system based on an adversarial neural network. The method includes: the transmitting end converts the plaintext to be sent into multiple plaintext blocks; adopts a block cipher working mode, uses an encoder of an adversarial neural network model to encrypt multiple plaintext blocks in sequence, and the encoder adopts a multi-layer convolutional neural network; combines the ciphertext block and the plaintext length to obtain the ciphertext and sends it; the receiving end adopts a block cipher working mode, uses a decoder of an adversarial neural network model to decrypt multiple ciphertext blocks in sequence, obtains the plaintext block corresponding to each ciphertext block, and the decoder adopts a multi-layer convolutional neural network; combines the multiple plaintext blocks obtained by decryption to generate a combined plaintext; extracts the corresponding part of the length of the plaintext to be sent from the combined plaintext as the plaintext. The encoder, decoder and classifier of the present application adopt convolutional neural networks, which can reduce the difficulty of model training, have stronger ability to process text sequences, make full use of the unpredictability of neural networks, and enhance communication security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication security technology, and in particular to a secure communication method and system based on an adversarial neural network. Background Art

[0002] In 2016, the Google team proposed Adversarial Neural Cryptography (ANC) in the paper "Learning to protect communications with adversarial neural cryptography". Adversarial neural cryptography is a cross-application of neural networks and cryptography, which can achieve secure communication between different parties in a way that is resilient to almost any attachment. In the paper, the adversarial neural network of adversarial neural cryptography is Figure 1 As shown, adversarial neural networks are used for encryption without relying on other human knowledge, aiming to allow machines to learn encryption on their own.

[0003] Figure 1 In the network, Alice is the encoder, Bob is the decoder, and Eve is the classifier. The three have similar network structures. Eve is regarded as a ciphertext-only attacker, which intercepts the intermediate content of the communication between Alice and Bob and tries to decipher it. Alice and Bob learn together to counter Eve's attack in normal communication. Since Alice and Bob are collaboratively trained and share keys, the structures of the two networks are closer. At the same time, adversarial terms with Eve are set in their loss functions, so they can communicate normally, but Eve cannot crack it. During communication, the sender uses the trained encoder (Alice) to encrypt the message to obtain the ciphertext, and the receiver uses the trained decoder (Bob) to decrypt the ciphertext to obtain the message. However, Figure 1 The adversarial neural network shown suffers from considerable bit loss when trained using deep learning methods, and its bit accuracy of plaintext restoration is around 98%. There is a certain probability of garbled characters, which can cause great trouble to normal communications.

[0004] Based on the Google team, in 2018, Coutinho et al. designed a secure communication model CPA-ANC under chosen plaintext attacks in the paper "Learning perfectly secure cryptography to protect communications with adversarial neural cryptography". Figure 2As shown in Figure 2. Chosen Plaintext Attack is referred to as CPA. Figure 2 In the example, the encoder (Alice), decoder (Bob) and classifier (Eve) are all set as feedforward neural networks FCC, where the tasks of the encoder (Alice) and decoder (Bob) remain unchanged, while Eve, as a classifier, randomly sends one of the two plaintexts to the encoder (Alice), intercepts its output and determines which plaintext the result is encrypted from. This network implemented the OTP (One-TimePad) method for the first time, and the classifier (Eve) was regarded as a chosen plaintext attacker with higher attack power, which greatly improved the security of the adversarial neural network and alleviated the bit loss problem of the adversarial neural network proposed by the Google team. However, its network structure becomes more vulnerable to gradient attacks after becoming simpler. At the same time, the network's requirements for data and computing power are further increased, and there is a risk of gradient disappearance, which makes the learning cost rise sharply. In addition, with the development of the Internet, various electronic document records of computers have replaced traditional paper document records. There are a large number of text sequences in daily communications, and Figure 2 The encoder, decoder, and classifier of the adversarial neural network shown have weak capabilities for processing text sequences due to the use of feed-forward neural networks. Summary of the invention

[0005] The present invention aims to solve the technical problems in the prior art that the resistant neural network structure proposed by Coutinho et al. is susceptible to gradient attacks, has a high learning cost, and its encoder, decoder and classifier use feedforward neural networks, resulting in weak ability to process text sequences. A secure communication method and system based on adversarial neural networks are provided.

[0006] In order to achieve the above-mentioned purpose of the present invention, according to the first aspect of the present invention, the present invention provides a secure communication method based on an adversarial neural network, comprising: the sending end executes: generating a plaintext length representation according to the length of the plaintext to be sent, and converting the plaintext to be sent into multiple plaintext blocks; adopting a block cipher working mode, using an encoder of a trained adversarial neural network model to encrypt multiple plaintext blocks in sequence, and obtain a ciphertext block corresponding to each plaintext block, wherein the encoder adopts a multi-layer convolutional neural network; combining the ciphertext block and the plaintext length representation to obtain the ciphertext, and sending the ciphertext; the receiving end executes: decomposing multiple ciphertext blocks and plaintext length representations from the received ciphertext; obtaining the length of the plaintext to be sent based on the plaintext length representation; adopting a block cipher working mode, using a decoder of a trained adversarial neural network model to decrypt multiple ciphertext blocks in sequence, and obtain a plaintext block corresponding to each ciphertext block, wherein the decoder adopts a multi-layer convolutional neural network; combining the multiple plaintext blocks obtained by decryption to generate a combined plaintext; extracting the part corresponding to the length of the plaintext to be sent from the combined plaintext as the plaintext.

[0007] In order to achieve the above-mentioned purpose of the present invention, according to the second aspect of the present invention, the present invention provides a secure communication system, which is used for the secure communication method based on adversarial neural network described in the first aspect of the present invention, including a sending end, a receiving end and a central server connected to each other for communication.

[0008] The present invention improves the adversarial neural network proposed by Coutinho et al.: the encoder, decoder and classifier no longer use a feedforward neural network, but a convolutional neural network, which improves the network complexity. The adversarial neural network model can converge and realize better during training, is less prone to gradient disappearance, reduces the difficulty of model training, and can improve the accuracy of the model. The convolutional neural network is used to make the model's text sequence processing capability stronger. The network parameters of the adversarial neural network model are obtained according to training, which makes full use of the unpredictability of the neural network and improves communication security.

[0009] In addition, the present invention generates an original summary of the plaintext to be sent at the sending end, generates a verification summary at the receiving end, and verifies the consistency of the original summary and the verification summary at the receiving end, thereby improving communication security. In order to improve the forward attack defense capability of the summary, a chaotic algorithm is used to fill in the original plaintext during the summary generation process. At the same time, the LLE algorithm (full name Locally Linear Embedding algorithm) in flow learning is used to generate a summary to resist the first original image attack.

[0010] In addition, to ensure that data will not be leaked or become undecryptable due to dynamic adjustment of the adversarial neural network model, the present invention combines the ideas of PGP, KDC and TCP protocols in traditional cryptography, and designs a network update protocol specifically for the problems faced by adversarial neural cryptographic systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 This is the structural diagram of the first existing adversarial neural network model;

[0012] Figure 2 This is the structural diagram of the second existing adversarial neural network model;

[0013] Figure 3 It is a flowchart of a secure communication method based on an adversarial neural network in a preferred embodiment of the present invention;

[0014] Figure 4 is a flow chart of a secure communication method based on an adversarial neural network in another preferred embodiment of the present invention;

[0015] Figure 5 It is an overall framework diagram of a secure communication system in a preferred embodiment of the present invention;

[0016] Figure 6 This is a schematic diagram of a summary generation process in a preferred embodiment of the present invention;

[0017] Figure 7 is a schematic diagram of a network update protocol of a secure communication system in a preferred embodiment of the present invention;

[0018] Figure 8 It is a training effect diagram of the adversarial neural network model provided in a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0019] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0020] In the description of the present invention, it is necessary to understand that the terms "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.

[0021] In the description of the present invention, unless otherwise specified and limited, it should be noted that the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a mechanical connection or an electrical connection, or it can be the internal connection between two components. It can be a direct connection or an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to the specific circumstances.

[0022] The present invention discloses a secure communication method based on an adversarial neural network. The method is implemented based on a secure communication system. The secure communication system includes a transmitting end, a receiving end and a central server connected to each other for communication. Figure 5 As shown, the sending end is connected to the receiving end and the central server for communication respectively, the central server is connected to the receiving end and the sending end for communication respectively, and the receiving end is connected to the sending end and the central server for communication respectively. The sending end is the sender, which can be an electronic device equipped by the sender, and the receiving end is the receiver, which can be an electronic device equipped by the receiver, and the electronic device can be a smart terminal, a tablet computer, a personal desktop computer or a server, etc. The central server is preferably, but not limited to, a cloud server or a computer cluster.

[0023] The central server trains the adversarial neural network model and the autoencoder separately. The process of the central server training the adversarial neural network model includes:

[0024] Step 1, construct an adversarial neural network. Construct a network structure of encoder, decoder and classifier. Preferably, both the encoder and decoder use multi-layer convolutional neural networks, specifically four-layer convolutional neural networks. The classifier uses a single-layer convolutional neural network. The encoder, decoder and classifier are connected according to the adversarial neural network framework designed by Coutinho et al., that is, Figure 2 The connection relationships shown are connected to form an adversarial neural network. This application innovatively adopts a convolutional neural network to improve accuracy and security while retaining the characteristics of the convolutional network, and has a stronger ability to process text sequences.

[0025] like Figure 2As shown, the input end of the encoder (Alice) is connected to the first output end of the classifier (Eve), the output end of the encoder (Alice) is connected to the input end of the decoder (Bob), the output end of the decoder (Bob) outputs the plaintext obtained by decryption by the decoder, the classifier (Eve) intercepts the ciphertext output by the encoder (Alice) from the communication link between the encoder (Alice) and the decoder (Bob), and the classifier (Eve) decrypts the ciphertext to obtain the plaintext decrypted by the classifier.

[0026] Step 2: construct a sample pool, which includes multiple binary strings of block length. The block length needs to match the computing power and hardware resources of the hardware device that executes the secure communication method provided by the present invention, and is preferably, but not limited to, 32 bits or 64 bits.

[0027] Set up a key generator to generate encryption keys and send them to the encoder and decoder synchronously.

[0028] Step 3, perform adversarial neural network training to obtain an adversarial neural network model. During the adversarial network training process, taking a block length of 64 bits as an example, the classifier selects two 64-bit samples from the sample pool, and randomly selects a sample plaintext as plaintext, and sends the plaintext to the encoder. The key generator generates an encryption key key, and the encryption key length is also the block length. The plaintext and the key are concatenated into a 128-bit tensor, recorded as the first tensor, and the first tensor is input into the encoder for encryption to obtain a 64-bit training ciphertext ciphertext. The classifier decrypts the training ciphertext ciphertext to obtain the classifier plaintext plain_Eve. The training ciphertext ciphertext and the key key are concatenated to form a tensor, recorded as the second tensor. The second tensor is input into the decoder for decoding to obtain the decoder plaintext plain_Bob, and the classifier loss L is calculated respectively. E and the encoding-decoding loss L AB , and adjust the classifier network parameters according to the classifier loss, and adjust the network parameters of the encoder and decoder according to the encoding and decoding loss.

[0029] in:

[0030] L E =d(plain_Eve, plaintext)

[0031]

[0032] d(plain_Eve, plaintext) represents the Manhattan distance between the classifier plaintext plain_Eve and the plaintext plaintext. d(plain_Bob, plaintext) represents the Manhattan distance between the decoder plaintext plain_Bob and the plaintext plaintext.

[0033] In the above training process, the small batch training method is adopted, the optimizer uses Adam, the mini_batch is set to 128, the number of training rounds is 30,000 rounds, the learning rate is 0.0008, and when Alice-Bob is trained once, Eve is trained twice. At the same time, a batch is changed every 200 rounds of training. Through continuous training, the classifier is eventually unable to decipher the original plaintext based on the ciphertext output by the intercepted encoder, and the encoder and decoder communicate securely. The trained adversarial neural network model is sent to the sender and the decoder. The sender uses the encoder to encrypt the plaintext, and the receiver uses the decoder to decrypt the plaintext to ensure communication security. The entire cryptographic system relies on the dynamic changes and unpredictability of the adversarial neural network to provide secure communication guarantees, and uses the unpredictability of the convolutional neural network itself to achieve encryption and decryption of plaintext.

[0034] The process of training the autoencoder by the central server is:

[0035] Multiple sets of third tensors with a length equal to the block length are randomly generated. In one example, the block length is 64 bits.

[0036] A two-layer autoencoder is constructed, the first layer is the encoding layer, and the second layer is the reconstruction layer. The encoding layer generates a fourth tensor of twice the block length based on the third tensor, and the decoding layer reduces the fourth tensor to the block length to obtain the reconstructed tensor of the third tensor.

[0037] The autoencoder is trained using multiple sets of third tensors, and the mean square error is used as the loss function. The network parameters of the autoencoder are continuously adjusted according to the loss function value until the training is completed and the trained autoencoder is obtained. The central server sends the trained autoencoder to the transmitter and receiver.

[0038] In a preferred embodiment, the schematic diagram of the secure communication method based on adversarial neural network disclosed in the present invention is as follows: Figure 3 As shown, including:

[0039] The sender executes:

[0040] Step S11, generating a plaintext length representation according to the length of the plaintext to be sent, and converting the plaintext to be sent into multiple plaintext blocks.

[0041] The plaintext to be sent may be text. First, the plaintext to be sent is converted into an ASCII code format; then, the ASCII code is converted into a corresponding binary string, which is recorded as a first string.

[0042] Generating a plaintext length representation according to the length of the plaintext to be sent specifically includes: recording a first character string length plain_len corresponding to the plaintext to be sent, converting the first character string length plain_len into a binary number of a set number of digits, the binary number being the plaintext length representation. The set number of digits is preferably, but not limited to, 8 digits, 10 digits, or 12 digits. The set number of digits is determined by prior negotiation between the sending end and the receiving end.

[0043] Convert the plaintext to be sent into multiple plaintext blocks, including:

[0044] In the first character string corresponding to the plaintext to be sent, a preset position is padded with 0. The preset position needs to be negotiated in advance between the sending end and the receiving end. The preset position can be the front end, the end and the middle of the first character string, such as padded with 0 at the front end of the first character string, or padded with 0 in the middle of the first character string, or padded with 0 at the end of the first character string. Preferably, 0 is padded at the end of the first character string. By padded with 0, the length of the first character string after padded with 0 is an integer multiple of the block length. In an example, the length of the first character string after padded with 0 is an integer multiple of 64. The first character string after padded with 0 is divided into a plurality of plaintext blocks in sequence according to the block length, and the length of each plaintext block is the block length.

[0045] Step S12, adopting the block cipher working mode (CBC), using the encoder of the trained adversarial neural network model to encrypt multiple plaintext blocks in sequence to obtain the ciphertext block corresponding to each plaintext block, wherein the encoder adopts a multi-layer convolutional neural network, specifically a four-layer convolutional neural network.

[0046] The specific execution process of step S12 is as follows:

[0047] For the first plaintext block, the following formula is used to obtain the first plaintext block M 1 The corresponding ciphertext block C 1 :

[0048]

[0049] Among them, IV represents the initialization vector, and the sender and the receiver negotiate the initialization vector in advance; Key represents the encryption key, and Alice(,) represents the encoder of the trained adversarial neural network model.

[0050] For the second plaintext block and the plaintext blocks after the second plaintext block, let the index be i', i'≥2; obtain the corresponding ciphertext block according to the following formula:

[0051]

[0052] C i’-1 Indicates the ciphertext block corresponding to the i'-1th plaintext block. i’ Represents the i'th plaintext block.

[0053] Step S13, combine the ciphertext block and the plaintext length to obtain the ciphertext, and send the ciphertext. The ciphertext C is represented as:

[0054] C=(C 1 , C 2 ...C n , Splain_len)

[0055] Splain_len represents the plaintext length corresponding to the first string length plain-len.

[0056] In the secure communication method of this embodiment, the receiving end executes:

[0057] Step S21, decomposing a plurality of ciphertext blocks and plaintext length representations from the received ciphertext. In one example, a set number of bits corresponding to the plaintext length representation is decomposed from the end of the ciphertext as the plaintext length representation.

[0058] Step S22, based on the plaintext length representation, obtain the length of the plaintext to be sent. Convert the plaintext length representation into a decimal value to obtain the length of the plaintext to be sent.

[0059] Step S23, adopting the block cipher working mode, using the decoder of the trained adversarial neural network model to decrypt multiple ciphertext blocks in sequence to obtain the plaintext block corresponding to each ciphertext block, wherein the decoder adopts a multi-layer convolutional neural network, preferably, the decoder is a four-layer convolutional neural network.

[0060] In this embodiment, the block cipher working mode (CBC mode) is adopted for decryption. For the first ciphertext block, its corresponding plaintext block M is obtained by the following formula: 1 :

[0061]

[0062] Among them, IV is the initial vector of the encoder encryption at the receiving end, i'≥2, and for the subsequent i'th ciphertext block, the decryption formula for obtaining its corresponding plaintext block is:

[0063]

[0064] Bob(,) represents the decoder of the trained adversarial neural network model, and Key represents the encryption key used by the encoder. And so on, the plaintext blocks corresponding to all ciphertext blocks are decrypted respectively.

[0065] Step S24, combining the multiple plaintext blocks obtained by decryption to generate a combined plaintext M; the combined plaintext M is the plaintext after the zero is added, M=(M 0 , M 1 ...M n ).

[0066] Step S25, extracting the portion corresponding to the length of the plaintext to be sent from the combined plaintext as the plaintext, that is, deleting the 0-padded portion from the combined plaintext, and using the remaining portion as the plaintext. Specifically, the receiving end deletes the bit position of the preset 0-padded position in the combined plaintext according to the negotiation with the sending end, and uses the remaining portion after the deletion as the plaintext. In one example, when the sending end and the receiving end agree to add 0 at the end of the plaintext, the first plain_len bits are extracted from the combined plaintext as the plaintext.

[0067] In cryptography, encryption can be regarded as a kind of translation. The encrypted result still has certain pattern features that can be extracted and attacked by machine learning. Therefore, in this embodiment, in order to improve the resistance of the ciphertext to forward attacks, it is further preferred to use the first chaos algorithm to further confuse the ciphertext obtained by the sender, enhance the randomness of the ciphertext, reduce its pattern features and improve the obfuscation properties to better deal with forward attacks. Specifically, in this embodiment, step S13 executed by the sender is improved to:

[0068] Step S131, combining all ciphertext blocks and plaintext lengths to obtain an intermediate encryption vector. At this time, the intermediate encryption vector is represented by the letter C: C = (C 1 , C 2 ...C n , Splain_len);

[0069] Step S132, using the first chaos algorithm to generate a chaos matrix CTM_matrix; the first chaos algorithm is preferably but not limited to the existing Tent mapping, Logistic mapping, Cubic mapping, Hebyshev mapping, Piecewise mapping, sinusoidal mapping, sine mapping, CMIC mapping, Circle mapping, Bernoulli mapping. The shape of the chaos matrix is ​​C_len*1, where C_len represents the length of the intermediate encryption vector.

[0070] Step S133, multiplying the chaotic matrix and the intermediate encryption vector to obtain the ciphertext C′.

[0071] Accordingly, step S21 performed by the receiving end is improved as follows:

[0072] Step S211, use the first chaos algorithm to generate the chaos matrix again, and obtain the inverse matrix of the chaos matrix; since the chaotic matrix is ​​multiplied by the intermediate encryption vector to obtain the ciphertext C′, the ciphertext C′ is a square matrix of size C_len*C_len, and C_len can be obtained through the size of the ciphertext C′. The chaos matrix generated by the receiving end is also C_len*1.

[0073] Step S212, multiplying the inverse matrix by the ciphertext to obtain an intermediate encryption vector.

[0074] Step S213, decomposing all ciphertext blocks and plaintext length representations from the intermediate encryption vector. In one example, the plaintext length representation is decomposed from the end of the ciphertext.

[0075] In this embodiment, in order to improve the randomness of the chaotic matrix and improve the ability of the ciphertext to resist forward attacks, it is further preferred that the process of the transmitting end and the receiving end generating the chaotic matrix using the first chaotic algorithm includes:

[0076] Get the length C_len of the intermediate encrypted vector;

[0077] A value is randomly selected in the first variable threshold interval X∈[0,1] as the initial value of the first variable x, and the following formula is iterated C_len times, and a first variable value is obtained in each iteration:

[0078]

[0079] Where k represents the number of iterations of the first chaos algorithm, Q represents the first coefficient, x(k) represents the value of the first variable x obtained in the kth first chaos algorithm iteration;

[0080] The first variable values ​​obtained from C_len iterations are combined to form a chaotic matrix of size C_len*1.

[0081] In this implementation, it should be noted that the initial value of the first variable and the first coefficient need to be negotiated in advance between the sending end and the receiving end.

[0082] In a preferred embodiment, in order to verify the information of the sender and the receiver and further improve the communication security, Figure 4 As shown, the sender also executes:

[0083] Step S14, generating an original summary H of the plaintext to be sent, and encrypting the original summary using the private key private-key of the sender to obtain the encrypted summary RSA (H, private_key).

[0084] Step S15, concatenate the encrypted summary RSA (H, private-key) with the ciphertext C′ to obtain concatenated information, and send the concatenated information.

[0085] Accordingly, after receiving the splicing information, the receiving end executes:

[0086] Step S26, split the ciphertext and the encrypted summary RSA (H, private_key) from the spliced ​​information, decrypt the encrypted summary using the public key of the receiving end to obtain the original summary H; decrypt the ciphertext to obtain the plaintext, and generate a verification summary of the decrypted plaintext.

[0087] If chaotic matrix processing is used in the ciphertext, the receiving end first needs to execute the above steps S211-S213 to obtain all ciphertext blocks and plaintext length representations. If chaotic matrix processing is not used in the ciphertext, the receiving end directly disassembles all ciphertext blocks and plaintext length representations from the ciphertext. After obtaining all ciphertext blocks and plaintext length representations, the receiving end executes the above decryption process of steps S23-S25 to obtain the plaintext.

[0088] Step S26, verify the consistency of the original summary and the verification summary:

[0089] If the original digest and the verification digest are consistent, the decrypted plaintext is accepted; if the original digest and the verification digest are inconsistent, the decrypted plaintext is rejected.

[0090] In this embodiment, in order to improve the forward attack defense capability of the summary, the chaos algorithm is used to fill the original plaintext in the summary generation process, and the LLE algorithm (full name Locally Linear Embedding) in flow learning is used to generate the summary, so as to resist the first original image attack. Further preferably, the sending end generates the original summary of the plaintext to be sent, such as Figure 6 As shown, including:

[0091] Step S141, converting the plaintext to be sent into a second binary string, and obtaining the length of the second string; here, the second string is the same as the first string. If the first string has been obtained, the first string is directly used as the second string.

[0092] Step S142, obtain a target length that is greater than the second string length and closest to the second string length, the target length is an integer multiple of 2 times the block length, calculate the difference diff1 between the second string length and the target length, and record it as the first difference. In an example, the block length is 64 bits, then the target length is 128 bits, at this time, the difference between the length of the second string and the nearest multiple of 128 is calculated and recorded as diff1.

[0093] Step S143, using the second chaotic algorithm to obtain the first chaotic number sequence, the first chaotic number sequence is a binary sequence, taking out the first difference bit from the first chaotic number sequence and filling it into the second string to obtain the first filled plaintext. The sending end and the receiving end can negotiate the filling position of the first difference bit in advance, which can be the end or the beginning of the first string.

[0094] Step S144, divide the first place-padded plaintext into a plurality of first place-padded blocks, wherein the length of the first place-padded block is twice the block length. In one example, the length of the first place-padded block is 128 bits.

[0095] Step S145, iteratively obtain the digest of each first padding block according to the following formula, and use the digest of the last first padding block obtained as the original digest H of the plaintext to be sent:

[0096]

[0097] Among them, H i-1 Indicates the summary of the first padding block i-1, the initial summary H 0 ={0} L , the length of the first padding block is 2L, Indicates the i-th first padding block M i The first L position, Indicates the i-th first padding block M i The last L bits of Alice(,) represent the encoder of the trained adversarial neural network model; AE() represents the trained autoencoder; LLE() represents the local linear embedding algorithm, and L is a positive integer.

[0098] Accordingly, the process of generating the verification digest of the plaintext obtained by decryption at the receiving end in step S26 includes:

[0099] Step S261: convert the plaintext obtained by decryption into a third binary string, and obtain the length of the third string.

[0100] Step S262, obtaining a target length that is greater than the third character string length and closest to the third character string length, the target length being an integer multiple of 2 times the block length, and calculating a difference between the third character string length and the target length, recorded as a second difference diff2;

[0101] Step S263, using a second chaotic algorithm to obtain a second chaotic number sequence, the second chaotic number sequence is a binary sequence, taking out the second difference bit from the second chaotic number sequence and filling it into the third character string to obtain a second filled plaintext;

[0102] Step S264, dividing the second place-padded plaintext into a plurality of second place-padded blocks, wherein the length of the second place-padded block is twice the block length;

[0103] Step S265, iteratively obtain the digest of each second padding block according to the following formula, and use the digest of the last second padding block as the verification digest of the plaintext obtained by decryption

[0104]

[0105] Among them, H′ j-1 represents the summary of the j-1th second padding block, H′ 0 ={0} L , the length of the second padding block is 2L, Represents the jth second padding block M′ j The first L position, Represents the jth second padding block M′ j ; Alice(,) represents the encoder of the trained adversarial neural network model; AE() represents the trained autoencoder; LLE() represents the local linear embedding algorithm.

[0106] In this embodiment, the second chaos algorithm may be an existing Tent mapping, Logistic mapping, Cubic mapping, Hebyshev mapping, Piecewise mapping, sinusoidal mapping, sine mapping, CMIC mapping, Circle mapping, or Bernoulli mapping.

[0107] In this embodiment, in order to improve the randomness of the first chaotic number sequence and enhance the ability of the original summary to resist forward attacks, preferably, in step S143, the first chaotic number sequence is obtained by using the second chaotic algorithm, including:

[0108] Get the length C_len of the intermediate encrypted vector;

[0109] In the second variable threshold interval x k′ ∈(0, 1) randomly selects a value as the initial value x of the second variable x 0 ,but, Iterate the following formula for the number of times corresponding to the target length, and obtain a second variable value in each iteration:

[0110]

[0111]

[0112]

[0113] Wherein, k′ represents the number of iterations of the second chaos algorithm; t represents the first control parameter selected randomly; represents the Singer map value at the k′+1th iteration of the second chaotic algorithm; μ3 represents the third control parameter, μ 3 ∈(0,4];x k′ represents the second variable value at the k′th iteration of the second chaos algorithm, x k′+1 represents the second variable value at the k′+1th iteration of the second chaos algorithm; μ 2 represents the second control parameter, μ 2 ∈(0,4]; represents the logistic map value at the k′+1th iteration of the second chaotic algorithm;

[0114] All second variable values ​​obtained for the number of times corresponding to the target length are combined into a sequence, and the sequence is converted into a binary format to obtain a first chaotic sequence.

[0115] In this embodiment, it should be noted that the second variable initial value, the first control parameter, the second control parameter, and the third control parameter need to be negotiated in advance between the sending end and the receiving end.

[0116] In a preferred embodiment, Figure 5 As shown, the sending end is provided with a first vulnerability detection model, and the first vulnerability detection model calculates the distance between the ciphertext generated by the sending end and the plaintext corresponding to the ciphertext. Preferably, the distance is the Manhattan distance. If the distance is less than or equal to a preset distance threshold, a warning is issued to the receiving end;

[0117] and / or,

[0118] The receiving end is provided with a second vulnerability detection model, which calculates the distance between the received ciphertext and the plaintext obtained by decrypting the ciphertext. Preferably, the distance is the Manhattan distance. If the distance is less than or equal to a preset distance threshold, an alarm is issued to the sending end.

[0119] In this embodiment, the distance threshold is preferably but not limited to 0.1. The network structure of the first vulnerability detection model is similar to the encoder structure of the adversarial neural network, and the network structure of the second vulnerability detection model is similar to the decoder structure of the adversarial neural network. However, the input of the first alarm and the second alarm is only 64 bits. At the sending end, the ciphertext stored in the plaintext library is continuously read as the input of the first vulnerability detection model, and the Manhattan distance of the plaintext corresponding to the ciphertext output by the first vulnerability detection model is used as the loss function to train the first vulnerability detection model. When the loss of the first vulnerability detection model is lower than 0.1, an alarm warning will be sent to the other party. At the receiving end, the received ciphertext is continuously read as the input of the second vulnerability detection model, and the Manhattan distance of the plaintext obtained by decrypting the ciphertext output by the second vulnerability detection model is used as the loss function to train the second vulnerability detection model. When the loss of the second vulnerability detection model is lower than 0.1, an alarm warning will be sent to the other party.

[0120] The security and reliability of the adversarial neural cryptographic system comes from the fact that it is a dynamic system of collaborative training of encryption and decryption modules. At the same time, its encryption and decryption modules are inverse functions of each other and are not completely equivalent network structures. Therefore, how to transmit data for collaborative training to achieve a shared dynamic network structure, how to ensure the synchronous changes of the encryption and decryption module network structure to avoid the problem that old ciphertexts cannot be decrypted by new modules, and how to ensure that there is no leakage of data during transmission are more important. Previous network protocols and traditional cryptographic protocols are based on a fixed public algorithm and process. The security of these algorithms does not come from dynamic changes, so they have not solved this problem well. In order to make the adversarial neural cryptographic system available, this application designs a cryptographic protocol for the adversarial neural cryptographic system.

[0121] In a preferred embodiment, in order to enable a single network to perfectly protect a single direction of a communication channel and ensure that data will not be leaked or decrypted due to dynamic adjustment of the adversarial neural network model, this application combines the ideas of PGP, KDC and TCP protocols in traditional cryptography, and specifically addresses the problems faced by adversarial neural cryptographic systems, and designs the following Figure 7 The network update protocol shown in Figure 1. The sender and receiver execute the network update protocol during the communication, including:

[0122] When the sender sends an alarm, a timer will be started. When the timer ends, or when the record of the alarm sent by the receiver is received, the sender sends a signal of "ready to change" to the receiver, and immediately stops encrypting new ciphertext.

[0123] After receiving the ciphertext of the signal of preparation for replacement, the receiving end will start to detect the undecrypted ciphertext in the system, and after processing the undecrypted ciphertext, it will send the prepared signal (i.e. the "prepared" text message). Then the sending end and the receiving end will exchange the authorization code and use the private key to apply to the central server for the instruction to replace the adversarial neural network model.

[0124] The central server sends the newly trained adversarial neural network model to the sender and receiver. After replacing the adversarial neural network model, the sender uses the newly trained adversarial neural network model to encrypt the replaced signal (i.e. the "replaced" text message) and sends it to the receiver. The receiver verifies and replies with an authorization code, and then resumes communication.

[0125] The following example shows the detailed steps of the network update protocol, including:

[0126] Step 601: The sender (sending end) sets and trains a first vulnerability detection model, and the receiver (receiving end) sets and trains a second vulnerability detection model.

[0127] Step 602: During the communication period, the sender will continue to submit ciphertext to the central server and it will be used as a sample and put into the sample pool.

[0128] Step 603: When the sender issues an alarm warning, a two-minute timer will be started. When the timer ends, or there is a record of receiving an alarm, the sender will send a "prepare to change" signal to the receiver and immediately stop encrypting new ciphertext.

[0129] Step 604: After receiving the ciphertext "Ready to Replace", the receiver will start to detect the undecrypted ciphertext in the system, and send "Ready" after processing. Then the two parties exchange authorization codes and use the private key to apply to the central server for instructions to replace the adversarial neural network model.

[0130] Step 605: The central server sends the newly trained adversarial neural network model to the sender and the receiver. After the model is replaced, the sender uses the new model to encrypt "changed" and sends it to the receiver. The receiver verifies and replies with an authorization code, and then resumes communication.

[0131] The present invention also discloses a secure communication system for implementing the secure communication method based on adversarial neural network. Figure 5 As shown, it includes a sending end, a receiving end and a central server that are interconnected and communicated.

[0132] The performance of the secure communication method and secure communication system based on the adversarial neural network provided by the present application is verified. The experimental results show that the adversarial neural network model of the present application can achieve a bit accuracy rate close to 100% when trained on a personal computer with conventional computing power while retaining adversarial training. This provides a feasible premise for the subsequent implementation of digital signatures and CBC mode in the communication method. The training effect is as follows Figure 8 shown. Figure 8 In the figure, the relatively flat curve is the change of the reconstruction error of the classifier with the number of training times, and the curve with a downward mutation is the change of the reconstruction error of the decoder with the number of training times.

[0133] The adversarial neural network model used in this application adopts an adversarial learning method. The neural network parameters are no longer pre-set by other means, but are dynamically adjusted by the neural network during the training process. A complete protocol for adversarial neural cryptographic systems is constructed to ensure that data will not be leaked or undecryptable due to dynamic adjustment of the model. A chaotic system is used to further process the ciphertext to better eliminate its statistical characteristics. Through the vulnerability detection model, the leaked pattern features are monitored to prevent the features of a certain stage of the network from being learned, resulting in data no longer being secure. The secure communication system provided by this application is a dynamically changing and adjusted system, and its adjustment process relies on the unpredictability and randomness of the neural network. To a certain extent, it is a probabilistic cipher that does not rely on fixed mathematical problems.

[0134] The process of the LLE algorithm is explained. The LLE algorithm is mainly divided into three stages. The first stage is the process of finding K nearest neighbors. The second stage is to find the linear relationship of each sample with its K nearest neighbors in the neighborhood and obtain the linear relationship weight coefficient W. The third stage is to use the weight coefficient to reconstruct the sample data in low dimension.

[0135] Step 301: Input sample set D = {x 1 , x 2 , ..., x m}, the number of nearest neighbors k, the dimension reduced to d;

[0136] Step 302: Output a low-dimensional sample set matrix D′;

[0137] Step 303: for i 1 to m, use Euclidean distance as the metric to calculate and x i The nearest k nearest neighbors (x i1 , x i2 , ..., x ik , );

[0138] Step 304: for i 1 to m, find the local covariance matrix Z i =(x i -xj)(x i -x j ) T , and find the corresponding weight coefficient vector W i :

[0139]

[0140] Step 305: Use the weight coefficient vector W i Composition weight coefficient matrix W calculation matrix M = (IW)(IW) T ; I represents the identity matrix.

[0141] Step 306: Calculate the first d+1 eigenvalues ​​of the matrix M, and calculate the eigenvectors {y 1 ,y 2 ,...y d+1};

[0142] Step 307: The matrix spanned from the second eigenvector to the d+1th eigenvector is the output low-dimensional sample set matrix D′=(y 2 ,y 3 ,...y d+1 ).

[0143] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0144] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

Claims

1. A secure communication method based on adversarial neural network, characterized in that: include: The sender executes: Generate a plaintext length representation according to the length of the plaintext to be sent, and convert the plaintext to be sent into multiple plaintext blocks; Adopting the block cipher working mode, using the encoder of the trained adversarial neural network model to encrypt multiple plaintext blocks in sequence, and obtain the ciphertext block corresponding to each plaintext block, wherein the encoder adopts a multi-layer convolutional neural network; Combining the ciphertext block and the plaintext length indicates the ciphertext is obtained; The sender also executes: Generate an original summary of the plaintext to be sent, and encrypt the original summary using the private key of the sender to obtain an encrypted summary; splicing the encrypted summary with the ciphertext to obtain splicing information, and sending the splicing information; The process of generating the original summary of the plaintext to be sent by the sender includes: Convert the plaintext to be sent into a second binary string, and obtain the length of the second string; Obtain a target length that is greater than the second string length and closest to the second string length, wherein the target length is an integer multiple of 2 times the block length, and calculate a difference between the second string length and the target length, which is recorded as a first difference; Using a second chaotic algorithm to obtain a first chaotic number sequence, taking out the first difference bit from the first chaotic number sequence and filling it into the second character string to obtain a first filled plaintext; Divide the first place-padded plaintext into a plurality of first place-padded blocks, wherein the length of the first place-padded block is twice the length of the block; Iterate and obtain the summary of each first padding block according to the following formula, and use the summary of the last first padding block as the original summary of the plaintext to be sent Among them, H i-1 Indicates the summary of the first padding block i-1, the initial summary H0 = {0} L , the length of the first padding block is 2L, Indicates the i-th first padding block M i The first L position, Indicates the i-th first padding block M i Alice(,) represents the encoder of the trained adversarial neural network model; AE() represents the trained autoencoder; LLE() represents the local linear embedding algorithm, and L is a positive integer; Accordingly, after receiving the splicing information, the receiving end executes: Separate the ciphertext and encrypted summary from the concatenated information, and use the public key of the receiving end to decrypt the encrypted summary to obtain the original summary; Decomposing a plurality of ciphertext blocks and plaintext length representations from the received ciphertext; Obtain the length of the plaintext to be sent based on the plaintext length representation; Adopting the block cipher working mode, using the decoder of the trained adversarial neural network model to decrypt multiple ciphertext blocks in sequence to obtain the plaintext block corresponding to each ciphertext block, wherein the decoder adopts a multi-layer convolutional neural network; Combining multiple plaintext blocks obtained by decryption to generate a combined plaintext; Extracting a portion corresponding to the length of the plaintext to be sent from the combined plaintext as the plaintext; Generate a verification digest of the plaintext obtained by decryption; If the original digest and the verification digest are consistent, the decrypted plaintext is accepted; if the original digest and the verification digest are inconsistent, the decrypted plaintext is rejected.

2. A secure communication method based on adversarial neural network as claimed in claim 1, characterized in that: The sender converts the plaintext to be sent into multiple plaintext blocks, including: The plaintext to be sent is converted into a first binary string, 0 is added to the end of the first string so that the length of the first string after the 0 addition is an integer multiple of the block length, and the first string after the 0 addition is divided into multiple plaintext blocks in sequence according to the block length.

3. A secure communication method based on an adversarial neural network as claimed in claim 1 or 2, characterized in that: The sender combines the ciphertext block and the plaintext length to obtain the ciphertext, including: Combining all ciphertext blocks and plaintext length representations to obtain an intermediate encryption vector; generating a chaotic matrix using a first chaotic algorithm; Multiply the chaotic matrix and the intermediate encryption vector to obtain the ciphertext; Accordingly, the receiving end decomposes the received ciphertext into multiple ciphertext blocks and plaintext length representations, including: Generate a chaotic matrix again using the first chaotic algorithm, and obtain an inverse matrix of the chaotic matrix; Multiply the inverse matrix with the ciphertext to obtain the intermediate encrypted vector; Decompose all ciphertext blocks and plaintext length representations from the intermediate encryption vector.

4. A secure communication method based on adversarial neural network as claimed in claim 1, characterized in that: The method of obtaining the first chaotic number sequence by using the second chaotic algorithm comprises: Get the length C_len of the intermediate encrypted vector; A value is randomly selected within the second variable threshold interval as the initial value of the second variable x, and the following formula is iterated for the number of times corresponding to the target length, and a second variable value is obtained in each iteration: Wherein, k′ represents the number of iterations of the second chaos algorithm; t represents the first control parameter selected randomly; represents the Singer mapping value at the k′+1th iteration of the second chaotic algorithm; μ3 represents the third control parameter, μ3∈(0,4]; x k′ represents the second variable value at the k′th iteration of the second chaos algorithm, x k′+1 represents the second variable value in the k′+1th iteration of the second chaos algorithm; μ2 represents the second control parameter, μ2∈(0,4]; represents the logistic map value at the k′+1th iteration of the second chaotic algorithm; All second variable values ​​obtained for the number of times corresponding to the target length are combined into a sequence, and the sequence is converted into a binary format to obtain a first chaotic sequence.

5. A secure communication method based on an adversarial neural network as claimed in claim 1, 2 or 4, characterized in that: The sending end is provided with a first vulnerability detection model, which calculates the distance between the ciphertext generated by the sending end and the plaintext corresponding to the ciphertext, and issues a warning to the receiving end if the distance is less than or equal to a preset distance threshold; and / or, The receiving end is provided with a second vulnerability detection model, which calculates the distance between the received ciphertext and the plaintext obtained by decrypting the ciphertext, and sends an alarm to the sending end if the distance is less than or equal to a preset distance threshold.

6. A secure communication method based on adversarial neural network as claimed in claim 5, characterized in that: The sending end and the receiving end execute a network update protocol during the communication period, and the network update protocol includes: When the sender sends an alarm, a timer will be started. When the timer ends, or the record of the alarm sent by the receiver is received, the sender sends a signal to the receiver to prepare for change and immediately stops encrypting new ciphertext. After receiving the ciphertext of the signal to be replaced, the receiver will start to detect the undecrypted ciphertext, and send the prepared signal after processing the undecrypted ciphertext. Then the sender and the receiver exchange authorization codes and use the private key to apply to the central server for instructions to replace the adversarial neural network model. The central server sends the newly trained adversarial neural network model to the sender and receiver. After replacing the adversarial neural network model, the sender uses the newly trained adversarial neural network model to encrypt the replaced signal and sends it to the receiver. The receiver verifies and replies with an authorization code, and then resumes communication.

7. A secure communication method based on adversarial neural network as claimed in claim 6, characterized in that: The central server trains the adversarial neural network model and the autoencoder respectively, and sends the trained adversarial neural network model and the autoencoder to the sending end and the receiving end respectively; The adversarial neural network model includes an encoder, a decoder and a classifier, the encoder is a multi-layer convolutional neural network, the decoder is a multi-layer convolutional neural network, and the classifier is a single-layer convolutional neural network.

8. A secure communication system, used to implement the secure communication method based on adversarial neural network according to any one of claims 1 to 7, characterized in that: It includes a sending end, a receiving end and a central server that are interconnected and communicate with each other.

Citation Information

Patent Citations

  • Random ciphertext generation method and system, and decryption method and system

    CN106789053A

  • Image encryption method based on adversarial nerve cryptography and SHA control chaos

    CN112417467A

  • Encryption and decryption method for data transmission

    CN115225320A

  • Non-deterministic symmetric encryption system construction method based on deep learning

    CN116015762A

  • Encoding, decoding and integrity validation systems for a security document with a steganography-encoded image and methods, security document, computing devices, computer programs and associated computer-readable data carrier

    EP4064095A1