Weighted integrated neural network key prediction method and device, medium and equipment

Through weighted integrated neural network key prediction methods, use residual neural network training multiple key prediction models, combined with weighted integrated processing technology, solve the problem of high complexity of the sequence password key to crack the time complexity, and achieve efficient key prediction prediction Essence

CN119363328AActive Publication Date: 2025-01-24INNER MONGOLIA UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411437106.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-01-24
Estimated Expiration
2044-10-15

AI Technical Summary

Technical Problem

In the prior art, when cracking the keys of sequence ciphers, the time complexity is high, especially when the key bit length increases, the time required for cracking will increase dramatically.

Method used

The weighted integrated neural network key prediction method is used to generate key streams by obtaining multiple sets of sample keys and initialization parameter vectors, and use them as training data to train the residual neural network to obtain multiple key prediction models. Then, the key stream of the ciphertext data to be cracked is input into multiple key prediction models, multiple first bit prediction values ​​are obtained, and weighted integration processing is performed to obtain the first bit prediction result of the key.

Benefits of technology

A significant reduction of the time complexity of the key prediction makes the attack more efficient and can effectively crack the key of the sequence password.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363328A_ABST
    Figure CN119363328A_ABST
Patent Text Reader

Abstract

The invention discloses a weighted integrated neural network key prediction method, a weighted integrated neural network key prediction device, a medium and equipment, and relates to the cross technical field of cryptographic analysis and machine learning. Respectively inputting each group of preset number of sample keys and the initialization parameter vectors into a sequence key algorithm to obtain multiple groups of preset number of sample key streams; using the first bit value of the sample key as a label of a corresponding sample key stream, and using each group of preset number of sample key streams and the corresponding label as training data to train the residual neural network to obtain a plurality of key prediction models; then respectively inputting the key stream of the to-be-broken text data into a plurality of key prediction models to obtain a plurality of first bit prediction values of the key of the to-be-broken text data; and performing weighted integration processing on the plurality of first bit prediction values to obtain a key prediction result of the to-be-broken text data. According to the method, the time complexity of key prediction can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the interdisciplinary technical field of cryptanalysis and machine learning, and in particular to a weighted integrated neural network key prediction method, apparatus, medium and equipment. Background Art

[0002] In the field of cryptanalysis, machine learning techniques were first applied to side-channel attacks (SCA). By intercepting information such as energy and electromagnetic waves leaked by hardware during the encryption process, neural networks were used to learn encrypted information and predict possible encryption operations. However, this approach was limited to practical attack methods and had not yet been further studied. Until the introduction of differential-neural distinguishers (NDs) based on neural networks, they demonstrated superior performance compared to pure differential distinguishers based on differential distribution tables (DDTs). By utilizing a sufficient number of neutral bits, key recovery attacks were performed and successfully applied to Speck32 / 64. This method applied machine learning techniques at the theoretical level and achieved superior attack results. However, it was primarily applied to block ciphers, and theoretically, there is still no promising machine learning-assisted cryptanalysis method for stream ciphers.

[0003] Currently, stream ciphers typically use a secret key to generate a pseudo-random keystream, which is then used to encrypt plaintext data bit by bit. Existing techniques typically use exhaustive methods to predict stream cipher keys. However, due to the long bit length of the key, the exhaustive method has an exponential time complexity, meaning that the time required to crack the key increases dramatically as the bit length increases. Therefore, the exhaustive method has a high time complexity for predicting the key. Summary of the Invention

[0004] Based on this, it is necessary to provide a weighted integrated neural network key prediction method, device, medium and equipment to address the above technical problems, which can reduce the time complexity of key prediction.

[0005] The present invention adopts the following technical solutions:

[0006] The present invention provides a weighted integrated neural network key prediction method, comprising:

[0007] Obtaining a plurality of sets of preset number of sample keys and initialization parameter vectors for a stream cipher algorithm;

[0008] Inputting each set of preset number of sample keys and initialization parameter vectors into the sequence key algorithm respectively to obtain multiple sets of preset number of sample key streams;

[0009] The first bit value of the sample key is used as the label of the corresponding sample key stream, and each set of preset number of sample key streams and corresponding labels is used as training data to train the residual neural network to obtain multiple key prediction models;

