• No results found

A Power Attack Method Based on Clustering

N/A
N/A
Protected

Academic year: 2020

Share "A Power Attack Method Based on Clustering"

Copied!
7
0
0

Loading.... (view fulltext now)

Full text

(1)

 

A Power Attack Method Based on Clustering

Ruo-nan ZHANG, Qi-ming ZHANG and Ji-hua CHEN

National University of Defense Technology, Changsha, Hunan, China

Keywords: K-means clustering, Euclidean distance, Hamming distance, AES algorithm, Power attack.

Abstract. Clustering uses the similarity between samples to automatically classify, and the power information generated in the encryption process has a certain similarity. Therefore, a method that use clustering for power attack is present in this paper. Similarity between the power data is considered in the method. We divided the data into many categories by clustering, and classified the data according to the guess key. We compared the similarity between the two categories, and got the correct key in the case of greatest similarity. At the same time, the s-box simulation data of AES encryption algorithm was selected as the verification example. We selected the key-related part of the power data as feature points to attack based on K-means clustering, and used Euclidean distance to calculate the similarity between clustering and classification results. The experiment result shows that the method can help us get the correct key effectively.

Introduction

In life, we will use a lot of password hardware. To ensure the security of cryptographic hardware devices, some algorithms are added to the security chips of these devices, such as EDS, AES, and RSA. However, in the actual work, there are some security vulnerabilities which can be attacked in these algorithms. Some physical information, such as power information, electromagnetic information, etc. which are leaked at runtime, can become a security flaw. With these physical information, the attacker can get the key to cause harm or theft of the device information. Through the analysis of the side channel information in the operation of the cryptographic chip, it can be found that the power waveform has a certain relationship with the key. When the key changes, the power will show different characteristics. Therefore, the attacker cracks the key by analyzing side channel information based on the relationship between side channel information and key.

In 1998, Kocher et al. processed an effective attack method, power analysis [1]. The idea of this method is to reduce the key search space by analyzing power information leaked in the runtime. One of the important idea is differential power analysis. In this way, we can get the information about key when the device is running, rather than analysis the key in theory.

Power attack has been considered as an effective way to get a key, including Simple Power Analysis, Differential Power Analysis and Correlation Power Analysis. J.R. Rao al. crack the key of COMP128 algorithm [2]. In 2011, researchers from Germany demonstrated how to attack the 3DES algorithm in the Mifare DESFire MF1CD40 series cards and recovered the key at the CHES meeting. As the defend technology develops, a lot of new ways of power analysis attack appear, such as second order DPA attack, template attack, and multi-bit DPA attack [4,5,6]. To enhance the effect of DPA, T.S. Messerges proposed a multi-bit attack way [7] in which the output bits of the distinguish function are more than one to improve precision and efficiency. In 2016, Yanting Ren al. improved the correlation power analysis by combine the leak information in two adjacent clock periods [8], and attacked the 3DES algorithm successfully.

Data compression and data preprocessing develops because of the need of data processing. In 2006, C. Archambeau al. proposed data dimensionality to compress feature space and reduce calculation by using principal component analysis in the template attack.

(2)

classify the power data, thus the key will be gotten. We use simulation data to verify. The result shows that our method is effective.

AES Algorithm and the Feasibility of Power Attack

Advanced Encryption Standard AES has been extensively researched and focused by the relevant scholars since the solicitation, which has greatly contributed to the development of block ciphers. As a new generation of data encryption standard, AES is released by the US National Institute of Standards and Technology as a federal information processing standards in 2001, the purpose of which is to replace the old data encryption standard EDS. Now AES has become the preferred encryption standard for information security production because of its superiority.

[image:2.612.181.430.231.721.2]

Principle of AES Algorithm

(3)

AES algorithm derived from Rijndael algorithm, and it consists of encryption and decryption module and key expansion module [9]. In the AES algorithm specification, the length of plaintext is 128 bits, and the length of key can be 128 bits,192 bits or 256 bits. The process of AES algorithm is shown as Figure 1:

Feasibility of Power Attack

The power of CMOS device consists of switching power, short-circuit power, and leakage power. The power generated by the chip is mainly composed of switching power and short-circuit power. Switching power and short-circuit power are all generated at the time when the signal changes, so these two power are closely related to the change of data, which is the physical basis of power analysis to CMOS device.

The basic idea of power attack is that instantaneous power depends on data and operation. Power waveform and key has a certain relationship. When the key changes, the power will show different character, which shows the physical basis of power analysis attack.

The stage to attack can be chosen from this two aspects: (1)the output of xor of plaintext and the first round key

Xor operation of round key is that data xor with key by bit, which is the operation of operand and key. Especially for the xor of initial plaintext and first round key. If the attack successfully, we can get key subset directly.

(2)output of subbytes

