Design method of symmetric cipher differential partition device based on deep learning

By introducing a variety of residual towers and attention layers of one-dimensional convolutional layers into the symmetric cryptographic differential divider, combining batch normalization and Hardswish activation functions, the problems of insufficient feature extraction capabilities and great noise influence in the prior art are solved, and more efficient differential pattern processing and recognition capabilities are achieved.

CN119519940APending Publication Date: 2025-02-25BENGBU COLLEGE
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411465682.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The existing symmetric cryptographic differential divider based on deep learning is insufficient in the initial stage of extracting the feature of the input data, and the residual module design is too fixed, the feature extraction capability is limited, and it is difficult to deal with complex differential modes. The activation function and loss function are mainly used in single ciphertext for scenes, with small data volume, noise or outliers having a great impact.

Method used

A symmetric cryptographic differential divider based on deep learning was designed. By introducing residual towers of multiple one-dimensional convolution layers into the initial convolution module and the residual module, and combining batch normalization and Hardswish activation functions, multiple residual structure dividers were generated. At the same time, attention layers are added to enhance the feature extraction capability of the model and enhance the diversity of data through multi-ciphertext pairs and random key encryption.

Benefits of technology

Through multi-level optimization and selection strategies, the identification and feature extraction capabilities of the differential divider are improved, noise interference is reduced, and processing capabilities of complex differential modes and generalization capabilities of models are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119519940A_ABST
    Figure CN119519940A_ABST
Patent Text Reader

Abstract

The invention provides a design method of a symmetric password differential divider based on deep learning, and relates to the technical field of password differential analysis, and the method comprises the steps: splicing initial ciphertexts into a multi-ciphertext pair, carrying out encryption through a random key, and calculating a differential value before and after encryption as input; based on an input module, an initial convolution module, a residual error module and a prediction module, establishing a preliminary symmetric cryptography difference divider, optimizing the residual error module, batch normalization and an activation function, introducing batch normalization and a Hardswitch activation function into the residual error module, adding an attention layer, generating different residual error structures, and predicting the residual error structures; and the residual structure with the highest accuracy is selected to be applied to the differential partition device, so that the effect of the symmetric password differential partition device is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cryptographic differential analysis, and in particular to a design method for a symmetric cryptographic differential distinguisher based on deep learning. Background Art

[0002] In the field of information security, cryptography is the basis for ensuring data confidentiality and integrity. Symmetric cryptography is widely used in data protection due to its high encryption efficiency. However, with the advancement of attack technology, traditional cryptographic systems are facing the threat of differential attacks. Differential attacks analyze the differential relationship between input and output to find the weaknesses of cryptographic algorithms. To this end, developing more powerful differential distinguishers to resist attacks has become a research hotspot. With the development of deep learning technology, it has provided a new perspective for cryptanalysis and has made certain progress, but the problems in the research are also obvious. For example, the neural network structure used is relatively simple, and only simple parameter adjustment is performed on the neural network. There is little research on using prior knowledge of cryptographic algorithms to modify the structure of the neural network, and the accuracy of the neural network is limited when discriminating ciphertext.

[0003] In the prior art, publication number CN118114229A discloses a symmetric cryptographic differential discriminator based on a residual neural network, constructs an initial convolution module in the discriminator that can simulate bit operations, constructs a residual module of the discriminator based on a ResNet network, constructs a prediction module in the differential discriminator for judging real pairs and random pairs based on an MLP structure, and optimizes the activation function and loss function in the network to softmax and Cross Entropy Loss function, respectively, so as to achieve the best discrimination accuracy.

[0004] The main problems with the above method are: the initial convolution module is limited to simulated bit operations, which limits the depth of the model's feature extraction of the input data in the initial stage, and thus lacks sufficient flexibility and adaptability when faced with complex differential patterns; the design of the residual module is relatively fixed, the feature extraction capability is limited, and it is unable to highlight important features and suppress minor features, and performs poorly when processing tasks that require high-precision feature extraction; the activation function and loss function used are mainly applied to single ciphertext pair scenarios, where the data volume is small, and noise or outliers will have a greater impact on the model and affect the accuracy of judgment.

[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention

[0006] The purpose of the present invention is to provide a design method for a symmetric cryptographic differential distinguisher based on deep learning to solve the problems raised in the above background technology.

[0007] To achieve the above object, the present invention provides the following technical solutions:

[0008] The design method of the symmetric cryptographic differential distinguisher based on deep learning includes the following steps:

[0009] Step 1: Establish a preliminary symmetric password differential distinguisher based on the input module, initial convolution module, residual module and prediction module;

[0010] Step 2: Optimize the preliminary symmetric password differential distinguisher, select the residual tower containing 2, 3, and 4 3×3 one-dimensional convolutional layers in the residual module, add batch normalization and Hardswish activation function to each convolutional layer, and generate three residual structure distinguishers;

[0011] Step 3: After the residual tower has finished learning the ciphertext data, an attention layer is generated and added to each residual tower, and three other residual structure discriminators are generated. The six residual structure discriminators are tested for discrimination, and the residual structure discriminator with the highest accuracy is selected based on the test results.

[0012] Step 4: Collect the initial ciphertext pairs, concatenate the single ciphertext pairs into multiple ciphertext pairs, perform a round of encryption on the multiple ciphertext pairs using a random key to generate an encrypted ciphertext pair, and input the difference between the multiple ciphertext pairs and the encrypted ciphertext pair as the difference value of the ciphertext data into the symmetric cipher differential distinguisher;

[0013] Step 5: Apply the selected residual structure discriminator to the preliminary symmetric cipher differential discriminator to generate an optimized symmetric cipher differential discriminator, and input the differential value of the ciphertext data obtained in step 4 into the optimized symmetric cipher differential discriminator for training.

[0014] Furthermore, the structures of the three residual structure discriminators are:

[0015] 2-layer convolutional residual tower: the input data enters the first 3×3 1D convolutional layer, the data is standardized by batch normalization and Hardswish activation function is applied, and then enters the second 3×3 1D convolutional layer, batch normalization and Hardswish activation are performed again, and the input data and the processed output are added as the final output of the residual tower to complete the residual connection;

[0016] 3-layer convolution residual tower: input data enters the first 3×3 one-dimensional convolution layer, standardizes the data through batch normalization and applies the Hardswish activation function, enters the second 3×3 one-dimensional convolution layer, performs batch normalization and Hardswish activation, enters the third 3×3 one-dimensional convolution layer, performs batch normalization and Hardswish activation, and adds the input data and the processed output as the final output of the residual tower to complete the residual connection;

[0017] Residual tower with 4 convolution layers: the input data enters the first 3×3 one-dimensional convolution layer, the data is standardized by batch normalization and the Hardswish activation function is applied, enters the second 3×3 one-dimensional convolution layer, batch normalization and Hardswish activation are performed, enters the third 3×3 one-dimensional convolution layer, batch normalization and Hardswish activation are performed, enters the fourth 3×3 one-dimensional convolution layer, batch normalization and Hardswish activation are performed, and the input data and the processed output are added as the final output of the residual tower to complete the residual connection.

[0018] Furthermore, five rounds of Speck encrypted ciphertext pairs are trained, and ReLU, PReLU, swish, GeLu, ELU, Selu, LeakyRelu and Hardswish activation functions are selected respectively. Combined with BatchNorm, LayerNorm and InstanceNorm normalization techniques, the accuracy of password recognition is verified, and the Hardswish activation function and BatchNorm normalization technique with the highest accuracy are selected for batch normalization and activation of the residual tower.

[0019] Furthermore, the principle for generating the attention layer is:

[0020] The final output of the residual tower is used as the input of the attention layer. Each feature of the final output corresponds to a channel. Global average pooling is performed on all channels, and the features of each channel are reduced to a scalar. The number of channels is reduced through the first fully connected layer and activated by the Hardswish activation function. The number of channels is restored to the original number of channels through the second fully connected layer, and the attention weight of each channel is generated after activation by the sigmoid function.

[0021] Furthermore, the six residual structure discriminators were tested through five rounds of Speck ciphertexts, and their accuracy was verified in the residual module containing 10 residual towers. The residual tower with the highest accuracy of three convolution layers combined with the attention layer was selected as the residual structure discriminator.

[0022] Furthermore, the number of ciphertext pairs in the multi-ciphertext pair is 32, which are p 1 、p 2 ,……,p 32 , generate a 128-bit random number as the key, perform a round of random encryption through the AES encryption algorithm, and the generated encrypted ciphertext pair is c 1 、c 2 ,……,c 32 , p 1 ~p 32 and c1 ~c 32 The ciphertext pairs with the same subscripts are XORed bit by bit to generate d 1 ~d 32 The differential value of is input as the differential value of the ciphertext data.

[0023] Compared with the prior art, the present invention has the following beneficial effects:

[0024] The present invention concatenates single ciphertext pairs to form multiple ciphertext pairs, which can more comprehensively capture the differential relationship between data, reduce noise interference, use random keys for encryption, increase data diversity, enable the model to learn more complex patterns, and improve the richness of differential features, thereby enhancing the recognition ability of the differential distinguisher.

[0025] The present invention also improves the residual module and the activation function. In the residual module, different numbers of one-dimensional convolutional layers are combined with batch normalization and Hardswish activation function. Batch normalization helps to accelerate the training process and improve the generalization ability of the model. The Hardswish activation function provides nonlinear changes, which can capture more complex features and effectively improve the expressiveness of the model. An attention layer is added to calculate the weights of each channel based on the attention mechanism, so that the model can focus on more important features, thereby improving the differential learning effect of ciphertext data. This multi-level optimization and selection strategy can select the optimal residual structure through experimental verification, compare multiple models, and ensure the optimality of the selected structure for specific tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 This is a schematic diagram of a method flow of an embodiment of the present invention;

[0027] Figure 2 This is a schematic diagram of the structure of a preliminary symmetric cryptographic differential distinguisher according to an embodiment of the present invention;

[0028] Figure 3 Schematic diagram of six residual structure classifiers according to an embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments.

[0030] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0031] Example:

