Next Article in Journal
Analysis of Effects of Rock Physical Properties Changes from Freeze–Thaw Weathering in Ny-Ålesund Region: Part 2—Correlations and Prediction of Weathered Properties
Next Article in Special Issue
Highly Efficient Implementation of Block Ciphers on Graphic Processing Units for Massively Large Data
Previous Article in Journal
Review on Corrosion Inhibitors for Oil and Gas Corrosion Issues
Previous Article in Special Issue
PAGE—Practical AES-GCM Encryption for Low-End Microcontrollers
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

SIV: Raise the Correlation of Second-Order Correlation Power Analysis to 1.00

1
Department of Mathematics, Kookmin University, Seoul 02707, Korea
2
Department of Financial Information Security, Kookmin University, Seoul 02707, Korea
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Appl. Sci. 2020, 10(10), 3394; https://doi.org/10.3390/app10103394
Submission received: 9 April 2020 / Revised: 10 May 2020 / Accepted: 10 May 2020 / Published: 14 May 2020
(This article belongs to the Special Issue Side Channel Attacks and Countermeasures)

Abstract

:
The major factors that determine the performance of the second-order correlation power analysis (SOCPA) include the accuracy of the power model and the correlation between the hypothetical intermediate value and preprocessed power consumption. Because of the tradeoff between the accuracy and correlation, the correlation coefficient of the general SOCPA using 8-bit SubBytes output is only up to 0.35. Therefore, based on the operational characteristic of the cryptographic algorithm, we propose to find a special intermediate value, called sparse intermediate value (SIV). The SIV significantly improves the performance of the SOCPA because it accurately models the power consumption while the correlation coefficient is 1.00. Further, the experimental results on OpenSSL advanced encryption standard (AES) show that the SIV-based SOCPA can disclose the entire secret key with only about a quarter of the power trace required by the general SOCPA.

1. Introduction

Cryptanalysis is the study of the analysis of the cryptographic algorithm’s vulnerabilities to construct a secure system. Mathematical analysis, conventional cryptanalysis, reveals secret information based on the fact that an analyst knows plaintext or ciphertext. Meanwhile, Paul Kocher discovered that physical information of a cryptographic device is associated with the secret information [1]. Although a cryptographic algorithm could be secure against mathematical analysis, it is subjected to vulnerability using physical information. Consequently, cryptanalysis research is required under the assumption that an analyst is aware of physical information in addition to plaintext/ciphertext. Side-channel analysis discloses a secret key by using physical information such as power consumption, electromagnetic, acoustic, and photon [2,3,4,5].
Power analysis, which analyzes power consumption patterns of a cryptographic device, includes the simple power analysis (SPA) [1], differential power analysis (DPA) [2], and correlation power analysis (CPA) [6]. The DPA/CPA is based on the fact that power consumption when storing data in a register is related to the data. The important factor, which determines the DPA/CPA performance, is the accuracy of the power model that describes the relationship. To raise the model’s accuracy, the analyst considers every single bit of the register: i.e., the length of intermediate value should be as long as the length of the register.
The first-order correlation power analysis (FOCPA) is a statistical method that utilizes the correlation between a single point of power consumption and the sensitive intermediate value. Thus, the countermeasure such as masking is generally used [7]. To counter the FOCPA, the first-order masking, which splits an intermediate value into two random variables, is utilized. That is, it spreads the power consumption related to the intermediate value into two points. The first-order masked implementation is vulnerable to the second-order correlation power analysis (SOCPA) that utilizes the correlation between guessable intermediate value and two split points of power consumption. Two points of power consumption are preprocessed to related to the guessable intermediate value, and the preprocessing function determines the SOCPA performance.
For the SOCPA, the longer bit length of the intermediate value reduces the correlation between the hypothetical intermediate value and preprocessed power consumption. That is, 1-bit intermediate value has the highest correlation with the preprocessed power consumption when performing the SOCPA. However, 1-bit intermediate is generally not used because shorter bit length reduces the accuracy of the power model. In this tradeoff relation, analysts commonly use an 8-bit intermediate value to improve the performance of the SOCPA.
SOCPA requires more power traces than the FOCPA to determining whether the guessed key is the right key because the correlation of the SOCPA is much lower than the FOCPA. Accordingly, several preprocessing functions had been suggested to raise the correlation of the SOCPA. The first function is the product of two points [8]. If the power model is the Hamming weight model and the length of the intermediate value is 8, the absolute correlation coefficient is only about 0.09. In this case, theoretically, the general SOCPA requires at least 1 0.09 2 123 times more traces than the FOCPA because the correlation is only 0.09 [9]. Thus, the first function is generally not used. In 2000, the absolute-difference (AD) function was proposed by Messerges [10]. However, the correlation was still only 0.24, much lower than 1.00. To raise the correlation, Prouff suggested the product-combining (PC) function in 2009, and the correlation was enhanced to 0.35 [11]. Existing researches are focused on the preprocessing function to enhance SOCPA performance, and the correlation has not raised significantly.
As discussed above, a 1-bit intermediate value is typically not used because it decreases the accuracy of the power model. However, the correlation between the hypothetical intermediate value and preprocessed power consumption is 1.00, if the preprocessing function is AD or PC. Thus, if there exists the 8-bit intermediate value that has the same characteristic as 1-bit, it allows significantly raising the correlation. We focus on the characteristic that the number of cases is 2, for 1-bit intermediate value. Therefore, unlike existing researches, we aim to find the intermediate values that have a smaller cardinality, such as a 1-bit intermediate value. In this paper, we propose the special intermediate value, named sparse intermediate value (SIV), based on the operational characteristics of the cryptographic algorithm, and remarkably raise the correlation from 0.35 to 1.00. That is, we reduce the the minimum trace to disclose the secret key to the same as the FOCPA.
The rest of this paper is organized as follows. Section 2 briefly describes the overview of the CPA and MixColumns of the advanced encryption algorithm (AES). We analyze the operational characteristics to find the SIV and demonstrate the existence of the power consumption related to SIV in Section 3. Section 4 analyzes OpenSSL AES and compares the general SOCPA using 8-bit SubBytes output to SIV-based SOCPA. Section 5 recommends two countermeasures against the proposed method. Section 6 summarizes results obtained and the contribution of this paper. Finally, Section 7 concludes the paper.

