CN117081722A - Method and device for constructing side channel attack model, and side channel attack method and device - Google Patents

Method and device for constructing side channel attack model, and side channel attack method and device Download PDF

Info

Publication number
CN117081722A
CN117081722A CN202310980683.0A CN202310980683A CN117081722A CN 117081722 A CN117081722 A CN 117081722A CN 202310980683 A CN202310980683 A CN 202310980683A CN 117081722 A CN117081722 A CN 117081722A
Authority
CN
China
Prior art keywords
cnn
model
layer
training
side channel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310980683.0A
Other languages
Chinese (zh)
Inventor
张大华
朱亚运
张晓娟
蔺子卿
胡柏吉
曹靖怡
张亮
方圆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Corp of China SGCC
China Electric Power Research Institute Co Ltd CEPRI
State Grid Anhui Electric Power Co Ltd
Chuzhou Power Supply Co of State Grid Anhui Electric Power Co Ltd
Information and Telecommunication Branch of State Grid Anhui Electric Power Co Ltd
Original Assignee
State Grid Corp of China SGCC
China Electric Power Research Institute Co Ltd CEPRI
State Grid Anhui Electric Power Co Ltd
Chuzhou Power Supply Co of State Grid Anhui Electric Power Co Ltd
Information and Telecommunication Branch of State Grid Anhui Electric Power Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by State Grid Corp of China SGCC, China Electric Power Research Institute Co Ltd CEPRI, State Grid Anhui Electric Power Co Ltd, Chuzhou Power Supply Co of State Grid Anhui Electric Power Co Ltd, Information and Telecommunication Branch of State Grid Anhui Electric Power Co Ltd filed Critical State Grid Corp of China SGCC
Priority to CN202310980683.0A priority Critical patent/CN117081722A/en
Publication of CN117081722A publication Critical patent/CN117081722A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/002Countermeasures against attacks on cryptographic mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/002Countermeasures against attacks on cryptographic mechanisms
    • H04L9/003Countermeasures against attacks on cryptographic mechanisms for power analysis, e.g. differential power analysis [DPA] or simple power analysis [SPA]

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

A method and device for constructing a side channel attack model, a side channel attack method and device, the method for constructing the side channel attack model comprises: constructing a CNN-transducer model fused by a convolutional neural network CNN and a transducer encoder; setting initial parameters of a CNN-converter model to obtain a CNN-converter initial model, and training the CNN-converter initial model by training data to obtain a CNN-converter final model. The method and the device provided by the embodiment of the invention provide a side channel attack model with higher attack efficiency for constructing a novel power system, and provide assistance for improving the side channel attack verification technology.

Description

