Next Article in Journal
A Multi-Terminal HVdc Grid Topology Proposal for Offshore Wind Farms
Next Article in Special Issue
An Automated End-to-End Side Channel Analysis Based on Probabilistic Model
Previous Article in Journal
Magnetic Nanowires
Previous Article in Special Issue
Memory Efficient Implementation of Modular Multiplication for 32-bit ARM Cortex-M4
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Single Trace Analysis against HyMES by Exploitation of Joint Distributions of Leakages

1
Center for Information Security Technologies (CIST), Korea University, Seoul 02841, Korea
2
Department of Cyber Security, College of Science and Technology, Korea University, Sejong 30019, Korea
3
Department of Information Security, Cryptology, and Mathematics, Kookmin University, Seoul 02707, Korea
*
Author to whom correspondence should be addressed.
Appl. Sci. 2020, 10(5), 1831; https://doi.org/10.3390/app10051831
Submission received: 21 January 2020 / Revised: 28 February 2020 / Accepted: 2 March 2020 / Published: 6 March 2020
(This article belongs to the Special Issue Side Channel Attacks and Countermeasures)

Abstract

:
Beginning with the proposal of the McEliece cryptosystem in 1978, code-based cryptography has positioned itself as one of main categories in post-quantum cryptography (PQC). To date, the algebraic security of certain variants of McEliece cryptosystems has been challenged many times, although some of the variants have remained secure. However, recent studies on code-based cryptography have focused on the side-channel resistance since previous studies have indicated that the existing algorithms were vulnerable to side-channel analysis. In this paper, we propose the first side-channel attack on the Hybrid McEliece Scheme (HyMES) using only a single power consumption trace. HyMES is a variant of the McEliece system that provides smaller keys, along with faster encryption and decryption speed. By exploiting joint distributions of nonlinear functions in the decryption process, we were able to recover the private key of HyMES. To the best of our knowledge, this is the first work proposing a side-channel analysis based on a joint distribution of the leakages on the public-key system.

1. Introduction

Currently, main public-key cryptosystems in use (such as Rivest–Shamir–Adleman (RSA) and elliptic-curve cryptography (ECC)) are based on the difficulty of number theoretic problems. For example, RSA is based on the difficulty of factoring large numbers, while ECC is based on the difficulty of solving discrete logarithm problems on elliptic curves. However, when a quantum computer is put into practical use running the Shor algorithm, these problems can be solved in polynomial time, thus making the RSA and ECC insecure [1]. Studies on post-quantum cryptography have been actively conducted worldwide in attempts to solve this problem. Post-quantum cryptography involves a cryptographic algorithm that runs on a classical computer, and it is believed to be immune to quantum attacks. There are several categories of post-quantum cryptography: multivariate-based, lattice-based, code-based, isogeny-based cryptography, and hash-based digital signature algorithms. Multivariate cryptography is based on the difficulty of solving multivariate equation systems. Lattice-based cryptography is based on the difficulty of solving several lattice problems. Code-based cryptography is based on the difficulty of decoding general linear codes. Isogeny-based cryptography is based on the hardness of finding isogeny between elliptic curves. Finally, hash-based digital signature algorithms are based on the security of cryptographic hash functions. Among these categories, code-based cryptography has been researched the most due to its fast encryption and decryption speeds [2]. Additionally, code-based cryptosystems account for the second-most submitted categories to the National Institute of Standards and Technology (NIST) standardization project [3].
The first code-based cryptosystem was the McEliece cryptosystem, which was proposed by Robert McEliece in 1978 [4]. The McEliece cryptosystem was cryptographic scheme to use randomization in the encryption process. Since the main building block in implementing a McEliece cryptosystem is matrix multiplication, it provides faster encryption and decryption speeds than RSA [2]. However, one disadvantage of code-based cryptosystems is the key size involved in such systems. For example, the public key size of McEliece base on the Goppa code is about 437KB for 80-bit security [5]. Hybrid McEliece Scheme (HyMES) is a variant of the McEliece system that was proposed by B.Biswas in 2008 [6]. Since the public-key of HyMES uses a generator matrix represented in reduced row echelon form, it has a smaller key size than the classical McEliece. For 80-bit security, the public-key size of HyMES is 63KB, and it also provides faster speed than the classical McEliece [5].
Although the McEliece cryptosystem is theoretically secure, there could be certain vulnerabilities when implementing such a system [7,8,9]. For example, the side-channel analysis proposed by Kocher et al. is an attack based on information gained from the implementation rather than from the algorithm itself [10,11]. During the execution of an algorithm, additional information, such as time, power consumption, and electromagnetic information, can be used to reveal a secret key. Since the side-channel attack is now considered as a de facto standard, post-quantum cryptography (PQC) should similarly consider possible side-channel attacks in order to substitute RSA and ECC.
The first proposed side-channel attack on McEliece is the timing attack, which was proposed by Strenzke in 2008 [7]. In Reference [7], they revealed the secret key by exploiting the fact that the time difference information is related to the error bits of the codeword. Since the attack proposed by Strenzke, constant-time implementations have been considered when constructing and implementing code-based cryptosystems [12]. In 2010, Heyse et al. proposed the SPA (Simple Power Analysis) on McEliece [9]. Their attack involved analyzing the power consumption trace obtained during the decoding process. However, due to the structure of the decryption algorithm, the SPA proposed in Reference [9] cannot be applied to HyMES. On the other hand, Y. Linge proposed a side-channel analysis technique with which to identify a secret key by using the probability distribution of the input and the output of a nonlinear function varying with the secret key value [13]. The joint distribution is a probability distribution considering two or more random variables. The side-channel analysis using the joint distribution has only been investigated in the symmetric key cryptography, and several traces have been used.
In this paper, we present our proposed side-channel analysis on HyMES using a single power consumption trace. The main contributions of this paper are as follows.
  • We propose the first side-channel analysis on HyMES using the joint distributions of leakages. We target the non-linearity of the pre-computation table in HyMES implementation [6]. By analyzing the leakage that occurs while calculating the parity-check matrix, we are able to recover the Goppa polynomial g ( z ) and the support L s e c , which are the secret keys of HyMES. The proposed method only uses one power consumption trace, and it is the first joint distribution based analysis for public-key cryptography. Moreover, we demonstrate that any other public-key cryptosystem using nonlinear operation can be vulnerable to our attack. The details of our attack are presented in Section 3.
  • We present an experimental result validating the efficiency of the proposed attack. We confirm that the proposed method works as expected by using simulated power traces. These simulated traces are collected by adding noise to the Hamming weight model. The attack success rate is 100% up to the noise standard deviation of 1.3. Further, we show that the performance of the proposed attack increase when several traces are used. When 10 traces are used, the attack success rate is 100% up to the noise standard deviation of 2.1.
