A Side-Channel Analysis Method Based on a Hybrid BILSTM and CNN Model

The side-channel analysis method using a hybrid BILSTM and CNN model solves the problems of low accuracy and trajectory imbalance in existing side-channel analysis technologies, enabling efficient security detection of cryptographic chips and improving information security.

CN116346304BActive Publication Date: 2026-03-10CHONGQING UNIV OF POSTS & TELECOMM
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-24
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing deep learning-based side-channel analysis methods have low accuracy in analyzing the ASCAD and DPA competition datasets and suffer from trajectory imbalance, making it difficult to effectively detect the security of cryptographic chips.

Method used

A side-channel analysis method based on a hybrid BILSTM and CNN model is adopted. By acquiring side-channel power consumption trajectory data, preprocessing and Pearson correlation coefficient analysis are performed to construct a leakage model to generate a labeled dataset. The hybrid model is then used for multiple training and testing to select the optimal model.

Benefits of technology

It improves the accuracy of side-channel analysis, enhances the security of cryptographic chips, improves information security, and increases the efficiency of cryptanalysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116346304B_ABST
    Figure CN116346304B_ABST
Patent Text Reader

Abstract

This invention relates to the field of power consumption analysis and side-channel analysis of encrypted chips, and particularly to a side-channel analysis method based on a hybrid BILSTM and CNN model. The method includes: acquiring an initial power consumption trajectory dataset for side-channel analysis; analyzing the initial power consumption trajectory dataset using the Pearson correlation coefficient to obtain a new trajectory dataset; constructing a leakage model, generating labels based on the leakage model, and matching the generated labels with data in the trajectory dataset to obtain a label dataset; dividing the label dataset into a training set and a test set; inputting the training dataset into the hybrid BILSTM and CNN side-channel analysis model for multiple training iterations to obtain multiple trained side-channel analysis models; and inputting data from the test set into the trained side-channel analysis models for testing to obtain the optimal side-channel analysis model. This invention uses an optimized side-channel analysis model to analyze power, improving the efficiency of the analysis.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of encryption chip power analysis and side channel analysis, and particularly relates to a side channel analysis method based on a BILSTM and CNN hybrid model. BACKGROUND

[0002] Side channel analysis technology has brought actual threats to commercial products, personal safety applications and national military security. At present, the security measures that can be adopted by most cryptographic integrated circuit products are limited, on the one hand due to cost constraints, and on the other hand due to immature protection methods. With the increasing research on side channel analysis, many previous protection methods have been unable to perfectly prevent various analyses, and therefore the detection method of side channel analysis is currently the focus of research.

[0003] Power analysis seriously threatens the security of cryptographic chips, and should be comprehensively and deeply discussed and researched. At the same time, deep learning (ML) is rising in various fields, and automation and intelligentization are bound to be an important direction of future information security research. Machine learning improves its prediction ability through the experience learned from the training set, and is suitable for fields with large data size, high dimension but lack of unified theoretical explanation. There are a large number of complex search and optimization problems in the field of cryptanalysis, which are difficult in theory, and the existing analysis methods have made little progress, which provides a broad application space for machine learning. The basic assumption of machine learning is that there is a certain correlation between the input and output, which can be fitted by a linear or nonlinear function, and the internal statistical law can be automatically found in a large amount of data. The encryption algorithm in cryptography usually uses a certain specific key to encrypt the input data (plaintext), and then outputs the ciphertext, and a theoretically secure encryption algorithm must ensure that the correlation between the plaintext and the ciphertext is almost random.

[0004] At present, in the research of side channel analysis based on deep learning at home and abroad, the analysis object is the ASCAD data set or the data set provided by the DPA competition, and many of the power traces provided by these data sets have the problem of unbalanced traces, and the accuracy of analysis and detection is low. SUMMARY

[0005] In order to solve the problems existing in the prior art, the present application provides a side channel analysis method based on a BILSTM and CNN hybrid model, which comprises: obtaining side channel data information to be detected, and preprocessing the information; inputting the preprocessed data into a side channel analysis model to obtain an analysis result; and evaluating the side channel analysis model according to the analysis result.

[0006] The process of training the side channel analysis model comprises:

[0007] S1: obtaining an initial power consumption trajectory dataset used in side channel analysis;

[0008] S2: analyzing the initial power consumption trajectory dataset by using a Pearson correlation coefficient to obtain a new trajectory dataset, and preprocessing the new trajectory dataset;

[0009] S3: constructing a leakage model, generating labels according to the leakage model, corresponding the generated labels with data in the preprocessed trajectory dataset to obtain a label dataset, and dividing the label dataset into a training set and a test set;

[0010] S4: inputting data in the training dataset into a side channel analysis model based on a mixed BILSTM and CNN for multiple times of training to obtain multiple trained side channel analysis models;

[0011] S5: inputting data in the test set into the trained channel analysis models for testing to screen out an optimal side channel analysis model.

[0012] Preferably, the process of obtaining the initial power consumption trajectory dataset for side channel analysis comprises: setting a side channel power signal collection point; obtaining power consumption trajectory data of the side channel power signal collection point by using a power collection device; and collecting all the power consumption trajectory data to obtain the initial power consumption trajectory dataset.

[0013] Preferably, the process of analyzing the initial power consumption trajectory dataset by using the Pearson correlation coefficient comprises: using the Pearson correlation coefficient to obtain the correlation between Hamming weight H and voltage value V collected by the power collection device, wherein the strongly correlated sample points represent the S-box leakage part; and constructing a new trajectory dataset by using the data S-box leakage part trajectory.

[0014] Preferably, the process of constructing labels according to the leakage model comprises: obtaining all the initial power consumption trajectories, and defining a label for each power consumption trajectory trace, the expression of the label being:

[0015] label(tracei)=Sbox(Pik^Kk)

[0016] wherein Pik represents plaintext of the kth byte of the ith trace, and Kk represents the key of the kth byte.

[0017] Preferably, the process of training in the side channel analysis model based on the mixed BILSTM and CNN comprises:

[0018] S41: inputting data in the training set into a CNN model to obtain 32-dimensional intermediate data through three convolutional layers and three pooling layers; wherein the data in the training set is one-dimensional power consumption data;

[0019] S42: the intermediate data is processed by a flatten layer and a reshape layer to change dimensions;

[0020] S43: the data after dimension change is input into a BILSTM layer and a full connection layer to perform key guessing, and 256 key guessing results of the power consumption data are obtained; rank ranking is performed according to the guessing results, and when the value of the rank reaches 0, it is determined that the sub-key guessing is successful, and the training of the model is completed.

[0021] To achieve the above object, the application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize any of the above side channel analysis methods based on the BILSTM and CNN hybrid model.

[0022] To achieve the above object, the application further provides a side channel analysis device based on the BILSTM and CNN hybrid model, which comprises a processor and a memory; the memory is used to store a computer program; the processor is connected with the memory and is used to execute the computer program stored in the memory, so that the side channel analysis device based on the BILSTM and CNN hybrid model executes any of the above side channel analysis methods based on the BILSTM and CNN hybrid model.

[0023] The application has the following beneficial effects:

[0024] The application tests the security of the password chip by using the deep learning template, can strengthen the defense against the side channel, ensures the stability and security of the financial system, and improves the information security level; the application acquires the power consumption trajectory data set by constructing the FPGA encryption chip, verifies the availability of the deep learning model in the field of side channel analysis through the power consumption trajectory data set, and improves the efficiency of the password analysis. BRIEF DESCRIPTION OF DRAWINGS

[0025] Figure 1 The whole flowchart of the application;

[0026] Figure 2 The network parameter diagram of the BILSTM and CNN hybrid model in the embodiment of the application;

[0027] Figure 3 The effect diagram of the sub-key calculation of the application. DETAILED DESCRIPTION

[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0029] A side-channel analysis method based on a hybrid BILSTM and CNN model is disclosed. The method includes: acquiring side-channel data information to be detected and preprocessing the information; inputting the preprocessed data into a side-channel analysis model to obtain analysis results; and evaluating the side-channel model based on the analysis results.

[0030] The process of training the side-channel analysis model includes:

[0031] S1: Obtain the initial power trajectory dataset used for side-channel analysis; the specific process includes: setting up side-channel power signal acquisition points; using power acquisition equipment to acquire power trajectory data of the side-channel power signal acquisition points; and collecting all the power trajectory data to obtain the initial power trajectory dataset.

[0032] S2: The Pearson correlation coefficient is used to analyze the initial power consumption trajectory dataset to obtain a new trajectory dataset, and the new trajectory dataset is preprocessed. During the analysis, the correlation between the Hamming weight H and the voltage value V collected by the power acquisition device is calculated using the Pearson correlation coefficient. The sample points with strong correlation represent the leakage part of the S-box. The trajectory of the leakage part of the data S-box is used to form a new trajectory dataset.

[0033] S3: Construct a leakage model, generate labels based on the leakage model, and match the generated labels with the data in the preprocessed trajectory dataset to obtain a label dataset; divide the label dataset into a training set and a test set.

[0034] S4: Input the data in the training dataset into the side channel analysis model based on BILSTM and CNN for multiple training iterations to obtain multiple trained side channel analysis models;

[0035] S5: Input the data from the test set into the trained channel analysis model for testing, and select the optimal side channel analysis model.

[0036] In this embodiment, the process of training the side-channel analysis model based on a hybrid BILSTM and CNN includes:

[0037] S41: Input the data in the training set into the CNN model, and obtain 32-dimensional intermediate data through 3 convolutional layers and 3 pooling layers; where the data in the training set is one-dimensional power consumption data;

[0038] S42: The intermediate data is processed by the flatten layer and the reshape layer;

[0039] S43: The data after the dimension change is input into the BILSTM layer and the full connection layer for key guessing, 256 key guessing results of the power consumption data are obtained; the rank ranking is performed according to the guessing results, when the value of the rank reaches 0, it is determined that the sub-key guessing is successful, and the training of the model is completed.

[0040] As shown in Figure 1 The steps of the side channel power consumption analysis method of the BILSTM and CNN hybrid model include:

[0041] Step 1, the XMEGA chip runs the encryption algorithm, the FPGA steals the chip connected to the PC end, sets the oscilloscope to collect the sampling points of the encryption chip during encryption, and the PC end operates the stealing chip (or uses the oscilloscope) to steal the power consumption trajectory leaked by the encryption chip, and makes an initial power consumption trajectory dataset.

[0042] In this embodiment, the chip analysis platform set in chipwhisper is CWLITE XMEGA, the number of traces set for grabbing is 10000, the SCOPE TYPE is set to OPENADC, the oscilloscope used for power consumption trajectory is specified, and the sampling points scope.adc.samples are set. The sampling points depend on the oscilloscope hardware device, the key and plaintext are obtained, the plaintext and key used for encryption can be changed by changing the ktp position in the chipwhisper package, after the setting is completed, the power consumption trajectory leaked during the running of the AES encryption is collected, and the dataset thereof is made by using numpy.

[0043] Step 2, in view of the problem of unbalanced dataset, the data is preprocessed to align the first round S-box output part, the Pearson correlation coefficient is used to obtain the correlation between the Hamming weight H and the oscilloscope collected voltage value V, according to the correlation research, the strong correlation part sample point represents the S-box leakage part, and then the data S-box leakage part trajectory is taken out alone to form a new dataset, and the length of the single dataset is assumed to be N; wherein, the linear correlation between the Hamming weight H and the oscilloscope collected voltage value V is expressed as:

[0044] H i =kV i +h

[0045] The quasi-score calculation formula is:

[0046]

[0047] The expression of the Pearson correlation coefficient is:

[0048]

[0049] where H i represents the linear correlation between the Hamming weight H and the voltage value V collected by the power collection device, k represents the algebra, V i represents the power consumption, h represents the algebra, z represents the quasi-score, x represents the data sample, μ represents the mean, σ represents the standard deviation, and cov(.) represents the covariance.

[0050] Step 3, a leakage model is constructed, and labels of the data set in step 2 are made by using the leakage model. Different leakage models will cause different template classification results. Given a set of power consumption traces T = {T1, T2, …, T |T|}, for all T i ∈R m , where i ∈ {1, 2, 3, …, |T|}, in the plaintext P = {P1, P2, …, P |T|}, the purpose of step S5 training is to make the BILSTM and CNN mixed model classify the traces T i ∈T according to the labels label(T i ) ∈ C of the traces T i ∈T, where C = {1, 2, …, |C|-1} is the selected classification class set. The classification class is defined by the leakage model.

[0051] In this embodiment, the identity leakage model Hamming weight HW and 8-bit sub-key are used, so |C| = 256.

[0052] Step 4, a BILSTM and CNN mixed side channel analysis model is constructed for the data set and its final classification |C| of steps 2 and 3; as shown in the figure, the structure of the constructed BILSTM and CNN mixed side channel analysis model includes: input layer (None, 130, 1), convolution layer (None, 130, 4), pooling layer (None, 129, 4), convolution layer (None, 129, 8), pooling layer (None, 128, 8), convolution layer (None, 127, 16), pooling layer (None, 127, 16), convolution layer (None, 127, 32), pooling layer (None, 126, 32), flattening layer (None, 4032), RESHAPE layer (None, 1, 0), BILSTM layer (None, 512), full connection layer (None, 256), and output layer (None, 256). Figure 2

[0053] ​Step 5, for each byte, 90% of the data set made in step S2 is used for model training, and 100 times are trained respectively. The experiment is to analyze the power consumption trajectory leaked by the XMEGA encryption chip when running 128-bit AES encryption. Each byte is b bits, b = 8, and 100 times are trained for each byte. The key of 128 bits needs to be trained 128 / 8*100 times. The best sub-model is selected from the 100 models for each byte.

[0054] Get n-bit key, each byte is b bits, b = 8, and the sub-key byte Get 128 plaintext, and the HW weight model in step 3 is used for each encryption Make a label data set, set the epoch of the neural network model in claim 5 to 100, and set the batch_size to 128. Train it, select the 90% data set in step S2 to train 16 sub-keys respectively, and select the optimal sub-model according to the following integral ranking method:

[0055]

[0056] Wherein, R(k) represents a rank ranking function, k' represents a sub-key byte, k represents a known true key, K represents a key set, Pr represents a key correct probability, P represents a plaintext, GE represents a guess entropy, and E represents an expectation function.

[0057] The guess entropy (GE) is the expected rank of all possible keys. The guess entropy (GE) provides a useful estimate of the number of candidate keys required for a successful analysis test. If n-bit key k∈K has n-bit sub-key K i Independent recovery, for The bias guess entropy should be used, that is, the guess entropy is separately guessed for each sub-key. Among the 100 models trained for each sub-key, the model with the lowest R(k) value is selected in the case of greater guess entropy value, and these models are mixed together.

[0058] Step 6, using the trained model, test the trajectory of the test set and recover the key information. The remaining 10% of the data set in step 2 is tested using the 16 sub-models selected in step 5, and the test results are obtained. As shown in Figure 3 The test trajectory is shown in the figure, and the rank R(k) of each sub-key test is 0, that is, the budget is correctly guessed.

[0059] In an embodiment of the present application, the present application also includes a computer readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement any of the above-mentioned side channel analysis methods based on the BILSTM and CNN hybrid model.

[0060] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by computer program related hardware. The aforementioned computer program can be stored in a computer readable storage medium. The program executes the steps of the above-mentioned method embodiments when executed; and the aforementioned storage medium includes ROM, RAM, magnetic disc or optical disc and various storage medium that can store program codes.

[0061] A side channel analysis device based on a BILSTM and CNN hybrid model, comprising a processor and a memory; the memory is used to store a computer program; the processor is connected with the memory, and is used to execute the computer program stored in the memory, so that the side channel analysis device based on the BILSTM and CNN hybrid model executes any above-mentioned side channel analysis method based on the BILSTM and CNN hybrid model.

[0062] Specifically, the memory includes ROM, RAM, magnetic disc, U disk, memory card or optical disc and various storage medium that can store program codes.

[0063] Preferably, the processor can be a general processor, including a central processing unit (CPU), a network processor (NP) and the like; and can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component.

[0064] The above-mentioned embodiments further explain the purpose, technical solutions and advantages of the present application. It should be understood that the above-mentioned embodiments are only preferred embodiments of the present application, and are not used to limit the present application. Any modification, equivalent replacement, improvement and the like made to the present application within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims

1. A side channel analysis method based on a BILSTM and CNN hybrid model, characterized in that, The method comprises the following steps: acquiring side channel data information to be detected, and preprocessing the information; inputting the preprocessed data into a side channel analysis model to obtain an analysis result; defending the side channel according to the analysis result; the process of training the side channel analysis model comprises the following steps: S1: acquiring a side channel initial power consumption trajectory data set; S2: analyzing the initial power consumption trajectory data set by using a Pearson correlation coefficient to obtain a new trajectory data set, and preprocessing the new trajectory data set; S3: constructing a leakage model, generating labels according to the leakage model, corresponding the generated labels with data in the preprocessed trajectory data set to obtain a label data set, and dividing the label data set into a training set and a test set; S4: inputting data in the training data set into a side channel analysis model based on a BILSTM and a CNN for multiple times of training to obtain multiple trained side channel analysis models; the structure of the constructed side channel analysis model based on the BILSTM and the CNN comprises an input layer (None, 130, 1), a convolution layer (None, 130, 4), a pooling layer (None, 129, 4), a convolution layer (None, 129, 8), a pooling layer (None, 128, 8), a convolution layer (None, 127, 16), a pooling layer (None, 127, 16), a convolution layer (None, 127, 32), a pooling layer (None, 126, 32), a flattening layer (None, 4032), a RESHAPE layer (None, 1, 0), a BILSTM layer (None, 512), a full connection layer (None, 256), and an output layer (None, 256) connected in sequence; the process of training the side channel analysis model based on the BILSTM and the CNN comprises the following steps: S41: inputting data in the training set into a CNN model to obtain 32-dimensional intermediate data through three convolution layers and three pooling layers; wherein the data in the training set is one-dimensional power consumption data; S42: performing dimension conversion on the intermediate data through a flattening layer and a reshape layer; S43: inputting the data after dimension conversion into a BILSTM layer and a full connection layer for key guessing to obtain 256 key guessing results of the power consumption data; ranking the guessing results according to a rank value, and when the rank value reaches 0, it is determined that the sub-key is successfully guessed, and the training of the model is completed; S5: inputting data in the test set into the trained side channel analysis model for testing to select an optimal side channel analysis model; the expression of the optimal side channel analysis model is as follows: , ; wherein, denotes a rank ranking function, denotes a sub-key byte, k denotes a known true key, denotes a set of sub-keys, denotes a probability of a key being correct, denotes a plaintext, denotes a guessing entropy, denotes an expectation function. 2.The side channel analysis method based on a BILSTM and CNN hybrid model according to claim 1, wherein, the process of acquiring the initial power consumption trajectory data set of the analysis side channel comprises the following steps: setting a side channel power signal collection point; acquiring power consumption trajectory data of the side channel power signal collection point by using a power collection device; and collecting all the power consumption trajectory data to obtain the initial power consumption trajectory data set. 3.The side channel analysis method based on a BILSTM and CNN hybrid model according to claim 1, characterized in that, The process of analyzing the initial power consumption trajectory data set by using Pearson correlation coefficient includes: using Pearson correlation coefficient to obtain the correlation between Hamming weight H and the voltage value V collected by the power collection device, wherein the strongly correlated sample points represent the S-box leakage part; and constructing a new trajectory data set by using the data S-box leakage part trajectory.

4. The side channel analysis method based on a BILSTM and CNN hybrid model according to claim 3, characterized in that, The formula for analyzing the initial power consumption trajectory data by using Pearson correlation coefficient is: ; ; ; wherein, represents a linear correlation between the Hamming weight H and the voltage value V collected by the power harvesting device, represents an algebraic, represents a power consumption value, represents an algebraic, represents a quasi-score, represents a data sample, represents a mean value, represents a standard deviation, represents a covariance.

5. The side channel analysis method based on a hybrid model of BILSTM and CNN according to claim 1, characterized in that, The process of constructing a label according to the leakage model includes: obtaining all initial power consumption trajectories, and defining a label for each power consumption trajectory trace, the expression of the label is: label(tracei)=Sbox(Pik^Kk); wherein Pik represents the plaintext of the kth byte of the ith trace, and Kk represents the key of the kth byte.

6. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by a processor to implement the side channel analysis method based on the BILSTM and CNN hybrid model in any one of claims 1 to 5. 7.A side channel analysis device based on a hybrid model of BILSTM and CNN, characterized in that, The device comprises a processor and a memory; the memory is used for storing a computer program; the processor is connected with the memory and is used for executing the computer program stored in the memory, so that the device executes the side channel analysis method based on the BILSTM and CNN hybrid model in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Side channel analysis method based on deep learning

    CN111565189A

  • Hybrid denoising power consumption analysis method for cryptographic algorithm and terminal

    CN112564884A

  • Combined neural network power load prediction method based on KL divergence evaluation

    CN115099518A