[0010] Inputting the key stream of the ciphertext data to be cracked into multiple key prediction models respectively to obtain multiple first bit prediction values ​​of the key of the ciphertext data to be cracked;

[0011] The multiple first bit prediction values ​​are weighted and integrated to obtain a key prediction result of the ciphertext data to be cracked; the key prediction result includes the first bit value of the key of the ciphertext data to be cracked.

[0012] Preferably, each set of preset number of sample key streams and corresponding labels is used as training data to train the residual neural network to obtain multiple key prediction models, including:

[0013] For any set of preset number of sample key streams, the preset number of sample key streams and corresponding labels are used as training data, and the residual neural network is iteratively trained to obtain the loss function value of the residual neural network for each training;

[0014] The parameters of the residual neural network are updated according to the loss function value of the residual neural network in each training until the residual neural network converges and the key prediction model is determined.

[0015] Preferably, the residual neural network includes a feature extraction module, a residual block and a prediction module; iteratively training the residual neural network to obtain the loss function value of the residual neural network for each training includes:

[0016] For any training, the training data is input into the feature extraction module to obtain the features of the training data;

[0017] The features of the training data are input into the residual block, and the deep features of the training data are extracted through multi-layer convolution and skip connections;

[0018] Input the deep features of the training data into the prediction module to obtain the prediction results of the training data;

[0019] Compare the prediction results with the labels of the training data to determine the loss function value of the residual neural network.

[0020] Preferably, the prediction result is compared with the label of the training data to determine the loss function value of the residual neural network, including:

[0021] According to the prediction results and labels, the initial loss function value of the residual neural network is calculated through the binary cross entropy loss function corresponding to the binary classification task;

[0022] Perform weight decay on the initial loss function value to determine the loss function value.

[0023] Preferably, the parameters of the key prediction model are the parameters corresponding to the residual neural network with the highest prediction accuracy during the iterative training process.

[0024] Preferably, a plurality of first bit prediction values ​​are weighted and integrated to obtain a key prediction result of the ciphertext data to be cracked, including:

[0025] Obtain prediction accuracy rates of multiple key prediction models, and normalize the multiple prediction accuracy rates to obtain a normalized weight of each key prediction model;

[0026] According to the normalized weight of each key prediction model, multiple first bit prediction values ​​are weighted to obtain the prediction value of the ciphertext data to be cracked;

[0027] If the predicted value is greater than the preset threshold, the key prediction result is determined to be 1;

[0028] If the predicted value is less than or equal to the preset threshold, the key prediction result is determined to be 0.

[0029] The present invention provides a weighted integrated neural network key prediction device, comprising:

[0030] An acquisition module, used for acquiring a plurality of sets of preset sample keys and initialization parameter vectors for a stream cipher algorithm;

[0031] A sample generation module, configured to input each set of a preset number of sample keys and an initialization parameter vector into a sequence key algorithm to obtain a plurality of sets of the preset number of sample key streams;

[0032] a training module, configured to use the first bit value of the sample key as a label of the corresponding sample key stream, and use each set of preset number of sample key streams and corresponding labels as training data to train the residual neural network to obtain multiple key prediction models;

[0033] an output module, configured to input the key streams of the ciphertext data to be cracked into the multiple key prediction models respectively, and obtain multiple first bit prediction values ​​of the key of the ciphertext data to be cracked;

[0034] A weighted integration module is used to perform weighted integration processing on the multiple first bit prediction values ​​to obtain a key prediction result of the ciphertext data to be cracked; the key prediction result includes the first bit value of the key of the ciphertext data to be cracked.

[0035] The present invention provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned weighted integrated neural network key prediction method.

[0036] The present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned weighted integrated neural network key prediction method when executing the program.

[0037] At least one of the above technical solutions adopted by the present invention can achieve the following beneficial effects:

[0038] The present invention adopts the initialization parameter vector of the serial cipher algorithm and multiple groups of preset number of sample keys to generate a key stream, and uses the key stream and corresponding labels as training data. This is equivalent to the present invention adopting the core concept of plaintext attack and initial vectorization attack, and using the key stream that can be intercepted during data encryption transmission and the fixed initialization parameter vector for model training. In addition, data generation and model training are both preprocessing processes and do not occupy the actual time consumption. When conducting a data attack, the key stream of the intercepted ciphertext data to be cracked can be directly used to predict multiple first bit prediction values ​​of the key of the ciphertext data to be cracked through multiple trained key prediction models, and then the multiple first bit prediction values ​​are weighted and integrated to finally obtain the first bit value of the key of the ciphertext data to be cracked. In this way, compared with the prior art in which multiple bits of the key need to be predicted by exhaustive method, the present invention predicts the first bit value of the key, and after determining the first bit value, predicts the subsequent bit values, which significantly reduces the complexity and time cost of the attack, making the attack more efficient. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0040] Figure 1 A schematic flow chart of a weighted integrated neural network key prediction method provided by the present invention;

[0041] Figure 2 A schematic diagram of the structure of a residual neural network provided by the present invention;

[0042] Figure 3A structural block diagram of a weighted integrated neural network key prediction device provided by the present invention;

[0043] Figure 4 A schematic diagram of a computer device for implementing a weighted integrated neural network key prediction method provided by the present invention. DETAILED DESCRIPTION

[0044] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with specific embodiments of the present invention and corresponding drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0045] Machine learning, as a core technology in artificial intelligence, has demonstrated its powerful capabilities in a variety of fields, such as image recognition, autonomous driving, and natural language processing. At the theoretical level, machine learning-based cryptanalysis methods have primarily been applied to block ciphers, with little analysis of stream ciphers. Stream ciphers, with their high initialization times, cause differential features to be propagated, diffused, and obfuscated, ultimately rendering them undetectable. Existing techniques are therefore incapable of applying these techniques to block ciphers.

[0046] Current mainstream technologies address this issue by using differential features to construct a ND, surpassing the performance of pure differential distinguishers based on DDT. They also utilize a sufficient number of neutral bits in the initial differential to achieve key recovery. However, the high number of initialization rounds in stream ciphers renders this approach ineffective, preventing effective ND from being established and limiting its ability to analyze stream ciphers.

[0047] Currently, stream ciphers typically use a secret key to generate a pseudo-random keystream, which is then used to encrypt plaintext data bit by bit. Existing techniques typically use exhaustive methods to predict stream cipher keys. However, due to the long bit length of the key, the exhaustive method has an exponential time complexity, meaning that the time required to crack the key increases dramatically as the bit length increases. Therefore, the exhaustive method has a high time complexity for predicting the key.

[0048] Based on this, the present invention provides a weighted integrated neural network key prediction method. By utilizing the concepts of chosen plaintext attack and initialization parameter vector attack of chosen sequence cipher algorithm, a weighted integrated neural network key prediction method is proposed. This method can reduce the time complexity of predicting keys and has certain versatility.

[0049] The weighted integrated neural network key prediction method provided in the embodiment of the present application can be applied to a server, which can be a server set up on a business platform, or a device such as a desktop computer, a laptop computer, etc. that can execute the solution of the present invention.

[0050] The technical solutions provided by various embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0051] In an exemplary embodiment, Figure 1 The following is a flow chart of a weighted integrated neural network key prediction method in the present invention, which specifically includes the following steps:

[0052] S101, obtaining a plurality of sets of preset number of sample keys and initialization parameter vectors for a stream cipher algorithm.

[0053] The preset number of sample keys includes a plurality of sample keys whose first bit value is 0 and a plurality of sample keys whose first bit value is 1.

[0054] The stream cipher algorithm may be the Trivium algorithm, and the initialization parameter vector of the stream cipher algorithm may be an initialization vector (IV). The IV is randomly generated to ensure that the same plaintext generates different ciphertexts in different encryption processes. Therefore, the IV in this embodiment may be randomly generated.

[0055] The key is the primary parameter used to generate a pseudo-random number sequence (key stream) during the encryption process. Multiple sets of a preset number of sample keys can be randomly selected from a database. Each set of sample keys has a preset number of keys. The multiple sets can be 1,000, and the preset number can be 10,000. This means that each of the 1,000 randomly selected sets contains 10,000 keys as the sample keys.