[0032] See also Figure 1 , the present invention provides a technical solution:

[0033] The design method of the symmetric cryptographic differential distinguisher based on deep learning includes the following steps:

[0034] Step 1: Establish a preliminary symmetric password differential distinguisher based on the input module, initial convolution module, residual module and prediction module;

[0035] In this embodiment, Input is used as input and Output is used as output. The input module is Module1, which is used to receive the differential value of the ciphertext data; the initial convolution module is Module2, which is based on the ResNet network and uses a single-layer convolution operation with a convolution kernel size of 1 to extract features from the differential value; the residual module is Module3, which uses 10 two-layer convolutional neural networks to extract deeper features, and 10 blocks are used to represent the 10 two-layer convolutional neural networks, and the residual connection is used to reduce information loss and enhance the feature extraction capability; the prediction module is Module4, which is used to determine the number of fully connected layers used according to the number of extracted features, and map the features of the input differential value to the output label.

[0036] Step 2: Optimize the preliminary symmetric password differential distinguisher, select the residual tower containing 2, 3, and 4 3×3 one-dimensional convolutional layers in the residual module, add batch normalization and Hardswish activation function to each convolutional layer, and generate three residual structure distinguishers;

[0037] In this embodiment, the structures of the three residual structure distinguishers are:

[0038] 2-layer convolutional residual tower: the input data enters the first 3×3 1D convolutional layer, the data is standardized by batch normalization and Hardswish activation function is applied, and then enters the second 3×3 1D convolutional layer, batch normalization and Hardswish activation are performed again, and the input data and the processed output are added as the final output of the residual tower to complete the residual connection;

[0039] 3-layer convolution residual tower: input data enters the first 3×3 one-dimensional convolution layer, standardizes the data through batch normalization and applies the Hardswish activation function, enters the second 3×3 one-dimensional convolution layer, performs batch normalization and Hardswish activation, enters the third 3×3 one-dimensional convolution layer, performs batch normalization and Hardswish activation, and adds the input data and the processed output as the final output of the residual tower to complete the residual connection;

[0040] 4-layer convolution residual tower: input data enters the first 3×3 one-dimensional convolution layer, standardizes the data through batch normalization and applies the Hardswish activation function, enters the second 3×3 one-dimensional convolution layer, performs batch normalization and Hardswish activation, enters the third 3×3 one-dimensional convolution layer, performs batch normalization and Hardswish activation, enters the fourth 3×3 one-dimensional convolution layer, performs batch normalization and Hardswish activation, and adds the input data and the processed output as the final output of the residual tower to complete the residual connection;

[0041] The three residual structure discriminators are named S 1 , S 2 , S 3 .

[0042] In this embodiment, the traditional ReLU activation function is used as the end of the residual branch in the ResNet network, so that the calculation result of the branch is always non-negative and increasing, which affects the expressiveness of the feature. Therefore, other activation functions are needed to make the calculation result of the residual branch in the (-∞, +∞) interval. Five rounds of Speck encrypted ciphertext pairs are trained, and ReLU, PReLU, swish, GeLu, ELU, Selu, LeakyRelu and Hardswish activation functions are selected respectively. Combined with BatchNorm, LayerNorm and InstanceNorm normalization techniques, the accuracy of password recognition is verified, and the Hardswish activation function with the highest accuracy and BatchNorm normalization technology are selected for batch normalization and activation of the residual tower.