2. Related Works

2.1. Symbols and Notations

Table 1 shows the notations used throughout this paper.

2.2. Correlation Power Analysis

The CPA is a statistical method that analyzes a huge amount of power traces T of cryptographic device encrypting different plaintexts P to reveal the secret key K [6]. It is based on the fact that T is related to the intermediate values f P , K calculated when encrypting P . The power consumption model is a method that describes the relationship between T and f P , K . Typically, the Hamming weight model is utilized as the power consumption model in software implementation. It assumes that the power consumption is linearly related to the number of 1’s in the binary representation of the intermediate value [12]. Therefore, when data d = d 7 d 6 d 5 d 0 2 is stored in an 8-bit register, the power consumption P d is linearly related to the Hamming weight of d HW d = i = 0 7 d i .
P d = ϵ × HW d + P n o i s e .
The brute-force attack must guess the entire secret key to determining whether the supposed key is the right key, whereas the CPA guesses a much shorter partial key K i and decides that. Thus, the CPA applies the divide-and-conquer algorithm that recovers the K i and combines that to disclose the whole secret key K. An analyst calculates the set of Hamming weights of an intermediate value HW f P , G K , where G K is the guessed key. If G K = K i , the set of Hamming weight is linearly related to T . Therefore, the analyst can confirm that G K is the secret key by Pearson’s correlation coefficient Corr T , HW f P , G K . The Pearson’s correlation coefficient is a measure of linear correlation with a value between 1 and 1.
Masking is a countermeasure against the CPA performed by randomizing the power consumption unrelated to the guessable intermediate value. The Boolean masking conceals sensitive data x by XORing a random value (mask) m to the data x m . Thus, the intermediate value x is split into more than two random variables r 1 , r 2 , , r n , r 0 = x r 1 r 2 r n . The analyst cannot disclose the key via the CPA because the intermediate value, which is related to power consumption, is not guessable. Typically, the 8-bit masked AES is implemented as a schema proposed by Herbst [7]. As the schema can efficiently resist the first-order CPA (FOCPA) with only six masks. Figure 1 shows the mask used to conceal the output of each transformation in the Herbst schema. Note that SubBytes and Shiftrows require only one mask each, and MixColumns requires four masks.

2.3. Second-Order CPA

If every mask is independent, the masked cryptography is secure against the CPA. However, in general implementation, some intermediate value shares the same mask because of the spatial and time complexity. In this case, the implementation might be vulnerable to the CPA.
The SOCPA is an analytical method that reveals the secret key by combining the power consumption of the two intermediate values x , y that share the same mask m. The analyst can disclose the key based on the fact that HW x y is linearly related to p r e HW x m , HW y m for some preprocessing function p r e . Therefore, the SOCPA utilizes the fact that the correlation of Equation (1) is not zero, as shown in Table 2. l I denotes the bit length of the intermediate value.
Corr HW x y , p r e HW x m , HW y m = Corr i = 0 l I 1 x i y i , p r e i = 0 l I 1 x i m i , i = 0 l I 1 y i m i .
The commonly used preprocessing functions are product-combining (PC) and absolute-difference (AD). The definitions of PC and AD are expressed as follows:
p r e PC X , Y = X E X × Y E Y p r e AD X , Y = X Y ,
where X and Y denote the random variables.
The correlation of Equation (1) depends on the preprocessing function and the bit length of the intermediate value l I , as shown in Table 2. In Table 2, the correlation coefficients decrease as the bit length increases for all preprocessing functions. Note that the correlation is 1.00 when the bit length is 1; however, the correlation is only 0.35 at most when the bit length is 8.
Because x y is a guessable intermediate value, and two points of power consumption P x m , P y m are linearly related to HW x m , HW y m , respectively, Equation (1) can be modified to Equation (2). Therefore, the analyst can perform the CPA by combining two intermediate values and two points of power consumption.
Corr HW x y , p r e P x m , P y m = Corr i = 0 l I 1 x i y i , p r e P x m , P y m .
Note that the Hamming weight is only modifiable to power consumption when l I is equal to the length of the register l R . If l I < l R , the remaining l R l I bits act as noise. For example, if data d = d 7 d 6 d 0 2 is stored in an 8-bit register and an analyst uses only a 1-bit intermediate value d 7 , then the remaining 7 bits d 6 d 5 d 0 2 behave similar to noise:
P d = ϵ × d 7 + i = 0 6 d i + P n o i s e .
The correlation of Equation (2) may be much lower compared to the correlation of Equation (1) because of the effect of noise. Consequently, even though the correlation of Equation (1) is 1.00 when bit length is 1, generally, the 1-bit intermediate is not an optimal choice. Table 3 shows the theoretical correlation coefficients of Equation (2) when the bit length of the register is 8. In Table 3, the correlation of the 1-bit intermediate value is only up to 0.13, which is much less than that of the 8-bit intermediate value. The theoretical correlation of the table is calculated as Equation (4). Unlike Equation (1), the upper limit of the sigma notation of the preprocessing function input is fixed at 7.
Corr i = 0 l I 1 u i v i , p r e i = 0 7 u i m i , i = 0 7 v i m i .

