JPWO2004047052A1 - Tamper resistant information processing equipment - Google Patents

Tamper resistant information processing equipment Download PDF

Info

Publication number
JPWO2004047052A1
JPWO2004047052A1 JP2004553095A JP2004553095A JPWO2004047052A1 JP WO2004047052 A1 JPWO2004047052 A1 JP WO2004047052A1 JP 2004553095 A JP2004553095 A JP 2004553095A JP 2004553095 A JP2004553095 A JP 2004553095A JP WO2004047052 A1 JPWO2004047052 A1 JP WO2004047052A1
Authority
JP
Japan
Prior art keywords
information processing
signal
processing apparatus
calculation
mod
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.)
Granted
Application number
JP2004553095A
Other languages
Japanese (ja)
Other versions
JP4381987B2 (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.)
Renesas Technology Corp
Original Assignee
Renesas Technology Corp
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 Renesas Technology Corp filed Critical Renesas Technology Corp
Publication of JPWO2004047052A1 publication Critical patent/JPWO2004047052A1/en
Application granted granted Critical
Publication of JP4381987B2 publication Critical patent/JP4381987B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/002Countermeasures against attacks on cryptographic mechanisms
    • H04L9/003Countermeasures against attacks on cryptographic mechanisms for power analysis, e.g. differential power analysis [DPA] or simple power analysis [SPA]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/60Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers
    • G06F7/72Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic
    • G06F7/724Finite field arithmetic
    • G06F7/725Finite field arithmetic over elliptic curves
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • H04L9/3066Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy involving algebraic varieties, e.g. elliptic or hyper-elliptic curves
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2207/00Indexing scheme relating to methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F2207/72Indexing scheme relating to groups G06F7/72 - G06F7/729
    • G06F2207/7219Countermeasures against side channel or fault attacks
    • G06F2207/7223Randomisation as countermeasure against side channel attacks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/08Randomization, e.g. dummy operations or using noise
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/12Details relating to cryptographic hardware or logic circuitry
    • H04L2209/127Trusted platform modules [TPM]

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Analysis (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computational Mathematics (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Algebra (AREA)
  • Storage Device Security (AREA)

Abstract

ICチップの消費電力の変化から秘密情報を取り出すことを困難にして耐タンパー性を高める際に、計算量の肥大化を回避して処理を高速化する。ICチップの内部で実行される冪乗剰余計算や楕円曲線上の点のスカラー倍計算を行うにあたって、データを乱数に基づいてブラインド化し、計算終了後にアンブラインド化するが、ブラインドに用いるデータが計算の繰り返しを通じて一定となるように、ブラインドの方式を変更する。このことにより、アンブラインド時の計算量を少なくすることができる。When it is difficult to extract secret information from changes in the power consumption of the IC chip and the tamper resistance is increased, the processing speed is increased by avoiding an increase in the amount of calculation. When performing power-residue calculation or scalar multiplication of points on an elliptic curve that are executed inside the IC chip, the data is blinded based on random numbers and unblinded after the calculation, but the data used for the blind is calculated The blind method is changed so that it becomes constant through the repetition of the above. As a result, the amount of calculation during unblinding can be reduced.

Description

本発明は、暗号を用いて情報の安全性及び信頼性を確保する技術に係り、特に暗号への攻撃を防ぐ耐タンパー情報処理装置に関する。  The present invention relates to a technique for ensuring the safety and reliability of information using encryption, and more particularly to a tamper resistant information processing apparatus for preventing attacks on encryption.

現在、市場が拡大しつつあるIC(Integrated Circuit)カードや、ヨーロッパで広く利用されているGSM(Global Systems for Mobile Communication)規格のモバイルホンは、利用者認証や、電子商取引を行なうことができる携帯端末である。更にICカードは、特に信頼性や安全性が重視される電子マネーとしても利用される。一方、GSMモバイルホンでは、同様の利用のためのSIM(Subscriber Identification Module)モジュールとよばれる形態が採用されている。
ICカード及びSIMモジュールとも、カード形態の情報処理装置であり、端子付きの半導体チップをプラスティックの板に張り付けた構造をしている。両者の構造が基本的に同じであるので、以下ICカードについて説明する。
上記のように利用されるICカードは、勝手に書き換えることが許されない個人情報の保持を行なうほか、秘密情報である暗号鍵を用いたデータの暗号化や暗号文の復号を行なう。
ICカード自体は電源を持っておらず、ICカードを制御するリーダライタから電力の供給を受けて、動作可能となる。接触式のICカードでは、半導体チップの端子を介して直接的に電力が供給される。一方、非接触式のICカードでは、内蔵するアンテナコイルがリーダライタの発する電波を受信し、その共振出力を検波整流することにより、半導体チップを動作させる電力が取り出される。
ICカードは、動作可能になると、リーダライタから送信されるコマンドを受信し、そのコマンドに従って、データの転送等の処理を行なう。
ICカードは、第10図に示すように、カード101の上に、IC(半導体集積回路)である半導体チップ102を搭載したものである。一般にICカードは、ISO7816の規格に定められた位置に供給電圧端子Vcc、グランド端子GND、リセット端子RST、入出力端子I/O、クロック端子CLKを持ち、これらの端子を通して、リーダライタ(図示せず)から電源の供給やリーダライタとのデータの通信を行なう。
情報処理を行なう半導体チップ102の構成は、基本的には通常のマイクロコンピュータと同じである。その構成は、第11図に示すように、CPU(中央処理装置)201、記憶装置(MEM)204、入出力ポート(I/O)207、コプロセッサ(COPRO)202からなる。
CPU201は、論理演算や算術演算などを行なう装置であり、記憶装置204は、プログラム格納部(PS)205及びデータ格納部(DS)206を備えている。入出力ポート207は、リーダライタと通信を行なう装置である。コプロセッサ202は、暗号処理そのもの、又は暗号処理に必要な演算を高速に行なう装置であり、例えば、広く用いられているRSA暗号を対象とした剰余演算を行なうための特別な演算装置や、DES(米国のデータ暗号化規格)暗号のラウンド処理を行なう暗号装置などがある。ICカード用プロセッサの中には、コプロセッサ202を持たないものも多くある。各装置は、データバス203によって相互に接続されている。
記憶装置204は、ROM(Read Only Memory)やRAM(Random access Memory)、EEPROM(Electric Erasable Programmable Read Only Memory)などからなる。近年は、EEPROMの代わりにFeRAM(Ferroelectric RAM)を使うものもある。
書換えることができないメモリであるROMには、主にプログラムが格納される。書き換えが可能なEEPROMには、ICカードがリーダライタから抜かれた状態で保持することが要求されるデータが格納される。例えば、プリペイドカードでのプリペイドの度数などは、使用するたびに書き換えられ、EEPROMに保持される。
このように、ICカードにおいては、プログラムや重要な情報が半導体チップの中に密閉される。即ち、ICカードは、重要な情報を格納したり、内部で暗号処理を行なうために用いられる。
従来、ICカードでの暗号を外部から解読する難しさは、暗号アルゴリズムの解読の困難さと同じと考えられていた。しかし、ICカードが暗号処理を行なっている際の消費電流(リーダライタから供給される)を観測し、解析することにより、暗号アルゴリズムの解読よりも容易に暗号処理の内容や暗号鍵を推定することが可能であるとの示唆がなされるようになった。このような危険性が、例えば、文献1:1997年John wiley & Sons出版社発行“SMARTCARD HANDBOOK”(W.Rankl及びEffing共著)の第263頁(8.5.1.1“Passive Protective Mechanism”)に記載されている。
特に、CMOS(Complementary Metal Oxide Transistor)トランジスタによって構成される半導体チップ102のデータバス203においては、配線の持つ静電容量や配線に接続されているトランジスタの静電容量のため、バスドライバーによってバスの値が1から0又は0から1に変わるときに電力を消費する。一方、トランジスタのレベルが固定の状態では殆ど電力を消費しない。そのため、消費電力を観測すれば、半導体チップ102の中で、何が動作しているかが分かる可能性がある。
第12図は、半導体チップ102の1サイクルでの消費電力の波形の例を示したものである。処理しているデータに依存して、消費電力波形が曲線301や曲線302のように異なる。このような差は、バス203を流れるデータやCPU201で処理しているデータに依存して生じる。そのため、消費電流を観測すれば、半導体チップ102の中で、何が動作しているか分かる可能性がある。
コプロセッサ202は、CPU201と並列に、例えば、512ビットの剰余演算を行なう場合がある。その場合は、CPU201の消費電流とは異なった消費電流波形が長時間に渡って継続する。従って、その特徴的な波形を観測することにより、コプロセッサ202の動作回数を容易に測定することができる。コプロセッサ202の動作回数が暗号鍵と何らかの関係があるならば、コプロセッサ202の動作回数から暗号鍵を推定できる可能性がある。
例えば、RSA暗号の処理である、
Y^X mod N(^は、冪乗を表す)
でよく用いられる実装においては、秘密指数であるXのバイナリ表現の各項が0であるか1であるかに従い、剰余乗算である、
A*B mod N(*は、乗算を表す)
の実行回数が変化する。なお、RSA暗号の処理(復号)については後で述べるが、Yは暗号文、XはそのICカードのみが知る秘密指数、Nは公開されている法(モジュラス)、Z mod Nは、ZをNで割った余りを意味する。
通常のICカードには、当該剰余演算を実行するコプロセッサ202が内蔵されており、このコプロセッサの動作電流は比較的大きく、CPU201とは異なる電力消費パターンを示す場合がある。この場合は、コプロセッサ202の動作回数を数えることは容易であり、従って、秘密鍵Xの情報、即ち、1の個数を消費電力パターンから同定することができる。
また、コプロセッサ202での演算内容が、暗号鍵(秘相指数)に依存した偏りを持つ場合、その偏りが消費電流に反映し、暗号鍵が推定される可能性がある。偏りが著しい場合には、Xの全てのビットパターンを同定できる可能性もある。CPU201でも同様の事情が存在する。暗号鍵は一定であるため、処理するデータを変更して、消費電流を観測することにより、暗号鍵のビット値の影響が観測できる可能性がある。これらの消費電流の波形を統計的に処理することにより、暗号鍵を同定することができる可能性がある〔(例えば文献2:Springer−Verlag出版社発行「クリプト(Crypto)’99」論文集(Proceedings of Crypto’99)の第1頁〜第10頁(P.Kocher,J.Jaffe及びB.Jun“Differential Power Analysis”)参照)。
上記のような攻撃(タンパー)から内部データを守るために、即ち耐タンパーを備えるために、ICチップ102でのデータ処理と消費電流との関連性を減らすことが行なわれる。消費電流とチップの処理との関連性が減れば、観測した消費電流の波形からICチップ102内での処理や暗号鍵の推測が困難になる。
さて、暗号方式には、暗号・復号のための鍵を共通にしないで復号を可能にする公開鍵方式があり、多く用いられる。この場合、暗号鍵は公開され、復号鍵は、復号側でのみ知るものとなる。公開鍵方式を採用する暗号法の代表として、RSA暗号や楕円曲線暗号がある。
ここで、上記のデータ処理と消費電流との関連性を減らす耐タンパーの代表的な従来例を、特にRSA暗号を例に取って説明する。その説明に先立ってRSA暗号の処理について以下に述べる。
RSA暗号暗号処理は、単位となる処理の組み合せで実行されることが多い(このことは、楕円曲線暗号に共通している)。RSA暗号の復号処理は、例えば、
S=Y^X mod N
による復号結果Sを求める冪乗剰余計算によって行なわれる。計算機上で通常実装される、この冪乗剰余計算の例をフローチャートで第13図に示す。この冪乗剰余計算は、アディション・チェイン・アルゴリズムに基づいて行なわれる〔例えば文献3:1997年CRC Press出版社発行“HANDBOOK OF APPLIED CRYPTOGRAPHY”(Menezes,van Oorschot及びVanstone共著)の第615頁“Algorithm 14.82”参照〕。この復号結果Sを求める計算の手順の骨子は、次ぎの通りである。
本例の暗号化の計算をスタートして、まず、
(1)秘密指数Xのnビットを、所望ビットJ毎に、例えば2ビット(J=2)毎に区切り、上位から読んでいき、それが、00,01,10,11のいずれであるかに応じて、
TBL[0]=1
TBL[1]=Y
TBL[2]=Y^2 mod N
TBL[3]=Y^3 mod N
を対応させ(ステップ0601)、続いて、
(2)これらの乗算剰余計算を行なう。
上述のように秘密鍵Xのビットを2ビット毎に区切ることは説明の便宜のための一例である。実際には秘密鍵Xのビットを1ビット、3ビット、4ビットにまとめて計算することもある。その際も計算手法の基本的な考え方は同じである。
このようなアディション・チェイン方式を用いて計算を行なう際、2回の二乗の計算を行なうステップ0602及びステップ0611は、Xのビットと無関係に行なわれる。
一方、その次に行なわれる乗算剰余計算においては、Xのビット(この例では、2ビット分を指す)値に応じて、条件分岐(ステップ0603、ステップ0604、ステップ0605及びステップ0606)が行なわれる。そして、それぞれのビットに応じて、ステップ0607、ステップ0608、ステップ0609及びステップ0610の乗算剰余計算が行なわれる。ステップ0602,0611及びステップ0607〜0610の演算は、カウンタkがn/Jから1になるまで、区切ったX毎にn/J回行なわれる。即ち、1回の演算が終わる毎にkから1を減じ、k=0になったときに演算が終了し、そのときの演算結果が最終結果になる。
なお、実装面からは、この乗算剰余計算は処理が重いので、多くのICカードでは、乗算剰余計算には、CPUではなく、専用のコプロセッサが用いられることが多い。
この乗算剰余計算の際、各ビットによって異なるのは、ステップ0601において生成するテーブルの値、即ち、TBL[0],TBL[1],TBL[2],TBL[3]である。
一般に、上述のように乗算剰余計算は処理が重く、その際、発生する電流は非常に大きい。特に、多桁計算の際に、TBL[0],TBL[1],TBL[2],TBL[3]のうち、どれが処理されているかが判ることがある。
このような電流波形の違いから、例えば、電流波形パターンを4種類に分類することができれば、秘密鍵のビットパターンを見つけることができる。即ち、4種類の電流波形に基づき、その4つの順列のパターン数4!=24通りを試せば良い。法Nのビット数が増えた場合も、事情は同様である。
この秘密鍵のビットパターンを見つける攻撃の方法は、特にNのビット数が増加したときに、著しい効果を発揮する。例えば、Nが2048ビットの場合、現在のところ、事実上因数分解を行なうのは不可能である。しかし、オシロスコープを用いてICチップの消費電流を見ることができれば、秘密鍵のビットパターンを見つけることができる。
例えば、X(2000ビット程度)の値を知るには、次のような手順がある。先ず、2000ビット程度の消費電流の波形の塊(2ビット毎に区切っていれば、約1000個の塊)を4通りに分類する。分類された4通りそれぞれについて、別の計算機を用いて、冪乗剰余計算を実行する。そして、この各冪乗剰余計算の結果をICチップから出力される結果と比較して、その両者が一致しているものを探し出せばよい。この検証は、高々24通りに過ぎない。従って、第13図に示したようなRSA暗号の通常の処理は、データが解読される高い可能性を有することとなる。
このような解析を撹乱する基本的な考えは、データを変形して、暗号処理を行ない、最後に逆変形することである。共通鍵を採用しているDES暗号に対してこの考えを適用した、攻撃から守る方法の例が、例えば、文献4:特開2000−182012号公報に記載されている。
解析を撹乱する方法、即ち、データ処理と消費電流との関連性を減らすことによって耐タンパーを得る、RSA暗号を対象にした従来の代表的な方法として、Yの代わりに、KY mod N(Kは、法Nの下で逆数を持つ乱数)を用いて処理を行ない、最後に修正処理を行なう従来の(方法A)がある。(方法A)が例えば文献5:Springer−Verlag出版社発行「クリプト(Crypto)’96」論文集(Proceedings of Crypto’96)の第104頁〜第113頁(P.Kocher“Timing Attacks on Implementation of Diffie−Hellman,RSA,DSS,and Other Sytems”)に記載されている。
(方法A)においては、入力データY自身ではなく、乱数Kに対して、KYが演算されるので、剰余乗算を行なうコプロセッサにおいて消費される電流が異なる。Kは乱数であり、外部から判らないため、KYの値がどうなるか判らず、従って対応する電流も本来のものとの相関がなくなる。これにより、電流から秘密鍵を知ることが困難になる。
Currently, the IC (Integrated Circuit) card whose market is expanding and the GSM (Global Systems for Mobile Communication) standard mobile phone widely used in Europe are mobile phones that can perform user authentication and electronic commerce. It is a terminal. Furthermore, the IC card is also used as electronic money in which reliability and safety are particularly important. On the other hand, the GSM mobile phone employs a form called a SIM (Subscriber Identification Module) module for similar use.
Both the IC card and the SIM module are card-type information processing devices, and have a structure in which a semiconductor chip with terminals is attached to a plastic plate. Since both structures are basically the same, the IC card will be described below.
The IC card used as described above holds personal information that cannot be rewritten without permission, and also encrypts data and decrypts ciphertext using an encryption key that is secret information.
The IC card itself does not have a power source, and can operate by receiving power from a reader / writer that controls the IC card. In a contact type IC card, power is directly supplied via a terminal of a semiconductor chip. On the other hand, in a non-contact type IC card, a built-in antenna coil receives a radio wave emitted from a reader / writer and detects and rectifies the resonance output, thereby extracting electric power for operating the semiconductor chip.
When the IC card becomes operable, it receives a command transmitted from the reader / writer and performs processing such as data transfer in accordance with the command.
As shown in FIG. 10, the IC card is obtained by mounting a semiconductor chip 102 which is an IC (semiconductor integrated circuit) on a card 101. In general, an IC card has a supply voltage terminal Vcc, a ground terminal GND, a reset terminal RST, an input / output terminal I / O, and a clock terminal CLK at positions defined by the ISO 7816 standard, and a reader / writer (not shown) is passed through these terminals. Power supply and data communication with the reader / writer.
The configuration of the semiconductor chip 102 that performs information processing is basically the same as that of a normal microcomputer. As shown in FIG. 11, the configuration includes a CPU (central processing unit) 201, a storage device (MEM) 204, an input / output port (I / O) 207, and a coprocessor (COPRO) 202.
The CPU 201 is a device that performs logical operations and arithmetic operations, and the storage device 204 includes a program storage unit (PS) 205 and a data storage unit (DS) 206. The input / output port 207 is a device that communicates with the reader / writer. The coprocessor 202 is a device that performs cryptographic processing itself or computation necessary for cryptographic processing at high speed. For example, a special computing device for performing a remainder computation on a widely used RSA cipher, DES, (A data encryption standard in the United States) There are encryption devices that perform encryption round processing. Many IC card processors do not have the coprocessor 202. Each device is connected to each other by a data bus 203.
The storage device 204 includes a ROM (Read Only Memory), a RAM (Random Access Memory), an EEPROM (Electrically Erasable Programmable Read Only Memory), and the like. In recent years, some use FeRAM (Ferroelectric RAM) instead of EEPROM.
A program is mainly stored in a ROM which is a memory that cannot be rewritten. The rewritable EEPROM stores data required to be held in a state where the IC card is removed from the reader / writer. For example, the prepaid frequency of the prepaid card is rewritten every time it is used, and is stored in the EEPROM.
Thus, in the IC card, programs and important information are sealed in the semiconductor chip. In other words, the IC card is used for storing important information and internally performing encryption processing.
Conventionally, it has been considered that the difficulty of decrypting the encryption of the IC card from the outside is the same as the difficulty of decrypting the encryption algorithm. However, by observing and analyzing the current consumption (supplied from the reader / writer) when the IC card is performing encryption processing, it is possible to estimate the content and encryption key of encryption processing more easily than decryption of the encryption algorithm. It has been suggested that this is possible. Such a risk is described in, for example, Reference 1: 1997, John Wiley & Sons publisher “SMARTCARD HANDBOOK” (co-authored by W. Rankl and Effing), page 263 (8.5.1.1 “Passive Protective Mechanism”). )It is described in.
In particular, in the data bus 203 of the semiconductor chip 102 formed of CMOS (Complementary Metal Oxide Transistor) transistors, the bus driver uses a bus driver because of the capacitance of the wiring and the capacitance of the transistor connected to the wiring. Power is consumed when the value changes from 1 to 0 or from 0 to 1. On the other hand, little power is consumed when the transistor level is fixed. Therefore, by observing the power consumption, it may be possible to understand what is operating in the semiconductor chip 102.
FIG. 12 shows an example of the power consumption waveform in one cycle of the semiconductor chip 102. Depending on the data being processed, the power consumption waveform differs as shown by curve 301 and curve 302. Such a difference occurs depending on data flowing through the bus 203 and data processed by the CPU 201. Therefore, by observing the current consumption, it may be possible to know what is operating in the semiconductor chip 102.
The coprocessor 202 may perform, for example, a 512-bit remainder operation in parallel with the CPU 201. In that case, a consumption current waveform different from the consumption current of the CPU 201 continues for a long time. Therefore, the number of operations of the coprocessor 202 can be easily measured by observing the characteristic waveform. If the number of operations of the coprocessor 202 has some relationship with the encryption key, the encryption key may be estimated from the number of operations of the coprocessor 202.
For example, RSA encryption processing
Y ^ X mod N (^ represents power)
In the implementation often used in the above, it is a remainder multiplication according to whether each term of the binary representation of X, which is a secret exponent, is 0 or 1.
A * B mod N (* represents multiplication)
The number of executions of changes. The processing (decryption) of the RSA encryption will be described later. Y is a ciphertext, X is a secret exponent known only by the IC card, N is a public method (modulus), and Z mod N is Z It means the remainder divided by N.
A normal IC card has a built-in coprocessor 202 that executes the remainder operation. The operating current of the coprocessor is relatively large and may show a power consumption pattern different from that of the CPU 201. In this case, it is easy to count the number of operations of the coprocessor 202. Therefore, the information of the secret key X, that is, the number of 1 can be identified from the power consumption pattern.
Further, when the calculation content in the coprocessor 202 has a bias depending on the encryption key (secret phase index), the bias may be reflected in the current consumption, and the encryption key may be estimated. If the bias is significant, all bit patterns of X may be identified. Similar circumstances exist in the CPU 201. Since the encryption key is constant, there is a possibility that the influence of the bit value of the encryption key can be observed by changing the data to be processed and observing the current consumption. By statistically processing these waveforms of current consumption, there is a possibility that an encryption key can be identified [(For example, “Crypto '99”, published by Springer-Verlag publisher, ( Proceedings of Crypto '99), pages 1 to 10 (see P. Kocher, J. Jaffe and B. Jun “Differential Power Analysis”).
In order to protect internal data from the attack (tamper) as described above, that is, to have tamper resistance, the relevance between data processing in the IC chip 102 and current consumption is reduced. If the relationship between the current consumption and the chip processing decreases, it becomes difficult to process the IC chip 102 and estimate the encryption key from the observed current consumption waveform.
An encryption method includes a public key method that enables decryption without using a common encryption / decryption key, and is often used. In this case, the encryption key is made public and the decryption key is known only on the decryption side. RSA cryptography and elliptic curve cryptography are representative examples of cryptography that employs a public key scheme.
Here, a typical conventional example of tamper resistance that reduces the relevance between the above data processing and current consumption will be described, particularly taking RSA encryption as an example. Prior to the description, the RSA encryption process will be described below.
The RSA encryption processing is often executed by a combination of unit processing (this is common to elliptic curve encryption). The decryption process of RSA encryption is, for example,
S = Y ^ X mod N
This is performed by the power-residue calculation for obtaining the decoding result S. FIG. 13 is a flowchart showing an example of this power residue calculation that is normally implemented on a computer. This power-residue calculation is performed based on the addition chain algorithm (for example, reference 3: page 615 of "HANDBOOK OF APPLIED CRYPTOGRAPHY" published by CRC Press Publisher, 1997) Algorithm 14.82 "). The outline of the calculation procedure for obtaining the decoding result S is as follows.
Start the encryption calculation of this example,
(1) The n bits of the secret exponent X are divided into desired bits J, for example, every 2 bits (J = 2), and read from the higher order, which is 00, 01, 10, or 11 In response to the,
TBL [0] = 1
TBL [1] = Y
TBL [2] = Y ^ 2 mod N
TBL [3] = Y ^ 3 mod N
(Step 0601),
(2) Perform these multiplication remainder calculations.
As described above, dividing the bits of the secret key X every two bits is an example for convenience of explanation. Actually, the bits of the secret key X may be calculated as 1 bit, 3 bits, and 4 bits. At that time, the basic concept of the calculation method is the same.
When the calculation is performed using such an addition chain method, Step 0602 and Step 0611 for performing the square calculation twice are performed irrespective of the bit of X.
On the other hand, in the subsequent multiplication remainder calculation, conditional branches (step 0603, step 0604, step 0605, and step 0606) are performed in accordance with the value of the bit of X (in this example, indicating 2 bits). . Then, in accordance with each bit, multiplication remainder calculation in step 0607, step 0608, step 0609, and step 0610 is performed. The computations of steps 0602, 0611 and steps 0607-0610 are performed n / J times for each delimited X until the counter k changes from n / J to 1. That is, every time one calculation is completed, 1 is subtracted from k. When k = 0, the calculation ends, and the calculation result at that time becomes the final result.
From the viewpoint of mounting, this multiplication remainder calculation is heavy, and in many IC cards, a dedicated coprocessor is often used for multiplication remainder calculation instead of the CPU.
In this multiplication remainder calculation, what is different for each bit is the value of the table generated in step 0601, that is, TBL [0], TBL [1], TBL [2], TBL [3].
In general, as described above, the multiplication remainder calculation is heavy, and the generated current is very large. In particular, in multi-digit calculations, it may be known which of TBL [0], TBL [1], TBL [2], and TBL [3] is being processed.
From such a difference in current waveform, for example, if the current waveform pattern can be classified into four types, a secret key bit pattern can be found. That is, based on four types of current waveforms, the number of patterns in the four permutations is 4! = Try 24 streets. The situation is the same when the number of bits of modulus N increases.
This attacking method for finding the bit pattern of the secret key is particularly effective when the number of N bits is increased. For example, if N is 2048 bits, it is virtually impossible to perform factorization at present. However, if the current consumption of the IC chip can be seen using an oscilloscope, the bit pattern of the secret key can be found.
For example, to know the value of X (about 2000 bits), there are the following procedures. First, a waveform block of current consumption of about 2000 bits (about 1000 blocks if divided every 2 bits) is classified into four types. For each of the four classified categories, the power residue calculation is executed using another computer. Then, the result of each power-residue calculation is compared with the result output from the IC chip, and a search is made for a match between the two. This verification is no more than 24 ways. Therefore, the normal processing of the RSA encryption as shown in FIG. 13 has a high possibility of data being decrypted.
The basic idea of disturbing such analysis is to transform the data, perform cryptographic processing, and finally reverse transform. An example of a method for protecting against attacks by applying this idea to a DES cipher employing a common key is described in, for example, Document 4: Japanese Patent Laid-Open No. 2000-182012.
As a conventional representative method for RSA cryptography that disturbs analysis, that is, obtains tamper resistance by reducing the relationship between data processing and current consumption, instead of Y, KY mod N (K Is a conventional (method A) in which processing is performed using a random number having a reciprocal number under modulus N, and correction processing is finally performed. (Method A) is disclosed in, for example, Reference 5: Springer-Verlag publisher “Crypto '96” Proceedings of Crypto '96, pages 104 to 113 (P. Kocher “Timing Attacks on Implementation of Implementation”). Diffie-Hellman, RSA, DSS, and Other Systems ").
In (Method A), since KY is calculated with respect to the random number K, not the input data Y itself, the current consumed in the coprocessor that performs the modular multiplication differs. Since K is a random number and is not known from the outside, it does not know what the value of KY will be, and accordingly, the corresponding current also has no correlation with the original one. This makes it difficult to know the secret key from the current.

(方法A)では、得られる結果は、
(KY)^X mod N
であり、正しい結果を得るためには、
K^(−X)mod N
を乗じて修正する必要がある。計算時間の増加は、このようにデータを本来とは異なるものに変形し、最後に逆変形を一括して行なうことによって生じる。本発明者は、計算時間の増加を抑えるために、上記の変形と一括逆変形による計算の構成を変えて処理を軽くすることに着目した。
本発明は、情報処理装置をそのようにして計算の肥大化を避けるように構成したものであるが、本発明の内容を説明するために、以下に先ず(方法A)を分解し、問題点を明らかにしておく。
(方法A)を第14図から第17図に示す。第14図に示す事前処理においては、まず乱数K(K<N)を発生する(ステップ0701)。そして、入力Yと当該乱数Kを用いて、
TBL[K,j]=(K*Y)^j mod N
(j=0、1、2、3)
を作成する(ステップ0702)。
その上で、KのNに関する逆数(Kは、Nと互いに素でなければならない)をユークリッド互除法を用いて計算し(例えば文献3の第67頁(Algorithm 2.107)参照)、これをCとする(ステップ0703)。
Cを用いて、
B[j]=C^j mod N(j=0、1、2、3)
を作成する(ステップ0704)。
次に、第15図に示す冪乗剰余計算の処理に移る。第15図の処理は、第13図における処理と同じであるが、ステップ0801,0802,0803,0804において、TBL[K,j]を用いている点が異なる。この処理で、
S=(K*Y)^X mod N
が計算される。
続いて、第16図に示す乱数Kに対する冪乗剰余計算の処理に移る。第16図の処理は、
T=C^X mod N=K^(−X)mod N
の計算を行なうものであって、第13図の処理と同じであるが、ステップ0901,0902,0903,0904において、B[j]を用いている点が異なる。
次いで、第17図に示す修正処理に移る。第17図の処理においては、 S*T mod N
を計算し、再びSとし、処理を終了する。
この際、第15図に示した、剰余二乗算2回と剰余乗算1回の処理が単位処理に相当する。(ここでは、1を乗ずる処理も敢えて行なっているが、これは説明のためであって、実際には処理を行なわないことが多い。)単位処理は、中間結果Sと乱数K、指数X[k]によって決まるので、以下、これを、
U(S、K、X[k])
と書くものとする。言い換えれば、この表記では、(方法A)の処理は、第18図、第19図に示すようになる。
第18図の事前処理は、事前計算のステップ0701,0702,0703,0704と、S,Tの初期化の処理であるステップ0705を行なうものである。
第19図の冪乗剰余計算と乱数Kに対する冪乗剰余計算の処理は、第18図の処理に引き続いて、SとTの計算を行なうものである。ここで、ステップ1201,1202の処理が、先に示した単位処理である。最後にステップ1203の処理を行なって、冪乗剰余計算の処理が終了する。
(方法A)の場合、この単位処理U(S,K,X[k])において、途中処理結果Sは、乱数Kと指数の2ビットブロックX[k]に対し、
S*(Y*K)^(4+X[k])mod N
=(S*Y^(4+X[k]))*K^(4+X[k])mod N
と変形される。従って、この計算は、指数の2ビットブロックX[k]の影響を受け、指数が尽きるまで影響を受ける。このことが、最終的な処理が大きなものになる原因になる。この問題は、データ隠蔽に用いた乱数Kの指数が変化してしまうことによって生ずる。もし、各2ビット処理毎にKの指数が変化しなければ、処理の肥大化を避けることができる。
この事情は、楕円曲線暗号においても同様である。以下に、楕円曲線暗号の演算処理の概要を説明する。
楕円曲線暗号においては、有限体(有限個の元の間に四則演算が定義された代数系)F上で定義された楕円曲線(3次曲線)Eの上の点PとQに対し、これらの和であるE上の点P+Qが定義される。更に、通常の0(ゼロ)に相当する点(無限遠点)Oが定義される。即ち、いかなるE上の点Pに対しても、P+O=O+P=Pとなるような点Oが唯一つ存在する。更に、任意のE上の点Pに対して、P+Q=Oとなるような点Q(−Pと書かれる)が存在し、E上の点全体は、一つの加法群(アーベル群)を形成する。Pをm個加えたものをmPと書き、負の数mに関しては、−Pを−m個加えたものをmPと書くことにする。m=0に対しては、mP=O(無限遠点)とする。これをPのスカラー倍演算と呼ぶ。mは、現在、160ビット程度の整数を用いることが多い。
楕円曲線暗号は、等式mP=Qにおいて、PとQが与えられた場合にmを決定する問題(楕円曲線上の離散対数問題)が、多大な計算時間を必要とすることを利用した公開鍵暗号である。
暗号処理の本体は、適当なEの点Pのスカラー倍mPの計算である。この計算にもRSA暗号の処理に用いたアディション・チェイン・アルゴリズムを適用することができる。これまでの例に倣い、RSA暗号の指数2ビットを処理単位とするアディション・チェイン・アルゴリズムを楕円曲線暗号の処理におけるスカラー倍の計算を行なうように変形したものを第20図に示す。
容易に分かるように、第13図の処理と第20図の処理の違いは、データと、その間の演算の違いだけである。即ち、
A*B mod N
がA+B(楕円曲線上の加算)に対応し、1がO(無限遠点)に対応する。
このことは、アディション・チェイン・アルゴリズムが、個々の演算の種類によらない、より一般的なものであることを示している。
従って、楕円曲線暗号におけるスカラー倍の処理においても、RSA暗号で生ずるのと同様のセキュリティ上の問題即ち攻撃(タンパー)を受ける問題が発生する。また、楕円曲線暗号のデータを隠蔽するための処理のうち、RSA暗号の処理における(方法A)に類似する、以下の(方法B)においても計算量の増大という問題が発生する。
(方法B)は、mの代わりにm+K(Kは乱数)を用いてスカラー倍の処理(m+K)Pを行ない、最後に−KPを加える処理である。この(方法B)においても、(方法A)と同様に計算量の増大という問題が発生する。
即ち、−KPを求める処理は、Kがmと同程度以上のビット長を持てば、mPを計算するのと同様の処理時間を必要とする。Kがmと同程度以上のビット長を必要とする理由は、もしも、mがKと比較して小さい場合(例えば半分の長さのとき)、mの上位は、殆どそのままの生の値で処理されることになるからである。
ここで挙げた演算は一例であって、それ以外にも種々のデータを隠蔽する従来方法がある。説明を省略するが、いずれも同様の問題が発生する。
本発明者は、逐次的に逆変換を行なうようにすれば、処理が軽くなり、消費電力と内部処理との関連を減らすことが可能になることを見出した。この方法においは、単位処理の前後で、データの形式が変化しないので、従来の(方法A)や(方法B)のように、本来のデータとは異なるものに変形し、最後に逆変形を一括して行なうことによって発生する処理の肥大化を避けることができる。なお、単位処理とは、例えば、第19図におけるUに相当するものである。
以下、本発明の処理手順を第1図を用いて説明する。今、所望の演算を#で表したときの信号Aと信号Bとを以って行なうA#Bに関して、多くの公開鍵暗号で用いられる一般的な演算は、
Y^X=Y#Y#…#Y(X個)
となり、A#Bの形式を含んでいる。本発明は、このような演算を対象とする。演算では、Xのビット長がnであるとし、Jビット単位のアディション・チェイン方式による処理が採用される。Jは、負でない整数である。
説明の煩雑さを避けるために、nは、Jの倍数であると仮定する。以下、Xを上位からJビット毎に区切っていったものを、X=(X[n/J]X[n/J−1]…X[k]…X[1])と表現する。(k=1,2,…,n/J−1,n/J)
ステップS1で、k=n/Jとし、
ステップS2で、乱数発生源が発生する信号に基づいて信号Wを定め、
ステップS3で、L=Wとする。即ち、Lの格納部に信号Wを入力し、
ステップS4で、L#Lを計算し、再びLの格納部に書き戻す操作をJ回行ない、
ステップS5で、X[k]とWに基づいて一意的に決まる信号
B[k]*W^((2^J)−1)
に対して、
A#B[k]#W^((2^J)−1)
を計算し、再びAの格納部に書き戻す操作を実行し、
ステップS6で、kから1を減じ、
ステップS7で、k=0であればステップS7に進み、k>0であれば、再びステップS4に戻り、
ステップS8で、k=0になったときの処理結果Tに対して、
T#W^(−1)
を出力結果Sとする。但し、W^(−1)は、W#Y=IとなるYのことである。
以下、これら一連の処理によって、Sの値がどのように変化するかを説明する。
最初、ステップS3によってL=Wとなる。ステップS4によって、値は、
L=W^(2^J)
となる。ステップS5によって、Lの値は、
W^(2^J)#B[k]#W^(−(2^J−1))
=B[k]#W
となる。この段階で、kが0でなければ、ステップS7によって再びステップS4に戻るので、同様に、ステップS4及びステップS5を経て、Lの値は、
B[k]^(2^J)#W
となる。このとき、Lの値が、単位処理の前後で、W=I(単位元)であるときの値に、Wを掛けるという形式を崩していないことが重要である。以下、全く同様に、単位処理の前後で、
「W=Iの場合の途中結果」#W
が維持され続ける。Wの値が未知であるので、処理データが不明のままであり、従って、ICチップの消費電力から、不正に内部情報を読み取ることが困難となる。
以上の演算は、言い換えると、kの値を定めるカウンタkが0となって、ステップS4からステップS7への演算が終了したときに、結果は、
Y^X#W
の形式となることであり、この場合にステップS8で、
W^(−1)mod N
を乗ずることによって、所望の値、Y^Xを得ることができるのである。この際、所望の値に修正するのに必要な処理は、ステップS8であって、従来の(方法A)のときのように、W^(−X)を乗ずるという重い修正処理の必要がない。
なお、取り上げるXの順番は、上記では、n/Jからとしたが、これを1からの逆順としても良く、或いは、番号が2ずつ変化するようにしても良い。従って、単純に順番を表すためのhを用いて上記のXの表現を改め、X=(X[h]X[h−1]…X[k]…X[1])としてkをhから順に定めるようにすることができる。
In (Method A), the result obtained is
(KY) ^ X mod N
And to get the correct results,
K ^ (-X) mod N
It is necessary to correct by multiplying. The increase in the calculation time is caused by transforming the data into something different from the original one and finally performing the inverse transformation collectively. In order to suppress an increase in calculation time, the present inventor has focused on reducing the processing by changing the calculation configuration by the above-described deformation and batch reverse deformation.
In the present invention, the information processing apparatus is configured so as to avoid the enlargement of the calculation. In order to explain the contents of the present invention, first, (Method A) is first decomposed, To clarify.
(Method A) is shown in FIGS. In the preprocessing shown in FIG. 14, first, a random number K (K <N) is generated (step 0701). Then, using the input Y and the random number K,
TBL [K, j] = (K * Y) ^ j mod N
(J = 0, 1, 2, 3)
Is created (step 0702).
Then, the reciprocal of K with respect to N (K must be relatively prime to N) is calculated using the Euclidean algorithm (see, for example, page 67 (Algorithm 2.107) of Document 3), C (step 0703).
Using C,
B [j] = C ^ j mod N (j = 0, 1, 2, 3)
Is created (step 0704).
Next, the process proceeds to the power residue calculation shown in FIG. The process in FIG. 15 is the same as the process in FIG. 13 except that TBL [K, j] is used in steps 0801, 0802, 0803, 0804. In this process,
S = (K * Y) ^ X mod N
Is calculated.
Subsequently, the process proceeds to the power residue calculation for the random number K shown in FIG. The process of FIG.
T = C ^ X mod N = K ^ (-X) mod N
13 is the same as the processing in FIG. 13 except that B [j] is used in steps 0901, 0902, 0903, and 0904.
Then, the process proceeds to the correction process shown in FIG. In the process of FIG. 17, S * T mod N
Is calculated and set to S again, and the process ends.
At this time, the process of two remainder multiplications and one remainder multiplication shown in FIG. 15 corresponds to a unit process. (Here, the process of multiplying by 1 is also performed darely, but this is for the purpose of explanation, and in many cases, the process is not actually performed.) The unit process includes the intermediate result S, the random number K, and the exponent X [ k].
U (S, K, X [k])
Shall be written. In other words, in this notation, the processing of (Method A) is as shown in FIGS.
The pre-processing in FIG. 18 performs pre-calculation steps 0701, 0702, 0703, and 0704, and step 0705, which is an initialization process for S and T.
The process of the power residue calculation and the power residue calculation for the random number K in FIG. 19 is to calculate S and T following the process of FIG. Here, the processing of steps 1201 and 1202 is the unit processing described above. Finally, the process of step 1203 is performed, and the process of calculating the power residue is completed.
In the case of (Method A), in this unit processing U (S, K, X [k]), the intermediate processing result S is obtained for a random number K and an exponent 2-bit block X [k].
S * (Y * K) ^ (4 + X [k]) mod N
= (S * Y ^ (4 + X [k])) * K ^ (4 + X [k]) mod N
And transformed. Therefore, this calculation is affected by the exponent 2-bit block X [k] and is affected until the exponent is exhausted. This causes the final process to become large. This problem occurs because the index of the random number K used for data hiding changes. If the index of K does not change for each 2-bit processing, processing enlargement can be avoided.
This situation is the same in elliptic curve cryptography. Below, the outline | summary of the calculation process of elliptic curve cryptography is demonstrated.
In elliptic curve cryptography, for points P and Q on an elliptic curve (cubic curve) E defined on a finite field (algebraic system in which four arithmetic operations are defined between finite elements) F, A point P + Q on E which is the sum of is defined. Further, a point (infinity point) O corresponding to normal 0 (zero) is defined. That is, for any point P on E, there is only one point O such that P + O = O + P = P. Furthermore, for any point P on E, there is a point Q (written as -P) such that P + Q = O, and the entire point on E forms one additive group (Abelian group). To do. A value obtained by adding m P is written as mP, and for a negative number m, a value obtained by adding -m -P is written as mP. For m = 0, mP = 0 (infinity point). This is called a scalar multiplication of P. Currently, m is often an integer of about 160 bits.
The elliptic curve cryptography uses the fact that the problem of determining m when P and Q are given in the equation mP = Q (discrete logarithm problem on an elliptic curve) requires a lot of computation time. Key encryption.
The main body of the cryptographic process is the calculation of a scalar multiple mP of the appropriate point P of E. The addition chain algorithm used for RSA encryption processing can also be applied to this calculation. FIG. 20 shows a modification of the addition chain algorithm in which the RSA cipher exponent of 2 bits is used as a processing unit, so as to perform scalar multiplication in the elliptic curve cipher processing, following the previous examples.
As can be easily understood, the difference between the processing of FIG. 13 and the processing of FIG. 20 is only the difference in data and the operation between them. That is,
A * B mod N
Corresponds to A + B (addition on an elliptic curve) and 1 corresponds to O (point at infinity).
This indicates that the addition chain algorithm is more general regardless of the type of operation.
Therefore, even in the scalar multiplication process in elliptic curve cryptography, the same security problem as in the RSA cipher, that is, the problem of receiving an attack (tamper) occurs. Further, among the processes for concealing elliptic curve encryption data, the following (Method B), which is similar to (Method A) in the RSA encryption process, also causes a problem of an increase in calculation amount.
(Method B) is a process of performing scalar multiplication (m + K) P using m + K (K is a random number) instead of m, and finally adding -KP. In this (Method B) as well as (Method A), there is a problem that the amount of calculation increases.
That is, the process for obtaining -KP requires the same processing time as that for calculating mP if K has a bit length equal to or greater than m. The reason why K needs a bit length equal to or larger than m is that if m is smaller than K (for example, half the length), the upper part of m is almost the same raw value. This is because it will be processed.
The calculations given here are merely examples, and there are other conventional methods for hiding various data. Although the explanation is omitted, the same problem occurs in both cases.
The present inventor has found that if the inverse transformation is sequentially performed, the processing becomes light and the relation between the power consumption and the internal processing can be reduced. In this method, since the data format does not change before and after the unit processing, it is transformed into something different from the original data as in the conventional (Method A) or (Method B), and finally the inverse transformation is performed. It is possible to avoid the enlargement of processing that occurs by carrying out collectively. The unit process corresponds to, for example, U in FIG.
The processing procedure of the present invention will be described below with reference to FIG. Now, with regard to A # B, which is performed using the signal A and the signal B when the desired operation is represented by #, a general operation used in many public key cryptography is as follows:
Y ^ X = Y # Y # ... # Y (X pieces)
And the format of A # B is included. The present invention is directed to such operations. In the calculation, it is assumed that the bit length of X is n, and processing using an addition chain method in units of J bits is employed. J is a non-negative integer.
In order to avoid complicated explanation, it is assumed that n is a multiple of J. In the following description, X divided from the higher order every J bits is expressed as X = (X [n / J] X [n / J−1]... X [k]... X [1]). (K = 1, 2,..., N / J-1, n / J)
In step S1, k = n / J,
In step S2, a signal W is determined based on the signal generated by the random number generation source,
In step S3, L = W. That is, the signal W is input to the L storage unit,
In step S4, L # L is calculated and written back to the storage unit of L again J times.
In step S5, a signal B [k] * W ^ ((2 ^ J) -1) uniquely determined based on X [k] and W
Against
A # B [k] #W ^ ((2 ^ J) -1)
, And execute the operation to write back to the storage unit of A again.
In step S6, 1 is subtracted from k.
In step S7, if k = 0, the process proceeds to step S7. If k> 0, the process returns to step S4 again.
In step S8, for the processing result T when k = 0,
T # W ^ (-1)
Is the output result S. However, W ^ (-1) is Y that satisfies W # Y = I.
Hereinafter, how the value of S changes by these series of processes will be described.
First, at step S3, L = W. By step S4, the value is
L = W ^ (2 ^ J)
It becomes. By step S5, the value of L is
W ^ (2 ^ J) #B [k] #W ^ (-(2 ^ J-1))
= B [k] #W
It becomes. At this stage, if k is not 0, the process returns to step S4 again by step S7. Similarly, through steps S4 and S5, the value of L is
B [k] ^ (2 ^ J) #W
It becomes. At this time, it is important that the value of L is multiplied by W before and after the unit processing and the value when W = I (unit element) is not broken. In the same way, before and after the unit processing,
“Intermediate result when W = I” #W
Will continue to be maintained. Since the value of W is unknown, the processing data remains unknown, and therefore it becomes difficult to illegally read internal information from the power consumption of the IC chip.
In other words, when the counter k that determines the value of k becomes 0 and the calculation from step S4 to step S7 is completed, the result is
Y ^ X # W
In this case, in step S8,
W ^ (-1) mod N
By multiplying by, a desired value Y ^ X can be obtained. At this time, the processing necessary for correcting to a desired value is step S8, and there is no need for heavy correction processing of multiplying W ^ (− X) as in the conventional (method A). .
The order of X to be picked up is n / J in the above description, but this may be reversed from 1 or the number may be changed by 2. Therefore, the above expression of X is amended using h for simply representing the order, and k is changed from h as X = (X [h] X [h−1]... X [k]... X [1]). It can be determined in order.

第1図は、本発明に係る情報処理装置が実行する手順を説明するためのフローチャートであり、第2図は、本発明の情報処理装置を説明するための構成図であり、第3図は、乱数発生装置の例を説明するための構成図であり、第4図は、本発明の第1の実施例の事前処理を説明するためのフローチャートであり、第5図は、第1の実施例の冪乗剰余計算部を説明するためのフローチャートであり、第6図は、第1の実施例の修正処理部を説明するためのフローチャートであり、第7図は、本発明の第2の実施例の事前処理部を説明するためのフローチャートであり、第8図は、第2の実施例のスカラー倍処理部を説明するためのフローチャートであり、第9図は、第2の実施例の修正処理部を説明するためのフローチャートであり、第10図は、ICカードの概観及び各種端子を説明するための平面図であり、第11図は、従来の情報処理装置の例を説明するための構成図であり、第12図は、データによる消費電力の違いを説明するための曲線図であり、第13図は、アディション・チェイン方式によるRSA復号の例を説明するためのフローチャートであり、第14図は、従来の耐タンパーRSA復号の事前処理の例を説明するためのフローチャートであり、第15図は、従来の耐タンパーRSA復号の冪乗剰余計算部の例を説明するためのフローチャートであり、第16図は、従来の耐タンパー復号処理の乱数Kに対する冪乗剰余計算部の例を説明するためのフローチャートであり、第17図は、従来の耐タンパー復号処理の修正処理部の例を説明するためのフローチャートであり、第18図は、従来の耐タンパー復号処理の事前処理の例を説明するための別のフローチャートであり、第19図は、従来の耐タンパー復号処理の冪乗剰余計算部と乱数Kの冪乗剰余計算部の例を説明するための別のフローチャートであり、第20図は、従来の別の耐タンパー暗号処理を説明するためのフローチャートである。  FIG. 1 is a flowchart for explaining the procedure executed by the information processing apparatus according to the present invention, FIG. 2 is a block diagram for explaining the information processing apparatus of the present invention, and FIG. FIG. 4 is a block diagram for explaining an example of a random number generator, FIG. 4 is a flowchart for explaining pre-processing of the first embodiment of the present invention, and FIG. 5 is a diagram showing the first embodiment. FIG. 6 is a flowchart for explaining an example raised remainder calculation unit, FIG. 6 is a flowchart for explaining a correction processing unit of the first embodiment, and FIG. 7 is a second flowchart of the present invention. FIG. 8 is a flowchart for explaining a pre-processing unit of the embodiment, FIG. 8 is a flowchart for explaining a scalar multiplication processing unit of the second embodiment, and FIG. 9 is a flowchart of the second embodiment. FIG. 10 is a flowchart for explaining a correction processing unit, FIG. FIG. 11 is a plan view for explaining an overview of an IC card and various terminals, FIG. 11 is a configuration diagram for explaining an example of a conventional information processing apparatus, and FIG. 12 is a diagram of power consumption by data. FIG. 13 is a flow chart for explaining an example of RSA decoding by an addition chain method, and FIG. 14 is a flowchart of pre-processing of conventional tamper-resistant RSA decoding. FIG. 15 is a flowchart for explaining an example of a power-residue calculating unit of conventional tamper resistant RSA decoding, and FIG. 16 is a flowchart of conventional tamper resistant decoding processing. FIG. 17 is a flowchart for explaining an example of a power residue calculation unit for a random number K, and FIG. 17 is a flowchart for explaining an example of a correction processing unit of a conventional tamper resistant decoding process. FIG. 18 is another flowchart for explaining an example of the prior process of the conventional tamper-resistant decoding process, and FIG. 19 shows the power residue calculation unit and the random number K of the conventional tamper-resistant decoding process FIG. 20 is another flowchart for explaining an example of the power-residue calculating unit, and FIG. 20 is a flowchart for explaining another conventional tamper resistant encryption process.

以下、本発明に係る耐タンパー情報処理装置を図面に示した実施例を参照して更に詳細に説明する。
本実施例の情報処理装置の構成を第2図に示す。同図において、201は、論理演算や算術演算などを行なうCPU(中央処理装置)、204は、プログラム格納部(PS)205及びデータ格納部(DS)206を備えた記憶装置(MEM)、207は、リーダライタ(図示せず)と通信を行なう入出力ポート(I/O)、202は、暗号処理そのもの又は暗号処理に必要な演算を高速に行なうコプロセッサ(COPRO)、208は、乱数発生源となる乱数発生装置(RNG)、203は、各装置を相互に接続するデータバスを示す。以上の各装置がICチップに内蔵されている。
CPU201及びコプロセッサ202は、以下に述べる暗号処理の各ステップをプログラム格納部205に格納された暗号処理プログラムに従って実行する。
乱数発生装置208の構成を第3図に示す。第3図において、1402は、一方の端子が接地された抵抗、1407は、抵抗1402の他方の端子を接続した入力端子を持つ増幅器(オペアンプ)、1404は、増幅器1407の出力端子を接続した入力端子1406と基準電源を入力する入力端子1403を持つ比較器である。
増幅器1407の他方の入力端子は接地される。また、基準電源の電位はVthに固定されており、比較器1404は、端子1406の電位とVthとを比較して、端子1406の電位がVthよりも高いときは、出力端子1405より、1を出力し、低い場合は、0を出力する。出力端子1405の出力信号は、バス203に供給される。
抵抗1402は、熱によって揺らぎ、振幅変化がランダムな熱雑音を発生する。これを増幅器1407が増幅し、その出力電位を比較器1404が適当な電位Vthと比較することによって、予測できないビット列が生成される。
以上の情報処理装置がICカードやGSMモバイルホンで用いられるSIMモジュールにICチップとして実装される。
はじめに第1の実施例として、RSA暗号を取り上げる。本実施例は、演算#を、
A#B=A*B mod N
で定義することによって構成される。ここで、データA,B,Nは、1024ビットの正の整数とする。上記のA*B mod Nは、AとBの通常の積をNで割った余りを意味する。例えば、
5*3 mod 7=1
である。
RSA暗号の復号演算は、
Y^X mod N
の計算を行なうことによって実行される。ここで、Yは暗号文、Xは秘密指数,Nは公開モジュラスである。計算は、
Y^X=Y#Y#…#Y(X個)
として行なわれる。
アタッカーのターゲットは、Xである。Xはn=1024ビットであるものとし、演算は、2ビット単位の、即ちJ=2のアディション・チェイン方式で処理される。以下、Xを上位から2ビット毎に区切っていったものを、X=(X[512]X[511]…X[1])と表現する。
本実施例では、コプロセッサ202がA*B mod Nを計算する。当該コプロセッサは、データ格納部206にレジスタA,B,Nを持ち、A*B mod Nを計算して、その結果を再びAレジスタに格納するものとする。一般に、A,B,Nは、1024ビット程度の大きな整数であるので、A*B mod Nの計算に時間がかかるため、通常、専用のコプロセッサが用意される。
以下、説明のため、CPUのレジスタサイズは、32ビットとしておく。
第4図、第5図、第6図に基づいて本発明の説明を行なう。まず、第4図に示すフローチャートの処理を開始する。ステップ1501の処理は、先に述べたステップS2に相当し、内蔵されている乱数発生装置208が乱数Wを発生する。Wは、Nよりも小さいもので、かつNと互いに素であるものとする。RSA暗号では、Nは、大きな素数PとQ(両者は、Nのほぼ半分のビット長を持つ)の積であるので、Wを、P,Qのうちの小さい方よりも小さくとれば、確実に互いに素となる。ここでは、高速処理を考慮して、Wを32ビット以下とする。なお、本発明は、32ビットに限定されるものではなく、64ビット、或いは、16ビット、8ビット等の他の値を採用することが可能である。
ここで、RSA暗号の処理のために、事前処理として、レジスタA,Bを持つコプロセッサ202を用いて、ステップS5に相当する演算で用いるY0,Y1,Y2,Y3が以下において算出される。
ステップ1502にて、
M=W^(−1)mod N
が計算される。この計算は、拡張されたユークリッド互除法を用いてなされる(例えば文献3の第67頁(Algorithm2.107)参照)。Mを求める計算は、数学的には、不定方程式(ディオフンタス方程式)である
M*W−H*N=1
を解いて、Mを求めることに等しい。
この際、Wが32ビットであり、Nのビット数(1024ビット)よりもずっと小さいので、拡張されたユークリッド互除法のアルゴリズムにおける最初のステップ、即ち、NをWで割る処理を行なった段階で、NをWで割った余りは、32ビット以下になる。従って、最初のステップを高速に実行できれば、その後の処理が軽い。最初のステップを高速化する方法は、よく知られているように、引き離し法(Non Restoring Method)があり、本実施例で採用した。この方法では、除算の中間処理である減算を、正負にかかわらず計算して、最後に値の調節が行なわれる。
次に、ステップ1503にて、
W^(−3)mod N=M^3 mod N
が計算される。具体的には、MをAレジスタに格納して、コプロセッサ202を用いて、
A*A mod N
を計算し、次に、Bレジスタに、Mを格納して、コプロセッサ202で、
A*B mod N
を実行することにより、Aレジスタに、W^(−3)mod Nが格納される。これは、続いてデータ格納部206のRAMの領域に転送される。これがステップ1504におけるY0となる。
次に、BレジスタにY0を格納して、A*B mod Nを実行することにより、Aレジスタに
Y1=Y*W^(−3)mod N
の値が格納される。この値は、上記RAMの領域(Y0とは重複しない領域)に転送される。
次に、もう一度、A*B mod Nを実行することにより、Aレジスタには、
Y2=Y^2*W^(−3)mod N
が格納される。この値は、上記RAMの領域(Y0,Y1とは重複しない)に転送される。
次に、更にもう一度、A*B mod Nを実行することにより、Aレジスタには、
Y3=Y^3 mod N
が格納される。この値は、上記RAMの領域(Y0,Y1,Y2とは重複しない)に転送される。これによって、ステップ1504の処理が終了し、Y0〜Y3の値が全て求められたことになる。
ステップ1505の処理は、カウンタをk=512に初期化するもので、ステップS1に相当する。
次に、ステップ1506で、Aレジスタに乱数Wが格納される(ステップS3に相当する)。そして、第5図の処理に移る。
ステップ1601では、まず最初に、カウンタkの値が0であるかどうかが調べられる(ステップS6に相当)。kが0でなければ、ステップS4に相当するステップ1602,1603によって、Aレジスタの値が4乗される。
次に、ステップ1604,1605,1606,1607によって、指数Xの2ビットブロックX[k]の値に応じて、Y0〜Y3のうちの一つが選ばれ、ステップ1608,1609,1610,1611において、これがBレジスタに転送される。続いて、ステップ1612で、A*B mod Nが計算される。ステップ1604〜1612がステップS5に相当する。
次に、kから1が減算される(ステップS6に相当するステップ1613)。そして、処理は再びステップ1601へと移り、カウンタkの値が0になるまで同様の処理が続けられる。カウンタkの値が0になったときに、第6図の処理に移る。
第6図の処理はステップS7に相当する修正処理であって、BレジスタにMが格納され(ステップ1701)、A*B mod Nが計算され、結果がAレジスタに格納される(ステップ1702)。
この処理によって、
Y^X*W*M mod N
=Y^X*W*W^(−1)mod N
=Y^X mod N
となり、所望の結果が得られる。
第5図に示した処理の過程では、全てのデータに乱数が掛けられているため、外部から当該ICチップの消費電力を基に秘密情報を取り出すことが困難になる。更に、第6図に示した処理の過程では、従来に行なわれていたW^(−X)を乗ずるという重い修正処理の必要がなく、従って、処理の肥大化が回避され、処理が高速化される。なお、ここでは、データ長が1024ビットである場合を扱ったが、これ以外の場合も同様に処理可能であることは言うまでもない。
次に、第2の実施例として、楕円曲線暗号に対する処理を取り上げる。説明に先立って、楕円曲線暗号について述べる。
楕円曲線は、(曲線E)を表す
Y^2=a*X^3+b*X+c
という形の標準形を持つ3次曲線に、無限遠点と呼ばれる特殊な元Oを加えたものである。但し、(曲線E)は非特異なもの、即ち、右辺が重根を持たないように選ばれる。ここで、a,b,cは、定数であり、有限体Fの元である。又、X,YもまたFの元であるが、これらは変数であるものとする。
有限体は、有限個の元からなる代数系であって、四則演算が可能なものをいう。最も簡単な有限体は、素体GF(P)である。ここで、Pは素数であって、GF(P)は、集合としては、
GF(P)={0,1,2,…,P−1}
である。
GF(P)における四則演算は、
(和)A+B mod P
(差)A−B mod P
(積)A*B mod P
(商)A*B^(−1)mod P
である。(商)の定義において、Bは0でないものとする。
GF(P)の元を係数に持つZの多項式のうち、n−1次以下のもの全体からなる集合に対して、既約なn次多項式Φ(Z)を取って、
(和)A(Z)+B(Z)mod Φ(Z)
(差)A(Z)−B(Z)mod Φ(Z)
(積)A(Z)*B(Z)mod Φ(Z)
(商)A(Z)*B(Z)^(−1)mod Φ(Z)
によって四則演算を定義したものも体となり、その代数的な構造は、Φ(Z)の選び方に依存しない。これをGF(P)のn次拡大体と呼ぶ。暗号処理においては、計算量を軽減する立場から、素体GF(P)と、標数2のガロア体GF(2^n)がよく用いられる。
(曲線E)の二つの点RとSをとると、RとSを通る直線が1本定まる(R=Sのときは接線を取る)。(曲線E)は3次曲線であるので、RとSを通る直線がY軸に平行になる場合を除けば、必ず、もう1点で交わる。この点をTとし、TとX軸に関して対称の位置にある点がRとSの和であり、
R+S
と書かれる。RとSを通る直線がY軸に平行になる場合は、R+Sは無限遠点Oであるものとする。又、R+V=Oとなるような点VをRの逆元といい、−Rで表す。このような規則の下で、(曲線E)の点全体は、可換群という代数系、即ち、Eのモーデル・ヴェイユ群が構成される。
楕円曲線上の和の計算は、X,Yの四則演算で達成される〔例えば文献6:1994年シュプリンガー・フェアラーク東京出版社発行「楕円曲線論入門」(J.H.シルバーマン及びテイト著、足立恒雄他訳)参照〕。
本実施例は、演算#を、
R#S=R+S(楕円曲線E上の和)
で定義することによって構成される。ここでは、楕円曲線としては、素体GF(P)の上で定義されたものを考える。
楕円曲線暗号の処理は、スカラー倍演算である
mR(mは整数、PはEの点)
の計算によって行なわれる。アタッカーのターゲットは、整数mである。mが160ビットであるものとし、2ビット単位のアディション・チェイン方式で処理する場合を考える。以下、Xを上位から2ビット毎に区切っていったものを、m=(m[80]m[79]…m[1])と表現する。
また、本実施例においても、第1にの実施例の場合と同様に、ICチップに内蔵した乱数発生装置208を用い、A*B mod Nを計算するコプロセッサ202を用いる。コプロセッサ202により、GF(P)上の積と商の演算ができる。和と差については、CPU201でも容易に処理することができる。演算は、具体的には、
R1(X1,Y1),R2(X2,Y2)
に対し、
R1+R2=(X3,Y3)
とすると、
X3=H^2−X1−X2 mod P
Y3=−(H*X3+Y2−H*X2)mod P
H=(Y2−Y1)*(X2−X1)^(−1)mod P
と書くことができる。
第7図、第8図、第9図を用いて本実施例を説明する。まず、第7図の処理を開始する。ステップ1801の処理は、乱数発生装置208が乱数W1,W2を発生する。W=(W1,W2)とする。
次に、ステップ1802にて、
−W=(W1,P−W2)
が計算される。計算結果の値は、データ格納部206のRAMの領域に転送される。
次に、ステップ1803にて、−3Wが計算される。この値は、上記RAMの領域(−Wとは重複しない領域)に転送される。
ステップ1804においては、RSA暗号の場合と同様の処理が剰余乗算の代わりに、楕円曲線上の和で行なわれ、
R0=3W
R1=R−3W
R2=2R−3W
R3=3R−3W
が求められ、これらを格納したテーブルが作成される。これらの値は、全て、互いに重複しないように配置される。
ステップ1805の処理は、カウンタをk=80に初期化するものである。
次に、RAM上の領域SにWが格納され(ステップ1806)、第8図の処理に移る。
ステップ1901では、まず最初に、カウンタkの値が0であるかどうかが調べられる。kが0でなければ、ステップ1902,1903によってSの4倍点が計算される。
次に、ステップ1904,1905,1906,1907によって、mの2ビットブロックm[k]の値に応じて、R0〜R3のうちの一つが選ばれ、ステップ1908,1909,1910,1911において、S+(R0〜R3のいずれか)が計算される。
次に、kから1が減算される(ステップ1912)。そして、処理は再びステップ1901へと移り、カウンタkの値が0になるまで同様の処理が続けられる。
カウンタkの値が0になったとき、第9図に示す処理に移る。
第9図に示した処理は修正処理であって、S−Wが計算され、結果の値がSレジスタに格納される(ステップ2001)。
この処理によって、
mR+W−W=mR
となり、所望の結果が得られる。
第9図までの処理の過程では、全てのデータに乱数が加算されているため、外部から当該ICチップの消費電力に基づいて秘密情報を取り出すことが困難になる。更に、第9図に示した処理の過程では、従来に行なわれていたW^(−X)を乗ずるという重い修正処理の必要がなく、従って、処理の肥大化が回避され、処理が高速化される。
以上に示した二つの実施例は、本質的に、演算#の意味を置換えただけで得られるものであり、言うまでもなく、これを一般化することが可能である。
本発明により、処理の肥大化を伴うことなく高いセキュリティを維持することができる、ICカードなどの耐タンパー情報処理装置を提供することができる。
Hereinafter, the tamper resistant information processing apparatus according to the present invention will be described in more detail with reference to the embodiments shown in the drawings.
The configuration of the information processing apparatus of this embodiment is shown in FIG. In the figure, 201 is a CPU (central processing unit) that performs logical operations and arithmetic operations, 204 is a storage device (MEM) that includes a program storage unit (PS) 205 and a data storage unit (DS) 206, 207 Is an input / output port (I / O) that communicates with a reader / writer (not shown), 202 is an encryption process itself or a coprocessor (COPRO) that performs operations necessary for the encryption process at high speed, and 208 is a random number generator. A random number generator (RNG) 203 serving as a source indicates a data bus that interconnects the devices. Each of the above devices is built in the IC chip.
The CPU 201 and the coprocessor 202 execute the following cryptographic processing steps according to the cryptographic processing program stored in the program storage unit 205.
The configuration of the random number generator 208 is shown in FIG. In FIG. 3, 1402 is a resistor having one terminal grounded, 1407 is an amplifier (op amp) having an input terminal connected to the other terminal of the resistor 1402, 1404 is an input connecting the output terminal of the amplifier 1407 The comparator has a terminal 1406 and an input terminal 1403 for inputting a reference power supply.
The other input terminal of the amplifier 1407 is grounded. The potential of the reference power supply is fixed to Vth, and the comparator 1404 compares the potential of the terminal 1406 with Vth. When the potential of the terminal 1406 is higher than Vth, 1 is output from the output terminal 1405. If it is low, 0 is output. An output signal from the output terminal 1405 is supplied to the bus 203.
The resistor 1402 fluctuates due to heat and generates thermal noise whose amplitude change is random. The amplifier 1407 amplifies this, and the comparator 1404 compares the output potential with an appropriate potential Vth, thereby generating an unpredictable bit string.
The above information processing apparatus is mounted as an IC chip on a SIM module used in an IC card or a GSM mobile phone.
First, RSA encryption will be taken up as a first embodiment. In this embodiment, the operation # is
A # B = A * B mod N
It is configured by defining Here, the data A, B, and N are assumed to be positive integers of 1024 bits. The above A * B mod N means a remainder obtained by dividing the normal product of A and B by N. For example,
5 * 3 mod 7 = 1
It is.
The decryption operation of the RSA cipher is
Y ^ X mod N
It is executed by calculating Here, Y is a ciphertext, X is a secret exponent, and N is a public modulus. The calculation is
Y ^ X = Y # Y # ... # Y (X pieces)
As done.
The attacker's target is X. X is assumed to be n = 1024 bits, and the operation is processed by an addition chain method in units of 2 bits, that is, J = 2. In the following, X divided from the upper 2 bits is expressed as X = (X [512] X [511]... X [1]).
In this embodiment, coprocessor 202 calculates A * B mod N. The coprocessor has registers A, B, and N in the data storage unit 206, calculates A * B mod N, and stores the result in the A register again. In general, since A, B, and N are large integers of about 1024 bits, it takes time to calculate A * B mod N. Therefore, a dedicated coprocessor is usually prepared.
In the following description, the register size of the CPU is 32 bits.
The present invention will be described with reference to FIGS. 4, 5, and 6. FIG. First, the process of the flowchart shown in FIG. 4 is started. The processing in step 1501 corresponds to step S2 described above, and the built-in random number generator 208 generates a random number W. It is assumed that W is smaller than N and is relatively prime to N. In RSA cryptography, N is a product of large prime numbers P and Q (both have a bit length approximately half that of N), so if W is smaller than the smaller of P and Q, it is certain. Are prime to each other. Here, W is set to 32 bits or less in consideration of high-speed processing. The present invention is not limited to 32 bits, and other values such as 64 bits, 16 bits, and 8 bits can be adopted.
Here, for the RSA encryption process, Y0, Y1, Y2, and Y3 used in the operation corresponding to step S5 are calculated as follows using a coprocessor 202 having registers A and B as a pre-process.
In step 1502,
M = W ^ (-1) mod N
Is calculated. This calculation is performed by using an extended Euclidean algorithm (see, for example, page 67 (Algorithm 2.107) of Document 3). The calculation for obtaining M is mathematically an indefinite equation (Diofontas equation) M * W−H * N = 1
Is equivalent to finding M.
At this time, since W is 32 bits and is much smaller than the number of bits of N (1024 bits), the first step in the extended Euclidean algorithm algorithm, that is, the stage where N is divided by W is performed. , N divided by W becomes 32 bits or less. Therefore, if the first step can be executed at high speed, the subsequent processing is light. As is well known, a method for speeding up the first step is a separation method (Non Restoring Method), which is adopted in this embodiment. In this method, subtraction, which is an intermediate process of division, is calculated regardless of whether it is positive or negative, and finally the value is adjusted.
Next, in step 1503,
W ^ (-3) mod N = M ^ 3 mod N
Is calculated. Specifically, M is stored in the A register, and the coprocessor 202 is used.
A * A mod N
And then stores M in the B register and the coprocessor 202
A * B mod N
Is executed, W (−3) mod N is stored in the A register. This is subsequently transferred to the RAM area of the data storage unit 206. This is Y0 in step 1504.
Next, Y0 is stored in the B register, and A * B mod N is executed, so that Y1 = Y * W ^ (− 3) mod N in the A register.
The value of is stored. This value is transferred to the RAM area (an area not overlapping with Y0).
Next, by executing A * B mod N again,
Y2 = Y ^ 2 * W ^ (-3) mod N
Is stored. This value is transferred to the RAM area (not overlapping with Y0 and Y1).
Next, by executing A * B mod N again,
Y3 = Y ^ 3 mod N
Is stored. This value is transferred to the RAM area (not overlapping Y0, Y1, Y2). As a result, the processing in step 1504 is completed, and all the values of Y0 to Y3 are obtained.
The processing in step 1505 initializes the counter to k = 512, and corresponds to step S1.
Next, in step 1506, the random number W is stored in the A register (corresponding to step S3). Then, the process proceeds to FIG.
In step 1601, first, it is checked whether or not the value of the counter k is 0 (corresponding to step S6). If k is not 0, the value of the A register is raised to the fourth power by steps 1602 and 1603 corresponding to step S4.
Next, in steps 1604, 1605, 1606, 1607, one of Y0 to Y3 is selected according to the value of the 2-bit block X [k] of the index X. In steps 1608, 1609, 1610, 1611, This is transferred to the B register. Subsequently, in step 1612 A * B mod N is calculated. Steps 1604 to 1612 correspond to step S5.
Next, 1 is subtracted from k (step 1613 corresponding to step S6). Then, the process returns to step 1601 and the same process is continued until the value of the counter k becomes zero. When the value of the counter k becomes 0, the process proceeds to FIG.
The process in FIG. 6 is a correction process corresponding to step S7, where M is stored in the B register (step 1701), A * B mod N is calculated, and the result is stored in the A register (step 1702). .
This process
Y ^ X * W * M mod N
= Y ^ X * W * W ^ (-1) mod N
= Y ^ X mod N
Thus, a desired result is obtained.
In the process shown in FIG. 5, since random numbers are multiplied by all data, it is difficult to extract secret information from the outside based on the power consumption of the IC chip. Further, in the course of the process shown in FIG. 6, there is no need for a heavy correction process of multiplying by W ^ (− X), which has been conventionally performed, so that the process is not enlarged and the process is speeded up. Is done. Although the case where the data length is 1024 bits has been dealt with here, it goes without saying that processing can be similarly performed in other cases.
Next, as a second embodiment, processing for elliptic curve cryptography will be taken up. Prior to explanation, elliptic curve cryptography will be described.
The elliptic curve represents (curve E) Y ^ 2 = a * X ^ 3 + b * X + c
A special element O called a point at infinity is added to a cubic curve having a standard form of However, (curve E) is selected so that it is non-singular, that is, the right side has no multiple roots. Here, a, b, and c are constants and are elements of the finite field F. X and Y are also elements of F, but these are variables.
A finite field is an algebraic system consisting of a finite number of elements and capable of four arithmetic operations. The simplest finite field is a prime field GF (P). Here, P is a prime number, and GF (P) is set as
GF (P) = {0, 1, 2,..., P-1}
It is.
The four arithmetic operations in GF (P) are
(Sum) A + B mod P
(Difference) A-B mod P
(Product) A * B mod P
(Quotient) A * B ^ (-1) mod P
It is. In the definition of (quotient), B is not 0.
Taking an irreducible nth-order polynomial Φ (Z) for a set consisting of all of the n-1th and lower order polynomials of Z having coefficients of elements of GF (P),
(Sum) A (Z) + B (Z) mod Φ (Z)
(Difference) A (Z) -B (Z) mod Φ (Z)
(Product) A (Z) * B (Z) mod Φ (Z)
(Quotient) A (Z) * B (Z) ^ (-1) mod Φ (Z)
The field that defines the four arithmetic operations is also a field, and its algebraic structure does not depend on how to select Φ (Z). This is called an nth-order extension of GF (P). In cryptographic processing, a prime field GF (P) and a characteristic 2 Galois field GF (2 ^ n) are often used from the standpoint of reducing the amount of calculation.
Taking two points R and S of (curve E), one straight line passing through R and S is determined (when R = S, a tangent is taken). Since (curve E) is a cubic curve, it always intersects at another point except when the straight line passing through R and S is parallel to the Y axis. Let this point be T, and the point at a symmetrical position with respect to the T and X axes is the sum of R and S.
R + S
It is written. When a straight line passing through R and S is parallel to the Y axis, R + S is assumed to be an infinite point O. A point V where R + V = O is called an inverse element of R and is represented by -R. Under such rules, the entire point of (curve E) constitutes an algebraic system called a commutative group, that is, a Mordell-Weil group of E.
The calculation of the sum on the elliptic curve is achieved by four arithmetic operations of X and Y [for example, Reference 6: "Introduction to Elliptic Curve Theory" published by Springer Fairlark Tokyo Publishing Company in 1994 (by JH Silverman and Tate) See Tsuneo Adachi et al.)].
In this embodiment, the operation # is
R # S = R + S (sum on elliptic curve E)
It is configured by defining Here, an elliptic curve defined on the prime field GF (P) is considered.
Elliptic curve cryptography is a scalar multiplication mR (m is an integer, P is an E point)
This is done by calculating The target of the attacker is an integer m. Assume that m is 160 bits, and processing is performed by an addition chain method in units of 2 bits. Hereinafter, X obtained by dividing X from the upper 2 bits is expressed as m = (m [80] m [79]... M [1]).
Also in this embodiment, as in the first embodiment, the random number generator 208 built in the IC chip is used and the coprocessor 202 for calculating A * B mod N is used. The coprocessor 202 can calculate the product and quotient on GF (P). The CPU 201 can easily process the sum and difference. Specifically, the operation
R1 (X1, Y1), R2 (X2, Y2)
Whereas
R1 + R2 = (X3, Y3)
Then,
X3 = H ^ 2-X1-X2 mod P
Y3 =-(H * X3 + Y2-H * X2) mod P
H = (Y2-Y1) * (X2-X1) ^ (-1) mod P
Can be written.
The present embodiment will be described with reference to FIGS. 7, 8, and 9. FIG. First, the process of FIG. 7 is started. In the process of Step 1801, the random number generator 208 generates random numbers W1 and W2. Let W = (W1, W2).
Next, in step 1802,
-W = (W1, P-W2)
Is calculated. The value of the calculation result is transferred to the RAM area of the data storage unit 206.
Next, in step 1803, -3W is calculated. This value is transferred to the RAM area (an area that does not overlap with -W).
In step 1804, the same process as in the RSA cipher is performed with the sum on the elliptic curve instead of the remainder multiplication.
R0 = 3W
R1 = R-3W
R2 = 2R-3W
R3 = 3R-3W
And a table storing these is created. These values are all arranged so as not to overlap each other.
The processing in step 1805 is to initialize the counter to k = 80.
Next, W is stored in the area S on the RAM (step 1806), and the process proceeds to FIG.
In step 1901, first, it is checked whether or not the value of the counter k is zero. If k is not 0, the 4th point of S is calculated in steps 1902 and 1903.
Next, in steps 1904, 1905, 1906 and 1907, one of R0 to R3 is selected according to the value of the 2-bit block m [k] of m, and in steps 1908, 1909, 1910 and 1911, S + (Any of R0 to R3) is calculated.
Next, 1 is subtracted from k (step 1912). Then, the process again proceeds to step 1901 and the same process is continued until the value of the counter k becomes zero.
When the value of the counter k becomes 0, the processing moves to the processing shown in FIG.
The process shown in FIG. 9 is a correction process, SW is calculated, and the resulting value is stored in the S register (step 2001).
This process
mR + W-W = mR
Thus, a desired result is obtained.
In the process up to FIG. 9, since random numbers are added to all data, it is difficult to extract secret information from the outside based on the power consumption of the IC chip. Furthermore, in the course of the process shown in FIG. 9, there is no need for a heavy correction process of multiplying W ^ (-X), which has been performed in the prior art. Is done.
The two embodiments described above are essentially obtained by simply replacing the meaning of the operation #, and needless to say, it can be generalized.
According to the present invention, it is possible to provide a tamper resistant information processing apparatus such as an IC card that can maintain high security without enlarging processing.

本願発明は、ICカードやGSMモバイルホンなどで用いられるICチップが有する情報を安全に守るために利用される。  The present invention is used to safely protect information held in an IC chip used in an IC card, a GSM mobile phone, or the like.

Claims (11)

信号を入力する信号入力部と、処理プログラムを格納すると共に、処理中のデータを格納する格納部と、乱数の信号を発生する乱数発生装置と、上記処理プログラムに従って、上記信号入力部より入力された信号に対して所定のデータ処理を行なう演算部と、処理結果の信号を出力する信号出力部とを有し、
前記格納部に格納された処理プログラムは、所望の演算を#で表したときの信号Aと信号Bとを以って行なう演算A#Bに関わり、与えられた整数列X[h],X[h−1],…,X[k],…,X[1](但し、hは整数)を対象にするプログラムであり、
該処理プログラムは、上記演算部に、
k=hとする第1の手順と、
前記乱数発生装置が発生する乱数の信号に基づいて信号Wを定める第2の手順と、
L=Wとして、Lの格納部にWを格納する第3の手順と、
L#Lを計算し、再びLの格納部に書き戻す操作をJ回(但し、Jは負でない整数)実行する第4の手順と、
X[k]とWに基づいて一意的に決まる信号B[k]#W^((2^J)−1)に対して、L#B[k]#W^((2^J)−1)を計算し、再びLの格納部に書き戻す操作を実行する第5の手順と、
kから1を減ずる第6の手順と、
k>0ならば第4の手順に戻り、k=0であれば処理結果Tを出力する第7の手順と、
上記処理結果Tに対して、T#W^(−1)を出力結果Sとする第8の手順とを実行させることを特徴とする情報処理装置。
A signal input unit for inputting a signal, a storage unit for storing a processing program, a storage unit for storing data being processed, a random number generator for generating a random number signal, and the signal input unit according to the processing program A calculation unit that performs predetermined data processing on the received signal, and a signal output unit that outputs a signal of the processing result,
The processing program stored in the storage unit is related to the operation A # B performed with the signal A and the signal B when the desired operation is represented by #, and given integer sequences X [h], X [H-1], ..., X [k], ..., X [1] (where h is an integer),
The processing program is stored in the arithmetic unit.
a first procedure for k = h;
A second procedure for determining a signal W based on a random number signal generated by the random number generator;
A third procedure for storing W in the storage unit of L, where L = W;
A fourth step of calculating L # L and writing back to the storage unit of L again J times (where J is a non-negative integer);
For a signal B [k] #W ^ ((2 ^ J) -1) uniquely determined based on X [k] and W, L # B [k] #W ^ ((2 ^ J)- 5) to calculate 1) and execute the operation of writing back to the storage unit of L again;
a sixth procedure for subtracting 1 from k;
If k> 0, the process returns to the fourth procedure, and if k = 0, the seventh procedure for outputting the processing result T;
An information processing apparatus that causes the processing result T to execute an eighth procedure in which T # W ^ (-1) is an output result S.
上記演算A#Bが剰余乗算の整数演算#である、
A#B=A*B mod N
であり、上記WがNと互いに素な整数であることを特徴とする請求の範囲第1項に記載の情報処理装置。
The operation A # B is an integer operation # of remainder multiplication.
A # B = A * B mod N
The information processing apparatus according to claim 1, wherein W is an integer that is relatively prime to N.
上記演算部は、中央処理装置とコプロセッサからなり、該コプロセッサが上記演算A*B mod Nを実行することを特徴とする請求の範囲第2項に記載の情報処理装置。3. The information processing apparatus according to claim 2, wherein the calculation unit includes a central processing unit and a coprocessor, and the coprocessor executes the calculation A * B mod N. 上記Wのビット数が8,16,32,64のいずれかであることを特徴とする請求の範囲第2項に記載の情報処理装置。The information processing apparatus according to claim 2, wherein the number of bits of W is 8, 16, 32, or 64. 上記演算A#Bが有限体上で定義された代数曲線E上のモーデル・ヴェイユ群の和演算であることを特徴とする請求の範囲第1項に記載の情報処理装置。2. The information processing apparatus according to claim 1, wherein the operation A # B is a sum operation of a Mordell-Weil group on an algebraic curve E defined on a finite field. 上記モーデル・ヴェイユ群による有限群が素体GF(P)(Pは素数)であることを特徴とする請求の範囲第5項に記載の情報処理装置。6. The information processing apparatus according to claim 5, wherein the finite group by the Model-Weil group is a prime field GF (P) (P is a prime number). 上記モーデル・ヴェイユ群による有限群がガロア標数2のガロア体GF(2^n)(nは正の整数)であることを特徴とする請求の範囲第5項に記載の情報処理装置。6. The information processing apparatus according to claim 5, wherein the finite group by the Model-Weil group is a Galois field GF (2 ^ n) (n is a positive integer) having a Galois characteristic 2. 請求の範囲第2項に記載の情報処理装置を実装してなることを特徴とするICカード。An IC card comprising the information processing apparatus according to claim 2 mounted thereon. 請求の範囲第5項に記載の情報処理装置を実装してなることを特徴とするICカード。An IC card comprising the information processing apparatus according to claim 5 mounted thereon. GSMモバイルホンにおけるSIMモジュールあって、請求の範囲第2項に記載の情報処理装置を実装してなることを特徴とするSIMモジュール。A SIM module in a GSM mobile phone, wherein the information processing device according to claim 2 is mounted. GSMモバイルホンにおけるSIMモジュールであって、請求の範囲第5項に記載の情報処理装置を実装してなることを特徴とするSIMモジュール。A SIM module in a GSM mobile phone, wherein the information processing apparatus according to claim 5 is mounted.
JP2004553095A 2002-11-15 2002-11-15 Tamper resistant information processing apparatus and IC card and SIM module using the same Expired - Fee Related JP4381987B2 (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2002/011911 WO2004047052A1 (en) 2002-11-15 2002-11-15 Tamper-resistant information processor

Publications (2)

Publication Number Publication Date
JPWO2004047052A1 true JPWO2004047052A1 (en) 2006-03-23
JP4381987B2 JP4381987B2 (en) 2009-12-09

Family

ID=32321474

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004553095A Expired - Fee Related JP4381987B2 (en) 2002-11-15 2002-11-15 Tamper resistant information processing apparatus and IC card and SIM module using the same

Country Status (2)

Country Link
JP (1) JP4381987B2 (en)
WO (1) WO2004047052A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007116215A (en) * 2005-10-18 2007-05-10 Fuji Electric Holdings Co Ltd Tamper-resistant module device

Also Published As

Publication number Publication date
JP4381987B2 (en) 2009-12-09
WO2004047052A1 (en) 2004-06-03

Similar Documents

Publication Publication Date Title
JP4199937B2 (en) Anti-tamper encryption method
JP3926532B2 (en) Information processing apparatus, information processing method, and card member
EP1248409B1 (en) Attack-resistant cryptographic method and apparatus
US5414772A (en) System for improving the digital signature algorithm
KR20170098731A (en) Method of protecting a circuit against a side-channel analysis
CN100356342C (en) Information processing unit
EP1073021A2 (en) Information processing apparatus, card and information processing system
US8291223B2 (en) Arithmetic circuit for montgomery multiplication and encryption circuit
Dhem et al. Hardware and software symbiosis helps smart card evolution
RU2276465C2 (en) Cryptographic method and chip-card for realization of said method (variants)
US8321691B2 (en) EMA protection of a calculation by an electronic circuit
US20020124179A1 (en) Fault detection method
US20040247114A1 (en) Universal calculation method applied to points on an elliptical curve
US8065735B2 (en) Method of securing a calculation of an exponentiation or a multiplication by a scalar in an electronic device
KR101025421B1 (en) Smart card system for defending electromagnetic analysis attack in smart card system
US11502836B2 (en) Method for performing cryptographic operations on data in a processing device, corresponding processing device and computer program product
JP2004126841A (en) Method for mounting program
EP1501236B1 (en) Error correction for cryptographic keys
JP4381987B2 (en) Tamper resistant information processing apparatus and IC card and SIM module using the same
JP2008525834A (en) A secure and compact power method for cryptography
JPWO2005027403A1 (en) Information processing equipment
MXPA02006801A (en) Modular exponential algorithm in an electronic component using a public key encryption algorithm.
US20060056619A1 (en) Method for universal calculation applied to points of an elliptic curve
EP4372548A1 (en) Protecting cryptographic operations againt horizontal side-channel analysis attacks
EP1802024A2 (en) Balanced cryptographic computational method and apparatus for leak minimization in smartcards and other cryptosystems

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090526

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090723

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20090825

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090916

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121002

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121002

Year of fee payment: 3

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121002

Year of fee payment: 3

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131002

Year of fee payment: 4

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees