JP7327349B2 - IC card, command management method for IC card, and microcontroller for IC card - Google Patents

IC card, command management method for IC card, and microcontroller for IC card Download PDF

Info

Publication number
JP7327349B2
JP7327349B2 JP2020178220A JP2020178220A JP7327349B2 JP 7327349 B2 JP7327349 B2 JP 7327349B2 JP 2020178220 A JP2020178220 A JP 2020178220A JP 2020178220 A JP2020178220 A JP 2020178220A JP 7327349 B2 JP7327349 B2 JP 7327349B2
Authority
JP
Japan
Prior art keywords
command
card
storage area
history storage
management unit
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
JP2020178220A
Other languages
Japanese (ja)
Other versions
JP2022069184A (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 JP2020178220A priority Critical patent/JP7327349B2/en
Publication of JP2022069184A publication Critical patent/JP2022069184A/en
Application granted granted Critical
Publication of JP7327349B2 publication Critical patent/JP7327349B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Storage Device Security (AREA)

Description

本発明は,ICカードおよびICカードのコマンド管理方法に関する。 The present invention relates to an IC card and an IC card command management method.

ICカードは,ターミナルが送信するコマンドに従う処理を行い,処理結果をレスポンスでターミナルへ返信するという単純なモデルで動作する。ICカードのコマンドおよびICカードのレスポンスは,APDU(Application Protocol Data Unit)という形式で様々な規格で規定されている。 The IC card operates according to a simple model in which it performs processing according to commands sent by the terminal and returns the processing result to the terminal as a response. IC card commands and IC card responses are defined by various standards in the form of APDUs (Application Protocol Data Units).

ICカードのユースケース(特定の目的を達成するための一連の処理)は,ICカードの用途によって予め定まっているが,ICカードが不正使用される場合,ICカードは,通常のユースケースから外れた使い方をされる。よって,通常のユースケースから外れた使い方をされたことをICカード側で判定できれば,ICカードの不正使用を防止できる。 IC card use cases (a series of processes to achieve a specific purpose) are predetermined according to the application of the IC card, but if the IC card is used illegally, the IC card will deviate from the normal use case. is used. Therefore, if the IC card side can determine that the IC card has been used in ways that deviate from normal use cases, unauthorized use of the IC card can be prevented.

ICカードの不正使用を防止する手法の一つとして,認証系コマンド(例えば,ISO/IEC 7816-4で規定されたVERIFYコマンド)に再試行回数を設定する手法が知られている。セキュリティ用途で使用される認証系コマンドに再試行回数を設定することで,認証系コマンドが不正使用されても,連続して認証系コマンドに失敗できる最大回数を再試行回数に制限できる。 As one method of preventing unauthorized use of IC cards, a method of setting the number of retries in an authentication command (for example, the VERIFY command specified in ISO/IEC 7816-4) is known. By setting the number of retries for authentication commands used for security purposes, the maximum number of consecutive authentication command failures can be limited to the number of retries even if the authentication commands are used illegally.

しかしながら,非特許文献1などで規定された相互認証フロー(Mutual Authentication Flow)では,相互認証の最初にICカードが,相互認証の成功回数(Sequence Counter)に基づき生成したセッション鍵を用いて,認証コード(Card Cryptogramなど)を生成する。このため,非特許文献1に準拠したICカードでは,相互認証フローの最初に用いるコマンド(INITIALIZE UPDATEコマンド)を何度も使用して,何度もセッション鍵や認証コードの生成を試行することが可能である。 However, in the mutual authentication flow (Mutual Authentication Flow) defined in Non-Patent Document 1, etc., at the beginning of mutual authentication, an IC card uses a session key generated based on the number of successes of mutual authentication (Sequence Counter) to perform authentication. Generate code (such as Card Cryptogram). Therefore, in an IC card conforming to Non-Patent Document 1, the command used at the beginning of the mutual authentication flow (INITIALIZE UPDATE command) can be used many times to try to generate the session key and authentication code many times. It is possible.

相互認証フローの最初に用いるコマンドを何度も使用できると,ICカードに対する攻撃手法の一つであるサイドチャネル攻撃が可能になる。特許文献1では,相互認証フローの最初に用いるコマンドを何度も使用できるケースでも,サイドチャネル攻撃に対する耐タンパー性をICカードに持たせられるようにしている。 If the command used at the beginning of the mutual authentication flow can be used many times, a side channel attack, which is one of attack methods against the IC card, becomes possible. In Patent Literature 1, even in cases where the command used at the beginning of the mutual authentication flow can be used many times, the IC card is made to have tamper resistance against side-channel attacks.

特開2018-148387号公報JP 2018-148387 A

Global Platform Card SpecificationGlobal Platform Card Specification

非特許文献1などで規定された相互認証フローは,コマンドを何度も使用できるケースの一例にしか過ぎない。セキュリティ属性が設定されていないファイルには,読み取りコマンドを何度も使用できる。よって,ICカードの運用時に,ICカードが,通常のユースケースから外れた使い方をされたか否かを判定できることは大変重要なことである。 The mutual authentication flow defined in Non-Patent Document 1, etc. is just an example of a case where commands can be used many times. You can use multiple read commands on files that do not have security attributes set. Therefore, when operating the IC card, it is very important to be able to determine whether or not the IC card has been used in ways that deviate from normal use cases.

そこで,本発明は,通常のユースケースから外れた使い方をされたか否かを判定できるICカードなどを提供することを目的とする。 SUMMARY OF THE INVENTION Accordingly, it is an object of the present invention to provide an IC card or the like that can determine whether or not it has been used in ways that deviate from normal use cases.

上述した課題を解決する第1発明は,外部装置から受信したコマンドAPDUに対応するコマンドを実行すると,前記コマンドの種別を示す種別コードと前記コマンドが返したレスポンスAPDUに対応する実行結果コードを含むコマンド履歴を履歴格納領域に格納し,前記履歴格納領域において,事前に定められた内容の前記コマンド履歴の数がこの前記コマンド履歴に設定された最大許容数を超えると,通常のユースケースから外れた使い方をされたと判定するコマンド管理部を備えたことを特徴とするICカードである。なお,第1発明において,前記コマンド管理部は,通常のユースケースから外れた使い方をされたと判定すると,カード状態をロック状態に遷移させることが望ましい。 A first invention for solving the above-mentioned problems includes, when a command corresponding to a command APDU received from an external device is executed, a type code indicating the type of the command and an execution result code corresponding to the response APDU returned by the command. A command history is stored in a history storage area, and in the history storage area, when the number of the command histories with predetermined content exceeds the maximum allowable number set for the command history, it is out of a normal use case. The IC card is characterized by comprising a command management section for determining that the IC card has been used in a different manner. In addition, in the first invention, it is preferable that the command management unit shifts the card state to the locked state when it determines that the card is used in a way that deviates from the normal use case.

更に,上述した課題を解決する第2発明は,ICカードが,外部装置から受信したコマンドAPDUに対応するコマンドを実行すると,前記コマンドの種別を示す種別コードと前記コマンドが返したレスポンスAPDUに対応する実行結果コードを含むコマンド履歴を履歴格納領域に格納し,前記履歴格納領域において,事前に定められた内容の前記コマンド履歴の数がこの前記コマンド履歴に設定された最大許容数を超えると,通常のユースケースから外れた使い方をされたと判定することを特徴とするICカードのコマンド管理方法である。第2発明において,ICカードは,通常のユースケースから外れた使い方をされたと判定すると,カード状態をロック状態に遷移させることが望ましい。 Furthermore, in the second invention for solving the above-mentioned problems, when an IC card executes a command corresponding to a command APDU received from an external device, a type code indicating the type of the command and a response APDU returned by the command are corresponded. store a command history including an execution result code in a history storage area; A command management method for an IC card, characterized in that it is determined that the IC card is used in a manner deviating from a normal use case. In the second invention, it is desirable that the IC card transitions to the locked state when it is determined that the IC card has been used in ways that deviate from normal use cases.

更に,上述した課題を解決する第3発明は,外部装置から受信したコマンドAPDUに対応するコマンドを実行すると,前記コマンドの種別を示す種別コードと前記コマンドが返したレスポンスAPDUに対応する実行結果コードを含むコマンド履歴を履歴格納領域に格納し,前記履歴格納領域において,事前に定められた内容の前記コマンド履歴の数がこの前記コマンド履歴に設定された最大許容数を超えると,通常のユースケースから外れた使い方をされたと判定するコマンド管理部を備えたことを特徴とするICカード用のマイクロコントローラである。第3発明において,前記コマンド管理部は,通常のユースケースから外れた使い方をされたと判定すると,カード状態をロック状態に遷移させることが望ましい。 Furthermore, the third invention for solving the above-mentioned problems is a third aspect of the present invention, when a command corresponding to a command APDU received from an external device is executed, a type code indicating the type of the command and an execution result code corresponding to the response APDU returned by the command. is stored in a history storage area, and in the history storage area, if the number of said command histories with predetermined content exceeds the maximum allowable number set for this said command history, a normal use case A microcontroller for an IC card, characterized by comprising a command management section for determining that the IC card has been used in a manner deviating from the standard. In the third invention, it is preferable that the command management section shifts the card state to the locked state when it is determined that the card is used in a manner deviating from the normal use case.

通常のユースケースから外れた使い方をされた場合,同一の種別に属するコマンドが繰り返し実行されるため,通常のユースケースから外れた使い方をされたと判定しない数を最大許容数として設定すれば,事前に定められた内容の前記コマンド履歴の数から,通常のユースケースから外れた使い方をされたか否かを判定できる。 If the usage deviates from the normal use case, commands belonging to the same type are repeatedly executed. From the number of command histories with the contents defined in 1., it is possible to determine whether or not the command is used in ways that deviate from normal use cases.

本実施形態に係るICカードのハードウェア構成図。FIG. 2 is a hardware configuration diagram of an IC card according to the embodiment; 本実施形態に係るICカードの機能構成図。FIG. 2 is a functional configuration diagram of an IC card according to the embodiment; ICカードのコマンド管理部が備えるコマンドテーブルを説明する図。FIG. 4 is a diagram for explaining a command table provided in a command management unit of an IC card; コマンドテーブルに記載する種別コードを説明する図。FIG. 4 is a diagram for explaining type codes to be written in a command table; コマンド履歴と履歴格納領域を説明する図。FIG. 4 is a diagram for explaining a command history and a history storage area; コマンド履歴に含ませる実行結果コードを説明する図。FIG. 11 is a diagram for explaining execution result codes to be included in the command history; FIG. ICカードが備えるコマンド管理部の動作を説明する図。FIG. 4 is a diagram for explaining the operation of a command management unit included in an IC card; ICカードが通常のユースケースから外れた使い方をされたときの履歴格納領域を説明する図。FIG. 11 is a diagram for explaining a history storage area when the IC card is used in a way that deviates from the normal use case;

ここから,本発明に係る実施形態について記載する。本実施形態は,本発明の理解を容易にするためのものであり,本発明は,本実施形態に限定されるものではない。また,特に断りのない限り,図面は,本発明の理解を容易にするために描かれた模式的な図である。 Embodiments according to the present invention will now be described. This embodiment is intended to facilitate understanding of the present invention, and the present invention is not limited to this embodiment. In addition, unless otherwise specified, the drawings are schematic diagrams drawn to facilitate understanding of the present invention.

図1は,本実施形態に係るICカード1のハードウェア構成図である。本実施形態に係るICカード1は,マイクロコントローラ100をカード本体に埋め込んだカードである。ICカード1は,ICカード1が動作するために必要な各種信号用の端子を有するコンタクト端子106をカード表面に備え,マイクロコントローラ100はコンタクト端子106と接続している。 FIG. 1 is a hardware configuration diagram of an IC card 1 according to this embodiment. The IC card 1 according to this embodiment is a card in which a microcontroller 100 is embedded in the card body. The IC card 1 is provided with contact terminals 106 having terminals for various signals necessary for the IC card 1 to operate, and the microcontroller 100 is connected to the contact terminals 106 .

ICカード1に埋め込まれるマイクロコントローラ100は,プロセッサ101,ランダムアクセスメモリ102(RAM102),読み出し専用メモリ103(ROM103),電気的に書き換え可能な不揮発性メモリ104(NVM104),および,コンタクト端子106を介して外部装置となるターミナル2とシリアル通信を行うUART105(Universal Asynchronous Receiver/Transmitte)を有する。 A microcontroller 100 embedded in the IC card 1 includes a processor 101, a random access memory 102 (RAM 102), a read only memory 103 (ROM 103), an electrically rewritable nonvolatile memory 104 (NVM 104), and contact terminals 106. It has a UART 105 (Universal Asynchronous Receiver/Transmitte) for serial communication with the terminal 2, which is an external device, via the terminal.

本発明は,図1で図示したICカード1の形態に限定されない。ICカード1は,非接触型またはデュアルインタフェース型でもよい。ICカード1の形状はキャッシュカードの形状に限定されず,ICカード1の形状は,SIM(Subscriber Identity Module Card),マイクロSIMまたはナノSIMでもよい。更に,ICカード1に埋め込むマイクロコントローラ100は,特定の暗号演算機能に特化した暗号演算回路など図1では図示していない回路を内蔵していてもよい。また,ICカード1は,指紋センサなど図示していないデバイスを備えていてもよい。 The present invention is not limited to the form of the IC card 1 illustrated in FIG. The IC card 1 may be of contactless type or dual interface type. The shape of the IC card 1 is not limited to that of a cash card, and the shape of the IC card 1 may be a SIM (Subscriber Identity Module Card), micro SIM or nano SIM. Furthermore, the microcontroller 100 embedded in the IC card 1 may incorporate a circuit not shown in FIG. 1, such as a cryptographic computation circuit specialized for a specific cryptographic computation function. The IC card 1 may also include a device (not shown) such as a fingerprint sensor.

図2は,本実施形態に係るICカード1の機能構成図である。ICカード1は,プロセッサ101を動作させるコンピュータプログラムで実現される機能として,ICカード1の用途で必要となる複数のコマンド13と,ターミナル2から受信したコマンドAPDUに対応するコマンド13の実行を管理するコマンド管理部10を備える。 FIG. 2 is a functional configuration diagram of the IC card 1 according to this embodiment. The IC card 1 manages the execution of a plurality of commands 13 necessary for the use of the IC card 1 and the commands 13 corresponding to the command APDU received from the terminal 2 as functions realized by a computer program that operates the processor 101 . A command management unit 10 is provided.

ICカード1が備えるコマンド管理部10は,ターミナル2から受信したコマンドAPDUに対応するコマンド13を実行し,コマンド13のレスポンスAPDUをターミナル2へ送信する機能を有する。本実施形態に係るコマンド管理部10は,この機能に加え,コマンド13の実行履歴から,ICカード1が通常のユースケースから外れた使い方をされたか否かを判定し,ICカード1が通常のユースケースから外れた使い方をされたと判定すると,ICカード1のカード状態をロック状態にする機能を有する。なお,運用で使用されるICカード1のカード状態は,コマンド13の処理が行える運用状態になっている。ICカード1のカード状態を,運用状態から,コマンド13の処理が行えないロック状態にすることで,ICカード1の不正な使用を防止できる。 A command management unit 10 provided in the IC card 1 has a function of executing a command 13 corresponding to a command APDU received from the terminal 2 and transmitting a response APDU to the command 13 to the terminal 2 . In addition to this function, the command management unit 10 according to the present embodiment determines whether or not the IC card 1 has been used outside the normal use case from the command 13 execution history. It has a function of locking the IC card 1 when it is determined that it has been used outside the use case. The card status of the IC card 1 used in operation is an operational status in which the command 13 can be processed. Unauthorized use of the IC card 1 can be prevented by changing the card status of the IC card 1 from the operational status to the locked status in which the command 13 cannot be processed.

このことを実現するために,ICカード1が備えるコマンド管理部10は,ICカード1が備えるコマンド13の一覧を記したコマンドテーブル11と,コマンド管理部10が実行したコマンド13のコマンド履歴を記憶する履歴格納領域12を有する。 In order to realize this, the command management unit 10 provided in the IC card 1 stores a command table 11 listing the commands 13 provided in the IC card 1 and the command history of the commands 13 executed by the command management unit 10. has a history storage area 12 for

図3は,ICカード1のコマンド管理部10が備えるコマンドテーブル11を説明する図である。ICカード1のコマンド管理部10が備えるコマンドテーブル11は,マイクロコントローラ100が有するROM103またはNVM104に格納されるマトリクス構造のデータである。コマンドテーブル11には,ICカード1が実装しているコマンド13ごとに,コマンド13が対応するクラスバイト(CLA)および命令バイト(INS)と,コマンド13が対応する種別コードが少なくとも記される。なお,コマンド13のプログラムコードを記憶した範囲を示すアドレスをコマンドテーブル11に記すこともできる。 FIG. 3 is a diagram for explaining the command table 11 provided in the command management section 10 of the IC card 1. As shown in FIG. The command table 11 provided in the command management unit 10 of the IC card 1 is matrix-structured data stored in the ROM 103 or NVM 104 of the microcontroller 100 . In the command table 11, for each command 13 mounted on the IC card 1, at least the class byte (CLA) and instruction byte (INS) corresponding to the command 13 and the type code corresponding to the command 13 are described. It is also possible to write in the command table 11 an address indicating the range in which the program code of the command 13 is stored.

図3では,ICカード1が実装したコマンド13の一例として,ISO/IEC 7816-4に準拠したコマンド13を図示している。ICカード1に実装したコマンド13のコマンドAPUは,ISO/IEC 7816-4準拠のコマンド13であるか否かなどを示すCLA,コマンド13の識別に用いるINSを必ず含む。ICカード1に実装したコマンド13は,CLAの上位ニブルとINSの対によって識別できるため,コマンドテーブル11には,ICカード1に実装されたコマンド13ごとにCLSの上位ニブルおよびINSを記している。なお,ICカード1に実装させるコマンド13は任意でよい。 FIG. 3 shows a command 13 conforming to ISO/IEC 7816-4 as an example of the command 13 implemented by the IC card 1 . The command APU of the command 13 mounted on the IC card 1 always includes CLA indicating whether or not the command 13 conforms to ISO/IEC 7816-4, and INS used to identify the command 13 . Since the command 13 mounted on the IC card 1 can be identified by a pair of the CLA upper nibble and INS, the command table 11 describes the CLS upper nibble and INS for each command 13 mounted on the IC card 1. . Note that the command 13 to be mounted on the IC card 1 may be arbitrary.

ICカード1は,ISO/IEC 7816-4に準拠したコマンド13のみを実装しているため,ICカード1のコマンド管理部10が備えるコマンドテーブル11におけるCLAはすべて‘0x’(‘’は16進数を意味する)になっている。これは,CLAの上位ニブルで,ISO/IEC 7816-4準拠のコマンド13であるか否かが示され,CLAの下位ニブルは,セキュアメッセージの適用の有無やロジカルチャネル番号を表すのに利用されるからである。 Since the IC card 1 implements only commands 13 conforming to ISO/IEC 7816-4, all CLAs in the command table 11 provided in the command management unit 10 of the IC card 1 are '0x' ('' is a hexadecimal number means). This is the upper nibble of CLA and indicates whether it is a command 13 conforming to ISO/IEC 7816-4. This is because that.

INSはコマンド13の識別に利用される。ICカード1のコマンド管理部10が備えるコマンドテーブル11におけるINSはコマンド13ごとに異なっている。図3では,行に対応するコマンド13を分かり易くするために,コマンド名を記載しているが,コマンド名はコマンドテーブル11に必要ない。 INS is used to identify the command 13 . The INS in the command table 11 provided in the command management unit 10 of the IC card 1 are different for each command 13 . In FIG. 3, the command names are shown in order to make the commands 13 corresponding to the rows easier to understand, but the command names are not necessary in the command table 11 .

図4は,コマンドテーブル11に記載する種別コードを説明する図である。ICカード1が実装している複数のコマンド13は,コマンド13の種別に基づき複数のグループに分類される。 FIG. 4 is a diagram for explaining the type code described in the command table 11. As shown in FIG. A plurality of commands 13 mounted on the IC card 1 are classified into a plurality of groups based on the types of the commands 13 .

本実施形態では,コマンド13の種別を,コマンド13の動作や使用目的によって定めているが,コマンド13の種別をINSにすることもできる。図4では,コマンド13の種別として,データの読出しを行うコマンド13が属する「読出し系」,データの書込みを行うコマンド13が属する「書込み系」,認証処理で用いられるコマンド13が属する「認証系」,ファイルの選択を行うコマンド13が属する「選択系」を記載している。 In this embodiment, the type of the command 13 is determined according to the operation and purpose of use of the command 13, but the type of the command 13 can also be INS. In FIG. 4, the types of the commands 13 are "read system" to which the command 13 for reading data belongs, "write system" to which the command 13 for writing data belongs, and "authentication system" to which the command 13 used in the authentication process belongs. ", and "selection system" to which the command 13 for selecting a file belongs.

コマンド13の種別それぞれには,コマンド13の種別を識別するための種別コードが割り当てられる。本実施形態において,種別コードは1ニブル(4ビット)のデータである。例えば,認証系に属するコマンド13の種別コードは「3(0011b,bはバイナリを意味する)」である。 Each type of command 13 is assigned a type code for identifying the type of command 13 . In this embodiment, the type code is data of 1 nibble (4 bits). For example, the type code of the command 13 belonging to the authentication system is "3 (0011b, b means binary)".

図5は,コマンド履歴と履歴格納領域12を説明する図である。履歴格納領域12は,複数のコマンド履歴を実行順で連続して並べる領域である。履歴格納領域12に格納するコマンド履歴は,コマンド管理部10が実行したコマンド13の種別コードとこのコマンド13の実行結果コードを含む。 FIG. 5 is a diagram for explaining the command history and the history storage area 12. As shown in FIG. The history storage area 12 is an area in which a plurality of command histories are continuously arranged in order of execution. The command history stored in the history storage area 12 includes the type code of the command 13 executed by the command management unit 10 and the execution result code of this command 13 .

図6は,コマンド履歴に含ませる実行結果コードを説明する図である。図6では,コマンド13の実行結果として,「中断」,「失敗」および「成功」を記している。それぞれの実行結果には,コマンド13の実行結果を識別するための実行結果コードが割り当てられている。本実施形態において,実行結果コードは1ニブル(4ビット)のデータである。例えば,「成功」に係る実行結果コードは「1(0001b)」である。 FIG. 6 is a diagram for explaining execution result codes to be included in the command history. In FIG. 6, "interruption", "failure" and "success" are shown as the execution results of the command 13. FIG. Each execution result is assigned an execution result code for identifying the execution result of the command 13 . In this embodiment, the execution result code is 1 nibble (4 bits) data. For example, the execution result code for "success" is "1 (0001b)".

コマンド管理部10が実行したコマンド13の種別コードとこのコマンド13の実行結果コードを含むコマンド履歴を格納する履歴格納領域12はRAM102またはNVM104に設けることができる。履歴格納領域12をRAM102に設けると,ICカード1がリセットされたとき,履歴格納領域12の内容を消去できる。履歴格納領域12をNVM104に設けると,ICカード1がリセットされても,履歴格納領域12の内容を保持できる。ユースケースで実行するコマンド13の最大実行回数はユースケースの内容で定まるため,ユースケースで実行するコマンド13の最大実行回数に基づいて,履歴格納領域12に格納できるコマンド履歴の数に制限を設けることが望ましい。この場合,履歴格納領域12は循環順編成ファイルの構造にするとよい。 The history storage area 12 for storing the command history including the type code of the command 13 executed by the command management unit 10 and the execution result code of the command 13 can be provided in the RAM 102 or the NVM 104 . If the history storage area 12 is provided in the RAM 102, the contents of the history storage area 12 can be erased when the IC card 1 is reset. By providing the history storage area 12 in the NVM 104, the contents of the history storage area 12 can be retained even if the IC card 1 is reset. Since the maximum number of executions of the command 13 executed in the use case is determined by the contents of the use case, the number of command histories that can be stored in the history storage area 12 is limited based on the maximum number of executions of the command 13 executed in the use case. is desirable. In this case, the history storage area 12 should have a cyclic sequential file structure.

図7は,ICカード1が備えるコマンド管理部10の動作を説明する図である。なお、図7の説明は、ICカード1のコマンド管理方法の説明も兼ねている。 FIG. 7 is a diagram for explaining the operation of the command management section 10 provided in the IC card 1. As shown in FIG. Note that the description of FIG. 7 also serves as a description of the command management method of the IC card 1 .

ターミナル2は,ユースケースに従い,ICカード1で動作させるコマンド13のコマンドAPDUをICカード1へ送信し,ICカード1のコマンド管理部10は,マイクロコントローラ100が備えるUART105を利用して,ターミナル2が送信したコマンドAPDUを受信する。 The terminal 2 transmits the command APDU of the command 13 to be operated by the IC card 1 to the IC card 1 according to the use case, and the command management unit 10 of the IC card 1 utilizes the UART 105 provided in the microcontroller 100 to receives the command APDU sent by

ICカード1のコマンド管理部10は,ターミナル2が送信したコマンドAPDUを受信すると(S1),ターミナル2が送信したコマンドAPDUに対応するコマンド13を呼び出し,コマンドAPDUに対応するコマンド13を実行する(S2)。ターミナル2が送信したコマンドAPDUに対応するコマンド13は,コマンドAPDUに含まれるCLAおよびINSで示される。 When the command management unit 10 of the IC card 1 receives the command APDU transmitted by the terminal 2 (S1), it calls the command 13 corresponding to the command APDU transmitted by the terminal 2, and executes the command 13 corresponding to the command APDU ( S2). A command 13 corresponding to the command APDU sent by the terminal 2 is indicated by CLA and INS included in the command APDU.

ターミナル2が送信したコマンドAPDUに対応するコマンド13は,このコマンドAPDUで示される処理を実行し,コマンド13の実行結果を示すレスポンスAPDUをコマンド管理部10に返し,コマンド管理部10は,レスポンスAPDUをコマンド13から受け取る(S3)。なお,レスポンスAPDUは,コマンド13の実行結果を示すステータスワードを必ず含む。 The command 13 corresponding to the command APDU transmitted by the terminal 2 executes the processing indicated by this command APDU, returns a response APDU indicating the execution result of the command 13 to the command management unit 10, and the command management unit 10 receives the response APDU. is received from the command 13 (S3). Note that the response APDU always includes a status word indicating the execution result of the command 13 .

ICカード1が備えるコマンド管理部10は,コマンド13からレスポンAPDUを受け取ると,まず,コマンドテーブル11を参照し,コマンド13が呼び出したコマンド13のCLAおよびINSに対応する種別コードを特定する(S4)。例えば,ターミナル2が送信したコマンドAPDUにおけるCLAが‘0x’で,ターミナル2が送信したコマンドAPDUにおけるCLAが‘88’の場合,図3を参照すれば,コマンド13が呼び出したコマンド13のCLAおよびINSに対応する種別コードは「4(0010b)」になる。 When the command management unit 10 provided in the IC card 1 receives the response APDU from the command 13, it first refers to the command table 11 and identifies the type code corresponding to the CLA and INS of the command 13 called by the command 13 (S4 ). For example, if the CLA in the command APDU sent by terminal 2 is '0x' and the CLA in the command APDU sent by terminal 2 is '88', referring to FIG. The type code corresponding to INS is "4 (0010b)".

次に,ICカード1が備えるコマンド管理部10は,コマンド13から引き渡されたレスポンスAPDUに含まれるステータスワードで示されるコマンド13の実行結果に対応する実行結果コードを特定する(S5)。例えば,コマンド13から引き渡されたレスポンスAPDUのステータスワードで正常終了が示される場合,図6を参照すれば,コマンド13の実行結果に対応する実行結果コードは「1(0001b)」になる。 Next, the command management unit 10 provided in the IC card 1 identifies an execution result code corresponding to the execution result of the command 13 indicated by the status word included in the response APDU delivered from the command 13 (S5). For example, if the status word of the response APDU delivered from the command 13 indicates normal termination, referring to FIG. 6, the execution result code corresponding to the execution result of the command 13 will be "1 (0001b)".

次に,ICカード1が備えるコマンド管理部10は,ステップS4で特定した種別コードとステップS5で特定した実行結果コードを含むコマンド履歴を履歴格納領域12に追加する(S6)。上述した通り,種別コードおよび実行結果コードは共に1ニブルのデータであるため,履歴格納領域12に追加するコマンド履歴は1バイトのデータになる。 Next, the command management unit 10 provided in the IC card 1 adds the command history including the type code identified in step S4 and the execution result code identified in step S5 to the history storage area 12 (S6). As described above, the type code and the execution result code are both 1-nibble data, so the command history added to the history storage area 12 is 1-byte data.

次に,ICカード1が備えるコマンド管理部10は,履歴格納領域12を参照し,履歴格納領域12において,事前に定められた内容のコマンド履歴の数がこのコマンド履歴に設定された最大許容数を超えると,ICカード1が通常のユースケースから外れた使い方をされたか否かを判定する処理を実行する(S7)。 Next, the command management unit 10 provided in the IC card 1 refers to the history storage area 12, and in the history storage area 12, the number of command histories with predetermined contents is the maximum allowable number set in this command history. When the time exceeds the limit, a process of determining whether or not the IC card 1 has been used outside the normal use case is executed (S7).

本実施形態において,ICカード1が備えるコマンド管理部10は,ICカード1が通常のユースケースから外れた使い方をされたか否かを判定するための判定条件を記憶する。この判定条件には,事前に定められた内容のコマンド履歴とこのコマンド履歴の最大許容数が記される。判定条件としては,以下の条件が考えられる。
(条件1)認証系の種別コードを含むコマンド履歴とこのコマンド履歴の最大許容数。
(条件2)読取り系の種別コードを含み,かつ,成功ではない実行結果コードを含むコマンド履歴とこのコマンド履歴の最大許容数。
(条件1)により,認証系に属するコマンド13が繰り返して実行されたか否かを判定できる。(条件2)により,認証に成功していないにもかかわらず,読取り系のコマンド13が繰り返して実行されたか否かを判定できる。
In this embodiment, the command management unit 10 provided in the IC card 1 stores determination conditions for determining whether or not the IC card 1 has been used in ways that deviate from normal use cases. This determination condition describes a command history with predetermined contents and the maximum allowable number of command histories. The following conditions are conceivable as judgment conditions.
(Condition 1) A command history including an authentication type code and the maximum allowable number of this command history.
(Condition 2) A command history that includes a reading type code and an execution result code that is not successful, and the maximum allowable number of command histories.
(Condition 1) makes it possible to determine whether or not the command 13 belonging to the authentication system has been repeatedly executed. (Condition 2) makes it possible to determine whether or not the read command 13 has been repeatedly executed even though the authentication has not succeeded.

上述した判定条件は,ICカード1に実装させるコマンド13に従って任意に設定できる。複数の判定条件を設定する場合,判定条件はOR論理で扱われる。すなわち,コマンド管理部10に設定された少なくとも一つの判定条件が成立していれば,コマンド管理部10は,ICカード1が通常のユースケースから外れた使い方をされたと判定する。 The judgment condition described above can be arbitrarily set according to the command 13 mounted on the IC card 1 . When setting a plurality of judgment conditions, the judgment conditions are handled by OR logic. That is, if at least one determination condition set in the command management unit 10 is satisfied, the command management unit 10 determines that the IC card 1 has been used in ways that deviate from normal use cases.

ICカード1が備えるコマンド管理部10は,ICカード1が通常のユースケースから外れた使い方をされたと判定すると,コマンド13を利用できないロック状態にICカード1のカード状態を遷移させて(S9),この手順は終了する。また,ICカード1が備えるコマンド管理部10は,ICカード1が通常のユースケースから外れた使い方をされていない判定すると,マイクロコントローラ100が備えるUART105を利用して,コマンド13から受信したレスポンスAPDUをターミナル2へ送信して(S8),図7の手順は終了する。 When the command management unit 10 provided in the IC card 1 determines that the IC card 1 has been used outside of the normal use case, it changes the card state of the IC card 1 to a locked state in which commands 13 cannot be used (S9). , the procedure ends. Further, when the command management unit 10 provided in the IC card 1 determines that the IC card 1 is not being used outside the normal use case, it uses the UART 105 provided in the microcontroller 100 to transmit the response APDU received from the command 13. is sent to terminal 2 (S8), and the procedure in FIG. 7 ends.

ここから,ICカード1が通常のユースケースから外れた使い方をされたときの例を示し,ICカード1が備えるコマンド管理部10が,ICカード1が通常のユースケースから外れた使い方をされたか否かを判定する処理の内容について詳細に説明する。 From here, an example when the IC card 1 is used outside the normal use case will be shown. The details of the processing for determining whether or not the

図8は,ICカード1が通常のユースケースから外れた使い方をされたときの履歴格納領域12を説明する図である。なお,この説明では,上述した(条件1)を判定条件とし,認証系の種別コードを含むコマンド履歴の最大許容数を5個としている。すなわち,ICカード1のコマンド管理部10は,履歴格納領域12において,認証系のコマンド13に係るコマンド履歴が6個あると,コマンド13を実行しないロック状態にICカード1のカード状態を遷移させる。 FIG. 8 is a diagram for explaining the history storage area 12 when the IC card 1 is used in ways that deviate from normal use cases. In this description, the above-mentioned (condition 1) is used as the determination condition, and the maximum allowable number of command histories including the type code of the authentication system is five. That is, when there are six command histories related to authentication-related commands 13 in the history storage area 12, the command management unit 10 of the IC card 1 changes the card state of the IC card 1 to a locked state in which the command 13 is not executed. .

図8(a)は,履歴格納領域12の初期状態を図示している。履歴格納領域12の初期状態は,履歴格納領域12をコマンド履歴の初期値(‘00’)でパディングした状態になっている。 8A shows the initial state of the history storage area 12. FIG. The initial state of the history storage area 12 is a state in which the history storage area 12 is padded with the initial value ('00') of the command history.

図8(b)は,図8(a)の状態から,認証系のコマンド13の実行に失敗した後の履歴格納領域12を図示している。図3に従えば,認証系のコマンド13の種別コードは3(0011b)になり,図6に従えば,コマンド13の実行失敗に対応する実行結果コードは2(0011b)になるため,履歴格納領域12の先頭に格納されるコマンド履歴は‘32’になっている。図8(b)で図示した状態の履歴格納領域12において,認証系のコマンド13に係るコマンド履歴は1個であるため,コマンド管理部10は,この時点ではICカード1のカード状態をロック状態に遷移させない。 FIG. 8(b) shows the history storage area 12 after the execution of the authentication-related command 13 fails from the state of FIG. 8(a). According to FIG. 3, the type code of the authentication system command 13 is 3 (0011b), and according to FIG. 6, the execution result code corresponding to the execution failure of the command 13 is 2 (0011b). The command history stored at the top of area 12 is '32'. In the history storage area 12 in the state shown in FIG. 8(b), there is only one command history related to the command 13 of the authentication system. do not transition to

図8(c)は,図8(b)の状態から,認証系のコマンド13の実行に成功した後の履歴格納領域12を図示している。図3に従えば,認証系のコマンド13の種別コードは3(0011b)になり,図6に従えば,コマンド13の実行成功に対応する実行結果コードは1(0001b)になるため,履歴格納領域12の先頭に格納されるコマンド履歴は‘31’になっている。 FIG. 8(c) shows the history storage area 12 after the authentication command 13 has been successfully executed from the state of FIG. 8(b). According to FIG. 3, the type code of the command 13 of the authentication system is 3 (0011b), and according to FIG. 6, the execution result code corresponding to successful execution of the command 13 is 1 (0001b). The command history stored at the top of area 12 is '31'.

また,図8(b)において履歴格納領域12の先頭に格納されるコマンド履歴‘32’は二番目に格納されている。図8(c)で図示した状態の履歴格納領域12において,認証系のコマンド13に係るコマンド履歴は2個であるため,コマンド管理部10は,この時点ではICカード1のカード状態をロック状態に遷移させない。 Also, in FIG. 8B, the command history '32' stored at the head of the history storage area 12 is stored second. In the history storage area 12 in the state shown in FIG. 8(c), there are two command histories related to the commands 13 of the authentication system. do not transition to

図8(d)は,図8(c)の状態から,認証系のコマンド13の実行に失敗した後の履歴格納領域12を図示している。図3に従えば,認証系のコマンド13の種別コードは3(0011b)になり,図6に従えば,コマンド13の実行失敗に対応する実行結果コードは2(0011b)になるため,履歴格納領域12の先頭に格納されるコマンド履歴は‘32’になっている。 FIG. 8(d) illustrates the history storage area 12 after the execution of the authentication-related command 13 fails from the state of FIG. 8(c). According to FIG. 3, the type code of the authentication system command 13 is 3 (0011b), and according to FIG. 6, the execution result code corresponding to the execution failure of the command 13 is 2 (0011b). The command history stored at the top of area 12 is '32'.

また,図8(c)において履歴格納領域12の先頭に格納されるコマンド履歴‘31’は2番目に格納され,図8(b)において履歴格納領域12の先頭に格納されているコマンド履歴‘32’は三番目に格納されている。図8(d)で図示した状態の履歴格納領域12において,認証系のコマンド13に係るコマンド履歴は3個であるため,コマンド管理部10は,この時点ではICカード1をロック状態に遷移させない。 Also, the command history '31' stored at the head of the history storage area 12 in FIG. 8C is stored second, and the command history '31' stored at the head of the history storage area 12 in FIG. 32' is stored third. In the history storage area 12 in the state shown in FIG. 8(d), there are three command histories related to the authentication commands 13, so the command management unit 10 does not cause the IC card 1 to transition to the locked state at this time. .

図8(e)は,図8(d)の状態から,認証系のコマンド13の実行に連続して3回失敗した後の履歴格納領域12を図示している。図8(e)で図示した履歴格納領域12は,認証系のコマンド13の実行失敗に係る3つのコマンド履歴‘32’を図8(d)で図示した履歴格納領域12に追加した状態になっている。図8(e)で図示した状態の履歴格納領域12において,認証系のコマンド13に係るコマンド履歴は6個であるため,コマンド管理部10は,この時点ではICカード1のカード状態をロック状態に遷移させる。 FIG. 8(e) illustrates the history storage area 12 after the execution of the authentication-related command 13 has failed three times in succession from the state of FIG. 8(d). The history storage area 12 shown in FIG. 8(e) is in a state in which three command histories '32' related to the execution failure of the authentication system command 13 are added to the history storage area 12 shown in FIG. 8(d). ing. In the history storage area 12 in the state shown in FIG. 8(e), there are six command histories related to the commands 13 of the authentication system. transition to

1 ICカード
10 コマンド管理部
11 コマンドテーブル
12 履歴格納領域
13 コマンド
2 ターミナル
1 IC card 10 Command management unit 11 Command table 12 History storage area 13 Command 2 Terminal

Claims (6)

外部装置から受信したコマンドAPDUに対応するコマンドを実行すると,前記コマンドの種別を示す種別コードと前記コマンドが返したレスポンスAPDUに対応する実行結果コードを含むコマンド履歴を履歴格納領域に格納し,前記履歴格納領域において,事前に定められた内容の前記コマンド履歴の数がこの前記コマンド履歴に設定された最大許容数を超えると,通常のユースケースから外れた使い方をされたと判定するコマンド管理部を備えたことを特徴とするICカード。 When a command corresponding to a command APDU received from an external device is executed, a command history including a type code indicating the type of the command and an execution result code corresponding to the response APDU returned by the command is stored in the history storage area. a command management unit that determines that usage outside the normal use case is used when the number of command histories with predetermined contents in the history storage area exceeds the maximum allowable number set for the command histories; An IC card characterized by comprising: 前記コマンド管理部は,通常のユースケースから外れた使い方をされたと判定すると,カード状態をロック状態に遷移させることを特徴とする,請求項1に記載したICカード。 2. The IC card according to claim 1, wherein said command management unit transitions the card state to a locked state when it determines that the command management unit has used the IC card in a way that deviates from a normal use case. ICカードが,外部装置から受信したコマンドAPDUに対応するコマンドを実行すると,前記コマンドの種別を示す種別コードと前記コマンドが返したレスポンスAPDUに対応する実行結果コードを含むコマンド履歴を履歴格納領域に格納し,前記履歴格納領域において,事前に定められた内容の前記コマンド履歴の数がこの前記コマンド履歴に設定された最大許容数を超えると,通常のユースケースから外れた使い方をされたと判定することを特徴とするICカードのコマンド管理方法。 When the IC card executes a command corresponding to a command APDU received from an external device, a command history including a type code indicating the type of the command and an execution result code corresponding to the response APDU returned by the command is stored in the history storage area. When the number of command histories with predetermined contents exceeds the maximum allowable number set for the command histories in the history storage area, it is determined that the usage is outside the normal use case. A command management method for an IC card, characterized by: 前記ICカードは,通常のユースケースから外れた使い方をされたと判定すると,カード状態をロック状態に遷移させることを特徴とする,請求項3に記載したICカードのコマンド管理方法。 4. The command management method for an IC card according to claim 3, wherein said IC card transitions to a locked state when it is determined that said IC card has been used outside of a normal use case. 外部装置から受信したコマンドAPDUに対応するコマンドを実行すると,前記コマンドの種別を示す種別コードと前記コマンドが返したレスポンスAPDUに対応する実行結果コードを含むコマンド履歴を履歴格納領域に格納し,前記履歴格納領域において,事前に定められた内容の前記コマンド履歴の数がこの前記コマンド履歴に設定された最大許容数を超えると,通常のユースケースから外れた使い方をされたと判定するコマンド管理部を備えたことを特徴とするICカード用のマイクロコントローラ。 When a command corresponding to a command APDU received from an external device is executed, a command history including a type code indicating the type of the command and an execution result code corresponding to the response APDU returned by the command is stored in the history storage area. a command management unit that determines that usage outside the normal use case is used when the number of command histories with predetermined contents in the history storage area exceeds the maximum allowable number set for the command histories; A microcontroller for an IC card, comprising: 前記コマンド管理部は,通常のユースケースから外れた使い方をされたと判定すると,カード状態をロック状態に遷移させることを特徴とする,請求項5に記載したICカード用のマイクロコントローラ。 6. A microcontroller for an IC card according to claim 5, wherein said command management unit shifts the card state to a locked state when it determines that the command management unit has used the card in a manner deviating from a normal use case.
JP2020178220A 2020-10-23 2020-10-23 IC card, command management method for IC card, and microcontroller for IC card Active JP7327349B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2020178220A JP7327349B2 (en) 2020-10-23 2020-10-23 IC card, command management method for IC card, and microcontroller for IC card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2020178220A JP7327349B2 (en) 2020-10-23 2020-10-23 IC card, command management method for IC card, and microcontroller for IC card

Publications (2)

Publication Number Publication Date
JP2022069184A JP2022069184A (en) 2022-05-11
JP7327349B2 true JP7327349B2 (en) 2023-08-16

Family

ID=81521937

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020178220A Active JP7327349B2 (en) 2020-10-23 2020-10-23 IC card, command management method for IC card, and microcontroller for IC card

Country Status (1)

Country Link
JP (1) JP7327349B2 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1771519A (en) 2003-04-09 2006-05-10 奥贝蒂尔卡系统股份有限公司 Electronic entity secured by a modifiable counter for the uses of classified data
JP2013196010A (en) 2012-03-15 2013-09-30 Toshiba Corp Portable electronic device, portable electronic device processor and portable electronic device control program
US20140282947A1 (en) 2013-03-15 2014-09-18 Ologn Technologies Ag Systems, methods and apparatuses for ensuring proximity of communication device
US20150082427A1 (en) 2013-09-17 2015-03-19 Ologn Technologies Ag Systems, Methods and Apparatuses for Prevention of Relay Attacks
WO2018012321A1 (en) 2016-07-15 2018-01-18 株式会社 東芝 Ic module, ic card, and collation device
US20200193101A1 (en) 2018-12-18 2020-06-18 Idemia France Securing a transaction by means of a smart card and smart card
US20200245138A1 (en) 2019-01-30 2020-07-30 Gavin Shenker Terminal type identification in interaction processing

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4815912B2 (en) * 2005-07-15 2011-11-16 大日本印刷株式会社 IC card, IC card program

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1771519A (en) 2003-04-09 2006-05-10 奥贝蒂尔卡系统股份有限公司 Electronic entity secured by a modifiable counter for the uses of classified data
JP2013196010A (en) 2012-03-15 2013-09-30 Toshiba Corp Portable electronic device, portable electronic device processor and portable electronic device control program
US20140282947A1 (en) 2013-03-15 2014-09-18 Ologn Technologies Ag Systems, methods and apparatuses for ensuring proximity of communication device
US20150082427A1 (en) 2013-09-17 2015-03-19 Ologn Technologies Ag Systems, Methods and Apparatuses for Prevention of Relay Attacks
WO2018012321A1 (en) 2016-07-15 2018-01-18 株式会社 東芝 Ic module, ic card, and collation device
US20200193101A1 (en) 2018-12-18 2020-06-18 Idemia France Securing a transaction by means of a smart card and smart card
US20200245138A1 (en) 2019-01-30 2020-07-30 Gavin Shenker Terminal type identification in interaction processing

Also Published As

Publication number Publication date
JP2022069184A (en) 2022-05-11

Similar Documents

Publication Publication Date Title
US6299069B1 (en) Integrated circuit for embedding in smart cards, and method of issuing smart cards
US7178039B2 (en) Method and arrangement for the verification of NV fuses as well as a corresponding computer program product and a corresponding computer-readable storage medium
NO321049B1 (en) Safety bearing with barrier for tapping via wires
ES2306241T3 (en) MICROCONTROLLER PROCEDURE, SYSTEM AND CARD FOR COMMUNICATION OF APPLICATION SERVICES FROM A MICROCONTROLLER CARD TO A TERMINAL.
JP2007026118A (en) Ic card, and program for ic card
US20090184799A1 (en) Information storage medium and information storage medium processing apparatus
US8621617B2 (en) Method of securing execution of a program
JP7327349B2 (en) IC card, command management method for IC card, and microcontroller for IC card
CN109154955A (en) IC module, IC card and comparison device
JP2009129413A (en) Shared management method of portable storage device, and portable storage device
JP4445718B2 (en) IC card and IC card program
US9912471B2 (en) Method for operating a portable data carrier, and such a portable data carrier
JP6182940B2 (en) IC card, status word output method, and status word output processing program
JP2007141113A (en) Ic card having biometrics authentication function and ic card program
US11151338B2 (en) Securing a transaction by means of a smart card and smart card
JP2006309331A (en) Ic card, and processing method of command to be mounted on ic card
JPH11282991A (en) Ic card
JP2005011147A (en) Ic card and ic card program
EP1384197B1 (en) Method of manufacturing smart cards
KR100959562B1 (en) Method for communication RFID reader and tag
JP5375731B2 (en) IC card and computer program for IC card
AU723007B2 (en) Method of dynamically interpreting data by a chip card
JPH01217689A (en) Portable electronic equipment
JP4583305B2 (en) Recording method, recording apparatus, and IC card
CN116882429B (en) Data transmission method and device for smart card chip and smart card

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20230414

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20230414

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230717

R150 Certificate of patent or registration of utility model

Ref document number: 7327349

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150