2.4. MixColumns of AES

The MixColumns of AES is defined as the multiplication of the constant matrix. In the equation below, s i , j and s i , j denote the input and output, respectively.
s 0 , 0 s 0 , 1 s 0 , 2 s 0 , 3 s 1 , 0 s 1 , 1 s 1 , 2 s 1 , 3 s 2 , 0 s 2 , 1 s 2 , 2 s 2 , 3 s 3 , 0 s 3 , 1 s 3 , 2 s 3 , 3 = 2 3 1 1 1 2 3 1 1 1 2 3 3 1 1 2 s 0 , 0 s 0 , 1 s 0 , 2 s 0 , 3 s 1 , 0 s 1 , 1 s 1 , 2 s 1 , 3 s 2 , 0 s 2 , 1 s 2 , 2 s 2 , 3 s 3 , 0 s 3 , 1 s 3 , 2 s 3 , 3 .
In AES, byte values are interpreted as Galois field GF 2 8 elements, i.e., if the binary representation of the value d is d 7 d 6 d 5 d 4 d 3 d 2 d 1 d 0 2 , it is interpreted as the element of the Galois field as follows:
d 7 x 7 + d 6 x 6 + d 5 x 5 + d 4 x 4 + d 3 x 3 + d 2 x 2 + d 1 x + d 0 .
Furthermore, AES operation is also defined in the Galois field GF 2 8 . Multiplication is defined by multiplying two binary polynomials and reducing with an irreducible polynomial x 8 + x 4 + x 3 + x + 1 . The general approach to implement multiplication in the Galois field is to repeat the xtime operation, i.e., multiplying the input with x. Multiplying the above polynomial with the polynomial x results in
d 7 x 8 + d 6 x 7 + d 5 x 6 + d 4 x 5 + d 3 x 4 + d 2 x 3 + d 1 x 2 + d 0 x .
As the degree of the irreducible polynomial is 8, if d 7 is zero, the above result does not require reduction. However, if d 7 is 1, subtraction of the irreducible polynomial is needed, i.e., byte-level implementation of the xtime performs different operation depending on d 7 . The MSB of the input is determined as follows:
xtime d = d 1 if MSB d = 0 , d 1 0 x 1 b if MSB d = 1 .
Note that the MSB extraction is required to implement the xtime operation.

Our Challenge

The major challenge we faced in this paper is finding a special intermediate value, shortly SIV, that maintains the correlation coefficient presented in Table 2 when l I = 1 because it is less affected by noise, unlike Equation (3). Thus, because the SIV can accurately model power consumption and retain the theoretical correlation coefficient of the SOCPA is 1.00, using the SIV can significantly increase the performance of the SOCPA.

3. Sparse Intermediate Value in AES

In this section, we find the SIV based on the operational characteristic of the cryptographic algorithm. If there exists some intermediate value that behaves like a shorter length of the intermediate value, it can enhance the SOCPA performance because it raises the correlation between hypothetical intermediate value and preprocessed power consumption, as shown in Table 2 while accurately model power consumption. Typically, the number of all possible outcomes C S of an L S bit intermediate value S is 2 L S .
C S = 2 L S .
However, a special intermediate value SIV may exist such that C SIV is much lower than 2 L SIV because of operational characteristics.
C SIV < 2 L SIV .
Definition 1.
An intermediate value S is SIV if C S < 2 L S .

3.1. Finding the SIV Based on Operational Characteristics

The xtime performs different operations depending on the input’s MSB, as shown in Equation (5). To determine the instruction to be executed in software implementation, the MSB must be extracted and stored in a register. When storing the MSB in an 8-bit register, only 1-bit changes depending on the MSB and the remaining 7 bits are always zero. Let the binary representation of the input d be d 7 d 6 d 5 d 4 d 3 d 2 d 1 d 0 2 . Then the intermediate value S 1 , which is stored in the register when extracting MSB, is s 7 s 6 s 5 s 4 s 3 s 2 s 1 s 0 2 = 0000000 d 7 2 . The C S 1 is only 2, which is much smaller than 2 8 = 256 . Therefore, S 1 can be utilized as the SIV. Thus, we define the Property 1 as follows.
Property 1.
MSB extraction is essential to implementxtime. Therefore, the SIV exists as S 1 = 0000000 d 7 2 , such that C S 1 is only 2.
C S 1 = 00000000 2 , 00000001 2 = 0 x 00 , 0 x 01 .
Listing 1 is one of the xtime implementations in C language. It can be divided into two parts. One part is multiplication by x as the left-side of the XOR operator input 1 , and the other part is reduction by the irreducible polynomial as the right-side input 7 0 x 1 b .
Listing 1: 8-bit implementation of xtime using C language.
Applsci 10 03394 i001
In the reduction part, the MSB is not only extracted at input 7 but also multiplied by 0x1b to decide whether to reduce the left-side result. The intermediate value S 2 , which is stored when the MSB is multiplied by 0x1b, is d 7 × 0001 1011 2 = 000 d 7 d 7 0 d 7 d 7 . As the C S 2 is only 2, S 2 can be utilized as the SIV.
Note that the difference between the Hamming weights of elements in C S 2 is 4, whereas the difference of C S 1 is only 1. The effect of S 2 on power consumption is relatively greater compared to  S 1 .
P S 1 = ϵ × HW S 1 + P n o i s e = ϵ × d 7 + P n o i s e P S 2 = ϵ × HW S 2 + P n o i s e = ϵ × 4 d 7 + P n o i s e .
Therefore, S 2 can relatively reduce the effect of noise. Thus, we define the Property 2 as follows.
Property 2.
If SIV is computed using a certain constant, the computation result is not only utilized as the SIV, it may also significantly affect power consumption. Thus, the computation result can relatively reduce the effect of noise P n o i s e . In the case of Listing 1, the multiplication result S 2 = 000 d 7 d 7 0 d 7 d 7 2 can reduce the effect. The power consumption of S 2 and the collection of all possible outcomes of S 2 are expressed as follows:
P S 2 = ϵ × 4 d 7 + P n o i s e
C S 2 = 00000000 2 , 00011011 2 = 0 x 00 , 0 x 1 b .
We demonstrate the existence of SIV via CPA and t-value. In this paper, we compare the two versions of the CPA, as follows.
  • General CPA: CPA using SubBytes output as an intermediate value.
  • SIV-based CPA: CPA using SIV as an intermediate value.

