An oblivious transfer method based on generative adversarial networks
By combining the generative adversarial network and the CKKS full homomorphic encryption algorithm, a new inadvertent transmission protocol was constructed, which solved the shortcomings of the existing protocol in information transmission security and computing efficiency, and achieved efficient and secure information transmission.
Patent Information
- Application Number
- CN202410957494.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-07-17
AI Technical Summary
When existing inadvertent transmission protocols face malicious attacks and cracking, it is difficult to ensure the security and privacy of information transmission, and the computing efficiency is low.
A new inadvertent transmission protocol is constructed using generative adversarial network combined with CKKS full homomorphic encryption algorithm. Through the adversarial learning mechanism of neural networks, symmetric encryption algorithms are generated and CKKS algorithm is used in random unintentional transmission protocols to improve computing efficiency and security.
It realizes the secure encrypted transmission of information during inadvertent transmission, improves the privacy protection capabilities of both parties in the communication, improves the computing efficiency, and enhances the security of the anti-network encryption algorithm.
Smart Images

Figure CN118890184B_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 flow of information and data has become increasingly rapid and widespread. Information security has received increasing attention, and data security has gradually become a hot topic. Privacy protection faces new crises and challenges. The emergence of privacy computing technology provides an effective solution to this problem. Privacy computing can perform computations on data while ensuring that the data is not leaked, thus ensuring privacy while ensuring data flow. Secure multi-party computation (SMC) technology within privacy computing provides a method for multiple independent and mutually untrusting parties to jointly compute a function and obtain the corresponding output without the presence of a trusted third party. Furthermore, SMC ensures that each party only obtains its own results, and its private inputs are not leaked. Furthermore, no party can infer the private information of any other party from the output. SMC addresses the privacy protection issue of distributed computing among multiple independent and mutually untrusting parties, and holds significant research significance and value.
[0003] Oblivious transfer, proposed by Rabin, is a cryptographic protocol and a key technology for secure two-party computation in privacy-focused computing. Oblivious transfer is widely used and serves as a fundamental building block in many other security protocols. It also plays a crucial role in areas such as Privacy Set Intersection (PSI), Private Information Retrieval (PIR), and Location-Based Services (LBS). However, oblivious transfer can become a bottleneck for applications that use it, and escalating malicious attacks and cracking practices have raised new security and privacy requirements for oblivious transfer.
[0004] Generative adversarial networks (GANs) are powerful generative models. Their adversarial learning mechanisms have made them a hot topic in the field of artificial intelligence since their introduction. They have provided new insights, injected new vitality into numerous fields, and propelled their development. GANs have now penetrated and flourished in various fields, with widespread applications in image generation, speech synthesis, and information security. In recent years, GANs have also made progress in symmetric encryption schemes within cryptography. With the rapid development of artificial intelligence (AI), there is enormous potential for applying AI to oblivious transfer protocols. GANs also have untapped application scenarios within information security, awaiting further expansion.
[0005] In summary, the research on the combination of oblivious transfer protocol and generative adversarial network 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 transfer method based on a generative adversarial network. As a new privacy protection method, a generative adversarial network is used to construct an oblivious transfer 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 pre-processed data from step 1 into the neural network model, and obtain a symmetric encryption algorithm based on the adversarial learning mechanism through end-to-end adversarial training using the encryption and decryption model and multiple attack network models; the attack networks include brute force attack networks, chosen plaintext attack networks, and chosen ciphertext attack networks;
[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 of its choice;
[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 of length N = 256 bits. During each training, a batch size of 4096 plaintext and key data is randomly generated.
[0014] Step 1.2: Before entering the neural network, preprocess the plaintext and key data by replacing the binary numbers 0 and 1 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 encryption network Alice, decryption network Bob and 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 key k, and D B (θ B ,c,k) is defined as the decryption output of the decryption network Bob for the ciphertext c and key k, and D 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 i-th 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 true 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) It is p (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 the batch of data preprocessed in step 1 as the input of the neural network and train the encryption and decryption model consisting 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 to obtain 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 with CKKS to obtain ciphertext B. If σ=1, the random value b is homomorphically encrypted with CKKS and then homomorphically added with 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 is 1, and when calculating k1, q is -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 input to the encryption network Alice in step 2, and encrypts the two messages m0 and m1 to be sent, respectively, to obtain 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 plain text. σ , complete the encrypted transmission of information.
[0046] Compared with the prior art, the present invention has the following beneficial effects:
[0047] 1) This paper utilizes the adversarial learning mechanism of generative adversarial networks in symmetric encryption scenarios and combines it with oblivious transfer to propose an oblivious transfer protocol based on generative adversarial networks. This breaks through the traditional thinking and research methods of oblivious transfer, which uses specific cryptographic algorithms to transmit information, and replaces it with adversarial learning between neural networks, providing a new perspective and approach to oblivious transfer.
[0048] 2) The oblivious transfer protocol based on generative adversarial networks proposed in this paper ensures the security of information between the communicating parties during transmission and the protection of their privacy during protocol execution, thus fulfilling the privacy requirements of the oblivious transfer protocol and providing 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 computing in exchange for improved computational efficiency. Compared with the classic Paillier and BFV algorithms, CKKS is faster and more efficient.
[0050] 4) This invention designs multiple attack networks for adversarial network encryption: brute force, chosen-plaintext, and chosen-ciphertext. The greater the threat posed by the attack network, the easier it is for the model to learn a more secure encryption algorithm. Using an adversarial learning mechanism to train the model in the presence of three attack networks with varying attack capabilities, the sender and receiver face increased obstacles during training. Both communicating parties must find a more secure cryptographic system capable of resisting brute force, chosen-plaintext, and chosen-ciphertext attacks simultaneously, further enhancing the security of the resulting encryption algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 Schematic diagram of the overall framework of the oblivious transfer method based on generative adversarial networks 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 curve showing the change in 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 with reference to the accompanying drawings and specific embodiments.
[0059] The overall framework of the method of the present invention is as follows Figure 1 As shown in the figure, the method consists of two stages: a random oblivious transfer protocol based on the CKKS homomorphic encryption algorithm and an encrypted information transmission based on a generative adversarial network.
[0060] Step 1: Generate the “mini-batch” size of plaintext and key data required for each training of the neural network and preprocess the data.
[0061] Both plaintext and key are set to binary numbers with a length of N = 256 bits, and plaintext and key data with a batch size of 4096 are 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 "mini-batch" processing. Input the pre-processed data in step 1 into the neural network model. After end-to-end adversarial training of the encryption and decryption model and multiple attack network models, the attack network includes brute force attack network, chosen plaintext attack network and chosen ciphertext attack network, and obtain a symmetric encryption method based on the adversarial learning mechanism.
[0064] The overall structure of the adversarial network model under multiple attack networks is as follows: Figure 2As shown in the figure. Unlike typical one-on-one generative adversarial networks, the five neural networks form a one-on-many adversarial network model. Alice encrypts and sends a message, while Bob receives and decrypts it. Three attackers monitor the communication, but each can only obtain the ciphertext and cannot send messages or modify the information during transmission. Alice uses the key to encrypt two plaintexts to obtain two corresponding ciphertexts. The ciphertexts are sent over a public channel, and the receiver receives and decrypts one ciphertext from the public channel. Attacker Eve1 intercepts one ciphertext and attempts 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. To simultaneously defend against all three attack methods, Alice and Bob need to continuously update their encryption methods during training to achieve more secure encryption.
[0065] The Alice network takes as input an N-bit plaintext and an N-bit key. The two N-bit inputs are first concatenated into a 2N-bit vector, where the floating-point numbers -1 and 1 represent bits 0 and 1. This vector then passes through a 2N×2N fully-connected layer and four one-dimensional convolutional layers. The four one-dimensional convolutional layers have channels of 2, 4, 4, and 1, respectively. The kernel sizes are set to 4, 2, 1, and 1, with strides of 1, 2, 1, and 1, respectively. For example, the first one-dimensional convolutional layer slides a kernel of size 4 over the 2N-bit output of the fully-connected layer with a stride of 1. Except for the last convolutional layer, the activation function of each layer is the sigmoid function. The final layer uses the hyperbolic tangent function to keep the output between [-1, 1], ultimately mapping it to binary.
[0066] To ensure that the individual networks in the model do not experience training imbalances due to structural differences, the structures of each network are designed to be similar. Bob's input consists of N-bit ciphertext and an N-bit key, and his output is N-bit plaintext. This means that both the input and output sizes are identical to Alice's. Therefore, Bob's neural network structure and parameters are consistent with Alice's. The convolutional network parameters for Alice and Bob's networks are shown in Table 1. Since Eve1's input is only N-bit ciphertext, its fully connected layers are N×N, and the stride of the four one-dimensional convolutional layers is set to 1. The structure and parameters of other network layers remain consistent with Alice's. The convolutional network parameters for Eve1 are shown in Table 2. Eve2 takes N-bit plaintext and N-bit ciphertext as input. The two N-bit inputs are first concatenated into a 2N-bit vector, where the floating-point numbers -1 and 1 represent bits 0 and 1. The vector then passes through four one-dimensional convolutional layers, with channel numbers of 2, 4, 4, and 1, respectively. The kernel sizes are set to 4, 2, 1, and 1, respectively, with strides of 1, 2, 1, and 1, respectively. Unlike other networks, the activation function of each convolutional layer, including the last one, is a sigmoid function. Following the convolutional layers is a 2N×2N fully connected layer, also activated with a sigmoid function, ensuring that the output is between [0, 1]. Eve3 also takes N-bit plaintext and N-bit ciphertext as input, and its output is between [0, 1]. Therefore, the network structure and parameters of Eve3 remain consistent with those of Eve2. The convolutional network parameters for 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 encryption network Alice, decryption network Bob and 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 key k, and D B (θ B ,c,k) is defined as the decryption output of the decryption network Bob for the ciphertext c and key k, and D 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 i-th 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 true 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) It is p (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) It is p (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 the same as the plaintext length, length N = 256 bits;
[0094] 2) Batch size: The network is trained using minibatch processing, with each batch size set to 4096;
[0095] 3) Iterations: the number of training steps, set to 10,000;
[0096] 4) Optimizer: Use TensorFlow’s Adam optimizer and set the learning rate to 0.0008.
[0097] Use a mini-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 each.
[0099] Repeat the two steps for more than 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 Alice's encryption model forms a mutual learning relationship with Bob's decryption model.
[0100] At the beginning of training, the five neural networks are randomly initialized, and Alice may produce ciphertext that neither Bob nor Eve1 can understand. After some training, Alice and Bob may find a way that allows Bob to partially decrypt Alice's ciphertext, and Eve1 gradually begins to be able to crack some ciphertexts. As the training deepens, Alice and Bob learn stronger encryption and decryption capabilities 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 curve of the change in the number of correct bits in the output of the decryption network Bob and the brute force 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 as follows. Figure 5 and Figure 6 As shown in the figure, the classification error rates of both models 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 goal 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 and private keys pr, pk∈K is 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 is generated, and the ciphertext c∈C is generated, where P and C are the plaintext space and ciphertext space respectively. P and* Care the operations on P and C respectively, here they are addition operations; D is the decryption algorithm, which takes as input the key pr and the ciphertext c and outputs the message m. Let H be the hash function that obtains a λ-bit hash value, here we use the SHA256 hash algorithm, and the result is 256 bits. Thus, we define F, and 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 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, performs CKKS homomorphic encryption on a and calculates 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, i.e. 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 receiver will share one key, 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 cannot get 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 plain text σ , complete the encrypted transmission of information.
Claims
1. An oblivious transmission method based on a generative adversarial network, 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 generative adversarial network according to claim 1, 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 generative adversarial network according to claim 1, 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 key k. E1 (θ E1 ,c) is defined as the decryption output of ciphertext c by brute force network Eve1; Use L1 function to describe the real plaintext p and the estimated plaintext p output by the neural network ′ The gap between: Among them, N is the length of the plaintext, p i is the i-th element in the real plaintext p, p i ′ To estimate the plaintext p ′ The i-th element in d(p,p ′ ) represents the real plaintext p and the estimated plaintext p ′ The L1 distance between them; Define the loss function of the decryption network Bob: L B d(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 generative adversarial network according to claim 3, 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 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*a q ), H is the SHA256 hash algorithm, * is the addition operation on the plaintext space, when calculating k0, q is 1, and when calculating k1, q is -1; Step 3.4: The receiver calculates the key k σ =F(b,e P ,1).
5. The oblivious transmission method based on generative adversarial network according to claim 4, characterized in that: The step 4 is specifically as follows: 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; 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; 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