[0043] Step 3: After the residual tower has finished learning the ciphertext data, an attention layer is generated and added to each residual tower, and three other residual structure discriminators are generated. The six residual structure discriminators are tested for discrimination, and the residual structure discriminator with the highest accuracy is selected based on the test results.

[0044] In this embodiment, the principle for generating the attention layer is:

[0045] After the residual tower has finished learning the ciphertext data, the convolutional layers in the tower will splice their output data, and splice the ciphertext structure that was originally two-dimensional data into three-dimensional data as the final output of the residual tower. The final output of the residual tower is used as the input of the attention layer, so that the ciphertext structure has more than one channel. Each feature of the final output corresponds to a channel, and all channels are globally averaged pooled to reduce the features of each channel to a scalar. The number of channels is reduced through the first fully connected layer, and activated by the Hardswish activation function, and then the number of channels is restored to the original number of channels through the second fully connected layer. After activation with the sigmoid function, the attention weight of each channel is generated. On the basis of adding the attention layer, the attention layer is spliced ​​behind the residual structure discriminator to generate three new residual structure discriminators, and the three new residual structure discriminators are named SeNet-S respectively. 1 , SeNet-S 2 , SeNet-S 3 ;

[0046] Through 5 rounds of Speck ciphertext, the six residual structure discriminators were tested for their accuracy in the residual module containing 10 residual towers. According to the test results, the three-layer convolution residual tower with the highest accuracy combined with the attention layer structure, namely SeNet-S 2 As residual structure discriminators, the accuracy test results of 6 residual structure discriminators are shown in Table 1.

[0047]

[0048]

[0049] Table 1

[0050] Step 4: Collect the initial ciphertext pairs, concatenate the single ciphertext pairs into multiple ciphertext pairs, perform a round of encryption on the multiple ciphertext pairs using a random key to generate an encrypted ciphertext pair, and input the difference between the multiple ciphertext pairs and the encrypted ciphertext pair as the difference value of the ciphertext data into the symmetric cipher differential distinguisher;

[0051] In this embodiment, the number of ciphertext pairs in the multiple ciphertext pairs is 32, which are p 1 、p 2,……,p 32 , a 128-bit random number is generated as the key through the Linux random number generator with a fixed random seed, as well as the required training set and test set. The size of the training set is 10 7 , the size of the test set is 10 6 , a round of random encryption is performed through the AES encryption algorithm, and the generated encrypted ciphertext pair is c 1 、c 2 ,……,c 32 , p 1 ~p 32 and c 1 ~c 32 The ciphertext pairs with the same subscripts are XORed bit by bit to generate d 1 ~d 32 The differential value of is input as the differential value of the ciphertext data.

[0052] In this embodiment, the formula for generating the differential value of the ciphertext data is:

[0053] d 1 =p 1 ⊕c 1

[0054] d 2 =p 2 ⊕c 2

[0055] …

[0056] d 32 =p 32 ⊕c 32

[0057] Among them, d 1 ,d 2 ,……,d 32 Represents the differential value of the ciphertext data as input, p 1 、p 2 ,……,p 32 represents multiple ciphertext pairs concatenated from the collected initial ciphertexts, c 1 、c 2 ,……,c 32 Represents an encrypted ciphertext pair, and ⊕ represents an XOR operation.

[0058] Step 5: Apply the selected residual structure discriminator to the preliminary symmetric cipher differential discriminator to generate an optimized symmetric cipher differential discriminator, and input the differential value of the ciphertext data obtained in step 4 into the optimized symmetric cipher differential discriminator for training.

[0059] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.

[0060] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product. Those skilled in the art may appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software methods depends on the specific application and design constraints of the technical solution.

[0061] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0062] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.

Claims