Demonstration of Existence of SIV

Our experiments demonstrated that the SIV-related power consumption occurs. We analyzed 100,000 power consumption traces at a 29.538 MS/s sampling rate when AES ran on a ChipWhisperer-Lite ATXMEGA128D4 (8-bit processor) [14]. We utilized S 2 as the SIV.
For the FOCPA of the MixColumns, the peak correlation coefficient of the General FOCPA is approximately 0.87, and the peak correlation of the SIV-based FOCPA is around 0.94, as shown in Figure 2. The peak correlation of the two versions of FOCPA is similar, demonstrating the existence of the SIV-related power consumption when performing xtime, as shown in Property 1.
The power consumption of MixColumns is linearly related to the Hamming weight of SubBytes output because the SubBytes output is identical to the MixColumns input. In addition, the correlation of SubBytes is not zero because the Hamming weight of the SIV is linearly related to the MSB of the SubBytes output, as shown in Equation (6).
To demonstrate Property 2, we compared each power consumption of S 1 and S 2 . The power consumption is divided into two groups based on the SIV, and we verified the distributions of each group. Based on Equation (6), the effect of d 7 on the power consumption P S 2 is four times greater than that on P S 1 . Therefore, theoretically, the difference between the mean of the two distributions of S 2 is four times larger than that of S 1 . We utilized the t-value of Welch’s t-test [15] to measure the difference between the two distributions as follows:
t = E X E Y σ X 2 X + σ Y 2 Y ,
where σ X and σ Y denote the standard deviation of X and Y, respectively
Figure 3 shows the experimental proof of Property 2. The difference between the mean of the two distributions of S 2 is around 0.02084, which is approximately 3.5 times larger than that of S 1 (0.005981). This is very close to the theoretical ratio of 4. The t-value of S 2 is approximately 876.22 and that of S 1 is 198.84. Owing to the substantial difference in the means of the two distributions of S 2 , the two distributions are completely separated despite the noise, as shown in Figure 3b, i.e., the effect of noise can be relatively moderated, as demonstrated in Property 2.

3.2. The Performance Improvement of SOCPA Using SIV

In Section 3.1, we demonstrated the existence of SIV using the operational characteristic. In the case of AES, the cardinality of all possible outcomes of SIV is only 2. Moreover, the Hamming weights of outcomes are different. Note that constant multiplication with random variables only affects the sign of the correlation coefficient:
Corr a X , b Y = sign a b · Corr X , Y ,
where a and b are the arbitrary constants, and sign is the sign function. Thus, the theoretical correlation coefficient of Equation (1) is the same as the 1-bit correlation presented in Table 2, although the length of the SIV is 8. For example, let u , v be the S 2 intermediate value, then the theoretical correlation of the SIV is the same as that of some 1-bit intermediate value.
Corr HW u v , p r e HW u , HW v = Corr HW 4 u 7 4 v 7 , p r e HW 4 u 7 , HW 4 v 7 = Corr 4 × u 7 v 7 , p r e 4 u 7 , 4 v 7 = Corr u 7 v 7 , p r e u 7 , v 7 .
Therefore, when the preprocessing functions are AD and PC, the SIV can increase the correlation coefficient of SOCPA from 0.24 to 1.00 and from 0.35 to 1.00, respectively. That is, the SIV theoretically allows to reduce the minimum trace to disclose the secret key, 1 0.24 2 17.3611 times and 1 0.35 2 8.1633 times, respectively [9].

4. Application to OpenSSL AES

In this section, we analyzed the AES implementation of the OpenSSL, one of the most commonly used secure socket layer (SSL) toolkit, and demonstrate that SIV can significantly improve the performance of SOCPA.

4.1. Finding SIV Based on Operational Characteristics