[0056] Each set of the preset number of sample keys includes a plurality of sample keys whose first bit value is 0 and a plurality of sample keys whose first bit value is 1. Optionally, in each set of the preset number of sample keys, the number of sample keys whose first bit value is 0 and the number of sample keys whose first bit value is 1 may be the same, that is, among 10,000 sample keys, 5,000 keys have a first bit value of 0, and 5,000 keys have a first bit value of 1.

[0057] S102 , inputting each set of preset number of sample keys and initialization parameter vectors into a sequence key algorithm respectively, to obtain multiple sets of preset number of sample key streams.

[0058] For any set of preset number of sample keys, the initialization parameter vector and the preset number of sample keys are input into the stream cipher algorithm to obtain a preset number of sample key streams, and the bit length of each sample key stream is the preset bit length; wherein the preset bit length can be 1600 bits.

[0059] Inputting the initialization parameter vector and a preset number of sample keys into a stream cipher algorithm to obtain a preset number of sample key streams may include: for any sample key, inputting the initialization parameter vector and the sample key into the stream cipher algorithm to obtain a sample key stream of a preset bit length.

[0060] Among them, the stream cipher algorithm can be Trivium. When generating a sample key stream with a length of 1600 bits, the target is 1152 initialization rounds. After 1152 initialization rounds in Trivium, it continues to iterate 1600 rounds to obtain a sample key stream with a length of 1600 bits.

[0061] S103, using the first bit value of the sample key as a label of the corresponding sample key stream, and using each set of preset number of sample key streams and corresponding labels as training data, training the residual neural network to obtain multiple key prediction models.

[0062] Each set of preset number of sample key streams and their corresponding labels is used as a set of training data, and the residual neural network is trained with each set of preset number of training data to obtain each set of preset number of key prediction models; for example, 1000 sets of preset number of samples can obtain 1000 key prediction models.

[0063] Specifically, in an exemplary embodiment, each group of preset number of sample key streams and corresponding labels is used as training data to train the residual neural network to obtain multiple key prediction models, including: for any group of preset number of sample key streams, the preset number of sample key streams and corresponding labels are used as training data, and the residual neural network is iteratively trained to obtain the loss function value of the residual neural network for each training; the parameters of the residual neural network are updated according to the loss function value of the residual neural network for each training until the residual neural network converges, and the key prediction model is determined.

[0064] Among them, the residual neural network includes a feature extraction module, a residual block and a prediction module; the residual neural network is iteratively trained to obtain the loss function value of the residual neural network for each training, including: for any training, the training data is input into the feature extraction module to obtain the features of the training data; the features of the training data are input into the residual block, and the deep features of the training data are extracted through multi-layer convolution and jump connections; the deep features of the training data are input into the prediction module to obtain the prediction results of the training data; the prediction results are compared with the labels of the training data to determine the loss function value of the residual neural network.

[0065] like Figure 2 As shown, Figure 2 Figure 3 is a structural diagram of the residual neural network. The residual neural network ResNet includes a feature extraction module, a residual block and a prediction module. The training data is input into the feature extraction module, and the feature extraction module outputs the features of the training data. The features of the training data are input into the residual block, and the deep features of the training data are extracted through multi-layer convolution and jump connections. The deep features of the training data are input into the prediction module to obtain the prediction results of the training data.

[0066] Specifically, the feature extraction module includes a 1D convolutional layer, a batch normalization layer, and a ReLU (Rectified Linear Unit) activation function.

[0067] First, the single-channel input of the training data is expanded to the specified channel data through the 1D convolution layer. Specifically, this layer extracts the input features of the residual neural network (single channel, which is a feature sequence in the present invention) into 64 channels. The convolution kernel size is set to 1, which means that the convolution operation will not cross adjacent elements, but will perform linear combinations element by element. This operation is used to perform preliminary feature extraction or channel expansion on the input signal, increase the dimension of the input data, and facilitate subsequent feature learning. The step size is set to 1, which means that only one unit is slid at a time, that is, the input and output sizes remain consistent.

[0068] Then, the batch normalization layer is used to perform batch normalization on the training data with a specified number of channels to speed up the network convergence and prevent gradient explosion or disappearance. The training data with a specified number of channels is divided into smaller batches (mini-batches), and the output features of each mini-batch are standardized to have a mean of 0 and a variance of 1. At the same time, the output is readjusted through learnable parameters. Given an input of x, let β be a mini-batch, where m is the batch size and each data point is x. i Then the mean of each dimension of mini-batch can be obtained by formula Calculate the variance by the formula Calculate and standardize the data according to the mean and variance, using the formula Calculation, where ε is a very small number to prevent zero error, usually 10-5. Finally, the obtained normalized data is linearly transformed by two learnable parameters γ and δ, which represent the scaling factor and offset respectively, according to the formula Perform calculations to enable the network to learn and adjust on standardized data to adapt to the original data distribution.

[0069] Finally, the ReLU activation function is introduced to introduce nonlinearity to prevent gradient disappearance and enable the model to learn more complex features.

[0070] The rectifier function (ReLU) introduces a nonlinear transformation to prevent the network from degenerating into a linear transformation, which can be expressed as formula (1). This activation function sets all values ​​less than 0 to 0 and leaves values ​​greater than 0 unchanged. This activation function is simple and efficient and does not cause the vanishing gradient problem in the positive interval.

[0071] f(x)=max(0,x) (1)

[0072] Among them, x represents the point corresponding to the training data of the specified number of channels, and f(x) is the feature after the activation function of the rectification function ReLU, that is, the feature of the training data.

[0073] The residual block is the core of the residual neural network. It extracts deep features through multiple layers of convolution and skip connections, ensuring that the results do not deteriorate as the network depth increases. A residual block consists of a 1D convolutional layer, batch normalization, ReLU activation, a 1D convolutional layer, batch normalization, and ReLU activation. First, the features of the training data are passed through a 1D convolutional layer using a kernel size of 3 units, allowing the model to capture richer patterns in the local area. The output of the convolution is passed to a batch normalization layer (BatchNorm1D), which normalizes the output, accelerating convergence and ensuring more stable training. Nonlinearity is then introduced using the ReLU activation function, followed by another convolution and batch normalization operation. These two consecutive convolution operations extract deep features from the data layer by layer. However, deep networks often suffer from the vanishing gradient problem, which makes the model inefficient to train. Therefore, the residual block uses skip connections to directly append the input data to the output of the last convolutional layer, forming a residual connection. This way, even if the convolutional layer fails to learn valid features, the input data can still be passed directly to the next layer, avoiding information loss and effectively alleviating the vanishing gradient problem in deep networks. Finally, the module output is obtained through the ReLU activation function.

[0074] Optionally, the residual block can also include a residual connection, which is not shown in the figure. By adding a branch to the input itself, it allows the loss value to be directly transmitted to the network further ahead during the backward propagation process, thereby slowing down the network's decay and allowing the network to be set deeper. Let be the mapping of the network before propagation and be the mapping of the network after propagation. This process can be expressed by the formula H(x) = F(x) + x.

[0075] The prediction module consists of three parts: a flattening layer, a fully connected layer, and an output layer. First, the high-dimensional features extracted from the residual block are mapped to low-dimensional features (flattening). The results are then passed to the fully connected layer. Through full connectivity, normalization, and activation functions, the model gradually reduces the feature dimensions and extracts more abstract features. Finally, the results are passed through a sigmoid activation function (not shown in the figure), mapping the output values ​​to a range of 0 to 1, resulting in the classification result.

[0076] Flattening layer: Flattens the multi-dimensional output from the residual block into a one-dimensional vector to facilitate processing by the fully connected layer. Fully connected layer: This layer receives the one-dimensional vector output from the flattening layer and maps it to the specified feature dimension. Output layer: Maps the above features to a single feature, that is, obtains a predicted value. The Sigmoid activation function then maps this value to the range z∈[0,1] from 0 to 1. The prediction result is determined by predicting the input category based on the threshold. For example, if the threshold is greater than 0.1, the category is 1, and if the threshold is less than or equal to 0.5, the category is 0.

[0077] The Sigmoid activation function is shown in formula (2). This activation function is usually used in binary classification tasks to convert the obtained results into probability values ​​and determine which category it belongs to based on the selected threshold.

[0078]

[0079] Among them, x is the input feature and σ(x) is the prediction result.

[0080] Optionally, the prediction results are compared with the labels of the training data to determine the loss function value of the residual neural network, including: calculating the initial loss function value of the residual neural network based on the prediction results and the labels through the binary cross entropy loss function corresponding to the binary classification task; and performing weight attenuation on the initial loss function value to determine the loss function value.

[0081] The calculation formula of the cross entropy loss function is shown in formula (3). Substitute the prediction result and the corresponding label into formula (3) and calculate the initial loss function value of the residual neural network through formula (3).

[0082]

[0083] in, is the prediction result, y is the label, is the initial loss function value. This loss function indicates that when the difference between the label and the predicted value is too large, a larger penalty value will be given to make the residual neural network converge to a better result.

[0084] The initial loss function value is weighted attenuated to determine the loss function value. This is called L2 regularization. By adding the square sum of the weight parameters as a penalty term to the given initial loss function, overfitting can be prevented during training. This can be shown in Formula (4).

[0085]

[0086] Among them, λ represents the regularization parameter, Is the sum of the squares of all parameters in the residual neural network. Loss total Represents the loss function value of the residual neural network, Loss original is the initial loss function value

[0087] The parameters of the residual neural network are updated according to the loss function value of the residual neural network in each training until the residual neural network converges and the key prediction model is determined. The residual neural network uses the Adam optimizer and sets the learning rate to 10 -4 , in order to update the parameters in the residual neural network through the loss function value; the loss is calculated using the binary cross entropy loss function and the L2 regularization penalty is used, and its parameter is set to 10 -4 .

[0088] Among them, the condition for the convergence of the residual neural network can be a preset number of iterations, for example, the residual neural network converges after 500 iterations. During each iterative training process, the prediction accuracy of the residual neural network trained each time can be calculated, and the residual neural network with the highest prediction accuracy is saved (usually saved after 20 iterations, that is, the residual neural network with the highest prediction accuracy is saved only after the loss function gradually stabilizes), and the residual neural network model with the highest prediction accuracy is determined as the key prediction model, that is, the parameters of the key prediction model are the parameters corresponding to the residual neural network with the highest prediction accuracy during the iterative training process.

[0089] Through the above operations, multiple key prediction models and multiple prediction accuracy rates are finally obtained.

[0090] S104: Input the key stream of the ciphertext data to be cracked into multiple key prediction models respectively to obtain multiple first bit prediction values ​​of the key of the ciphertext data to be cracked.

[0091] The key stream of the ciphertext data to be cracked may be intercepted from the transmission path of the ciphertext to be cracked.

[0092] The key stream of the ciphertext data to be cracked is input into each key prediction model respectively, and the value of the first bit of the key of the ciphertext data to be cracked output by each key prediction model is obtained, that is, multiple first bit prediction values ​​of the key of the ciphertext data to be cracked are obtained.

[0093] S105 , performing weighted integration processing on the multiple first bit prediction values ​​to obtain a key prediction result of the ciphertext data to be cracked; the key prediction result includes the first bit value of the key of the ciphertext data to be cracked.

[0094] This embodiment adopts the Softmax weighting method to perform key prediction, and by smoothing the model accuracy, prevents the accuracy from being too high or too low so as to affect the final key prediction result, thereby improving the robustness of the prediction.

[0095] In an exemplary embodiment, performing weighted integration processing on multiple first bit prediction values ​​to obtain a key prediction result of the ciphertext data to be cracked includes the following steps:

[0096] S201, obtaining prediction accuracy rates of multiple key prediction models, and normalizing the multiple prediction accuracy rates to obtain a normalized weight of each key prediction model.

[0097] For example, suppose there are n trained key prediction models, and the corresponding multiple prediction accuracies can be used as a set of weights {w1,w2,…,w n}, first use the Softmax function to perform probability conversion, that is, normalization, as shown in Formula 5.

[0098]

[0099] Where n is the number of prediction accuracy, ω i is the i-th prediction accuracy, Softmax(w i ) is the i-th normalized weight, and e is the base of the natural logarithm (approximately 2.718).

[0100] S202 , weighting multiple first bit prediction values ​​according to the normalized weight of each key prediction model to obtain a prediction value of the ciphertext data to be cracked.

[0101] By using formula (5), the normalized weight corresponding to each key prediction model can be calculated: Given the multiple first bit prediction values ​​of the key of the ciphertext data to be cracked, {p1,p2,...,p n}, then the predicted value of the ciphertext data to be cracked is expressed by formula (6).

[0102]

[0103] in, is the predicted value of the ciphertext data to be cracked.

[0104] S203: If the predicted value is greater than the preset threshold, the key prediction result is determined to be 1; if the predicted value is less than or equal to the preset threshold, the key prediction result is determined to be 0.

[0105] A preset threshold may be set, and if the predicted value is greater than the preset threshold, the key prediction result is determined to be 1; if the predicted value is less than or equal to the preset threshold, the key prediction result is determined to be 0. For example, the preset threshold may be 0.5.

[0106] The average accuracy of 1,000 models derived from this method was approximately 52.7%. To verify the predictive accuracy of the weighted ensemble neural network, five randomly generated validation datasets were used using the Trivium Stream Cryptography algorithm. The number of correct 1-bit key recoveries in all five datasets exceeded 5,000, exceeding the accuracy of random selection. Furthermore, this method can also perform multi-bit predictions by increasing the number of labels, effectively handling a multi-classification task (which also requires increasing the amount of data).

[0107] This method utilizes the core concepts of chosen-plaintext attack and chosen-IV attack, obtains corresponding data through existing cryptographic algorithms to construct a data set, and then further predicts by integrating multiple neural network models, which can improve the accuracy of the prediction.

[0108] The weighted ensemble neural network key prediction method proposed in this paper aims to improve machine learning-assisted cryptanalysis for sequence ciphers. Leveraging the core concepts of chosen initialization vector attacks and chosen plaintext attacks, the method constructs a data set from existing data. Using supervised learning, the method abstracts key prediction into a binary classification task, using a residual neural network for learning and prediction. Furthermore, the method uses multiple data sets for multi-model training, and the prediction results are evaluated for accuracy using a probability-weighted approach, thereby improving the accuracy of key prediction results.

[0109] When applying the weighted integrated neural network key prediction method provided by the present invention, it is not necessary to Figure 1 The steps are executed in the order shown. The specific execution order of the steps can be determined according to needs, and the present invention does not limit this.

[0110] The above is a weighted integrated neural network key prediction method provided by one or more embodiments of the present invention. Based on the same idea, the present invention also provides a corresponding weighted integrated neural network key prediction device, such as Figure 3 shown.

[0111] Figure 3 This is a structural block diagram of a weighted integrated neural network key prediction device provided by the present invention, the device 300 includes:

[0112] The acquisition module 301 is used to acquire a plurality of preset groups of sample keys and initialization parameter vectors for a stream cipher algorithm.

[0113] The sample generation module 302 is configured to input each set of a preset number of sample keys and the initialization parameter vector into the sequence key algorithm to obtain multiple sets of the preset number of sample key streams.

[0114] The training module 303 is used to use the first bit value of the sample key as the label of the corresponding sample key stream, and use each group of preset number of sample key streams and corresponding labels as training data to train the residual neural network to obtain multiple key prediction models.

[0115] The output module 304 is configured to input the key streams of the ciphertext data to be cracked into the multiple key prediction models respectively, to obtain multiple first bit prediction values ​​of the key of the ciphertext data to be cracked.

[0116] The weighted integration module 305 is used to perform weighted integration processing on the multiple first bit prediction values ​​to obtain the key prediction result of the ciphertext data to be cracked; the key prediction result includes the first bit value of the key of the ciphertext data to be cracked.

[0117] The specific limitations of the key prediction device can be found in the limitations of the weighted integrated neural network key prediction method described above and will not be repeated here. Each module in the key prediction device described above can be implemented in whole or in part through software, hardware, or a combination thereof. Each of the modules described above can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in a computer device in software form, so that the processor can call and execute the corresponding operations of each of the modules described above.

[0118] The present invention also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 The proposed weighted ensemble neural network key prediction method.

[0119] The present invention also provides Figure 4 The structural diagram of the computer equipment shown in FIG. Figure 4 As shown in the figure, at the hardware level, the computer device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory. Of course, it may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 The proposed weighted ensemble neural network key prediction method.

[0120] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0121] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of the present invention.

Claims

1. A weighted integrated neural network key prediction method, characterized in that: The method comprises: Obtaining a plurality of sets of preset numbers of sample keys and initialization parameter vectors for a stream cipher algorithm; Inputting each set of preset number of sample keys and the initialization parameter vector into the sequence key algorithm respectively to obtain multiple sets of preset number of sample key streams; The first bit value of the sample key is used as a label of the corresponding sample key stream, and each group of preset number of sample key streams and corresponding labels are used as training data to train the residual neural network to obtain multiple key prediction models; Inputting the key streams of the ciphertext data to be cracked into the multiple key prediction models respectively to obtain multiple first bit prediction values ​​of the key of the ciphertext data to be cracked; The multiple first bit prediction values ​​are weighted and integrated to obtain a key prediction result of the ciphertext data to be cracked; the key prediction result includes a first bit value of the key of the ciphertext data to be cracked.

2. The method according to claim 1, characterized in that The method uses each group of preset number of sample key streams and corresponding labels as training data to train the residual neural network to obtain multiple key prediction models, including: For any set of preset number of sample key streams, the preset number of sample key streams and corresponding labels are used as training data, the residual neural network is iteratively trained, and the loss function value of the residual neural network is obtained for each training; The parameters of the residual neural network are updated according to the loss function value of the residual neural network after each training until the residual neural network converges to determine the key prediction model.

3. The method according to claim 2, characterized in that The residual neural network includes a feature extraction module, a residual block and a prediction module; the iterative training of the residual neural network to obtain the loss function value of the residual neural network for each training includes: For any training, the training data is input into a feature extraction module to obtain features of the training data; Inputting the features of the training data into the residual block, and extracting the deep features of the training data through multi-layer convolution and skip connection; Inputting the deep features of the training data into the prediction module to obtain the prediction results of the training data; The prediction result is compared with the label of the training data to determine the loss function value of the residual neural network.

4. The method according to claim 3, characterized in that The step of comparing the prediction result with the label of the training data to determine the loss function value of the residual neural network includes: According to the prediction result and the label, the initial loss function value of the residual neural network is calculated by using the binary cross entropy loss function corresponding to the binary classification task; The initial loss function value is weighted attenuated to determine the loss function value.

5. The method according to claim 2, characterized in that: The parameters of the key prediction model are the parameters corresponding to the residual neural network with the highest prediction accuracy during the iterative training process.

6. The method according to claim 1, characterized in that The step of performing weighted integration processing on the plurality of first bit prediction values ​​to obtain a key prediction result of the ciphertext data to be cracked includes: Obtaining prediction accuracy rates of the multiple key prediction models, and normalizing the multiple prediction accuracy rates to obtain a normalized weight of each key prediction model; According to the normalized weight of each key prediction model, multiple first bit prediction values ​​are weighted to obtain the prediction value of the ciphertext data to be cracked; If the predicted value is greater than a preset threshold, determining that the key prediction result is 1; If the predicted value is less than or equal to the preset threshold, the key prediction result is determined to be 0.

7. A weighted integrated neural network key prediction device, characterized in that: include: An acquisition module, used for acquiring a plurality of sets of preset number of sample keys and initialization parameter vectors for a stream cipher algorithm; A sample generation module, used for inputting each set of preset number of sample keys and the initialization parameter vector into the sequence key algorithm to obtain multiple sets of preset number of sample key streams; A training module, used to use the first bit value of the sample key as a label of the corresponding sample key stream, and use each group of preset number of sample key streams and corresponding labels as training data to train the residual neural network to obtain multiple key prediction models; An output module, used for inputting the key streams of the ciphertext data to be cracked into the multiple key prediction models respectively, to obtain multiple first bit prediction values ​​of the key of the ciphertext data to be cracked; A weighted integration module, used for performing weighted integration processing on the plurality of first bit prediction values ​​to obtain a key prediction result of the ciphertext data to be cracked; The key prediction result includes the first bit value of the key of the ciphertext data to be cracked.

8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

9. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Equivalent key acquisition method and device and computer readable storage medium

    CN110071798A

  • Physical layer label signal embedding authentication method and system based on WFRFT

    CN112188483A