1. A design method for a symmetric cryptographic differential distinguisher based on deep learning, characterized in that: The specific steps include: Step 1: Establish a preliminary symmetric password differential distinguisher based on the input module, initial convolution module, residual module and prediction module; Step 2: Optimize the preliminary symmetric password differential distinguisher, select the residual tower containing 2, 3, and 4 3×3 one-dimensional convolutional layers in the residual module, add batch normalization and Hardswish activation function to each convolutional layer, and generate three residual structure distinguishers; Step 3: After the residual tower has finished learning the ciphertext data, an attention layer is generated and added to each residual tower, and three other residual structure discriminators are generated. The six residual structure discriminators are tested for discrimination, and the residual structure discriminator with the highest accuracy is selected based on the test results. Step 4: Collect the initial ciphertext pairs, concatenate the single ciphertext pairs into multiple ciphertext pairs, perform a round of encryption on the multiple ciphertext pairs using a random key to generate an encrypted ciphertext pair, and input the difference between the multiple ciphertext pairs and the encrypted ciphertext pair as the difference value of the ciphertext data into the symmetric cipher differential distinguisher; Step 5: Apply the selected residual structure discriminator to the preliminary symmetric cipher differential discriminator to generate an optimized symmetric cipher differential discriminator, and input the differential value of the ciphertext data obtained in step 4 into the optimized symmetric cipher differential discriminator for training.

2. The design method of a symmetric cryptographic differential distinguisher based on deep learning according to claim 1, characterized in that: The structures of the three residual structure distinguishers in step 2 are: 2-layer convolutional residual tower: the input data enters the first 3×3 1D convolutional layer, the data is standardized by batch normalization and Hardswish activation function is applied, and then enters the second 3×3 1D convolutional layer, batch normalization and Hardswish activation are performed again, and the input data and the processed output are added as the final output of the residual tower to complete the residual connection; 3-layer convolution residual tower: input data enters the first 3×3 one-dimensional convolution layer, standardizes the data through batch normalization and applies the Hardswish activation function, enters the second 3×3 one-dimensional convolution layer, performs batch normalization and Hardswish activation, enters the third 3×3 one-dimensional convolution layer, performs batch normalization and Hardswish activation, and adds the input data and the processed output as the final output of the residual tower to complete the residual connection; Residual tower with 4 convolution layers: the input data enters the first 3×3 one-dimensional convolution layer, the data is standardized by batch normalization and the Hardswish activation function is applied, enters the second 3×3 one-dimensional convolution layer, batch normalization and Hardswish activation are performed, enters the third 3×3 one-dimensional convolution layer, batch normalization and Hardswish activation are performed, enters the fourth 3×3 one-dimensional convolution layer, batch normalization and Hardswish activation are performed, and the input data and the processed output are added as the final output of the residual tower to complete the residual connection.

3. The design method of a symmetric cryptographic differential distinguisher based on deep learning according to claim 2, characterized in that: Through 5 rounds of Speck encrypted ciphertext pairs for training, ReLU, PReLU, swish, GeLu, ELU, Selu, LeakyRelu and Hardswish activation functions are selected respectively, and the accuracy of password recognition is verified by combining BatchNorm, LayerNorm and InstanceNorm normalization techniques. The Hardswish activation function and BatchNorm normalization technique with the highest accuracy are selected for batch normalization and activation of the residual tower.

4. The design method of a symmetric cryptographic differential distinguisher based on deep learning according to claim 1, characterized in that: The principle for generating the attention layer in step 3 is: After the residual tower has finished learning the ciphertext data, the convolutional layers in the tower will splice their output data, and splice the ciphertext structure that was originally two-dimensional data into three-dimensional data as the final output of the residual tower. The final output of the residual tower is used as the input of the attention layer. Each feature of the final output corresponds to a channel, and global average pooling is performed on all channels to reduce the features of each channel to a scalar. The number of channels is reduced through the first fully connected layer and activated by the Hardswish activation function. The number of channels is restored to the original number of channels through the second fully connected layer, and the attention weight of each channel is generated after activation by the sigmoid function.

5. The design method of a symmetric cryptographic differential distinguisher based on deep learning according to claim 1, characterized in that: The number of ciphertext pairs in the multiple ciphertext pairs in step 4 is 32, namely p1, p2, ..., p 32 , generate a 128-bit random number as the key, perform a round of random encryption through the AES encryption algorithm, and the generated encrypted ciphertext pairs are c1, c2, ..., c 32 , p1~p 32 and c1~c 32 The ciphertext pairs with the same subscripts are XORed bit by bit to generate d1~d 32 The differential value of is input as the differential value of the ciphertext data.

6. The design method of a symmetric cryptographic differential distinguisher based on deep learning according to claim 1, characterized in that: Through 5 rounds of Speck ciphertext, the 6 residual structure discriminators were tested for discrimination. The accuracy of the 6 residual structure discriminators was verified in the residual module containing 10 residual towers. The residual tower with 3 layers of convolution and the attention layer with the highest accuracy was selected as the residual structure discriminator.

Citation Information

Patent Citations

  • Symmetric cipher difference partition device based on residual neural network

    CN118114229A