Cross-device side channel analysis method based on variational autoencoder model

By combining the variational autoencoder model and support vector machine, the problem of different side channel curve distributions in cross-device analysis is solved, key recovery and security detection of different devices are achieved, and analysis efficiency is improved.

CN116131973BActive Publication Date: 2025-10-03SHANGHAI JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310124377.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-16
Publication Date
2025-10-03
Estimated Expiration
2043-02-16

AI Technical Summary

Technical Problem

In cross-device analysis scenarios, due to the differences in the statistical distribution of side-channel curves between devices, the leakage model on the modeling device cannot adapt to the target device, resulting in poor analysis results or even loss of capabilities.

Method used

A cross-device side channel analysis method based on the variational autoencoder model is adopted. By constructing a variational autoencoder model consisting of a single encoder and multiple decoders, combined with side channel information collection and support vector machine classification, universal feature extraction and key recovery of side channel curves of different devices are achieved.

Benefits of technology

It realizes the generalized analysis capability among different devices, can effectively recover the keys on the target device, and improves the efficiency of system security detection and information security protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116131973B_ABST
    Figure CN116131973B_ABST
Patent Text Reader

Abstract

A cross-device side channel analysis method based on a variational autoencoder model. In the offline phase, a variational autoencoder model is constructed that includes a single encoder and multiple decoders, and the side channel curves obtained by running the AES algorithm on the acquisition device are used as samples for training. In the online phase, the trained variational autoencoder model is used to analyze the side channel curves obtained after running the AES algorithm on the target device. When the predicted key is the same as the actual key, it is considered that the security of the target device is at risk. The present invention effectively addresses the differences in the distribution of side channel curves between different devices through the variational autoencoder, achieving a universal feature extraction effect for side channel curves from different devices. It can effectively analyze the key of the cryptographic algorithm running on the target device, and achieve the effects of system security detection and information security protection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a technology in the field of information security, specifically a cross-device side channel analysis method based on a variational auto-encoder (VAE) model. Background Art

[0002] In cross-device analysis scenarios, even if the modeling device and the target device are running the same algorithm (such as the Advanced Encryption Standard, AES), the hardware platform running the algorithm, the algorithm's implementation, and the environment in which the side-channel curves are collected may differ. These differences will be reflected in the statistical distribution of the side-channel curves collected from the modeling device and the target device. Due to the differences in the statistical distribution of the side-channel curves generated by different devices, the leakage model built on the modeling device cannot adapt to the different distribution of side-channel curves on the target device, resulting in poor analysis results or even complete loss of analysis capabilities. Summary of the Invention

[0003] In view of the fact that the existing technology does not have the generalization ability, cannot process curves from different devices, and cannot solve the shortcomings of cross-device analysis, the present invention proposes a cross-device side channel analysis method based on the variational autoencoder model. The variational autoencoder effectively copes with the distribution differences of side channel curves between different devices, achieves the universal feature extraction effect of side channel curves from different devices, can effectively analyze the key of the cryptographic algorithm running on the target device, and realizes the effect of system security detection and information security protection.

[0004] The present invention is achieved through the following technical solutions:

[0005] The present invention relates to a cross-device side channel analysis method based on a variational autoencoder model. In the offline stage, a variational autoencoder model including a single encoder and multiple decoders is constructed, and side channel curves obtained by running the AES algorithm on a collection device are used as samples for training. In the online stage, the side channel curves obtained by running the AES algorithm on a target device are analyzed using the trained variational autoencoder model. When the predicted key is the same as the actual key, it is considered that the security of the target device is at risk.

[0006] The sample refers to: running the AES algorithm on N modeling devices respectively by randomizing the plaintext and key, and using the side channel information acquisition circuit to obtain the side channel curve t corresponding to the N devices, the plaintext m corresponding to each curve, and the key k.

[0007] The side-channel curve described here refers to the collection and quantification of power consumption or electromagnetic radiation side-channel information generated by a physical device when running a cryptographic algorithm. Collecting power consumption requires analysts to measure the voltage or current of specific components on the physical device. Quantifying electromagnetic radiation requires analysts to place electromagnetic probes around specific components of the physical device and collect the electromagnetic radiation emitted by them. The quantification process requires an oscilloscope or quantization circuit to sample the collected voltage or current information to form a side-channel curve.

[0008] The cryptographic algorithm execution parameter information refers to the input and output of the cryptographic algorithm. In the modeling and analysis scenario, the parameter information available during the modeling phase includes the input plaintext, input key, output ciphertext, and other possible input and output information. The parameters available during the analysis phase include all other parameter information except the key.