Method and device for constructing side channel attack model, and side channel attack method and device
Technical Field
The invention relates to the technical field of side channel attack, in particular to a method and a device for constructing a side channel attack model, and a side channel attack method and a side channel attack device.
Background
With the advent of the information age, intelligent devices composed of encryption devices in new power systems are becoming more and more popular. These devices offer more convenience and comfort to people's life, but at the same time face the threat of the cryptographic algorithm being attacked. With the greatest threat coming from side channel attacks. Unlike mathematical analysis type attacks, side channel attacks capture physical information related to a key by using an instrument, such as power consumption, radiation electromagnetic radiation or calculation time, and the effectiveness of the attack is far higher than that of the mathematical analysis type attack of the cryptanalysis, so that the attack poses a serious threat to the cryptodevice.
Disclosure of Invention
In view of the above, the invention provides a method and a device for constructing a side channel attack model, and a side channel attack method and a side channel attack device, which can realize side channel attack modeling simulation of a novel power system and provide assistance for a side channel attack verification technology.
In a first aspect, an embodiment of the present invention provides a method for constructing a side channel attack model, including: constructing a CNN-transducer model fused by a convolutional neural network CNN and a transducer encoder; setting initial parameters of a CNN-converter model to obtain a CNN-converter initial model, and training the CNN-converter initial model by training data to obtain a CNN-converter final model; wherein each piece of training data comprises a plaintext, a secret key, a power consumption trace and a label.
Further, the convolutional neural network CNN includes a first input layer, a convolutional layer, and a pooling layer, which are sequentially connected.
Further, the transducer encoder comprises a second input layer, a position coding layer, a multi-head attention mechanism layer, a first residual error connection and normalization layer, a feedforward neural network layer and a second residual error connection and normalization layer which are connected in sequence;
the second input layer is used for mapping input data into d-dimensional vectors and outputting the d-dimensional vectors;
the position coding layer is used for generating position codes, injecting the position codes into output data of the second input layer, obtaining coded data and outputting the coded data;
the multi-head attention mechanism layer is used for converting output data of the position coding layer into a Query matrix Q, a Key matrix K and a Value matrix V, linearly transforming the Query matrix Q, the Key matrix K and the Value matrix V for a plurality of times, splicing different self-attention outputs, linearly transforming again and outputting the spliced self-attention outputs;
the first residual connection and normalization layer is used for adding the output data of the multi-head attention mechanism layer and the input data of the multi-head attention mechanism layer, then carrying out normalization processing, and outputting the normalized data;
the feedforward neural network layer is used for carrying out nonlinear conversion on the output data of the first residual connection and the normalization layer and then outputting the output data;
and the second residual is connected with the normalization layer and is used for carrying out normalization processing after adding the output data of the feedforward neural network layer and the input data of the feedforward neural network layer, and outputting the normalized data.
Further, the position codes are calculated by using sine and cosine functions of different frequencies.
Further, training the CNN-transducer initial model with training data includes: and outputting an output value of the S box look-up table by inputting a voltage change value when the S box looks-up table, and training the CNN-converter initial model.
Further, the training data comprises a training set and a testing set, and is obtained in advance through the following modes: under the condition of a fixed key and a random plaintext, collecting a plurality of power consumption traces to serve as a training set, and under the condition of a random key, collecting a plurality of power consumption traces to serve as a testing set; and correspondingly setting labels of each power consumption trace according to key values of each power consumption trace in the training set and the testing set.
In a second aspect, an embodiment of the present invention further provides a side channel attack method, including: performing encryption operation by adopting any plaintext and key combination, and collecting power consumption information in the encryption process; and inputting the acquired power consumption information in the encryption process into a CNN-converter model constructed by adopting the method provided by each embodiment, and acquiring key information in the encryption process.
In a third aspect, an embodiment of the present invention further provides an apparatus for constructing a side channel attack model, including: the construction unit is used for constructing a CNN-transducer model fused by the convolutional neural network CNN and the transducer encoder; the training unit is used for setting initial parameters of the CNN-converter model to obtain a CNN-converter initial model, and training the CNN-converter initial model by training data to obtain a CNN-converter final model; wherein each piece of training data comprises a plaintext, a secret key, a power consumption trace and a label.
In a fourth aspect, an embodiment of the present invention further provides a side channel attack apparatus, including: the acquisition unit is used for executing encryption operation by adopting any plaintext and key combination and acquiring power consumption information in the encryption process; and the attack unit is used for inputting the acquired power consumption information in the encryption process into the CNN-converter model constructed by adopting the method provided by each embodiment to acquire the key information in the encryption process.
In a fifth aspect, embodiments of the present invention further provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method provided by the above embodiments.
In a sixth aspect, an embodiment of the present invention further provides an electronic device, including: a processor; a memory for storing the processor-executable instructions; the processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the methods provided in the foregoing embodiments.
According to the method and device for constructing the side channel attack model, the side channel attack method and device, the CNN-transducer model fused by the convolutional neural network CNN and the transducer encoder is constructed, initial parameters of the CNN-transducer model are set to obtain the CNN-transducer initial model, training data are adopted to train the CNN-transducer initial model to obtain a CNN-transducer final model, and the CNN-transducer model is obtained by fusion of the CNN-transducer model and the CNN-transducer model, because the CNN is good in learning local characteristics and the CNN-transducer model is good in learning global characteristics, the accuracy is improved, the convergence speed is higher, the generalization capacity is better, and therefore the side channel attack model with higher attack efficiency is provided.
Drawings
FIG. 1 illustrates an exemplary flow chart of a method of constructing a side channel attack model according to an embodiment of the present invention;
fig. 2 shows a network architecture diagram of a convolutional neural network CNN according to an embodiment of the present invention;
FIGS. 3a and 3b are diagrams illustrating network structures of a transducer, multi-head attention mechanism, respectively, according to embodiments of the present invention;
FIGS. 4a and 4b are graphs showing data alignment of three models LSTM, CNN and CNN-converter at accuracy and loss values, respectively, according to an embodiment of the present invention;
FIG. 5 illustrates an exemplary flow chart of a side channel attack method according to an embodiment of the invention;
FIG. 6 is a schematic structural diagram of an apparatus for constructing a side channel attack model according to an embodiment of the present invention;
fig. 7 shows a schematic structural diagram of a side channel attack apparatus according to an embodiment of the present invention.
Detailed Description
The exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, however, the present invention may be embodied in many different forms and is not limited to the examples described herein, which are provided to fully and completely disclose the present invention and fully convey the scope of the invention to those skilled in the art. The terminology used in the exemplary embodiments illustrated in the accompanying drawings is not intended to be limiting of the invention. In the drawings, like elements/components are referred to by like reference numerals.
Unless otherwise indicated, terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. In addition, it will be understood that terms defined in commonly used dictionaries should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and will not be interpreted in an idealized or overly formal sense.
Fig. 1 shows an exemplary flow chart of a method of constructing a side channel attack model according to an embodiment of the present invention.
As shown in fig. 1, the method includes:
step S101: and constructing a CNN-transducer model fused with a transducer encoder by the convolutional neural network CNN.
Further, the convolutional neural network CNN includes a first input layer, a convolutional layer, and a pooling layer, which are sequentially connected.
Further, the transducer encoder comprises a second input layer, a position coding layer, a multi-head attention mechanism layer, a first residual error connection and normalization layer, a feedforward neural network layer and a second residual error connection and normalization layer which are connected in sequence;
the second input layer is used for mapping input data into d-dimensional vectors and outputting the d-dimensional vectors;
the position coding layer is used for generating position codes, injecting the position codes into output data of the second input layer, obtaining coded data and outputting the coded data;
the multi-head attention mechanism layer is used for converting output data of the position coding layer into a Query matrix Q, a Key matrix K and a Value matrix V, linearly transforming the Query matrix Q, the Key matrix K and the Value matrix V for a plurality of times, splicing different self-attention outputs, linearly transforming again and outputting;
the first residual connection and normalization layer is used for adding the output data of the multi-head attention mechanism layer and the input data of the multi-head attention mechanism layer, then carrying out normalization processing, and outputting the normalized data;
further, the feedforward neural network layer is used for carrying out nonlinear conversion on the output data of the first residual connection and the normalization layer and then outputting the output data;
further, the second residual connection and normalization layer is used for adding the output data of the feedforward neural network layer and the input data of the feedforward neural network layer, performing normalization processing, and outputting the normalized data.
Further, the position codes are calculated by using sine and cosine functions of different frequencies.
Specifically, a CNN-transducer model is constructed by fusing a convolutional neural network CNN with a transducer encoder, and the CNN model and the transducer encoder can be respectively built.
(1) Establishing CNN model
Fig. 2 shows a network structure schematic diagram of a convolutional neural network CNN according to an embodiment of the present invention. As shown in FIG. 2, the convolution layer and the pooling layer constitute the main structure of the one-dimensional CNN, as shown in formula (1), wherein h i Is a feature extracted by the ith layer convolution, x i Is the input data of the layer i convolution, sigma is the activation function,is a convolution operation, ω i And b i Is a convolution kernel weight matrix and a bias vector.
(2) Creating a transducer encoder
Fig. 3a shows a network structure of a transducer according to an embodiment of the present invention. As shown in fig. 3a, the encoder of the transducer includes an input layer, position coding, multi-head attention mechanism, feed forward neural network, and residual connection and layer normalization (Add&Norm). The input layer maps the input data into d-dimensional vectorsThe position codes are injected into the input sequence position information, and the position codes are calculated by using sine and cosine functions with different frequencies, as shown in formulas (2) - (3), wherein p represents the position, and i represents the dimension. After the position encoding is calculated, it is added to the input embedded vector, and the position information is merged into the input representation. The model can learn the order and positional relationship in the input sequence in the self-attention mechanism.
Fig. 3b shows a network architecture diagram of a multi-headed attention mechanism according to an embodiment of the present invention. As shown in fig. 3b, the Query matrix Q, key matrix K, and Value matrix V are linearly transformed multiple times, and different self-attention outputs are spliced and linearly transformed to obtain the multi-head attention output of the transducer.
The multi-head attention mechanism is shown in formulas (4) - (5). Wherein Z is an embedded vector matrix of the input sequence, each row representing an embedded vector of one position, W Q Is a linear transformation parameter matrix of the query vector. Matrix multiplication, which means that a linear transformation is applied to an embedded vector matrix Z of the input sequence, resulting in a query vector matrix Q, where each row represents a query vector for one location. Thus, for each position of the input sequence, a corresponding query vector is obtained for calculating the self-attention weight and performing subsequent self-attention calculations. The attention mechanism is to convert the input data with position code into a Query matrix Q, a Key matrix K, a Value matrix V, calculate the dot product of Q and K to obtain an associated matrix, and divide the result of the dot product of Q and K by the division to prevent the larger result of the dot product of Q and KWherein->The dimensions representing the query and the key (usually equal to the dimensions of the hidden layer) are determined by dividing by +.>The numerical range of the dot product result can be scaled to avoid the result of the dot product being too large.
The SoftMax function normalizes the signals to make the sum of the positive numbers equal to 1, and the attention score of the corresponding position is obtained. The SoftMax function is to compress the k-dimensional vector into another k-dimensional vector such that each element ranges at (0, 1) and the sum of the elements is 1, x is shown in equation (6) i Is the i-th dimension vector. The input attention score is multiplied by V to yield an output of self-attention.
Feedforward neural networks are used in a transducer model to non-linearly convert the output of the self-attention mechanism. In the transducer encoder, a feedforward neural network is part of each sub-layer, immediately following the multi-headed self-attention mechanism. It consists of two fully connected layers, commonly referred to as feedforward layers or as feedforward neural network layers. The feed-forward neural network processes the self-attention representation to obtain a non-linearly transformed representation.
The first residual connection and normalization layer and the second residual connection and normalization layer both comprise residual connection and layer normalization, which are specifically as follows:
the residual connection is used in the transducer model to process the output data of the sub-modules and add the original input to the output of the sub-modules. At the end of each sub-module, such as a multi-headed self-attention mechanism and a feed forward neural network, the residual connection sums the output of the sub-module with the original input.
Layer normalization is a regularization technique used in neural networks to normalize the output of sub-modules in a transducer model. In each sub-module of the encoder, including the multi-headed self-attention mechanism and the feed-forward neural network, a layer normalization operation is applied after the self-attention representation or the feed-forward network output is calculated. The purpose of the layer normalization is to normalize the output of each sub-module to stabilize the training process and speed up convergence.
Step S102: setting initial parameters of a CNN-converter model to obtain a CNN-converter initial model, and training the CNN-converter initial model by training data to obtain a CNN-converter final model; wherein each piece of training data comprises a plaintext, a secret key, a power consumption trace and a label.
Further, training the CNN-transducer initial model with training data includes:
and outputting an output value of the S box look-up table by inputting a voltage change value when the S box looks-up table, and training the CNN-converter initial model.
Further, the training data comprises a training set and a testing set, and is obtained in advance through the following modes:
under the condition of a fixed key and a random plaintext, collecting a plurality of power consumption traces to serve as a training set, and under the condition of a random key, collecting a plurality of power consumption traces to serve as a testing set;
and correspondingly setting labels of each power consumption trace according to key values of each power consumption trace in the training set and the testing set.
Specifically, in the process of modeling, an attacker needs to collect 60000 trace pieces of training data as a training set X profliling ,,X profliing ∈(1,N p ) And test set Y attack ,Y attack ∈(1,N a ) Wherein N is P And N a Representing the maximum number of training sets and test sets. The training data comprises plaintext, key, power consumption trace, and label, wherein the input of the model during training is voltage change value v during S-box table look-up i The output is the output value y of the S box look-up table i ,v i And y is i One-to-one correspondence, denoted as { v ] i ,y i },i∈(1,N p ) The input of the model in test is the voltage change value v in S-box table look-up i The output is the output value y of the S box look-up table i ,v i And y is i One-to-one correspondence, denoted as { v ] i ,y i },i∈(1,N a )。
In the embodiment of the invention, 60000 power consumption tracks are acquired under a fixed key and random plaintext for training, and are recorded as N P 10000 power consumption strips are collected under the random keyTrace-for-model attack, denoted N a . The first round of AES encryption process was complete, consisting of 16S boxes, 1600 points per power trace.
An attacker gathers a sufficient number of power consuming traces and assigns an appropriate tag to each trace to model the relationship between physical leakage and key. The attacker then trains the data by setting appropriate machine learning model parameters. The data set can be an experimental sample, and the label is directly set to be a corresponding key value by adopting an explicit label mark, so that the key value can be accurately controlled and observed.
According to the embodiment, the CNN-transducer model fused by the convolutional neural network CNN and the transducer encoder is constructed, initial parameters of the CNN-transducer model are set to obtain the CNN-transducer initial model, training data is adopted to train the CNN-transducer initial model to obtain the CNN-transducer final model, and the CNN-transducer model is improved in accuracy and has higher convergence speed and better generalization capability due to the fact that the CNN is good in learning local features and the transducer is good in learning global features, so that a side channel attack model with higher attack efficiency is provided, the model can be used for simulating side channel attack, help is provided for a side channel attack verification technology, and further the side channel attack oriented to a novel power system is prevented better.
Example 1
The data set used in the embodiment of the invention consists of power consumption time sequence data, and the model constructed by the embodiment of the invention is adopted for model training and testing, and LSTM and CNN are compared at the same time. Fig. 4a and fig. 4b show data comparison graphs of LSTM, CNN and CNN-transducer three models in terms of accuracy and loss value, respectively, according to an embodiment of the present invention. As shown in fig. 4a and fig. 4b, it can be clearly seen that the CNN-transducer model provided by the embodiment of the present invention has a faster convergence speed and a stronger generalization capability compared with LSTM and CNN. In addition, under the same training round, the accuracy of the CNN-transducer model is obviously higher than that of LSTM and CNN, and the accuracy in the network training process does not have large fluctuation, and the performance is very stable. On the verification set, the accuracy of the final training set of the CNN-transducer model is up to 99.88%, and the accuracy of the verification set is up to 99.76%.
In conclusion, the CNN-converter model provided by the embodiment of the invention has excellent performance and remarkable advantages. Compared with the traditional LSTM and CNN models, the method has the advantages of improving accuracy, and having faster convergence speed and better generalization capability. These results indicate that the model provided by the embodiment of the invention has great potential and may achieve better performance in practical application.
Fig. 5 shows an exemplary flow chart of a side channel attack method according to an embodiment of the invention.
As shown in fig. 5, the method includes:
step S501: performing encryption operation by adopting any plaintext and key combination, and collecting power consumption information in the encryption process;
step S502: and inputting the acquired power consumption information in the encryption process into a CNN-converter model constructed by adopting the method provided by each embodiment, and acquiring key information in the encryption process.
Once model training is complete, an attacker can perform encryption operations on any plaintext and key combination and collect power consumption information during encryption. The attacker may then enter power consumption information into a trained model to break the key used in the present encryption process.
According to the embodiment, the acquired power consumption information in the encryption process is input into the novel power system side channel attack model constructed by the method provided by the embodiment so as to realize cracking encryption, a side channel attack method with higher attack efficiency for the novel power system is provided, and assistance is provided for improving the side channel attack verification technology.
Fig. 6 shows a schematic structural diagram of an apparatus for constructing a side channel attack model according to an embodiment of the present invention.
As shown in fig. 6, the apparatus includes:
the construction unit 601 is configured to construct a CNN-transducer model fused by a convolutional neural network CNN and a transducer encoder;
the training unit 602 is configured to set initial parameters of the CNN-transporter model to obtain a CNN-transporter initial model, and train the CNN-transporter initial model with training data to obtain a CNN-transporter final model; wherein each piece of training data comprises a plaintext, a secret key, a power consumption trace and a label.
Further, the convolutional neural network CNN includes a first input layer, a convolutional layer, and a pooling layer, which are sequentially connected.
Further, the transducer encoder comprises a second input layer, a position coding layer, a multi-head attention mechanism layer, a first residual error connection and normalization layer, a feedforward neural network layer and a second residual error connection and normalization layer which are connected in sequence;
the second input layer is used for mapping input data into d-dimensional vectors and outputting the d-dimensional vectors;
the position coding layer is used for generating position codes, injecting the position codes into the data processed by the second input layer, obtaining coded data and outputting the coded data;
the multi-head attention mechanism layer is used for converting output data of the position coding layer into a Query matrix Q, a Key matrix K and a Value matrix V, linearly transforming the Query matrix Q, the Key matrix K and the Value matrix V for a plurality of times, splicing different self-attention outputs, linearly transforming again and outputting;
the first residual connection and normalization layer is used for adding the output data of the multi-head attention mechanism layer and the input data of the multi-head attention mechanism layer, then carrying out normalization processing, and outputting the normalized data;
the feedforward neural network layer is used for carrying out nonlinear conversion on the output data of the first residual connection and the normalization layer and then outputting the output data;
the second residual connection and normalization layer is used for adding the output data of the feedforward neural network layer and the input data of the feedforward neural network layer, performing normalization processing, and outputting the normalized data.
Further, the position codes are calculated by using sine and cosine functions of different frequencies.
Further, training the CNN-transducer initial model with training data includes:
and outputting an output value of the S box look-up table by inputting a voltage change value when the S box looks-up table, and training the CNN-converter initial model.
Further, the training data comprises a training set and a testing set, and is obtained in advance through the following modes:
under the condition of a fixed key and a random plaintext, collecting a plurality of power consumption traces to serve as a training set, and under the condition of a random key, collecting a plurality of power consumption traces to serve as a testing set;
and correspondingly setting labels of each power consumption trace according to key values of each power consumption trace in the training set and the testing set.
According to the embodiment, the CNN-transducer model fused by the convolutional neural network CNN and the transducer encoder is constructed, initial parameters of the CNN-transducer model are set to obtain the CNN-transducer initial model, training data is adopted to train the CNN-transducer initial model to obtain the CNN-transducer final model, and the CNN-transducer model is improved in accuracy and has higher convergence speed and better generalization capability due to the fact that the CNN is good in learning local features and the transducer is good in learning global features, so that a side channel attack model with higher attack efficiency is provided, the model can be used for simulating side channel attack, help is provided for a side channel attack verification technology, and further the side channel attack oriented to a novel power system is prevented better.
Fig. 7 shows a schematic structural diagram of a side channel attack apparatus according to an embodiment of the present invention.
As shown in fig. 7, the apparatus includes:
the acquisition unit 701 is used for performing encryption operation by adopting any plaintext and key combination and acquiring power consumption information in the encryption process;
the attack unit 702 is configured to input the collected power consumption information in the encryption process into the CNN-transform model constructed by using the method provided in the above embodiments, and obtain the key information in the encryption process.
It should be noted that, when the apparatus provided in the foregoing embodiment performs the functions thereof, only the division of the foregoing functional modules is used as an example, in practical application, the foregoing functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to perform all or part of the functions described above. In addition, the apparatus and the method embodiments provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the apparatus and the method embodiments are detailed in the method embodiments and are not repeated herein.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when being executed by a processor, implements the method for constructing a side channel attack model or the side channel attack method provided by the above embodiments.
The embodiment of the invention also provides electronic equipment, which comprises: a processor; a memory for storing processor-executable instructions; the processor is configured to read the executable instructions from the memory and execute the instructions to implement the method for constructing a side channel attack model or the side channel attack method provided in the foregoing embodiments.
The invention has been described with reference to a few embodiments. However, as is well known to those skilled in the art, other embodiments than the above disclosed invention are equally possible within the scope of the invention, as defined by the appended patent claims.
Generally, all terms used in the claims are to be interpreted according to their ordinary meaning in the technical field, unless explicitly defined otherwise therein. All references to "a/an/the [ means, component, etc. ]" are to be interpreted openly as referring to at least one instance of said means, component, etc., unless explicitly stated otherwise. The steps of any method disclosed herein do not have to be performed in the exact order disclosed, unless explicitly stated.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical aspects of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the above embodiments, it should be understood by those of ordinary skill in the art that: modifications and equivalents may be made to the specific embodiments of the invention without departing from the spirit and scope of the invention, which is intended to be covered by the claims.