The remainder of this paper is organized as follows. Section 2 provides background on code-based cryptography and discusses the side-channel attack used for the analysis. Section 3 provides a high-level description of the proposed attack. Section 4 shows the experimental results using the simulation traces. Finally, the conclusion is drawn in Section 5.

2. Related Works

In this section, we describe the backgrounds of concepts to be used throughout this paper. First, we briefly introduce binary Goppa code, which is one of the error correcting codes used in HyMES. We introduce the basic concepts in code-based cryptography and structures of HyMES. Finally, we introduce the side-channel analysis exploiting the joint distributions of leakages, which is the key attack method in the proposed analysis.

2.1. Binary Goppa Code

This paper only discusses basic information about the binary Goppa code over the finite field F 2 . The Goppa code consists of the Goppa polynomial g ( z ) and support L s e c . The g ( z ) and L s e c are defined in Definition 3.
Definition 1.
For positive integer m , t , Goppa polynomial g ( z ) and support L are as follows.
g ( z ) = i = 0 t g i z i F 2 m [ z ]
L = { α 0 , , α n 1 } F 2 m n , g ( α j ) 0 , 0 j n 1 .
The syndrome S c ^ required to decode the Goppa code is denoted in Equation (1). The binary [ n , k , d c ] -Goppa code is defined as the set of all c ^ that have the syndrome S c ^ at zero in Equation (2). Since the parity check matrix H spans the null space of C, as shown in Definition 2, we can derive H from the syndrome S c ^ as in Equation (3).
Definition 2.
For the Goppa polynomial g ( z ) and the support L = { α 0 , , α n 1 } , the syndrome S c ^ is as follows.
S c ^ = i = 0 n 1 c i ^ g ( α i ) g ( z ) g ( α i ) z α i i = 0 n 1 c i ^ z α i mod g ( z ) ,
G o p p a ( L , g ( z ) ) = { c ^ F 2 m n S c ^ = i = 0 n 1 c i ^ z α i 0 mod g ( z ) } ,
H = g t g ( α 0 ) g t g ( α 1 ) g t g ( α n 1 ) g t α 0 + g t 1 g ( α 0 ) g t α 0 + g t 1 g ( α 1 ) g t α 0 + g t 1 g ( α n 1 ) g t α 0 t 1 + + g 2 α + g 1 g ( α 0 ) g t α 0 t 1 + + g 2 α + g 1 g ( α 1 ) g t α 0 t 1 + + g 2 α + g 1 g ( α n 1 ) .
The H in Equation (3) can be simplified as shown in Equation (4), and the H ^ can be used as the parity check matrix because the determinant of H g is not 0.
H = g t 0 0 g t 1 g t 0 g 1 g 2 g t × 1 g ( α 0 ) 1 g ( α 1 ) 1 g ( α n 1 ) α 0 g ( α 0 ) α 1 g ( α 1 ) α n 1 g ( α n 1 ) α 0 t 1 g ( α 0 ) α 1 t 1 g ( α 1 ) α n 1 t 1 g ( α n 1 ) = H g × H ^ .

2.2. Code-Based Cryptography

Error correction codes were first developed in 1947 by Richard Hamming. The technique was developed to enable the reliable delivery of digital data over unreliable communication channels. In this technique, the sender encodes the data using an error-correcting code prior to transmission. The additional information added by the code is used by the receiver to recover the original data. However, decoding is only efficient for linear codes with efficient decoding algorithms. The code-based cryptosystems make use of the fact that decoding the syndrome of a general linear code is known to be NP-hard, while efficient algorithms exist for the decoding of specific linear codes. The Goppa codes are an example of efficient correcting codes that can be turned into a secure coding scheme when the decoding functions are kept secret. Only an attacker in possession of the secret decoding function can remove the secret mapping and recover the plaintext. Before describing the Goppa codes, the definition of binary linear code is presented in Definition 1. The definitions of the generator matrix G and the parity check matrix H are as denoted in Definition 2.
Definition 3.
Binary linear code [ n , k ] C is a one-to-one function that takes a k-bit string message and outputs a n-bit string codeword.
Definition 4.
If the row vector space of k × n matrix G spans C over finite field F and the dimension of row vector space is k, then matrix G is the generator matrix of [ n , k ] C over F. For the ( n k ) × n matrix H, if the column vectors of H T are the basis of the null space of G, H is the parity check matrix of C.

2.2.1. McEliece Cryptosystem

The McEliece cryptosystem was the first code-based public-key cryptosystem proposed by McEliece in 1978 [4]. Although the algorithm states that any error-correcting codes can be used, only McEliece with Goppa codes has resisted cryptanalysis to date [14,15]. In this paper, we define classical McEliece as McEliece with Goppa code. The encryption and decryption processes of McEliece are respectively described in Algorithms 1 and 2. In step 2, the generator matrix G corresponding to the code C is a matrix consisting of the basis sequences necessary for generating C. Therefore, k represents the dimension of code C. G is computed by using Goppa polynomial of degree t, which is the primary part of the public key. Scrambling matrix S and a permutation matrix P need to hide the algebraic structure of G. These are generated randomly and multiplied with G [4]. H W ( e ) is the number of 1 when e is expressed in binary.
Algorithm 1 Classical McEliece: Encryption
InputM,Kpub = ( G ^ = S G P , t )
Output Ciphertext c
1:
Represent the message M as k-bit vector m
2:
Generate a random n-bit vector e. H W ( e ) t
3:
return c = m × G ^ + e
Algorithm 2 Classical McEliece: Decryption
Inputc,Ksec = ( G , S 1 , P 1 )
Output Message M
1:
Compute the c ^ = c × P 1
2:
Compute the syndrome S c ^
3:
Obtain a k-bit m ^ = m × S from S c ^ using decoding algorithm D G o p p a ( c ^ )
4:
Compute the m = m ^ × S 1
5:
Represent the m as a message M
6:
return M