[0009] The present invention relates to a system for implementing the above-mentioned analysis method, comprising: a cross-device side information curve acquisition module and a side channel curve analysis module, wherein: the cross-device side information acquisition module collects side channel curves and cryptographic algorithm operating parameters of different devices; the side channel information analysis module extracts latent space features from the operating parameters based on a variational autoencoder model, obtains leakage labels and their corresponding candidate keys through support vector machine classification, and realizes security assessment by calculating the change in guessed entropy.

[0010] Technical Effects

[0011] This paper applies the variational autoencoder model to side-channel analysis, employing a single-encoder, multi-decoder variational autoencoder model and applying a support vector machine to the latent space classification of this model. Compared to existing technologies, this method enables the leakage model established during the modeling phase to generalize analysis capabilities, enabling direct processing of unknown target device curves and recovering cryptographic keys. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 It is a schematic diagram of the present invention;

[0013] Figure 2 Schematic diagram of the single-encoder and multi-decoder variational autoencoder model of the present invention.

[0014] Figure 3 This is a schematic diagram of the application scenario of this embodiment. DETAILED DESCRIPTION

[0015] In this embodiment, for N modeling devices, the curve set collected on the i-th modeling device is T i , T i Contains several curves t∈T i , taking the analysis of the key of the unprotected AES block encryption algorithm as an example.

[0016] like Figure 1 As shown, this embodiment relates to a cross-device side channel analysis method based on a variational autoencoder model, including:

[0017] Step 1) Run the AES algorithm on each of the N modeling devices by randomizing the plaintext and key, and use the side channel information acquisition circuit to obtain the side channel curve t corresponding to the N devices and the plaintext m and key k corresponding to each curve during operation.

[0018] The side channel information acquisition circuit includes but is not limited to an electromagnetic probe, an oscilloscope, etc.

[0019] The modeling device refers to: a device used to establish a leakage model in the offline phase, and correspondingly a device used to perform key recovery in the online phase, ie, a target device.

[0020] Step 2) Calculate the leakage label of each side channel curve t Each curve is preprocessed to improve the signal-to-noise ratio of the leaked label and reduce the dimension of the curve, where SBOX is the S-box lookup table used in the AES algorithm, and HW(·) is the Hamming weight of the input.

[0021] The preprocessing includes but is not limited to: normalization, selecting the part of the curve that is most relevant to the S-box operation, etc.

[0022] Step 3) Using the side channel curve obtained in step 2 as a sample, train a variational autoencoder model including a single encoder and multiple decoders.

[0023] like Figure 2 As shown, the variational autoencoder model includes: an encoder model and multiple decoder models, wherein: the encoder model extracts features of the modeling device and the target device, and each modeling device corresponds to a separate decoder model. During training, the latent space features of the curve from a certain modeling device are input into the corresponding decoder model for reconstruction, and the weight parameters of the model are updated through the calculated loss function. A single encoder model extracts unified latent space features from side channel curves with different distributions, and the decoder model maps the unified latent space features to the curve distribution of each modeling device. This single encoder and multiple decoder model structure enables the trained encoder model to have universal feature extraction capabilities for curves with different distributions.

[0024] The latent space features described above are low-dimensional features that conform to a Gaussian distribution, mapped using an encoder model. The encoder model maps each curve to a multivariate Gaussian distribution with mean μ and variance σ. The latent space features are then sampled from this Gaussian distribution. The sampling process involves generating a random number γ with mean 0 and variance 1, and calculating z = μ + γσ. This proves that z conforms to a multivariate Gaussian distribution with mean μ and variance σ. The resulting z is the latent space feature of the input side channel curve.

[0025] The support vector machine classifier maps the data to be classified into a high-dimensional space and finds a hyperplane in the high-dimensional space, so that the data to be classified is located on both sides of the hyperplane as much as possible; the support vector machine classifier trains a binary classification support vector machine for each two categories, and integrates the prediction results of each classifier during prediction to obtain the final multi-classification result.

[0026] The step 3 specifically includes:

[0027] 3.1) Input the side channel curve t from the i-th device into the encoder φ to obtain the Gaussian distribution parameter μ followed by the latent space distribution t and σ t , and sample to obtain the latent space feature z t .

[0028] 3.2) The latent space feature z t Input the i-th decoder ψ i , get the reconstruction curve of the corresponding input side channel curve t

[0029] 3.3) Calculating the loss function Where: KL(·) is the KL divergence of the input Gaussian distribution from the standard normal distribution with mean 0 and variance 1, means The reconstruction deviation from t, measured in L2 norm.