Listing 2 is MixColumns implementation of the OpenSSL version 1.1.1c, which is the latest version. In this listing, t is the AES state, which is the 32-bit array of length 4; r0, r1, and r2 are 32-bit variables for xtime operations and matrix multiplication.
Listing 2: The implementation of MixColumns in OpenSSL version 1.1.1c aes x86core.c.
Applsci 10 03394 i002
In this listing, line 7 is the implementation of xtime. Line 7 can be divided into two parts: performing bytewise 1-bit left shift operation (multiplication by x) as the left-side of the XOR operator r 0 & 0 x 7 f 7 f 7 f 7 f 1 and executing bytewise reduction as the right-side of the XOR operator r 1 r 1 7 & 0 x 1 b 1 b 1 b 1 b .
Note that the bytewise MSB of the input is not only extracted and stored to r1 at line 5 but also calculated by itself at line 7. Table 4 shows the binary representation of the SIVs, wherein X[31:24] denotes the first byte of X. In particularly, because the MSB of each byte of the input determines 7 bits of the subtraction result S 5 , it can reduce the effect of noise to the maximum, similar to Property 2. Therefore, the subtraction result can be utilized as the SIV with the best property. Thus, we define the Property 3 as follows.
Property 3.
Let the binary representation of input d be d 31 d 30 d 0 2 , then the MSB of each byte is d 31 , d 23 , d 15 , d 7 .Assume, without loss of generality, that the analyst considers the first byte of the intermediate value. Thus, the power consumption of S i i 3 , 4 , 5 , 6 is given as follows:
P S i = ϵ × n × d 31 + n × i = 0 2 d 8 i + 7 + P n o i s e ,
where n is the Hamming weight of S i .The remaining 24 bits behave similar to noise. Note that if n is large, the effect of P n o i s e can be relatively reduced.

Demonstration of Existence of SIV

Our experiments demonstrate that the power consumption, which occurs when performing OpenSSL AES on ChipWhisperer UFO STM32F3 (32-bit processor) has the same features as the ATXMEGA128D4 in Section 3.1 [16].
Figure 4 shows the results of the two versions of FOCPA. For the FOCPA of the MixColumns, the peak correlation of the General FOCPA is about 0.50, whereas the peak correlation of the SIV-based FOCPA is about 0.37. The peak correlation coefficients of the two versions of FOCPA are the same. Therefore, the SIV-related power consumption exists.
Figure 5 shows the distribution of power consumption of S 3 and S 5 . The difference between the means of the two distributions of S 5 is approximately 0.003485, which is about 6.8 times larger than that of S 3 (0.000512). This is very close to the theoretical ratio of 7. The t-value of S 5 and S 3 is 107.73 and 24.81, respectively. Consequently, the effect of noise can be relatively reduced, as stated in Property 3.

4.2. Experimental Results of General SOCPA and SIV-Based SOCPA

In this section, we demonstrate that the correlation coefficient of the SIV-based SOCPA is considerably higher than that of General SOCPA. The PC and AD are utilized as preprocessing functions, and the results for AD are presented in Appendix A. The experimental environment is the same as that described in Section 4.1. We analyze the power consumption that occurs while performing OpenSSL AES on ChipWhisperer UFO STM32F (32-bit processor) [16].
To perform SOCPA, the analyst must combine two intermediate values concealed by the same mask. The inputs of the MixColumns share the same mask by row, as shown in Figure 1 [Step 4]. Our attack scenario performs minimum times of the attacks to recover the entire secret key. We analyze each row of the MixColumns by dividing it into two pairs. Thus, the combination of byte indexes of intermediate value for analysis is ( 00 , 04 ) , ( 01 , 05 ) , , ( 11 , 15 ) . Recall that the state of AES is a column-major order array.
Figure 6 shows the bytewise peak correlation of two versions of the SOCPA. The correlation of the SIV-based SOCPA for every combination is higher than that of the General SOCPA, and the average correlation of the SIV-based SOCPA is approximately 1.7 times higher than the General SOCPA. The correlation of the SIV-based SOCPA is not 1.00 because the remaining 24 bits behave similar to noise.
Furthermore, we find the minimum trace to disclose (MTD) to illustrate that the SIV-based SOCPA is more effective, i.e., it can reveal the secret key with less information than the General SOCPA. Figure 7 shows the MTD for a combination of 1st and 5th bytes. In this figure, the SIV-based SOCPA can disclose the secret key with only about 34% of the power trace than that required by the General SOCPA.
Figure 8 shows the MTD of every combination of intermediate values; the maximum MTD of the SIV-based SOCPA is 1717, and that of the General SOCPA is 6643. Therefore, SIV allows the disclosure of the entire secret key using only a quarter of the trace required by the General SOCPA.

5. Countermeasures

We recommend two countermeasures against the SIV-based SOCPA. The first countermeasure changes the sequence of computations to increase the time complexity in calculating the SIV. The second countermeasure is to implement the SIV generating operation using a precomputed table to eliminate power consumption related to the SIV. Typically, Listing 3 is an implementation of the MixColumns to reduce the time complexity in the 8-bit device.

5.1. Increasing the Time Complexity of the SIV-Based SOCPA