2.2.2. HyMES (Hybrid McEliece Scheme)

The HyMES was proposed by B.Biswas and N.Sendrier, who were members of the SECRET team at the INRIA Lab in 2008 [6]. The HyMES is a variant of the McEliece cryptosystem that provides a smaller key size and faster encryption rate than McEliece for the same security level. The key generation algorithm of HyMES is described below.
In step 1 of Algorithm 3, Goppa polynomial is chosen as an irreducible polynomial. In this case, since the minimum distance of the code satisfies d c 2 t + 1 , a valid user can correct a maximum of t errors. In step 2, the number of supports n is used as the number of all elements of G F ( 2 m ) , and the supports are selected randomly from 0 to 2 m 1 in order. The public-key size of HyMES is k × ( n k ) , which is reduced to k × k relative to the Classical McEliece whose public-key size is k × n . The encryption and decryption algorithms are denoted in Algorithms 4 and 5, respectively.
Algorithm 3 HyMES: Key Generation
Inputt,n,m
OutputKsec,Kpub
1:
Generate a random monic polynomial g ( z ) as the Goppa polynomial g ( z ) = z t + c t 1 z t 1 + + c 1 z + c 0 , deg ( g ( z ) ) = t , c i G F ( 2 m )
2:
Randomly choose the support L = { α 0 , , α n 1 } , α i G F ( 2 m ) , g ( α i ) 0
3:
Compute the parity check matrix H ^
4:
Convert the parity check matrix to the systematic form H ^ s y s = S ^ H ^ P ^ = ( Q T I n k )
5:
If the parity check matrix H ^ is not converted to the systematic form ( Q T I n k ) , go back to step 1
6:
Replace support L with L s e c = L P ^ using P ^
7:
Compute G s y s = ( I k Q ) = S G P
8:
return K s e c = ( g ( z ) , L s e c ) , K p u b = G s y s = ( I k Q )
Algorithm 4 HyMES: Encryption
Input M , K p u b = G s y s = ( I k Q )
Output Ciphertext c
1:
Represent the message M as k-bit vector m
2:
Generate a random n-bit vector e. H W ( e ) t
3:
Return c = m × G s y s + e
Algorithm 5 HyMES: Decryption
Input c , K s e c = ( g ( z ) , L s e c )
Output Message M
1:
Compute the syndrome S c = ( H P ^ ) c T
2:
Obtain a k-bit m ^ = m × S × G × P = m G s y s = m ( I k Q ) = ( m m Q ) from S c using decoding algorithm D G o p p a ( c )
3:
Obtain m from the top k-bit of m ^ .
4:
Represent the m as a message M
5:
return M
In step 3 of Algorithm 4, it is not necessary to multiply the identity matrix I k for matrix multiplication with m and G s y s , so the encryption speed of HyMES is faster than that of the Classical McEliece.

2.3. Side-Channel Analysis by Exploiting Joint Distributions of Leakages

The side-channel analysis is an attack which exploits any weakness that occurs during the execution of a cryptographic algorithm. The first side-channel analysis using power consumption was proposed by Kocher et al. in Reference [11]. Later, S. Chari proposed the template attack in Reference [16], and then K.Schramm proposed a collision attack in Reference [17]. Since then, various side-channel attacks have proposed for various algorithms. Regarding code-based cryptography, Heyse et al. proposed SPA on the decoding process of the Classical McEliece in 2010 [9]. The proposed method used the leakage obtained when multiplying a matrix P 1 before calculating the syndrome during decryption. However, since HyMES does not multiply P 1 before calculating the syndrome in the decryption process, the method proposed in [9] cannot be used. Therefore, we analyzed HyMES by exploiting the joint distributions of leakages. In this section, we describe in detail the analysis exploiting the joint distributions of leakages.
In 2014, Y. Linge proposed a method of determining the secret key of AES by using the joint distributions [13]. They exploited the joint distributions of the input and output of the S-box, which is a nonlinear function of AES. Since this distribution depends on the key value, an attacker can identify the secret key under the assumption that the value of the plaintext pair is unknown. The attack procedure proposed by Y. Linge is described in Algorithm 6. The function g takes k and a as arguments and outputs b. The function ϕ outputs the input’s Hamming weight. In Reference [13], the function g is selected as the AES S-box. In this example, the attack is described based on the S-box used in the first round SubBytes of AES.
Algorithm 6 Side channel analysis using joint distributions
Input ( a i b i ) , = 0 , , M 1
Outputkey
1:
g : K × A B , N = | K | , S ( g , k ) , S d { 0 , , n } × { 0 , , m }
2:
for k K           ← computation of theoretical joint distributions
3:
S ( g , k ) 0
4:
 for a A
5:
   S ( g , k ) ( ϕ ( a ) , ϕ ( g ( a , k ) ) ) S ( g , k ) ( ϕ ( a ) , ϕ ( g ( a , k ) ) + 1 | A |
6:
 end
7:
end
8:
S d 0
9:
for i = 0 : M 1            ← computation of estimated joint distribution
10:
S d ( a i , b i ) S d ( a i , b i ) + 1 M
11:
end
12:
k e y 0
13:
for k K           ← compare theoretical distribution and estimated distribution
14:
 if d ( S ( g , k ) , S d ) < d ( S ( g , k e y ) , S d )
15:
   k e y k
16:
 end
17:
end
18:
return k e y
First, steps 2–7 of Algorithm 6 are the processes involved in making the theoretical joint distributions table, which uses the Hamming weight values of random variables, plaintext a, and S-box output b. This process is performed for key k = 0–255 with a 1-byte size. The S ( g , k ) is the theoretical joint distribution table of ϕ ( a ) and ϕ ( b ) when the key is k for function g. The size of S ( g , k ) is 9 × 9, since the range of possible Hamming weights for a and b is 0-8. Next, steps 9–11 are the processes of constructing the estimated joint distribution table using ( a i , b i ) pairs, which are the estimated Hamming weight values of a and b. Finally, steps 13–18 are the processes for obtaining the similarity between the estimated distribution and the theoretical distribution. The guessed key is the one with the highest similarity to the real key.
In order to construct the estimated joint distribution table, the Hamming weight values of the plaintext a and the output b are estimated from the collected power consumption traces. Although the Hamming weight values should be accurately estimated for the performance of the attack, it is very difficult to accurately guess the Hamming weight values due to the noise signal. In 2017, an improved method was proposed that use a maximum likelihood method that reflects the influence of noise as a probability [18]. An attack using the joint distributions of leakages is possible because the joint distribution depends on the key value, which occurs because the AES S-box is sufficiently non-linear. The attack using the joint distribution has only been investigated in symmetric key cryptography.

3. Single Trace Analysis Against HyMES

In this section, we propose for the first time a side-channel attack on HyMES exploiting the joint distributions of the leakages. First, we present an outline of the proposed attack. Then, we describe the two steps used to recover the secret key ( g ( z ) , L s e c ) .

3.1. Outline of the Proposed Attack

Our attack targets the leakage obtained during the computation of H P ^ . Note that H P ^ is required for syndrome operation S c ^ = ( H P ^ ) c T in step 1 of Algorithm 5. The implementation of HyMES proposed in Reference [6] includes the process of calculating the column vectors h i of H P ^ in the key generation algorithm. The implementation precomputes the values h i , i = 0 , , n 1 and stores the result as a secret key. Since these values are required to compute the syndrome, they can also be directly calculated in the decryption process if they are not precomputed. Therefore, without loss of generality, we may assume that the h i is calculated in the same way as described in Algorithm 7.
Algorithm 7 computes the H P ^ using the secret key L s e c which is substituted with the permutation matrix P ^ . The h i with length m t -bit can be expressed as a polynomial of degree t 1 degree polynomial over G F [ 2 m ] , as shown in Equation (5).
h i = h i [ t 1 ] z t 1 + h i [ t 2 ] z t 2 + + h i [ 0 ] .
Algorithm 7 HyMES Implementation: Computation of H P ^ [6]
Input g ( z ) = z t + g t 1 z t 1 + + g 0 , L s e c = { α 0 , , α n 1 } , n = 2 m
Output the column vectors h i , i = 0 , , n 1 of H P ^
1:
for i = 0 : n 1
2:
h i [ t 1 ] 1
3:
 for j = t 2 : 0
4:
   h i [ j ] g j + 1 ( α i × h i [ j + 1 ] )
5:
 end
6:
a g 0 ( α i × h i [ 0 ] )
7:
 for j = 0 : t 1
8:
   h i [ j ] h i [ j ] / a
9:
 end
10:
end
11:
return h i , i = 0 , , n 1
To recover the secret key ( g ( z ) , L s e c ) , the proposed attack is divided into two stages. The first stage of the attack identifies the Goppa polynomial g ( z ) based on the joint distributions of leakages. The second stage finds the remaining secret key L s e c through the horizontal correlation analysis by using g ( z ) obtained in the first stage. In Section 3.2 and Section 3.3, we explain how to determine g ( z ) and L s e c , respectively.

3.2. Recovering g ( z )

The multiplication and division involved in Algorithm 7 are computed over the field G F ( 2 m ) . In general, the multiplication and division on G F ( 2 m ) are implemented using the exponentiation-table and the log-table for the purpose of speed efficiency. For the root α of the primitive polynomial p ( x ) that constitutes G F ( 2 m ) , the exponentiation-table takes the positive integer i as input and returns α i . The log-table is constructed to return i by taking the element α i of G F ( 2 m ) as an input. In Reference [6], the multiplication and division are computed by addition, subtraction, and modulus operations using the pre-computed log-table and exponentiation-table. Note that using the tables is more efficient than directly computing the exponentiations and logarithm values. The implementations of multiplication and division over G F ( 2 m ) are as shown in Algorithms 8 and 9, respectively.
Algorithm 8 HyMES implementation: Multiplication over G F ( 2 m ) [6]
Input a , b G F ( 2 M ) , exp [ i ] = α i , log [ α i ] = i , i = 0 , , 2 m 1 m o d ( d ) = ( ( d ) ( 2 m 1 ) ) + ( ( d ) > > m )
Output the column vectors a × b G F ( 2 m )
1:
if a or b = 0
2:
a × b 0
3:
else
4:
a × b exp [ m o d ( log [ a ] ) + log [ b ] ]
5:
end
6:
return a × b
Algorithm 9 HyMES implementation: Division over G F ( 2 m ) [6]
Input a , b G F ( 2 M ) , exp [ i ] = α i , log [ α i ] = i , i = 0 , , 2 m 1 m o d ( d ) = ( ( d ) ( 2 m 1 ) ) + ( ( d ) > > m )
Output the column vectors a / b G F ( 2 m )
1:
if a = 0
2:
a / b 0
3:
else
4:
a / b exp [ m o d ( log [ a ] ) log [ b ] ]
5:
end
6:
return a / b
Now that the basic field operations have been explained, we present the method to recover g ( z ) . To find g ( z ) , we must find the coefficients g t 1 , g t 2 , , g 0 of all the orders of g ( z ) . In this section, we only explain how to find g t 1 , since the other coefficients are found with the same methods used for g t 1 . The full recovery of g ( z ) using the joint distributions of leakages is described in Algorithm 10.
Function l ( k , a ) is a function that returns log [ k a ] by taking the elements k and a of G F ( 2 m ) , while function ϕ ( v ) takes v as input and returns the Hamming weight of v. The value of a i and b i are the estimated Hamming weights of the input a and output b of the function l ( k , a ) , respectively.
When j = t 2 , t 3 in the step 3 loop of Algorithm 7, the operation process can be described as follows for i = 0 : 2 m 1 .
h 0 [ t 2 ] = g t 1 ( α 0 × h 0 [ t 1 ] )
h 0 [ t 3 ] = g t 2 ( α 0 × h 0 [ t 2 ] )
h 1 [ t 2 ] = g t 1 ( α 1 × h 1 [ t 1 ] )
h 1 [ t 3 ] = g t 2 ( α 1 × h 1 [ t 2 ] )
h 2 m 1 [ t 2 ] = g t 1 ( α 2 m 1 × h 2 m 1 [ t 1 ] )
h 2 m 1 [ t 3 ] = g t 2 ( α 2 m 1 × h 2 m 1 [ t 2 ] ) .
The multiplication operation α i × h i [ t 2 ] over G F ( 2 m ) in Equation (6) is performed by using the pre-computation table as shown in Equation (7).
exp [ m o d ( log [ α i ] + log [ g t 1 ( α i × 1 ) ] ) ] .
Algorithm 10 Analysis for g ( z )
Input Power consumption trace P for HyMES key generation, A table log[], exp[] created with the primitive polynomial p(x)
Output the column vectors g ( z ) = z t + g t 1 z t 1 + + g 0
1:
l : K × A B , S ( l , g i ) , S d { 0 , , m } × { 0 , , m }
2:
for j = t 1 : 1
3:
 for g j = 0 : 2 m 1
4:
   S ( l , g j ) 0
5:
  for a = 0 : 2 m 1
6:
    S ( l , g j ) ( ϕ ( a ) , ϕ ( l ( a , g j ) ) ) S ( l , g j ) ( ϕ ( a ) , ϕ ( g ( a , g j ) ) + 1 2 m
7:
  end
8:
 end
9:
 for i = 0 : 2 m 1
10:
  Find POI α i × h i [ j ] , log [ h i [ j 1 ] ]
11:
 end
12:
 Estimate data Hamming weight using slice method
13:
 for i = 0 : 2 m 1
14:
   S d ( a i , b i ) S d ( a i , b i ) + 1 2 m
15:
 end
16:
g j 0
17:
 for g j = 0 : 2 m 1
18:
  if d ( S ( l , g j ) , S d ) < d ( S ( l , g j ) , S d )
19:
    g j g j
20:
  end
21:
 end
22:
end
23:
return g ( z ) = z t + g t 1 z t 1 + + g 0
To find g t 1 , we use log [ g t 1 ( α i × 1 ) ] in the second log table operation of Equation (7). First, we set the Hamming weights of α i and log [ g t 1 α i ] as random variables, and then construct the theoretical joint distribution tables for 2 m key candidates g t 1 . The range of Hamming weights is 0-m since α i and log [ g t 1 α i ] are elements in G F ( 2 m ) . Therefore, the size of the joint distribution table S ( l , g t 1 ) is ( m + 1 ) × ( m + 1 ) . Next, we find the point at which α i and log [ g t 1 ] α i are processed from the power consumption trace of Algorithm 7. In this paper, the power consumption model follows the Hamming weight model shown in Equation (8), under the assumption that α and β are the same at all time points.
P v = α H W ( v ) + β + ω
The estimated joint distribution table can be constructed by guessing the Hamming weight of α i and log [ g t 1 α i ] from the power consumption value P α i and P log [ g t 1 α i ] , respectively. The Hamming weight of α i and log [ g t 1 α i ] can be estimated using Linge’s slice method. This slice method uses the correlation between the Hamming weight and the power consumption value. For example, the number of data points with Hamming weight p is about M × C N p 2 N among N-bit data M with uniform distribution. By sorting the power consumption values for the M data in ascending order, it is possible to guess the Hamming weight of the corresponding data. The performance of the slice method increases when the values of the actually used data are uniformly distributed, so it is necessary to use a sufficient amount of data. Finally, when the similarity between the theoretical joint distribution and the estimated joint distribution is compared, g t 1 with the highest similarity is selected as the real key g t 1 . In this paper, we use the Harmonic Mean Distance, Inner Product Distance, and χ -square Pearson Distance as the comparison method of distribution similarity. The definitions of the three similarity comparison methods are the same as Definition 5–7.
Definition 5.
Harmonic Mean Distance (HMD) is as follows.
H M D ( S ( g , k ) , S d ) = 1 2 i = 0 i = n j = 0 j = m p i , j f i , j p i , j + f i , j , p i , j + f i , j 0 0 , p i , j + f i , j = 0 .
Definition 6.
Inner Product Distance is as follows.
I P D ( S ( g , k ) , S d ) = 1 i = 0 i = n j = 0 j = m p i , j f i , j .
Definition 7.
χ-square Pearson Distance is as follows.
χ 2 P D ( S ( g , k ) , S d ) = i = 0 i = n j = 0 j = m ( p i , j f i , j ) 2 f i , j , f i , j 0 0 , f i , j = p i , j , f i , j = 0 p i , j .

3.3. Recovering L s e c

In this section, we explain how to find the remaining secret key L s e c using g(z) obtained in Section 3.2. The process of finding L s e c is described in Algorithm 11. We explain the process of finding L s e c by recovering the first support value α 0 as a concrete example. The other support values can be analyzed using the same logic used to find α 0 . When i = 0 in Algorithm 7, the operation process can be expressed by Equation (12). To find α 0 , we perform the horizontal correlation power analysis between the actual power consumption values that occur when values dependent on α 0 are processed and the Hamming weights of the values, which are calculated by guessing the value of α 0 in Equation (12). The number of equations containing α 0 in Equation (12) is t 1 + 1 + t = 2 t . Therefore, the number of data available for the horizontal correlation power analysis is 2 t . Generally, HyMES with 88-bit security uses the parameter m = 11 , t = 32 . Therefore, 64 data points are available for the horizontal correlation power analysis using these parameters, which is a little data for the actual analysis. This can be resolved by using α 0 -dependent values. By using all the α 0 -dependent values used in the multiplication and division operations in steps 2–21 of Algorithm 11, 8 t = 256 data can ultimately be used for the analysis. When the correlation coefficients between actual power consumption values and 8 t power consumption models, which are estimated from 0 to 2 11 1 , are obtained, the estimated value with the highest correlation coefficient can be considered as the correct α 0 .
h 0 [ t 1 ] = 1
h 0 [ t 2 ] = g t 1 + ( α 0 × h 0 [ t 1 ] )
h 0 [ t 3 ] = g t 2 + ( α 0 × h 0 [ t 2 ] )
h 0 [ 0 ] = g 1 + ( α 0 × h 0 [ 1 ] )
a = g 0 + ( α 0 × h 0 [ 0 ] )
h 0 [ 0 ] = h 0 [ 0 ] / a
h 0 [ 1 ] = h 0 [ 1 ] / a
h 0 [ t 1 ] = h 0 [ t 1 ] / a .
Algorithm 11 Analysis for L s e c
Input Power consumption values of POI of HyMES PMat1 × 8t, A table log[], exp[] created with the primitive polynomial p(x), Goppa polynomial g ( z ) = z t + g t 1 z t 1 + + g 0
Output L s e c = { α 0 , , α 1 }
1:
for i = 0 : n 1
2:
 for j = 0 : n 1
3:
   p m 1 h w ( j )
4:
   p m 2 h w ( log [ j ] )
5:
   p m 3 h w ( log [ j ] + log [ h i [ t 1 ] ] )
6:
   p m 4 h w ( m o d ( log [ j ] + log [ h i [ t 1 ] ] ) )
7:
   p m 5 h w ( exp [ m o d ( log [ j ] + log [ h i [ t 1 ] ] ) ] )
8:
  for k = t 2 : 0
9:
    p m 5 ( t 2 k ) + 6 h w ( h i [ k ] )
10:
    p m 5 ( t 2 k ) + 7 h w ( log [ h i [ k ] ] )
11:
    p m 5 ( t 2 k ) + 8 h w ( log [ j ] + log [ h i [ k ] ] )
12:
    p m 5 ( t 2 k ) + 9 h w ( m o d ( log [ j ] + log [ h i [ k ] ] ) )
13:
    p m 5 ( t 2 k ) + 9 h w ( exp [ m o d ( log [ j ] + log [ h i [ k ] ] ) ] )
14:
  end
15:
  for k = 0 : t 1
16:
    p m 3 k + 5 t + 1 h w ( log [ h i [ k ] ] log [ a ] )
17:
    p m 3 k + 5 t + 2 h w ( m o d ( log [ h i [ k ] ] log [ a ] ) )
18:
    p m 3 k + 5 t + 3 h w ( exp [ m o d ( log [ h i [ k ] ] log [ a ] ) ] )
19:
  end
20:
   c t j ρ ( PM , T )
21:
 end
22:
α i a r g m a x j ( CT )
23:
end
24:
return L s e c = { α 0 , , α n 1 }

4. Experiment

In this section, we describe the experimental results of the proposed attack. The experiments were conducted by using simulated power traces under the assumption that the power consumption models follow Equation (8). We assume that the α and β in Equation (8) are equal to 1 and 0 at all points. We use the parameters m = 11 and t = 32 [6] for the analysis. We present the analysis results of the coefficients g 31 and α 0 , where g 31 is the 32nd term of the secret key g ( z ) and α 0 is the first element of the support L s e c . Although we only present experimental results for when g 31 is 1499 and α 0 is 999, similar results can be confirmed for other secret key values.

4.1. Find g ( z ) Using Harmonic Mean Distance

To find g 31 , we conducted an analysis by exploiting the joint distributions of two random variables A = α i × h i [ t 1 ] and B = log [ h i [ t 2 ] ] = log [ g t 1 α i ] . The similarity between the theoretical distribution according to the guessing key g 31 and the distribution estimated from the simulation trace were obtained using three similarity comparison methods. The power consumption model is set to α = 1 , β = 0 , and σ = 0 . 1 , where σ is the noise standard deviation. Figure 1 shows the similarity between the theoretical distribution and the estimated distribution using HMD. Note that the smaller distance indicates high similarity between the two distributions.
When g 31 = 1499 , the highest similarity was found at 0.0001016 and the second highest was fount at 0.007898 when g 31 = 508 . This indicates that the difference between the distance of the correct key and the distance of the wrong key is not very large, so that when the noise value becomes large enough, the analysis failure rate rises. To solve this problem, two random variables C = m o d ( log [ α i ] + log [ h i [ t 2 ] ] ) and D = exp [ C ] can be respectively added to A and B to form a joint distribution using four random variables in total. The use of four random variables magnifies the difference between the correct key and wrong key, which allows the correct key to be guessed with a higher success rate.
Figure 2 shows the result of HMD between the theoretical joint distribution and the estimated distribution constructed by using four random variables. The experimental result shows that the distance at g 31 = 1499 is 0.01776 and that the distance at g 31 = 927 is 0.3911. We found that the difference between the distance to the correct guessing key and the wrong key is larger when using four random variables than when using two random variables. As mentioned earlier, many random variables elaborates the joint distributions of the leakages.
Figure 3 shows the success rate of the attack according to the noise standard deviation. Recall that the attack is based on the joint distributions of leakages constructed by using two random variables. The success rate of the attack was measured by increasing the noise standard deviation from 0 to 2.5 in increments of 0.1. We analyzed 10,000 case according to the noise standard deviation. The experimental result using IPD shows that even if the noise standard deviation is zero, the success rate is still zero. The result when χ 2 PD is used shows that the success rate of the attack is 1 until the noise standard deviation reaches 0.3, and the success rate of the attack starts to decrease rapidly after 0.4. The result when HMD is used is the best among the results of the three methods. When the noise standard deviation is 0.4, the success rate of the attack begins to decrease to 0.9814.
Figure 4 shows the experimental results using four random variables. The other experimental conditions are the same as those shown in Figure 3. The success rate of the attack according to the noise standard deviation is highest when HMD is used. The success rate of the attack remains at 1 up to the noise standard deviation of 0.6, and then starts to decrease from 0.7 to 0.9823. Figure 4 shows that using four random variables improves the performance of the attack. However, in practice, environments with a noise standard deviation of 0.6 are extremely rare and can be difficult to analyze. The success rate of the attack is not high even in an environment where the noise standard deviation is small because of the errors between the estimated Hamming weight and the actual value used in constructing the estimated joint distribution.
Table 1 shows the success rate of the slice method for the data with a maximum Hamming weight of 11. The success rate was calculated based on the noise standard deviation for the case of α = 1 and the case of α = 2 . The data used is a random value according to the uniform distribution. The numbers of data point used were 2048, which is the minimum number for applying the slice method to 11-bit data, and 20,480, which is 10 times larger than the minimum number. The experimental result presented above shows that the more data points used and the larger the value of α , the better the performance of the slice method.

4.2. Find g ( z ) Using Maximum Likelihood

If the Hamming weight of POI (Point of Interesting) is estimated with only one trace, it is very difficult to correct the error due to the noise. However, conducting an analysis using the maximum likelihood method [18] can improve the performance of the attack. This can be attributed to the fact that the maximum likelihood reflects the influence of the noise with probability. The results of the analysis of the maximum likelihood method are shown in Figure 5.
In the case of using two variables, the success rate of the attack remains at 1 up to a noise standard deviation of 0.4, which results in a smaller but better result than the result of the method shown in Figure 3. In the case of using four variables, the success rate of the attack remain at 1 up to a noise standard deviation of 1.3, which is about twice as high as the analysis result obtained using the best result HMD performance.

4.3. Find α 0

Figure 6 shows the success rate of the attack according to the noise standard deviation when the horizontal correlation power analysis is conducted with 256 partial traces to identify α 0 . The success rate of the attack was measured by increasing the noise standard deviation from 0 to 2.5 in increments of 0.1. The horizontal correlation power analysis was performed 10,000 times according to the noise standard deviation. The success rate of the attack remains at 1 up to a noise standard deviation of 2.7, and then starts to decrease from 2.8.

4.4. Experiments Using Multiple Traces

In the previous experiments, only one trace was used for analysis. The experimental results obtained using the maximum likelihood yielded an analysis success rate of 1 up to a noise standard deviation of 1.3. However, the noise standard deviation of 1.3 is a small value in a typical actual analysis environment, and it may be difficult to analyze according to the trace collection environment. Therefore, we experimentally confirmed that the performance of the attack can be improved by using additional traces. For each experiment with one trace, we accumulate the scores from the most probable candidate key to the least probable candidate key. More concretely, 5–1 points were accumulated from the first candidate key to the fifth candidate key.
Figure 7 shows the experimental result obtained using 10 traces. The noise standard deviation was increased by 0.1. The analysis was conducted 10000 times for each noise standard deviation. The analysis performed for each trace is the maximum likelihood when using four variables. We performed a maximum likelihood analysis for each trace and used four random variables. The attack success rate remains at 1 up to a noise standard deviation of 2.1, and then begins to decrease from 2.2. In this paper, we experimented with 10 traces, but we can obtain better experimental results by using more traces.

5. Conclusions

In this paper, we analyzed HyMES by exploiting the joint distributions of leakages. We exploited the nonlinearity of the precomputation table used in calculating the column vector h i of the parity check matrix H in the decryption process. Previously, the side-channel analysis by exploiting the joint distributions of leakages was only investigated for the symmetric key cryptography. To the best of our knowledge, this is the first to analyze the public-key cryptosystem exploiting the joint distributions of leakages. The experimental results using a single simulated power trace show a success rate of 100% up to a noise standard deviation 1.3. We demonstrated that the proposed attack can be applied to all code-based cryptosystems that calculate h i in the manner proposed in Reference [6].

Author Contributions

All authors have contributed to this work. B.P. and S.K. analyzed the algorithm and drafted and revised the manuscript. B.P. and S.K. performed the experiment and analyzed the result. B.P. and S.H. devised a methodology of additional experiment. H.K.K. and S.C.S. verified the analytical methods and supervised this work. All authors have read and agreed to the published version of the manuscript.

Funding

This research was supported by Basic Science Research Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Science and ICT (NRF-2019R1A2C2088960).

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Shor, P.W. Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer. SIAM Rev. 1999, 41, 303–332. [Google Scholar] [CrossRef]
  2. Nguyen, H.B. An Overview on the Ntru Cryptographic System. Ph.D. Thesis, San Diego State University, San Diego, CA, USA, 2014. [Google Scholar]
  3. Moody, D. The NIST Post-Quantum Crypto “Competition”. Available online: https://csrc.nist.gov/CSRC/media/Projects/Post-Quantum-Cryptography/documents/asiacrypt-2017-moody-pqc.pdf (accessed on 12 December 2017).
  4. Mceliece, R.J. A public-key cryptosystem based on algebraic. Coding Theory 1978, 4244, 114–116. [Google Scholar]
  5. Hudde, H.C. Development and Evaluation of a Code-Based Cryptography Library for Constrained Devices. Ph.D. Thesis, Ruhr Universitat Bochum, Bochum, Germany, 2013. [Google Scholar]
  6. Biswas, B.; Sendrier, N. McEliece Cryptosystem Implementation: Theory and Practice. In International Workshop on Post-Quantum Cryptography; Springer: Berlin, Germany, 2008; pp. 47–62. [Google Scholar]
  7. Strenzke, F.; Tews, E.; Molter, H.G.; Overbeck, R.; Shoufan, A. Side channels in the McEliece PKC. In International Workshop on Post-Quantum Cryptography; Springer: Berlin, Germany, 2008; pp. 216–229. [Google Scholar]
  8. Strenzke, F. A timing attack against the secret permutation in the McEliece PKC. In Post-Quantum Cryptography; Springer: Berlin, Germany, 2010; pp. 95–107. [Google Scholar]
  9. Heyse, S.; Moradi, A.; Paar, C. Practical power analysis attacks on software implementations of McEliece. In International Workshop on Post-Quantum Cryptography; Springer: Berlin, Germany, 2010; pp. 108–125. [Google Scholar]
  10. Kocher, P.C. Timing attacks on implementations of Diffie-Hellman, RSA, DSS, and other systems. In Advances in Cryptology—CRYPTO ’96; Springer: Berlin, Germany, 1996; pp. 104–113. [Google Scholar]
  11. Kocher, P.; Jaffe, J.; Jun, B. Differential power analysis. In Advances in Cryptology—CRYPTO’ 99; Springer: Berlin, Germany, 1999; pp. 388–397. [Google Scholar]
  12. Bernstein, D.J.; Chou, T.; Schwabe, P. McBits: Fast constant-time code-based cryptography. In Cryptographic Hardware and Embedded Systems—CHES 2013; Springer: Berlin, Germany, 2013; pp. 250–272. [Google Scholar]
  13. Linge, Y.; Dumas, C.; Lambert-Lacroix, S. Using the joint distributions of a cryptographic function in side channel analysis. In Constructive Side-Channel Analysis and Secure Design; Springer: Cham, Switzerland, 2014; pp. 199–213. [Google Scholar]
  14. Sidelnikov, V.M.; Shestakov, S.O. On insecurity of cryptosystemsbased on generalized Reed-Solomon codes. In Discrete Mathematics and Applications; Walter de Gruyter: Berlin, Germany, 1992; pp. 439–444. [Google Scholar]
  15. Marcus, M. White Paper on McEliece with Binary Goppa Codes. Available online: https://www.hyperelliptic.org/tanja/students/m_marcus/whitepaper.pdf (accessed on 28 February 2019).
  16. Chari, S.; Rao, J.R.; Rohatgi, P. Template attacks. In Cryptographic Hardware and Embedded Systems—CHES 2002; Springer: Berlin, Germany, 2003; pp. 13–28. [Google Scholar]
  17. Schramm, K.; Leander, G.; Felke, P.; Paar, C. A Collision-Attack on AES Combining Side Channel and Differential-Attack. In Cryptographic Hardware and Embedded Systems—CHES 2004; Springer: Berlin, Germany, 2004; pp. 163–175. [Google Scholar]
  18. Clavier, C.; Reynaud, L. Improved blind side-channel analysis by exploitation of joint distributions of leakages. In Cryptographic Hardware and Embedded Systems—CHES 2017; Springer: Cham, Switzerland, 2017; pp. 24–44. [Google Scholar]
Figure 1. Harmonic Mean Distance (HMD) using two random variables A , B .
Figure 1. Harmonic Mean Distance (HMD) using two random variables A , B .
Applsci 10 01831 g001
Figure 2. Harmonic Mean Distance using four random variables A , B , C , D .
Figure 2. Harmonic Mean Distance using four random variables A , B , C , D .
Applsci 10 01831 g002
Figure 3. Success rate according to noise standard deviation (using two random variables).
Figure 3. Success rate according to noise standard deviation (using two random variables).
Applsci 10 01831 g003
Figure 4. Success rate according to noise standard deviation (using 4 random variables).
Figure 4. Success rate according to noise standard deviation (using 4 random variables).
Applsci 10 01831 g004
Figure 5. Success rate according to noise standard deviation (using maximum likelihood).
Figure 5. Success rate according to noise standard deviation (using maximum likelihood).
Applsci 10 01831 g005
Figure 6. Success rate according to noise standard deviation ( α 0 = 999 ).
Figure 6. Success rate according to noise standard deviation ( α 0 = 999 ).
Applsci 10 01831 g006
Figure 7. Success rate according to noise standard deviation (using 10 power traces).
Figure 7. Success rate according to noise standard deviation (using 10 power traces).
Applsci 10 01831 g007
Table 1. Performance of slice method.
Table 1. Performance of slice method.
α = 1 α = 2
N σ Correct Rate N σ Correct Rate
0.10.9581 0.10.9542
0.50.6975 0.50.9335
10.4293 10.6971
204820.2790204820.4280
30.2349 30.3268
40.2149 40.2772
50.2024 50.2503
0.10.9846 0.10.9856
0.50.7008 0.50.9532
10.4288 10.7012
2048020.27832048020.4292
30.2337 30.3272
40.2144 40.2789
50.2035 50.2509

Share and Cite

MDPI and ACS Style

Park, B.; Kim, S.; Hong, S.; Kim, H.; Seo, S.C. Single Trace Analysis against HyMES by Exploitation of Joint Distributions of Leakages. Appl. Sci. 2020, 10, 1831. https://doi.org/10.3390/app10051831

AMA Style

Park B, Kim S, Hong S, Kim H, Seo SC. Single Trace Analysis against HyMES by Exploitation of Joint Distributions of Leakages. Applied Sciences. 2020; 10(5):1831. https://doi.org/10.3390/app10051831

Chicago/Turabian Style

Park, ByeongGyu, Suhri Kim, Seokhie Hong, HeeSeok Kim, and Seog Chung Seo. 2020. "Single Trace Analysis against HyMES by Exploitation of Joint Distributions of Leakages" Applied Sciences 10, no. 5: 1831. https://doi.org/10.3390/app10051831

APA Style

Park, B., Kim, S., Hong, S., Kim, H., & Seo, S. C. (2020). Single Trace Analysis against HyMES by Exploitation of Joint Distributions of Leakages. Applied Sciences, 10(5), 1831. https://doi.org/10.3390/app10051831

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