White-box encryption method and system based on neural network
Through the white box encryption method based on neural network, the encryption and decryption operation of the AES algorithm is simulated and the obfuscation structure is constructed, which solves the key leakage risk and attack deformation problems of the existing white box encryption method in the white box environment, and achieves high security and AES white box implementation with anti-attack ability.
Patent Information
- Application Number
- PCT/CN2023/107620
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-31
- Filing Date
- 2023-07-17
- Publication Date
- 2024-12-05
AI Technical Summary
The existing white box encryption method has the risk of key leakage in the white box environment. Attackers can access the cracked key through reverse engineering and memory state. The existing solutions lack immunity, security and resistance to attacks when facing attack deformation. Inadequate performance.
Using a white box encryption method based on neural networks, the encryption and decryption operation of AES algorithm is simulated, and the obfuscation structure is constructed using neural networks, fixed keys are embedded, and the core steps of training multiple neural networks to replace the AES algorithm are realized to achieve the obfuscation of keys and The uninterpretation of the encryption and decryption process.
It improves the security and attack resistance of the encryption system, makes it difficult to extract keys, provides high security and scalability, can resist cracking and analysis by quantum computers, and supports hardware acceleration.
Smart Images

Figure CN2023107620_05122024_PF_FP_ABST
Abstract
Description
White box encryption method and system based on neural network Technical Field The present invention relates to white box encryption technology, and in particular to a white box encryption method and system based on neural network. Background Art The security of traditional cryptographic primitives is based on the black-box attack model [1]. In a black-box environment, attackers can only obtain the input and output information of the algorithm and cannot know the internal information of the program when it is running. However, in actual environments, it is difficult to achieve a true black-box environment. Attackers have many means to obtain the running details of the program, which leads to many unexpected security issues, such as key leakage. In this case, the security of cryptographic algorithms needs further discussion. Therefore, in 2002, Chow et al. proposed the concept of white-box environment [2]. It is assumed that in a white-box environment, attackers have the ability to fully control the device, including reverse engineering the program, observing the intermediate results of the program when it is running, accessing the memory state of the program when it is running, reading the key in the memory, etc. It is not difficult to find that in a white-box environment, there are higher requirements for the security of the algorithm. At the same time, Chow also proposed a white-box cryptographic scheme in a white-box environment, including white-box AES. The main idea is to fix the key so that the specific mapping between input and output can be obtained, and then summarized as a lookup table, and the key is implicit in the lookup table. A simple lookup table is easily attacked, therefore, an additional bijection is introduced in Chow's scheme to perform obfuscation, thereby achieving an embedded key scheme that cannot be extracted by attackers. For various known white-box encryption methods, please refer to references [2 to 6]. The security of white-box encryption methods can be measured by indicators such as diversity, ambiguity, key concealment, key recovery difficulty, and anti-attack performance. According to these evaluation criteria, the current white-box encryption technology has the following shortcomings: (1) Existing white-box encryption methods, such as those proposed in references [2 to 6], often expose The exploitable weaknesses, based on attack schemes against white-box encryption methods such as those described in references [7 to 13], allow attackers to use these weaknesses to restore the 128-bit AES key and thus crack the white-box cipher. (2) Existing white-box encryption methods, such as those in references [5, 6] and other similar new white-box encryption schemes, cannot meet the cryptographic processing performance requirements or lack security metrics and corresponding proofs, and can be easily overturned by attackers. (3) Existing white-box encryption algorithms can only cope with certain specific attacks and lack immunity to many normal attacks, such as deformation or modification.
[0013] The improved attack method shown in can effectively attack the masking-based white-box encryption scheme, which is impossible with the original attack method. The cited references are listed below: [1]Claus Peter Schnorr, Serge Vaudenay. "The Black-Box Model for Cryptographic Primitives", Journal of Cryptology, Volume 11, Issue 2, March 1998, pp 125-140. [2] Stanley Chow, Philip A. Eisen, Harold Johnson, Paul C. van Oorschot. "White-Box Cryptography and an AES Implementation", SAC 2002, St. John's, Newfoundland, Canada, August 15-16, 2002. [3]Chung Hun Baek, Jung Hee Cheon, Hyunsook Hong. "White-box AES implementation revisited", Journal of Communications and Networks, Volume 18, Issue 3, June 2016. [4] Julien Bringer, Herve Chabanne, Emmanuelle Dottax. "White Box Cryptography: Another Attempt", January 2006. [5]Jaesung Yoo, Hanjae Jeong, Dongho Won. "A method for secure and efficient block cipher using white-box cryptography",ICUIMC'12: Proceedings of the 6th International Conference on Ubiquitous Information Management and Communication,February 2012,No.89,pp 1-8. [6]Andrey Bogdanov,Takanori Isobe."White-Box Cryptography Revisited:Space-Hard Ciphers",CCS'15:Proceedings of the 22nd ACM SIGSAC Conference on Computer and Communications Security,October 2015,pp 1058-1069. [7]Olivier Billet,Henri Gilbert,Charaf Ech-Chatbi."Cryptanalysis of a white box AES implementation",SAC'04:Proceedings of the 11th international conference on Selected Areas in Cryptography,August 2004,pp 227-240. [8]Wil Michiels,Paul Gorissen,Henk D.L.Hollmann."Cryptanalysis of a Generic Class of White-Box Implementations",SAC 2008,Sackville,New Brunswick,Canada,August 14-15,2008. [9]Joppe W.Bos,Charles Hubain,Wil Michiels,Philippe Teuwen."Differential Computation Analysis:Hiding Your White-Box Designs is Not Enough",International Conference on Cryptographic Hardware and Embedded Systems,August 2016.
[0010] Subhadeep Banik,Andrey Bogdanov,Takanori Isobe,Martin Jepsen. "Analysis of Software Countermeasures for Whitebox Encryption",IACR Transactions on Symmetric Cryptology, 2017(1),pp 307-328.
[0011] Brendan McMillion,Nick Sullivan."Attacking White-Box AES Constructions",SPRO'16:Proceedings of the 2016 ACM Workshop on Software PROtection,October 2016,pp 85-90.
[0012] Patrick Derbez,Pierre-Alain Fouque,Baptiste Lambin,Brice Minaud. "On Recovering Affine Encodings in White-Box Implementations",IACR Transactions on Cryptographic Hardware and Embedded Systems, 2018(3),pp 121-149.
[0013] Matthieu Rivain, Junwei Wang. "Analysis and Improvement of Differential Computation Attacks against Internally-Encoded White-Box Implementations", IACR Transactions on Cryptographic Hardware and Embedded Systems, 2019 (2), pp 225-255. Summary of the invention To overcome the above problems, the present invention provides a white-box encryption method and system based on a neural network, which uses the operation of the model to simulate the encryption and decryption of the AES algorithm, that is, uses a neural network to simulate and replace the encryption and decryption operations of the AES algorithm, thereby achieving the purpose of obfuscating the algorithm and embedding a fixed key, thereby completing the white-box implementation of AES. A first aspect of the present invention provides a white box encryption method based on a neural network, comprising the following steps: A1) determining a white-box AES scheme; the white-box AES scheme includes operations of initial round key addition, byte substitution, row shift, column confusion, and round key addition; A2) applying a preliminary obfuscation operation to the white-box AES encryption step provided in step A1), that is, combining the round key addition and byte replacement operations, adding random bijection for scrambling operation, and using the input-output mapping after the operation as a training set to train a first-class neural network; using the first-class neural network to replace the round key addition and byte replacement operations in the original white-box AES encryption step, and constructing a white-box AES structure after preliminary obfuscation; A3) Based on the white-box AES structure after the initial obfuscation constructed in step A2), the row shift is not obfuscated; in the column obfuscation operation, the corresponding scrambling and restoring operation is first added, and then the finite field multiplication is performed, and then a randomly generated secret byte is XORed, and the input after the operation is converted into The input-output mapping is also trained to obtain the second type of neural network; the second type of neural network is used to replace some operations of column obfuscation in the white-box AES structure after the initial obfuscation to construct the white-box AES structure after the second obfuscation; A4) Based on the second obfuscated white-box AES structure constructed in step A3), a neural network is used to simulate an XOR operation to obtain a third type of neural network, which performs an XOR operation on the output result of the second type of network to complete the column obfuscation function; the third type of neural network is used to replace the XOR operation in the second obfuscated white-box AES structure to construct a third obfuscated white-box AES structure; A5) On the basis of the third obfuscated white-box AES structure constructed in step A4), the scrambled restoration and the last round of key operation mentioned in step A3) are integrated to obtain a fourth type of neural network; the fourth type of neural network is used to replace the last round of key addition operation in the third obfuscated white-box AES structure; A6) Importing the four types of neural networks trained in steps A2) to A5) to obtain an obfuscated white-box AES encryption structure. Furthermore, the scrambling operation described in step A2 is designed as a randomly generated bijective operation. Furthermore, the training set described in step A2 is input-output program mapping and then put into the neural network for overfitting training. Furthermore, the training of the first type of neural network in step A2 includes the initial round key plus AddRoundKey, bytes replacing SubBytes, and 160 randomly generated bijective Shuffle1 and Shuffle2 for scrambling. Furthermore, the training of the second type of neural network in step A3 includes 160 different inverse scrambling Inv_Shuffle2 and Inv_Shuffle1, finite field multiplication Mul and 160 random secret bytes Rand_Key. Furthermore, the training of the third type of neural network in step A4 includes Xor. Furthermore, the training of the fourth type of neural network in step A5 includes 16 different inverse scrambling Inv_Shuffle2 and Inv_Shuffle1, and the final round key AddRoundKey. Furthermore, the encryption and decryption process of the white box encryption method includes the following steps: B1) After the plaintext to be encrypted is introduced into the four types of neural networks trained in steps A2 to A5, a conventional AES encryption process is performed; B2) Decrypt the ciphertext encrypted in step B1 through the conventional AES decryption process. Further, the conventional AES encryption process in step B1 includes the following steps: The first step is to import the trained first neural network, second neural network, third neural network and fourth neural network; The second step is to input the plain text and save it in array form; The third step is to enter the encryption body. First, the input plaintext array is converted into the input format of the neural network through the function fun1, and then it is passed to the first type of neural network Net1 to encrypt it, and the row shift operation is performed to generate a temporary variable temp_SR; The fourth step is to perform column obfuscation transformation on temp_SR. In this solution, column obfuscation is divided into two parts, namely finite field multiplication and XOR. Function fun2 will convert the input plaintext array into 4 arrays corresponding to the finite field multiplication order, concatenate them in sequence and pass them into the second type of neural network Net2 for obfuscation, and obtain 4 temporary arrays that perform finite field multiplication with 2, 3, 1, and 1 respectively, and use fun3 to adjust its format to generate a temporary variable temp_3; Step 5: Perform two-by-two XOR operations on the four arrays generated in the previous step to complete column obfuscation. Specifically, use the third-class neural network XorNet to obfuscate temp_3 and generate a temporary variable temp_XorNet. Use fun4 to adjust its format and then use XorNet to obfuscate it again to generate the next round of input data plain. Finally, output the result of this round of encryption; Step 6: Repeat the above steps 3 to 5 for a total of 9 rounds; Step 7, the last round, first perform step 3, use fun5 to adjust the current format, then use Net3 to encrypt it, and finally use fun6 to adjust its format to generate the final ciphertext cipher and output it. The encryption process ends here. A second aspect of the present invention provides a system for a white-box encryption method based on a neural network, comprising: The white-box AES scheme determination module includes the operations of initial round key addition, byte substitution, row shift, column obfuscation, and round key addition; The preliminary obfuscation module applies preliminary obfuscation operations to the white-box AES encryption step, that is, the round key addition and byte replacement operations are combined, and random bijection is added for scrambling operations. The input-output mapping after the operation is used as a training set to train the first-class neural network; the first-class neural network is used to replace the round key addition and byte replacement operations in the original white-box AES encryption step to construct the white-box AES structure after preliminary obfuscation; The secondary obfuscation module, based on the initially obfuscated white-box AES structure constructed in step A2), does not perform row shift obfuscation; in the column obfuscation operation, first adds the corresponding scrambling and restoration operation, then performs finite field multiplication, and then XORs a randomly generated secret byte, and similarly trains the input-output mapping after the operation to obtain the second type of neural network; uses the second type of neural network to replace part of the column obfuscation operations in the initially obfuscated white-box AES structure, and constructs the second obfuscated white-box AES structure; The third obfuscation module uses a neural network to simulate the XOR operation on the basis of the white-box AES structure after the second obfuscation, and obtains a third type of neural network, which performs XOR on the output of the second type of network to complete the column obfuscation function; the third type of neural network is used to replace the XOR operation in the white-box AES structure after the second obfuscation, and the white-box AES structure after the third obfuscation is constructed; The four-pass obfuscation module is based on the white-box AES structure after the third obfuscation, and integrates the scrambling restoration and the last round of key operation proposed by the three-pass obfuscation modules to obtain The fourth type of neural network is derived; the fourth type of neural network is used to replace the last round of key addition operation in the white box AES structure after the third obfuscation; The import module imports the four types of neural networks trained by the first to fourth obfuscation modules to obtain the obfuscated white box AES encryption structure. The beneficial effects of the present invention are: based on conventional encryption algorithms, such as AES encryption, the present invention obfuscates information such as keys by applying a specialized neural network training method to the existing structures of these passwords, and makes the entire process unexplainable by replacing the inherent encryption and decryption steps with neural networks, providing a reliable black box environment for some operations. The present invention has the following advantages: (1) Good security, which is achieved by the inexplicability of neural networks. In informatics, NP-hard problems have always been the pinnacle of informatics, among which P problems are problems that can be solved in polynomial time, and NP problems are problems whose correctness can be verified in polynomial time. The NP-hard problems mentioned here refer to problems that all NP problems can be reduced to a certain problem in polynomial time, which is one of the most important complexity classes in computational complexity theory. The feasible domain of each parameter value in the overfitting involved in the present invention is theoretically from negative infinity to positive infinity, so the state space of its feasible solution is of infinite exponential level, which is a more complex problem than the NP-hard problem, making the neural network inexplicable, so that the specific mapping relationship simulated by each generated neural network model is in a sufficiently secure "black box" secret state in the white box implementation. (2) Anti-attack capability. The unexplainable nature of neural networks makes this method extremely anti-attack capable. At the algorithm level, it can resist the cracking analysis of the embedded key of the white box by quantum computers. (3) Scalability. In the neural network-based AES white box implementation proposed in this invention, each neural network model is used to simulate byte-level mapping behavior, so that the scheme can be easily expanded to a quantum-resistant AES version with a larger key length. In addition, the main process of encryption and decryption is completed by the neural network model, so it only needs to replace the model to complete it. Updates to the built-in algorithm keys. At the same time, while ensuring that the network input and output interfaces remain unchanged, some updated disruption technologies can also be combined. (4) Hardware acceleration affinity. The computing subject of the white-box cryptography implemented by the present invention is a neural network, which makes the method very easy to obtain hardware acceleration support (such as acceleration using GPU or FPGA). BRIEF DESCRIPTION OF THE DRAWINGS FIG1 is a general schematic diagram of the white box encryption method of the present invention; FIG2 is a schematic diagram of the obfuscation process of the white-box encryption method of the present invention; FIG3 is a schematic diagram of the encryption process of the white box encryption method of the present invention. FIG. 4 is a flowchart of encryption and decryption of the present invention. FIG5 is a system structure diagram of the present invention. DETAILED DESCRIPTION The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. In the description of the present invention, it should be noted that the orientations or positional relationships indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. are based on the orientations or positional relationships shown in the 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 limiting the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances. Example 1 1 , this embodiment relates to a white-box encryption method based on a neural network, which uses a neural network to simulate and replace the encryption and decryption operations of the AES algorithm, thereby achieving the purpose of obfuscating the algorithm and embedding a fixed key, and completing the white-box implementation of AES; the method includes the following steps: A1) determining a white-box AES scheme; the white-box AES scheme includes operations of initial round key addition, byte substitution, row shift, column confusion, and round key addition; A2) applying a preliminary obfuscation operation to the white-box AES encryption step provided in step A1), that is, combining the round key addition and byte replacement operations, adding random bijection for scrambling operation, and using the input-output mapping after the operation as a training set to train a first-class neural network; using the first-class neural network to replace the round key addition and byte replacement operations in the original white-box AES encryption step, and constructing a white-box AES structure after preliminary obfuscation; A3) Based on the initially obfuscated white-box AES structure constructed in step A2), the row shift is not obfuscated; in the column obfuscation operation, the corresponding scrambling and restoring operation is first added, and then the finite field multiplication is performed, and then a randomly generated secret byte is XORed, and the input-output mapping after the operation is similarly trained to obtain a second type of neural network; the second type of neural network is used to replace part of the column obfuscation operations in the initially obfuscated white-box AES structure, and a second obfuscated white-box AES structure is constructed; A4) Based on the second obfuscated white box AES structure constructed in step A3), a neural network is used to simulate the XOR operation to obtain a third type of neural network, which is used to generate the second type of network input The result is XORed to complete the column obfuscation function; the third type of neural network is used to replace the XOR operation in the white box AES structure after the second obfuscation to construct the white box AES structure after the third obfuscation; A5) On the basis of the third obfuscated white-box AES structure constructed in step A4), the scrambled restoration and the last round of key operation mentioned in step A3) are integrated to obtain a fourth type of neural network; the fourth type of neural network is used to replace the last round of key addition operation in the third obfuscated white-box AES structure; A6) Importing the four types of neural networks trained in steps A2) to A5) to obtain an obfuscated white-box AES encryption structure. This method is a new method for white-box algorithms for symmetric cryptography. This method fully realizes the concealment against black-box attacks and high security strength and robustness against advanced white-box attacks from various links such as key generation, obfuscation and white-box cryptographic encryption and decryption in the encryption process. The method uses the characteristic of summarizing the core steps of the AES scheme with fixed keys into multiple mapping tables, and combines this problem to propose a neural network-based obfuscation technology for the first time to simultaneously achieve good concealment and strong anti-attack performance of this white-box encryption scheme. The unique rules of the neural network also make this method have a high unexplainable performance, and the key used for encryption is difficult to be extracted, thereby obtaining a secure white-box AES algorithm. In addition, this obfuscation technology is widely used and can complete the obfuscation of key operation steps of white-box algorithms and corporate confidential codes. 4, the encryption and decryption process of the white box encryption method includes the following steps: B1) after introducing the neural network trained in steps A2) to A5) of claim 1 into the plaintext to be encrypted, a conventional AES encryption process is performed; B2) decrypting the ciphertext encrypted in step B1) by a conventional AES decryption process; B3) Based on the portability of the code, the neural network related library designed for the encryption and decryption process of steps B1) and B2) is implemented in C language to enable the algorithm to be more widely used. In the encryption and decryption process of the white-box encryption method, in steps B1) and B2), the corresponding AES encryption and decryption steps are replaced by the neural network trained as described in claim 1, thereby making full use of the unexplainability of the neural network to achieve a sufficiently secure and reliable white-box encryption method. Example 2 1-3 , this embodiment describes a white-box encryption method based on a neural network based on the AES cipher. The concept of neural network is described as follows: using the idea of bionics to achieve modeling by simulating the structure and function of biological neural networks. It is widely used in machine learning, especially in deep learning. Deep neural network, this concept can also be commonly referred to as "multi-layer neural network", which can be described as: based on the basic neural network perceptron binary classification model, it is expanded. First, add hidden layers to enhance the expressive power of the model; then set multiple outputs for neurons so that the model can be flexibly applied to classification and regression; finally, expand the activation function, for example: expand the excitation function used in the perceptron to the Sigmoid function used in logistic regression. In general, the first layer of its structure is the input layer, the last layer is the output layer, and the layers in between are all hidden layers. The layers are fully connected, that is, any neuron in the i-th layer must be connected to any neuron in the i+1-th layer. Overfitting refers to the phenomenon of matching a specific data set too closely or precisely to the point where it cannot fit other data well or predict future observations. In this solution, the collected data set will contain all possibilities of single-byte inputs, and no test set is required. In order to ensure the correctness of the function after the neural network is replaced, overfitting training must be performed. White-box encryption based on neural networks. The obfuscation method involved in this technology can be briefly described as follows: First, the round key addition and byte substitution operations are combined and a randomly generated double The scrambling operation is performed on the input and output mapping after the operation, and the first type of neural network is trained by using the input and output mapping after the operation as the training set. Given the following Python code, Among them, x is the input data set, and its construction method is similar to the initialization operation of the y set, and an additional index variable is introduced to identify it and the nth round key byte for round key addition. Through this data set construction method, the operations of round key addition, byte replacement and scrambling are completed. The next step is to pass the data into the neural network for training. In this scheme, the network structure consists of 2 convolutional pooling layers and 2 linear layers, and tanh is used as the activation function. The loss function is multi-classification cross entropy, and the optimization algorithm uses Adam. The white-box encryption algorithm based on neural networks adopts an overfitting training method, and records the corresponding maximum label value index in the network classification result sigma, which is used to compare with the actual label value to determine whether the training is completed. The following Python code is used After the training is completed, the neural network is saved and defined as the first type of neural network. There are three more types of neural networks, which involve the obfuscation operations of row shifting, column obfuscation and round key addition required in the AES encryption process. The specific obfuscation technology is similar to that of the first type of neural network. They all use overfitting training methods. When all classification results are consistent with the corresponding target values, the training is completed, thereby using the unexplainable nature of the neural network to ensure the security and anti-attack ability of white-box encryption. The obfuscation process of the AES white box encryption method is shown in Figure 2: The first step is to analyze the four basic steps of AES encryption and summarize its important encryption operations. The results can be divided into: round key addition, byte substitution, random bijection, row shift, finite field multiplication and XOR. Therefore, the training of the neural network is carried out according to this encryption rule; In the second step, since the present invention is based on the unexplainable characteristics of neural networks, it is necessary to summarize the various important steps of AES encryption into multiple mapping tables, and use overfitting training on the tables to enable the neural network to replace the encryption and decryption operations to achieve the obfuscation effect. The training of Net1 includes the initial round key plus AddRoundKey, bytes replacing SubBytes, 160 randomly generated bijective Shuffle1 and Shuffle2 for scrambling, the training of Net2 includes 160 different inverse scrambling Inv_Shuffle2 and Inv_Shuffle1, finite field multiplication Mul and 160 random secret bytes Rand_Key, the training of XorNet includes Xor, the training of Net3 includes 16 different inverse scrambling Inv_Shuffle2 and Inv_Shuffle1, and the final round key plus AddRoundKey; The third step is to save the trained network. This completes the obfuscation process. The encryption process of the AES white box encryption method is shown in Figure 3: The first step is to import the network trained in the obfuscation step; The second step is to input the plain text and save it in array form; The third step is to enter the encryption body. First, the input plaintext array is converted into the input format of the neural network through the function fun1, and then it is passed to the first type of neural network Net1 to encrypt it, and the row shift operation is performed to generate a temporary variable temp_SR; The fourth step is to perform column obfuscation transformation on temp_SR. In this solution, column obfuscation is divided into two parts, namely finite field multiplication and XOR. Function fun2 will convert the input plaintext array into 4 arrays corresponding to the finite field multiplication order, concatenate them in sequence and pass them into the second type of neural network Net2 for obfuscation, and obtain finite field multiplications with 2, 3, 1, and 1 respectively. 4 temporary arrays, and use fun3 to adjust their formats to generate temporary variable temp_3; Step 5: Perform two-by-two XOR operations on the four arrays generated in the previous step to complete column obfuscation. Specifically, use the third-class neural network XorNet to obfuscate temp_3 and generate a temporary variable temp_XorNet. Use fun4 to adjust its format and then use XorNet to obfuscate it again to generate the next round of input data plain. Finally, output the result of this round of encryption; Step 6: Repeat the above steps 3 to 5 for a total of 9 rounds; Step 7, the last round, first do step 3, use fun5 to adjust the current format, then use Net3 to encrypt it, and finally use fun6 to adjust its format to generate the final ciphertext and output it. The encryption process ends here. Example 3 5 , this embodiment relates to a white-box encryption system based on a neural network for implementing the method of Embodiment 2, including: The white-box AES scheme determination module includes the operations of initial round key addition, byte substitution, row shift, column obfuscation, and round key addition; The preliminary obfuscation module applies preliminary obfuscation operations to the white-box AES encryption step, that is, the round key addition and byte replacement operations are combined, and random bijection is added for scrambling operations. The input-output mapping after the operation is used as a training set to train the first-class neural network; the first-class neural network is used to replace the round key addition and byte replacement operations in the original white-box AES encryption step to construct the white-box AES structure after preliminary obfuscation; The secondary obfuscation module, based on the white box AES structure after the initial obfuscation constructed in step A2), does not perform obfuscation on the row shift; in the column obfuscation operation, first add the corresponding scrambling and restoration operation, then perform finite field multiplication, and then XOR a randomly generated secret byte, and the input-output mapping after the operation is also trained to obtain the second type of neural network; use the second type The neural network replaces some of the column obfuscation operations in the white-box AES structure after the initial obfuscation, and constructs the white-box AES structure after the second obfuscation. The third obfuscation module uses a neural network to simulate the XOR operation on the basis of the white-box AES structure after the second obfuscation, and obtains a third type of neural network, which performs XOR on the output of the second type of network to complete the column obfuscation function; the third type of neural network is used to replace the XOR operation in the white-box AES structure after the second obfuscation, and the white-box AES structure after the third obfuscation is constructed; The fourth obfuscation module is based on the white-box AES structure after the third obfuscation, and integrates the scrambling restoration and the last round of key operation proposed by the three obfuscation modules to obtain the fourth type of neural network; the fourth type of neural network is used to replace the last round of key addition operation in the white-box AES structure after the third obfuscation; The import module imports the four types of neural networks trained by the first to fourth obfuscation modules to obtain the obfuscated white-box AES encryption structure. The contents described in the embodiments of this specification are merely an enumeration of the implementation forms of the inventive concept. The protection scope of the present invention should not be regarded as limited to the specific forms described in the embodiments. The protection scope of the present invention also extends to the equivalent technical means that can be conceived by those skilled in the art based on the inventive concept.
Claims
1. A white box encryption method based on a neural network, characterized in that: The steps include: A1) determining a white-box AES scheme; the white-box AES scheme includes operations of initial round key addition, byte substitution, row shift, column confusion, and round key addition; A2) applying a preliminary obfuscation operation to the white-box AES encryption step provided in step A1), that is, combining the round key addition and byte substitution operations, adding a random bijection to perform a scrambling operation, and using the input-output mapping after the operation as a training set to train a first type of neural network; The first type of neural network is used to replace the round key addition and byte substitution operations in the original white-box AES encryption step to construct a white-box AES structure after preliminary obfuscation. A3) Based on the white-box AES structure after preliminary obfuscation constructed in step A2), the row shift is not obfuscated; in the column obfuscation operation, the corresponding scrambling and restoring operation is first added, and then the finite field multiplication is performed, and then a randomly generated secret byte is XORed, and the input-output mapping after the operation is also trained to obtain the second type of neural network; The second type of neural network is used to replace some column obfuscation operations in the white-box AES structure after the initial obfuscation, and the white-box AES structure after the second obfuscation is constructed; A4) Based on the second obfuscated white-box AES structure constructed in step A3), a neural network is used to simulate an XOR operation to obtain a third type of neural network, which performs an XOR operation on the output result of the second type of network to complete the column obfuscation function; the third type of neural network is used to replace the XOR operation in the second obfuscated white-box AES structure to construct a third obfuscated white-box AES structure; A5) On the basis of the third obfuscated white-box AES structure constructed in step A4), the scrambled restoration and the last round of key operation mentioned in step A3) are integrated to obtain a fourth type of neural network; the fourth type of neural network is used to replace the last round of key addition operation in the third obfuscated white-box AES structure; A6) Importing the four types of neural networks trained in steps A2) to A5) to obtain an obfuscated white-box AES encryption structure.
2. The white-box encryption method based on a neural network as claimed in claim 1, characterized in that: The scrambling operation described in step A2 is designed as a randomly generated bijective operation.
3. The white-box encryption method based on a neural network as claimed in claim 2, characterized in that: The training set described in step A2 is the input-output program mapped and put into the neural network for overfitting training.
4. The white-box encryption method based on a neural network as claimed in claim 1, characterized in that: The training of the first type of neural network in step A2 includes the initial round key plus AddRoundKey, bytes replacing SubBytes, and 160 randomly generated bijective Shuffle1 and Shuffle2 for scrambling.
5. The white-box encryption method based on a neural network as claimed in claim 1, characterized in that: The training of the second type of neural network in step A3 includes 160 different inverse scrambling Inv_Shuffle2 and Inv_Shuffle1, finite field multiplication Mul and 160 random secret bytes Rand_Key.
6. The white-box encryption method based on a neural network as claimed in claim 1, characterized in that: The training of the third type of neural network in step A4 includes Xor.
7. The white-box encryption method based on a neural network as claimed in claim 1, characterized in that: The training of the fourth type of neural network in step A5 includes 16 different inverse private bytes replacing Inv_Shuffle2 and Inv_Shuffle1, and the final round key plus AddRoundKey.
8. The neural network-based white-box encryption method according to claim 1, characterized in that: The encryption and decryption process of this white box encryption method includes the following steps: B1) After the plaintext to be encrypted is introduced into the four types of neural networks trained in steps A2 to A5, a conventional AES encryption process is performed; B2) Decrypt the ciphertext encrypted in step B1 through the conventional AES decryption process.
9. The neural network-based white-box encryption method according to claim 8, characterized in that: The conventional AES encryption process in step B1 includes the following steps: The first step is to import the trained first neural network, second neural network, third neural network and fourth neural network; The second step is to input the plain text and save it in array form; The third step is to enter the encryption body. First, the input plaintext array is converted into the input format of the neural network through the function fun1, and then it is passed to the first type of neural network Net1 to encrypt it, and the row shift operation is performed to generate a temporary variable temp_SR; The fourth step is to perform column obfuscation transformation on temp_SR. In this solution, column obfuscation is divided into two parts, namely finite field multiplication and XOR. Function fun2 will convert the input plaintext array into 4 arrays corresponding to the finite field multiplication order, concatenate them in sequence and pass them into the second type of neural network Net2 for obfuscation, and obtain 4 temporary arrays that perform finite field multiplication with 2, 3, 1, and 1 respectively, and use fun3 to adjust its format to generate a temporary variable temp_3; Step 5: Perform two-by-two XOR operations on the four arrays generated in the previous step to complete column obfuscation. Specifically, use the third-class neural network XorNet to obfuscate temp_3 and generate a temporary variable temp_XorNet. Use fun4 to adjust its format and then use XorNet to obfuscate it again to generate the next round of input data plain. Finally, output the result of this round of encryption; Step 6: Repeat the above steps 3 to 5 for a total of 9 rounds; Step 7, the last round, first perform step 3, use fun5 to adjust the current format, then use Net3 to encrypt it, and finally use fun6 to adjust its format to generate the final ciphertext cipher and output it. The encryption process ends here.
10. A white box encryption system according to any one of the white box encryption methods based on a neural network as claimed in claims 1 to 9, characterized in that: include: The white-box AES scheme determination module includes the operations of initial round key addition, byte substitution, row shift, column obfuscation, and round key addition; The preliminary obfuscation module applies preliminary obfuscation operations to the white-box AES encryption step, which combines the round key addition and byte substitution operations, adds random bijection for scrambling operations, and uses the input-output mapping after the operation as a training set to train the first type of neural network; The first type of neural network is used to replace the round key addition and byte substitution operations in the original white-box AES encryption step to construct a white-box AES structure after preliminary obfuscation. The secondary obfuscation module, based on the white box AES structure after the initial obfuscation constructed in step A2), does not perform obfuscation on the row shift; in the column obfuscation operation, first adds the corresponding scrambling and restoration operation, then performs finite field multiplication, and then XORs a randomly generated secret byte, and similarly trains the input-output mapping after the operation to obtain the second type of neural network; The second type of neural network is used to replace some column obfuscation operations in the white-box AES structure after the initial obfuscation, and the white-box AES structure after the second obfuscation is constructed; The third obfuscation module uses a neural network to simulate the XOR operation on the basis of the white-box AES structure after the second obfuscation, and obtains a third type of neural network, which performs XOR on the output of the second type of network to complete the column obfuscation function; the third type of neural network is used to replace the XOR operation in the white-box AES structure after the second obfuscation, and the white-box AES structure after the third obfuscation is constructed; The fourth obfuscation module is based on the white-box AES structure after the third obfuscation, and integrates the scrambling restoration and the last round of key operation proposed by the three obfuscation modules to obtain the fourth type of neural network; the fourth type of neural network is used to replace the last round of key addition operation in the white-box AES structure after the third obfuscation; The import module imports the four types of neural networks trained by the first to fourth obfuscation modules to obtain the obfuscated white-box AES encryption structure.
Citation Information
Patent Citations
White-box cryptography system for confusing wheel boundary and method
CN105099666A
Transparent Internet of Things secure transmission method and device based on white-box password service
CN114448624A
Method for protecting data transfer using neural cryptography
US20200304292A1
Cited By
Image encryption method and system based on bidirectional dynamic confusion and controllable noise diffusion
CN120343172A
