Password side channel analysis method based on dynamic time warping
By applying dynamic time regularization algorithm in crypto-side channel analysis, differentiating and classifying unequal energy trace fragments in asymmetric crypto-algorithm, the problem that traditional methods are difficult to deal with unequal energy trace fragments is solved, and efficient key inference and data integrity retention is achieved.
Patent Information
- Application Number
- CN202411946431.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-27
AI Technical Summary
The prior art is difficult to effectively process energy trace fragments of inequality in asymmetric cryptographic algorithms, resulting in increased difficulty in side channel analysis, and traditional dimensionality reduction-clustering methods are difficult to adapt to this situation.
The cryptographic side channel analysis method based on dynamic time regularization (DTW) is used to distinguish energy traces of different operation types in the asymmetric cryptographic algorithm through the DTW algorithm, and the DTW distance result is displayed using a columnar stacking graph, and the distinction value is found to classify the energy trace fragment into two types of operation, thereby inferring the key information.
It realizes efficient classification and key inference of unequal energy trace fragments, avoids the problem of data feature changes in traditional methods, can adapt to unequal noise, retain data integrity, and does not need to collect multiple energy traces, and can efficiently perform cryptographic analysis.
Smart Images

Figure CN119766417A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security cryptography, and more specifically, to a cryptographic side channel analysis method based on dynamic time warping. Background Art
[0002] Security chips are widely used in various devices to protect device data. Cryptography is one of the important means for security chips to protect data. Cryptography is a technical science involving encryption and decryption to ensure the security, confidentiality and integrity of data. Its core purpose is to protect information through various methods and algorithms so that it cannot be read or tampered with without authorization. Cryptography is widely used, including e-commerce, network security, email encryption and various data protection measures. With the widespread application of cryptography, cryptography is used in many embedded devices, such as smart cards, mobile phones, single-chip microcomputers and other devices. These devices will generate a lot of side channel information during use, and analysts can analyze these side information to obtain keys.
[0003] In 1999, Kocher et al. proposed Simple Power Analysis (SPA), which is a very direct side channel analysis method. It uses the detailed observation of the energy consumption of the device during encryption operations to infer the specific information of the device when performing operations, especially the key used for encryption. In asymmetric cryptographic algorithms, typical examples include RSA and ECC encryption algorithms. These two algorithms usually involve a large number of exponentiation and modular operations. These operations will produce different energy consumption characteristics at the hardware level. RSA is a "square-multiplication" algorithm, and ECC is a "point multiplication-point doubling" algorithm. Therefore, SPA analysts can infer key information by observing these energy traces.
[0004] When performing SPA analysis on asymmetric cryptographic algorithms, due to the long running time of the RSA algorithm or the ECC algorithm, the large data size and the different time required for the two different operations, the length of each energy trace segment (the energy trace segment representing the processing of a single private key bit) is different. Clock jitter or random delay can also affect the length of the energy trace segment. For traditional dimensionality reduction-clustering methods, in order to perform dimensionality reduction operations, different energy trace segments need to have the same length. In this process, how to adjust unequal length sequences to the same length is controversial (such as zero padding, truncation, multiple truncation, difference, etc.), and this adjustment may affect the original characteristics of the data, thereby causing the information used for side channel analysis to change. In 1978, Sakoe Hiroaki and Seibi Chiba proposed the Dynamic Time Warping algorithm, which was originally intended to achieve matching and alignment between time series in speech recognition. Dynamic time warping can be used to align two time series of different lengths or time axes in order to compare their similarities. The algorithm can also calculate the similarity of two time series. This scheme is mainly developed for asymmetric cryptographic algorithms, and its main idea can also be applied to symmetric cryptographic algorithms to distinguish the round operations of the algorithms. Summary of the invention
[0005] In view of this, the purpose of the present invention is to propose an innovative cryptographic side channel analysis method based on dynamic time warping to address the problems of large-scale data of energy traces sampled by cryptographic algorithms, high analysis difficulty, and the difficulty of traditional "dimensionality reduction-clustering" methods to handle energy trace segments of unequal lengths. Dynamic time warping is used to distinguish the energy traces corresponding to different operation types in asymmetric cryptographic algorithms, thereby achieving efficient and automatic inference of the keys of cryptographic algorithms.
[0006] A cryptographic side channel analysis method based on dynamic time warping comprises the following steps: Step 1: Collect side information (such as energy signals) of the device executing the asymmetric cryptographic algorithm to obtain an energy trace, analyze the collected energy trace, and determine the area in the energy trace where operations related to secret information are performed; Step 2: Analyze the energy trace of executing the cryptographic algorithm and divide the energy trace into energy trace segments according to the signal peak value; Step 3: Select an energy trace segment as a reference energy trace segment, apply the DTW algorithm to each energy trace segment and the reference energy trace segment, and calculate the DTW distance between the two segments; Step 4: Display all obtained DTW distance results using a stacked column chart, and find the distance value between two clusters of column charts in the chart as the distinguishing value; Step 5: Use the discrimination value to classify the DTW distance results into two categories, and obtain two types of operation types corresponding to the energy trace fragments. These two types correspond to two different operation results of the asymmetric encryption algorithm, thereby inferring the key information.
[0007] According to an example of an embodiment of the present invention, in step 3, an energy trace segment is selected as a reference energy trace segment, and a DTW algorithm is applied to each energy trace segment and the reference energy trace segment to calculate a DTW distance between the two segments; The algorithm selects the energy trace segment as the reference segment, then traverses all energy trace segments and applies the DTW algorithm to calculate the DTW distance between their reference segments.
[0008] According to an example of an embodiment of the present invention, in step 4, all obtained DTW distance results are displayed using a column stacking chart, and the distance value between two clusters of column charts in the chart is found as a distinguishing value; Each divided energy trace segment has a corresponding DTW distance result value. These results are plotted into a stacking diagram, that is, a bar graph. The horizontal axis of the bar graph is an interval and each bar graph is closely connected. Since the selected reference energy trace and its own calculated DTW distance result value will be 0, the smallest 0 is not considered when drawing the stacking diagram; the final stacking diagram will show two major categories, and the value between the two categories is the distinguishing value.
[0009] According to an example of an embodiment of the present invention, in step 5, the DTW distance result is divided into two categories using a distinguishing value, and two types of operation types corresponding to the energy trace fragments are obtained. The two types correspond to two different operation results of the asymmetric cryptographic algorithm, thereby inferring the key information; There are only two operations in the modular exponentiation operation of the RSA algorithm: square operation and multiplication operation. The energy trace fragments are directly divided into two categories using the distinguishing value; one category represents the message operation "square" and the other represents the operation "multiplication".
[0010] The present application at least includes the beneficial effects of: using the DTW algorithm to obtain a sequence of intermediate values related to the key in the algorithm. The present invention directly uses energy trace fragments of unequal lengths for classification without the need for padding operations, and can adapt to noises of unequal lengths, thereby retaining the integrity of the data. The method of the present invention does not need to collect multiple energy traces, and can efficiently perform cryptographic analysis. The method is effective for energy traces, and is also effective for electromagnetic traces and illumination traces.
[0011] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The above and other purposes, features and advantages of the embodiments of the present invention will become more apparent by describing the embodiments of the present invention in more detail in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0013] Figure 1 is a flow chart of the method of the present invention; Figure 2 Schematic diagram of the energy trace of the RSA algorithm of the Sakura-G development board in the embodiment of the method of the present invention; Figure 3 is an enlarged view of the energy trace in an embodiment of the method of the present invention; Figure 4 Schematic diagram of energy trace operation division in an embodiment of the method of the present invention; Figure 5 is an enlarged view of an energy trace segment in an embodiment of the method of the present invention; Figure 6 is a schematic diagram of DTW results in an embodiment of the method of the present invention; Figure 7 It is a schematic diagram of the K-Means clustering result in an embodiment of the method of the present invention. DETAILED DESCRIPTION
[0014] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0015] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme of the present application is further elaborated in detail below in conjunction with the accompanying drawings and embodiments. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the following description, it is related to "optional implementation method", which describes a subset of all possible embodiments, but it can be understood that the "optional implementation method" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict. The term "first / second" involved is only to distinguish similar objects, and does not represent a specific order for the object. It can be understood that "first / second" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by technicians in the technical field of the present application. The terms used herein are only for the purpose of describing the present application and are not intended to limit the present application.
[0016] The embodiment of the present application provides, taking the RSA algorithm as an example, collecting energy information running on the SAKURA-G development board, and using the method of the present invention to recover the secret information of the algorithm; like Figure 1 As shown, a cryptographic side channel analysis method based on dynamic time warping includes the following steps: Step 1: Prepare the hardware and software equipment platform, collect the side information of the equipment executing the asymmetric encryption algorithm to obtain the energy trace, locate the algorithm encrypted part in the energy trace, and determine the area in the energy trace that performs the secret information related operation; Specifically, after building the hardware and software equipment platform, the complete energy trace of the RSA algorithm executing encryption on the SAKURA-G development board is collected, such as Figure 2 As shown. Since the energy consumed by the square and multiplication operations in the RSA encryption process is relatively high, the part with higher energy trace in the figure is judged to be the encryption part; Step 2: Analyze the energy trace of executing the cryptographic algorithm and divide the energy trace into energy trace segments according to the signal peak value; Specifically, according to the algorithm principle of RSA, there are two operations in modular exponentiation: square operation and multiplication operation. The two operations may present different characteristics in the energy trace. It is known that the length of the secret exponent of a modular exponentiation operation is 1024 bits. If all bits of the secret exponent are 0, the square operation is performed 1024 times; if all bits of the secret exponent are 1, the square operation and multiplication operation are performed 1024 times each, for a total of 2048 operations. Therefore, the number of operations ranges from 1024 to 2048. Observe the energy trace and zoom in on this part of the energy trace. You can see different operations. There are tiny spikes before and after each operation, such as Figure 3 As shown. The division is based on the peak value of the spikes before and after the operation. The division results are shown in Figure 4 As shown; Step 3: Select an energy trace segment as a reference energy trace segment, apply the DTW algorithm to each energy trace segment and the reference energy trace segment, and calculate the DTW distance between the two segments; Specifically, after division, the single energy trace fragment is as follows Figure 5 As shown, the algorithm of the present invention selects the energy trace segment as the reference segment, then traverses all energy trace segments, and applies the DTW algorithm to calculate the DTW distance between the reference segments; for each calculation, the two energy trace segments are recorded as A and B, and the points on them correspond to A i and B i , the lengths of A and B are , ; then you can construct a The table is a graph in which the horizontal and vertical axes represent the positions of the points of each energy trace of A and B, and the values are the distances between the corresponding points. For example, (1,1) in the table represents the distance between the first point of energy trace A and the first point of energy trace B. The DTW algorithm needs to find a path from the lower left corner of the table to the upper right corner, and the path is recorded as , starting from and the end point is ; This path needs to minimize the cumulative distance, and this path represents the best alignment between the two time series; First of all, this path is not chosen randomly, but needs to meet the following constraints: 1) Boundary conditions: arrive ; For the DTW algorithm, the speed of pronunciation of any speech may change, but the order of its parts cannot be changed, so the selected path must start from the lower left corner and end at the upper right corner; 2) Continuity: If , then for the next point on the path Needs to be satisfied and ; That is, it is impossible to match across a certain point, and it can only align with its adjacent points; this ensures that each coordinate in A and B is Appear in; 3) Monotonicity: If , then for the next point on the path Needs to be satisfied and This restriction The above points must be monotonically performed over time to ensure that the time series is not disrupted between corresponding points; Combined with the continuity and monotonicity constraints, each grid point has only three paths; for example, if the path has passed through the grid point , then the next grid point passed can only be one of the following three situations: , or .
[0017] The algorithm then uses dynamic programming to perform subsequent calculations, using the recursive formula To fill in the table, is the cumulative distance, is the distance between single points. The result in the upper right corner of the final table is the distance calculation result of the DTW algorithm. Since the DTW algorithm takes a long time, the Fast-DTW algorithm can be used to accelerate the algorithm by reducing the size of the table.
[0018] Step 4: Display all obtained DTW distance results using a stacked column chart, and find the distance value between two clusters of column charts in the chart as the distinguishing value; Specifically, after step 3, each divided energy trace segment has a corresponding DTW distance result value. These results are plotted into a stacking diagram, that is, a bar graph. The horizontal axis of the bar graph is an interval and each bar graph is closely connected. Since the selected reference energy trace and its own calculated DTW distance result value will be 0, the smallest 0 is not considered when drawing the stacking diagram. For this example, the result is as follows Figure 6 As shown in the figure, it can be seen that the data is roughly divided into two categories, and the dividing point between the two categories is around 60, so 60 is selected as the dividing value.
[0019] Step 5: Use the discrimination value to classify the DTW distance results into two categories, and obtain two types of operation types corresponding to the energy trace fragments. These two types correspond to two different operation results of the asymmetric encryption algorithm, thereby inferring the key information.
[0020] Specifically, there are only two operations in the modular exponentiation operation of the RSA algorithm: square operation and multiplication operation. The energy trace fragments are directly divided into two categories using the distinguishing value. One category represents the message operation "square" and the other represents the operation "multiplication"; among them, the category with more guessed sample points represents "square", restores the message sequence and attempts to calculate the key. In this embodiment, the key recovery accuracy is 99.54%. For misclassified operation fragments, it is necessary to traverse its possible values and try to recover the key. Under the same division, each energy trace fragment is padded with zeros to make each fragment of the same length, and then the operation points are classified through PCA dimensionality reduction and K-Means clustering. The classification results are as follows. Figure 7 As shown, the color of the point reflects the result of a K-Means experiment, and the shape of the point reflects the correct classification result. The experimental results show that the average accuracy of 1000 clustering results is 75.73%, thus proving that the method of the present invention is superior to the traditional dimension reduction-clustering method.
[0021] It should be noted that the object information (including but not limited to the object's device information, corresponding personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the object or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0022] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. The above-mentioned embodiments only express several implementation methods of the present application, and their descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the patent of this application. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several deformations and improvements can be made, which all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be based on the attached claims.
Claims
1. A cryptographic side channel analysis method based on dynamic time warping, characterized in that: The following steps are involved: Step 1: Collect side information of the device executing the asymmetric cryptographic algorithm to obtain an energy trace, analyze the collected energy trace, and determine the area in the energy trace where the secret information-related operation is performed; Step 2: Analyze the energy trace of executing the cryptographic algorithm and divide the energy trace into energy trace segments according to the signal peak value; Step 3: Select an energy trace segment as a reference energy trace segment, apply the DTW algorithm to each energy trace segment and the reference energy trace segment, and calculate the DTW distance between the two segments; Step 4: Display all obtained DTW distance results using a stacked column chart, and find the distance value between two clusters of column charts in the chart as the distinguishing value; Step 5: Use the discrimination value to classify the DTW distance results into two categories, and obtain two types of operation types corresponding to the energy trace fragments. These two types correspond to two different operation results of the asymmetric encryption algorithm, thereby inferring the key information.
2. A cryptographic side channel analysis method based on dynamic time warping as claimed in claim 1, characterized in that: In the step 3, an energy trace segment is selected as a reference energy trace segment, and a DTW algorithm is applied to each energy trace segment and the reference energy trace segment to calculate the DTW distance between the two segments; The algorithm selects the energy trace segment as the reference segment, then traverses all energy trace segments and applies the DTW algorithm to calculate the DTW distance between their reference segments.
3. A cryptographic side channel analysis method based on dynamic time warping as claimed in claim 1, characterized in that: In step 4, all obtained DTW distance results are displayed using a column stacking chart, and the distance value between two clusters of column charts in the chart is found as a distinguishing value; Each divided energy trace segment has a corresponding DTW distance result value. These results are plotted into a stacking diagram, that is, a bar graph. The horizontal axis of the bar graph is an interval and each bar graph is closely connected. Since the selected reference energy trace and its own calculated DTW distance result value will be 0, the smallest 0 is not considered when drawing the stacking diagram; the final stacking diagram will show two major categories, and the value between the two categories is the distinguishing value.
4. A cryptographic side channel analysis method based on dynamic time warping as claimed in claim 1, characterized in that: In step 5, the DTW distance results are divided into two categories using a distinguishing value, and two types of operation types corresponding to the energy trace segments are obtained. The two types correspond to two different operation results of the asymmetric cryptographic algorithm, thereby inferring the key information; There are only two operations in the modular exponentiation operation of the RSA algorithm: square operation and multiplication operation. The energy trace fragments are directly divided into two categories using the distinguishing value; one category represents the message operation "square" and the other represents the operation "multiplication".
Citation Information
Patent Citations
Second-order side channel energy analysis method for SM4 algorithm of simple mask
CN103647637A
Side channel correlation energy analysis method and system applied to polynomial hardware multiplication
CN114785478A
Cryptographic algorithm artificial intelligence side channel analysis method based on dimension reduction and clustering
CN117579244A
Fast Partial Pattern Matching System and Method
US20110224984A1
Methods and apparatuses for tracking weak signal traces
WO2020061346A1