Casual transmission method based on generative adversarial network
By combining the generative adversarial network with the CKKS full homomorphic encryption algorithm, an inadvertent transmission protocol is built, which solves the problems of information security and efficiency of traditional protocols, realizes the security and privacy protection of information transmission, and improves computing efficiency and encryption The security of the algorithm.
Patent Information
- Application Number
- CN202410957494.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2044-07-17
AI Technical Summary
The existing inadvertent transmission protocols are difficult to ensure the security and privacy of information when facing malicious attacks and cracks, and traditional cryptographic algorithms have problems of inefficiency in information transmission.
Generative adversarial network combined with CKKS all-homomorphic encryption algorithm is adopted to build an inadvertent transmission protocol through the adversarial learning mechanism of neural networks, and end-to-end training is used for multiple attack networks to generate a more secure symmetric encryption algorithm, and in the random inadvertent transmission protocol. Apply CKKS homomorphic encryption algorithm to improve computing efficiency.
It realizes security and privacy protection during information transmission, provides a new privacy protection solution, improves computing efficiency, resists brute-force cracking, plaintext attacks and ciphertext attacks, and improves the security of encryption algorithms.
Smart Images

Figure CN118890184A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of private information transmission in privacy computing, and specifically to an oblivious transmission method based on a generative adversarial network. Background Art
[0002] With the rapid development and application of big data, cloud computing, and mobile Internet, the circulation of information data has shown a high-speed and extensive trend. Information security has received more and more attention, and data security has gradually become a hot issue. Privacy protection is facing new crises and challenges. The emergence of privacy computing technology provides an effective solution to this problem. Privacy computing can calculate and process data while ensuring that data is not leaked, that is, it guarantees privacy security on the basis of data circulation. The secure multi-party computing technology in privacy computing provides a method for multiple independent and mutually untrusting participants to jointly calculate a function without the existence of a trusted third party and each can obtain the corresponding output result. In addition, secure multi-party computing can ensure that each participant can only obtain its own results, and its private input is not leaked. At the same time, the participants cannot infer the privacy information of any other party through the output results. Secure multi-party computing solves the privacy protection problem of distributed computing between multiple independent and mutually untrusting participants, which has important research significance and value.
[0003] Oblivious transfer, proposed by Rabin, is a cryptographic protocol and an important secure two-party computing protocol and key technology in privacy computing. Oblivious transfer is widely used and plays the role of a basic building block in many other security protocols. It also plays a huge role and occupies an important position in the fields of Privacy Set Intersection (PSI), Private Information Retrieval (PIR) and Location-Based Service (LBS). Therefore, oblivious transfer can become a bottleneck for applications that call it, and the escalating malicious attacks and cracking have also put forward new requirements for the security and privacy of oblivious transfer.
[0004] Generative adversarial networks are a powerful generative model. The characteristics of adversarial learning mechanisms have made generative adversarial networks quickly become a hot topic in the field of artificial intelligence after they were proposed. They have provided new ideas for many fields, injected new development vitality, and promoted the development of these fields. Nowadays, generative adversarial networks have penetrated into various fields and have been developed in many fields. They are widely used in image generation, speech synthesis, information security, etc. In recent years, generative adversarial networks have also made certain progress in symmetric encryption systems in the direction of cryptography. With the rapid development of artificial intelligence technology, there is still great potential in applying artificial intelligence to the field of oblivious transfer protocols. Generative adversarial networks also have application scenarios to be explored in the field of information security, and need to be expanded to broader fields.
[0005] In summary, the research on the combination of oblivious transfer protocols and generative adversarial networks has important theoretical and practical significance. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide an oblivious transmission method based on a generative adversarial network. As a new privacy protection method, a generative adversarial network is used to construct an oblivious transmission protocol to ensure the security of secret information.
[0007] The technical solution adopted by the present invention is: an oblivious transmission method based on a generative adversarial network, comprising the following steps:
[0008] Step 1: Generate the plaintext and key data of the set batch size required for each training of the neural network, and preprocess the data;
[0009] Step 2: Input the preprocessed data in step 1 into the neural network model, and obtain a symmetric encryption algorithm based on an adversarial learning mechanism through end-to-end adversarial training of the encryption and decryption model and multiple attack network models; the attack network includes a brute force network, a chosen plaintext attack network, and a chosen ciphertext attack network;
[0010] Step 3: Execute the 2-choose-1 random oblivious transfer protocol based on the CKKS fully homomorphic encryption algorithm to complete the key generation and transmission. After the protocol is completed, the sender obtains two keys corresponding to the two messages to be sent, and the receiver obtains a key corresponding to the message it selects;
[0011] Step 4: Using the symmetric encryption algorithm obtained in step 2, the sender uses the two keys obtained in step 3 to encrypt the two messages and sends the two encrypted messages to the receiver. The receiver uses the key obtained in step 3 to decrypt the ciphertext corresponding to the selected message to obtain the selected message, thus completing the encrypted transmission of the information.
[0012] Furthermore, the step 1 is specifically as follows:
[0013] Step 1.1: Both plaintext and key are set to binary numbers with a length of N = 256 bits. Plaintext and key data with a batch size of 4096 are randomly generated during each training;
[0014] Step 1.2: Before entering the neural network, the plaintext and key data are preprocessed and the binary numbers 0 and 1 are replaced with floating point numbers -1 and 1 respectively.
[0015] Furthermore, the step 2 is specifically as follows:
[0016] Step 2.1: Define the loss function for each neural network that appears in the neural network model:
[0017] The parameters of the encryption network Alice, the decryption network Bob and the brute force network Eve1 are represented by θ A ,θ B and θ E1 Indicates that E A (θ A ,p,k) is defined as the encryption output of the encryption network Alice for the real plaintext p and the key k. B (θ B ,c,k) is defined as the decryption output of the decryption network Bob for the ciphertext c and key k. E1 (θ E1 ,c) is defined as the decryption output of ciphertext c by brute force network Eve1;
[0018] Use the L1 function to describe the gap between the actual plaintext p and the estimated plaintext p' output by the neural network:
[0019]
[0020] Among them, N is the length of the plaintext, p i is the ith element in the real plaintext p, p′ i is the i-th element in the estimated plaintext p′; d(p,p′) represents the L1 distance between the real plaintext p and the estimated plaintext p′.
[0021] Define the loss function of the decryption network Bob:
[0022] L B =d(p,D B (θ B ,E A (θ A ,p,k),k)) (2)
[0023] Define the loss function for brute force cracking network Eve1:
[0024] L E1=d(p,D E1 (θ E1 ,E A (θ A ,p,k))) (3)
[0025] Define the loss function of the chosen plaintext attack network Eve2:
[0026]
[0027] Among them, when c (i) Yes (i) When the ciphertext otherwise f j (i) is the model output value; M is the number of plaintext and ciphertext pairs;
[0028] Define the loss function of the chosen ciphertext attack network Eve3:
[0029]
[0030] Among them, when p (i) It is c (i) When the plain text otherwise is the model output value; M is the number of plaintext and ciphertext pairs;
[0031] Define the overall loss function of the encryption network Alice and the decryption network Bob:
[0032]
[0033] Among them, Err E2 is the classification error of Eve2, Err E3 is the classification error of Eve3;
[0034] Step 2.2: Use a batch of data preprocessed in step 1 as the input of the neural network, and train the encryption and decryption model composed of the encryption network Alice and the decryption network Bob once;
[0035] Step 2.3: Train the three attack networks Eve1, Eve2, and Eve3 twice respectively, thereby adding a slight computational advantage to the attack network;
[0036] Step 2.4: Repeat N times s In steps 2.2 and 2.3, the encryption and decryption models and the attack network model are alternately trained, and the finally trained Alice network is used as the encryption algorithm and the Bob network is used as the decryption algorithm to obtain a symmetric encryption algorithm based on the adversarial learning mechanism.
[0037] Furthermore, the step 3 is specifically as follows:
[0038] Step 3.1: The sender generates a public-private key pair, selects a random value a from the plaintext space, performs CKKS homomorphic encryption on the random value a, obtains ciphertext A, and sends ciphertext A to the receiver;
[0039] Step 3.2: The receiver inputs its choice σ∈{0,1} and selects a random value b from the plaintext space; if σ=0, the random value b is homomorphically encrypted by CKKS to obtain ciphertext B; if σ=1, the random value b is homomorphically encrypted by CKKS and then homomorphically added to ciphertext A to obtain ciphertext B; ciphertext B is sent to the sender;
[0040] Step 3.3: The sender decrypts the ciphertext B to obtain the decryption result d, and then calculates the two keys k0=F(d,e P ,1) and k1=F(d,a,-1); where e P is the unit element in the plaintext space; define the function F as F(b,a,q)=H(b* P a q ), H is the SHA256 hash algorithm, * P It is an addition operation on the plaintext space. When calculating k0, q takes 1, and when calculating k1, q takes -1.
[0041] Step 3.4: The receiver calculates the key k σ =F(b,e P ,1).
[0042] Furthermore, the step 4 is specifically as follows:
[0043] Step 4.1: The sender uses the two keys k0 and k1 generated in step 3 as the input of the encryption network Alice in step 2, and encrypts the two messages m0 and m1 to be sent respectively, obtaining two ciphertexts c0 and c1;
[0044] Step 4.2: The sender sends the two ciphertexts c0 and c1 encrypted by the encryption network Alice to the receiver, and the receiver receives the two ciphertexts c0 and c1;
[0045] Step 4.3: The receiver uses the ciphertext c corresponding to the selected message σ and key k σ As the input of the decryption network Bob in step 2, the ciphertext is decrypted to obtain the selected message m in plaintext form. σ , complete the encrypted transmission of information.
[0046] Compared with the prior art, the present invention has the following beneficial effects:
[0047] 1) This invention uses the adversarial learning mechanism of generative adversarial networks in symmetric encryption scenarios, combines it with oblivious transmission, and proposes an oblivious transmission protocol based on generative adversarial networks. It breaks through the traditional thinking mode and research method of using specific cryptographic algorithms for information transmission in oblivious transmission, and replaces it with adversarial learning between neural networks, providing a new perspective and idea for oblivious transmission;
[0048] 2) The oblivious transfer protocol based on generative adversarial networks proposed in the present invention ensures the security of information between the two communicating parties during the transmission process and the protection of the privacy of both parties during the execution of the protocol, realizes the privacy requirements of the oblivious transfer protocol, and provides a new privacy protection solution;
[0049] 3) The present invention uses the CKKS (Cheon-Kim-Kim-Song) homomorphic encryption algorithm in the random oblivious transfer protocol, using approximate calculations in exchange for improved computing efficiency. Compared with the classic Paillier and BFV algorithms, CKKS has faster computing speed and higher efficiency;
[0050] 4) The present invention designs a variety of attack networks for adversarial network encryption, namely, brute force attack networks, chosen plaintext attack networks, and chosen ciphertext attack networks. The greater the threat posed by the attack network, the easier it is for the model to learn a more secure encryption algorithm. In the presence of three attack networks with different attack capabilities, the model is trained using an adversarial learning mechanism. The obstacles faced by the sender and the receiver during the training process are enhanced. The communicating parties must find a more secure cryptographic system that can simultaneously resist brute force attacks, chosen plaintext attacks, and chosen ciphertext attacks for communication, and the security of the resulting encryption algorithm is further improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 Schematic diagram of the overall framework of the oblivious transmission method based on the generative adversarial network of the present invention.
[0052] Figure 2 This is the overall structure diagram of the adversarial network model under multiple attack networks.
[0053] Figure 3 Schematic diagram of the adversarial training process of the adversarial network model.
[0054] Figure 4 Schematic diagram of the change curve of the number of correct bits in the output of the decryption network Bob and the brute force network Eve1 as the number of training iterations increases during the training process of the adversarial network model.
[0055] Figure 5 Schematic diagram of the classification error rate change curve of the selected plaintext attack network Eve2 as the number of training iterations increases during the training process of the adversarial network model.
[0056] Figure 6 Schematic diagram of the classification error rate change curve of the ciphertext attack network Eve3 as the number of training iterations increases during the training process of the adversarial network model.
[0057] Figure 7 This is the flow chart of the random oblivious transfer protocol based on the CKKS homomorphic encryption algorithm. DETAILED DESCRIPTION
[0058] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0059] The overall framework of the method of the present invention is as follows Figure 1 As shown, the method consists of two stages: a random oblivious transfer protocol based on the CKKS homomorphic encryption algorithm and encrypted information transmission based on a generative adversarial network.
[0060] Step 1: Generate the “small batch” size of plaintext and key data required for each neural network training, and preprocess the data.
[0061] Both the plaintext and the key are set to binary numbers with a length of N = 256 bits, and a batch size of 4096 plaintext and key data is randomly generated during each training.
[0062] Since neural networks all process floating point numbers, in order to make the training more stable, the plaintext and key data are preprocessed before entering the neural network, and the binary numbers 0 and 1 are replaced with floating point numbers -1 and 1 respectively to facilitate processing by the neural network.
[0063] Step 2: Train the neural network model using "small batch" processing. Input the preprocessed data in step 1 into the neural network model. After end-to-end adversarial training of encryption and decryption models and multiple attack network models, the attack networks include brute force cracking networks, chosen plaintext attack networks, and chosen ciphertext attack networks, a symmetric encryption method based on adversarial learning mechanism is obtained.
[0064] The overall structure of the adversarial network model under multiple attack networks is as follows: Figure 2As shown. Unlike the usual one-to-one generative adversarial network, the five neural networks form a one-to-many adversarial network model. Alice encrypts and sends messages, Bob receives and decrypts messages, and three attackers monitor the communication, but they can only obtain ciphertexts, but cannot send messages or modify information during transmission. Alice uses the key to encrypt two plaintexts to obtain two corresponding ciphertexts, sends the ciphertexts to the public channel, and the receiver receives a ciphertext from the public channel and decrypts it. Attacker Eve1 intercepts a ciphertext and tries to recover the plaintext through brute force; attacker Eve2 simulates a chosen plaintext attack to determine which plaintext the received ciphertext is encrypted from; attacker Eve3 simulates a chosen ciphertext attack to determine which ciphertext the received plaintext corresponds to. In order to resist three attack methods at the same time, Alice and Bob need to continuously update in training to obtain a more secure encryption method.
[0065] The input of Alice network is N-bit plaintext and N-bit key. First, the two N-bit inputs are connected into a 2N-bit vector. The floating point numbers -1 and 1 in the vector represent bits 0 and 1. Then, the vector passes through a 2N×2N fully connected layer and four one-dimensional convolutional layers. The number of channels of the four one-dimensional convolutional layers are 2, 4, 4, and 1 respectively. The convolution kernel sizes are set to 4, 2, 1, and 1 respectively, and the step sizes are 1, 2, 1, and 1 respectively. For example, the first one-dimensional convolutional layer slides a convolution kernel of size 4 on the 2N-bit output of the fully connected layer with a step size of 1. Except for the last convolutional layer, the activation function of each layer is the S-shaped growth curve Sigmoid function. The hyperbolic tangent Tanh function is used in the last layer to make the output between [-1,1], and finally it can be mapped to binary.
[0066] In order to ensure that the networks in the model will not cause imbalanced training due to the network structure, the structures of each network are designed similarly. Bob's input is N-bit ciphertext and N-bit key, and the output is N-bit plaintext, that is, the input size and output size are the same as Alice, so Bob's neural network structure and parameters are consistent with Alice. The convolutional network parameters of Alice and Bob are shown in Table 1. Since the input of Eve1 network is only N-bit ciphertext, the fully connected layer is N×N, and the step size of the four one-dimensional convolutional layers is set to 1. The other network layer structures and parameters are consistent with Alice. The convolutional network parameters of Eve1 network are shown in Table 2. The input of Eve2 is N-bit plaintext and N-bit ciphertext. The two N-bit inputs are first connected into a 2N-bit vector. The floating point numbers -1 and 1 in the vector represent bits 0 and 1. It first passes through four one-dimensional convolutional layers. The number of channels of the four one-dimensional convolutional layers is 2, 4, 4, and 1 respectively. The convolution kernel size is set to 4, 2, 1, and 1 respectively, and the step size is 1, 2, 1, and 1 respectively. Different from other networks, including the last convolutional layer, the activation function of each convolutional layer is the Sigmoid function. After the convolutional layer is a 2N×2N fully connected layer, which is also activated by the Sigmoid function so that the output is between [0,1]. The input of Eve3 is also N-bit plaintext and N-bit ciphertext, and the output is between [0,1]. Therefore, the network structure and parameters of Eve3 are consistent with Eve2. The convolutional network parameters of Eve2 and Eve3 are shown in Table 3.
[0067] Table 1. Neural network parameters of Alice and Bob
[0068]
[0069] Table 2 Neural network parameters of Eve1
[0070]
[0071] Table 3 Neural network parameters of Eve2 and Eve3
[0072]
[0073]
[0074] Define the loss function for each neural network that appears in the neural network model:
[0075] The parameters of the encryption network Alice, the decryption network Bob and the brute force network Eve1 are represented by θ A ,θ B and θ E1 Indicates that E A (θ A,p,k) is defined as the encryption output of the encryption network Alice for the real plaintext p and the key k. B (θ B ,c,k) is defined as the decryption output of the decryption network Bob for the ciphertext c and key k. E1 (θ E1 ,c) is defined as the decryption output of ciphertext c by brute force network Eve1.
[0076] Use the L1 function to describe the gap between the actual plaintext and the estimated plaintext output by the neural network:
[0077]
[0078] Among them, N is the length of the plaintext, p i is the ith element in the real plaintext p, p′ i is the i-th element in the estimated plaintext p′; d(p,p′) represents the L1 distance between the real plaintext p and the estimated plaintext p′.
[0079] Define the loss function of the decryption network Bob:
[0080] L B =d(p,D B (θ B ,E A (θ A ,p,k),k)) (2)
[0081] Define the loss function for brute force cracking network Eve1:
[0082] L E1 =d(p,D E1 (θ E1 ,E A (θ A ,p,k))) (3)
[0083] Define the loss function of the chosen plaintext attack network Eve2:
[0084]
[0085] Among them, when c (i) Yes (i) When the ciphertext otherwise f j (i) is the model output value; M is the number of plaintext and ciphertext pairs.
[0086] Define the loss function of the chosen ciphertext attack network Eve3:
[0087]
[0088] Among them, when c (i) Yes (i) When the ciphertext otherwise f j (i) is the model output value; M is the number of plaintext and ciphertext pairs.
[0089] Define the overall loss function for Alice and Bob:
[0090]
[0091] Among them, Err E2 is the classification error of Eve2, Err E3 is the classification error of Eve3.
[0092] Before training, the hyperparameters of the neural network are set as follows:
[0093] 1) Ciphertext: It consists of floating point numbers, and its length is set to be the same as the plaintext length, N = 256 bits;
[0094] 2) Batch size: The training network uses "minibatch" processing, and each batch size is set to 4096;
[0095] 3) Iteration number: the number of training steps, set to 10000;
[0096] 4) Optimizer: Use TensorFlow’s Adam optimizer and set the learning rate to 0.0008.
[0097] Take a small batch of data preprocessed in step 1 as the input of the neural network and train the encryption and decryption model composed of Alice and Bob once.
[0098] To add some slight computational advantage to the attack networks Eve1, Eve2, and Eve3, while Alice and Bob train a mini-batch once, Eve1, Eve2, and Eve3 are trained twice respectively.
[0099] Repeat the two steps above 10,000 times, that is, alternately train the encryption and decryption model and the attack network model. The adversarial training process of the adversarial network model is as follows: Figure 3 As shown in the figure, the encryption and decryption model composed of Alice and Bob forms three adversarial learning relationships with the attack models of Eve1, Eve2 and Eve3 respectively, and the encryption model of Alice and the decryption model of Bob form a mutual learning relationship.
[0100] At the beginning of training, the five neural networks are randomly initialized, and Alice may generate ciphertext that neither Bob nor Eve1 can understand. After some training, Alice and Bob may find a way to allow Bob to partially decrypt Alice's ciphertext, and Eve1 gradually begins to be able to crack some ciphertext. As the training deepens, Alice and Bob learn stronger encryption and decryption capabilities for training due to Eve1's cracking, Eve2's chosen plaintext attack, and Eve3's chosen ciphertext attack, and continuously update parameters to reduce the reconstruction error between the plaintext and Bob's output; and the three attack networks also learn stronger attack capabilities as Alice and Bob become stronger, and continuously update parameters to reduce the decryption error or classification error rate. In the end, Alice and Bob can safely encrypt and decrypt in the presence of the three attackers, while Eve1 cannot crack the ciphertext, and the classification results of Eve2 and Eve3 are similar to random guesses. During the training of the adversarial network model, as the number of training iterations increases, the change curve of the number of correct bits in the output of the decryption network Bob and the brute force cracking network Eve1 is as follows: Figure 4 The classification error rate curves of the selected plaintext attack network Eve2 and the selected ciphertext attack network Eve3 are shown in Figure 5 and Figure 6 As shown in the figure, the classification error rates of the two have been fluctuating around 0.5. The final result is consistent with expectations, that is, neither Eve2 nor Eve3 can be correctly classified, which is close to random guessing, achieving the purpose of indistinguishability.
[0101] The finally trained Alice network is used as the encryption algorithm and the Bob network is used as the decryption algorithm to obtain a symmetric encryption method based on the adversarial learning mechanism.
[0102] Step 3: Execute the 2-choose-1 random oblivious transfer protocol based on the CKKS fully homomorphic encryption algorithm to complete the key generation and transmission. After the protocol is completed, the sender obtains two keys corresponding to the two messages to be sent, and the receiver obtains a key corresponding to the message it selects.
[0103] Before describing the construction of the protocol, we first define some symbols used. Let Г=(KG,E,D) be the CKKS homomorphic encryption scheme, where KG is the key generation algorithm, the input is the security parameter λ, and a pair of public-private key pairs pr,pk∈K are generated, where pr is the private key, pk is the public key, and K is the key space; E is the encryption algorithm, the input key pk and message m∈P are generated, and the ciphertext c∈C is generated, where P and C are the plaintext space and ciphertext space respectively, * P and* Care operations on P and C respectively, here it is addition operation; D is the decryption algorithm, input key pr and ciphertext c, output message m. Let H be the hash function that obtains λ-bit hash value, here we use SHA256 hash algorithm, the result is 256 bits. So we define F, we have F(b,a,p)=H(b* P a p ). Finally, pk S and pr S are the public and private keys of the sender S, which are randomly generated by the CKKS algorithm.
[0104] The random oblivious transfer protocol process based on the CKKS homomorphic encryption algorithm is as follows Figure 7 As shown, the specific steps are as follows:
[0105] The sender generates a public-private key pair (pr S ,pk S )←Г·KG, select a random value a∈ from the plaintext space R P, perform CKKS homomorphic encryption on a and calculate Send A to the receiver;
[0106] The receiver inputs its choice σ∈{0,1} and selects a random value b∈ R P, if σ=0, then b is homomorphically encrypted by CKKS. If σ=1, then b is homomorphically encrypted by CKKS and then homomorphically added to A, that is, Send B to the sender;
[0107] The sender decrypts B and obtains Then calculate the two keys k0=F(d,e P ,1) and k1=F(d,a,-1);
[0108] The receiver calculates the key k σ =F(b,e P ,1), where e P is the identity element of P.
[0109] After the end of this phase of the protocol, the protocol generates two keys for the sender, one for each of the two messages to be sent. The sender and the receiver will share one of the keys, which is the key corresponding to the message selected by the receiver. The other key is only held by the sender, that is, the receiver has no way of knowing the key corresponding to the unselected message. Specifically, the sender enters the public-private key pair (pk S ,pr S), the receiver inputs the selected bit σ∈{0,1}, and after the random oblivious transfer protocol, the sender obtains the two keys k0 and k1 corresponding to the two messages m0 and m1 to be sent, and the receiver obtains the key k corresponding to its selection σ σ , but unable to obtain the key k 1-σ .
[0110] Step 4: Using the symmetric encryption algorithm obtained in step 2, the sender uses the two keys obtained in step 3 to encrypt the two messages and sends the two encrypted messages to the receiver. The receiver uses the key obtained in step 3 to decrypt the ciphertext corresponding to the selected message to obtain the selected message, thus completing the encrypted transmission of the information.
[0111] The sender uses the two keys k0 and k1 generated in step 3 as the input of Alice's neural network (encryption network) in step 2, and encrypts the two messages m0 and m1 to be sent respectively, obtaining two ciphertexts c0 and c1.
[0112] The sender sends the two ciphertexts c0 and c1 encrypted by the neural network to the receiver, and the receiver receives the two ciphertexts c0 and c1.
[0113] The receiver uses the ciphertext c corresponding to the selected message σ and key k σ As the input of Bob's neural network (decryption network) in step 2, the ciphertext is decrypted to obtain the selected message m in plaintext form σ , complete the encrypted transmission of information.
Claims
1. An oblivious transfer method based on generative adversarial networks, It is characterized in that The following steps are involved: Step 1: Generate the plaintext and key data of the set batch size required for each training of the neural network, and preprocess the data; Step 2: Input the preprocessed data in step 1 into the neural network model, and obtain a symmetric encryption algorithm based on an adversarial learning mechanism through end-to-end adversarial training of the encryption and decryption model and multiple attack network models; the attack network includes a brute force network, a chosen plaintext attack network, and a chosen ciphertext attack network; Step 3: Execute the 2-choose-1 random oblivious transfer protocol based on the CKKS fully homomorphic encryption algorithm to complete the key generation and transmission. After the protocol is completed, the sender obtains two keys corresponding to the two messages to be sent, and the receiver obtains a key corresponding to the message it selects; Step 4: Using the symmetric encryption algorithm obtained in step 2, the sender uses the two keys obtained in step 3 to encrypt the two messages and sends the two encrypted messages to the receiver. The receiver uses the key obtained in step 3 to decrypt the ciphertext corresponding to the selected message to obtain the selected message, thus completing the encrypted transmission of the information.
2. The oblivious transmission method based on a generative adversarial network according to claim 1, It is characterized in that The step 1 is specifically as follows: Step 1.1: Both plaintext and key are set to binary numbers with a length of N = 256 bits. Plaintext and key data with a batch size of 4096 are randomly generated during each training; Step 1.2: Before entering the neural network, the plaintext and key data are preprocessed and the binary numbers 0 and 1 are replaced with floating point numbers -1 and 1 respectively.
3. The oblivious transmission method based on a generative adversarial network according to claim 1, It is characterized in that The step 2 is specifically as follows: Step 2.1: Define the loss function for each neural network that appears in the neural network model: The parameters of the encryption network Alice, the decryption network Bob and the brute force network Eve1 are represented by θ A ,θ B and θ E1 Indicates that E A (θ A , p, k) is defined as the encryption output of the encryption network Alice for the real plaintext p and the key k. B (θ B , c, k) is defined as the decryption output of the decryption network Bob for the ciphertext c and the key k. E1 (θ E1 , c) is defined as the decryption output of the ciphertext c by the brute force network Evel; Use the L1 function to describe the gap between the actual plaintext p and the estimated plaintext p' output by the neural network: Among them, N is the length of the plaintext, p i is the ith element in the real plaintext p, p′ i is the i-th element in the estimated plaintext p′; d(p, p′) represents the L1 distance between the real plaintext p and the estimated plaintext p′; Define the loss function of the decryption network Bob: L B sd(p,D B (θ B ,E A (θ A ,p,k),k)) (2) Define the loss function for brute force cracking network Eve1: L E1 =d(p,D E1 (i E1 ,E A (i A ,p,k))) (3) Define the loss function of the chosen plaintext attack network Eve2: Among them, when c (i) Yes (i) When the ciphertext otherwise is the model output value; M is the number of plaintext and ciphertext pairs; Define the loss function of the chosen ciphertext attack network Eve3: Among them, when p (i) It is c (i) When the plain text otherwise is the model output value; M is the number of plaintext and ciphertext pairs; Define the overall loss function of the encryption network Alice and the decryption network Bob: Among them, Err E2 is the classification error of Eve2, Err E3 is the classification error of Eve3; Step 2.2: Use a batch of data preprocessed in step 1 as the input of the neural network, and train the encryption and decryption model composed of the encryption network Alice and the decryption network Bob once; Step 2.3: Train the three attack networks Eve1, Eve2, and Eve3 twice respectively, thereby adding a slight computational advantage to the attack network; Step 2.4: Repeat N times s In steps 2.2 and 2.3, the encryption and decryption models and the attack network model are alternately trained, and the finally trained Alice network is used as the encryption algorithm and the Bob network is used as the decryption algorithm to obtain a symmetric encryption algorithm based on the adversarial learning mechanism.
4. The oblivious transmission method based on a generative adversarial network according to claim 3, It is characterized in that The step 3 is specifically as follows: Step 3.1: The sender generates a public-private key pair, selects a random value a from the plaintext space, performs CKKS homomorphic encryption on the random value a, obtains ciphertext A, and sends ciphertext A to the receiver; Step 3.2: The receiver inputs its choice σ∈{0,1} and selects a random value b from the plaintext space; if σ=0, the random value b is homomorphically encrypted by CKKS to obtain ciphertext B; if σ=1, the random value b is homomorphically encrypted by CKKS and then homomorphically added to ciphertext A to obtain ciphertext B; ciphertext B is sent to the sender; Step 3.3: The sender decrypts the ciphertext B to obtain the decryption result d, and then calculates the two keys k respectively. 0 =F(d, e P , 1) and k 1 =F(d, a, -1); where e P is the unit element in the plaintext space; define the function F as F(b, a, q) = H(b* P a q ), H is the SHA256 hash algorithm, *P is the addition operation on the plaintext space, calculate k 0 When q is 1, calculate k 1 When , q takes -1; Step 3.4: The receiver calculates the key k σ =F(b, e P , 1).
5. The oblivious transmission method based on a generative adversarial network according to claim 4, It is characterized in that The step 4 is specifically as follows: Step 4.1: The sender takes the two keys k generated in step 3 and 0 and k 1 As input to the encryption network Alice in step 2, for the two messages m to be sent 0 and m 1 Encrypt them separately to get two ciphertexts c 0 and c 1 ; Step 4.2: The sender sends the two ciphertexts c encrypted by the encryption network Alice 0 and c 1 Sent to the receiver, the receiver receives two ciphertexts c 0 and c 1 ; Step 4.3: The receiver uses the ciphertext c corresponding to the selected message σ and key k σ As the input of the decryption network Bob in step 2, the ciphertext is decrypted to obtain the selected message m in plaintext form. σ , complete the encrypted transmission of information.
Citation Information
Patent Citations
Ridge regression privacy protection algorithm based on secure multi-party computing
CN116975906A