AES is an iterative password based on finite field operations. The first step of iterative is subbytes, which is a byte-level operation. S box is a non-linear subbytes operation that has 8 inputs and 8 outputs, which can give 8 bits output in terms of 8 bits input by searching in the S box. The first round key is initial key, so the responding output after subbytes can be gotten if we know the first byte of plaintext and key.

Power Attack Method Based on Clustering

Clustering belongs to unsupervised learning, which takes advantage of the similarity between sample data for automatic classification. There is also a similar correlation between the power data generated during cryptographic encryption, so we can do power attack by clustering [10].

Clustering is a method which classify data according to some characteristics. Objects in the same cluster have high similarity, while objects in different cluster have high difference.

K-means Clustering

K-means clustering is a common clustering algorithm [11]. The main idea of K-means clustering is that describe the similarity between object and cluster by defining the distance between the object and the center of clustering, adjust the center of cluster and the attribution of object and then iterative to get the clustering result. The key of this algorithm is to define the distance between object and the center of cluster and the way of adjusting the center of the cluster. In K-means clustering algorithm, the distance between object and center of cluster is Euclidean distance, and the center of the cluster is barycenter. The specific algorithm flow is:

(1) Choose k data samples from N data samples as initial clustering center.

(2) Calculate the distance between each sample and these clustering center, and re-divide the samples according to the minimum distance.

(3) Re-calculate the mean of the data in each cluster.

(4) Cycle step (2) to step (3) until each cluster is not changing.

(4)

Euclidean Distance

At the time of classification, similarity measures between different samples are usually required, and the metrics need to be able to accurately characterize the similarity of data within the same cluster. The usual approach is to calculate the distance between the samples. Because each dimension index is at the same scale level, this paper uses the Euclidean distance to judge the correlation between data. The Euclidean distance of the two n-dimensional vectors is more small, the two n-dimensional vectors are more relevant.

Calculation method of Euclidean distance:

The Euclidean distance between two n-dimension vectors a(x11, x12, …,x1n) and a(x21, x22, …,x2n).

   n k k k

y

x

d

1 2 2 1

12 ( ) . (1)

Hamming Distance Weight

If the values of the metric vectors x and y are taken as binary values such as 1 or 0, you can use Hamming distance to achieve the measurement between the models. It is defined as follow:

) ( 2 1 ) , ( 1 2

   n k k k

y

x

n

y

x

D

. (2)

If x and y are the same, the Hamming distance is 0; if they are completely different, the Hamming distance is n. We can calculate Hamming distance by XOR.

Power Attack Based on Clustering

[image:4.612.135.476.428.695.2]

The idea of power attack based on clustering is shown in Figure 2, the detailed procedure is shown as follow:

(5)

(1) The data obtained in the actual measurement are high-dimensional, so a large number of measurement points in each cycle will cause the information redundancy and increase the complexity of the attack. Therefore, it is necessary to extract the feature data of power data corresponding to each set of plaintext.

(2) Select the power data points that are most relevant to the key as the data for attack.

(3) Clustering attack data. In the result, similar power data is classified as a cluster. When the key is n bits, its Hamming distance is n+1.

(4) Corresponding to each guessing key, we classify the attack data once. When the key is n bits, we need to do 2n operations.

(5) Compare the clustering result with 2n classification results. The key in the case of maximum similarity is the correct key.

Experimental Verification and Analysis Experiment Process

(1) Get simulation data

[image:5.612.164.446.321.534.2]

We collect power data in the process of encryption for 2000 plaintext, so we can get 2000 sets of power data, each of which has 400 points. Fig.3 shows 400 power data points of one plaintext.

Figure 3. One set of power data.

(2) Feature extraction

In the 2000 sets of power data, part of 400 data in each group is related to the key which can reflect the key information better, so we extract the feature data [13,14,15,16,17]. We choose the samples with the greatest correlation with the key as the attack data.

(3) Similarity comparison

K-means clustering method is used to cluster attack data. For 8-bit key, there are 9 kinds of Hamming weights. Therefore, we cluster the data in 3 clusters and get 3 center of cluster.

We choose another method to classify the data. The output of subbytes is chosen as attack point and the power of CMOS circuit is generated by state changing, so we use Hamming weight model to classify data into 3 class and calculate the barycenter of each class of data as the center of classification.

(6)

correspondence calculate the Euclidean distance. We choose the correspondence in the case of minimum distance.

[image:6.612.132.468.194.452.2]

There are 256 keys because the key is 8 bits. For each key, we can get a group of centers of classification. Compare the classification centers with cluster centers, and the key in the case that the two groups centers are closest to each other is the correct key. In this paper, we choose Euclidean distance as a criterion for similarity comparison. For each group of classification centers, we calculate the distance between them with cluster centers and we can get 256 results which shows in Figure 4.

Figure 4. Euclidean distance of 256 keys.

Result Analysis

It can be seen from the figure 4, when the distance is minimum, the key is 198. It is consistent with the correct key and indicate that the attack is successful; It also can be seen that the result has obvious spikes, which indicates that this method is effective.

Summary

Based on the analysis of the similarity between power and the similarity between power and key, this paper proposes a power attack method based on clustering. Considering the similarity between power data, this method classifies the power data into some groups and judge the correct key with Euclidean distance. Through the experimental verification with simulation data, it shows that the method can attack the correct key effectively. This paper does not use the measured data to verify the results, so the result need to be further verified with actual measurement data.

References

(7)

[2] Rao J.R. et al. Partitioning Attacks: Or How to Rapidly Clone Some GSM Cards [C]. IEEE Symposium on Security and Privacy, 2002: 31-41.

[3] Oswald, D. and C. Paar, Breaking mifare DESFire MF3ICD40: power analysis and templates in the real world, in Cryptographic Hardware and Embedded Systems-CHES 2011. 2011, Springer. p. 207-222.

[4] Kerstin Lemke, Kai Schramm, and Christof Paar. DPA on n-Bit Sized Boolean and Arithemtic Operations and Its Application to IDEA, RC6, and the HMAC-Construction [C]. Lecture Notes in Computer Science, 2004, 3156: 205-219.

[5] Thomas S. Messerges. Using Second-Order Power Analysis to Attack DPA Resistant Software [C]. Lecture Notes in Computer Science, 2000, 1965: 238-251.

[6] Stefan Mangard, Thomas Popp, and Berndt M. Gammel. Side-Channel Leakage of Mashed CMOS Gates [C]. Lecture Notes in Computer Science, 2005, 3376: 351-165.

[7] Messerges T.S., Dabbish E.A., Sloan R.H. Examining Smart-card Security under the Threat of Power Attack Analysis [J]. IEEE Trans. on computers, 2002, 51(5): 541-552.

[8] Yanting Ren, Liji Wu, Hexin Li, Xiangyu Li, Xiangmin Zhang, An Wang, Hongyi Chen. Key Recovery Against 3DES in CPU Smart Card Based on Improved Correlation Power Analysis [J]. Journal of Tsinghua University (Natural Science Edition), 2016, (the second issue)

[9] Huiyun Li, Dawei Li, al. edited, Password Security Chip and Side Channel Technology [M] Beijing Science and Technology Press, 2014.

[10] Junjie Li. Research on clustering discriminator based on ant colony algorithm [D]. University of electronic Science and Technology of China, 2014.

[11] Zhiwei Li. Research on K-means clustering algorithm[J]. Electronic world, 2016(19): 55-55. [12] Sujie Zhang, Huaici Zhao. Research on Optimal Clustering Number and Initial Clustering Center Point Selection Algorithm [J]. Computer Application Research, 2017, 34(6): 1-5.

[13] Archambeau C., Peeters E., Standaert F.X., et al. Template attacks in principal subspaces [C] International Conference on Cryptographic Hardware and Embedded Systems. Springer-Verlag, 2006: 1-14.

[14] Liyang Zhang.AES Differential Energy Analysis Based on Template Attack [J]. Theoretical discussion, 2014(9): 52-53.

[15] Hastie T., Tibshirani R., Friedman J.H., et al. The Elements of Statistical Learning [M]. World Book Inc, 2015.

[16] Jing Li, Hongxin Zhang, Han Gan, et al. Feature Extraction of Power Curve Based on Echo State Network [J]. Journal of Radio Science, 2014, 29(6).

Figure

Figure 1. Process of AES.
Figure 2. The idea of power attack based on clustering.
Figure 3. One set of power data.
Figure 4. Euclidean distance of 256 keys.

References

Related documents

Under the addition of formate, H 2 production increased more than 2-fold in BL21 cells with recombinant hydrogenase 1, compared to the culture without formate (bars (e) vs (b),

“Both experienced professionals as well as business and technical students will bene fi t from Mike’s pragmatic and direct style that guides the reader through the history and use

Embedded systems are realized for functioning even without man gadget intercession and have been capable of reply to occurrence in real time running, not only those

recycling two different spent abrasive materials (Black Beauty and silica sand) as.. aggregate in hot mix asphalt

Debnath, Some Inequalities Involving the Constant e , and an Application to Carleman’s inequality, J. 253

It takes into account the presence of brittle high-strength reinforcing inclusions (basalt aggregates), a pore network of two different scales (communicating

Each node whose sensor triggers danger diffuses the information about danger to its neighbors in a message that includes its source node id, the potential value and the number

The addition of manyw , then, does not save bottom-of-the-scale numerals from yielding contradictory truth conditions, and so we conclude that our account of the bottom-of-the-