JP2005258968A - Validity verification method of data written in ic card, and program for ic card - Google Patents
Validity verification method of data written in ic card, and program for ic card Download PDFInfo
- Publication number
- JP2005258968A JP2005258968A JP2004071934A JP2004071934A JP2005258968A JP 2005258968 A JP2005258968 A JP 2005258968A JP 2004071934 A JP2004071934 A JP 2004071934A JP 2004071934 A JP2004071934 A JP 2004071934A JP 2005258968 A JP2005258968 A JP 2005258968A
- Authority
- JP
- Japan
- Prior art keywords
- card
- data
- authentication code
- written
- application
- 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.)
- Withdrawn
Links
Images
Abstract
Description
本発明は、クレジットカードサイズのプラスチックカードに半導体集積回路(以下、ICチップと記す)を埋め込んだICカードおよびICカードに搭載するプログラムに関し、更に詳しくはICカードに書込んだデータの正当性を検証する技術に関する。 The present invention relates to an IC card in which a semiconductor integrated circuit (hereinafter referred to as an IC chip) is embedded in a credit card-sized plastic card and a program mounted on the IC card. It relates to the technology to be verified.
ICカードとは、クレジットカードサイズのプラスチックカードにICチップを埋め込み、前記ICチップのメモリにデータを記録するカードである。近年ICカードはキャッシュカード、クレジットカードまたは電子マネーなどに幅広く応用されている。 An IC card is a card that embeds an IC chip in a credit card-sized plastic card and records data in the memory of the IC chip. In recent years, IC cards have been widely applied to cash cards, credit cards, electronic money, and the like.
前記ICチップのメモリには、ICカード発行処理時に初期データ(場合によってはプログラム)が書込まれる。前記メモリに誤ったデータもしくは不正なデータが書込まれると、運用時にトラブルが発生するため、誤ったデータもしくは不正なデータの書込みを防止すべく、ICカード発行処理時においては、ICカードに送信する書込みデータにMAC(MAC:Message Authentication Code)と呼ばれる認証コードを付加することが多い。 Initial data (in some cases, a program) is written into the memory of the IC chip during the IC card issuance process. If incorrect data or illegal data is written in the memory, troubles occur during operation. To prevent incorrect data or illegal data from being written, it is sent to the IC card during IC card issuance processing. In many cases, an authentication code called MAC (Message Authentication Code) is added to write data.
MACとは、ICカードに書込むデータを引数としてある関数fx()から演算され、前記書込むデータと一意に対応する値である。前記関数fx()としては、暗号関数やハッシュ関数が利用される。MACが付加された書込みデータをICカードが受信すると、ICカードは受信した書込みデータを引数として、前記MACを生成したときと同じ関数fx()を用いてICカード内部でMACを演算し、前記書込みデータに付加されたMACとICカード内部で演算したMACを比較する。MACの値が一致していれば、受信した書込みデータは信用できると判断し、ICカードは受信した書込みデータをメモリに書き込む。他人の出願に係る特許文献1においては、1つの書込みデータに異なる2つのMACを付加することで、より安全にICカードにデータを書き込むことができる方法を開示している。
ICカード発行処理に書込まれるデータのデータサイズは、アプリケーションの種類によっても異なるが、通常、数キロバイトから数十キロバイトである。ICカードが一度に受信できるデータサイズには限界があるため、ICカードは上述のようなデータサイズの大きいデータを一度に受信することはできない。数キロバイトから数十キロバイトにも及ぶようなデータサイズのデータを書き込む際は、前記データサイズより小さいデータサイズのデータ(以下、データブロックと記す)に分割し、複数のデータブロックをICカードに送信することで、データサイズの大きいデータをICカードのメモリに書き込む。 The data size of data written to the IC card issuing process is usually several kilobytes to several tens of kilobytes, although it varies depending on the type of application. Since there is a limit to the data size that can be received by the IC card at one time, the IC card cannot receive data having a large data size as described above. When writing data with a data size ranging from several kilobytes to several tens of kilobytes, it is divided into data with a data size smaller than the data size (hereinafter referred to as data blocks), and a plurality of data blocks are transmitted to the IC card. As a result, data having a large data size is written into the memory of the IC card.
しなしながら、前述の従来の技術では、ICカードは、受信した書込みデータをMACを用いて検証できるが、ICカードに書込みデータを送信する側は、ICカードに書き込まれたデータの正当性を検証することはできない問題があった。 However, in the above-described conventional technology, the IC card can verify the received write data using the MAC, but the side that transmits the write data to the IC card checks the validity of the data written to the IC card. There was a problem that could not be verified.
例えば、ICカードにデータサイズの大きいデータを複数のデータブロックに分けて送信する場合は、前記データブロックを送信する毎にMACが付加され、ICカードは前記MACの正当性が正しければ受信したデータブロックをメモリに書込む。このため、ICカードに送信される複数のデータブロックの内、一つのデータブロックが欠落(ICカードが受信しないことを意味する)しても、ICカードに書込みデータを送信する側は前記データブロックの欠落を確認することはできない問題が生じていた。 For example, when data having a large data size is divided into a plurality of data blocks and transmitted to an IC card, a MAC is added each time the data block is transmitted, and the IC card receives the received data if the MAC is correct. Write the block to memory. For this reason, even if one data block is missing (meaning that the IC card does not receive) among a plurality of data blocks transmitted to the IC card, the side that transmits the write data to the IC card is There was a problem that it was not possible to confirm the lack of.
上述の問題を鑑みて、本発明は、ICカード発行システム等のICカードに書込みデータを送信する外部装置が、ICカードに書込まれたデータの正当性を検証し、書込みデータの欠落や書込みデータの改竄を検知できるICカードの書込みデータ検証方法を提供することを目的とする。 In view of the above problems, the present invention enables an external device that transmits write data to an IC card such as an IC card issuing system to verify the validity of the data written to the IC card and An object of the present invention is to provide an IC card write data verification method capable of detecting data tampering.
前述の問題を解決するために第1の課題解決手段は、ICカードに書込まれたデータの正当性検証方法であって、外部装置から送信した書込みデータの認証コードを要求する認証コード要求コマンドを、外部装置からICカードに送信するステップと、前記ICカードがメモリに書込んだデータに基く第1の認証コードを演算し、前記外部装置に前記第1の認証コードを送信するステップと、前記外部装置がICカードに送信した書込みデータに基づく第2の認証コードを演算するステップと、前記外部装置が前記第1の認証コードと前記第2の認証コードを比較するステップとからなることを特徴とするICカードに書込まれたデータの正当性検証方法である。 In order to solve the above-mentioned problem, a first problem solving means is a method for verifying the validity of data written in an IC card, and an authentication code request command for requesting an authentication code of write data transmitted from an external device Transmitting from the external device to the IC card, calculating a first authentication code based on the data written in the memory by the IC card, and transmitting the first authentication code to the external device; Comprising a step of calculating a second authentication code based on write data transmitted from the external device to the IC card, and a step of comparing the first authentication code and the second authentication code by the external device. This is a method for verifying the validity of data written on a characteristic IC card.
第1の課題解決手段によれば、外部装置がICカードに書込まれたデータに基づく第1の認証コードをICカードから取得し、ICカードに送信した書込みデータに基づく第2の認証コードと比較することで、外部装置はICカードに書込まれたデータの正当性を検証できる。例えば、前述のデータブロックの欠落が生じると、前記第1の認証コードと前記第2の認証コードが一致しないため、前記外部装置はデータブロックの欠落等によってICカードに書込まれたデータが正当でないことを知ることができる。 According to the first problem solving means, the first authentication code based on the data written in the IC card by the external device is acquired from the IC card, and the second authentication code based on the write data transmitted to the IC card; By comparing, the external device can verify the validity of the data written in the IC card. For example, if the data block is lost, the first authentication code and the second authentication code do not match. You can know that it is not.
更に第2の課題解決手段は、第1の課題解決手段に記載のデータの正当性検証方法において、前記認証コード要求コマンドはICカードにデータを書き込む最終のコマンドであることを特徴とするICカードに書込まれたデータの正当性検証方法である。第2の課題解決手段によれば、前記認証コード要求コマンドをデータを書き込む最終のコマンドとすることで、前記外部装置は前記第1の認証コードを取得するために、特別なコマンドをICカードに送信する必要は無くなる。 Further, the second problem solving means is the data validity verification method according to the first problem solving means, wherein the authentication code request command is a final command for writing data to the IC card. This is a method for verifying the validity of the data written in the. According to the second problem solving means, by making the authentication code request command the final command for writing data, the external device sends a special command to the IC card in order to obtain the first authentication code. There is no need to send.
更に第3の課題解決手段は、ICカードに搭載されるICカード用プログラムであって、外部装置から送信される認証コード要求コマンドを受信するステップと、メモリに書込んだデータに基づく認証コードを演算するステップと、前記認証コードを前記外部装置に送信するステップを順に実行する手順を少なくとも含むことを特徴とするICカード用プログラムである。ICカードが第3の課題解決手段のICカード用プログラムを実装することで、第1の課題解決手段、第2の課題解決手段が実現できる。 Further, a third problem solving means is an IC card program mounted on an IC card, the step of receiving an authentication code request command transmitted from an external device, and an authentication code based on the data written in the memory. An IC card program comprising at least a procedure for sequentially executing a step of calculating and a step of transmitting the authentication code to the external device. By mounting the IC card program of the third problem solving means on the IC card, the first problem solving means and the second problem solving means can be realized.
更に第4の課題解決手段は、前記認証コード要求コマンドはICカードにデータを書き込む最終のコマンドであることを特徴とする第3の課題解決手段に記載のICカード用プログラムである。第4の課題解決手段のICカード用プログラムを実装することで、第2の課題解決手段が実現できる。 The fourth problem solving means is the IC card program according to the third problem solving means, wherein the authentication code request command is a final command for writing data to the IC card. By implementing the IC card program of the fourth problem solving means, the second problem solving means can be realized.
これまで述べたように、本発明のICカードに書込まれたデータの正当性検証方法およびICカード用プログラムを用いれば、外部装置はICカードから取得する前記第1の認証コードと外部装置が演算する前記第2の認証コードから、ICカードに書込まれたデータの正当性を検証できる。外部装置がICカードに書込まれたデータの正当性を検証できることは、前述のデータブロックの欠落を検知できるばかりではなく、ICカードに送信した書込みデータの改竄も検知することができる。 As described above, if the method for verifying the validity of the data written in the IC card of the present invention and the IC card program are used, the external device can obtain the first authentication code acquired from the IC card and the external device. The validity of the data written in the IC card can be verified from the second authentication code to be calculated. The ability of the external device to verify the validity of the data written to the IC card can not only detect the aforementioned missing data block, but also detect falsification of the write data transmitted to the IC card.
〔本発明の第1の実施の形態〕
ICカードに搭載されたアプリケーションの発行処理、すなわちアプリケーションが使用する初期データをICチップが具備するメモリに書き込む処理に、本発明を適用した実施の形態について、以下に図を参照にしながら詳細に説明する。まず初めに発行システムおよびアプリケーションについてそれぞれ説明し、つづいて発行処理時にICカードに書込まれたデータの正当性検証方法の手順について説明し、そして前記正当性検証方法に必要なICカード用プログラムの動作手順について説明する。
[First embodiment of the present invention]
An embodiment in which the present invention is applied to a process of issuing an application mounted on an IC card, that is, a process of writing initial data used by an application to a memory included in an IC chip will be described in detail below with reference to the drawings. To do. First, each of the issuing system and application will be described, then the procedure of the method of verifying the validity of the data written to the IC card during the issuing process will be described, and the IC card program required for the method of verifying validity will be described. The operation procedure will be described.
<発行システムおよびアプリケーションの説明>
図1はICカード発行システム100の概略図である。ICカード発行システム100は、ICカード200とデータ通信し、ICカード200の書換え可能なメモリにデータを書き込む外部装置である。ICカード発行システム100は、ICカード200に書込むデータを記憶する記憶装置110、ICカード200に書込むデータからICカード200に送信するAPDU(APDU:Application Protocol Data Unit)を生成するAPDU生成装置120、およびICカード200とデータ通信しデータの読み書きを行なうリーダライタ130を少なくとも備えている。
<Description of issuing system and application>
FIG. 1 is a schematic diagram of an IC
図2は、ICカード200に埋め込まれるICチップ210の構成図である。ICチップ210には、演算機能およびICチップ210が具備するデバイスを制御する機能を備えた中央演算装置211(CPU:Central Processing Unit、以下CPUと記す)、読み出し専用メモリ212(RO:Read Only Memory、以下ROMと記す)、書換え可能なメモリとしてEEPROM213(EEPROM:Electrically Erasable Programmable Read-Only Memoryの略)、揮発性メモリとしてランダムアクセスメモリ214(RAM:Random Access Memory、以下RAMと記す)、およびリーダライタ130とデータ通信するためのI/O回路215を少なくとも備なえている。本発明は、ICチップ210の仕様をなんら限定するものではなく、ICカード200の用途に適した仕様のICチップ210を選択することができる。例えばROM212およびEEPROM213の容量については限定しないし、書換え可能なメモリは強誘電体メモリまたはフラッシュメモリ等のEEPROM以外のメモリであっても構わない。またICチップ210は乱数を生成する回路、暗号演算回路等の図示していない他のデバイスを備えていても構わない。
FIG. 2 is a configuration diagram of the
図3は、APDU生成装置120によって生成されるデータ書込みコマンドAPDUおよび前記コマンドに対応するレスポンスAPDUの構造を示した図である。ここで前記データ書込みコマンドとは、EEPROMに所定のデータを書き込むために、ICカード発行システム100がICカード200に送信するコマンドである。前記レスポンスAPDUとは、ICカード200が前記データ書込みコマンドを受信・処理した後、ICカード200がICカード発行システムに返信するレスポンスである。
FIG. 3 is a diagram showing the structure of a data write command APDU generated by the
図3(a)はデータ書込みコマンドAPDU300の説明図である。データ書込みAPDU300は、コマンドコード301、コマンドパラメータ302およびデータフィールド303から構成されている。CPU211はコマンドコード301から処理内容(本実施の形態ではデータ書込み処理)を識別し、詳細な実行条件をコマンドパラメータ302から判断する。EEPROM213に書込まれるデータは、データフィールド303に格納される。
FIG. 3A is an explanatory diagram of the data write command APDU 300. The data write APDU 300 includes a
図3(b)はレスポンスAPDU310の説明図である。レスポンスAPDU310は、レスポンスデータ311およびレスポンスコード312から構成される。レスポンスデータ311は、ICカード200がICカード発行システム100に送信するデータで、送信するデータが無ければレスポンスデータ311は無くてもよい。レスポンスコード312は、データ書込み処理の成功/失敗を示すコードで、ICカード発行システム100はレスポンスコード312から、データ書込みコマンドAPDUで送信したデータが正常に書込まれたことを認識できる。
FIG. 3B is an explanatory diagram of the
図4はICカードに搭載されるアプリケーション400を説明するための図である。アプリケーション400は、CPU211に対する命令を記述したアプリケーションコード410と、アプリケーションコード410が使用するアプリケーションデータ420から構成される。
FIG. 4 is a diagram for explaining an
アプリケーションコード410はEEPROM213にデータを書き込む処理を実行するコードを少なくとも含み、本発明のICカード用プログラムもアプリケーションコード410に含まれる。アプリケーションコード410は、通常、マルチアプリケーション型ICカードの場合は書換え可能なメモリに実装され、専用型ICカード(Native型ICカード)の場合はROMに実装される。本発明のICカードに書込んだデータの正当性検証方法は、ICカードに搭載されるプログラムによって実現されるため、プログラムが実行できれば、アプリケーションコード310が実装されるメモリの種別は問わない。
The
アプリケーションデータ420は、アプリケーションコード410が使用するデータで、ICカード一枚ごとに異なる。マルチアプリケーション型ICカードおよび専用型ICカードともに、アプリケーションデータ420は書換え可能なメモリ(本実施の形態ではEEPROM213)に記録される。アプリケーションデータ420のデータサイズは、アプリケーション400の種類によって異なるが数キロバイトから数十キロバイトにも及ぶ。
The
アプリケーション400は、外部装置(ICカード発行システム100)からデータ書込みコマンドAPDUを受信すると、受信したデータ書込みコマンドAPDUに含まれるコマンドコードをアプリケーションコード410が解釈し、前記コマンドコードに対応した処理(データ書込み処理)を実行する。ICチップ210が具備しているI/O回路215は一度に数キロバイトにも及ぶデータ(例えば電子証明証等)を受信することができないので、発行処理時にデータサイズの大きいデータをEEPROM213に書き込む際は、ICカード発行システム100はデータサイズの大きいデータをI/O回路215が一度に受信できるデータ(データブロック)に分割し、複数のデータ書込みコマンドAPDUにわけてICカード200に送信する。
When the
ICカード製造会社またはICカード発行会社に備えれているICカード発行システムを用いて発行する場合は、ICカードに送信されるコマンドAPDUが欠落することはまずないが、インターネット経由でICカードを発行する場合は、ICカードに送信するコマンドAPDUが欠落することがある。ここで、コマンドAPDUが欠落するとは、複数にわけて送信されるコマンドAPDUの少なくとも一つのコマンドAPDUをICチップが受信しないことを意味する。コマンドAPDUが欠落したまま、ICカードにデータが書込まれると、運用時にICカードの動作不良が生じる。 When issuing using the IC card issuing system provided by the IC card manufacturer or IC card issuing company, it is unlikely that the command APDU transmitted to the IC card will be lost, but the IC card is issued via the Internet. In this case, the command APDU transmitted to the IC card may be lost. Here, “missing command APDU” means that the IC chip does not receive at least one command APDU of command APDUs transmitted in plural. If data is written to the IC card with the command APDU missing, the IC card malfunctions during operation.
そこで、本発明は、ICカード発行システム100がICカードに書込まれたデータの正当性を検証することで、前述のコマンドAPDUの欠落等の異常をICカード発行システムが検知できることを目的としている。
Therefore, the present invention has an object of enabling the IC card issuing system to detect an abnormality such as a missing command APDU described above by verifying the validity of data written to the IC card by the IC
<アプリケーション発行手順の詳細な説明>
ここから、アプリケーション400の発行処理、すなわちアプリケーションデータ420をEEPROM213に書き込む処理を例にとり、本発明のICカードに書込まれたデータの正当性検証方法を図を参照しながら詳細に説明する。図5はICカードに書込まれたデータの正当性検証方法の動作手順を示した図、図6はICカードに書込まれたデータの正当性検証方法の動作手順の説明を補足するための図である。
<Detailed description of application issuance procedure>
From here, the issue verification process of the
図6(a)はアプリケーションの発行処理前の状態を示した図である。図6(a)に示すごとく、ICカード発行システム100が具備する記憶装置110にはアプリケーションデータ421が記憶され、アプリケーションデータ421はデータブロック1からデータブロック5までの5つのデータブロック422に分割され、それぞれのデータブロック422がICカード200に送信される。ICチップ210が具備するEEPROM213には、アプリケーションデータ421が書込まれるたの領域であるアプリケーションデータ領域423が設定され、アプリケーションデータ領域423にはデータは書き込まれていない。
FIG. 6A is a diagram showing a state before an application issuance process. As shown in FIG. 6A,
本発明のデータの正当性検証方法の最初のステップ(S100)は、APDU生成装置120がデータ書込みコマンドAPDUを生成するステップである。一つのデータ書込みコマンドAPDUのデータフィールドには、一つのデータブロック422が格納されてICカード200に送信される。ICカード200に送信するデータブロックが最終ブロックの場合は、送信するデータブロックが最終のデータブロックであることを意味するデータ書込みコマンドAPDUを送信する。例えば、図3において、送信するデータブロックが最終データブロックでない場合はコマンドパラメータ302を「00h」(hは16進表記を意味する)に設定し、送信するデータブロックが最終データブロックの場合はコマンドパラメータ302を「80h」に設定する。ICカード200は受信したデータ書込みコマンドAPDU300に含まれるコマンドパラメータ302から、送信されたデータブロックが最終ブロックであることを判断する。
The first step (S100) of the data validity verification method of the present invention is a step in which the
次のステップ(S110)は、ICカード発行システム100がICカード200にステップS100で生成したデータ書込みコマンドAPDUを送信するステップである。ICカード発行システム100は前記生成したデータ書込みコマンドAPDUを送信した後、ICカード200からデータ書込みコマンドAPDUに対応するレスポンスAPDUを受信する。
The next step (S110) is a step in which the IC
次のステップ(S120)は、ICカード発行システム100が最終データブロックが送信済であることを確認するステップである。最終データブロックが送信済ならばステップS130へ進み、最終データブロックが送信済でなければステップS100に戻る。ICカード発行システム100はステップS100からステップS120までのステップを繰り返すことで、すべてのデータブロック422をICカード200に送信することができる。図6(b)は、5つのデータブロック422すべてがアプリケーションデータ領域423に書込まれた後の図である。
The next step (S120) is a step in which the IC
次のステップ(S130)は、ICカード発行システム100がICカード200に認証コード要求コマンドを送信するステップである。ICカード200は前記認証コード要求コマンドを受信すると、アプリケーションデータ領域423に書き込んだ5つのデータブロックから第1の認証コードである認証コード_Cを演算する。認証コード_Cの演算に使用する関数fx()は、書込んだデータを引数として値が一意に定まる関数fx()であればどのような関数fx()を用いてもよい。認証コードを演算する関数fx()としては、DES(DES:Data Encryption Standard)等の暗号関数、加算関数またはハッシュ関数を用いればよい。ICカード200は定めれた関数fx()で認証コード_Cを演算すると、演算した認証コード_CをICカード発行システム100に送信し、ICカード発行システム100はICカード200が演算した認証コード_Cを得る。
The next step (S130) is a step in which the IC
図6(c)は、認証コード_Cの演算を説明するための図である。ICカード200はアプリケーションデータ領域423に書込んだ5つのデータブロックすべてを引数として、関数fx()からICカードの認証コード_C500を演算する。すなわち、認証コード_C500はfx(データブロック1、データブロック2、データブロック3、データブロック4、データブロック5)の値である。演算した認証コード_C500はICカード発行システムに送信される。
FIG. 6C is a diagram for explaining the calculation of the authentication code _C. The
次のステップ(S140)は、ICカード発行システム100がICカード200に送信したすべてのデータブロックからICカード200と同じ関数fx()を用いて第2の認証コードである認証コード_Pを演算するステップである。
In the next step (S140), the authentication code _P, which is the second authentication code, is calculated from all data blocks transmitted to the
次のステップ(S150)は、ICカード発行システムが、ステップS130でICカード200から受信した認証コード_CとステップS140で演算した認証コード_Pを比較するステップである。
In the next step (S150), the IC card issuing system compares the authentication code_C received from the
図6(d)は、ICカード発行システム100が認証コード_Pを用いてICカードに書込まれたデータの正当性検証を説明するための図である。ICカード発行システム100はICカードに送信した5つのデータブロックすべてを引数として、関数fx()からICカード発行システム100の認証コード_P501を演算する。演算した認証コード_P501は認証コード_C500と比較される。それぞれの認証コードが一致すれば、ICカード200にはすべてのデータが正常に書込まれたと判断でき、一致しなければICカード200に書込まれデータには異常があると判断できる。例えば、図6においてICカード200がデータブロック3を受信できなかった場合は、ICカード200が演算した認証コード_Cはfx(データブロック1、データブロック2、データブロック4、データブロック5)の値となり、ICカード発行システム100が演算する認証コード_P501とは異なる値になるため、ICカード発行システム100はICカード200に書込まれたデータに異常があることがわかる。ステップS150の処理を実行後、本発明のデータの正当性検証方法は終了する。
FIG. 6D is a diagram for explaining the validity verification of the data written in the IC card by the IC
<ICカードに実装されるプログラムの動作手順>
次にICカード200に実装するプログラムの動作手順について、図を参照しながら説明する。図7は前記プログラムの動作手順の流れ図である。なお前述のように、本プログラムはアプリケーションコード410に含まれる。
<Operation procedure of program mounted on IC card>
Next, the operation procedure of the program mounted on the
最初のステップ(S200)は、ICカード200がデータ書込みコマンドAPDUを受信するステップである。データ書込みコマンドAPDUを受信すると、データ書込みコマンドAPDUからコマンドコード、コマンドパラメータならびにアプリケーションデータ領域423に書込むデータブロック422を抽出する。
The first step (S200) is a step in which the
次のステップ(S210)は、前記コマンドコードで示さる処理すわなちデータ書込み処理を実行するステップである。少なくともアプリケーションコード410はデータを書込み開始するアドレスを所持しており、データブロック422をアプリケーションデータ領域423に書込んだ後、前記データを書込み開始するアドレスを更新する。
The next step (S210) is a step of executing a process indicated by the command code, that is, a data write process. At least the
次のステップ(S220)は、前記データ書込みコマンドAPDUに対するレスポンスAPDUを送信するステップである。前記レスポンスAPDUのレスポンスコードにはデータ書込み処理の正常終了/異常終了を示すコードが含まれる。 The next step (S220) is a step of transmitting a response APDU to the data write command APDU. The response code of the response APDU includes a code indicating normal end / abnormal end of the data writing process.
次のステップ(S230)は、ステップS200で受信したデータ書込みコマンドAPDUが最終データブロックのデータ書き込みコマンドであるか確認するステップである。前記確認は、受信したデータ書込みコマンドAPDUに含まれるコマンドパラメータ302から判断する。最終データブロックの場合はS240へ進み、最終データブロックでない場合はステップS200へ戻る。アプリケーションコード310は、ステップS200からステップS230を繰り返すことで、複数のデータブロックを受信し、アプリケーションデータ421すべてをアプリケーションデータ領域423に書き込むことができる。
The next step (S230) is a step of confirming whether the data write command APDU received in step S200 is the data write command of the last data block. The confirmation is determined from the
次のステップは(S240)は、認証コード要求コマンドを受信するステップである。 The next step (S240) is a step of receiving an authentication code request command.
次のステップは(S250)は、認証コード_Cを演算し、演算した認証コード_Cをレスポンスデータに格納したレスポンスAPDUをICカード発行システム100に返信するステップである。認証コード_Cの演算に関してはすでに上述している。ステップS250を実行後、本発明のICカード用プログラムの処理は終了する。
The next step (S250) is a step of calculating the authentication code_C and returning a response APDU storing the calculated authentication code_C in the response data to the IC
これまで述べたように、本発明のICカードに書込まれたデータの正当性検証方法はおよびICカード用プログラムを用いれば、ICカードから取得する認証コード_CとICカード発行システムが演算する認証コード_Pから、ICカード発行システム100はICカードに書込まれたデータの正当性を検証できることは明らかである。
As described above, if the method of verifying the validity of the data written in the IC card of the present invention and the IC card program are used, the authentication code _C acquired from the IC card and the authentication calculated by the IC card issuing system are used. From the code _P, it is clear that the IC
〔第2、第3の実施の形態〕
ここから、これまで述べた第1の実施の形態以外の、他の実施の形態について説明を加える。
[Second and third embodiments]
From here, explanation is added about other embodiment other than 1st Embodiment described so far.
第2の実施の形態は、ICカード200は受信したデータ書込みコマンドAPDUが最終データブロックを書き込むコマンドであった場合、最終データブロックをEEPROMに書込んだ後、自動的に認証コード_Cを演算し、演算した認証コード_CをレスポンスAPDUのレスポンスデータに格納し送信することを特徴とする実施の形態である。第2の実施の形態においては、ICカード発行システム100は、認証コード要求コマンドをICカードに送信しなくとも、ICカード200から認証コード_Cを得ることができる。
In the second embodiment, when the received data write command APDU is a command for writing the final data block, the
図8は第2の実施の形態のデータ正当性検証方法の手順を示した図、図9は第2の実施の形態のICカード用プログラムの手順を示した図である。図8においては、図5のステップS130がステップS131に変更されている。すなわち図5においては、認証コード_Cを得るために、ICカード発行システム100はICカード200に認証コード要求コマンドを送信したが、図8においては、ICカード発行システム100は最終データブロックのデータ書込みコマンドAPDUに対するレスポンスAPDUから認証コード_Cを取得する。
FIG. 8 shows the procedure of the data validity verification method of the second embodiment, and FIG. 9 shows the procedure of the IC card program of the second embodiment. In FIG. 8, step S130 of FIG. 5 is changed to step S131. That is, in FIG. 5, the IC
また図9に示したICカード用プログラムの最初のステップS201そして次のステップS211はそれぞれ、図7のステップS200、ステップ210と同じ処理である。次のステップS221は、アプリケーションデータ領域423に書き込んだデータブロックが最終データブロックであるか確認するステップである。最終データブロックでない場合は、ステップS231に進みレスポンスAPDUを送信した後、ステップS201へ戻る。最終データブロックの場合はステップS241に進む。ステップS241においては認証コード_Cを演算し、ステップS241の次のステップS251にて演算した認証コード_Cを含むレスポンスAPDUを送信する。
Further, the first step S201 and the next step S211 of the IC card program shown in FIG. 9 are the same processes as steps S200 and 210 in FIG. 7, respectively. The next step S221 is a step of confirming whether the data block written in the
また第3の実施の形態は、データ書込みコマンドAPDUにMACを付加した実施の形態である。図10は、データ書き込みコマンドAPDUにMACが付加されたときのICカードのプログラムの動作手順を示した図である。図10においては、図5に加えてステップS202が追加されている。ステップS202においては、ステップS200で受信したデータ書込みコマンドAPDUのデータフィールドに含まれるデータブロックとMACを照合し、MACが正しければステップS210へ進み、MACが正しくなければデータ書込み処理を終了する。なおMACの演算には、認証コードと同じ関数を使用してもよく、異なる関数を使用してもよい。なお第3の実施の形態の説明においては、ICカードに書込まれたデータの正当性検証方法の手順は省略するが、第1の実施の形態の説明および第3の実施の形態の説明から、容易に第3の実施の形態のデータの正当性検証方法の手順は明らかになる。 The third embodiment is an embodiment in which a MAC is added to the data write command APDU. FIG. 10 is a diagram showing an operation procedure of the IC card program when the MAC is added to the data write command APDU. In FIG. 10, step S202 is added in addition to FIG. In step S202, the data block included in the data field of the data write command APDU received in step S200 is collated with the MAC. If the MAC is correct, the process proceeds to step S210. If the MAC is not correct, the data write process is terminated. In the MAC calculation, the same function as the authentication code may be used, or a different function may be used. In the description of the third embodiment, the procedure of the method for verifying the validity of the data written in the IC card is omitted, but from the description of the first embodiment and the description of the third embodiment. The procedure of the data validity verification method of the third embodiment will be readily apparent.
加えてこれまで述べた実施の形態においてはアプリケーションデータをEEPROMに書込む実施の形態について述べてきたが、マルチアプリケーションOSがアプリケーションをEEPROMに書き込む発行処理についても本発明を適用することができる。この場合はこれまで述べたICカード用プログラムはアプリケーションコードではなく、マルチアプリケーションOSに組み込まれる。 In addition, in the embodiment described so far, the embodiment in which application data is written in the EEPROM has been described. However, the present invention can also be applied to the issuing process in which the multi-application OS writes the application in the EEPROM. In this case, the IC card program described so far is incorporated not in the application code but in the multi-application OS.
100 ICカード発行システム
200 ICカード
210 ICチップ
300 コマンドAPDU
310 レスポンスAPDU
400 アプリケーション
410 アプリケーションコード
420 アプリケーションデータ
422 データブロック
423 EEPROM内のアプリケーションデータ領域
100 IC
310 Response APDU
400
Claims (4)
前記ICカードがメモリに書込んだデータに基く第1の認証コードを演算し、前記外部装置に前記第1の認証コードを送信するステップと、
前記外部装置がICカードに送信した書込みデータに基づく第2の認証コードを演算するステップと、前記外部装置が前記第1の認証コードと前記第2の認証コードを比較するステップとからなることを特徴とするICカードに書込まれたデータの正当性検証方法。 Transmitting an authentication code request command for requesting an authentication code of write data transmitted from the external device from the external device to the IC card;
Calculating a first authentication code based on the data written in the memory by the IC card, and transmitting the first authentication code to the external device;
Comprising a step of calculating a second authentication code based on write data transmitted from the external device to the IC card, and a step of comparing the first authentication code and the second authentication code by the external device. A method for verifying the validity of data written on a characteristic IC card.
前記認証コード要求コマンドはICカードにデータを書き込む最終のコマンドであることを特徴とするICカードに書込まれたデータの正当性検証方法。 In the data validity verification method according to claim 1,
The method for verifying the validity of data written to an IC card, wherein the authentication code request command is a final command for writing data to the IC card.
外部装置から送信される認証コード要求コマンドを受信するステップと、
メモリに書込んだデータに基づく認証コードを演算するステップと、
前記認証コードを前記外部装置に送信するステップを順に実行する手順を少なくとも含むことを特徴とするICカード用プログラム。 An IC card program mounted on an IC card,
Receiving an authentication code request command transmitted from an external device;
Calculating an authentication code based on the data written to the memory;
An IC card program, comprising at least a procedure for sequentially executing the steps of transmitting the authentication code to the external device.
前記認証コード要求コマンドはICカードにデータを書き込む最終のコマンドであることを特徴とするICカード用プログラム。
The IC card program according to claim 3,
The IC card program, wherein the authentication code request command is a final command for writing data to the IC card.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004071934A JP2005258968A (en) | 2004-03-15 | 2004-03-15 | Validity verification method of data written in ic card, and program for ic card |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004071934A JP2005258968A (en) | 2004-03-15 | 2004-03-15 | Validity verification method of data written in ic card, and program for ic card |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2005258968A true JP2005258968A (en) | 2005-09-22 |
Family
ID=35084593
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004071934A Withdrawn JP2005258968A (en) | 2004-03-15 | 2004-03-15 | Validity verification method of data written in ic card, and program for ic card |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2005258968A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007206765A (en) * | 2006-01-31 | 2007-08-16 | Dainippon Printing Co Ltd | Method of issuing ic card, ic card issuing system, and ic card |
JP2009175923A (en) * | 2008-01-23 | 2009-08-06 | Dainippon Printing Co Ltd | Platform integrity verification system and method |
JP2010108313A (en) * | 2008-10-30 | 2010-05-13 | Dainippon Printing Co Ltd | Integrity verification system and method for platform |
JP2012243133A (en) * | 2011-05-20 | 2012-12-10 | Toshiba Corp | Portable electronic device and control method of portable electronic device |
JP2013222348A (en) * | 2012-04-17 | 2013-10-28 | Dainippon Printing Co Ltd | Ic card and computer program |
JP2013246672A (en) * | 2012-05-28 | 2013-12-09 | Toppan Printing Co Ltd | Portable recording medium and terminal |
-
2004
- 2004-03-15 JP JP2004071934A patent/JP2005258968A/en not_active Withdrawn
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007206765A (en) * | 2006-01-31 | 2007-08-16 | Dainippon Printing Co Ltd | Method of issuing ic card, ic card issuing system, and ic card |
JP2009175923A (en) * | 2008-01-23 | 2009-08-06 | Dainippon Printing Co Ltd | Platform integrity verification system and method |
JP2010108313A (en) * | 2008-10-30 | 2010-05-13 | Dainippon Printing Co Ltd | Integrity verification system and method for platform |
JP2012243133A (en) * | 2011-05-20 | 2012-12-10 | Toshiba Corp | Portable electronic device and control method of portable electronic device |
JP2013222348A (en) * | 2012-04-17 | 2013-10-28 | Dainippon Printing Co Ltd | Ic card and computer program |
JP2013246672A (en) * | 2012-05-28 | 2013-12-09 | Toppan Printing Co Ltd | Portable recording medium and terminal |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20040059916A1 (en) | Memory card | |
JP3865629B2 (en) | Storage device | |
JP2007026118A (en) | Ic card, and program for ic card | |
US20090184799A1 (en) | Information storage medium and information storage medium processing apparatus | |
CN113348110B (en) | Electronic control device and security verification method for electronic control device | |
JP2002024046A (en) | Microcomputer, its memory contents changing system and memory contents changing method | |
JP2005258968A (en) | Validity verification method of data written in ic card, and program for ic card | |
US20060289656A1 (en) | Portable electronic apparatus and data output method therefor | |
CN107223252A (en) | Safety element | |
JP4583305B2 (en) | Recording method, recording apparatus, and IC card | |
JP7452750B1 (en) | Electronic information storage medium, IC chip, IC card, public key verification method, and program | |
JP2011171946A (en) | Portable electronic device, method for controlling portable electronic device, and ic card | |
JP2000322535A (en) | Information processing method and system for ic card | |
JP2007323133A (en) | Method for issuing ic card, and ic card | |
JP2007011591A (en) | Portable electronic device and ic card | |
JP7444197B2 (en) | Electronic information storage medium, cryptographic operation method selection method, and program | |
JP4899499B2 (en) | IC card issuing method, IC card issuing system, and IC card | |
JP7452577B2 (en) | Electronic information storage medium, profile change method, and program | |
JP5464053B2 (en) | Authentication processing apparatus, authentication processing method, authentication processing program, processing system, and automatic teller machine | |
JP4549731B2 (en) | Multi-application IC card with command code that is commonly used by applications | |
JP5226383B2 (en) | Microcomputer identification information management system and method | |
JP6969114B2 (en) | IC card, IC card startup processing method, and IC card startup processing program | |
JP5293113B2 (en) | SEMICONDUCTOR DEVICE, SEMICONDUCTOR DEVICE CONTROL METHOD, AND SEMICONDUCTOR DEVICE CONTROL PROGRAM | |
WO2020003958A1 (en) | Mutual authentication system and mutual authentication method | |
JP4641157B2 (en) | Multi-application IC card and application program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Application deemed to be withdrawn because no request for examination was validly filed |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20070605 |