The first countermeasure is to modify the MixColumns implementation, as shown in Listing 3. This listing utilizes the associative property to change the sequence of computations to complicate the calculation of the SIV.
Listing 3: Countermeasures to increase the time complexity of the intermediate value [17].
Applsci 10 03394 i003
The existing MixColumns implementation in Listing 2 performs xtime for each term and then adds two terms, as shown on the left-hand side of Equation (7). Contrarily, the proposed implementation adds two terms and then performs xtime, as shown on the right-hand side of Equation (7). To calculate the input of xtime, the analyst must guess two keys XORed with s 0 , 0 and s 0 , 1 .
2 · s 0 , 0 + 2 · s 1 , 0 + s 1 , 0 + s 2 , 0 , + s 3 , 0 = 2 · s 0 , 0 + s 1 , 0 + s 1 , 0 + s 2 , 0 + s 3 , 0 .
Although the SIV occurs in this implementation, the size of keyspace to perform the SIV-based SOCPA increases from 2 16 to 2 32 . Therefore, performing the SIV-based SOCPA is impractical because the complexity of calculating the MSB of the xtime input increases to 2 16 = 65,536 times. As this countermeasure only changes the sequence of computations, there is no overhead for countermeasure.

5.2. Removing Bit Extraction Operation

The second countermeasure is to implement xtime, which is the SIV generating operation, by precomputation table. This implementation does not extract the input’s MSB or generate the SIV; it only refers to the table. Thus, the power consumption related to the SIV does not occur. However, to implement this countermeasure, additional memory is required. Therefore, if the AES is implemented using a precomputed table of SubBytes and MixColumns known as T-table, it requires 4KB memory. Additionally, if a precomputation table achieves the only xtime, 256 bytes of memory are required. As these implementations substitute several operations to memory reference operations, the time complexity is generally lower than Listing 2.

6. Discussion

Herein, the special intermediate value, named SIV, was proposed based on the operational characteristics of the cryptographic algorithm. The SIV of the AES is determined by analyzing the reduction operation of the MixColumns. It remarkably raises the correlation of SOCPA to 1.00 compared to existing studies that have only increase the correlation to 0.35 [8,10,11]. That is, SIV theoretically allows reducing the MTD approximately 8.1633 times than General SOCPA [9].
We analyzed the AES of OpenSSL, which is one of the most commonly used secure socket layer toolkit. As shown in Table 5, correlation is increased from 0.0910 to 0.1722, and the SIV-based SOCPA can disclose the entire secret key with only about quarter trace required for the General SOCPA. The correlation is lower than the theoretical value 1.00 and MTD is not reduced as much as the theory, because the remaining 24 bits behave similarly to noise. However, we showed that the SIV-based SOCPA could improve the analysis performance by more than four times.
Two countermeasures against the SIV-based SOCPA were recommended. The first is the ability to double the keyspace that must be guessed to calculate SIV, which increases the time complexity by 65,536 times. The countermeasure does not require any computation and memory overhead. Next is the implementation of the lookup table, which performs transformation without the subroutine that causes the SIV. This countermeasure has a 4 KB memory overhead. Typically, these two countermeasures provide guidelines for implementation that are resistant to the SIV-based SOCPA.
Our limitation is that, unlike improvements the preprocessing function is applicable to every cryptography, SIV-based SOCPA has to analyze the operational characteristic to determine the SIV for each cryptography, and we only discovered the SIV of the AES. And we applied only to the AES

7. Conclusions

In this paper, we proposed a special intermediate value, SIV, that has a unique characteristic.
The SIV improves the SOCPA performance significantly because it can accurately model power consumption and retain the theoretical correlation of 1-bit intermediate value. When the length of the intermediate value is 8, existing researches have only improved the correlation to 0.35, but the SIV has remarkably raised the correlation to 1.00. That is, the MTD for the General SOCPA requires at least 8.1633 times more traces than the FOCPA, whereas the SIV-based SOCPA is theoretically the same as the FOCPA.
We analyzed the OpenSSL, which is the most commonly used open-source secure socket layer, and confirmed that there exists the SIV. Consequently, the proposed SIV-based SOCPA can disclose the whole secret key using only a quarter of the trace required by the General SOCPA. Further, we recommended two countermeasures as a guideline for implementing a cryptographic algorithm that is resistant to the proposed method.
The limitation of the proposed method is that it has to discover the SIV for each cryptographic algorithms or implementation. In this paper, only the AES was analyzed. Finding the SIV from other cryptographic algorithms is an interesting further work. Thus in the future, we are going to apply to the proposed method for other cryptographic algorithms.

Author Contributions

Writing—original draft, J.-H.K., B.-Y.S. and D.-G.H.;Writing—review and editing, J.-H.K., B.-Y.S. and D.-G.H. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Acknowledgments

This work was supported by Institute for Information & communications Technology Promotion(IITP) grant funded by the Korea government(MSIT) (No. 2017-0-00520, Development of SCR-Friendly Symmetric Key Cryptosystem and Its Application Modes). Additionally, this work was supported as part of Military Crypto Research Center(UD170109ED) funded by Defense Acquisition Program Administration(DAPA) and Agency for Defense Development(ADD).

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
SIVSparse intermediate value
CPACorrelation power analysis
FOCPAFirst-order correlation power analysis
SOCPASecond-order correlation power analysis
HWHamming weight
MSBMost significant bit
PCProduct-combining
ADAbsolute-difference
AESAdvanced encryption standard

Appendix A. Second-Order CPA Results

Figure A1. Correlation coefficient of the two versions of SOCPA on MixColumns (Absolute-Difference).
Figure A1. Correlation coefficient of the two versions of SOCPA on MixColumns (Absolute-Difference).
Applsci 10 03394 g0a1
Figure A2. Minimum trace to disclosure for MixColumns for a combination of 1st and 5th bytes (Absolute-Difference).
Figure A2. Minimum trace to disclosure for MixColumns for a combination of 1st and 5th bytes (Absolute-Difference).
Applsci 10 03394 g0a2
Figure A3. Minimum trace to disclosure (MTD) for MixColumns (Absolute-Difference).
Figure A3. Minimum trace to disclosure (MTD) for MixColumns (Absolute-Difference).
Applsci 10 03394 g0a3

