JP6119345B2 - IC chip, IC card, verification processing method, and verification processing program - Google Patents

IC chip, IC card, verification processing method, and verification processing program Download PDF

Info

Publication number
JP6119345B2
JP6119345B2 JP2013058096A JP2013058096A JP6119345B2 JP 6119345 B2 JP6119345 B2 JP 6119345B2 JP 2013058096 A JP2013058096 A JP 2013058096A JP 2013058096 A JP2013058096 A JP 2013058096A JP 6119345 B2 JP6119345 B2 JP 6119345B2
Authority
JP
Japan
Prior art keywords
verification
area
processing
command
command processing
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
JP2013058096A
Other languages
Japanese (ja)
Other versions
JP2014182725A5 (en
JP2014182725A (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.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing Co 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 Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP2013058096A priority Critical patent/JP6119345B2/en
Publication of JP2014182725A publication Critical patent/JP2014182725A/en
Publication of JP2014182725A5 publication Critical patent/JP2014182725A5/en
Application granted granted Critical
Publication of JP6119345B2 publication Critical patent/JP6119345B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、外部からの攻撃による誤動作を検知することが可能なICチップの技術に関する。   The present invention relates to an IC chip technology capable of detecting a malfunction caused by an attack from the outside.

従来から、動作中のICチップに外乱を加えることでICチップの誤動作を促し、ICチップに誤った演算結果を応答させたり、ICチップが意図しない情報を外部に出力させる攻撃手法(FA:Fault Analysis)が知られている。上記外乱には、例えば、電源端子、接地端子、又はクロック端子への予期せぬ異常な電圧変化、チップ表面又は裏面への強い光の照射、ICチップ近傍での強い磁界の発生などが挙げられる。このような攻撃に対抗する対策として、CPU(ALUやレジスタなど)、メモリ、周辺回路(暗号演算器やタイマなど)といった各機能群に冗長な情報を持たせて適度なタイミングでその妥当性を検証することが効果的とされている。   Conventionally, an attack technique (FA: Fault) that causes a malfunction of the IC chip by applying a disturbance to the IC chip in operation, causes the IC chip to respond with an erroneous calculation result, or outputs information unintended by the IC chip to the outside. Analysis) is known. Examples of the disturbance include an unexpected abnormal voltage change to the power supply terminal, the ground terminal, or the clock terminal, irradiation of strong light to the front or back surface of the chip, generation of a strong magnetic field in the vicinity of the IC chip, and the like. . As countermeasures against such attacks, each function group such as CPU (ALU, registers, etc.), memory, peripheral circuits (cryptographic calculators, timers, etc.) is given redundant information and its validity is set at an appropriate timing. It is considered effective to verify.

例えば、特許文献1には、内部データを、互いにビット反転した関係にある正表現データと負表現データの表現形式を持つようにし、それらの表現形式で演算する演算装置を並列に動作させ、それぞれの表現形式の演算装置の出力結果が、ビット反転した関係を保っているかを検証するICチップが開示されている。   For example, in Patent Document 1, internal data has a representation format of positive representation data and negative representation data in a bit-inverted relationship with each other, and arithmetic units that operate in these representation formats are operated in parallel. An IC chip for verifying whether the output result of the arithmetic device of the expression format maintains a bit-inverted relationship is disclosed.

しかし、各機能群の内部で発生する誤動作を検証する機能を有するICチップが多く知られているが、例えば、各機能群をつなぐバス(データ用、番地用)にのる情報の改ざんを検知するには、検証に必要な冗長情報用にも配線を要することから、攻撃に対抗する対策を講じたICチップは多くない。   However, there are many known IC chips that have the function of verifying malfunctions that occur inside each function group. For example, detection of falsification of information on the bus (for data and address) that connects each function group is detected. Therefore, since wiring is also required for redundant information necessary for verification, there are not many IC chips that have taken countermeasures against attacks.

国際公開WO2005−027403号International Publication No. WO2005-027403

ところで、ICチップへの攻撃者は、ICチップの脆弱な箇所を見出すため、外乱を加える物理的な場所やタイミングを変えながら繰り返し試行することが想定される。従来、このような繰り返しの攻撃に対する耐性を、ソフトウェア的にICチップで高めることができる技術は知られていなかった。   By the way, it is assumed that an attacker to the IC chip tries repeatedly while changing the physical location and timing at which the disturbance is applied in order to find a vulnerable portion of the IC chip. Conventionally, no technology has been known that can increase the resistance to such repeated attacks with an IC chip in terms of software.

そこで、本発明は、繰り返しの攻撃に対する耐性をソフトウェア的に高めることが可能なICチップ、検証処理方法、及び検証処理プログラムを提供することを目的とする。   Therefore, an object of the present invention is to provide an IC chip, a verification processing method, and a verification processing program that can increase resistance to repeated attacks in software.

上記課題を解決するために、請求項1に記載の発明は、データを記憶する記憶手段と、外部から受信されたコマンドに対応したコマンド処理を実行するコマンド処理手段と、前記コマンド処理において用いられるプログラムにより要求された大きさの領域を前記記憶手段に割り当てる割当手段と、前記コマンド処理とは関係しない検証処理であって、前記記憶手段に割り当てられた領域に書き込まれた検証用データを読み出して検証する検証処理を定期または不定期のタイミングで繰り返し実行する検証処理手段と、を備え、前記割当手段は、前記プログラムにより要求された大きさの領域に加えて前記検証用データの書き込みに必要な大きさの領域を前記記憶手段に割り当てることを特徴とする。 In order to solve the above-mentioned problem, the invention described in claim 1 is used in the command processing, storage means for storing data, command processing means for executing command processing corresponding to a command received from the outside, and the command processing. An allocation unit that allocates an area of a size requested by the program to the storage unit, and a verification process that is not related to the command process, and that reads the verification data written in the area allocated to the storage unit Verification processing means for repeatedly executing verification processing to be verified at regular or irregular timing, and the allocation means is necessary for writing the verification data in addition to the area of the size requested by the program A region having a size is allocated to the storage means .

請求項2に記載の発明は、請求項1に記載のICチップにおいて、前記検証処理手段は、前記記憶手段に割り当てられた領域に対して前記検証用データの書き込み及び読み出しを繰り返し実行することを特徴とする。   According to a second aspect of the present invention, in the IC chip according to the first aspect, the verification processing unit repeatedly executes writing and reading of the verification data with respect to an area allocated to the storage unit. Features.

請求項3に記載の発明は、請求項1または請求項2に記載のICチップにおいて、前記記憶手段に割り当てられた領域は複数存在し、前記検証処理手段は、複数の前記領域の中から、前記検証用データを書き込む領域を無作為に選択することを特徴とする。   According to a third aspect of the present invention, in the IC chip according to the first or second aspect, there are a plurality of areas allocated to the storage unit, and the verification processing unit includes the plurality of areas. A region in which the verification data is written is selected at random.

請求項4に記載の発明は、請求項1乃至3の何れか一項に記載のICチップにおいて、前記コマンド処理では、前記コマンド処理において用いられるプログラムを構成する命令コードが読み出されるフェッチ処理が複数回実行され、前記検証処理手段は、前記フェッチ処理間で前記検証処理を実行することを特徴とする。   According to a fourth aspect of the present invention, in the IC chip according to any one of the first to third aspects, the command processing includes a plurality of fetch processing in which instruction codes constituting a program used in the command processing are read out. The verification processing means executes the verification processing between the fetch processing.

請求項5に記載の発明は、請求項1乃至3の何れか一項に記載のICチップにおいて、前記検証処理手段は、タイマカウンタのタイムアウトに応じて前記検証処理を実行することを特徴とする。   According to a fifth aspect of the present invention, in the IC chip according to any one of the first to third aspects, the verification processing unit executes the verification processing in response to a timeout of a timer counter. .

請求項6に記載の発明は、請求項1乃至5の何れか一項に記載のICチップにおいて、前記ICチップは、前記コマンド処理において用いられるプログラムにより要求された大きさの領域を前記記憶手段に割り当てる割当手段を更に備え、前記割当手段は、前記プログラムにより要求された大きさの領域に加えて前記検証用データの書き込みに必要な大きさの領域を前記記憶手段に割り当てることを特徴とする。   According to a sixth aspect of the present invention, in the IC chip according to any one of the first to fifth aspects, the IC chip stores an area having a size requested by a program used in the command processing. Allocating means for allocating to the storage means, the allocating means allocating an area of a size required for writing the verification data to the storage means in addition to the area of the size requested by the program. .

請求項に記載のICカードの発明は、データを記憶する記憶手段と、外部から受信されたコマンドに対応したコマンド処理を実行するコマンド処理手段と、前記コマンド処理において用いられるプログラムにより要求された大きさの領域を前記記憶手段に割り当てる割当手段と、前記コマンド処理とは関係しない検証処理であって、前記記憶手段に割り当てられた領域に書き込まれた検証用データを読み出して検証する検証処理を定期または不定期のタイミングで繰り返し実行する検証処理手段と、を備え、前記割当手段は、前記プログラムにより要求された大きさの領域に加えて前記検証用データの書き込みに必要な大きさの領域を前記記憶手段に割り当てることを特徴とする。請求項に記載の発明は、データを記憶する記憶手段を備えるICチップにより実行される検証処理方法であって、外部から受信されたコマンドに対応したコマンド処理を実行するステップと、前記コマンド処理において用いられるプログラムにより要求された大きさの領域を前記記憶手段に割り当てる割当ステップと、前記コマンド処理とは関係しない検証処理であって、前記記憶手段に割り当てられた領域に書き込まれた検証用データを読み出して検証する検証処理を定期または不定期のタイミングで繰り返し実行するステップと、を含み、前記割当ステップにおいては、前記プログラムにより要求された大きさの領域に加えて前記検証用データの書き込みに必要な大きさの領域を前記記憶手段に割り当てることを特徴とする。 The invention of the IC card according to claim 6 is requested by a storage means for storing data, a command processing means for executing command processing corresponding to a command received from the outside, and a program used in the command processing. An allocating unit for allocating an area of a size to the storage unit, and a verification process not related to the command process, the verification process for reading and verifying the verification data written in the area allocated to the storage unit Verification processing means that repeatedly executes at regular or irregular timings, and the allocation means includes an area of a size required for writing the verification data in addition to the area of the size requested by the program. It is allocated to the storage means . The invention according to claim 7 is a verification processing method executed by an IC chip having storage means for storing data, the command processing corresponding to a command received from the outside, and the command processing An allocation step of allocating an area of a size requested by the program used in the storage unit to the storage unit and a verification process not related to the command process, the verification data written in the area allocated to the storage unit and executing repeatedly at regular or irregular timing verification processing for verifying reads, only contains, in the assignment step, the writing of the verification data in addition to the region of the magnitude required by the program An area having a necessary size is allocated to the storage means .

請求項に記載の発明は、データを記憶する記憶手段を備えるICチップに含まれるコンピュータを、外部から受信されたコマンドに対応したコマンド処理を実行するコマンド処理手段、前記コマンド処理において用いられるプログラムにより要求された大きさの領域を前記記憶手段に割り当てる割当手段、及び前記コマンド処理とは関係しない検証処理であって、前記記憶手段に割り当てられた領域に書き込まれた検証用データを読み出して検証する検証処理を定期または不定期のタイミングで繰り返し実行する検証処理手段として機能させ、前記割当手段は、前記プログラムにより要求された大きさの領域に加えて前記検証用データの書き込みに必要な大きさの領域を前記記憶手段に割り当てることを特徴とする。 According to an eighth aspect of the present invention, there is provided command processing means for executing command processing corresponding to a command received from the outside, a computer included in an IC chip having storage means for storing data, and a program used in the command processing An allocation unit that allocates an area having a size requested by the storage unit to the storage unit, and a verification process that is not related to the command processing, wherein the verification data written in the area allocated to the storage unit is read and verified The verification process is performed as a verification processing unit that repeatedly executes the verification process at regular or irregular timings, and the allocation unit has a size required for writing the verification data in addition to the area of the size requested by the program. Are allocated to the storage means .

本発明によれば、検証処理手段は、コマンド処理とは関係しない検証処理であって、記憶手段に割り当てられた領域に書き込まれた検証用データを読み出して検証する検証処理を定期または不定期のタイミングで繰り返し実行するように構成したので、繰り返しの攻撃に対する耐性をソフトウェア的に高めることができる。   According to the present invention, the verification processing unit is a verification process not related to the command process, and performs the verification process for reading and verifying the verification data written in the area allocated to the storage unit periodically or irregularly. Since it is configured to repeatedly execute at the timing, it is possible to increase resistance to repeated attacks in terms of software.

ICカード1の概要構成例を示す図である。1 is a diagram illustrating a schematic configuration example of an IC card 1. FIG. (A)は、検証用領域が特定の領域の場合のメモリマップ例を示す図である。(B)は、検証用領域が不特定の領域の場合のメモリマップ例を示す図である。(C)は、検証用領域が不特定の領域の場合のメモリマップの別の例を示す図である。(A) is a figure which shows the example of a memory map in case a verification area | region is a specific area | region. (B) is a diagram showing an example of a memory map when the verification area is an unspecified area. (C) is a diagram showing another example of the memory map when the verification area is an unspecified area. 検証処理が定期のタイミングで繰り返し実行される様子を示す図である。It is a figure which shows a mode that a verification process is repeatedly performed at a regular timing. 検証処理が不定期のタイミングで繰り返し実行される様子を示す図である。It is a figure which shows a mode that a verification process is repeatedly performed at irregular timing.

以下、図面を参照して本発明の実施形態について詳細に説明する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

図1は、ICカード1の概要構成例を示す図である。なお、ICカード1は、キャッシュカード、クレージットカード、社員カード等として使用される。或いは、ICカード1は、スマートフォンや携帯電話機等に組み込まれる。   FIG. 1 is a diagram illustrating a schematic configuration example of the IC card 1. The IC card 1 is used as a cash card, a credit card, an employee card, or the like. Alternatively, the IC card 1 is incorporated into a smartphone, a mobile phone, or the like.

図1に示すように、ICカード1には、ICチップ1aが搭載されている。ICチップ1aは、CPU(Central Processing Unit)10、ROM(Read Only Memory)11、RAM(Random Access Memory)12、フラッシュメモリ13、タイマ14、及びI/O回路15を備えて構成される。なお、フラッシュメモリの代わりにEEPROMであっても構わない。ICチップ1aは、I/O回路15を介して、ICリーダ・ライタを備える外部端末2との間で接触または非接触で通信を行う。I/O回路15は、外部端末2とのインターフェイスを担う。I/O回路15には、例えばISO/IEC7816によって定められたC1〜C8の8個の端子が設けられている。例えば、C1端子は電源端子、C2端子はリセット端子、C3端子はクロック端子、C5端子はグランド端子、C7端子は外部端末2とのデータ通信を行う端子である。外部端末2の例としてはATM、改札機、認証用ゲート等が挙げられる。或いは、ICカード1が携帯端末に搭載される場合、外部端末2には携帯端末の機能を担うコントローラが該当する。   As shown in FIG. 1, an IC chip 1 a is mounted on the IC card 1. The IC chip 1a includes a CPU (Central Processing Unit) 10, a ROM (Read Only Memory) 11, a RAM (Random Access Memory) 12, a flash memory 13, a timer 14, and an I / O circuit 15. Note that an EEPROM may be used instead of the flash memory. The IC chip 1a communicates with or without contact with the external terminal 2 including the IC reader / writer via the I / O circuit 15. The I / O circuit 15 serves as an interface with the external terminal 2. The I / O circuit 15 is provided with eight terminals C1 to C8 defined by, for example, ISO / IEC7816. For example, the C1 terminal is a power supply terminal, the C2 terminal is a reset terminal, the C3 terminal is a clock terminal, the C5 terminal is a ground terminal, and the C7 terminal is a terminal that performs data communication with the external terminal 2. Examples of the external terminal 2 include an ATM, a ticket gate, and an authentication gate. Alternatively, when the IC card 1 is mounted on a mobile terminal, the external terminal 2 corresponds to a controller that performs the function of the mobile terminal.

CPU10は、ROM(Read Only Memory)11、フラッシュメモリ13またはRAM12に記憶された各種プログラムを実行する演算装置である。RAM12は、データを一時的に記憶する揮発性メモリである。ROM11は書き換え不可能なメモリであり、OS(Operating System)、本発明の検証処理プログラム、及びJAVA(登録商標)等のプログラム言語で記述されるアプリケーションプログラムを記憶する。フラッシュメモリ13は、不揮発性メモリであり、ROMを代替することができる程の大きさを持ったICチップではOS、本発明の検証処理プログラム、及びJAVA(登録商標)等のプログラム言語で記述されるアプリケーションプログラムの全部または一部を記憶することもある。タイマ14は、CPU10に供給されるクロック信号を入力とし、クロック信号の回数をタイマカウンタによりカウントする。そして、タイマ14は、事前に指定した値までカウントすると、タイマカウンタのタイムアウトとなり、事前に指定しておいたプログラムを実行し、初期状態にリセットされ、改めてカウントし始める。なお、タイマ14は、ソフトウェアにより構成されてもよいし、ハードウェアにより構成されてもよい。   The CPU 10 is an arithmetic unit that executes various programs stored in a ROM (Read Only Memory) 11, a flash memory 13, or a RAM 12. The RAM 12 is a volatile memory that temporarily stores data. The ROM 11 is a non-rewritable memory, and stores an OS (Operating System), a verification processing program of the present invention, and an application program described in a program language such as JAVA (registered trademark). The flash memory 13 is a non-volatile memory, and is written in a program language such as an OS, a verification processing program of the present invention, and JAVA (registered trademark) in an IC chip having a size that can replace a ROM. In some cases, all or part of the application program is stored. The timer 14 receives a clock signal supplied to the CPU 10 and counts the number of clock signals by a timer counter. When the timer 14 counts up to a value designated in advance, the timer counter times out, executes the program designated in advance, is reset to the initial state, and starts counting again. Note that the timer 14 may be configured by software or hardware.

そして、CPU10は、本発明の検証処理プログラムにより、VM(バーチャルマシン、仮想計算機ともいう)101(コマンド処理手段の一例)、及び検証処理部102(検証処理手段の一例)として機能する。   The CPU 10 functions as a VM (also referred to as a virtual machine or virtual machine) 101 (an example of a command processing unit) and a verification processing unit 102 (an example of a verification processing unit) according to the verification processing program of the present invention.

VM101は、外部端末2から受信されたコマンド(命令)に対応したコマンド処理を実行する。このコマンド処理では、ROM11、またはフラッシュメモリ13に記憶された命令コード(コマンド処理において用いられるプログラムを構成するコード)が読み出されるフェッチ処理が複数回実行される。この命令コードは、アプリケーションプログラムを構成するバイトコードと呼ぶデータ列である。つまり、VM101は、コマンドに応じて、上記データ列をプログラムとして逐次実行する。   The VM 101 executes command processing corresponding to the command (instruction) received from the external terminal 2. In this command processing, fetch processing for reading out an instruction code (a code constituting a program used in command processing) stored in the ROM 11 or the flash memory 13 is executed a plurality of times. This instruction code is a data string called a byte code constituting the application program. That is, the VM 101 sequentially executes the data string as a program according to the command.

検証処理部102は、ROM11、フラッシュメモリ13またはRAM12に書いてある検証用データを読み出し、特定の値であることを検証する監視プログラム(監視PG)により構成される。検証用データはどのような値であってもよい。検証処理部102は、ROM11、フラッシュメモリ13またはRAM12に割り当てられた領域(以下、「検証用領域」という)に書き込まれた検証用データを読み出して検証する検証処理を定期または不定期のタイミングで繰り返し実行する。この検証処理は、コマンド処理とは関係しない処理、言い換えれば、コマンド処理とは独立して行われる処理である。検証処理部102は、検証用領域に対して検証用データの書き込み及び読み出しを繰り返し実行することが望ましい(繰り返しの攻撃に対する耐性をより高めることができるため)が、事前にフラッシュメモリ13またはRAM12に書いておいた検証用データを、繰り返し読み出して期待値(設定値)と比較することで検証としてもよい。或いは、検証用データを工場での製造工程中にROM11に書き込んでおき、その検証用データを繰り返し読み出して期待値と比較することで検証としてもよい。つまり、書き込み回数と読み出し回数との比は「1:1」であってもよいし、書き込み回数と読み出し回数との比は「n:m」(n≦m)であってもよい。   The verification processing unit 102 is configured by a monitoring program (monitoring PG) that reads verification data written in the ROM 11, the flash memory 13, or the RAM 12 and verifies that the data is a specific value. The verification data may be any value. The verification processing unit 102 performs verification processing for reading and verifying verification data written in an area allocated to the ROM 11, flash memory 13, or RAM 12 (hereinafter referred to as “verification area”) at regular or irregular timings. Run repeatedly. This verification process is a process not related to the command process, in other words, a process performed independently of the command process. Although it is desirable that the verification processing unit 102 repeatedly executes writing and reading of verification data to and from the verification area (because resistance against repeated attacks can be further improved), the verification processing unit 102 stores the verification data in the flash memory 13 or the RAM 12 in advance. The written verification data may be repeatedly read and compared with an expected value (set value) for verification. Alternatively, the verification data may be written in the ROM 11 during the manufacturing process in the factory, and the verification data may be repeatedly read out and compared with the expected value for verification. That is, the ratio between the number of times of writing and the number of times of reading may be “1: 1”, and the ratio between the number of times of writing and the number of times of reading may be “n: m” (n ≦ m).

このような検証処理において検証用領域から読み出された検証用データに係る値と期待値とが一致しない場合、異常が検知される。この場合、例えば、CPU10は、動作を停止してICリーダ・ライタへのレスポンス(応答)をロックするか、或いは、ICリーダ・ライタへエラーを応答する。或いは、CPU10は、レスポンスとは異なるダミーデータ(固定値または乱数)をICリーダ・ライタへ出力するように構成してもよい。   In such a verification process, if the value related to the verification data read from the verification area does not match the expected value, an abnormality is detected. In this case, for example, the CPU 10 stops the operation and locks the response to the IC reader / writer, or returns an error to the IC reader / writer. Alternatively, the CPU 10 may be configured to output dummy data (fixed value or random number) different from the response to the IC reader / writer.

ここで、検証用データが書き込まれる検証用領域について説明する。検証用領域には、特定の領域と、不特定の領域とがある。特定の領域とは、ROM11、フラッシュメモリ13またはRAM12に予め割り当てられた固定領域である。図2(A)は、検証用領域が特定の領域の場合のメモリマップ例を示す図である。図2(A)の例では、RAM12においてスタックとして利用できる領域(以下、「スタック用領域」という)のうちアプリケーションプログラムの実行状況に応じて未使用領域が、検証用領域として割り当てられる。   Here, a verification area in which verification data is written will be described. The verification area includes a specific area and an unspecified area. The specific area is a fixed area previously allocated to the ROM 11, the flash memory 13, or the RAM 12. FIG. 2A is a diagram showing an example of a memory map when the verification area is a specific area. In the example of FIG. 2A, an unused area is allocated as a verification area in accordance with the execution status of the application program in an area that can be used as a stack in the RAM 12 (hereinafter referred to as “stack area”).

一方、不特定の領域とは、OSによりフラッシュメモリ13またはRAM12に適宜、割り当てられる領域である。検証用領域を不特定の領域とすれば、攻撃者が外乱を加える物理的な場所を探すことを防ぐことができる。図2(B)は、検証用領域が不特定の領域の場合のメモリマップ例を示す図である。サブルーチンを呼び出すたびにスタックを消費するが、OSは、図2(B)に示すように、スタック用として必要な大きさより大きい(少なくとも検証で必要な大きさ以上)領域を余分に確保することで、余分に確保した領域を検証用領域として割り当てる。つまり、スタック用として必要な大きさの領域に加えて検証用データの書き込みに必要な大きさの検証用領域がRAM12に割り当てられる。   On the other hand, the unspecified area is an area appropriately allocated to the flash memory 13 or the RAM 12 by the OS. If the verification area is an unspecified area, it is possible to prevent an attacker from searching for a physical place to which disturbance is applied. FIG. 2B is a diagram showing an example of a memory map when the verification area is an unspecified area. Each time the subroutine is called, the stack is consumed. As shown in FIG. 2B, the OS secures an extra area larger than necessary for the stack (at least larger than necessary for verification). The extra reserved area is allocated as a verification area. That is, a verification area having a size required for writing verification data is allocated to the RAM 12 in addition to an area required for the stack.

また、図2(C)は、検証用領域が不特定の領域の場合のメモリマップの別の例を示す図である。OS(割当手段の一例)は、コマンド処理において用いられるアプリケーションプログラムがICチップ1aにインストールされるときに、当該アプリケーションプログラムにより要求された大きさの領域をフラッシュメモリ13またはRAM12に割り当てるが、このとき、割り当ての最小単位を数バイトとしておき、図2(C)に示すように、アプリケーションプログラムで必要な大きさの領域より大きい(少なくとも検証で必要な大きさ以上)領域を余分に確保することで、余分に確保した領域を検証用領域として割り当てる。つまり、アプリケーションプログラムにより要求された大きさの領域に加えて検証用データの書き込みに必要な大きさの検証用領域がフラッシュメモリ13またはRAM12に割り当てられる。このとき、余分に確保された余剰分の複数の検証用領域のアドレスを記述するリストが生成されるように構成してもよい(これは、アプリケーションプログラムの動作に悪影響を及ぼさないように、フラッシュメモリ13またはRAM12におけるOS管理領域を対象としてもよい)。この場合、検証処理部102は、上記検証処理において、上記生成されたリストから無作為でアドレスを選択(つまり、検証用データを書き込む検証用領域を例えば乱数で選択)することにより、検証用データを書き込む検証用領域を適宜変える(例えば、定期的に検証用領域を選択しなおす)ように構成してもよい。この構成によれば、攻撃者が外乱を加える物理的な場所を探すことをより一層防ぐことができる。   FIG. 2C is a diagram showing another example of the memory map when the verification area is an unspecified area. When an application program used in command processing is installed in the IC chip 1a, the OS (an example of an allocation unit) allocates an area having a size requested by the application program to the flash memory 13 or the RAM 12. The minimum unit of allocation is set to several bytes, and as shown in FIG. 2C, an area larger than the area required by the application program (at least larger than the size required for verification) is secured. The extra reserved area is allocated as a verification area. That is, in addition to the area requested by the application program, a verification area having a size necessary for writing verification data is allocated to the flash memory 13 or the RAM 12. At this time, a list describing the addresses of a plurality of extra verification areas that are reserved in excess may be generated (this is performed so that the operation of the application program is not adversely affected. The OS management area in the memory 13 or RAM 12 may be the target). In this case, in the verification process, the verification processing unit 102 randomly selects an address from the generated list (that is, selects a verification area in which the verification data is written with, for example, a random number), thereby verifying the verification data. It is also possible to configure such that the verification area for writing the data is appropriately changed (for example, the verification area is periodically reselected). According to this configuration, it is possible to further prevent an attacker from searching for a physical place where disturbance is applied.

次に、定期または不定期のタイミングで繰り返し実行される検証処理について説明する。図3は、検証処理が定期のタイミングで繰り返し実行される様子を示す図である。ここで、図3に示す「命令識別」は、ICリーダ・ライタから受けたコマンド(命令)が何であるかを識別し、どのバイトコード列を実行すべきか決定する処理である。また、図3に示す「MOV」(move)は、VM101が実行するバイトコードの一つであり、実行対象となるレジスタの値をメモリに書く、または実行対象となるレジスタに値をメモリから読むことを示す。また、図3に示す「INC」(increment)は、VM101が実行するバイトコードの一つであり、実行対象となるレジスタの値を加算することを示す。図3(A)では、検証処理部102は、タイマ14のタイマカウンタのタイムアウトに応じて(つまり、タイマ機能により定期的に割り込まれることにより)監視PGが呼び出されることで検証処理を実行している。この構成によれば、攻撃者が外乱を加えるタイミングを探すことを防ぐことができる。図3(B)では、検証処理部102は、フェッチ処理間で検証処理を実行している。この構成によれば、タイマに依存することなく、攻撃者が外乱を加えるタイミングを探すことを防ぐことができる。なお、図3(B)に示すように、バイトコードによって処理時間が変わるので不定期のようにも見えるが、毎回のフェッチ処理で検証処理が実行されるので、「定期のタイミング」ということができる。   Next, verification processing that is repeatedly executed at regular or irregular timing will be described. FIG. 3 is a diagram illustrating a state in which the verification process is repeatedly executed at regular timing. Here, “instruction identification” shown in FIG. 3 is processing for identifying what a command (instruction) is received from the IC reader / writer and determining which bytecode string is to be executed. Further, “MOV” (move) shown in FIG. 3 is one of byte codes executed by the VM 101, and the value of the register to be executed is written in the memory, or the value is read from the memory to the register to be executed. It shows that. “INC” (increment) shown in FIG. 3 is one of byte codes executed by the VM 101, and indicates that the value of the register to be executed is added. In FIG. 3A, the verification processing unit 102 executes the verification process by calling the monitoring PG in response to the timeout of the timer counter of the timer 14 (that is, by being periodically interrupted by the timer function). Yes. According to this configuration, it is possible to prevent an attacker from searching for the timing to apply a disturbance. In FIG. 3B, the verification processing unit 102 executes the verification process between fetch processes. According to this configuration, it is possible to prevent an attacker from searching for a timing for applying a disturbance without depending on the timer. As shown in FIG. 3B, the processing time varies depending on the bytecode, so it looks irregular, but the verification process is executed every fetch process, so the term “periodic timing” is used. it can.

一方、図4は、検証処理が不定期のタイミングで繰り返し実行される様子を示す図である。図4(A)では、検証処理部102は、タイマ14のタイマカウンタのタイムアウトに応じて監視PGが呼び出されるが、例えば乱数で実行可否を選択することで検証処理を実行せずに終了する場合もある。この構成によれば、攻撃者が外乱を加えるタイミングを探すことをより一層防ぐことに加え、検証処理による命令実行時間の軽減ができる。なお、タイマ14による場合、検証処理の中で、次のタイムアウトまでの時間を乱数で設定しても「不定期」の効果が得られる。また、図4(B)では、検証処理部102は、毎回のフェッチ処理で監視PGが呼び出されるが、例えば乱数で実行可否を選択することで検証処理を実行せずに終了する場合もある。この構成によれば、タイマに依存することなく、攻撃者が外乱を加えるタイミングを探すことをより一層防ぐことに加え、検証処理による命令実行時間の軽減ができる。   On the other hand, FIG. 4 is a diagram illustrating a state in which the verification process is repeatedly executed at irregular timing. In FIG. 4A, the verification processing unit 102 calls the monitoring PG in response to the timeout of the timer counter of the timer 14, but, for example, ends the execution without executing the verification process by selecting whether or not to execute with a random number. There is also. According to this configuration, in addition to further preventing the attacker from searching for the timing to apply the disturbance, the instruction execution time by the verification process can be reduced. In the case of using the timer 14, even if the time until the next timeout is set as a random number in the verification process, an “irregular” effect can be obtained. In FIG. 4B, the verification processing unit 102 calls the monitoring PG in each fetch process, but may end without executing the verification process, for example, by selecting whether or not to execute with a random number. According to this configuration, it is possible to reduce the instruction execution time by the verification process in addition to further preventing the attacker from searching for the timing to apply the disturbance without depending on the timer.

以上説明したように、上記実施形態によれば、検証処理部102は、コマンド処理とは関係しない検証処理であって、検証用領域に書き込まれた検証用データを読み出して検証する検証処理を定期または不定期のタイミングで繰り返し実行するように構成したので、繰り返しの攻撃に対する耐性をソフトウェア的に高めることができる。   As described above, according to the above-described embodiment, the verification processing unit 102 is a verification process not related to the command process, and periodically performs the verification process for reading and verifying the verification data written in the verification area. Alternatively, since it is configured to repeatedly execute at irregular timings, it is possible to increase resistance to repeated attacks in terms of software.

1 ICカード
2 外部端末
1a ICチップ
10 CPU
11 ROM
12 RAM
13 フラッシュメモリ
14 タイマ
15 I/O回路
101 VM
102 検証処理部
1 IC Card 2 External Terminal 1a IC Chip 10 CPU
11 ROM
12 RAM
13 Flash memory 14 Timer 15 I / O circuit 101 VM
102 Verification processing unit

Claims (8)

データを記憶する記憶手段と、
外部から受信されたコマンドに対応したコマンド処理を実行するコマンド処理手段と、
前記コマンド処理において用いられるプログラムにより要求された大きさの領域を前記記憶手段に割り当てる割当手段と、
前記コマンド処理とは関係しない検証処理であって、前記記憶手段に割り当てられた領域に書き込まれた検証用データを読み出して検証する検証処理を定期または不定期のタイミングで繰り返し実行する検証処理手段と、
を備え
前記割当手段は、前記プログラムにより要求された大きさの領域に加えて前記検証用データの書き込みに必要な大きさの領域を前記記憶手段に割り当てることを特徴とするICチップ。
Storage means for storing data;
Command processing means for executing command processing corresponding to a command received from outside;
An allocating unit that allocates an area having a size requested by the program used in the command processing to the storage unit;
Verification processing not related to the command processing, the verification processing means for repeatedly executing the verification processing for reading and verifying the verification data written in the area allocated to the storage means at regular or irregular timing; ,
Equipped with a,
2. The IC chip according to claim 1, wherein the allocating unit allocates an area having a size required for writing the verification data to the storage unit in addition to an area having a size requested by the program .
前記検証処理手段は、前記記憶手段に割り当てられた領域に対して前記検証用データの書き込み及び読み出しを繰り返し実行することを特徴とする請求項1に記載のICチップ。   2. The IC chip according to claim 1, wherein the verification processing unit repeatedly executes writing and reading of the verification data to and from an area allocated to the storage unit. 前記記憶手段に割り当てられた領域は複数存在し、
前記検証処理手段は、複数の前記領域の中から、前記検証用データを書き込む領域を無作為に選択することを特徴とする請求項1または請求項2に記載のICチップ。
There are a plurality of areas allocated to the storage means,
3. The IC chip according to claim 1, wherein the verification processing unit randomly selects an area in which the verification data is written from a plurality of the areas.
前記コマンド処理では、前記コマンド処理において用いられるプログラムを構成する命令コードが読み出されるフェッチ処理が複数回実行され、
前記検証処理手段は、前記フェッチ処理間で前記検証処理を実行することを特徴とする請求項1乃至3の何れか一項に記載のICチップ。
In the command processing, fetch processing for reading out an instruction code constituting a program used in the command processing is executed a plurality of times,
4. The IC chip according to claim 1, wherein the verification processing unit executes the verification process between the fetch processes. 5.
前記検証処理手段は、タイマカウンタのタイムアウトに応じて前記検証処理を実行することを特徴とする請求項1乃至3の何れか一項に記載のICチップ。   4. The IC chip according to claim 1, wherein the verification processing unit executes the verification processing according to a timeout of a timer counter. 5. データを記憶する記憶手段と、
外部から受信されたコマンドに対応したコマンド処理を実行するコマンド処理手段と、
前記コマンド処理において用いられるプログラムにより要求された大きさの領域を前記記憶手段に割り当てる割当手段と、
前記コマンド処理とは関係しない検証処理であって、前記記憶手段に割り当てられた領域に書き込まれた検証用データを読み出して検証する検証処理を定期または不定期のタイミングで繰り返し実行する検証処理手段と、
を備え
前記割当手段は、前記プログラムにより要求された大きさの領域に加えて前記検証用データの書き込みに必要な大きさの領域を前記記憶手段に割り当てることを特徴とするICカード。
Storage means for storing data;
Command processing means for executing command processing corresponding to a command received from outside;
An allocating unit that allocates an area having a size requested by the program used in the command processing to the storage unit;
Verification processing not related to the command processing, the verification processing means for repeatedly executing the verification processing for reading and verifying the verification data written in the area allocated to the storage means at regular or irregular timing; ,
Equipped with a,
2. The IC card according to claim 1, wherein the allocating unit allocates an area having a size required for writing the verification data to the storage unit in addition to the area having a size requested by the program .
データを記憶する記憶手段を備えるICチップにより実行される検証処理方法であって、
外部から受信されたコマンドに対応したコマンド処理を実行するステップと、
前記コマンド処理において用いられるプログラムにより要求された大きさの領域を前記記憶手段に割り当てる割当ステップと、
前記コマンド処理とは関係しない検証処理であって、前記記憶手段に割り当てられた領域に書き込まれた検証用データを読み出して検証する検証処理を定期または不定期のタイミングで繰り返し実行するステップと、
を含み、
前記割当ステップにおいては、前記プログラムにより要求された大きさの領域に加えて前記検証用データの書き込みに必要な大きさの領域を前記記憶手段に割り当てることを特徴とする検証処理方法。
A verification processing method executed by an IC chip comprising a storage means for storing data,
Executing command processing corresponding to a command received from the outside;
An allocation step of allocating an area of a size requested by the program used in the command processing to the storage means;
A verification process not related to the command process, the verification process for reading and verifying the verification data written in the area allocated to the storage means is repeatedly executed at regular or irregular timing;
Only including,
In the allocation step, an area having a size required for writing the verification data is allocated to the storage unit in addition to an area having a size requested by the program .
データを記憶する記憶手段を備えるICチップに含まれるコンピュータを、
外部から受信されたコマンドに対応したコマンド処理を実行するコマンド処理手段、前記コマンド処理において用いられるプログラムにより要求された大きさの領域を前記記憶手段に割り当てる割当手段、及び
前記コマンド処理とは関係しない検証処理であって、前記記憶手段に割り当てられた領域に書き込まれた検証用データを読み出して検証する検証処理を定期または不定期のタイミングで繰り返し実行する検証処理手段として機能させ
前記割当手段は、前記プログラムにより要求された大きさの領域に加えて前記検証用データの書き込みに必要な大きさの領域を前記記憶手段に割り当てることを特徴とする検証処理プログラム。
A computer included in an IC chip having storage means for storing data;
Command processing means for executing command processing corresponding to a command received from the outside, allocation means for allocating an area of a size requested by a program used in the command processing to the storage means, and not related to the command processing A verification process that reads and verifies verification data written in an area allocated to the storage unit, and functions as a verification process unit that repeatedly executes at regular or irregular timings ;
The allocation processing program allocates an area of a size required for writing the verification data to the storage unit in addition to an area of a size requested by the program.
JP2013058096A 2013-03-21 2013-03-21 IC chip, IC card, verification processing method, and verification processing program Active JP6119345B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013058096A JP6119345B2 (en) 2013-03-21 2013-03-21 IC chip, IC card, verification processing method, and verification processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013058096A JP6119345B2 (en) 2013-03-21 2013-03-21 IC chip, IC card, verification processing method, and verification processing program

Publications (3)

Publication Number Publication Date
JP2014182725A JP2014182725A (en) 2014-09-29
JP2014182725A5 JP2014182725A5 (en) 2016-05-26
JP6119345B2 true JP6119345B2 (en) 2017-04-26

Family

ID=51701343

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013058096A Active JP6119345B2 (en) 2013-03-21 2013-03-21 IC chip, IC card, verification processing method, and verification processing program

Country Status (1)

Country Link
JP (1) JP6119345B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007226277A (en) * 2004-04-02 2007-09-06 Matsushita Electric Ind Co Ltd Method and apparatus for virtual machine alteration inspection
JP4903818B2 (en) * 2007-02-09 2012-03-28 株式会社エヌ・ティ・ティ・ドコモ Terminal device and software inspection method
JP2011034130A (en) * 2009-07-29 2011-02-17 Canon Inc Information processor, information processing method, and program

Also Published As

Publication number Publication date
JP2014182725A (en) 2014-09-29

Similar Documents

Publication Publication Date Title
US10509568B2 (en) Efficient secure boot carried out in information processing apparatus
US7797682B2 (en) Controlled execution of a program used for a virtual machine on a portable data carrier
EP2876593A1 (en) Method of generating a structure and corresponding structure
CN105893877A (en) Method for secure data reading, computer program product and data handling system
EP1821214A1 (en) Nonvolatile memory system
US11853412B2 (en) Systems and methods for defeating stack-based cyber attacks by randomizing stack frame size
JP6119345B2 (en) IC chip, IC card, verification processing method, and verification processing program
EP1295200A2 (en) Data processing method and device for protected execution of instructions
US9912471B2 (en) Method for operating a portable data carrier, and such a portable data carrier
JP6798157B2 (en) Electronic information storage medium, anomaly detection method, and anomaly detection program
TW559822B (en) Method and apparatus for masking out non-operable memory cells
JP6396119B2 (en) IC module, IC card, and IC card manufacturing method
JP6828548B2 (en) Electronic information storage medium, IC card, tampering check method and tampering check program
JP6424633B2 (en) Electronic information storage medium, abnormality detection method, and program
US20150101051A1 (en) Method and device for the performance of a function by a microcircuit
US20150032992A1 (en) Data processing arrangement and method for data processing
JP6769265B2 (en) Electronic information storage medium, IC card, data abnormality confirmation method, and data abnormality confirmation program
US20190042116A1 (en) Techniques for preventing memory corruption
JP6175882B2 (en) Information storage medium, IC card, and bytecode execution method
JP6340935B2 (en) IC chip, abnormality detection processing method, and program
JP7247638B2 (en) Electronic information storage medium, IC card, falsification check method, and program
JP6493672B2 (en) Electronic information storage medium, abnormality detection method, abnormality detection program, and IC card
JP6136541B2 (en) Information storage medium and bytecode execution method
JP6398449B2 (en) Electronic information recording medium, processor module operation control method, and processor module operation control program
JP6379852B2 (en) Electronic information recording medium, processor module processing method, and processor module processing program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160125

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160401

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20161017

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20161101

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20161228

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: 20170228

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170313

R150 Certificate of patent or registration of utility model

Ref document number: 6119345

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150