JP6228354B2 - Unauthorized operation detection circuit, device provided with unauthorized operation detection circuit, and unauthorized operation detection method - Google Patents
Unauthorized operation detection circuit, device provided with unauthorized operation detection circuit, and unauthorized operation detection method Download PDFInfo
- Publication number
- JP6228354B2 JP6228354B2 JP2012072271A JP2012072271A JP6228354B2 JP 6228354 B2 JP6228354 B2 JP 6228354B2 JP 2012072271 A JP2012072271 A JP 2012072271A JP 2012072271 A JP2012072271 A JP 2012072271A JP 6228354 B2 JP6228354 B2 JP 6228354B2
- Authority
- JP
- Japan
- Prior art keywords
- state value
- change condition
- state
- value
- unauthorized operation
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Description
本発明は、不正操作検知回路、不正操作検知回路を備えた装置、及び不正操作検知方法に関する。 The present invention relates to an unauthorized operation detection circuit, an apparatus including an unauthorized operation detection circuit, and an unauthorized operation detection method.
アルゴリズムの実行状態を状態(ステート)値により管理する装置の一例として、暗号機能を搭載したスマートカード(Smart Card)などが知られている。スマートカードは、チップカード(Chip Card)またはICカード(ICC: Integrated Circuit Card)などと呼ばれることもある。暗号機能を搭載したスマートカードには、暗号回路内部の秘密鍵に対する攻撃を防ぐための耐タンパ技術が用いられているものがある。 As an example of a device that manages the execution state of an algorithm based on a state value, a smart card equipped with an encryption function is known. The smart card is sometimes called a chip card (Chip Card) or an IC card (ICC: Integrated Circuit Card). Some smart cards equipped with a cryptographic function use a tamper resistant technique for preventing attacks on a secret key inside a cryptographic circuit.
暗号方式は共通鍵暗号方式と公開鍵暗号方式とに大別できる。共通鍵暗号方式は、暗号化と復号化で同一の秘密鍵を用いる方式であり、秘密鍵を送信者及び受信者以外の第三者にわからない秘密情報とすることで安全性を保つ。一方、公開鍵暗号方式は、暗号化と復号化で異なる鍵を用いる方式であり、暗号化を行うための公開鍵を一般に公開する代わりに、暗号文を復号するための秘密鍵を受信者のみの秘密情報とすることで安全性を保つ。 Encryption methods can be broadly classified into common key encryption methods and public key encryption methods. The common key cryptosystem uses the same secret key for encryption and decryption, and keeps the security by making the secret key secret information unknown to a third party other than the sender and the receiver. On the other hand, the public key cryptosystem uses a different key for encryption and decryption, and instead of publicly disclosing the public key for performing encryption, only the receiver receives the secret key for decrypting the ciphertext. Keep it safe by keeping it confidential.
これらの暗号方式に対しては、秘密鍵を暗号文などの入手可能な情報から推定する様々な攻撃手法が存在する。これらの攻撃手法は、理論攻撃と実装攻撃とに大別できる。理論攻撃は、暗号アルゴリズムの入力データと出力データとの関係から秘密鍵を求める。理論攻撃は、攻撃対象となる暗号アルゴリズムの実装の形態に依存せず成功する可能性がある。一方、実装攻撃は、暗号アルゴリズムを実装した装置に対して、入力データと出力データの関係のみならず、装置に対して物理的なストレスを加えることで得られるエラー情報、入出力データ以外に装置から観測される情報などを利用することで秘密鍵を推定する。実装攻撃の成功の可否は、暗号アルゴリズムの実装形態に依存する。 For these encryption methods, there are various attack methods for estimating a secret key from available information such as ciphertext. These attack methods can be broadly divided into theoretical attacks and implementation attacks. In the theoretical attack, a secret key is obtained from the relationship between input data and output data of a cryptographic algorithm. The theoretical attack may succeed without depending on the implementation form of the cryptographic algorithm to be attacked. On the other hand, the implementation attack is not only related to the relationship between input data and output data, but also to error information and input / output data obtained by applying physical stress to the device. The secret key is estimated by using information observed from. The success or failure of the implementation attack depends on the implementation form of the cryptographic algorithm.
暗号アルゴリズムが理論攻撃に対しては安全性を保てても、実装攻撃に対しては脆弱である場合があり、実装攻撃に対して安全性を保証できる暗号アルゴリズムが望まれている。実装攻撃に対する対策は、耐タンパ(Tamper-Proof)技術とも呼ばれる。 Even if a cryptographic algorithm can be secured against a theoretical attack, it may be vulnerable to an implementation attack, and a cryptographic algorithm that can guarantee the security against the implementation attack is desired. Countermeasures against mounting attacks are also called tamper-proof technology.
実装攻撃は、フォールト攻撃(Fault Attack)とサイドチャネル攻撃(Side Channel Attack)とに大別できる。フォールト攻撃は、スマートカードなどの装置に搭載された暗号回路の内部データ値に対して、意図的に異常を発生させた場合の暗号処理の出力結果と、正常な暗号処理の出力結果との差分情報を用いて、暗号回路の内部に格納されている秘密鍵を推定する。一方、サイドチャネル攻撃は、消費電力、電磁波、処理時間など、装置から漏洩する情報を用いて秘密鍵を推定する。サイドチャネル攻撃では、消費電力を用いた方法が最も良く知られており、電力解析攻撃(Power Analysis Attack)とも呼ばれる。電力解析攻撃は、装置の消費電力波形から秘密鍵を推定する。 Implementation attacks can be broadly classified into fault attacks and side channel attacks. A fault attack is a difference between the output result of cryptographic processing when an intentional abnormality is generated with respect to the internal data value of the cryptographic circuit installed in a smart card or other device, and the output result of normal cryptographic processing. Using the information, a secret key stored in the cryptographic circuit is estimated. On the other hand, in the side channel attack, a secret key is estimated using information leaked from the device such as power consumption, electromagnetic waves, and processing time. In the side channel attack, a method using power consumption is best known, and it is also called a power analysis attack. In the power analysis attack, a secret key is estimated from the power consumption waveform of the device.
従来の暗号回路を備えた装置では、理論攻撃に対しては安全性を保てても、実装攻撃に対しては脆弱である場合がある。 A device equipped with a conventional encryption circuit may be vulnerable to an implementation attack even if it can maintain security against a theoretical attack.
そこで、本発明は、実装攻撃に対する耐タンパ性を向上可能な不正操作検知回路、不正操作検知回路を備えた装置、及び不正操作検知方法を提供することを目的とする。 Therefore, an object of the present invention is to provide an unauthorized operation detection circuit, an apparatus including an unauthorized operation detection circuit, and an unauthorized operation detection method that can improve tamper resistance against mounting attacks.
本発明の一観点によれば、互いに異なる複数の、状態値の変化条件ルールを出力する変化条件ルール出力回路と、前記複数の変化条件ルールに従って現在の状態値に対する状態遷移後の状態値を生成する状態値生成回路と、前記複数の変化条件ルールに従って前記状態値生成回路で生成された状態遷移後の状態値のうち、1つの変化条件ルールに従って生成された状態遷移後の状態値と、前記変化条件ルール出力回路から出力された前記複数の変化条件ルールのうち、前記1つの変化条件ルールとを、乱数に基づいて選択出力する選択部と、演算開始入力に基づいて入力される前記現在の状態値を格納すると共に、前記選択部から選択出力される前記状態遷移後の状態値を次に入力されて格納する状態値格納部と、前記状態値格納部から出力される前記現在の状態値と前記状態値格納部に前記次に入力される前記状態遷移後の状態値とを比較し、状態遷移が前記選択部から選択出力される前記1つの変化条件ルールに従っていないと不正操作を検知して検知信号を出力する状態値比較回路を備え、前記複数の変化条件ルールは、同一固定ビット数の値変化を用いるルールである不正操作検知回路が提供される。 According to one aspect of the present invention, a change condition rule output circuit that outputs a plurality of different state value change condition rules, and a state value after state transition for a current state value is generated according to the plurality of change condition rules. A state value generation circuit, and a state value after the state transition generated according to one change condition rule among the state values after the state transition generated by the state value generation circuit according to the plurality of change condition rules, among the plurality of change conditions rules that are outputted from the change condition rule output circuit, and said one change condition rules, a selection unit for selectively outputting, based on a random number, is input on the basis of the operation start input the stores the current state value, and the state value storing unit for storing a state value after the state transition selected output from the selecting unit then is inputted, an output from the state value storage unit The one change condition rule in which the current state value is compared with the state value after the state transition that is input next to the state value storage unit, and the state transition is selected and output from the selection unit If not, a state value comparison circuit that detects an unauthorized operation and outputs a detection signal is provided, and the change condition rule is an unauthorized operation detection circuit that is a rule that uses a value change of the same fixed number of bits.
本発明の一観点によれば、外部装置と通信して演算開始入力を受信する通信回路と、プロセッサと、不正操作検知回路を備え、前記不正操作検知回路は、互いに異なる複数の、状態値の変化条件ルールを出力する変化条件ルール出力回路と、前記複数の変化条件ルールに従って現在の状態値に対する状態遷移後の状態値を生成する状態値生成回路と、前記複数の変化条件ルールに従って前記状態値生成回路で生成された状態遷移後の状態値のうち、1つの変化条件ルールに従って生成された状態遷移後の状態値と、前記変化条件ルール出力回路から出力された前記複数の変化条件ルールのうち、前記1つの変化条件ルールとを、乱数に基づいて選択出力する選択部と、前記演算開始入力に基づいて入力される前記現在の状態値を格納すると共に、前記選択部から選択出力される前記状態遷移後の状態値を次に入力されて格納する状態値格納部と、前記状態値格納部から出力される前記現在の状態値と前記状態値格納部に前記次に入力される前記状態遷移後の状態値とを比較し、状態遷移が前記選択部から選択出力される前記1つの変化条件ルールに従っていないと不正操作を検知して検知信号を前記プロセッサに出力する状態値比較回路を備え、前記複数の変化条件ルールは、同一固定ビット数の値変化を用いるルールである装置が提供される。 According to one aspect of the present invention, a communication circuit that communicates with an external device to receive an operation start input, a processor, and an unauthorized operation detection circuit are provided, and the unauthorized operation detection circuit includes a plurality of different state values. A change condition rule output circuit that outputs a change condition rule, a state value generation circuit that generates a state value after state transition with respect to a current state value according to the plurality of change condition rules, and the state value according to the plurality of change condition rules Of the state values after the state transition generated by the generation circuit, the state value after the state transition generated according to one change condition rule and the plurality of change condition rules output from the change condition rule output circuit. among them, the said one change condition rules, a selection unit for selectively outputting, based on the random number, if the stores the current state values input based on the operation start input co In, then the state value storing unit for storing entered, the stored current state value and the state value output from said state value storage state value after the state transition selected output from the selector The state value after the next state transition input to the unit is compared, and if the state transition does not comply with the one change condition rule selected and output from the selection unit, an unauthorized operation is detected and a detection signal is output. It includes a state value comparison circuit for outputting to said processor, said plurality of variation condition rule is a rule to use a value change in the same fixed number of bits device is provided.
本発明の一観点によれば、複数の変化条件ルールに従って状態値生成回路で現在の状態値に対する状態遷移後の状態値を生成し、1つの変化条件ルールに従って生成された状態遷移後の状態値と、前記1つの変化条件ルールとを、乱数に基づいて選択部から選択出力するステップと、演算開始入力に基づいて状態値格納部に入力される前記現在の状態値を格納すると共に、前記選択部から選択出力される前記状態遷移後の状態値を次に入力されて格納するステップと、前記状態値格納部から出力される前記現在の状態値と前記状態値格納部に前記次に入力される前記状態遷移後の状態値とを状態値比較回路で比較し、状態遷移が前記1つの変化条件ルールに従っていないと不正操作を検知して検知信号を出力するステップを不正操作検知回路で実行し、前記複数の変化条件ルールは互いに異なり、且つ、同一固定ビット数の値変化を用いるルールである不正操作検知方法。 According to one aspect of the present invention, the state value generation circuit generates a state value after the state transition with respect to the current state value according to a plurality of change condition rules, and the state after the state transition generated according to one change condition rule value, and the one change condition rule, and selecting the output from the selecting unit based on a random number, the stores the current state value inputted to the state value storage unit based on the calculated start input, Next , the state value after the state transition selected and output from the selection unit is input and stored; the current state value output from the state value storage unit; and the state value storage unit A step of comparing an input state value after the state transition with a state value comparison circuit, detecting an unauthorized operation when the state transition does not comply with the one change condition rule, and outputting a detection signal. The unauthorized operation detection method is a rule that is executed by the above-described method, and the plurality of change condition rules are different from each other and use value changes of the same fixed number of bits.
開示の不正操作検知回路、不正操作検知回路を備えた装置、及び不正操作検知方法によれば、実装攻撃に対する耐タンパ性を向上することが可能となる。 According to the disclosed unauthorized operation detection circuit, the device including the unauthorized operation detection circuit, and the unauthorized operation detection method, it is possible to improve tamper resistance against an implementation attack.
開示の不正操作検知回路、不正操作検知回路を備えた装置、及び不正操作検知方法では、状態値の変化条件ルールを変化条件ルール出力回路から出力し、複数の変化条件ルールに従って現在の状態値に対する状態遷移後の状態値を状態値生成回路で生成し、選択部から、複数の変化条件ルールに従って状態値生成回路で生成された状態遷移後の状態値のうち、1つの変化条件ルールに従って生成された状態遷移後の状態値と、変化条件ルール出力回路から出力された複数の変化条件ルールのうち、前記1つの変化条件ルールを、乱数に基づいて選択出力する。状態値格納部は、演算開始入力に基づいて現在の状態値を格納すると共に、選択部から選択出力される状態遷移後の状態値を格納する。状態値比較回路は、状態値格納部の入出力に基づき状態遷移後の状態値と現在の状態値を比較し、状態遷移が選択部から選択出力される前記1つの変化条件ルールに従っていないと不正操作を検知して検知信号を出力する。複数の変化条件ルールは、互いに異なるが、同一固定ビット数の値変化を用いるルールである。 In the disclosed unauthorized operation detection circuit, the device including the unauthorized operation detection circuit, and the unauthorized operation detection method, the change condition rule of the state value is output from the change condition rule output circuit, and the current state value according to the plurality of change condition rules is output. A state value after the state transition is generated by the state value generation circuit, and is generated from the selection unit according to one change condition rule among the state values after the state transition generated by the state value generation circuit according to a plurality of change condition rules. Of the plurality of change condition rules output from the state value after the state transition and the change condition rule output circuit, the one change condition rule is selectively output based on a random number. The state value storage unit stores the current state value based on the calculation start input, and stores the state value after the state transition selected and output from the selection unit. The state value comparison circuit compares the state value after the state transition with the current state value based on the input / output of the state value storage unit, and if the state transition does not comply with the one change condition rule selected and output from the selection unit, it is illegal. Detects an operation and outputs a detection signal. Although the plurality of change condition rules are different from each other, they are rules using value changes of the same fixed number of bits.
以下に、開示の不正操作検知回路、不正操作検知回路を備えた装置、及び不正操作検知方法の各実施例を図面と共に説明する。 Embodiments of the disclosed unauthorized operation detection circuit, the device including the unauthorized operation detection circuit, and the unauthorized operation detection method will be described below with reference to the drawings.
先ず、RSA暗号について説明する。RSA暗号の復号処理では、指数剰余演算が行われる。指数剰余演算は、秘密鍵d、暗号文a、法nに対して、v=ad (mod n)により平文vを計算する。一般的に、RSA暗号における秘密鍵dのビット長は、1024bit以上である。このため、d乗演算は単純な方法で実行すると、約21024回の乗算が必要となり、現実的な時間内に計算を完了することは難しい。 First, RSA encryption will be described. In the decryption process of the RSA cipher, exponent remainder calculation is performed. In the exponent remainder calculation, plaintext v is calculated by v = a d (mod n) for secret key d, ciphertext a, and modulus n. Generally, the bit length of the secret key d in RSA encryption is 1024 bits or more. For this reason, if the d-th power operation is executed by a simple method, about 2 1024 multiplications are required, and it is difficult to complete the calculation within a realistic time.
このd乗演算を効率的に行うためのアルゴリズムとしては、バイナリ法が知られている(例えば、非特許文献1参照)。バイナリ法を用いることで、d乗演算に必要な演算回数は、21024回から1024の定数倍(この定数は1.5以下の値)になり、効率的な演算を実現できる。 A binary method is known as an algorithm for efficiently performing this d-power operation (see, for example, Non-Patent Document 1). By using the binary method, the number of operations required for the d-th power operation is from 2 1024 times to a constant multiple of 1024 (this constant is a value of 1.5 or less), and an efficient operation can be realized.
秘密鍵dをu-bit値とし、その2進表現をd=(du-1,du-2,...,d0)2と表記する。ただし、diはdの個々のビット値を表す。図1は、バイナリ法を用いた指数剰余演算のアルゴリズムを説明する図であり、図2は、バイナリ法の処理を説明する図である。図1のアルゴリズムでは、秘密鍵dのビット値diを、i=u-1からi=0の順番にチェックする。このチェックの結果がdi=1であると、2乗算と乗算の両方が実行される。チェックの結果がdi=0であると、2乗算のみが実行される。このような処理をi=u-1からi=0まで繰り返すことにより、バイナリ法はv=ad(mod n)を計算する。つまり、バイナリ法では、秘密鍵dのビットdiの値と、2乗算、乗算の実行パターンとが直接的に連動している。 The secret key d is a u-bit value, and its binary representation is expressed as d = (d u−1 , d u−2 ,..., D 0 ) 2 . Here, d i represents an individual bit value of d. FIG. 1 is a diagram for explaining an algorithm for exponential residue calculation using the binary method, and FIG. 2 is a diagram for explaining processing of the binary method. In the algorithm of FIG. 1, the bit value d i of the secret key d is checked in the order from i = u−1 to i = 0. If the result of this check is d i = 1, both two multiplications and multiplications are performed. If the result of the check is d i = 0, only two multiplications are performed. By repeating such processing from i = u−1 to i = 0, the binary method calculates v = a d (mod n). That is, in the binary method, the value of bit d i of the secret key d, 2 multiplications, and the execution pattern multiplication are linked directly.
図3はフォールト攻撃を説明する図である。特にレーザを用いたストレス印加法は、1ビット(以下、1-bitと言う)単位で正確にフォールトを発生させることができ、攻撃者が意図した通りのフォールトを発生させることができてしまう。代表的なフォールト攻撃は、例えば非特許文献2に記載されている。説明の便宜上、RSA暗号に対するフォールト攻撃の概略について説明する。
FIG. 3 is a diagram for explaining a fault attack. In particular, the stress application method using a laser can accurately generate a fault in units of 1 bit (hereinafter referred to as 1-bit), and can generate a fault as intended by an attacker. A typical fault attack is described in
RSA暗号は、素数p, qに対しn=p×qを満たす合成数nを用いる。RSA暗号の安全性は、素因数分解によりnから素数p, qを得ることが困難であるという仮定に基づいている。ただし、p, qは512-bit以上、nは1024-bit以上の大きな整数である。つまり、攻撃者が合成数nから素数p, qを得ることに成功してしまうと、RSA暗号は解読されてしまう。 The RSA encryption uses a composite number n that satisfies n = p × q for prime numbers p and q. The security of the RSA cipher is based on the assumption that it is difficult to obtain primes p and q from n by prime factorization. However, p and q are large integers of 512-bit or more and n is 1024-bit or more. That is, if the attacker succeeds in obtaining the prime numbers p and q from the composite number n, the RSA cipher is decrypted.
RSA暗号に対するフォールト攻撃の目的は、素数pを得ることである。素数pを得ることができれば、割り算によりqも簡単に求めることができるので、p, qのいずれかを攻撃者が得ることができれば、RSA暗号は解読されてしまう。 The purpose of the fault attack on the RSA cipher is to obtain a prime number p. If the prime number p can be obtained, q can also be easily obtained by division. Therefore, if the attacker can obtain either p or q, the RSA cipher is decrypted.
RSA暗号に対するフォールト攻撃は、正常な出力値と、フォールトを発生させた場合の異常な出力値との2つを用いることで、pを解読する。攻撃者は、正常な出力値を得た後、後述の(mod q)のべき乗剰余計算における計算処理を実行している最中にフォールトを発生させる。 In the fault attack on the RSA cipher, p is deciphered by using two of a normal output value and an abnormal output value when a fault is generated. After obtaining a normal output value, the attacker generates a fault during the execution of the calculation process in the power-residue calculation of (mod q) described later.
この結果、正常な処理の場合 mq=cq dq (mod q)を得るのに対し、フォールト発生の場合は計算値が異常な値となり、m'q≠mqを満たすm'qを得る(m'qの値は、mqと等しくなければどのような値でも攻撃が成功する)。このm'qを用いて最終的に計算された結果、攻撃者は出力m'を得る。攻撃者は、正常な出力mとフォールト発生時の出力m'を用いて、GCD(m' - n, n)を計算することで、p=GCD(m' - m, n)を得る。ただし、GCD(a,b)は整数a,bの最大公約数を計算する関数である。 As a result, while obtaining a case of normal processing m q = c q dq (mod q), in the case of fault occurrence calculated value is an abnormal value, obtaining a q 'm satisfy q ≠ m q' for m (If m ' q is not equal to m q , the attack succeeds at any value.) As a result of the final calculation using m'q , the attacker obtains an output m '. The attacker obtains p = GCD (m′−m, n) by calculating GCD (m′−n, n) using the normal output m and the output m ′ when the fault occurs. GCD (a, b) is a function for calculating the greatest common divisor of integers a and b.
この攻撃が成立する理由は、異常なm'qを用いて後述するm'の計算を行うことで、正しいmの値とm'の値との差分がpの整数倍、即ち、整数kに対してm' -m = kpとなるからであり、その結果、CD(m' - m, n)=GCD(kp, pq) = pを得られてしまう。 The reason for this attack is that the calculation of m 'described later using an abnormal m' q makes the difference between the correct m value and m 'value an integral multiple of p, that is, the integer k. On the other hand, since m′−m = kp, CD (m′−m, n) = GCD (kp, pq) = p can be obtained as a result.
入力:c (暗号文)
dp (秘密鍵dに対し、dp=d mod (p-1)を満たす秘密鍵)
dq (秘密鍵dに対し、dq=d mod (q-1)を満たす秘密鍵)
p (n=p×qを満たす素数p)
q (n=p×qを満たす素数q)
u (u= q-1 (mod p)を満たす整数)
出力:m (平文)
ただし、eは暗号化用の公開鍵、 dは復号用秘密鍵であり、ed=1 mod (p-1)(q-1)を満たす。
Input: c (ciphertext)
dp (secret key satisfying dp = d mod (p-1) for secret key d)
dq (secret key satisfying dq = d mod (q-1) for secret key d)
p (prime number p satisfying n = p × q)
q (prime number q satisfying n = p × q)
u (integer that satisfies u = q -1 (mod p))
Output: m (plain text)
However, e is a public key for encryption, d is a private key for decryption, and satisfies ed = 1 mod (p−1) (q−1).
*正常な処理
1. cp= c mod p, cq = c mod q
2. mp=cp dp (mod p)を計算
3. mq=cq dq (mod q)を計算
4. m = ( (mq - mp)×u (mod q) )×p + mp を計算
5. mを出力
*Fault発生時の処理
1. cp= c mod p, cq = c mod q
2. mp=cp dp (mod p)
3. mq=cq dq (mod q)計算中にfault発生、mqの代わりにm'q出力(mq'≠mq)
4. m = ( (m'q - mp)×u (mod q) )×p + mp を計算
5. m'を出力
上記の如きフォールト攻撃は、正常な出力値とフォールト発生時の出力値を比較することにより、RSA暗号を解読するための秘密鍵である素数pを得る。ここでは説明の便宜上、フォールト発生時の電力波形を観察することで秘密鍵dを得るフォールト攻撃について説明する。
* Normal processing
1.c p = c mod p, c q = c mod q
2.Calculate m p = c p dp (mod p)
3.Calculate m q = c q dq (mod q)
4.Calculate m = ((m q -m p ) × u (mod q)) × p + m p
5. Output m * Processing when a fault occurs
1.c p = c mod p, c q = c mod q
2.m p = c p dp (mod p)
3. m q = c q dq ( mod q) fault occurs during computation, instead m 'q output (m q' of m q ≠ m q)
4.Calculate m = ((m ' q -m p ) × u (mod q)) × p + m p
5. Output m ′ In the fault attack as described above, a prime number p, which is a secret key for decrypting the RSA cipher, is obtained by comparing the normal output value and the output value at the time of occurrence of the fault. Here, for convenience of explanation, a fault attack for obtaining the secret key d by observing the power waveform at the time of fault occurrence will be described.
図4はバイナリ法を用いるRSA暗号をベースとした電力解析への耐タンパ性を有するRSA暗号アルゴリズムを説明する図である。図4の左側に記してある4ビット値1はRSA暗号アルゴリズムの実行状態を表す値であり、以下では「状態値」と呼ぶ。図4のRSA暗号アルゴリズムにおいては、(0000)2, (0001)2, ...., (1001)2が状態値である。図4のRSA暗号処理に限らず、状態値は、暗号処理を実行する装置において演算の実行状態を管理するために用いられる。
FIG. 4 is a diagram for explaining an RSA encryption algorithm having tamper resistance to power analysis based on RSA encryption using the binary method. A 4-
図4のRSA暗号アルゴリズムは、入力された暗号文c、秘密鍵d=(du-1,du-2,...,d0)2、法nから、平文m=cd (mod n)を計算し、電力解析により秘密鍵dが漏洩することを防ぐ耐タンパ機能(または、耐タンパ性)を有する。この耐タンパ機能について、図5を用いて説明する。 The RSA encryption algorithm shown in FIG. 4 has an input ciphertext c, a secret key d = (d u−1 , d u−2 ,..., D 0 ) 2 , and a modulus n, and plaintext m = c d (mod It has a tamper resistance function (or tamper resistance) that calculates n) and prevents the secret key d from being leaked by power analysis. This tamper resistance function will be described with reference to FIG.
図5は、図4のRSA暗号アルゴリズムを実装した装置におけるd=(10100...)2の場合の消費電力波形を示す図である。図5は、d=(du-1,du-2,...,d0)2に対して、以下の処理をi=u-1,...,1,0の夫々について繰り替えし実行した場合の波形である。 FIG. 5 is a diagram showing a power consumption waveform in the case where d = (10100...) 2 in the apparatus in which the RSA encryption algorithm of FIG. 4 is implemented. In FIG. 5, for d = (d u-1 , d u-2 , ..., d 0 ) 2 , the following processing is repeated for each of i = u-1, ..., 1,0. This is the waveform when executed.
di=1: R0=R0×R0で示される2乗算の後に、R0=R0×R1で示される乗算が実行される。 d i = 1: After two multiplications indicated by R 0 = R 0 × R 0 , a multiplication indicated by R 0 = R 0 × R 1 is executed.
di=0: R0=R0×R0で示される2乗算が実行される。 d i = 0: A double multiplication represented by R 0 = R 0 × R 0 is executed.
つまり、図5ではdiのビット値に応じて、R0=R0×R0とR0=R0×R1との2種類の乗算が実行されている。仮に、これらの乗算の種類を消費電力波形により識別することが可能であると、diのビット値を判別でき、秘密鍵dを解読されてしまう。しかし、図4のRSA暗号アルゴリズムに対しては、上記のような識別は困難である。これは、R0,R1は図4の状態値(0001)2,(0010)2に記されている通り、初期値を乱数r1, r2により与えられ更新される常にランダムな値であるからである。 That is, according to the bit value of d i in FIG. 5, two multiplication with R 0 = R 0 × R 0 and R 0 = R 0 × R 1 is running. If these multiplication types can be identified by the power consumption waveform, the bit value of d i can be determined and the secret key d is decrypted. However, the above identification is difficult for the RSA encryption algorithm of FIG. This is because R 0 and R 1 are always random values that are updated by initial values given by random numbers r 1 and r 2 as described in state values (0001) 2 and (0010) 2 in FIG. Because there is.
つまり、R0=R0×R0とR0=R0×R1との2種類の乗算は、いずれも(乱数)×(乱数)の乗算であり、このような乱数データ同士の乗算は、図5に示すように、消費電力波形で識別するのは困難である。このように、図4のRSA暗号アルゴリズムに対する電力解析は困難である。従って、図4のRSA暗号アルゴリズムを実行する装置は、電力解析に対して安全である。 In other words, the two types of multiplication of R 0 = R 0 × R 0 and R 0 = R 0 × R 1 are both (random number) × (random number) multiplications. As shown in FIG. 5, it is difficult to identify with the power consumption waveform. Thus, power analysis for the RSA encryption algorithm of FIG. 4 is difficult. Therefore, the device that executes the RSA encryption algorithm of FIG. 4 is safe for power analysis.
図4のRSA暗号アルゴリズムに対して、フォールト攻撃を行うことで、電力解析に対する耐性を無効化できる攻撃法も存在する(例えば、非特許文献3参照)。RSA暗号アルゴリズムに対して、フォールト攻撃を行うことで、電力解析に対する耐性を無効化できる攻撃法では、フォールト攻撃を行うことで、状態値の一部を強制的に変更し、電力解析への対策機能に必要となる処理をスキップし、対策機能を無効化させる。 There is also an attack method that can invalidate resistance to power analysis by performing a fault attack on the RSA encryption algorithm of FIG. 4 (see, for example, Non-Patent Document 3). In the attack method that can invalidate the resistance to power analysis by performing a fault attack against the RSA encryption algorithm, a part of the state value is forcibly changed by performing a fault attack, and measures against power analysis Skip the processing required for the function and disable the countermeasure function.
図6は、フォールト攻撃による電力解析の対策機能を無効化する方法を説明する図である。図6に示すように、実行状態は基本的に状態値の状態遷移により管理される。正常な処理においては、この状態値は(0000)2→(0001)2→(0010)2→(0011)2...のように、1つずつ増加しながら遷移するので、図6に示す順番でRSA暗号アルゴリズムの処理が行われる。 FIG. 6 is a diagram for explaining a method of invalidating a countermeasure function for power analysis by a fault attack. As shown in FIG. 6, the execution state is basically managed by state transition of state values. In normal processing, this state value transitions while increasing one by one as (0000) 2 → (0001) 2 → (0010) 2 → (0011) 2 . The RSA encryption algorithm is processed in order.
図6に示したRSA暗号アルゴリズムの処理に対し、フォールト攻撃は状態値の値を強制的に変更することで、例えば(0000)2→ (0010)2→(0011)2...のように、一部の状態値(図6の例では(0001)2)を強制的にスキップさせる。このような精度の高いフォールト発生は、レーザを用いたストレス印加方法により実現できる。このように図6のRSA暗号アルゴリズムの処理に対し、フォールト攻撃により状態値(0001)2を強制的にスキップすることで、R0への乱数の書込み処理がスキップされるため、R0の値は初期値0となる。 In contrast to the processing of the RSA encryption algorithm shown in FIG. 6, the fault attack forcibly changes the value of the state value, for example, (0000) 2 → (0010) 2 → (0011) 2 . Some state values ((0001) 2 in the example of FIG. 6) are forcibly skipped. Such highly accurate fault generation can be realized by a stress application method using a laser. In this way, by forcibly skipping the state value (0001) 2 by a fault attack with respect to the processing of the RSA encryption algorithm of FIG. 6, the process of writing a random number to R 0 is skipped, so the value of R 0 The initial value is 0.
図4及び図6のRSA暗号アルゴリズムにおいては、R0への乱数書込みが耐タンパ機能を保障する重要な条件であり、この処理がスキップされることで耐タンパ機能が無効化されてしまう。このような処理のスキップの結果、R0の値が0となった場合の消費電力波形を図7に示す。図7は、図6の状態値(0001)2をスキップしたRSA暗号アルゴリズムを実装した装置におけるd=(10100...)2の場合の消費電力波形を示す図である。 In the RSA encryption algorithm of FIGS. 4 and 6, random number writing to R 0 is an important condition for ensuring the tamper resistant function, and this tamper resistant function is invalidated by skipping this process. FIG. 7 shows a power consumption waveform when the value of R 0 becomes 0 as a result of skipping such processing. FIG. 7 is a diagram showing a power consumption waveform in the case of d = (10100...) 2 in an apparatus that implements the RSA encryption algorithm in which the state value (0001) 2 of FIG. 6 is skipped.
図7の例では、R0=R0×R0とR0=R0×R1の2種類の乗算が発生している。図5の消費電力波形においては、これら2種類の乗算は共に(乱数)×(乱数)である。しかし、図7の消費電力波形においては、フォールト発生によりR0の値がゼロであるので、夫々以下の乗算となる。 In the example of FIG. 7, two types of multiplications R 0 = R 0 × R 0 and R 0 = R 0 × R 1 occur. In the power consumption waveform of FIG. 5, these two types of multiplication are both (random number) × (random number). However, in the power consumption waveform of FIG. 7, since the value of R 0 is zero due to the occurrence of a fault, the following multiplications are respectively performed.
R0×R0:0×0
R0×R1:0×(乱数)
つまり、R0×R0は入力の両方がゼロである乗算である。R0×R1は入力の片方がゼロである乗算である。乗算の性質上、0を入力とする乗算の消費電力波形は、特殊な形状になることが知られている。このような特殊な波形は、0の入力が1個か、2個かに応じてさらに変化する場合がある。つまり、0の入力が1個である波形と、2個である波形は夫々に特徴がある。従って、図7に示すようにR0×R0の乗算とR0×R1の乗算とは、消費電力波形の形状によって識別できてしまう。これらの消費電力波形を識別することで、そのままdのビット値を識別できるので、図7の消費電力波形からは秘密鍵dをd=(10100..)2と解読されてしまう。
R 0 × R 0 : 0 × 0
R 0 × R 1 : 0 × (random number)
That is, R 0 × R 0 is a multiplication in which both inputs are zero. R 0 × R 1 is a multiplication in which one of the inputs is zero. Due to the nature of multiplication, it is known that the power consumption waveform of multiplication with 0 as an input has a special shape. Such a special waveform may further change depending on whether one or two zeros are input. That is, a waveform having one input of 0 and a waveform having two inputs are characteristic. Therefore, as shown in FIG. 7, the multiplication of R 0 × R 0 and the multiplication of R 0 × R 1 can be identified by the shape of the power consumption waveform. Since the bit value of d can be identified as it is by identifying these power consumption waveforms, the secret key d is deciphered as d = (10100 ..) 2 from the power consumption waveform of FIG.
RSA暗号アルゴリズムに対してフォールト攻撃を行うことで電力解析に対する耐性を無効化できる攻撃法を防ぐための対策技術は、従来から提案されている(例えば、特許文献1参照)。この対策技術は、回路の内部状態をチェックし、フォールト発生の有無の検知を行うフォールト検知による対策法である。フォールト検知を用いることで、フォールトが発生した場合でも、暗号装置の処理停止やデータ出力停止など、適切な防御方法を実施することができる。 A countermeasure technique for preventing an attack method that can invalidate resistance to power analysis by performing a fault attack on the RSA encryption algorithm has been proposed (see, for example, Patent Document 1). This countermeasure technique is a countermeasure method based on fault detection that checks the internal state of a circuit and detects whether or not a fault has occurred. By using fault detection, even when a fault occurs, it is possible to implement an appropriate defense method such as stopping processing of the encryption device or stopping data output.
従来のフォールト検知は、暗号装置の外側に状態値の外付けのカウンタを設置し、状態値の状態遷移が進む毎に、このカウンタを増加させ、このカウンタの値が期待通りの値であるかのチェックを定期的に行うことで、状態値の状態遷移が正しいかどうかのチェックを行う。つまり、従来のフォールト検知は、状態値の状態遷移が正しく行われているかどうかを、外付けのカウンタを用いて間接的にチェックする。しかし、このようなフォールト検知法では、基本的なフォールト攻撃を検知できるものの、より高度なフォールト攻撃が行われた場合、フォールト検知機能が無効化されてしまう。つまり、このようなフォールト検知法は、フォールト検知にリアルタイム性がないため、フォールトを1回発生させるフォールト攻撃に対しては有効であるが、フォールトを2回発生させるフォールト攻撃に対しては無効である。 In the conventional fault detection, an external counter of the state value is installed outside the cryptographic device, and this counter is incremented every time the state value transitions, and whether this counter value is as expected. Checking whether the state transition of the state value is correct is performed periodically. That is, in the conventional fault detection, whether or not the state transition of the state value is correctly performed is indirectly checked using an external counter. However, although such a fault detection method can detect a basic fault attack, if a more advanced fault attack is performed, the fault detection function is invalidated. In other words, such a fault detection method is effective for a fault attack that generates a fault once, because it does not have real-time fault detection, but is ineffective for a fault attack that generates a fault twice. is there.
そこで、状態値の状態遷移とフォールト検知を一体化することで、全ての状態遷移に関してフォールト検知を有効とし、フォールト検知のリアルタイム性を保障する不正操作検知回路が提案されている(例えば、特許文献3参照)。この提案されている不正操作検知回路では、状態値の変化条件ルールを複数準備し、どの変化条件ルールを用いるかを不正操作検知回路の内部で発生させた乱数によって選択することで、攻撃者がフォールト検知漏れとなる状態値のスキップのパターンを特定できないようにして、安全性を向上する。3種類の変化条件ルールを用いる場合、第1、第2、及び第3変化条件ルールは互いに異なるビット数を有し、夫々例えば1ビット、2ビット、及び3ビットである。この提案されている不正操作検知回路によれば、変化条件ルールに適合しない状態遷移を検出すると、フォールト検知信号が出力されるので、フォールト攻撃に対しては有効である。しかし、フォールト検知信号をゲイン毎に分類すると、フォールト検知信号のゲインの例えば最大値が同じ変化条件ルール内では変化しないものの、異なる変化条件ルール間では大きく変化するので、この変化に基づいて変化条件ルールが解読されてしまう可能性がある。つまり、この提案されている不正操作検知回路は、フォールト攻撃に対する耐タンパ技術であり、サイドチャネルとして見える不正操作検知回路の消費電力の動的変化の解析から変化条件ルールが解読されるサイドチャネル攻撃には脆弱である。 Thus, there has been proposed an unauthorized operation detection circuit that makes fault detection effective for all state transitions by integrating state transitions and fault detection of state values, and ensures real-time fault detection (for example, Patent Documents). 3). In this proposed unauthorized operation detection circuit, a plurality of state value change condition rules are prepared, and an attacker can select which change condition rule to use by a random number generated inside the unauthorized operation detection circuit. The safety is improved by making it impossible to specify the skip pattern of the state value that causes fault detection failure. When three kinds of change condition rules are used, the first, second, and third change condition rules have different numbers of bits, for example, 1 bit, 2 bits, and 3 bits, respectively. According to the proposed unauthorized operation detection circuit, a fault detection signal is output when a state transition that does not conform to the change condition rule is detected, which is effective against a fault attack. However, if the fault detection signal is classified by gain, the maximum value of the fault detection signal gain, for example, does not change within the same change condition rule, but changes greatly between different change condition rules. Rules may be deciphered. In other words, this proposed unauthorized operation detection circuit is a tamper-resistant technology against fault attacks, and a side channel attack in which change condition rules are deciphered from analysis of dynamic changes in power consumption of the unauthorized operation detection circuit that appears as a side channel. Is vulnerable.
図8は、本発明の一実施例における不正操作検知回路の一例を示すブロック図である。
図8に示す不正操作検知回路30は、状態値テーブル11A〜11Cを有する状態値生成回路11、状態値レジスタ12、変化条件ルール出力回路13A〜13C、状態値比較回路14、セレクタ15、及びセレクタ16を有する。不正操作検知回路30は、フォールト検知回路の機能を備えたステートマシン(State Machine)の一例である。
FIG. 8 is a block diagram showing an example of the unauthorized operation detection circuit in one embodiment of the present invention.
The unauthorized
状態値レジスタ12は、外部からの演算開始入力に基づいて、現在の状態値を格納する状態値格納部を形成する。状態値生成回路11は、状態値テーブル11A〜11Cを用いて、状態値レジスタ12が格納している現在の状態値、即ち、状態値レジスタ12の出力に基づいて状態遷移後の状態値を決定する。変化条件ルール出力回路13A〜13Cは、フォールト攻撃が無い場合の正常な処理時における状態値の変化条件ルールType-A〜Type-Cを定める。変化条件ルールType-A, Type-B, Type-Cは、互いに異なるルールである。状態値比較回路14は、状態値の状態遷移が正常であるか否かを判断し、状態値の状態遷移の異常からフォールト攻撃を検知するとフォールト検知信号を出力する。セレクタ15は、状態値生成回路11の状態値テーブル11A〜11Cを用いて生成された現在の状態値に対する状態遷移後の3つの状態値の1つを、外部からの乱数入力に基づいて選択出力して状態値レジスタ12及び状態値比較回路14に入力する。状態値テーブル11A〜11Cは、夫々現在の状態値に対する変化条件ルールType-A〜Type-Cに従った状態遷移後の状態値を生成するのに必要なデータ(即ち、変化条件ルールType-A〜Type-Cのデータ)を格納する。また、セレクタ16は、変化条件ルール出力回路13A〜13Cのうち1つの出力を、外部からの乱数入力に基づいて選択出力して状態値比較回路14に入力する。なお、乱数は、不正操作検知回路30内で発生しても良いことは言うまでもない。
The state value register 12 forms a state value storage unit that stores the current state value based on an operation start input from the outside. The state
セレクタ15及びセレクタ16は、乱数入力に基づいて連動している選択部を形成する。選択部は、変化条件ルールType-Aに従った状態値テーブル11Aを用いて生成された状態遷移後の状態値の出力が選択されるとき変化条件ルール出力回路13Aの変化条件ルールType-Aの出力が選択され、変化条件ルールType-Bに従った状態値テーブル11Bを用いて生成された状態遷移後の状態値の出力が選択されるとき変化条件ルール出力回路13Bの変化条件ルールType-Bの出力が選択され、変化条件ルールType-Cに従った状態値テーブル11Cを用いて生成された状態遷移後の状態値の出力が選択されるとき変化条件ルール出力回路13Cの変化条件ルールType-Cの出力が選択されるように動作する。
The
状態値比較回路14は、状態値レジスタ12の出力(即ち、現在の状態値)と入力(即ち、状態値生成回路11で生成された現在の状態値に対する状態遷移後の状態値)を比較することで、セレクタ16から出力される変化条件ルール(状態値生成回路11で用いた変化条件ルールと同じ)に基づいてフォールト発生の有無を検知する。具体的には、状態値比較回路14は、状態値レジスタ12の出力と入力との関係が、セレクタ16から出力される変化条件ルールに従った1-bit変化であるか否かに基づいて、フォールト発生の有無を検知する。
The state value comparison circuit 14 compares the output (that is, the current state value) of the
状態値比較回路14は、状態値レジスタ12の出力と入力との関係が、セレクタ16を介して与えられる変化条件ルールに従っている場合、フォールト発生の無い正常な処理であると判断する。一方、状態値レジスタ12の出力と入力との関係が、セレクタ16を介して与えられる変化条件ルールに従っていない場合、状態値比較回路14はフォールトの発生した異常な処理であると判断してフォールト検知信号を出力する。
State value comparator circuit 14, the relationship between the output and input of the
なお、セレクタ15による状態値生成回路11の状態値テーブル11A〜11Cの何れか1つを用いて生成された状態値の出力を選択する処理と、セレクタ16による変化条件ルール出力回路13A〜13Cの何れか1つの出力を選択する処理とは、不正操作検知回路30が動作する最初の演算開始入力による初期化処理で決定する。
It should be noted that the process of selecting the output of the state value generated using any one of the state value tables 11A to 11C of the state
図8に示す例では、変化条件ルール出力回路13Aの与える変化条件ルールが1-bit値変化のType-Aであり、変化条件ルール出力回路13Bの与える変化条件ルールが1-bit値変化のType-Bであり、変化条件ルール出力回路13Cの与える変化条件ルールが1-bit値変化のType-Cである。また、不正操作検知回路30では、状態値テーブル11Aが変化条件ルールType-Aに基づいて遷移後の状態値を決定し、状態値テーブル11Bが変化条件ルールType-Bに基づいて遷移後の状態値を決定し、状態値テーブル11Cが変化条件ルールType-Cに基づいて遷移後の状態値を決定する。
In the example shown in FIG. 8, the change condition rule given by the change condition rule output circuit 13A is Type-A of 1-bit value change, and the change condition rule given by the change condition rule output circuit 13B is Type of 1-bit value change. -B, and the change condition rule given by the change condition rule output circuit 13C is Type-C of 1-bit value change. In the unauthorized
図9は、図8の不正操作検知回路30においてサイドチャネルとして見える消費電力の動的変化の一例を示す図である。図9中、縦軸は不正操作検知回路30の消費電力を任意単位で示し、横軸は時間を任意単位で示す。この例では、変化条件ルール出力回路13Aの与える変化条件ルールが消費電力波形26Aの1-bit値変化のType-Aであり、変化条件ルール出力回路13Bの与える変化条件ルールが消費電力波形26Bの1-bit値変化のType-Bであり、変化条件ルール出力回路13Cの与える変化条件ルールが消費電力波形26Cの1-bit値変化のType-Cである。図9からもわかるように、不正操作検知回路30の消費電力の動的変化(例えば、最大値の変化)は、互いに異なる変化条件ルール出力回路13A〜13Cを用いていても、消費電力波形26A,26B,26Cから確認できないことがわかる。
FIG. 9 is a diagram illustrating an example of a dynamic change in power consumption that appears as a side channel in the unauthorized
不正操作検知回路30は、3つの状態値テーブル11A〜11Cを用いて現在の状態値に対する状態遷移後の3つの状態値を生成する状態値生成回路11と、3つの変化条件ルール出力回路13A〜13Cを備えるが、3つの変化条件ルールType-A〜Type-Cの中から乱数に基づいて選択される1つの変化条件ルールは、常に同一固定ビット数の値変化(この例では、1-bit値変化)である。
The unauthorized
なお、図8の不正操作検知回路30では、互いに異なる変化条件ルールの数が3つであるが、互いに異なる変化条件ルールの数は複数であれば特に限定されない。また、互いに異なる変化条件ルールは、同一固定ビット数の値変化を用いるルールであれば良く、1-bit値変化を用いるルールに限定されない。なお、1-bit値変化を用いる変化条件ルールを使用する場合、2-bit以上の値変化を用いる変化条件ルールを使用する場合と比べて回路構成が比較的簡単になり、且つ、消費電力を比較的低く抑えることができる。
In the unauthorized
図8の不正操作検知回路30によれば、攻撃者は何回もフォールト攻撃を繰り返し試すような攻撃を行っても、秘密鍵を解読することができない。不正操作検知回路30は、既知の攻撃に対して状態値の1-bit値変化で防御を行い、さらに未知の攻撃(または、進化した攻撃)に対しても状態値の1-bit値変化で防御することで、秘密鍵の漏洩を防止できる。この状態値の1-bit値変化を用いる変化条件ルールの数を多くするほど、攻撃に対してより安全となる。
According to the unauthorized
図10は、本実施例における実装攻撃対策ハードウェアを搭載したスマートカードの一例の構成を示すブロック図である。スマートカード100は、不正操作検知回路を備えた装置の一例である。図10に示すスマートカード100は、プロセッサの一例であるCPU(Central Processing Unit)101、記憶部の一例であるROM(Read Only Memory)102、通信回路103、外部インターフェース回路104、実装攻撃対策ハードウェアの一例である不正操作検知回路105、記憶部の一例であるRAM(Random Access Memory)106、クロック生成回路107、電源回路108、及びバス109を有する。バス109は、CPU101、ROM102、通信回路103、不正操作検知回路105、及びRAM106を接続する。
FIG. 10 is a block diagram showing a configuration of an example of a smart card equipped with mounting attack countermeasure hardware in the present embodiment. The
CPU101は、スマートカード100全体の制御を司り、この例では周知の方法で乱数を発生する機能を有する。ROM102は、CPU101が実行するプログラム及び各種データを格納する。通信回路103は、外部インターフェース回路104を介して外部装置(図示せず)と有線及び無線の少なくとも一方の通信方式で通信し、例えば外部装置から演算開始入力を含む各種要求などを受信する。
The
なお、乱数は、不正操作検知回路105内で発生しても、スマートカード100内のCPU101及び不正操作検知回路105以外の回路部で発生しても、スマートカード100外で発生して不正操作検知回路105に入力しても良い。
Whether the random number is generated in the unauthorized operation detection circuit 105 or generated in a circuit unit other than the
図10中、不正操作検知回路105は、図8に示す不正操作検知回路30に相当する。図8に示す乱数入力は、例えばCPU101から不正操作検知回路105に入力され、図8に示す演算開始入力は、例えば通信回路103から不正操作検知回路105に入力される。演算開始入力は、例えば通信回路103からCPU101を介して不正操作検知回路105に入力されても良い。不正操作検知回路105は、上記の如き不正操作を検知すると、バス109経由でCPU101にフォールト検知信号(または、割り込み信号)を出力する。CPU101は、フォールト検知信号を受信すると、秘密鍵データ消去処理、暗号装置の利用停止処理などを実行して、攻撃者がその後さらに実装攻撃をしても成功しないような適切な対策を取る。このような適切な対策には、周知の対策を採用可能である。
10, the unauthorized operation detection circuit 105 corresponds to the unauthorized
不正操作検知回路105は、RSA暗号アルゴリズム、AES(Advanced Encryption Standard)暗号アルゴリズムなどの、任意の暗号アルゴリズムに対するフォールト攻撃及びサイドチャネル攻撃により、秘密鍵が攻撃者により推定されることを防ぐ。スマートカード100は、不正操作検知回路105を備えることで、高い耐タンパ性を実現することができる。
The unauthorized operation detection circuit 105 prevents a secret key from being estimated by an attacker due to a fault attack and a side channel attack on an arbitrary encryption algorithm such as an RSA encryption algorithm and an AES (Advanced Encryption Standard) encryption algorithm. Since the
RAM106は、CPU101が実行する演算の中間データを含む各種データを一時的に格納し、CPU101のワークエリアを提供する。クロック生成回路107は、図10に破線で示すように、スマートカード100内のクロックを必要とする各部に供給するクロックを生成する。この例では、クロックはCPU101、ROM102、通信回路103、外部インターフェース回路104、不正操作検知回路105、及びRAM106に供給される。クロック生成回路107は、外部装置から外部インターフェース回路104を介して供給される信号、クロックなどに基づいてクロックを生成する構成であっても良い。電源回路108は、スマートカード100内の電源電圧を必要とする各部に電源電圧を供給する。電源回路108は、外部装置から外部インターフェース回路104を介して供給される信号に基づいて電源電圧を出力する構成であっても良い。スマートカード100が例えば非接触ICカードの場合、電源回路108は外部インターフェース回路104のアンテナで受信した、カードリーダ/ライタなどの外部装置が発生した電波を電力に変換して電源電圧を出力する構成であっても良い。また、外部インターフェース回路104は、端子を含む構成であっても良い。なお、図10では説明の便宜上、電源回路108が供給する電源電圧の電源供給線の図示は省略する。
The
次に、本実施例における不正操作検知方法の一例を、図11と共に説明する。図11は、本実施例における不正操作検知方法の一例を説明するフローチャートである。図11において、ステップS1で不正操作検知回路30(または、不正操作検知回路105)の不正操作検知処理が開始されると、ステップS2では通信回路103からの演算開始入力を読込んで暗号処理を開始する。ステップS2の後、ステップS3ではフォールト検知及び攻撃対策処理を行う。ステップS3は、ステップS31〜S38を含む。
Next, an example of the unauthorized operation detection method in the present embodiment will be described with reference to FIG. FIG. 11 is a flowchart for explaining an example of the unauthorized operation detection method according to this embodiment. In FIG. 11, when the unauthorized operation detection process of the unauthorized operation detection circuit 30 (or unauthorized operation detection circuit 105) is started in step S1, the calculation start input from the
ステップS31では、CPU101からの乱数入力を読込む。ステップS32では、乱数入力に基づいて変化条件ルールType-A〜Type-Cのいずれか1つの変化条件ルールが選択され、セレクタ15,16の出力が選択された変化条件ルールに応じて選択される。これにより、変化条件ルールType-Aが選択されると、ステップS33Aでは現在の状態値に対する状態遷移後の状態値を状態値テーブル11Aに基づいて決定(または、生成)する。変化条件ルールType-Bが選択されると、ステップS33Bでは現在の状態値に対する状態遷移後の状態値を状態値テーブル11Bに基づいて決定する。変化条件ルールType-Cが選択されると、ステップS33Cでは現在の状態値に対する状態遷移後の状態値を状態値テーブル11Cに基づいて決定する。セレクタ15で選択された状態値生成回路11の出力は状態値レジスタ12に入力され、セレクタ16で選択された変化条件ルール出力回路13A〜13Cの何れか1つで定めた変化条件ルールが状態値比較回路14に入力される。
In step S31, a random number input from the
ステップS34では、セレクタ15から出力された遷移後の状態値を次の状態値として状態値レジスタ12に書込む。後述するように、状態値レジスタ12に現在の状態値が書き込まれていれば、遷移後の状態値は、次の現在の状態値として状態値レジスタ12に書き込れるが、演算開始入力による初期化処理では、状態値レジスタ12は演算開始入力に基づいて、遷移後の状態値を現在の状態値として格納する。ステップS35では、状態値生成回路11が状態値レジスタ12の出力(即ち、現在の状態値)に対し、セレクタ16から出力される変化条件ルールに従った1-bit値変化を伴う、ステップS2で開始された暗号処理の暗号演算(暗号アルゴリズム)の実行状態を表す状態値を生成する。これにより、状態値生成回路11は、セレクタ16から出力される変化条件ルールに従った状態遷移後の状態値を生成するのに必要なデータを格納する、対応する状態値テーブルを用いて1-bit値変化を伴う状態遷移後の状態値を生成し、次の状態値としてセレクタ15を介して出力する。ステップS36では、状態値比較回路14が状態値レジスタ12の出力(即ち、状態遷移前の現在の状態値)と入力(即ち、状態値生成回路11で生成された、現在の状態値に対する状態遷移後の状態値)を比較することで、状態値レジスタ12の出力と入力との関係が、セレクタ16から出力される変化条件ルールに従った1-bit値変化であるか否かを判定する。ステップS36の判定結果がNOであると、ステップS37では、状態値比較回路14が状態遷移前の現在の状態値から状態遷移後の状態値への状態遷移の異常からフォールト発生を検知してフォールト検知信号を出力する。
In step S34, the state value after the transition output from the
一方、ステップS36の判定結果がYESであると、ステップS38では、状態値レジスタ12に書き込まれた次の状態値を次の現在の状態値として書き込む。ステップS39では、上記の暗号演算を終了するか否かを判定し、判定結果がNOであると所定はステップS34へ戻る。ステップS39の判定結果がYESであると、ステップS4では、1つの変化条件ルールについて、予め設定されている演算回数分の演算が終了したか否かを判定し、判定結果がNOであると処理はステップS31へ戻る。ステップS4の判定結果がYESであると、ステップS5では処理が正常終了する。 On the other hand, if the decision result in the step S36 is YES, in a step S38, the next state value written in the state value register 12 is written as the next current state value. In step S39, it is determined whether or not to end the above-described cryptographic operation. If the determination result is NO, the process returns to step S34. If the decision result in the step S39 is YES, in a step S4, it is determined whether or not the calculation for the preset number of calculations has been completed for one change condition rule, and the process is determined to be NO. Returns to step S31. If the decision result in the step S4 is YES, the process is normally ended in a step S5.
図12は、上記実施例を共通鍵暗号方式へ適用した一例を説明する図である。代表的な共通鍵暗号アルゴリズムは、AES(Advanced Encryption Standard)が、米国連邦標準(FIPS:Federal Information Standards)FIPS 197として公開している(例えば、非特許文献4参照)。 FIG. 12 is a diagram for explaining an example in which the above embodiment is applied to a common key cryptosystem. As a typical common key encryption algorithm, AES (Advanced Encryption Standard) is published as Federal Information Standards (FIPS) FIPS 197 (see, for example, Non-Patent Document 4).
図12は、非特許文献4の第15頁、Figure 5に記されたAES暗号化処理に対して不正操作検知回路30(または、105)を用いた場合の状態値の状態遷移を示す。図12では、13個の状態値を4-bitで表現している。状態値の変化条件ルールは、1-bit値変化であるため、正常な状態遷移である限り、状態値は常に1-bit変化を行う。 FIG. 12 shows the state transition of the state value when the unauthorized operation detection circuit 30 (or 105) is used for the AES encryption process described in FIG. In FIG. 12, 13 state values are expressed in 4-bit. Since the change condition rule of the state value is a 1-bit value change, the state value always changes 1-bit as long as it is a normal state transition.
この例においても、不正操作検知回路30の状態値比較回路14は、状態値の状態遷移前と状態遷移後の値を比較し、セレクタ16で選択された変化条件ルールに従った1-bit値の変化であればフォールト発生が無いと判定し、それ以外の変化であればフォールトが発生したと判定してフォールト信号を出力する。
Also in this example, the state value comparison circuit 14 of the unauthorized
図13は、上記実施例を公開鍵暗号方式へ適用した一例を説明する図である。代表的な公開鍵暗号アルゴリズムとしては、RSA暗号が知られている。RSA暗号は、乗算剰余演算を繰り返すことで処理を行う公開鍵暗号である。RSA暗号は、乗算剰余を効率的に実行するための方法として、整数A,B、法Nに対してREDC(A,B,N)=A×B×R-1 (mod N)を計算するモンゴメリ(Montgomery)乗算剰余という方法が一般的に知られている。ここで、RはNのビット長xに対して、R=2xで与えられる定数である。Montgomery乗算剰余の処理アルゴリズムとしては、様々な方法が知られている(例えば、非特許文献5参照)。 FIG. 13 is a diagram for explaining an example in which the above embodiment is applied to a public key cryptosystem. RSA encryption is known as a typical public key encryption algorithm. The RSA cipher is a public key cipher that performs processing by repeating a modular multiplication operation. The RSA cipher calculates REDC (A, B, N) = A × B × R −1 (mod N) for integers A, B and modulus N as a method for efficiently executing the modular multiplication. The method of Montgomery multiplication remainder is generally known. Here, R is constant with respect to the bit length x of N, is given by R = 2 x. Various methods are known as Montgomery modular multiplication processing algorithms (see, for example, Non-Patent Document 5).
図13は、非特許文献5の第65頁、Algorithm 4に記されたMontgomery乗算剰余に対して不正操作検知回路30(または、105)を用いた場合の状態値の状態遷移を示す。図13では、w-bit単位の変数をg個並べることで、RSA暗号で用いられる1024-bit以上の数値を表現している。wは、一般的にw=16,32,64など、1024より小さな値である。w-bitの部分乗算を繰り返すことで、1024-bit以上の乗算剰余演算を行う。図13では17個の状態値を5-bitで表現している。状態値の変化条件ルールは、1-bit値変化であるため、正常な状態遷移である限り、状態値は常に1-bit変化を行う。
FIG. 13 shows the state transition of the state value when the unauthorized operation detection circuit 30 (or 105) is used for the Montgomery multiplication remainder described in page 65, Algorithm 4 of
この例においても、不正操作検知回路30の状態値比較回路14は、状態値の状態遷移前と状態遷移後の値を比較し、セレクタ16で選択された変化条件ルールに従った1-bit値の変化であればフォールト発生が無いと判定し、それ以外の変化であればフォールトが発生したと判定してフォールト信号を出力する。
Also in this example, the state value comparison circuit 14 of the unauthorized
図12の例は、共通鍵暗号方式の適用例であり、条件分岐のパターンは、for文による1重ループと非常に簡潔な構造である。これに対し、図13の示す公開鍵暗号方式の適用例においては条件分岐のパターンがより複雑となり、for文による2重ループと、if文による条件分岐とが組み合わさっている。条件分岐のパターンが複雑化することで、状態値の状態遷移パターンの構築はより困難となる。 The example of FIG. 12 is an application example of the common key cryptosystem, and the conditional branch pattern has a very simple structure such as a single loop by a for statement. On the other hand, in the application example of the public key cryptosystem shown in FIG. 13, the pattern of conditional branching is more complicated, and a double loop by a for sentence and a conditional branch by an if sentence are combined. Complicated conditional branch patterns make it more difficult to construct state transition patterns of state values.
この状態遷移パターンの困難さを解決するためには、補助的な手段が必要となるが、図13の例ではその1つであるNOP(No OPeration)状態の挿入を条件分岐((11001)2-(10001)2の状態値)において用いている。NOPとは、何も処理を行わない状態を指す。NOPは何も処理を行わないため、冗長な処理であるが、状態値の状態遷移条件の制約下において、遷移パターンを構築するために用いることができる補助的な手段である。 In order to solve the difficulty of this state transition pattern, an auxiliary means is required. In the example of FIG. 13, the insertion of a NOP (No OPeration) state, which is one of them, is conditional branch ((11001) 2 -(10001) 2 state value). NOP refers to a state in which no processing is performed. NOP is a redundant process because it does not perform any process, but it is an auxiliary means that can be used to construct a transition pattern under the restrictions of the state transition condition of the state value.
図14は、状態値の状態遷移条件が1-bit値変化である場合において、このNOP挿入が必要な例を説明する図である。状態値の変化条件ルールが1-bit値変化の場合は、状態値A,B,Cを用いて以下の処理を行う場合、状態値BとCとの間にNOPを挿入する必要がある。 FIG. 14 is a diagram illustrating an example in which this NOP insertion is necessary when the state transition condition of the state value is a 1-bit value change. When the state value change condition rule is a 1-bit value change, it is necessary to insert a NOP between the state values B and C when the following processing is performed using the state values A, B, and C.
A if (cond) then {
B 処理1}
C 処理2
変化条件ルールを1-bit値変化とした場合には、状態値A→B→Cの状態遷移を行うことを考える。状態値Aに含まれる「1」の個数をkで表すと、変化条件ルールの制約により、状態値Bでは「1」の個数が1つ増えるか、減るかのいずれであるので、k-1あるいはk+1となる。同様に、状態値Bから状態値Cに遷移する場合は、「1」の個数はk-2、k、あるいはk+2となる。
A if (cond) then {
B treatment 1}
When the change condition rule is a 1-bit value change, it is considered to perform a state transition of state values A → B → C. If the number of “1” included in the state value A is represented by k, the number of “1” is either increased or decreased by 1 in the state value B due to the restriction of the change condition rule. Or it becomes k + 1. Similarly, when the state value B transits to the state value C, the number of “1” is k−2, k, or k + 2.
以上により、変化条件ルールを1-bit値変化とした場合には、状態値A→B→Cの状態遷移を実現することができる。しかし、図14(a)に示すように、A→Cの状態遷移を行う場合は、「1」の個数がk個からk-2, k, k+2となる。つまり、A→Cの状態遷移を行う場合はkの値に関係なく、状態値が2-bit値変化するか、0-bit値変化するかのいずれかでしかなく、1-bit値変化を実現できない。
As described above, when the change condition rule is a 1-bit value change, it is possible to realize a state transition of state values A → B → C. However, as shown in FIG. 14A, when the state transition of A → C is performed, the number of “1” is changed from k to k−2, k,
そこで、例えばA→Cの状態遷移を行う場合でも1-bit値変化を実現するために、変化条件ルールを1-bit値変化とした場合には、図14(b)に示すように状態値BとCとの間にNOPを挿入した以下の処理を行う。 Therefore, for example, when a change condition rule is set to 1-bit value change in order to realize a 1-bit value change even when A → C state transition is performed, the state value as shown in FIG. The following processing in which NOP is inserted between B and C is performed.
A if (cond) then {
B 処理1
C NOP }
D 処理2
状態値BとDとの間にNOPを挿入したことで、変化条件ルールを1-bit値変化とした場合には、状態値A→B→C→Dの状態遷移において、状態値CからDに遷移したときの「1」の個数を、k-1あるいはk+1とすることができる。このとき、状態値A→Dの状態遷移は1-bit値変化となる。つまり、状態値A→B→C→Dの状態遷移と、状態値A→Dの状態遷移とは、両方とも1-bit値変化という制約において実現することができる。
A if (cond) then {
C NOP}
When the change condition rule is 1-bit value change by inserting NOP between the state values B and D , the state value C to D in the state transition of the state value A → B → C → D The number of “1” when transitioning to can be set to k−1 or k + 1. At this time, the state transition of the state value A → D is a 1-bit value change. That is, the state transition of the state value A → B → C → D and the state transition of the state value A → D can both be realized under the constraint of a 1-bit value change.
このように、NOPの挿入を含めた、状態値の状態遷移パターンの構築に利用できる補助的な手段を以下に説明する。なお、図14は条件分岐に関する例を示すが、ループ分岐に対しても応用可能である。 As described above, auxiliary means that can be used to construct a state transition pattern of state values including insertion of NOP will be described below. Although FIG. 14 shows an example related to conditional branching, it can also be applied to loop branching.
例えば、状態値のビット長を拡大することで、状態値の選択の自由度が広がり、状態値の状態遷移パターンの構築が容易となる。例えば15個の状態値が与えられている場合、それを表現するための最小のビット長は4-bitであるが、この4-bitより大きなビット長で15個の状態値を表現することで、状態値の状態遷移パターンの構築が容易となる。 For example, by expanding the bit length of the state value, the degree of freedom in selecting the state value is widened, and the state transition pattern of the state value can be easily constructed. For example, when 15 state values are given, the minimum bit length for expressing it is 4-bit. By expressing 15 state values with a bit length larger than 4-bit, It is easy to construct a state transition pattern of state values.
また、1重ループ、2重ループ、条件分岐など、基本的なフロー制御の種類に応じて状態値の構築のためのテンプレートを事前計算しておき、そのテンプレートを利用して状態値の構築を行うようにしても良い。この場合、ループ中の状態数、条件分岐の状態数に応じて多様なテンプレートを作成することで、様々な処理に対応できる。 Also, pre-calculate templates for constructing state values according to basic flow control types such as single loop, double loop, conditional branch, etc., and use these templates to construct state values. You may make it do. In this case, it is possible to cope with various processes by creating various templates according to the number of states in the loop and the number of states in the conditional branch.
以上の実施例を含む実施形態に関し、さらに以下の付記を開示する。
(付記1)
互いに異なる複数の、状態値の変化条件ルールを出力する変化条件ルール出力回路と、
前記複数の変化条件ルールに従って現在の状態値に対する状態遷移後の状態値を生成する状態値生成回路と、
前記複数の変化条件ルールに従って前記状態値生成回路で生成された状態遷移後の状態値のうち、任意の1つの変化条件ルールに従って生成された状態遷移後の状態値と、前記変化条件ルール出力回路から出力された前記複数の変化条件ルールのうち、前記任意の1つの変化条件ルールを、乱数に基づいて選択出力する選択部と、
演算開始入力に基づいて前記現在の状態値を格納すると共に、前記選択部から選択出力される前記状態遷移後の状態値を格納する状態値格納部と、
前記状態値格納部の入出力に基づき前記状態遷移後の状態値と前記現在の状態値を比較し、状態遷移が前記選択部から選択出力される前記任意の1つの変化条件ルールに従っていないと不正操作を検知して検知信号を出力する状態値比較回路
を備え、
前記複数の変化条件ルールは、同一固定ビット数の値変化を用いるルールである
ことを特徴とする不正操作検知回路。
(付記2)
前記複数の変化条件ルールは、いずれも1ビット値変化を用いるルールであることを特徴とする付記1記載の不正操作検知回路。
(付記3)
前記状態値生成回路は、前記現在の状態値に対する前記複数の変化条件ルールに従った状態遷移後の状態値を生成するのに必要なデータを格納する複数の状態値テーブルを有し、
前記選択部は、前記複数の状態値テーブルを用いて生成された前記現在の状態値に対する状態遷移後の複数の状態値の1つを前記乱数入力に基づいて選択出力して前記状態値格納部及び前記状態値比較回路に入力するセレクタを有する
ことを特徴とする付記1または2記載の不正操作検知回路。
(付記4)
外部装置と通信して演算開始入力を受信する通信回路と、
プロセッサと、
不正操作検知回路
を備え、
前記不正操作検知回路は、
互いに異なる複数の、状態値の変化条件ルールを出力する変化条件ルール出力回路と、
前記複数の変化条件ルールに従って現在の状態値に対する状態遷移後の状態値を生成する状態値生成回路と、
前記複数の変化条件ルールに従って前記状態値生成回路で生成された状態遷移後の状態値のうち、任意の1つの変化条件ルールに従って生成された状態遷移後の状態値と、前記変化条件ルール出力回路から出力された前記複数の変化条件ルールのうち、前記任意の1つの変化条件ルールを、乱数に基づいて選択出力する選択部と、
前記演算開始入力に基づいて前記現在の状態値を格納すると共に、前記選択部から選択出力される前記状態遷移後の状態値を格納する状態値格納部と、
前記状態値格納部の入出力に基づき前記状態遷移後の状態値と前記現在の状態値を比較し、状態遷移が前記選択部から選択出力される前記任意の1つの変化条件ルールに従っていないと不正操作を検知して検知信号を前記プロセッサに出力する状態値比較回路
を備え、
前記複数の変化条件ルールは、同一固定ビット数の値変化を用いるルールである
ことを特徴とする装置。
(付記5)
前記複数の変化条件ルールは、いずれも1ビット値変化を用いるルールであることを特徴とする付記4記載の装置。
(付記6)
前記状態値生成回路は、前記現在の状態値に対する前記複数の変化条件ルールに従った状態遷移後の状態値を生成するのに必要なデータを格納する複数の状態値テーブルを有し、
前記選択部は、前記複数の状態値テーブルを用いて生成された前記現在の状態値に対する状態遷移後の複数の状態値の1つを前記乱数の入力に基づいて選択出力して前記状態値格納部及び前記状態値比較回路に入力するセレクタを有する
ことを特徴とする付記4または5記載の装置。
(付記7)
アンテナを含む外部インターフェース回路を更に備え、
前記通信回路は、前記外部インターフェース回路を介して前記外部装置と無線の通信方式で通信し、
スマートカードを形成することを特徴とする付記4乃至6のいずれか1項記載の装置。
(付記8)
前記乱数は、前記装置内で発生されることを特徴とする付記4乃至7のいずれか1項記載の装置。
(付記9)
前記乱数は、前記不正操作検知回路内で発生されることを特徴とする付記8記載の装置。
(付記10)
前記乱数は、前記プロセッサで発生されることを特徴とする付記8記載の装置。
(付記11)
前記乱数は、前記不正操作検知回路外で発生されることを特徴とする付記8記載の装置。
(付記12)
複数の変化条件ルールに従って状態値生成回路で現在の状態値に対する状態遷移後の状態値を生成し、任意の1つの変化条件ルールに従って生成された状態遷移後の状態値と、前記任意の1つの変化条件ルールを、乱数に基づいて選択部から選択出力するステップと、
演算開始入力に基づいて状態値格納部に前記現在の状態値を格納すると共に、前記選択部から選択出力される前記状態遷移後の状態値を格納するステップと、
前記状態値格納部の入出力に基づき前記状態遷移後の状態値と前記現在の状態値を状態値比較回路で比較し、状態遷移が前記任意の1つの変化条件ルールに従っていないと不正操作を検知して検知信号を出力するステップ
を不正操作検知回路で実行し、
前記複数の変化条件ルールは互いに異なり、且つ、同一固定ビット数の値変化を用いるルールである
ことを特徴とする不正操作検知方法。
(付記13)
前記複数の変化条件ルールは、いずれも1ビット値変化を用いるルールであることを特徴とする、付記12記載の不正操作検知方法。
(付記14)
前記状態値生成回路において、前記複数の変化条件ルールに従った状態遷移後の状態値を生成するのに必要なデータを格納する複数の状態値テーブルを用いて前記現在の状態値に対する状態遷移後の状態値を生成することを特徴とする付記12または13記載の不正操作検知方法。
(付記15)
前記演算開始入力を前記不正操作検知回路を有するスマートカードの通信回路から読込むステップと、
前記乱数を前記スマートカードのプロセッサから読込むステップ
を前記不正操作検知回路で更に実行することを特徴とする付記12乃至14のいずれか1項記載の不正操作検知方法。
The following supplementary notes are further disclosed with respect to the embodiments including the above examples.
(Appendix 1)
A plurality of change condition rule output circuits for outputting a plurality of different condition value change condition rules,
A state value generation circuit for generating a state value after state transition with respect to a current state value according to the plurality of change condition rules;
Of the state values after the state transition generated by the state value generation circuit according to the plurality of change condition rules, the state value after the state transition generated according to any one change condition rule, and the change condition rule output circuit A selection unit that selects and outputs the arbitrary one change condition rule among the plurality of change condition rules output from a random number;
A state value storage unit that stores the current state value based on a calculation start input and stores the state value after the state transition that is selected and output from the selection unit;
The state value after the state transition is compared with the current state value based on the input / output of the state value storage unit, and it is illegal if the state transition does not comply with the arbitrary change condition rule selected and output from the selection unit A state value comparison circuit that detects an operation and outputs a detection signal is provided.
The unauthorized operation detection circuit, wherein the plurality of change condition rules are rules using value changes of the same fixed number of bits.
(Appendix 2)
The unauthorized operation detection circuit according to
(Appendix 3)
The state value generation circuit has a plurality of state value tables storing data necessary to generate a state value after state transition according to the plurality of change condition rules for the current state value,
The selection unit selects and outputs one of a plurality of state values after the state transition with respect to the current state value generated using the plurality of state value tables based on the random number input, and the state value storage unit And the tampering detection circuit according to
(Appendix 4)
A communication circuit that communicates with an external device and receives an operation start input;
A processor;
Equipped with an unauthorized operation detection circuit,
The unauthorized operation detection circuit is
A plurality of change condition rule output circuits for outputting a plurality of different condition value change condition rules,
A state value generation circuit for generating a state value after state transition with respect to a current state value according to the plurality of change condition rules;
Of the state values after the state transition generated by the state value generation circuit according to the plurality of change condition rules, the state value after the state transition generated according to any one change condition rule, and the change condition rule output circuit A selection unit that selects and outputs the arbitrary one change condition rule among the plurality of change condition rules output from a random number;
A state value storage unit that stores the current state value based on the calculation start input and stores the state value after the state transition that is selected and output from the selection unit;
The state value after the state transition is compared with the current state value based on the input / output of the state value storage unit, and it is illegal if the state transition does not comply with the arbitrary change condition rule selected and output from the selection unit A state value comparison circuit that detects an operation and outputs a detection signal to the processor;
The plurality of change condition rules are rules using value changes of the same fixed bit number.
(Appendix 5)
The apparatus according to claim 4, wherein each of the plurality of change condition rules is a rule using a 1-bit value change.
(Appendix 6)
The state value generation circuit has a plurality of state value tables storing data necessary to generate a state value after state transition according to the plurality of change condition rules for the current state value,
The selection unit selects and outputs one of a plurality of state values after state transition with respect to the current state value generated using the plurality of state value tables based on the random number input, and stores the state value And the selector for inputting to the state value comparison circuit.
(Appendix 7)
An external interface circuit including an antenna;
The communication circuit communicates with the external device through the external interface circuit by a wireless communication method,
The apparatus according to any one of appendices 4 to 6, wherein the apparatus forms a smart card.
(Appendix 8)
The apparatus according to any one of appendices 4 to 7, wherein the random number is generated in the apparatus.
(Appendix 9)
The apparatus according to claim 8, wherein the random number is generated in the unauthorized operation detection circuit.
(Appendix 10)
The apparatus according to claim 8, wherein the random number is generated by the processor.
(Appendix 11)
The apparatus according to claim 8, wherein the random number is generated outside the unauthorized operation detection circuit.
(Appendix 12)
The state value generation circuit generates a state value after the state transition with respect to the current state value according to the plurality of change condition rules, the state value after the state transition generated according to any one change condition rule, and the arbitrary one Selecting and outputting the change condition rule from the selection unit based on a random number;
Storing the current state value in the state value storage unit based on the calculation start input, and storing the state value after the state transition selected and output from the selection unit;
Based on the input / output of the state value storage unit, the state value after the state transition and the current state value are compared by a state value comparison circuit, and an unauthorized operation is detected if the state transition does not comply with the one change condition rule And executing the step of outputting the detection signal in the unauthorized operation detection circuit,
The method for detecting an unauthorized operation, wherein the plurality of change condition rules are rules different from each other and use a value change of the same fixed number of bits.
(Appendix 13)
The unauthorized operation detection method according to
(Appendix 14)
In the state value generation circuit, after the state transition with respect to the current state value using a plurality of state value tables storing data necessary for generating a state value after the state transition according to the plurality of change condition rules 14. The unauthorized operation detection method according to
(Appendix 15)
Reading the calculation start input from a communication circuit of a smart card having the unauthorized operation detection circuit;
The unauthorized operation detection method according to any one of
以上、開示の不正操作検知回路、不正操作検知回路を備えた装置、及び不正操作検知方法を実施例により説明したが、本発明は上記実施例に限定されるものではなく、本発明の範囲内で種々の変形及び改良が可能であることは言うまでもない。 As described above, the disclosed unauthorized operation detection circuit, the device including the unauthorized operation detection circuit, and the unauthorized operation detection method have been described by the embodiments. However, the present invention is not limited to the above embodiments, and is within the scope of the present invention. Needless to say, various modifications and improvements are possible.
11 状態値生成回路
11A〜11C 状態値テーブル
12 状態値レジスタ
13A〜13C 変化条件ルール出力回路
14 状態値比較回路
15,16 セレクタ
100 スマートカード
101 CPU
102 ROM
103 通信回路
104 外部インターフェース回路
105 不正操作検知回路
106 RAM
107 クロック生成回路
108 電源回路
109 バス
11 state
102 ROM
103 Communication Circuit 104 External Interface Circuit 105 Unauthorized
107
Claims (5)
前記複数の変化条件ルールに従って現在の状態値に対する状態遷移後の状態値を生成する状態値生成回路と、
前記複数の変化条件ルールに従って前記状態値生成回路で生成された状態遷移後の状態値のうち、1つの変化条件ルールに従って生成された状態遷移後の状態値と、前記変化条件ルール出力回路から出力された前記複数の変化条件ルールのうち、前記1つの変化条件ルールとを、乱数に基づいて選択出力する選択部と、
演算開始入力に基づいて入力される前記現在の状態値を格納すると共に、前記選択部から選択出力される前記状態遷移後の状態値を次に入力されて格納する状態値格納部と、
前記状態値格納部から出力される前記現在の状態値と前記状態値格納部に前記次に入力される前記状態遷移後の状態値とを比較し、状態遷移が前記選択部から選択出力される前記1つの変化条件ルールに従っていないと不正操作を検知して検知信号を出力する状態値比較回路
を備え、
前記複数の変化条件ルールは、同一固定ビット数の値変化を用いるルールである
ことを特徴とする不正操作検知回路。 A plurality of change condition rule output circuits for outputting a plurality of different condition value change condition rules,
A state value generation circuit for generating a state value after state transition with respect to a current state value according to the plurality of change condition rules;
Of the state values after the state transition generated by the state value generation circuit according to the plurality of change condition rules, the state value after the state transition generated according to one change condition rule, and the change condition rule output circuit of the outputted plurality of change condition rule, and the one change condition rules, a selection unit for selectively outputting, based on a random number,
Stores the current state values input based on the operation start input, the state value storing unit for storing a state value after the state transition selected output from the selecting unit then is inputted,
The current state value output from the state value storage unit is compared with the state value after the state transition input next to the state value storage unit, and the state transition is selected and output from the selection unit. A state value comparison circuit for detecting an unauthorized operation and outputting a detection signal if not complying with the one change condition rule;
The unauthorized operation detection circuit, wherein the plurality of change condition rules are rules using value changes of the same fixed number of bits.
前記選択部は、前記複数の状態値テーブルを用いて生成された前記現在の状態値に対する状態遷移後の複数の状態値の1つを前記乱数に基づいて選択出力して前記状態値格納部及び前記状態値比較回路に入力するセレクタを有する
ことを特徴とする請求項1または2記載の不正操作検知回路。 The state value generation circuit has a plurality of state value tables storing data necessary to generate a state value after state transition according to the plurality of change condition rules for the current state value,
The selection unit selectively outputs one of a plurality of state values after the state transition with respect to the current state value generated using the plurality of state value tables based on the random number , and the state value storage unit and The unauthorized operation detection circuit according to claim 1, further comprising a selector that inputs to the state value comparison circuit.
プロセッサと、
不正操作検知回路
を備え、
前記不正操作検知回路は、
互いに異なる複数の、状態値の変化条件ルールを出力する変化条件ルール出力回路と、
前記複数の変化条件ルールに従って現在の状態値に対する状態遷移後の状態値を生成する状態値生成回路と、
前記複数の変化条件ルールに従って前記状態値生成回路で生成された状態遷移後の状態値のうち、1つの変化条件ルールに従って生成された状態遷移後の状態値と、前記変化条件ルール出力回路から出力された前記複数の変化条件ルールのうち、前記1つの変化条件ルールとを、乱数に基づいて選択出力する選択部と、
前記演算開始入力に基づいて入力される前記現在の状態値を格納すると共に、前記選択部から選択出力される前記状態遷移後の状態値を次に入力されて格納する状態値格納部と、
前記状態値格納部から出力される前記現在の状態値と前記状態値格納部に前記次に入力される前記状態遷移後の状態値とを比較し、状態遷移が前記選択部から選択出力される前記1つの変化条件ルールに従っていないと不正操作を検知して検知信号を前記プロセッサに出力する状態値比較回路
を備え、
前記複数の変化条件ルールは、同一固定ビット数の値変化を用いるルールである
ことを特徴とする装置。 A communication circuit that communicates with an external device and receives an operation start input;
A processor;
Equipped with an unauthorized operation detection circuit,
The unauthorized operation detection circuit is
A plurality of change condition rule output circuits for outputting a plurality of different condition value change condition rules,
A state value generation circuit for generating a state value after state transition with respect to a current state value according to the plurality of change condition rules;
Of the state values after the state transition generated by the state value generation circuit according to the plurality of change condition rules, the state value after the state transition generated according to one change condition rule, and the change condition rule output circuit of the outputted plurality of change condition rule, and the one change condition rules, a selection unit for selectively outputting, based on a random number,
Stores the current state values input based on the operation start input, the state value storing unit for storing are then enter the state value after the state transition selected output from the selecting unit,
The current state value output from the state value storage unit is compared with the state value after the state transition input next to the state value storage unit, and the state transition is selected and output from the selection unit. A state value comparison circuit that detects an unauthorized operation and does not comply with the one change condition rule and outputs a detection signal to the processor;
The plurality of change condition rules are rules using value changes of the same fixed bit number.
演算開始入力に基づいて状態値格納部に入力される前記現在の状態値を格納すると共に、前記選択部から選択出力される前記状態遷移後の状態値を次に入力されて格納するステップと、
前記状態値格納部から出力される前記現在の状態値と前記状態値格納部に前記次に入力される前記状態遷移後の状態値とを状態値比較回路で比較し、状態遷移が前記1つの変化条件ルールに従っていないと不正操作を検知して検知信号を出力するステップ
を不正操作検知回路で実行し、
前記複数の変化条件ルールは互いに異なり、且つ、同一固定ビット数の値変化を用いるルールである
ことを特徴とする不正操作検知方法。 The state value generation circuit generates a state value after the state transition for the current state value according to a plurality of change condition rules, the state value after the state transition generated according to one change condition rule, and the one change condition the rules, and selecting the output from the selecting unit based on a random number,
Stores the current state value inputted to the state value storage unit based on the calculated start input, and storing the state value after the state transition selected output from the selecting unit then is inputted,
Compares the status value after the state transition is input to the next to the state value storage unit and the current state value output from said state value storage unit in a state value comparison circuit, a state transition is said one If the change condition rule is not followed, the unauthorized operation detection circuit executes a step of detecting the unauthorized operation and outputting a detection signal,
The method for detecting an unauthorized operation, wherein the plurality of change condition rules are rules different from each other and use a value change of the same fixed number of bits.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012072271A JP6228354B2 (en) | 2012-03-27 | 2012-03-27 | Unauthorized operation detection circuit, device provided with unauthorized operation detection circuit, and unauthorized operation detection method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012072271A JP6228354B2 (en) | 2012-03-27 | 2012-03-27 | Unauthorized operation detection circuit, device provided with unauthorized operation detection circuit, and unauthorized operation detection method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2013207414A JP2013207414A (en) | 2013-10-07 |
JP6228354B2 true JP6228354B2 (en) | 2017-11-08 |
Family
ID=49526130
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012072271A Active JP6228354B2 (en) | 2012-03-27 | 2012-03-27 | Unauthorized operation detection circuit, device provided with unauthorized operation detection circuit, and unauthorized operation detection method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6228354B2 (en) |
-
2012
- 2012-03-27 JP JP2012072271A patent/JP6228354B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2013207414A (en) | 2013-10-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4671571B2 (en) | Secret information processing device and memory for storing secret information processing program | |
EP3208789B1 (en) | Method of protecting a circuit against a side-channel analysis | |
JP7123959B2 (en) | Elliptic curve point multiplication device and method | |
KR20120127607A (en) | Device and method for obtaining a cryptographic key | |
JP5261088B2 (en) | Unauthorized operation detection circuit, device provided with unauthorized operation detection circuit, and unauthorized operation detection method | |
JP2008252299A (en) | Encryption processing system and encryption processing method | |
EP2332040B1 (en) | Countermeasure securing exponentiation based cryptography | |
EP2211265B1 (en) | Elliptic curve arithmetic processing unit and elliptic curve arithmetic processing program and method | |
US20130279692A1 (en) | Protecting modular exponentiation in cryptographic operations | |
JP5365624B2 (en) | Embedded device apparatus incorporating a decoding device, a program, and a recovery device having a countermeasure function against a power analysis attack | |
JP5407352B2 (en) | Decoding processing device, decoding processing program, and decoding processing method | |
KR20100113130A (en) | Countermeasure method and devices for asymmetric cryptography | |
JP2004304800A (en) | Protection of side channel for prevention of attack in data processing device | |
US20110170685A1 (en) | Countermeasure method and devices for asymmetric encryption with signature scheme | |
EP1443699A1 (en) | Information processing means and IC card | |
JP4386766B2 (en) | Error detection in data processing equipment. | |
Blömer et al. | Wagner’s Attack on a secure CRT-RSA Algorithm Reconsidered | |
JP6228354B2 (en) | Unauthorized operation detection circuit, device provided with unauthorized operation detection circuit, and unauthorized operation detection method | |
KR100876442B1 (en) | A secure method for calculating a polynomial convolution operation for an ntru cryptosystem | |
KR100953715B1 (en) | Digital signature method, Digital signature apparatus using CRT-RSA modula exponentiation algorithm and Recording medium using by the same | |
KR20170113268A (en) | Non-modular multiplier, method for non-modular multiplication and computational device | |
KR100953716B1 (en) | Method and Apparatus of digital signature using bit arithmetic based on CRT-RSA and Recording medium using by the same | |
JP2007272048A (en) | Encryption key creating device | |
KR100875461B1 (en) | A method and a computer readable media resistant to power analysis attacks for calculating an ntru polynomial convolution operation | |
KR20240040437A (en) | Method of calculating cipher, and electronic device perporming the methods |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20141127 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20150626 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20150707 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20150904 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20160308 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20160603 |
|
A911 | Transfer to examiner for re-examination before appeal (zenchi) |
Free format text: JAPANESE INTERMEDIATE CODE: A911 Effective date: 20160617 |
|
A912 | Re-examination (zenchi) completed and case transferred to appeal board |
Free format text: JAPANESE INTERMEDIATE CODE: A912 Effective date: 20160708 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20170810 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20171013 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6228354 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313111 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |