[go: up one dir, main page]

JP5200686B2 - Information processing apparatus, normal processing determination method, and information processing program - Google Patents

Information processing apparatus, normal processing determination method, and information processing program Download PDF

Info

Publication number
JP5200686B2
JP5200686B2 JP2008159072A JP2008159072A JP5200686B2 JP 5200686 B2 JP5200686 B2 JP 5200686B2 JP 2008159072 A JP2008159072 A JP 2008159072A JP 2008159072 A JP2008159072 A JP 2008159072A JP 5200686 B2 JP5200686 B2 JP 5200686B2
Authority
JP
Japan
Prior art keywords
value
stored
address
instruction
instructions
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
JP2008159072A
Other languages
Japanese (ja)
Other versions
JP2010002975A (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 JP2008159072A priority Critical patent/JP5200686B2/en
Publication of JP2010002975A publication Critical patent/JP2010002975A/en
Application granted granted Critical
Publication of JP5200686B2 publication Critical patent/JP5200686B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

ICカードやメモリカード等のセキュリティデバイスにおいて、攻撃者による処理フローの改ざんを検知する技術分野に関する。   The present invention relates to a technical field for detecting alteration of a processing flow by an attacker in a security device such as an IC card or a memory card.

セキュリティデバイス上のプログラムを実行する際、必ず実行しなければならないクリティカルな処理が存在するケースがある。ここで、クリティカルな処理とは、PINや生体情報の認証等、セキュリティデバイスが担保するセキュリティレベルを維持するために必要な処理プロセスを指す。   When executing a program on a security device, there is a case where there is a critical process that must be executed. Here, the critical processing refers to a processing process necessary for maintaining the security level secured by the security device, such as authentication of PIN and biometric information.

一方で、セキュリティデバイスに対し不正な動作を行わせるための攻撃としてレーザアタック等のDFA(Differential Fault Attack)が存在するが、このDFAによってセキュリティデバイス上の処理フローを改ざんし、クリティカルな処理を実行させないことにより、当該セキュリティデバイスのセキュリティ強度を低下させる攻撃が知られている。このような処理フローを改ざんする攻撃が成功した場合、ソフトウェア設計者や実装者が意図したクリティカルな処理の実行をスキップさせることができる。   On the other hand, there is DFA (Differential Fault Attack) such as laser attack as an attack to make a security device perform an illegal operation. By this DFA, the processing flow on the security device is altered and critical processing is executed. By not doing so, an attack that reduces the security strength of the security device is known. When such an attack that alters the processing flow is successful, execution of critical processing intended by the software designer or implementer can be skipped.

このような処理フロー改ざんの対策として、特許文献1には、分岐処理後に、分岐に関する内部データを検証する方式が提案されている。この方式では、分岐処理が実行された際、分岐先にて経路情報を記録しておき、分岐から戻った後に分岐経路情報の正当性を確認することにより、正常に分岐が実施されたかを検証している。
特開2002−334317号公報
As a countermeasure against such processing flow alteration, Patent Document 1 proposes a method of verifying internal data related to branching after branching processing. In this method, when branch processing is executed, route information is recorded at the branch destination, and after returning from the branch, the correctness of the branch route information is confirmed to verify whether the branch has been executed normally. doing.
JP 2002-334317 A

しかしながら、特許文献1に開示された方式は、分岐処理のみを対象としており、正常実行、ループ処理の検証における検証方法を提供していない。   However, the method disclosed in Patent Document 1 is intended only for branch processing, and does not provide a verification method for verification of normal execution and loop processing.

そこで、本発明は、このような点等に鑑みてなされたものであり、正常実行、ループ処理を含む処理をも正常に行われたか否かをチェックすることが可能な情報処理装置、正常処理判別方法、及び情報処理プログラムを提供することを課題の一つとする。   Therefore, the present invention has been made in view of such points and the like, and is an information processing apparatus capable of checking whether normal execution and processing including loop processing have been performed normally, and normal processing It is an object to provide a determination method and an information processing program.

上記課題を解決するために、請求項1に記載の発明は、一連の処理において実行される複数の命令からなるプログラムを記憶するプログラム記憶手段と、前記複数の命令のうち、特定の命令が格納されている記憶領域のアドレスに関する第一の値を、前記命令の実行前に予め記憶するアドレス記憶手段と、前記命令を実行するCPUと、を備え、前記第一の値は、前記特定の命令が格納されている記憶領域のアドレスを示す値に対して所定の演算を施した値であり、前記CPUは、前記特定の命令を実行した場合、当該命令が格納されている記憶領域のアドレスを示す値を一時的に格納しておき、その後当該格納された値に対して所定の演算を施した第二の値と、前記アドレス記憶手段に予め記憶されている前記第一の値と、が一致しているか否かを比較判別することにより前記処理が正常に行われたか否かを判別することを特徴とする。 In order to solve the above-mentioned problem, the invention according to claim 1 is a program storage means for storing a program composed of a plurality of instructions executed in a series of processes, and a specific instruction is stored among the plurality of instructions. Address storage means for storing in advance a first value related to the address of the storage area being executed before the execution of the instruction, and a CPU for executing the instruction, wherein the first value is the specific instruction Is a value obtained by performing a predetermined operation on the value indicating the address of the storage area in which the CPU is stored, and when the CPU executes the specific instruction, the CPU stores the address of the storage area in which the instruction is stored. A second value obtained by temporarily storing the indicated value and then performing a predetermined operation on the stored value, and the first value stored in advance in the address storage means. Match The processing by comparing determines whether is characterized in that to determine whether or not successful.

請求項に記載の発明は、一連の処理において実行される複数の命令からなるプログラムを記憶するプログラム記憶手段と、前記複数の命令のうち、特定の命令が格納されている記憶領域のアドレスに関する第一の値を、前記命令の実行前に予め記憶するアドレス記憶手段と、前記命令を実行するCPUと、を備え、前記第一の値は、前記特定の命令が格納されている記憶領域のアドレスを示す値に対して所定の演算を施した値であり、前記CPUは、前記特定の命令を実行した場合、当該命令が格納されている記憶領域のアドレスを示す値に対して所定の演算を施した値を第二の値として一時的に格納しておき、その後当該格納された値と、前記アドレス記憶手段に予め記憶されている前記第一の値と、が一致しているか否かを比較判別することにより前記処理が正常に行われたか否かを判別することを特徴とする。 The invention according to claim 2 relates to program storage means for storing a program composed of a plurality of instructions executed in a series of processing, and an address of a storage area in which a specific instruction is stored among the plurality of instructions. Address storage means for storing a first value in advance before execution of the instruction, and a CPU for executing the instruction, wherein the first value is a storage area in which the specific instruction is stored A value obtained by performing a predetermined operation on a value indicating an address. When the CPU executes the specific instruction, the CPU performs a predetermined operation on a value indicating an address of a storage area in which the instruction is stored. be stored temporarily a value subjected to a second value, whether followed and the stored value, said first value which is previously stored in the address storage means, match Compare and discriminate Characterized in that to determine whether the process was successful by.

請求項に記載の発明は、請求項1又は2に記載の情報処理装置において、前記特定の命令は複数有り、夫々の当該命令が格納されている記憶領域のアドレスは互いに異なることを特徴とする。 A third aspect of the present invention is the information processing apparatus according to the first or second aspect , wherein there are a plurality of the specific instructions, and addresses of storage areas in which the specific instructions are stored are different from each other. To do.

請求項に記載の発明は、一連の処理において実行される複数の命令からなるプログラムを記憶するプログラム記憶手段と、前記複数の命令のうち、特定の命令が格納されている記憶領域のアドレスに関する第一の値を、前記命令の実行前に予め記憶するアドレス記憶手段と、前記命令を実行するCPUと、を備え、前記特定の命令は複数有り、夫々の当該命令が格納されている記憶領域のアドレスは互いに異なり、前記第一の値は、各前記特定の命令が格納されている各記憶領域のアドレスを示す各値を所定の演算により縮退した値であり、前記CPUは、前記特定の命令を実行した場合、当該命令が格納されている記憶領域のアドレスを示す値を一時的に格納しておき、その後当該格納された値を前記演算により縮退し、当該縮退した第二の値と、前記アドレス記憶手段に予め記憶されている前記第一の値と、が一致しているか否かを比較判別することにより前記処理が正常に行われたか否かを判別することを特徴とする。 The invention according to claim 4 relates to program storage means for storing a program composed of a plurality of instructions executed in a series of processing, and an address of a storage area in which a specific instruction is stored among the plurality of instructions. An address storage means for storing the first value in advance before execution of the instruction, and a CPU for executing the instruction , a plurality of the specific instructions, and a storage area in which each of the instructions is stored Are different from each other, and the first value is a value obtained by degenerating each value indicating the address of each storage area in which each specific instruction is stored by a predetermined operation. If the instruction is executed may be stored temporarily a value that indicates the address of the storage area in which the instructions are stored, degenerated then the stored value by the computation, first and the degenerate Features of the values, said first value which is previously stored in the address storage means, to determine whether the process was successful by comparing determines whether or not the match And

請求項に記載の発明は、請求項に記載の情報処理装置において、前記演算はハッシュ計算又はXOR計算であることを特徴とする。 According to a fifth aspect of the present invention, in the information processing apparatus according to the fourth aspect , the calculation is hash calculation or XOR calculation.

請求項に記載の発明は、請求項乃至の何れか一項に記載の情報処理装置において、前記アドレスを示す値は、プログラムカウンタの値であることを特徴とする。 The invention of claim 6 is the information processing apparatus according to any one of claims 1 to 5, the value indicating the address, characterized in that the value of the program counter.

請求項に記載の発明は、請求項1乃至の何れか一項に記載の情報処理装置において、前記CPUは、前記特定の命令を複数回実行した場合、その回数をも一時的に格納しておき、当該格納された回数と前記第二の値との積と、前記格納された回数と前記アドレス記憶手段に予め記憶されている前記第一の値との積と、が一致しているか否かを比較判別することにより前記処理が正常に行われたか否かを判別することを特徴とする。 A seventh aspect of the present invention is the information processing apparatus according to any one of the first to sixth aspects, wherein the CPU temporarily stores the number of times when the specific instruction is executed a plurality of times. The product of the stored number of times and the second value matches the product of the stored number of times and the first value stored in advance in the address storage means. It is characterized in that it is determined whether or not the processing has been normally performed by comparing and determining whether or not there is.

請求項に記載の発明は、請求項1乃至の何れか一項に記載の情報処理装置において、前記特定の命令は、前記一連の処理に含まれる、セキュリティレベルを維持するために必要なクリティカル処理において実行されることを特徴とする。 According to an eighth aspect of the present invention, in the information processing apparatus according to any one of the first to seventh aspects, the specific instruction is necessary for maintaining a security level included in the series of processes. It is executed in critical processing.

請求項に記載の発明は、一連の処理において実行される複数の命令からなるプログラムを記憶するプログラム記憶手段と、前記複数の命令のうち、特定の命令が格納されている記憶領域のアドレスに関する第一の値を、前記命令の実行前に予め記憶するアドレス記憶手段と、前記命令を実行するCPUと、を用いた正常処理判別方法であって、前記第一の値は、前記特定の命令が格納されている記憶領域のアドレスを示す値に対して所定の演算を施した値であり、前記CPUが、前記特定の命令を実行した場合、当該命令が格納されている記憶領域のアドレスを示す値を一時的に格納しておき、その後当該格納された値に対して所定の演算を施した第二の値と、前記アドレス記憶手段に予め記憶されている前記第一の値と、が一致しているか否かを比較判別することにより前記処理が正常に行われたか否かを判別することを特徴とする請求項10に記載の発明は、一連の処理において実行される複数の命令からなるプログラムを記憶するプログラム記憶手段と、前記複数の命令のうち、特定の命令が格納されている記憶領域のアドレスに関する第一の値を、前記命令の実行前に予め記憶するアドレス記憶手段と、前記命令を実行するCPUと、を用いた正常処理判別方法であって、前記第一の値は、前記特定の命令が格納されている記憶領域のアドレスを示す値に対して所定の演算を施した値であり、前記CPUが、前記特定の命令を実行した場合、当該命令が格納されている記憶領域のアドレスを示す値に対して所定の演算を施した値を第二の値として一時的に格納しておき、その後当該格納された第二の値と、前記アドレス記憶手段に予め記憶されている前記第一の値と、が一致しているか否かを比較判別することにより前記処理が正常に行われたか否かを判別することを特徴とする。 The invention according to claim 9 relates to program storage means for storing a program composed of a plurality of instructions executed in a series of processing, and an address of a storage area in which a specific instruction is stored among the plurality of instructions. A normal processing determination method using address storage means for storing a first value in advance before execution of the instruction and a CPU for executing the instruction, wherein the first value is the specific instruction Is a value obtained by performing a predetermined operation on the value indicating the address of the storage area in which the CPU is stored, and when the CPU executes the specific instruction, the address of the storage area in which the instruction is stored is A second value obtained by temporarily storing the indicated value and then performing a predetermined operation on the stored value, and the first value stored in advance in the address storage means. Match The processing by comparing determines whether is characterized in that to determine whether or not successful. The invention according to claim 10 relates to program storage means for storing a program comprising a plurality of instructions executed in a series of processes, and an address of a storage area in which a specific instruction is stored among the plurality of instructions. A normal processing determination method using address storage means for storing a first value in advance before execution of the instruction and a CPU for executing the instruction, wherein the first value is the specific instruction Is a value obtained by performing a predetermined operation on the value indicating the address of the storage area in which the CPU is stored, and when the CPU executes the specific instruction, the address of the storage area in which the instruction is stored is A value obtained by performing a predetermined operation on the indicated value is temporarily stored as a second value, and then the stored second value and the first value stored in advance in the address storage means And the value of There wherein the determining whether the process was successful by comparing determines whether they match.

請求項11に記載の発明は、一連の処理において実行される複数の命令からなるプログラムを記憶するプログラム記憶手段と、前記複数の命令のうち、特定の命令が格納されている記憶領域のアドレスに関する第一の値を、前記命令の実行前に予め記憶するアドレス記憶手段と、前記命令を実行するCPUと、を備えた情報処理装置における前記CPUを、実行した前記命令のうち前記特定の命令が格納されている記憶領域のアドレスに関する第二の値と、前記アドレス記憶手段に予め記憶されている前記第一の値と、が一致しているか否かを比較判別することにより前記処理が正常に行われたか否かを判別するように機能させる情報処理プログラムであって、前記第一の値は、前記特定の命令が格納されている記憶領域のアドレスを示す値に対して所定の演算を施した値であり、前記情報処理プログラムは、前記CPUを、前記特定の命令を実行した場合、当該命令が格納されている記憶領域のアドレスを示す値を一時的に格納しておき、その後当該格納された値に対して所定の演算を施した前記第二の値と、前記アドレス記憶手段に予め記憶されている前記第一の値と、が一致しているか否かを比較判別することにより前記処理が正常に行われたか否かを判別するように機能させることを特徴とする請求項12に記載の発明は、一連の処理において実行される複数の命令からなるプログラムを記憶するプログラム記憶手段と、前記複数の命令のうち、特定の命令が格納されている記憶領域のアドレスに関する第一の値を、前記命令の実行前に予め記憶するアドレス記憶手段と、前記命令を実行するCPUと、を備えた情報処理装置における前記CPUを、実行した前記命令のうち前記特定の命令が格納されている記憶領域のアドレスに関する第二の値と、前記アドレス記憶手段に予め記憶されている前記第一の値と、が一致しているか否かを比較判別することにより前記処理が正常に行われたか否かを判別するように機能させる情報処理プログラムであって、前記第一の値は、前記特定の命令が格納されている記憶領域のアドレスを示す値に対して所定の演算を施した値であり、前記情報処理プログラムは、前記CPUを、前記特定の命令を実行した場合、当該命令が格納されている記憶領域のアドレスを示す値に対して所定の演算を施した値を前記第二の値として一時的に格納しておき、その後当該格納された値と、前記アドレス記憶手段に予め記憶されている前記第一の値と、が一致しているか否かを比較判別することにより前記処理が正常に行われたか否かを判別するように機能させることを特徴とする。 The invention according to claim 11 relates to program storage means for storing a program composed of a plurality of instructions executed in a series of processing, and an address of a storage area in which a specific instruction is stored among the plurality of instructions. The specific instruction among the instructions executed by the CPU in the information processing apparatus that includes an address storage unit that stores the first value in advance before execution of the instruction and a CPU that executes the instruction. The process is normally performed by comparing and determining whether or not the second value relating to the address of the storage area stored matches the first value stored in advance in the address storage means. an information processing program for causing a function to determine whether or not made, the first value is a value indicating the address of a storage area in which the particular instruction is stored When the CPU executes the specific instruction, the information processing program temporarily stores a value indicating the address of the storage area in which the instruction is stored. Then, whether or not the second value obtained by performing a predetermined operation on the stored value and the first value stored in advance in the address storage means match. It is made to function so that it may be discriminate | determined whether the said process was performed normally by comparing and discriminating . The invention according to claim 12 relates to program storage means for storing a program composed of a plurality of instructions executed in a series of processes, and an address of a storage area in which a specific instruction among the plurality of instructions is stored. The specific instruction among the instructions executed by the CPU in the information processing apparatus that includes an address storage unit that stores the first value in advance before execution of the instruction and a CPU that executes the instruction. The process is normally performed by comparing and determining whether or not the second value relating to the address of the storage area stored matches the first value stored in advance in the address storage means. An information processing program that functions to determine whether or not an operation has been performed, wherein the first value is a value indicating an address of a storage area in which the specific instruction is stored When the CPU executes the specific instruction, the information processing program executes a predetermined operation on a value indicating an address of a storage area in which the instruction is stored. Whether the calculated value is temporarily stored as the second value, and then the stored value matches the first value stored in advance in the address storage means It is made to function so as to determine whether or not the processing has been normally performed by comparing and determining whether or not.

本発明によれば、処理フロー改ざんの対策として単なるフラグではなく、特定の命令が格納されている記憶領域のアドレスに関する値を使用するように構成したので、正常実行、ループ処理を含む処理をも正常に行われたか否かをチェックすることができ、よって、セキュリティレベルを向上させることができる。   According to the present invention, as a countermeasure against processing flow tampering, a value related to the address of a storage area in which a specific instruction is stored is used instead of a mere flag, so that processing including normal execution and loop processing is also included. It is possible to check whether or not the operation has been normally performed, and thus the security level can be improved.

以下、図面を参照して本発明の最良の実施形態について詳細に説明する。以下に説明する実施形態は、ICカードに搭載される(埋め込まれる)ICチップに対して本発明を適用した場合の実施の形態である。   Hereinafter, the best embodiment of the present invention will be described in detail with reference to the drawings. The embodiment described below is an embodiment when the present invention is applied to an IC chip mounted (embedded) in an IC card.

[1.ICチップの構成及び機能等]
先ず、本発明の一実施形態に係るICチップの構成及び機能等について、図1等を用いて説明する。
[1. IC chip configuration and functions]
First, the configuration and functions of an IC chip according to an embodiment of the present invention will be described with reference to FIG.

図1は、本実施形態に係るICチップのハードウェア構成例を示す図である。   FIG. 1 is a diagram illustrating a hardware configuration example of an IC chip according to the present embodiment.

図1に示すように、ICチップ1は、演算機能を有するCPU(Central Processing Unit)11、プログラム記憶手段の一例としてのROM(Read Only Memory)12、アドレス記憶手段の一例としての不揮発性メモリ(例えば、EEPROM(Electrically Erasable and Programmable Read Only Memory))13、RAM(Random Access Memory)14、及び外部機器とデータ通信するためのI/O回路15等を備えて構成されている。なお、I/O回路15を介した外部機器とのデータ通信は、接触方式と非接触方式の何れの方式であっても良い。   As shown in FIG. 1, an IC chip 1 includes a CPU (Central Processing Unit) 11 having an arithmetic function, a ROM (Read Only Memory) 12 as an example of a program storage unit, and a nonvolatile memory (an example of an address storage unit). For example, an EEPROM (Electrically Erasable and Programmable Read Only Memory) 13, a RAM (Random Access Memory) 14, an I / O circuit 15 for data communication with an external device, and the like are configured. Note that data communication with an external device via the I / O circuit 15 may be either a contact method or a non-contact method.

ROM12には、一連のコマンド処理において実行される複数の命令(機械語で表わされる命令)からなるプログラムが記憶されている。かかるコマンド処理には、例えばICカードが担保するセキュリティレベルを維持するために必要なクリティカル処理(セキュリティ上重要な処理)が含まれている。このクリティカル処理としては、例えば、PINや生体情報の認証等のセキュリティ処理が挙げられる。   The ROM 12 stores a program composed of a plurality of instructions (instructions expressed in machine language) executed in a series of command processing. Such command processing includes, for example, critical processing (processing important for security) necessary for maintaining the security level secured by the IC card. Examples of the critical process include security processes such as PIN and biometric information authentication.

不揮発性メモリ13には、処理フロー検証用の情報が事前に(CPU11による処理実行前に)予め記憶される。具体的には、上記複数の命令のうち、上記クリティカル処理において実行される特定の命令が格納(配置)されている記憶領域のアドレス(論理アドレスや物理アドレスであり、各命令毎に互いに異なる)に関する値(第一の値)が記憶される。例えば、ICカードの提供者は、プログラムをコンパイラによりコンパイルしてROM12上に書き込んだ際に、どの命令がどのアドレスに格納されたかをエミュレータにより取り出した後、当該アドレスに関する値を不揮発性メモリ13における所定領域に記憶させる。   Information for processing flow verification is stored in advance in the non-volatile memory 13 (before execution of processing by the CPU 11). Specifically, among the plurality of instructions, an address of a storage area where a specific instruction executed in the critical process is stored (arranged) (a logical address or a physical address, which is different for each instruction) A value (first value) is stored. For example, when a provider of an IC card compiles a program with a compiler and writes it on the ROM 12, the emulator retrieves which instruction is stored in which address, and then sets a value related to the address in the nonvolatile memory 13. Store in a predetermined area.

RAM(揮発性メモリ)14には、CPU11により実行された上記特定の命令が格納されている記憶領域のアドレスに関する値(第二の値)が一時的に記憶(格納)される。   A RAM (volatile memory) 14 temporarily stores (stores) a value (second value) related to the address of the storage area in which the specific instruction executed by the CPU 11 is stored.

ここで、アドレスに関する値としては、例えば、当該アドレスを示す値、又は当該アドレスを示す値に対して所定の演算を施した値等が挙げられる。また、当該アドレスを示す値は、例えば、CPU11に搭載されるプログラムカウンタ(実行するべき命令が格納されているROM12上のアドレスを指し示すレジスタ)の値(以下、「PC値」という)である。   Here, examples of the value related to the address include a value indicating the address or a value obtained by performing a predetermined operation on the value indicating the address. The value indicating the address is, for example, a value of a program counter (a register indicating an address on the ROM 12 in which an instruction to be executed is stored) mounted on the CPU 11 (hereinafter referred to as “PC value”).

図2は、ICチップ内のメモリマップの概略図である。図2に示すように、不揮発性メモリ13に設けられた事前PC値等保持領域には、処理フロー検証用の情報として事前にPC値又は当該PC値に対して所定の演算を施した値(以下、「PC値等」という)が記憶保持され、RAM14に設けられた実行中PC値等保持領域には、上記コマンド処理において特定の命令が実行された際にPC値等が記憶保持される。   FIG. 2 is a schematic diagram of a memory map in the IC chip. As shown in FIG. 2, the pre-PC value holding area provided in the non-volatile memory 13 has a PC value or a value obtained by performing a predetermined operation on the PC value in advance as information for processing flow verification ( (Hereinafter referred to as “PC value, etc.”) is stored and held, and the PC value etc. in-execution holding area provided in the RAM 14 stores and holds the PC value and the like when a specific instruction is executed in the command processing. .

CPU11は、上記コマンド処理において上記特定の命令を実行した場合、当該命令に対応するPC値等(当該命令が格納されている記憶領域のアドレスに関する値の一例)をRAM14に一時的に格納しておき、その後当該格納された値と、不揮発性メモリ13に予め記憶されているPC値等と、が一致しているか否かを比較(つまり、RAM14の実行中PC値等保持領域に格納された値と不揮発性メモリ13の事前PC値等保持領域に格納された値を比較)判別することにより上記処理が正常に行われたか否かを判別するようになっている。   When the CPU 11 executes the specific instruction in the command processing, the CPU 11 temporarily stores in the RAM 14 a PC value or the like (an example of a value related to the address of the storage area in which the instruction is stored) corresponding to the instruction. After that, the stored value is compared with the PC value or the like stored in advance in the non-volatile memory 13 (that is, stored in the holding area of the executing PC value or the like in the RAM 14). By comparing the value and the value stored in the pre-PC value holding area of the non-volatile memory 13, it is determined whether or not the above processing has been performed normally.

図3は、CPU11におけるコマンド処理の一例を示すフローチャートである。図3に示すコマンド処理が開始されると、CPU11は、通常処理(クリティカル処理以外の処理)を行った(ステップS1)後、クリティカル処理を行う(ステップS2)。このクリティカル処理では、先ずセキュリティ処理が行われる(ステップS21)。図3の例では、セキュリティ処理は、命令A〜Eまでの5つの特定の命令で構成され、上から順に実行される。当該セキュリティ処理後、CPU11は、実行した特定の命令に対応するPC値等を、RAM14の実行中PC値等保持領域に格納する(ステップS22)。   FIG. 3 is a flowchart illustrating an example of command processing in the CPU 11. When the command processing shown in FIG. 3 is started, the CPU 11 performs normal processing (processing other than critical processing) (step S1), and then performs critical processing (step S2). In this critical processing, security processing is first performed (step S21). In the example of FIG. 3, the security process is composed of five specific instructions from instructions A to E, and is executed in order from the top. After the security processing, the CPU 11 stores the PC value or the like corresponding to the executed specific instruction in the execution value holding area of the RAM 14 (step S22).

ここで、図3に示すセキュリティ処理の例では、5つの特定の命令A〜Eが実行されるようになっており、これら全ての命令に対応するPC値等が格納されるように構成しても良いが、記憶領域を有効に活用するため、このうち一部の命令に対応するPC値等を格納することが望ましい。例えばセキュリティ処理において実行される5つの命令A〜Eのうち最後の命令Eに対応するPC値等のみ格納すれば、例えば最初の命令Aが実行された後、その後の命令がDFAによりスキップされた場合であっても当該スキップを後から検知することができる。   Here, in the example of the security processing shown in FIG. 3, five specific instructions A to E are executed, and the PC values and the like corresponding to all these instructions are stored. However, in order to make effective use of the storage area, it is desirable to store PC values corresponding to some of these instructions. For example, if only the PC value corresponding to the last instruction E among the five instructions A to E executed in the security processing is stored, for example, after the first instruction A is executed, the subsequent instructions are skipped by the DFA Even in this case, the skip can be detected later.

そして、ステップS3では、CPU11は、RAM14の実行中PC値等保持領域に格納されたPC値等と、不揮発性メモリ13の事前PC値等保持領域に事前に格納されているPC値等と、が一致しているか否かを比較判別し(正常/エラーの判定)、両者が一致している場合には(ステップS3:YES)、コマンド処理は正常に実行されたものと判別(正常判定)して、正常処理(例えば、外部にデータを出力)を行い(ステップS4)、両者が一致していない場合には(ステップS3:NO)、コマンド処理は正常に実行されていないと判別(エラー判定)して、DFA検知時のエラー処理(例えば、DFAを受けている可能性が高いとして、ICカードの動作を停止)を行う(ステップS5)。   In step S3, the CPU 11 stores the PC value stored in the PC value storage area during execution of the RAM 14, the PC value stored in advance in the storage area of the pre-PC value of the nonvolatile memory 13, and the like. Are compared (normal / error determination). If the two match (step S3: YES), it is determined that the command processing has been executed normally (normal determination). Then, normal processing (for example, outputting data to the outside) is performed (step S4). If the two do not match (step S3: NO), it is determined that the command processing is not executed normally (error) Then, error processing at the time of DFA detection (for example, the operation of the IC card is stopped assuming that there is a high possibility of receiving DFA) is performed (step S5).

[2.事前PC値等保持領域及び実行中PC値等保持領域に格納される値の具体例]
ここで、事前PC値等保持領域及び実行中PC値等保持領域に格納される値の具体例について説明する。
[2. Specific Example of Values Stored in Pre-PC Value Retention Area and Running PC Value Retention Area]
Here, specific examples of values stored in the pre-PC value etc. holding area and the in-execution PC value etc. holding area will be described.

(2.1 PC値(PCの即値)の場合)
プログラム全体(コマンド処理)の中で、クリティカル処理が1つしかない場合は、特定の命令に対応するPC値を1つ格納すれば良いが、クリティカル処理が複数個所にある場合は、各クリティカル処理において実行される特定の命令に対応するPC値を全て格納する。
(2.1 PC value (PC immediate value))
If there is only one critical process in the entire program (command process), it is sufficient to store one PC value corresponding to a specific instruction, but if there are multiple critical processes, each critical process All the PC values corresponding to a specific instruction executed in the are stored.

図4(A)は、PC値を格納した事前PC値等保持領域の一例を示す図である。   FIG. 4A is a diagram illustrating an example of a pre-PC value etc. holding area that stores PC values.

例えば、あるコマンド処理で複数のクリティカル処理を通過する場合、その通過する各クリティカル処理において実行される特定の命令(ここでは、各クリティカル処理につき、特定の命令が一つある場合を想定)が格納されている記憶領域のアドレスを示す値が、“0x003522”,“0x005678”,“0x006788”のとき、図4(A)に示すように、これら全てを事前PC値等保持領域に格納しておく。   For example, when multiple critical processes pass through a command process, a specific instruction (in this case, assuming that there is one specific instruction for each critical process) is stored. When the values indicating the addresses of the stored storage areas are “0x003522”, “0x005678”, and “0x006788”, as shown in FIG. 4A, all of these are stored in the pre-PC value etc. holding area. .

そして、CPU11は、コマンド処理の実行時に、“0x003522”,“0x005678”,及び“0x006788”の各アドレスにおける特定の命令を実行した際に、当該特定の命令に対応する全てのPC値を実行中PC値等保持領域に格納(即値で格納)しておき、その後、実行中PC値等保持領域に格納された値と、事前PC値等保持領域に格納された値を比較する際は、両者を即値で比較することにより、上述した正常/エラーの判定を行う。   Then, when executing a specific instruction at each address of “0x003522”, “0x005678”, and “0x006788” when executing the command processing, the CPU 11 is executing all the PC values corresponding to the specific instruction. When the value stored in the PC value etc. holding area is stored in the PC value etc. holding area (immediate value) and then the value stored in the PC value etc. holding area during execution is compared with the value stored in the previous PC value etc. holding area, both Is compared with an immediate value to perform the above-described normal / error determination.

(2.2 PC値に対して所定の演算を施した値の場合)
上記2.1と同様、クリティカル処理が複数個所にある場合は、各クリティカル処理において実行される特定の命令に対応するPC値に対して所定の演算を施した値を全て格納する。ここで、所定の演算を施した値とは、例えば、PC値に対して、固定値若しくは乱数等の不定値を加減乗除した値である。
(2.2 In the case of a value obtained by performing a predetermined calculation on the PC value)
As in 2.1 above, when there are a plurality of critical processes, all values obtained by performing a predetermined operation on the PC value corresponding to a specific instruction executed in each critical process are stored. Here, the value obtained by performing a predetermined calculation is, for example, a value obtained by adding, subtracting, or dividing a PC value by an indefinite value such as a fixed value or a random number.

図4(B)は、PC値に対して所定の演算を施した値を格納した事前PC値等保持領域の一例を示す図である。   FIG. 4B is a diagram illustrating an example of a pre-PC value etc. holding area in which a value obtained by performing a predetermined calculation on the PC value is stored.

例えば、上記2.1と同様、通過する各クリティカル処理において実行される特定の命令が格納されている記憶領域のアドレスを示す値が、“0x003522”,“0x005678”,“0x006788”のとき、各アドレスを示す値に対して所定の演算を施し、即値とは異なる値を、事前PC値等保持領域に格納しておく。一例として、各アドレスを示す値に対して固定値“0x112233”を加算した値を格納した場合、図4(B)に示す通りになる。   For example, as in 2.1 above, when the value indicating the address of the storage area in which a specific instruction executed in each passing critical process is stored is “0x003522”, “0x005678”, “0x006788”, A predetermined calculation is performed on the value indicating the address, and a value different from the immediate value is stored in the pre-PC value holding area. As an example, when a value obtained by adding a fixed value “0x112233” to a value indicating each address is stored, the result is as shown in FIG.

そして、CPU11は、コマンド処理の実行時に、“0x003522”,“0x005678”,及び“0x006788”の各アドレスにおける特定の命令を実行した際に、当該特定の命令に対応する全てのPC値を実行中PC値等保持領域に格納(即値で格納)しておき、その後、当該実行中PC値等保持領域に格納された各PC値に対して上記演算を施した値(つまり、比較時に演算)と、事前PC値等保持領域に格納された値を比較することにより、正常/エラーの判定を行う。   Then, when executing a specific instruction at each address of “0x003522”, “0x005678”, and “0x006788” when executing the command processing, the CPU 11 is executing all the PC values corresponding to the specific instruction. Stored in the PC value etc. holding area (stored as an immediate value), and then a value obtained by performing the above calculation on each PC value stored in the PC value etc. holding area during execution (that is, calculation at the time of comparison) The normal / error determination is performed by comparing the values stored in the pre-PC value holding area.

或いは、CPU11は、コマンド処理の実行時に、“0x003522”,“0x005678”,及び“0x006788”の各アドレスにおける特定の命令を実行した際に、当該特定の命令に対応する各PC値に対して上記演算を施した値を実行中PC値等保持領域に格納しておき、その後、実行中PC値等保持領域に格納された値と、事前PC値等保持領域に格納された値を比較することにより、上述した正常/エラーの判定を行う。   Alternatively, when executing a specific instruction at each address of “0x003522”, “0x005678”, and “0x006788” during execution of command processing, the CPU 11 performs the above processing for each PC value corresponding to the specific instruction. Store the calculated value in the PC value holding area during execution, and then compare the value stored in the PC value holding area during execution with the value stored in the pre PC value holding area Thus, the above-described normal / error determination is performed.

(2.3 複数のPC値を縮退した値の場合)
上記2.1と同様、クリティカル処理が複数個所にある場合、全ての特定の命令に対応するPC値若しくはPC値に対して所定の演算を施した値を事前PC値等保持領域に格納しておくのは、記憶領域を多く取るため、経済的とはいえない場合がある。そこで、これらの複数のPC値を所定の演算(例えば、ハッシュ計算、又はXOR(排他的論理和)計算)により縮退(データ量を縮退)した値(複数のPC値のデータをまとめてより小さなデータに縮退)を格納する。
(2.3 When multiple PC values are degenerated)
As in 2.1 above, when there are multiple critical processes, PC values corresponding to all specific instructions or values obtained by performing a predetermined operation on PC values are stored in the pre-PC value holding area. It is not economical because it takes a lot of storage space. Therefore, a value obtained by reducing (decreasing the amount of data) the plurality of PC values by a predetermined operation (for example, hash calculation or XOR (exclusive OR) calculation) is smaller. Store degenerate) in the data.

図5(A)は、複数のPC値を連結しハッシュ計算により縮退する例を示す図である。この場合、通過する各クリティカル処理において実行される特定の命令が格納されている記憶領域のアドレスを示す値が、図5(A)に示すように、“0x003522”,“0x005678”,“0x006788”・・・のとき、各アドレスを示す値を連結し、ハッシュ関数(例えば、SHA−1)によりハッシュ計算を行い、その結果(ハッシュ値)を、事前PC値等保持領域に格納しておく。   FIG. 5A is a diagram illustrating an example in which a plurality of PC values are concatenated and degenerated by hash calculation. In this case, as shown in FIG. 5A, the value indicating the address of the storage area in which a specific instruction executed in each passing critical process is stored is “0x003522”, “0x005678”, “0x006788”. In the case of..., The values indicating the respective addresses are concatenated, hash calculation is performed using a hash function (for example, SHA-1), and the result (hash value) is stored in a pre-PC value storage area.

また、図5(B)は、複数のPC値のXOR計算により縮退する例を示す図である。この場合、通過する各クリティカル処理において実行される特定の命令が格納されている記憶領域のアドレスを示す値が、図5(B)に示すように、“0x003522”,“0x005678”,“0x006788”・・・のとき、各アドレスを示す値のXOR計算を行い、その結果を、事前PC値等保持領域に格納しておく。   FIG. 5B is a diagram illustrating an example of degeneration by XOR calculation of a plurality of PC values. In this case, as shown in FIG. 5B, the value indicating the address of the storage area in which a specific instruction executed in each passing critical process is stored is “0x003522”, “0x005678”, “0x006788”. At the time of..., XOR calculation of values indicating each address is performed, and the result is stored in a pre-PC value etc. holding area.

そして、CPU11は、コマンド処理の実行時に、“0x003522”,“0x005678”,及び“0x006788”・・・の各アドレスにおける特定の命令を実行した際に、当該特定の命令に対応する全てのPC値を実行中PC値等保持領域に格納(即値で格納)しておき、その後、当該格納された値を上記演算(例えば、ハッシュ計算、又はXOR計算)により縮退し、当該縮退した値と、事前PC値等保持領域に格納された値を比較することにより、上述した正常/エラーの判定を行う。   When executing the command processing, the CPU 11 executes all the PC values corresponding to the specific instruction when executing the specific instruction at the addresses “0x003522”, “0x005678”, “0x006788”. Is stored in the PC value etc. holding area during execution (stored as an immediate value), and then the stored value is reduced by the above operation (for example, hash calculation or XOR calculation), and the reduced value is stored in advance. The normal / error determination described above is performed by comparing the values stored in the PC value etc. holding area.

[3.コマンド処理の実施例]
次に、本実施形態に係るICチップにおけるコマンド処理の実施例について、図6等を用いて説明する。
[3. Example of command processing]
Next, an example of command processing in the IC chip according to the present embodiment will be described with reference to FIG.

図6は、分岐、ループを含むコマンド処理の一例を示すフローチャートである。図6に示すコマンド処理は、クリティカル処理と分岐処理を夫々3つずつ有している。また、分岐処理03は、最小0回、最大1回のみループし、クリティカル処理02が最大2回実行されることは設計上明らかであるとする。   FIG. 6 is a flowchart showing an example of command processing including branching and looping. The command processing shown in FIG. 6 has three critical processes and three branch processes. Further, it is assumed by design that the branch process 03 loops at least once and at most once and the critical process 02 is executed twice at maximum.

また、事前PC値等保持領域には、通過する各クリティカル処理において実行される特定の命令が格納されている記憶領域のアドレスを示す値を加算した加算値が格納されるが、複数のパスが想定されるため、想定される各パスを経た際の加算値が全て事前PC値等保持領域に格納されるものとする。   In addition, in the pre-PC value holding area, an added value obtained by adding a value indicating the address of the storage area in which a specific instruction executed in each passing critical process is stored is stored. It is assumed that all the added values after passing through each assumed path are stored in the pre-PC value holding area.

図7は、各パスにおける加算値を各パスに対応付けて格納した事前PC値等保持領域の一例を示す図である。   FIG. 7 is a diagram illustrating an example of a pre-PC value holding area in which the addition value in each path is stored in association with each path.

なお、各クリティカル処理における特定の命令実行時には、当該特定の命令に対応するPC値が実行中PC値等保持領域に格納される。   When a specific instruction is executed in each critical process, the PC value corresponding to the specific instruction is stored in the holding area of the executing PC value and the like.

以上の前提条件の下、コマンド処理が正常に実行された場合と、正常に実行されなかった場合の検証について以下に説明する。   The verification when the command processing is normally executed and when the command processing is not normally executed under the above preconditions will be described below.

先ず、コマンド処理が正常に実行された場合の検証について説明する。   First, verification when command processing is executed normally will be described.

図6において、例えば、通常処理01→分岐処理01→クリティカル処理01→分岐処理02→クリティカル処理02→分岐処理03→クリティカル処理02→分岐処理03の順で処理が実行された場合、実行中PC値等保持領域には、図8(A)に示すように、各特定の命令に対応するPC値が格納される。そして、CPU11は、正常/エラー判定において、上記実行中PC値等保持領域に格納された各PC値(図8(A)に示す“0x003253”,“0x003469”,“0x003469”)を加算し、その加算値(0x009B25)と一致する値が事前PC値等保持領域に格納されているか否かを比較判別する。図7に示す事前PC値等保持領域では、No.3の加算値が一致しているので、処理は正常に行われていることを検証できる。   In FIG. 6, for example, when the processing is executed in the order of normal processing 01 → branching processing 01 → critical processing 01 → branching processing 02 → critical processing 02 → branching processing 03 → critical processing 02 → branching processing 03, the executing PC In the value holding area, as shown in FIG. 8A, the PC value corresponding to each specific instruction is stored. Then, the CPU 11 adds each PC value (“0x003253”, “0x003469”, “0x003469” shown in FIG. 8A)) stored in the holding area for the executing PC value etc. in the normal / error determination, It is compared and determined whether or not a value matching the added value (0x009B25) is stored in the pre-PC value etc. holding area. In the pre-PC value holding area shown in FIG. 7, since the addition values of No. 3 match, it can be verified that the processing is normally performed.