[0030] 3.4) Train the variational autoencoder model based on the calculated loss function, and update the decoder ψ based on the gradient calculated by backpropagation of the loss function. i The weight parameters in , and then update the weight parameters of the encoder φ.

[0031] The backpropagation method is a neural network training method that calculates and updates the gradient of each layer of neuron nodes in the neural network according to the value of the loss function corresponding to the input of a certain batch of neural networks. When the value of the loss function meets the convergence condition, the training of the neural network is considered to be completed.

[0032] 3.5) Repeat training steps 3.1) to 3.4) until all samples are traversed.

[0033] Step 4) Use the trained encoder φ to extract features from all curves t collected in step 1) and extract the latent space features z t .

[0034] Step 5) Use the latent space feature z corresponding to curve t t and leaked tags t The support vector machine classifier is trained, and the kernel function of the support vector machine is selected as RBF during training.

[0035] The leakage label refers to sensitive data derived from cryptographic algorithm runtime parameters that can significantly affect the distribution of certain points on the curve. For standard AES encryption implementations, the commonly used leakage label is the Hamming weight of the first-round S-box output. In the online phase, the leakage label can be directly calculated using the key and plaintext. In the offline phase, the key is calculated using the predicted leakage label and plaintext on the target device.

[0036] Step 6) In the online phase, a fixed key k is used on the target device with the same AES program. * , randomize the plaintext m′ and collect the corresponding side channel curve t′, input t′ into the encoder φ, and obtain the latent space feature z t′ , z t′ Input the trained support vector machine model to obtain the predicted leakage label l t′ And create an all-zero array v

[256] of length 256.

[0037] Step 7) Use the predicted leakage label l t′ And the corresponding plaintext m′, according to Get candidate k * For each candidate k * Take the value k so that the value of v[k] increases by 1.

[0038] Step 8) Repeat step 7) until all the side channel curves collected on the target device are used up, and the correct key k is calculated based on the array v * The guess entropy changes as the number of target curves increases.

[0039] The guess entropy refers to the probability of the correct key among all guessed keys in descending order when the target number curve is determined. The lower the rank, the better the performance. In this embodiment, N G The number of side channel curves used to reduce the guessed entropy to zero is defined as the number of curves required to recover the key with 100% probability.

[0040] In a specific experiment, the analysis targets the tinyAES implementation on eight XMEGA 8-bit microcontrollers. Side channel curves were collected to measure chip power consumption at a sampling rate of 20 GS / s and a sampling precision of 16. 1000 side channel curves were collected for each device, each with a dimension of 500. Under this experimental setup, a variational autoencoder and support vector machine model were trained with hyperparameters of 6 fully connected layers, 120 training epochs, 40 latent space dimensions, and 7 decoders. The curves were trained on seven of the eight devices, with 1000 curves from the target device reserved for online analysis. The experiments were conducted using the aforementioned method, with modeling performed on seven devices and analysis performed on the remaining device. The results are shown in Table 1.

[0041] Table 1

[0042]

[0043] Compared with the existing technology, this method can fully recover k by introducing the autoencoder model, the single encoder and multiple decoder model structure and the latent space classification strategy based on the support vector machine. * The number of curves required, and thus the guess entropy, is significantly reduced, making it suitable for chip side-channel security assessment in cross-device analysis scenarios. This method only requires a small number of devices to establish a universal leakage model to analyze all devices, eliminating the need for device-by-device modeling and evaluation. This reduces the workload for analysts and improves analysis efficiency.

[0044] The above-mentioned specific implementation can be partially adjusted in different ways by those skilled in the art without departing from the principles and purpose of the present invention. The scope of protection of the present invention shall be based on the claims and shall not be limited by the above-mentioned specific implementation. All implementation schemes within its scope shall be subject to the constraints of the present invention.

Claims