Claims (11)

1. A method for constructing a side channel attack model, comprising:
constructing a CNN-transducer model fused by a convolutional neural network CNN and a transducer encoder;
setting initial parameters of a CNN-converter model to obtain a CNN-converter initial model, and training the CNN-converter initial model by training data to obtain a CNN-converter final model; wherein each piece of training data comprises a plaintext, a secret key, a power consumption trace and a label.
2. The method of claim 1, wherein the convolutional neural network CNN comprises a first input layer, a convolutional layer, and a pooling layer, connected in sequence.
3. The method of claim 1, wherein the fransformer encoder comprises a second input layer, a position coding layer, a multi-headed attention mechanism layer, a first residual connection and normalization layer, a feed-forward neural network layer, and a second residual connection and normalization layer, connected in sequence;
the second input layer is used for mapping input data into d-dimensional vectors and outputting the d-dimensional vectors;
the position coding layer is used for generating position codes, injecting the position codes into output data of the second input layer, obtaining coded data and outputting the coded data;
the multi-head attention mechanism layer is used for converting output data of the position coding layer into a Query matrix Q, a Key matrix K and a Value matrix V, linearly transforming the Query matrix Q, the Key matrix K and the Value matrix V for a plurality of times, splicing different self-attention outputs, linearly transforming again and outputting the spliced self-attention outputs;
the first residual connection and normalization layer is used for adding the output data of the multi-head attention mechanism layer and the input data of the multi-head attention mechanism layer, then carrying out normalization processing, and outputting the normalized data;
the feedforward neural network layer is used for carrying out nonlinear conversion on the output data of the first residual connection and the normalization layer and then outputting the output data;
and the second residual connection and normalization layer is used for adding the output data of the feedforward neural network layer and the input data of the feedforward neural network layer, performing normalization processing, and outputting the normalized data.
4. A method according to claim 3, wherein the position codes are calculated by using sine and cosine functions of different frequencies.
5. The method of claim 1, wherein training the CNN-transducer initial model with training data comprises:
and outputting an output value of the S box look-up table by inputting a voltage change value when the S box looks-up table, and training the CNN-converter initial model.
6. The method of claim 1, wherein the training data comprises a training set and a test set, obtained in advance by:
under the condition of a fixed key and a random plaintext, collecting a plurality of power consumption traces to serve as a training set, and under the condition of a random key, collecting a plurality of power consumption traces to serve as a testing set;
and correspondingly setting labels of each power consumption trace according to key values of each power consumption trace in the training set and the testing set.
7. A side channel attack method, comprising:
performing encryption operation by adopting any plaintext and key combination, and collecting power consumption information in the encryption process;
inputting the acquired power consumption information in the encryption process into a CNN-converter model constructed by adopting the method of any one of claims 1-9 to acquire key information in the encryption process.
8. An apparatus for constructing a side channel attack model, comprising:
the construction unit is used for constructing a CNN-transducer model fused by the convolutional neural network CNN and the transducer encoder;
the training unit is used for setting initial parameters of the CNN-converter model to obtain a CNN-converter initial model, and training the CNN-converter initial model by training data to obtain a CNN-converter final model; wherein each piece of training data comprises a plaintext, a secret key, a power consumption trace and a label.
9. A side channel attack apparatus, comprising:
the acquisition unit is used for executing encryption operation by adopting any plaintext and key combination and acquiring power consumption information in the encryption process;
the attack unit is used for inputting the acquired power consumption information in the encryption process into the CNN-converter model constructed by adopting the method of any one of claims 1-9 to acquire key information in the encryption process.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method of any of claims 1-6 or 7.
11. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the method of any one of claims 1-6 or 7.
CN202310980683.0A 2023-08-04 2023-08-04 Method and device for constructing side channel attack model, and side channel attack method and device Pending CN117081722A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310980683.0A CN117081722A (en) 2023-08-04 2023-08-04 Method and device for constructing side channel attack model, and side channel attack method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310980683.0A CN117081722A (en) 2023-08-04 2023-08-04 Method and device for constructing side channel attack model, and side channel attack method and device

Publications (1)

Publication Number Publication Date
CN117081722A true CN117081722A (en) 2023-11-17

Family

ID=88705361

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310980683.0A Pending CN117081722A (en) 2023-08-04 2023-08-04 Method and device for constructing side channel attack model, and side channel attack method and device

Country Status (1)

Country Link
CN (1) CN117081722A (en)

Similar Documents

Publication Publication Date Title
Man et al. Double image encryption algorithm based on neural network and chaos
CN107086910B (en) A kind of weight encryption and decryption method and system for Processing with Neural Network
Gong et al. Quantum image encryption algorithm based on quantum image XOR operations
CN110490128B (en) Handwriting recognition method based on encryption neural network
Ran et al. A quantum color image encryption scheme based on coupled hyper-chaotic Lorenz system with three impulse injections
Devaraj et al. An efficient framework for secure image archival and retrieval system using multiple secret share creation scheme
Li et al. Learning efficient gans for image translation via differentiable masks and co-attention distillation
Han et al. A medical image encryption algorithm based on hermite chaotic neural network
CN113222150A (en) Quantum state transformation method and device
Huai et al. Zerobn: Learning compact neural networks for latency-critical edge systems
CN112787971A (en) Construction method of side channel attack model, password attack equipment and computer storage medium
Wang et al. Data hiding in neural networks for multiple receivers [research frontier]
Zhang et al. Two-dimensional exponential chaotic system with hardware implementation
CN113222159A (en) Quantum state determination method and device
CN108804931B (en) Neural network model encryption protection system and method related to domain transformation data encryption
CN111882028B (en) Convolution operation device for convolution neural network
CN113222160B (en) Quantum state conversion method and device
Cao et al. Privacy-preserving healthcare monitoring for IoT devices under edge computing
CN117081722A (en) Method and device for constructing side channel attack model, and side channel attack method and device
CN113222151A (en) Quantum state transformation method and device
Anumasa et al. Delay differential neural networks
Khavalko et al. Application of neural network technologies for information protection in real time
CN115168864A (en) Intelligent cross contract vulnerability detection method based on feature cross
Javan et al. Images encryption based on robust multi-mode finite time synchronization of fractional-order hyper-chaotic Rikitake systems
JP6321216B2 (en) Matrix / key generation device, matrix / key generation system, matrix combination device, matrix / key generation method, program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication