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 PDF

Info

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
Application number
JP2012072271A
Other languages
Japanese (ja)
Other versions
JP2013207414A (en
Inventor
昭雄 塩田
昭雄 塩田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Advanced Engineering Ltd
Original Assignee
Fujitsu Advanced Engineering Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Fujitsu Advanced Engineering Ltd filed Critical Fujitsu Advanced Engineering Ltd
Priority to JP2012072271A priority Critical patent/JP6228354B2/en
Publication of JP2013207414A publication Critical patent/JP2013207414A/en
Application granted granted Critical
Publication of JP6228354B2 publication Critical patent/JP6228354B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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.

特表2005−509936号公報JP 2005-509936 A 特表2009−500710号公報Special table 2009-500710 gazette 特開2010−68135号公報JP 2010-68135 A

Alfred J.Menezes et al., "HANDBOOK OF APPLIED CRYPTOGRAPHY"(CRC press), p.615, Algorithm 14.79 (http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf)Alfred J. Menezes et al., "HANDBOOK OF APPLIED CRYPTOGRAPHY" (CRC press), p.615, Algorithm 14.79 (http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf) D. Boneh, R. A. DeMillo, R. J. Lipton, "On the Importance of Checking Cryptographic Protocols for Faults", Eurocrypt '97, pp.37-51, 1997D. Boneh, R. A. DeMillo, R. J. Lipton, "On the Importance of Checking Cryptographic Protocols for Faults", Eurocrypt '97, pp. 37-51, 1997 Benoit Feix and Louis Marcel, "Passive and Active Combined Attacks", 2007 Workshop on Fault Diagnosis and Tolerance in Cryptography, FDTC 2007Benoit Feix and Louis Marcel, "Passive and Active Combined Attacks", 2007 Workshop on Fault Diagnosis and Tolerance in Cryptography, FDTC 2007 http://csrc.nist.gov/publications/fips/fips197/fips-197.pdfhttp://csrc.nist.gov/publications/fips/fips197/fips-197.pdf Kouichi Itoh, Masahiko Takenaka, Naoya Torii, Syouji Temma, and Yasushi Kurihara,"Fast Implementation of Public-Key Cryptography on a DSP TMS320C6201", CHES '99, LNCS 1717, pp.61-72Kouichi Itoh, Masahiko Takenaka, Naoya Torii, Syouji Temma, and Yasushi Kurihara, "Fast Implementation of Public-Key Cryptography on a DSP TMS320C6201", CHES '99, LNCS 1717, pp.61-72

従来の暗号回路を備えた装置では、理論攻撃に対しては安全性を保てても、実装攻撃に対しては脆弱である場合がある。   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.

バイナリ法を用いた指数剰余演算のアルゴリズムを説明する図である。It is a figure explaining the algorithm of the exponent remainder calculation using the binary method. バイナリ法の処理を説明する図である。It is a figure explaining the process of a binary method. フォールト攻撃を説明する図である。It is a figure explaining a fault attack. バイナリ法を用いるRSA暗号をベースとした電力解析への耐タンパ性を有するRSA暗号アルゴリズムを説明する図である。It is a figure explaining the RSA encryption algorithm which has tamper resistance to the power analysis based on RSA encryption using a binary method. 図4のRSA暗号アルゴリズムを実装した装置におけるd=(10100...)2の場合の消費電力波形を示す図である。FIG. 5 is a diagram showing a power consumption waveform when d = (10100...) 2 in the apparatus in which the RSA encryption algorithm of FIG. 4 is implemented. フォールト攻撃による電力解析の対策機能を無効化する方法を説明する図である。It is a figure explaining the method of invalidating the countermeasure function of the power analysis by a fault attack. 図6の状態値(0001)2をスキップしたRSA暗号アルゴリズムを実装した装置におけるd=(10100...)2の場合の消費電力波形を示す図である。Is a diagram showing a power waveform when the d = (10100 ...) 2 in the state value (0001) 2 device that implements the RSA encryption algorithm skips in FIG. 本発明の一実施例における不正操作検知回路の一例を示すブロック図である。It is a block diagram which shows an example of the unauthorized operation detection circuit in one Example of this invention. 図8の不正操作検知回路においてサイドチャネルとして見える消費電力の動的変化の一例を示す図である。It is a figure which shows an example of the dynamic change of the power consumption seen as a side channel in the unauthorized operation detection circuit of FIG. 実施例における実装攻撃対策ハードウェアを搭載したスマートカードの一例の構成を示すブロック図である。It is a block diagram which shows the structure of an example of the smart card carrying the mounting attack countermeasure hardware in an Example. 実施例における不正操作検知方法の一例を説明するフローチャートである。It is a flowchart explaining an example of the unauthorized operation detection method in an Example. 実施例を共通鍵暗号方式へ適用した一例を説明する図である。It is a figure explaining an example which applied the Example to the common key encryption system. 実施例を公開鍵暗号方式へ適用した一例を説明する図である。It is a figure explaining an example which applied the Example to the public key encryption system. NOP挿入が必要な例を説明する図である。It is a figure explaining the example which needs NOP insertion.

開示の不正操作検知回路、不正操作検知回路を備えた装置、及び不正操作検知方法では、状態値の変化条件ルールを変化条件ルール出力回路から出力し、複数の変化条件ルールに従って現在の状態値に対する状態遷移後の状態値を状態値生成回路で生成し、選択部から、複数の変化条件ルールに従って状態値生成回路で生成された状態遷移後の状態値のうち、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 Non-Patent Document 2, for example. For convenience of explanation, an outline of a fault attack against the RSA cipher will be described.

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-bit value 1 shown on the left side of FIG. 4 is a value representing an execution state of the RSA encryption algorithm, and is hereinafter referred to as a “state value”. In the RSA encryption algorithm of FIG. 4, (0000) 2 , (0001) 2 ,..., (1001) 2 are state values. The state value is used not only for the RSA encryption process of FIG. 4 but also for managing the execution state of the operation in the apparatus that executes the encryption process.

図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 operation detection circuit 30 shown in FIG. 8 includes a state value generation circuit 11 having state value tables 11A to 11C, a state value register 12, change condition rule output circuits 13A to 13C, a state value comparison circuit 14, a selector 15, and a selector. 16 The unauthorized operation detection circuit 30 is an example of a state machine having a fault detection circuit function.

状態値レジスタ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 value generation circuit 11 determines the state value after the state transition based on the current state value stored in the state value register 12, that is, the output of the state value register 12, using the state value tables 11A to 11C. To do. The change condition rule output circuits 13A to 13C define state value change condition rules Type-A to Type-C during normal processing when there is no fault attack. The change condition rules Type-A, Type-B, and Type-C are different rules. The state value comparison circuit 14 determines whether or not the state value state transition is normal, and outputs a fault detection signal when a fault attack is detected from the state value state transition abnormality. The selector 15 selects and outputs one of the three state values after the state transition with respect to the current state value generated using the state value tables 11A to 11C of the state value generating circuit 11 based on a random number input from the outside. And input to the state value register 12 and the state value comparison circuit 14. The state value tables 11A to 11C include data necessary for generating state values after state transitions according to the change condition rules Type-A to Type-C for the current state values (that is, the change condition rule Type-A ~ Type-C data). The selector 16 selects and outputs one of the change condition rule output circuits 13 </ b> A to 13 </ b> C based on a random number input from the outside and inputs the selected output to the state value comparison circuit 14. Needless to say, the random number may be generated in the unauthorized operation detection circuit 30.

セレクタ15及びセレクタ16は、乱数入力に基づいて連動している選択部を形成する。選択部は、変化条件ルールType-Aに従った状態値テーブル11Aを用いて生成された状態遷移後の状態値の出力が選択されるとき変化条件ルール出力回路13Aの変化条件ルールType-Aの出力が選択され、変化条件ルールType-Bに従った状態値テーブル11Bを用いて生成された状態遷移後の状態値の出力が選択されるとき変化条件ルール出力回路13Bの変化条件ルールType-Bの出力が選択され、変化条件ルールType-Cに従った状態値テーブル11Cを用いて生成された状態遷移後の状態値の出力が選択されるとき変化条件ルール出力回路13Cの変化条件ルールType-Cの出力が選択されるように動作する。   The selector 15 and the selector 16 form a selection unit that is linked based on random number input. When the output of the state value after the state transition generated using the state value table 11A according to the change condition rule Type-A is selected, the selection unit selects the change condition rule Type-A of the change condition rule output circuit 13A. When the output is selected and the output of the state value after the state transition generated using the state value table 11B according to the change condition rule Type-B is selected, the change condition rule Type-B of the change condition rule output circuit 13B When the output of the state value after the state transition generated using the state value table 11C according to the change condition rule Type-C is selected, the change condition rule Type- of the change condition rule output circuit 13C is selected. Operates so that the C output is selected.

状態値比較回路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 state value register 12 and the input (that is, the state value after the state transition with respect to the current state value generated by the state value generation circuit 11). Thus, the presence / absence of a fault is detected based on the change condition rule output from the selector 16 (the same as the change condition rule used in the state value generation circuit 11). Specifically, the state value comparator circuit 14, the relationship between the input and the output of the state value register 12, based on whether 1-bit change der Luke not in accordance with the change condition rule that is outputted from the selector 16 Detects the occurrence of faults.

状態値比較回路14は、状態値レジスタ12の力と力との関係が、セレクタ16を介して与えられる変化条件ルールに従っている場合、フォールト発生の無い正常な処理であると判断する。一方、状態値レジスタ12の力と力との関係が、セレクタ16を介して与えられる変化条件ルールに従っていない場合、状態値比較回路14はフォールトの発生した異常な処理であると判断してフォールト検知信号を出力する。 State value comparator circuit 14, the relationship between the output and input of the state value register 12, if it follows the change condition rule applied via selector 16, it determines that the normal processing without fault occurs. On the other hand, the relationship between the output and input of the state value register 12, if not in accordance with the change condition rules applied through selector 16, it is determined that the state value comparator circuit 14 is generated abnormal processing of fault Outputs a fault detection signal.

なお、セレクタ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 value generation circuit 11 by the selector 15 and the change condition rule output circuits 13A to 13C of the selector 16 are performed. The process for selecting any one of the outputs is determined by an initialization process based on the first calculation start input in which the unauthorized operation detection circuit 30 operates.

図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 operation detection circuit 30, the state value table 11A determines the state value after the transition based on the change condition rule Type-A, and the state value table 11B determines the state after the transition based on the change condition rule Type-B. The value is determined, and the state value table 11C determines the state value after the transition based on the change condition rule Type-C.

図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 operation detection circuit 30 in FIG. 8. In FIG. 9, the vertical axis indicates the power consumption of the unauthorized operation detection circuit 30 in arbitrary units, and the horizontal axis indicates time in arbitrary units. In this example, the change condition rule given by the change condition rule output circuit 13A is Type-A of 1-bit value change of the power consumption waveform 26A, and the change condition rule given by the change condition rule output circuit 13B is that of the power consumption waveform 26B. The change condition rule given by the change condition rule output circuit 13C is Type-C of the 1-bit value change of the power consumption waveform 26C. As can be seen from FIG. 9, the dynamic change (for example, the change in the maximum value) of the power consumption of the unauthorized operation detection circuit 30 is the power consumption waveform 26 </ b> A even when different change condition rule output circuits 13 </ b> A to 13 </ b> C are used. , 26B, 26C, it can be seen that it cannot be confirmed.

不正操作検知回路30は、3つの状態値テーブル11A〜11Cを用いて現在の状態値に対する状態遷移後の3つの状態値を生成する状態値生成回路11と、3つの変化条件ルール出力回路13A〜13Cを備えるが、3つの変化条件ルールType-A〜Type-Cの中から乱数に基づいて選択される1つの変化条件ルールは、常に同一固定ビット数の値変化(この例では、1-bit値変化)である。 The unauthorized operation detection circuit 30 uses the three state value tables 11A to 11C to generate three state values after the state transition with respect to the current state value, and the three change condition rule output circuits 13A to 13A. 13C, but one change condition rule selected based on a random number from the three change condition rules Type-A to Type-C is always a value change of the same fixed bit number (in this example, 1-bit Value change) .

なお、図8の不正操作検知回路30では、互いに異なる変化条件ルールの数が3つであるが、互いに異なる変化条件ルールの数は複数であれば特に限定されない。また、互いに異なる変化条件ルールは、同一固定ビット数の値変化を用いるルールであれば良く、1-bit値変化を用いるルールに限定されない。なお、1-bit値変化を用いる変化条件ルールを使用する場合、2-bit以上の値変化を用いる変化条件ルールを使用する場合と比べて回路構成が比較的簡単になり、且つ、消費電力を比較的低く抑えることができる。   In the unauthorized operation detection circuit 30 in FIG. 8, the number of different change condition rules is three, but there are no particular limitations as long as there are a plurality of different change condition rules. Different change condition rules may be rules that use a value change of the same fixed bit number, and are not limited to rules that use a 1-bit value change. Note that when using a change condition rule that uses a 1-bit value change, the circuit configuration is relatively simple and consumes less power than when using a change condition rule that uses a 2-bit or greater value change. It can be kept relatively low.

図8の不正操作検知回路30によれば、攻撃者は何回もフォールト攻撃を繰り返し試すような攻撃を行っても、秘密鍵を解読することができない。不正操作検知回路30は、既知の攻撃に対して状態値の1-bit値変化で防御を行い、さらに未知の攻撃(または、進化した攻撃)に対しても状態値の1-bit値変化で防御することで、秘密鍵の漏洩を防止できる。この状態値の1-bit値変化を用いる変化条件ルールの数を多くするほど、攻撃に対してより安全となる。 According to the unauthorized operation detection circuit 30 of FIG. 8, even if an attacker performs an attack that repeatedly tries a fault attack, the secret key cannot be decrypted. The unauthorized operation detection circuit 30 defends against a known attack by changing the 1-bit value of the state value, and further prevents the unknown attack (or evolved attack) by changing the 1-bit value of the state value. By protecting it, it is possible to prevent leakage of the private key. Enough to increase the number of change condition rule Ru using 1-bit value changes in the state value becomes more secure against attacks.

図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 smart card 100 is an example of a device including an unauthorized operation detection circuit. A smart card 100 shown in FIG. 10 includes a CPU (Central Processing Unit) 101 as an example of a processor, a ROM (Read Only Memory) 102 as an example of a storage unit, a communication circuit 103, an external interface circuit 104, and mounting attack countermeasure hardware. An unauthorized operation detection circuit 105 as an example, a RAM (Random Access Memory) 106 as an example of a storage unit, a clock generation circuit 107, a power supply circuit 108, and a bus 109. The bus 109 connects the CPU 101, ROM 102, communication circuit 103, unauthorized operation detection circuit 105, and RAM 106.

CPU101は、スマートカード100全体の制御を司り、この例では周知の方法で乱数を発生する機能を有する。ROM102は、CPU101が実行するプログラム及び各種データを格納する。通信回路103は、外部インターフェース回路104を介して外部装置(図示せず)と有線及び無線の少なくとも一方の通信方式で通信し、例えば外部装置から演算開始入力を含む各種要求などを受信する。   The CPU 101 controls the entire smart card 100, and in this example, has a function of generating random numbers by a well-known method. The ROM 102 stores programs executed by the CPU 101 and various data. The communication circuit 103 communicates with an external device (not shown) via the external interface circuit 104 by at least one of wired and wireless communication methods, and receives various requests including an operation start input from the external device, for example.

なお、乱数は、不正操作検知回路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 CPU 101 and the unauthorized operation detection circuit 105 in the smart card 100, the random number is generated outside the smart card 100 to detect the unauthorized operation. It may be input to the circuit 105.

図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 operation detection circuit 30 shown in FIG. 8 is input from the CPU 101 to the unauthorized operation detection circuit 105, for example, and the calculation start input illustrated in FIG. 8 is input from the communication circuit 103 to the unauthorized operation detection circuit 105, for example. The calculation start input may be input from the communication circuit 103 to the unauthorized operation detection circuit 105 via the CPU 101, for example. The unauthorized operation detection circuit 105 outputs a fault detection signal (or interrupt signal) to the CPU 101 via the bus 109 when detecting the unauthorized operation as described above. When the CPU 101 receives the fault detection signal, the CPU 101 executes a secret key data erasure process, a cryptographic device use stop process, and the like, and takes appropriate measures so that the attacker does not succeed even after a further implementation attack. A known measure can be adopted as such an appropriate measure.

不正操作検知回路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 smart card 100 includes the unauthorized operation detection circuit 105, high tamper resistance can be realized.

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 RAM 106 temporarily stores various data including intermediate data for operations executed by the CPU 101 and provides a work area for the CPU 101. The clock generation circuit 107 generates a clock to be supplied to each unit that requires a clock in the smart card 100, as indicated by a broken line in FIG. In this example, the clock is supplied to the CPU 101, ROM 102, communication circuit 103, external interface circuit 104, unauthorized operation detection circuit 105, and RAM 106. The clock generation circuit 107 may be configured to generate a clock based on a signal, a clock, or the like supplied from an external device via the external interface circuit 104. The power supply circuit 108 supplies a power supply voltage to each part in the smart card 100 that requires the power supply voltage. The power supply circuit 108 may be configured to output a power supply voltage based on a signal supplied from an external device via the external interface circuit 104. When the smart card 100 is, for example, a contactless IC card, the power supply circuit 108 converts a radio wave generated by an external device such as a card reader / writer received by the antenna of the external interface circuit 104 into power and outputs a power supply voltage. It may be. The external interface circuit 104 may include a terminal. In FIG. 10, for convenience of explanation, illustration of a power supply line of a power supply voltage supplied by the power supply circuit 108 is omitted.

次に、本実施例における不正操作検知方法の一例を、図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 communication circuit 103 is read in step S2, and the encryption process is started. To do. After step S2, fault detection and attack countermeasure processing are performed in step S3. Step S3 includes steps S31 to S38.

ステップ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 CPU 101 is read. In step S32, one of the change condition rules Type-A to Type-C is selected based on the random number input, and the outputs of the selectors 15 and 16 are selected according to the selected change condition rule. . Thereby, when the change condition rule Type-A is selected, in step S33A, the state value after the state transition with respect to the current state value is determined (or generated) based on the state value table 11A. When the change condition rule Type-B is selected, in step S33B, the state value after the state transition with respect to the current state value is determined based on the state value table 11B. When the change condition rule Type-C is selected, in step S33C, the state value after the state transition with respect to the current state value is determined based on the state value table 11C. The output of the state value generation circuit 11 selected by the selector 15 is input to the state value register 12, and the change condition rule defined by any one of the change condition rule output circuits 13A to 13C selected by the selector 16 is the state value. It is input to the comparison circuit 14.

ステップ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 selector 15 is written in the state value register 12 as the next state value. As will be described later, if the current state value is written in the state value register 12, the state value after the transition is written in the state value register 12 as the next current state value. In the conversion processing, the state value register 12 stores the state value after the transition as the current state value based on the calculation start input. In step S35, the state value generation circuit 11 is accompanied by a 1-bit value change according to the change condition rule output from the selector 16 with respect to the output of the state value register 12 (ie, the current state value). A state value representing the execution state of the cryptographic operation (cryptographic algorithm) of the started cryptographic process is generated . Thus, the state value generation circuit 11 stores the data necessary to generate the state value after the state transition in accordance with the change condition rule that is outputted from the selector 16, using a corresponding state value table 1- The state value after the state transition accompanied by the bit value change is generated and output through the selector 15 as the next state value. In step S36, the state value comparison circuit 14 outputs the state value register 12 (that is, the current state value before the state transition) and the input (that is, the state transition for the current state value generated by the state value generation circuit 11). By comparing the subsequent state value), it is determined whether or not the relationship between the output of the state value register 12 and the input is a 1-bit value change according to the change condition rule output from the selector 16. If the decision result in the step S36 is NO, in a step S37, the state value comparison circuit 14 detects the occurrence of a fault from the abnormality of the state transition from the current state value before the state transition to the state value after the state transition and detects the fault. A detection signal is output.

一方、ステップ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 operation detection circuit 30 compares the state value before and after the state transition, and the 1-bit value according to the change condition rule selected by the selector 16. If there is a change in, it is determined that no fault has occurred, and if it is any other change, it is determined that a fault has occurred and a fault signal is output.

図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 Non-Patent Document 5. In FIG. 13, numerical values of 1024-bit or more used in RSA encryption are expressed by arranging g variables in units of w-bit. w is generally a value smaller than 1024, such as w = 16, 32, 64. By repeating w-bit partial multiplication, a modular multiplication operation of 1024-bit or more is performed. In FIG. 13, 17 state values are expressed in 5-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 operation detection circuit 30 compares the state value before and after the state transition, and the 1-bit value according to the change condition rule selected by the selector 16. If there is a change in, it is determined that no fault has occurred, and if it is any other change, it is determined that a fault has occurred and a fault signal is output.

図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}
C treatment 2
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, k + 2. In other words, when A → C state transition is performed, regardless of the value of k, the state value only changes in 2-bit value or 0-bit value, and changes in 1-bit value. Cannot be realized.

そこで、例えば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 {
B Treatment 1
C NOP}
D Processing 2
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 1, wherein each of the plurality of change condition rules is a rule using a 1-bit value change.
(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 claim 1 or 2, further comprising a selector for input to the state value comparison circuit.
(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 12, wherein each of the plurality of change condition rules is a rule using a 1-bit value change.
(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 12 or 13, wherein the state value is generated.
(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 appendices 12 to 14, wherein the unauthorized operation detection circuit further executes a step of reading the random number from a processor of the smart card.

以上、開示の不正操作検知回路、不正操作検知回路を備えた装置、及び不正操作検知方法を実施例により説明したが、本発明は上記実施例に限定されるものではなく、本発明の範囲内で種々の変形及び改良が可能であることは言うまでもない。   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 value generation circuits 11A to 11C state value table 12 state value registers 13A to 13C change condition rule output circuit 14 state value comparison circuits 15 and 16 selector 100 smart card 101 CPU
102 ROM
103 Communication Circuit 104 External Interface Circuit 105 Unauthorized Operation Detection Circuit 106 RAM
107 clock generation circuit 108 power supply circuit 109 bus

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記載の不正操作検知回路。   The unauthorized operation detection circuit according to claim 1, wherein each of the plurality of change condition rules is a rule using a 1-bit value change. 前記状態値生成回路は、前記現在の状態値に対する前記複数の変化条件ルールに従った状態遷移後の状態値を生成するのに必要なデータを格納する複数の状態値テーブルを有し、
前記選択部は、前記複数の状態値テーブルを用いて生成された前記現在の状態値に対する状態遷移後の複数の状態値の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つの変化条件ルールに従って生成された状態遷移後の状態値と、前記1つの変化条件ルールを、乱数に基づいて選択部から選択出力するステップと、
演算開始入力に基づいて状態値格納部に入力される前記現在の状態値を格納すると共に、前記選択部から選択出力される前記状態遷移後の状態値を次に入力されて格納するステップと、
前記状態値格納部から出力される前記現在の状態値と前記状態値格納部に前記次に入力される前記状態遷移後の状態値とを状態値比較回路で比較し、状態遷移が前記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.
JP2012072271A 2012-03-27 2012-03-27 Unauthorized operation detection circuit, device provided with unauthorized operation detection circuit, and unauthorized operation detection method Active JP6228354B2 (en)

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)

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