次に、コマンド処理が正常に実行されなかった場合の検証について説明する。   Next, verification when command processing is not executed normally will be described.

図6において、例えば、通常処理01→分岐処理01→クリティカル処理01→分岐処理02→クリティカル処理02→分岐処理03→クリティカル処理02→分岐処理03というフローの中で、分岐処理02において処理フロー改ざんを発生させ、通常処理01→分岐処理01→クリティカル処理01→分岐処理02→分岐処理03→クリティカル処理02→分岐処理03というようにクリティカル処理02の実行がスキップされた場合、実行中PC値等保持領域には、図8(B)に示すように、各特定の命令に対応するPC値が格納される。そして、CPU11は、正常/エラー判定において、上記実行中PC値等保持領域に格納された各PC値(図8(B)に示す“0x003253”,“0x003469”)を加算し、その加算値(0x0066CC)と一致する値が事前PC値等保持領域に格納されているか否かを比較判別する。図7に示す事前PC値等保持領域では、何れの値にも一致していないので、処理フロー改ざんが発生したことを検知することができる。   In FIG. 6, for example, in the flow of normal processing 01 → branch processing 01 → critical processing 01 → branching processing 02 → critical processing 02 → branching processing 03 → critical processing 02 → branching processing 03, processing flow alteration in branch processing 02 When the execution of the critical process 02 is skipped as follows: normal process 01 → branch process 01 → critical process 01 → branch process 02 → branch process 03 → critical process 02 → branch process 03 In the holding area, as shown in FIG. 8B, a PC value corresponding to each specific instruction is stored. Then, the CPU 11 adds the PC values (“0x003253” and “0x003469” shown in FIG. 8B) stored in the holding area for PC values etc. during execution in normal / error determination, and adds the added value ( 0x0066CC) is compared to determine whether or not a value matching the pre-PC value etc. holding area is stored. Since the pre-PC value holding area shown in FIG. 7 does not match any value, it can be detected that the processing flow has been tampered with.

以上説明したように、上記実施形態によれば、コマンド処理において特定の命令を実行した場合、当該命令に対応するPC値等を事前PC値等保持領域に一時的に格納しておき、その後当該格納された値と、実行中PC値等保持領域に予め記憶されているPC値等と、が一致しているか否かを比較判別することにより上記コマンド処理が正常に行われたか否かを判別するように構成し、処理フロー改ざんの対策として単なるフラグではなく、PC値等を使用するように構成したので、正常実行、ループ処理を含む処理をも正常に行われたか否かをチェックすることができ、よって、セキュリティレベルを向上させることができる。   As described above, according to the above embodiment, when a specific instruction is executed in command processing, the PC value corresponding to the instruction is temporarily stored in the pre-PC value etc. holding area, and then It is determined whether or not the command processing is normally performed by comparing and determining whether or not the stored value and the PC value or the like stored in advance in the holding area for the PC value or the like during execution match. As a countermeasure against processing flow tampering, it is configured to use a PC value, etc., not just a flag, so check whether normal execution and processing including loop processing have also been performed normally. Therefore, the security level can be improved.

また、上記実施形態によれば、特段のセキュリティ機構を持たないコンピュータに対するフロー改ざんを防止することができ、局所的な対策から、処理全体に対する対策までスケーリングが可能である。   In addition, according to the above-described embodiment, it is possible to prevent flow tampering for a computer that does not have a special security mechanism, and it is possible to scale from a local countermeasure to a countermeasure for the entire process.