References

  1. Kocher, P.C. Timing Attacks on Implementations of Diffie-Hellman, RSA, DSS, and Other Systems. In Proceedings of the Advances in Cryptology—CRYPTO ’96, 16th Annual International Cryptology Conference, Santa Barbara, CA, USA, 18–22 August 1996; pp. 104–113. [Google Scholar] [CrossRef] [Green Version]
  2. Kocher, P.C.; Jaffe, J.; Jun, B. Differential Power Analysis. In Proceedings of the Advances in Cryptology— CRYPTO ’99, 19th Annual International Cryptology Conference, Santa Barbara, CA, USA, 15–19 August 1999; pp. 388–397. [Google Scholar] [CrossRef] [Green Version]
  3. Gandolfi, K.; Mourtel, C.; Olivier, F. Electromagnetic Analysis: Concrete Results. In Proceedings of the Cryptographic Hardware and Embedded Systems—CHES 2001, Third International Workshop, Paris, France, 14–16 May 2001; pp. 251–261. [Google Scholar] [CrossRef] [Green Version]
  4. Genkin, D.; Shamir, A.; Tromer, E. RSA Key Extraction via Low-Bandwidth Acoustic Cryptanalysis. In Proceedings of the Advances in Cryptology—CRYPTO 2014—34th Annual Cryptology Conference, Santa Barbara, CA, USA, 17–21 August 2014; Part I. pp. 444–461. [Google Scholar] [CrossRef] [Green Version]
  5. Ferrigno, J.; Hlavác, M. When AES blinks: Introducing optical side channel. IET Inf. Secur. 2008, 2, 94–98. [Google Scholar] [CrossRef]
  6. Brier, E.; Clavier, C.; Olivier, F. Correlation Power Analysis with a Leakage Model. In Proceedings of the Cryptographic Hardware and Embedded Systems—CHES 2004: 6th International Workshop, Cambridge, MA, USA, 11–13 August 2004; pp. 16–29. [Google Scholar] [CrossRef] [Green Version]
  7. Herbst, C.; Oswald, E.; Mangard, S. An AES Smart Card Implementation Resistant to Power Analysis Attacks. In Proceedings of the Applied Cryptography and Network Security, 4th International Conference, ACNS 2006, Singapore, 6–9 June 2006; pp. 239–252. [Google Scholar] [CrossRef]
  8. Chari, S.; Jutla, C.S.; Rao, J.R.; Rohatgi, P. Towards Sound Approaches to Counteract Power-Analysis Attacks. In Proceedings of the Advances in Cryptology—CRYPTO ’99, 19th Annual International Cryptology Conference, Santa Barbara, CA, USA, 15–19 August 1999; Wiener, M.J., Ed.; Lecture Notes in Computer Science; Springer: Berlin, Germany, 1999; Volume 1666, pp. 398–412. [Google Scholar] [CrossRef] [Green Version]
  9. Tillich, S.; Herbst, C.; Mangard, S. Protecting AES Software Implementations on 32-Bit Processors Against Power Analysis. In Proceedings of the Applied Cryptography and Network Security, 5th International Conference, ACNS 2007, Zhuhai, China, 5–8 June 2007; pp. 141–157. [Google Scholar] [CrossRef]
  10. Messerges, T.S. Using second-order power analysis to attack DPA resistant software. In Proceedings of the International Workshop on Cryptographic Hardware and Embedded Systems, Worcester, MA, USA, 17–18 August 2000; Springer: Berlin, Germany, 2000; pp. 238–251. [Google Scholar]
  11. Prouff, E.; Rivain, M.; Bevan, R. Statistical Analysis of Second Order Differential Power Analysis. IEEE Trans. Comput. 2009, 58, 799–811. [Google Scholar] [CrossRef]
  12. Moradi, A. Side-Channel Leakage through Static Power—Should We Care about in Practice? In Proceedings of the Cryptographic Hardware and Embedded Systems—CHES 2014—16th International Workshop, Busan, Korea, 23–26 September 2014; pp. 562–579. [Google Scholar] [CrossRef] [Green Version]
  13. Joye, M.; Paillier, P.; Schoenmakers, B. On Second-Order Differential Power Analysis. In Proceedings of the Cryptographic Hardware and Embedded Systems—CHES 2005, 7th International Workshop, Edinburgh, UK, 29 August–1 September 2005; pp. 293–308. [Google Scholar] [CrossRef] [Green Version]
  14. ChipWhisperer-Lite. Available online: https://wiki.newae.com/CW1173_ChipWhisperer-Lite (accessed on 24 April 2020).
  15. Welch, B.L. The generalization ofstudent’s’ problem when several different population variances are involved. Biometrika 1947, 34, 28–35. [Google Scholar] [PubMed]
  16. ChipWhisperer UFO. Available online: https://wiki.newae.com/CW308T-STM32F (accessed on 24 April 2020).
  17. Ahmed, E.G.; Shaaban, E.; Hashem, M. Lightweight Mix Columns Implementation for AES. In Proceedings of the 11th WSEAS International Conference on Mathematical Methods and Computational Techniques in Electrical Engineering, MMACTEE’09, Athens, Greece, 28–30 September 2009; World Scientific and Engineering Academy and Society (WSEAS): Stevens Point, WI, USA, 2009; pp. 48–53. [Google Scholar]
