The present invention relates to a random number expanding device, a random number expanding method and a random number expanding program that expand an M bits random number to an N bits random number, where N is larger than M.
As a basis for information security, cryptography technologies are widely used. In order to use cryptography in safety, information called secret key needs to be kept in secret except for the user. As a measure to store a secret key in safety, a method of using a computer chip is common. The secret key is written in a non-volatile memory in the chip, to which access is restricted from outside the chip. By access restriction, it is possible not to make the secret key read from outside the chip.
There has been considerable researches on attacks to retrieve a key from a computer chip. A fault attack is one of the classifications of attacks. By applying a physical stimulus to a computer, the computer may make a calculation error. There are cases when a secret key can be extracted by inducing a calculation error in a computer chip that processes encryption, and observing how a calculation error occurs in the result. Such an attack is referred to as a fault attack.
One of methods well-known as physical stimulus that provokes calculation errors is laser irradiation onto a computer chip. Non-patent literature 1 describes that by irradiating an appropriate part with a laser, it is possible to set a certain bit in a memory or a resister that stores data inside a computer chip to a logical value 0 or 1. Such an error is referred to as a bit-set/reset fault.
An attacker who can induce a bit-set/reset fault can retrieve secret data by observing if a key is overwritten before and after laser irradiation.
As described in Non-patent literature 2, there are many existing countermeasures against fault attacks. However, many of such countermeasures are ineffective.
One of effective countermeasures against fault attacks is a method to detect that laser irradiation is performed by a sensor, as disclosed in Patent literature 1. However, there are such problems that (1) a local irradiation may be overlooked, (2) the manufacturing cost is increased by using a specific circuit, etc.
Further, another effective countermeasure against fault attacks is a method to use random number masking. Random number masking is a technique as follows. Let an N bits secret key k(N) exists. Here, k(N)=k1, k2, . . . kN. In random number masking, an N bits random number r(N) is prepared. Here, r(N)=r1, r2, . . . rN. By taking the exclusive OR of the secret key k(N) and the random number r(N), masked data is obtained. After that, the random number r(N) and the masked data are stored in a resister. When the secret key k(N) is used, the secret key k(N) can be decrypted by calculating the exclusive OR of the random number r(N) and the masked data. Since the secret key k(N) itself is not stored, the secret key k(N) cannot be retrieved by an attack of laser irradiation. Thus, this can be a countermeasure against the fault attack by laser irradiation.
Patent literature 1: JP 2004-206680 A
Non-patent literature 1: C. Roscian, A. Sarafianos, J.-M. Dutertre, and A. Tria, “Fault Model Analysis of Laser-Induced Faults in SRAM Memory Cells,” Fault Diagnosis and Tolerance in Cryptography (FDTC), 2013 Workshop on, pp. 89-98, August 2013
Non-patent literature 2: M. Joye and M. Tunstall (Eds.), “Fault Analysis in Cryptography,” Springer, 2012
The random number masking as mentioned above has a problem that the necessary resisters double in number. Thus, the manufacturing cost is increased.
In the random number masking, an easy way to decrease the number of the resisters is a way to use random numbers of only one bit. Let this random number be r. A random number masking that provides random numbers of only one bit will be described. By taking the exclusive OR of each bit of a secret key k(N) and the random number r of one bit, masked data is obtained. The random number r and the masked data are stored in a resister. This method has an advantage that only one bit of a resister is necessary additionally. On the other hand, there is a problem that an attack by laser irradiation to not less than 2 parts at a time may succeed.
The present invention is aimed at providing a device, a method and a program that can reduce the bit numbers of the random numbers to be used, and counter an irradiation attack with multiple laser beams.
There is provided according to one aspect of the present invention, a random number expanding device includes a receiving unit that receives a random number r(M) of M bits, an expanding unit that expands the random number r(M) to a random number s(N) of N bits using a logical operation that is obtained by a multiplication of one matrix of a check matrix with a size of M×N and a generator matrix with a size of M×N which are determined from a linear code for error correction by a vector in a case in which the random number r(M) is the vector having M components, the multiplication being performed through addition based on an exclusive OR, and an outputting unit that outputs a bit value whose number is larger than M bits out of N bits of the random number s(N), as a random number.
Since a random number expanding device of the present invention is provided with an expanding unit, it is possible to reduce the bit numbers of the random numbers to be used, and counter an irradiation attack with multiple laser beams.
The following embodiment is based on the premise of (1) through (4) below.
*** Description of the Structure ***
With reference to
The random number expanding device 100 is provided with a receiving unit 110, an expanding unit 120 and an outputting unit 130.
The receiving unit 110 receives the M bits random number r(M).
The expanding unit 120 expands the random number r(M) to an N bits random number s(N) by using a logical operation obtained by multiplication of one matrix of a check matrix with a size of M×N and a generator matrix with a size of M×N, which are determined from a linear code for error correction, by a vector in a case wherein the random number r(M) is the vector with M components, in which multiplication addition is made into an exclusive OR.
That is, the expanding unit 120 expands the random number r(M) to the N bits random number s(N) using the logical operation obtained by multiplication of one matrix of the check matrix with the size of M×N and the generator matrix with the size of M x N, which are determined from an (N, N−M, D) linear code for error correction, by the vector in the case wherein the random number r(M) is the vector with M components. In other words, the expanding unit 120 expands a random number using the logical operation obtained by multiplication of one matrix by the vector with M components.
The (N, N−M, D) linear code for error correction is represented by a code length N, an information bit length N−M and a minimum distance D representing a minimum value of a hamming distance between different code words, using an integer number M expressing M bits, N being an integer number larger than M, and an integer number D. The (N, N−M, D) linear code will be discussed below.
The multiplication of one matrix of the check matrix with the size of M×N and the generator matrix with the size of M×N by the vector in the case wherein the random number r(M) is the vector with M components is the multiplication wherein addition is made into an exclusive OR. This multiplication is hereinafter referred to as an XOR multiplication, or may be simply referred to as a multiplication. Further, the check matrix and the generator matrix will be discussed below. The expanding unit 120 generates N components obtained by the XOR multiplication of one matrix of the check matrix and the generator matrix by the random number r(M) as a random number s(N).
The outputting unit 130 outputs bit values whose number is larger than M bits out of N bits of the random number s(N) as a random number. The outputting unit 130 outputs s(N) when r(M) is expanded to s(N) by the expanding unit 120. Otherwise, in a case of a truncating process as described below, the outputting unit 130 outputs a V bit random number s(V) in which at least 1 bit is removed from s(N). Here, the magnitude of each integer number is N >V >M. As will be discussed for
Additionally, as will be discussed for re-masking below, the receiving unit 110 receives the third random number r<3>, (M) as the random number r(M), which is obtained by taking the exclusive OR of the first M bits random number r<1>, (M) and the second M bits random number r<2>, (M). The expanding unit 120 expands the third random number r<3>, (M) to an XOR random number obtained by exclusive-ORing an N bits random number s<1>, (N) corresponding to a random number whereto the first random number r<1>, (M) is expanded, and an N bits random number s<2>, (N) corresponding to a random number whereto the second random number r21 2>, (M) is expanded. A storing unit 150 stores data masked with the random number s21 1>, (N). A masking unit 140 below performs an operation of X <+>s21 1>, (N) as the data masked with the random number s<1>, (N), and s21 1>, (N)<+>s21 2>, (N) as the XOR random number expanded by the expanding unit 120. By this operation, the masking unit 140 performs re-masking to convert the data masked with the random number s<1>, (N) to data masked with the random number s21 2>, (N).
The masking unit 140 masks data with a random number output by the outputting unit 130. The storing unit 150 stores the data masked by the masking unit 140.
*** Explanation of Operations ***
The operations in the random number expanding device 100 are described with reference to
One of the characteristics of the random number expanding device 100 is to use a linear code technique for expanding random numbers.
The expanding unit 120 expands the random number r(M) to the random number s(N) using the expanding function 1201. The expanding unit 120 uses the (N, N−M, D) linear code for expanding random numbers. N is a code length, N−M is an information bit length, and D is a minimum distance representing a minimum value of a hamming distance between different code words. The expanding function 1201 is defined by multiplication by the check matrix 1202. The check matrix 1202 is a matrix with a size of M×N determined from the (N, N−M, D) linear code. Since the check matrix 1202 is also a generator matrix, the check matrix 1202 can be also read as the generator matrix. The check matrix 1202, or the generator matrix, has dimensions of M×N. Having the dimensions of M×N means having M rows and N columns, or may having N rows and M columns Since the check matrix 1202 is also the generator matrix, let a matrix to be used for defining the expanding function 1201 be the check matrix 1202 below. Since the check matrix 1202 has the dimensions of M×N, r(M) as input data of M bits can be output as output data s(N) of N bits. One of the characteristics of the expanding unit 120 is to use an error correction code not for detecting a bit error, but for expanding the random number r(M) as input data to the random number s(N).
As an effect of expanding a random number using the check matrix 1202 of the (N, N−M, D) linear code, it is possible to improve the security against laser irradiation up to (D-1) beams. This is due to the next reason. The check matrix 1202 has N columns. When the check matrix 1202 has N rows and M columns, it suffices to transpose the check matrix 1202. By the property of the (N, N−M, D) linear code, any column of (D-1) number in the check matrix 1202 is linearly independent. Corresponding to the linear independence, any (D-1) bits, being extracted out of the random number s(N) as N bits data that has been expanded by the check matrix 1202, are linearly independent. If linearly dependent A of columns exist, this means lack of random numbers. Thus, an attack is made possible by performing irradiation with A of laser beams. When the (N, N−M, D) linear code is used, since any (D-1) is linearly independent, the mentioned attack can be prevented against laser irradiation up to (D-1) beams.
Let a 2 bits secret key desired to be protected be k(2). Let each bit of the secret key k(2) be k0 and k1. Let a 1 bit random number be r. An attacker knows that bits of the secret key k(2) after laser irradiation become (0, 0). A column 501 is for cases when the secret key k(2) is k0=k1, and when k0≠k1. A column 502 is for specific bits in the cases when k0=k1, and when k0≠k1. A column 503 indicates values of the random numbers r. A column 504 indicates masked secret keys k(2). A column 505 indicates values after laser irradiation. A column 506 indicates whether an error exists or not. A column 507 indicates error probabilities. The aim of the attacker is to judge whether k0=k1 or not. Judging whether k0−k1 or not has the same effect as obtaining one bit of a key. The secret key k(2) is masked using 1 bit random numbers r. The masked values are in the column 504. The attacker irradiates two parts of a resister that keeps the masked values with a laser. As indicated in the column 506, when k0=k1, an error may not occur. Meanwhile, when k0≠k1, an error inevitably occurs. Therefore, by testing if an error may occur or not, the attacker can judge whether k0=k1 or not. That means success in attack. By applying the method of the present embodiment to the attack as illustrated in
Here, the transposed matrix 1202-1 is used in
The structures illustrated in
In
The random number expanding device 100 may be equipped with a decrypting unit that decrypts masked data.
The random number expanding device 100 in
however, it may be composed of a program as discussed above. Masking of N bits secret information x is performed as follows. f indicates the expanding function 1201. First, the random number r(M) stored in the resister 1000 is converted to an N bits random number f(r) by the expanding unit 120. Here, f(r)=s(N). By taking exclusive OR of f(r)=s(N) and the N bits secret information x, a masked value x <+>f(r) is obtained. The masked value x <+>f(r) is stored in the resister 1005. The output of the resister 1005 is connected to the XOR logical gate 1004. By the XOR logical gate 1004, x <+>f(r)<+>f(r)=x is established, and the secret information X before masking is decrypted.
With reference to
In a random number masking, there is a case in which change of a masking value is desired. By changing the masking value, the security may be improved. Changing of the masking value is called re-masking. By the random number expanding device 100, re-masking can be performed effectively.
Let M bits random numbers be the first random number r<1>and the second random number r<2>. Let the N bits random numbers which are expanded from r<1>and r<2>be s<1>and s<2>. Now, it is desired to re-mask the value x <+>f(r<1>) that has been masked with f(r<1>) to another masked value x <+>f(r<2>). The random number s<1>=f(r<1>) and the random number s<2>=f(r<2>). Further, x is secret information, r<1>is a random number for old masking, and r<2>is a random number for new masking. First, the XOR logical gate 1100 generates r<1><+>r<2>.
Next, the receiving unit 110 receives r<1><+>r<2>as the third random number r<3>, (M). The expanding unit 120 expands r<1><+>r<2>to a random number f(r<1><+>r<2>). The outputting unit 130 outputs the random number f(r<1><+>r<2>). Since the expanding function f defined by multiplication with the check matrix 1202 is linear, f(r<1><+>r<2>)=f(r<1>)<+>f(r<2>)=s<1><+>s<2>is established. The masking unit 140 takes the exclusive OR of the masked value x <+>f(r<1>) and the expanded random number f(r<1>) <+>f(r<2>). In this way, the masking unit 140 obtains x <+>f(r<1>) <+>f(r<1>) <+>f(r<2)=x <+>f(r<2>). Thus, the new value x <+>f(r<2>) is a result of re-masking.
The re-masking method using the expanding function f as above has two important advantages. First, only one expanding function f is necessary to be prepared. Secondly, re-masking is executed without returning to the original value x not being masked, which may improve the security.
In
With reference to
In S21, only the random number r<1>is sent to the XOR logical gate 1020. The output of the XOR logical gate 1020 is the random number r<1>.
In S22, the expanding unit 120 generates s<1>=f(r<1>), and f(r<1>) is output from the outputting unit 130.
In S23, the XOR logical gate 1003 takes the exclusive OR of the secret information x and the f(r<1>). In S24, x <+>f(r<1>) is output from the selector 1030.
In S25, x <+>f(r<1>) is stored in the resister 1005.
Next, in S31, the random number r<1>and the random number r<2>are sent to the XOR logical gate 1020. The output of the XOR logical gate 1020 is r<1><+>r<2>.
In S32, the expanding unit 120 expands r<1><+>r<2>to f(r<1><+>r<2>)=f(r<1>) <+>f(r<2>) by the expanding function f, and the outputting unit 130 outputs f(r<1>) <+>f(r<2>).
In S33, by the XOR logical gate 1004, f(r<1>) <+>f(r<2>) output from the outputting unit 130 is exclusive-ORed with x <+>f(r<1>) output from the resister 1005. Thus, from the XOR logical gate 1004, x <+>f(r<1>) <+>f(r<1>) <+>f(r<2>)=x <+>f(r<2>) is output.
In S34, x <+>f(r<2>) is output from the selector 1030, and x <+>f(r<2>) is stored in the resister 1005. In this way, re-masking is completed. In order to decrypt re-masked x <+>f(r<2>), it suffices to send only the random number r<2>to the XOR logical gate 1020, expand the random number r<2>to f(r<2>) by the expanding unit 120, and XOR f(r<2>) and x <+>f(r<2>) stored in the resister 1005 by the XOR logical gate 1004.
With reference to
In what follows, N, V and M are positive integer numbers, where N >V >M.
It is not always true that a (V, V−M, D) linear code exists when expansion of the random number r(M) to the random number s(V) is desired. In such a case, truncation can be performed. The truncating process will be discussed with the use of
The expanding unit 120 uses at least a part of the error detecting unit 170 at the time of expanding the random number r(M) to the random number s(N). The error detecting unit may be a circuit as hardware for error correcting codes, or may be a program for error correcting codes. By using at least a part of the error detecting unit 170, it is possible to reduce the circuit scale and the size of the program.
*** Explanation of the Effect ***
By bundling the resisters to store data masked with the expanded random numbers according to the present embodiment, it is possible to make a resister file having resistance properties against laser irradiation.
Further, by storing the data masked with the expanded random numbers according to the present embodiment in a volatile memory, it is possible to realize the volatile memory with resistance properties against laser irradiation.
The random number expanding device 100 as the computer is equipped with hardware devices such as a processor 901, an auxiliary storage device 902, a memory 903, a communication device 904, an input interface 905 and a display interface 906. The processor 901 is connected to the other hardware devices via a signal line 910 to control these other hardware devices. The input interface 905 is connected to the input device 907. The display interface 906 is connected to a display 908.
The processor 901 is an IC (Integrated Circuit) that performs processing. The processor 901 is, for example, a CPU (Central Processing Unit), a DSP (Digital Signal Processor), or a GPU (Graphics Processing Unit). The auxiliary storage device 902 is, for example, a ROM (Read Only Memory), a flash memory, or an HDD (Hard Disk Drive). The memory 903 is, for example, a RAM (Random Access Memory). The communication device 904 includes a receiver 9041 that receives data and a transmitter 9042 that transmits data. The communication device 904 is, for example, a communication chip and a NIC (Network Interface Card). The input interface 905 is a port to which a cable 911 of the input device 907 is connected. The input interface 905 is, for example, a USB (Universal Serial Bus) terminal. The display interface 906 is a port to which a cable 912 of the display 908 is connected. The display interface 906 is, for example, a USB terminal, or an HDMI (registered trademark) (High Definition Multimedia Interface) terminal. The input device 907 is, for example, a mouse, a keyboard, or a touch panel. The display 908 is, for example, an LCD (Liquid Crystal Display).
In the auxiliary storage device 902, a program that realizes the functions of the receiving unit 110, the expanding unit 120, the outputting unit 130, the masking unit 140, the storing unit 150 and the decrypting unit 160 illustrated in
Although one processor 901 is illustrated in
The “units” may be provided by “circuitry.” Further, the “units” may be read as “circuits,” “processes,” “steps,” or “processing.” The “circuits” and the “circuitry” are concepts including not only the processor 901 but also other types of processing circuits such as a logic IC, a GA (Gate Array), an ASIC (Application Specific Integrated Circuit) and an FPGA (Field-Programmable Gate Array), etc.
The semiconductor device 200 is equipped with a plurality of circuits as the random number expanding device 100. In a resister 210 of the semiconductor device 200, the masked secret key and the random numbers r(M) before expansion are stored.
100: random number expanding device; 110: receiving unit; 120: expanding unit; 121: logical operation circuit; 121-1: XOR circuit; 130: outputting unit; 140: masking unit; 150: storing unit; 160: decrypting unit; 170: error detecting unit.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2015/050979 | 1/15/2015 | WO | 00 |