更に、ハードウェアに最も近いアセンブリレベルでの対策、および高級言語における対策をサポートすることができる。   Further, it is possible to support an assembly level countermeasure closest to the hardware and a countermeasure in a high-level language.

なお、上記図6で示したように、条件分岐など、複数のパスを持つコマンド処理に対しては、想定される全てのパスに対してPC値等(例えば、加算値)を計算、格納しておき、どのパスを経た場合でも比較を実施するように構成する他にも、例えば、特定のパス(例えば、正常系)についてのみPC値等を計算、格納しておき、それ以外のパス(例えば、異常系)についてはPC値等を計算、格納しないように構成しても良い。この構成によれば、記憶領域をより有効に活用することができる。   As shown in FIG. 6 above, for command processing having a plurality of paths such as conditional branching, PC values and the like (for example, addition values) are calculated and stored for all possible paths. In addition to the configuration in which the comparison is performed in any path, for example, the PC value or the like is calculated and stored only for a specific path (for example, a normal system), and other paths ( For example, for an abnormal system), a PC value or the like may not be calculated and stored. According to this configuration, the storage area can be used more effectively.

ここで、正常系とは、プログラムにおいて、利用者が正常な操作、運用を行ったと判断されるケースを意味する。この具体例としては、以下の(i)〜(iii)が挙げられる。   Here, the normal system means a case in which it is determined in the program that the user has operated and operated normally. Specific examples thereof include the following (i) to (iii).

(i)パーソナルコンピュータのログイン画面で正しいパスワードを入力したため、ログイン可能となり、以降、パーソナルコンピュータの機能を利用できるようになった。   (I) Since the correct password was entered on the login screen of the personal computer, it was possible to log in and the functions of the personal computer could be used thereafter.

(ii)携帯電話機で正しいPINの入力を行ったので、通話が可能になった。   (Ii) Since the correct PIN was entered on the mobile phone, a call became possible.

(iii)USBメモリに、メモリに格納可能なサイズのファイルをコピーしたので、メモリ内に正しくファイルがコピーされた。   (Iii) Since a file having a size that can be stored in the memory was copied to the USB memory, the file was correctly copied in the memory.

一方、異常系とは、プログラムにおいて、利用者が不正な(許可されない)操作や、誤った操作を行ったと判断されるケースを意味する。この具体例としては、以下の(iv)〜(vi)が挙げられる。   On the other hand, an abnormal system means a case where it is determined that a user performs an illegal (not permitted) operation or an erroneous operation in the program. Specific examples thereof include the following (iv) to (vi).

(iv)パーソナルコンピュータのログオン画面で間違ったパスワードを入力したため、ログインを拒否された。   (Iv) Login was rejected because an incorrect password was entered on the personal computer logon screen.

(v)携帯電話機でPINの入力値を間違えたため、通話することができなくなった。   (V) The user cannot make a call because the input value of the PIN is wrong on the mobile phone.

(vi)USBメモリに、メモリに格納できないサイズのファイルをコピーしようとしたら、コピーできない旨のメッセージが表示された。   (Vi) When attempting to copy a file of a size that cannot be stored in the USB memory, a message indicating that the file cannot be copied was displayed.

また、上記図6においては、クリティカル処理02が最大2回実行されることが設計上明らかであるとしたが、同一の特定の命令が何回実行されるかが明らかでない場合(例えば、ICカードの提供先でアプリケーションをインストールするような場合)が想定される。このような場合、CPU11は、特定の命令を実行した回数(n回)をもPC値等と共に一時的に事前PC値等保持領域に格納しておき、当該格納された回数とPC値等との積と、当該格納された回数と実行中PC値等保持領域に事前に格納されたPC値等との積と、が一致しているか否かを比較判別することによりコマンド処理が正常に行われたか否かを判別するように構成すれば、同一の特定の命令が何回実行されるかが明らかでないにも対応することができる。   In FIG. 6, it is apparent from the design that the critical process 02 is executed at most twice, but it is not clear how many times the same specific instruction is executed (for example, an IC card) In the case of installing the application at the service provider). In such a case, the CPU 11 temporarily stores the number of times of executing a specific instruction (n times) together with the PC value or the like in the pre-PC value holding area, and the stored number of times and the PC value or the like. The command processing is executed normally by comparing whether or not the product of the stored number and the product of the number of times stored and the PC value stored in advance in the execution value holding area are the same. If it is configured to discriminate whether or not it has been received, it is possible to cope with the case where it is not clear how many times the same specific instruction is executed.

なお、上記実施形態においては、ICカードを例にとって説明したが、メモリカード等のその他のセキュリティデバイス、例えば、PC値を保持するCPUを搭載し高度なセキュリティ強度が要求され揮発性及び不揮発性メモリを備えたコンピュータにおいて適用が可能である。   In the above-described embodiment, the IC card has been described as an example. However, other security devices such as a memory card, for example, a CPU that holds a PC value is mounted, and high security strength is required. The present invention can be applied to a computer having

本実施形態に係るICチップのハードウェア構成例を示す図である。It is a figure which shows the hardware structural example of the IC chip which concerns on this embodiment. ICチップ内のメモリマップの概略図である。It is the schematic of the memory map in IC chip. CPU11におけるコマンド処理の一例を示すフローチャートである。It is a flowchart which shows an example of the command processing in CPU11. (A)は、PC値を格納した事前PC値等保持領域の一例を示す図であり、(B)は、PC値に対して所定の演算を施した値を格納した事前PC値等保持領域の一例を示す図である。(A) is a diagram showing an example of a pre-PC value etc. holding area in which PC values are stored, and (B) is a pre-PC value etc. holding area in which values obtained by performing a predetermined operation on PC values are stored. It is a figure which shows an example. (A)は、複数のPC値を連結しハッシュ計算により縮退する例を示す図であり、(B)は、複数のPC値のXOR計算により縮退する例を示す図である。(A) is a figure which shows the example which concatenates several PC value and degenerates by hash calculation, (B) is a figure which shows the example reduced by XOR calculation of several PC value. 分岐、ループを含むコマンド処理の一例を示すフローチャートである。It is a flowchart which shows an example of the command processing containing a branch and a loop. 各パスにおける加算値を各パスに対応付けて格納した事前PC値等保持領域の一例を示す図である。It is a figure which shows an example of holding | maintenance area | regions, such as a prior | preceding PC value which stored the addition value in each path | pass in association with each path | pass. PC値を格納した実行中PC値等保持領域の一例を示す図である。It is a figure which shows an example of holding area | regions, such as a PC value in execution which stored PC value.

符号の説明Explanation of symbols

1 ICチップ
11 CPU
12 ROM
13 不揮発性メモリ
14 RAM
15 I/O回路
1 IC chip 11 CPU
12 ROM
13 Nonvolatile memory 14 RAM
15 I / O circuit

Claims (12)

一連の処理において実行される複数の命令からなるプログラムを記憶するプログラム記憶手段と、
前記複数の命令のうち、特定の命令が格納されている記憶領域のアドレスに関する第一の値を、前記命令の実行前に予め記憶するアドレス記憶手段と、
前記命令を実行するCPUと、
を備え、
前記第一の値は、前記特定の命令が格納されている記憶領域のアドレスを示す値に対して所定の演算を施した値であり、
前記CPUは、前記特定の命令を実行した場合、当該命令が格納されている記憶領域のアドレスを示す値を一時的に格納しておき、その後当該格納された値に対して所定の演算を施した第二の値と、前記アドレス記憶手段に予め記憶されている前記第一の値と、が一致しているか否かを比較判別することにより前記処理が正常に行われたか否かを判別することを特徴とする情報処理装置。
Program storage means for storing a program comprising a plurality of instructions executed in a series of processes;
Address storage means for storing a first value related to an address of a storage area in which a specific instruction is stored among the plurality of instructions in advance before execution of the instruction;
A CPU for executing the instructions;
With
The first value is a value obtained by performing a predetermined operation on a value indicating an address of a storage area in which the specific instruction is stored;
When the CPU executes the specific instruction, the CPU temporarily stores a value indicating the address of the storage area in which the instruction is stored, and then performs a predetermined operation on the stored value. It is determined whether or not the processing has been normally performed by comparing and determining whether or not the second value thus obtained and the first value stored in advance in the address storage means match. An information processing apparatus characterized by that.
一連の処理において実行される複数の命令からなるプログラムを記憶するプログラム記憶手段と、
前記複数の命令のうち、特定の命令が格納されている記憶領域のアドレスに関する第一の値を、前記命令の実行前に予め記憶するアドレス記憶手段と、
前記命令を実行するCPUと、
を備え、
前記第一の値は、前記特定の命令が格納されている記憶領域のアドレスを示す値に対して所定の演算を施した値であり、
前記CPUは、前記特定の命令を実行した場合、当該命令が格納されている記憶領域のアドレスを示す値に対して所定の演算を施した値を第二の値として一時的に格納しておき、その後当該格納された第二の値と、前記アドレス記憶手段に予め記憶されている前記第一の値と、が一致しているか否かを比較判別することにより前記処理が正常に行われたか否かを判別することを特徴とする情報処理装置。
Program storage means for storing a program comprising a plurality of instructions executed in a series of processes;
Address storage means for storing a first value related to an address of a storage area in which a specific instruction is stored among the plurality of instructions in advance before execution of the instruction;
A CPU for executing the instructions;
With
The first value is a value obtained by performing a predetermined operation on a value indicating an address of a storage area in which the specific instruction is stored;
When the CPU executes the specific instruction, the CPU temporarily stores a value obtained by performing a predetermined operation on the value indicating the address of the storage area in which the instruction is stored as a second value. Then, whether or not the processing has been normally performed by comparing whether or not the stored second value matches the first value stored in advance in the address storage means. An information processing apparatus for determining whether or not .
請求項1又は2に記載の情報処理装置において、
前記特定の命令は複数有り、夫々の当該命令が格納されている記憶領域のアドレスは互いに異なることを特徴とする情報処理装置。
The information processing apparatus according to claim 1 or 2 ,
2. An information processing apparatus according to claim 1 , wherein there are a plurality of specific instructions, and addresses of storage areas in which the instructions are stored are different from each other .
一連の処理において実行される複数の命令からなるプログラムを記憶するプログラム記憶手段と、
前記複数の命令のうち、特定の命令が格納されている記憶領域のアドレスに関する第一の値を、前記命令の実行前に予め記憶するアドレス記憶手段と、
前記命令を実行するCPUと、
を備え、
前記特定の命令は複数有り、夫々の当該命令が格納されている記憶領域のアドレスは互いに異なり、
前記第一の値は、各前記特定の命令が格納されている各記憶領域のアドレスを示す各値を所定の演算により縮退した値であり、
前記CPUは、前記特定の命令を実行した場合、当該命令が格納されている記憶領域のアドレスを示す値を一時的に格納しておき、その後当該格納された値を前記演算により縮退し、当該縮退した第二の値と、前記アドレス記憶手段に予め記憶されている前記第一の値と、が一致しているか否かを比較判別することにより前記処理が正常に行われたか否かを判別することを特徴とする情報処理装置。
Program storage means for storing a program comprising a plurality of instructions executed in a series of processes;
Address storage means for storing a first value related to an address of a storage area in which a specific instruction is stored among the plurality of instructions in advance before execution of the instruction;
A CPU for executing the instructions;
With
There are a plurality of the specific instructions, and the addresses of the storage areas where the respective instructions are stored are different from each other.
The first value is a value obtained by degenerating each value indicating an address of each storage area in which each specific instruction is stored by a predetermined operation,
When the CPU executes the specific instruction, the CPU temporarily stores a value indicating an address of a storage area in which the instruction is stored, and then degenerates the stored value by the calculation, It is determined whether or not the processing has been normally performed by comparing and determining whether or not the degenerated second value matches the first value stored in advance in the address storage unit. An information processing apparatus characterized by:
請求項4に記載の情報処理装置において、
前記演算はハッシュ計算又はXOR計算であることを特徴とする情報処理装置。
The information processing apparatus according to claim 4 ,
The information processing apparatus is characterized in that the calculation is hash calculation or XOR calculation .
請求項1乃至5の何れか一項に記載の情報処理装置において、
前記アドレスを示す値は、プログラムカウンタの値であることを特徴とする情報処理装置。
The information processing apparatus according to any one of claims 1 to 5 ,
The value indicating the address is a value of a program counter .
請求項1乃至6の何れか一項に記載の情報処理装置において、
前記CPUは、前記特定の命令を複数回実行した場合、その回数をも一時的に格納しておき、当該格納された回数と前記第二の値との積と、前記格納された回数と前記アドレス記憶手段に予め記憶されている前記第一の値との積と、が一致しているか否かを比較判別することにより前記処理が正常に行われたか否かを判別することを特徴とする情報処理装置。
The information processing apparatus according to any one of claims 1 to 6 ,
When the CPU executes the specific instruction a plurality of times, the CPU also temporarily stores the number of times, the product of the stored number and the second value, the stored number of times, It is determined whether or not the processing has been normally performed by comparing and determining whether or not the product of the first value stored in advance in the address storage means matches. Information processing device.
請求項乃至7の何れか一項に記載の情報処理装置において、
前記特定の命令は、前記一連の処理に含まれる、セキュリティレベルを維持するために必要なクリティカル処理において実行されることを特徴とする情報処理装置。
The information processing apparatus according to any one of claims 1 to 7,
The information processing apparatus is characterized in that the specific instruction is executed in a critical process necessary for maintaining a security level included in the series of processes .
一連の処理において実行される複数の命令からなるプログラムを記憶するプログラム記憶手段と、
前記複数の命令のうち、特定の命令が格納されている記憶領域のアドレスに関する第一の値を、前記命令の実行前に予め記憶するアドレス記憶手段と、
前記命令を実行するCPUと、
を用いた正常処理判別方法であって、
前記第一の値は、前記特定の命令が格納されている記憶領域のアドレスを示す値に対して所定の演算を施した値であり、
前記CPUが、前記特定の命令を実行した場合、当該命令が格納されている記憶領域のアドレスを示す値を一時的に格納しておき、その後当該格納された値に対して所定の演算を施した第二の値と、前記アドレス記憶手段に予め記憶されている前記第一の値と、が一致しているか否かを比較判別することにより前記処理が正常に行われたか否かを判別することを特徴とする正常処理判別方法
Program storage means for storing a program comprising a plurality of instructions executed in a series of processes;
Address storage means for storing a first value related to an address of a storage area in which a specific instruction is stored among the plurality of instructions in advance before execution of the instruction;
A CPU for executing the instructions;
A normal processing discrimination method using
The first value is a value obtained by performing a predetermined operation on a value indicating an address of a storage area in which the specific instruction is stored;
When the CPU executes the specific instruction, it temporarily stores a value indicating the address of the storage area in which the instruction is stored, and then performs a predetermined operation on the stored value. It is determined whether or not the processing has been normally performed by comparing and determining whether or not the second value thus obtained and the first value stored in advance in the address storage means match. A normal processing discrimination method characterized by the above .
一連の処理において実行される複数の命令からなるプログラムを記憶するプログラム記憶手段と、
前記複数の命令のうち、特定の命令が格納されている記憶領域のアドレスに関する第一の値を、前記命令の実行前に予め記憶するアドレス記憶手段と、
前記命令を実行するCPUと、
を用いた正常処理判別方法であって、
前記第一の値は、前記特定の命令が格納されている記憶領域のアドレスを示す値に対して所定の演算を施した値であり、
前記CPUが、前記特定の命令を実行した場合、当該命令が格納されている記憶領域のアドレスを示す値に対して所定の演算を施した値を第二の値として一時的に格納しておき、その後当該格納された第二の値と、前記アドレス記憶手段に予め記憶されている前記第一の値と、が一致しているか否かを比較判別することにより前記処理が正常に行われたか否かを判別することを特徴とする正常処理判別方法
Program storage means for storing a program comprising a plurality of instructions executed in a series of processes;
Address storage means for storing a first value related to an address of a storage area in which a specific instruction is stored among the plurality of instructions in advance before execution of the instruction;
A CPU for executing the instructions;
A normal processing discrimination method using
The first value is a value obtained by performing a predetermined operation on a value indicating an address of a storage area in which the specific instruction is stored;
When the CPU executes the specific instruction, a value obtained by performing a predetermined operation on the value indicating the address of the storage area in which the instruction is stored is temporarily stored as a second value. Then, whether or not the processing has been normally performed by comparing whether or not the stored second value matches the first value stored in advance in the address storage means. A normal processing determination method characterized by determining whether or not .
一連の処理において実行される複数の命令からなるプログラムを記憶するプログラム記憶手段と、
前記複数の命令のうち、特定の命令が格納されている記憶領域のアドレスに関する第一の値を、前記命令の実行前に予め記憶するアドレス記憶手段と、
前記命令を実行するCPUと、
を備えた情報処理装置における前記CPUを、実行した前記命令のうち前記特定の命令が格納されている記憶領域のアドレスに関する第二の値と、前記アドレス記憶手段に予め記憶されている前記第一の値と、が一致しているか否かを比較判別することにより前記処理が正常に行われたか否かを判別するように機能させる情報処理プログラムであって、
前記第一の値は、前記特定の命令が格納されている記憶領域のアドレスを示す値に対して所定の演算を施した値であり、
前記情報処理プログラムは、前記CPUを、前記特定の命令を実行した場合、当該命令が格納されている記憶領域のアドレスを示す値を一時的に格納しておき、その後当該格納された値に対して所定の演算を施した前記第二の値と、前記アドレス記憶手段に予め記憶されている前記第一の値と、が一致しているか否かを比較判別することにより前記処理が正常に行われたか否かを判別するように機能させることを特徴とする情報処理プログラム
Program storage means for storing a program comprising a plurality of instructions executed in a series of processes;
Address storage means for storing a first value related to an address of a storage area in which a specific instruction is stored among the plurality of instructions in advance before execution of the instruction;
A CPU for executing the instructions;
The CPU in the information processing apparatus comprising: the second value related to the address of the storage area in which the specific command is stored among the executed commands; and the first value stored in advance in the address storage unit An information processing program that functions to determine whether or not the process has been normally performed by comparing and determining whether or not the value of
The first value is a value obtained by performing a predetermined operation on a value indicating an address of a storage area in which the specific instruction is stored;
When the CPU executes the specific instruction, the information processing program temporarily stores a value indicating an address of a storage area in which the instruction is stored, and then stores the value for the stored value. The processing is normally performed by comparing and determining whether or not the second value that has been subjected to the predetermined calculation matches the first value stored in advance in the address storage means. An information processing program that functions to determine whether or not an error has occurred .
一連の処理において実行される複数の命令からなるプログラムを記憶するプログラム記憶手段と、
前記複数の命令のうち、特定の命令が格納されている記憶領域のアドレスに関する第一の値を、前記命令の実行前に予め記憶するアドレス記憶手段と、
前記命令を実行するCPUと、
を備えた情報処理装置における前記CPUを、実行した前記命令のうち前記特定の命令が格納されている記憶領域のアドレスに関する第二の値と、前記アドレス記憶手段に予め記憶されている前記第一の値と、が一致しているか否かを比較判別することにより前記処理が正常に行われたか否かを判別するように機能させる情報処理プログラムであって、
前記第一の値は、前記特定の命令が格納されている記憶領域のアドレスを示す値に対して所定の演算を施した値であり、
前記情報処理プログラムは、前記CPUを、前記特定の命令を実行した場合、当該命令が格納されている記憶領域のアドレスを示す値に対して所定の演算を施した値を前記第二の値として一時的に格納しておき、その後当該格納された値と、前記アドレス記憶手段に予め記憶されている前記第一の値と、が一致しているか否かを比較判別することにより前記処理が正常に行われたか否かを判別するように機能させることを特徴とする情報処理プログラム。
Program storage means for storing a program comprising a plurality of instructions executed in a series of processes;
Address storage means for storing a first value related to an address of a storage area in which a specific instruction is stored among the plurality of instructions in advance before execution of the instruction;
A CPU for executing the instructions;
The CPU in the information processing apparatus comprising: the second value related to the address of the storage area in which the specific command is stored among the executed commands; and the first value stored in advance in the address storage unit An information processing program that functions to determine whether or not the process has been normally performed by comparing and determining whether or not the value of
The first value is a value obtained by performing a predetermined operation on a value indicating an address of a storage area in which the specific instruction is stored;
When the CPU executes the specific instruction, the information processing program sets, as the second value, a value obtained by performing a predetermined operation on a value indicating an address of a storage area in which the instruction is stored. The processing is normal by temporarily storing and then comparing and determining whether or not the stored value matches the first value stored in advance in the address storage means. An information processing program that functions to determine whether or not the operation has been performed .
JP2008159072A 2008-06-18 2008-06-18 Information processing apparatus, normal processing determination method, and information processing program Active JP5200686B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008159072A JP5200686B2 (en) 2008-06-18 2008-06-18 Information processing apparatus, normal processing determination method, and information processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008159072A JP5200686B2 (en) 2008-06-18 2008-06-18 Information processing apparatus, normal processing determination method, and information processing program

Publications (2)

Publication Number Publication Date
JP2010002975A JP2010002975A (en) 2010-01-07
JP5200686B2 true JP5200686B2 (en) 2013-06-05

Family

ID=41584684

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008159072A Active JP5200686B2 (en) 2008-06-18 2008-06-18 Information processing apparatus, normal processing determination method, and information processing program

Country Status (1)

Country Link
JP (1) JP5200686B2 (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10228421A (en) * 1997-02-14 1998-08-25 Nec Ic Microcomput Syst Ltd Memory access control circuit
FR2790844B1 (en) * 1999-03-09 2001-05-25 Gemplus Card Int METHOD AND DEVICE FOR MONITORING THE PROGRESS OF A PROGRAM, PROGRAM DEVICE FOR MONITORING ITS PROGRAM
JP3854572B2 (en) * 2002-11-27 2006-12-06 株式会社エルイーテック Microprocessor
EP1450232A1 (en) * 2003-02-18 2004-08-25 SCHLUMBERGER Systèmes Method for code secure execution against attacks
EP1538509A1 (en) * 2003-12-04 2005-06-08 Axalto S.A. Method for securing a program execution against radiation attacks
JP5050893B2 (en) * 2008-02-08 2012-10-17 大日本印刷株式会社 IC card attack detection method, IC card and IC card program

Also Published As

Publication number Publication date
JP2010002975A (en) 2010-01-07

Similar Documents

Publication Publication Date Title
CN110990084B (en) Chip secure starting method and device, storage medium and terminal
US8375219B2 (en) Program and operation verification
JP6373888B2 (en) Information processing apparatus and control method
EP2294526B1 (en) A method for secure data reading and a data handling system
US8127144B2 (en) Program loader operable to verify if load-destination information has been tampered with, processor including the program loader, data processing device including the processor, promgram loading method, and integrated circuit
JP4864762B2 (en) Semiconductor memory device
JP4822231B2 (en) Fault detection due to long perturbations
JP2006522968A (en) Control execution of programs for virtual machines on portable data carriers
CN105893877B (en) Method for secure data reading and data processing system
US10148671B2 (en) Method for protecting a chip card against a physical attack intended to modify the logical behaviour of a functional program
JP5200686B2 (en) Information processing apparatus, normal processing determination method, and information processing program
US20060265578A1 (en) Detection of a sequencing error in the execution of a program
JP2008204085A (en) Semiconductor memory
US8527835B2 (en) Method for secure data transfer
US10242183B2 (en) Method of executing a program by a processor and electronic entity comprising such a processor
CN108200060B (en) Single sign-on authentication method, server and storage medium based on web subsystem
JP4728619B2 (en) Software falsification detection device, falsification prevention device, falsification detection method and falsification prevention method
EP3460702A1 (en) Method to detect an attack by fault injection on a sensitive operation
JP4701260B2 (en) Information processing apparatus, information processing method, and information processing program
JP2010128510A (en) Biological information authentication system
JP5949357B2 (en) Security token, data falsification detection method, and computer program
JP7247638B2 (en) Electronic information storage medium, IC card, falsification check method, and program
JP2009015434A (en) Portable information processor and information processing program
JP5070137B2 (en) Storage device and data writing device
JP2008123160A (en) Memory management method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110427

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20121010

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121023

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121217

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130128

R150 Certificate of patent or registration of utility model

Ref document number: 5200686

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20160222

Year of fee payment: 3