1. A cross-device side channel analysis method based on a variational autoencoder model, characterized in that: In the offline phase, a variational autoencoder model consisting of a single encoder and multiple decoders is constructed, and the side channel curves obtained by running the AES algorithm on the acquisition device are used as samples for training. In the online phase, the trained variational autoencoder model is used to analyze the side channel curves obtained by running the AES algorithm on the target device. If the predicted key is the same as the actual key, the security of the target device is considered to be at risk. Specifically, the following factors are considered: Step 1) Each modeling device runs the AES algorithm by randomizing the plaintext and key, and uses the side channel information collection circuit to obtain The side channel curve t corresponding to each device and the plaintext corresponding to each curve and key ; Step 2) Calculate each side channel curve Leaked tags Each curve is preprocessed to improve the signal-to-noise ratio of the leaked label and reduce the dimension of the curve, where SBOX is the S-box lookup table used in the AES algorithm, is to take the Hamming weight of the input; Step 3) Using the side channel curve obtained in step 2 as a sample, train a variational autoencoder model including a single encoder and multiple decoders, specifically including: 3.1) From Side channel profiles for each device Input encoder , we get the Gaussian distribution parameters followed by the latent space distribution and , and sample to obtain latent space features ; 3.2) The latent space features Enter decoders , get the side channel curve corresponding to the input The reconstruction curve ; 3.3) Calculating the loss function ,in: is the KL divergence of the input Gaussian distribution from the standard normal distribution with mean 0 and variance 1, means and The reconstruction bias of , measured in L2 norm; 3.4) Train the variational autoencoder model based on the calculated loss function, and update the decoder first based on the gradient calculated by backpropagation of the loss function The weight parameters in , and then update the encoder The weight parameter of 3.5) Repeat training steps 3.1) to 3.4) until all samples are traversed; Step 4) Use the trained encoder For all curves collected in step 1 Perform feature extraction to extract latent space features ; Step 5) Use Curves Corresponding latent space features and leaked tags Train the support vector machine classifier, and choose RBF as the kernel function of the support vector machine during training; Step 6) During the online phase, use the fixed key on the target device with the same AES program , randomized plaintext And collect the corresponding side channel curve ,Will Input encoder In the latent space feature ,Will Input the trained support vector machine model to obtain the predicted leakage label And create an all-zero array of length 256 ; Step 7) Use the predicted leak labels and the corresponding plaintext , according to the leaked label Obtain candidate keys For each candidate Value , making The value of is increased by 1; Step 8) Repeat step 7) until all the side channel curves collected on the target device are used up, according to the array Calculate the correct key The guess entropy changes as the number of target curves increases.

2. The cross-device side channel analysis method based on the variational autoencoder model according to claim 1 is characterized in that: The sample mentioned is: On each modeling device, the AES algorithm is run separately by randomizing the plaintext and key, and the side channel information acquisition circuit is used to obtain The side channel curve t corresponding to each device and the plaintext corresponding to each curve and key .

3. The cross-device side channel analysis method based on the variational autoencoder model according to claim 1 or 2, characterized in that: The variational autoencoder model includes: an encoder model and multiple decoder models, wherein: the encoder model extracts features of the modeling device and the target device, and each modeling device corresponds to a separate decoder model; during training, the latent space features of the curve from a certain modeling device are input into the corresponding decoder model for reconstruction, and the weight parameters of the model are updated through the calculated loss function; the decoder model maps the unified latent space features to the curve distribution of each modeling device; The latent space feature is to use the encoder model to map the side channel curve to a low-dimensional feature that conforms to the Gaussian distribution. The encoder model maps each curve to a mean of , the variance is The multivariate Gaussian distribution is then used to obtain latent space features by sampling in this Gaussian distribution.

4. The cross-device side channel analysis method based on the variational autoencoder model according to claim 3 is characterized in that: The sampling mentioned above refers to generating a random number with a mean of 0 and a variance of 1. ,calculate , it can be proved that The mean is , the variance is The multivariate Gaussian distribution of It is the latent space feature of the input side channel curve.

5. The cross-device side channel analysis method based on the variational autoencoder model according to claim 1 is characterized in that: The leaked label refers to the Hamming weight of the first round S-box output.

6. The cross-device side channel analysis method based on the variational autoencoder model according to claim 1 is characterized in that: The support vector machine classifier maps the data to be classified into a high-dimensional space and finds a hyperplane in the high-dimensional space so that the data to be classified are located on both sides of the hyperplane; the support vector machine classifier trains a binary classification support vector machine for each two categories, and integrates the prediction results of each classifier during prediction to obtain the final multi-classification result.

7. A system for implementing the cross-device side channel analysis method based on a variational autoencoder model as described in any one of claims 1-6, characterized in that: include: Cross-device side information curve collection module and side channel curve analysis module, wherein: the cross-device side information collection module collects side channel curves and cryptographic algorithm operating parameters of different devices; The side channel information analysis module extracts latent space features from operating parameters based on the variational autoencoder model, obtains leakage labels and their corresponding candidate keys through support vector machine classification, and realizes security assessment by calculating the change in guessed entropy.

Citation Information

Patent Citations

  • A password attack evaluation method based on conditional variational self-coding

    CN109670303A

  • Side channel analysis method and device, equipment, and storage medium

    CN112615714A