Figure 1. Masks to XOR to intermediate values for each transformation.
Figure 1. Masks to XOR to intermediate values for each transformation.
Applsci 10 03394 g001
Figure 2. Results of General FOCPA and SIV-based FOCPA (0th byte).
Figure 2. Results of General FOCPA and SIV-based FOCPA (0th byte).
Applsci 10 03394 g002
Figure 3. Distributions of power consumption that occurs when storing S 1 and S 2 .
Figure 3. Distributions of power consumption that occurs when storing S 1 and S 2 .
Applsci 10 03394 g003
Figure 4. Results of General FOCPA and SIV-based FOCPA. (0th byte).
Figure 4. Results of General FOCPA and SIV-based FOCPA. (0th byte).
Applsci 10 03394 g004
Figure 5. Distributions of power consumption that occurs when executing copy operation and xtime operation of OpenSSL.
Figure 5. Distributions of power consumption that occurs when executing copy operation and xtime operation of OpenSSL.
Applsci 10 03394 g005
Figure 6. Peak correlation coefficient of the two versions of SOCPA on MixColumns (Product-Combining).
Figure 6. Peak correlation coefficient of the two versions of SOCPA on MixColumns (Product-Combining).
Applsci 10 03394 g006
Figure 7. Minimum trace to disclosure for MixColumns for a combination of 1st and 5th bytes (Production-Combining).
Figure 7. Minimum trace to disclosure for MixColumns for a combination of 1st and 5th bytes (Production-Combining).
Applsci 10 03394 g007
Figure 8. Minimum trace to disclosure for MixColumns (Product-Combining).
Figure 8. Minimum trace to disclosure for MixColumns (Product-Combining).
Applsci 10 03394 g008
Table 1. Notations.
Table 1. Notations.
NotationDescription
XOR, ⊕Exclusive-OR operation
Binary left (right) shift operation
P D Power consumption when manipulating data D
P n o i s e Noise power
ϵ Constant
u 7 u 6 u 0 2 The binary representation of u
KThe secret key, K = ( K n 1 K n 2 K 0 ) 2 W , n W = | K |
WNumber of bits in a word
G K Guessed key, G K 0 , 1 W
NNumber of traces
P Plaintext set P = p 1 , , p N
T Trace set T = t 1 , , t N
p r e Preprocessing function
fArbitrary operation
f P , K Set of f p i , K 1 i N
Corr X , Y Pearson’s correlation coefficient for variables X and Y
E X The expectation for variable X
HW x Hamming weight of x
MSB x Most significant bit of x
PCProduct-combining
ADAbsolute-difference
C S Collection of all possible outcomes of intermediate value S
L S Bit length of the intermediate value S
X Cardinality of a set X
Table 2. Correlation coefficients of Equation (1) for preprocessing functions and the bit length of intermediate values [11,13].
Table 2. Correlation coefficients of Equation (1) for preprocessing functions and the bit length of intermediate values [11,13].
Preprocessing FunctionBit Length l I
1248
PC1.000.710.500.35
AD1.000.530.340.24
Table 3. Theoretical correlation coefficients of Equation (2) for preprocessing functions and the bit length of intermediate values when the length of the register is 8.
Table 3. Theoretical correlation coefficients of Equation (2) for preprocessing functions and the bit length of intermediate values when the length of the register is 8.
Preprocessing FunctionBit Length l I
1248
PC0.130.180.250.35
AD0.080.120.170.24
Table 4. Binary representation of the first byte of the SIVs for each operation when performing xtime in OpenSSL aes_x86core.c.
Table 4. Binary representation of the first byte of the SIVs for each operation when performing xtime in OpenSSL aes_x86core.c.
SIVOperationMSB 1MSB 0
S 3 r1[31:24] 10000000 2 00000000 2
S 4 (r1 ≫ 7)[31:24] 00000001 2 00000000 2
S 5 (r1 - (r1 ≫ 7))[31:24] 01111111 2 00000000 2
S 6 ((r1 - (r1 ≫ 7)) & 0x 1 b 1 b 1 b 1 b )[31:24] 00011011 2 00000000 2
Table 5. Average peak correlation coefficient and maximum of minimum trace to disclosure of two versions of SOCPA on MixColumns (Product-Combining).
Table 5. Average peak correlation coefficient and maximum of minimum trace to disclosure of two versions of SOCPA on MixColumns (Product-Combining).
SIV-Based SOCPAGeneral SOCPA
Average of peak correlation0.17220.0910
Maximum of minimum trace to disclosure17176643

Share and Cite

MDPI and ACS Style

Kim, J.-H.; Sim, B.-Y.; Han, D.-G. SIV: Raise the Correlation of Second-Order Correlation Power Analysis to 1.00. Appl. Sci. 2020, 10, 3394. https://doi.org/10.3390/app10103394

AMA Style

Kim J-H, Sim B-Y, Han D-G. SIV: Raise the Correlation of Second-Order Correlation Power Analysis to 1.00. Applied Sciences. 2020; 10(10):3394. https://doi.org/10.3390/app10103394

Chicago/Turabian Style

Kim, Ju-Hwan, Bo-Yeon Sim, and Dong-Guk Han. 2020. "SIV: Raise the Correlation of Second-Order Correlation Power Analysis to 1.00" Applied Sciences 10, no. 10: 3394. https://doi.org/10.3390/app10103394

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop