JP6780462B2 - Electronic information storage medium, secure processing execution method, and secure processing execution program - Google Patents

Electronic information storage medium, secure processing execution method, and secure processing execution program Download PDF

Info

Publication number
JP6780462B2
JP6780462B2 JP2016221726A JP2016221726A JP6780462B2 JP 6780462 B2 JP6780462 B2 JP 6780462B2 JP 2016221726 A JP2016221726 A JP 2016221726A JP 2016221726 A JP2016221726 A JP 2016221726A JP 6780462 B2 JP6780462 B2 JP 6780462B2
Authority
JP
Japan
Prior art keywords
key
key version
information
secure
command
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
JP2016221726A
Other languages
Japanese (ja)
Other versions
JP2018082246A (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 JP2016221726A priority Critical patent/JP6780462B2/en
Publication of JP2018082246A publication Critical patent/JP2018082246A/en
Application granted granted Critical
Publication of JP6780462B2 publication Critical patent/JP6780462B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

複数のアプリケーションを搭載するICカード等の技術分野に関する。 Related to technical fields such as IC cards equipped with multiple applications.

複数のアプリケーションを搭載するUIM(User Identity Module)等のIC(Integrated Circuit)カードでは、Java(登録商標)Card仕様及びGlobalPlatform(登録商標)仕様に準拠した製品が事実上のデファクトスタンダードになっている。ここで、アプリケーションは、アプリケーションインスタンスを指す。アプリケーションインスタンスとは、アプリケーションプログラム等をメモリに展開して実行可能な状態にインストールされたモジュールをいう。なお、アプリケーションは、アプリケーションプログラムを指す場合もある。特許文献1には、複数のアプリケーションを切り替えて使用可能なICカードの技術が開示されている。 For IC (Integrated Circuit) cards such as UIM (User Identity Module) that mounts multiple applications, products that comply with the Java (registered trademark) Card specifications and Global Platform (registered trademark) specifications have become the de facto standard. .. Here, an application refers to an application instance. An application instance is a module installed in a state in which an application program or the like is expanded in memory and executed. The application may also refer to an application program. Patent Document 1 discloses an IC card technology that can be used by switching a plurality of applications.

ところで、上述したICカード内には、当該ICカード自身及びICカード内のアプリケーションを管理するためのアプリケーションであるセキュリティドメイン(Security Domain、以下、「SD」という)が、必ず1つ以上存在する。SDには、ISD(Issuer Security Domain)とSSD(Supplementary Security Domains)がある。このようなSDは、主に、以下の(1)〜(9)の機能をサポートする。 By the way, in the above-mentioned IC card, there is always one or more security domains (Security Domain, hereinafter referred to as "SD") which are applications for managing the IC card itself and the application in the IC card. SD includes ISD (Issuer Security Domain) and SSD (Supplementary Security Domains). Such SD mainly supports the following functions (1) to (9).

(1)ICカードのライフサイクル管理
(2)アプリケーションプログラムのライフサイクル管理
(3)アプリケーションインスタンスのライフサイクル管理
(4)アプリケーションプログラムのロード
(5)アプリケーションインスタンスの生成(インストール)
(6)アプリケーションプログラムまたはアプリケーションインスタンスの削除
(7)アプリケーション向け発行データの書き込み
(8)データの読出し
(9)セキュアチャンネルプロトコル(Secure Channel Protocol、以下、「SCP」という)に従ったセキュアな通信路の確保
(1) IC card life cycle management
(2) Application program life cycle management
(3) Application instance life cycle management
(4) Loading the application program
(5) Application instance generation (installation)
(6) Deleting an application program or application instance
(7) Writing issued data for applications
(8) Reading data
(9) Securing a secure communication path according to the Secure Channel Protocol (hereinafter referred to as "SCP")

ISDは、上記(1)〜(9)の機能をサポートすることで、ICカード内のカードコンテント(アプリケーションプログラム、アプリケーションインスタンス等)に対して、ICカードの発行者の管理及びセキュリティポリシーを実現する。一方、SSDは、上記(1)〜(9)の機能をサポートすることで、ICカード内のカードコンテントに対して、ICカード上でサービスを提供する第三者の管理及びセキュリティポリシーを実現する。ここで、ICカード上でサービスを提供する第三者とは、ICカードの発行者及びICカードの保持者(ICカードの発行対象である利用者)以外の立場としての者をいう。また、上記(9)の機能において、SCPは、ICカード内のSDとICカード外部エンティティ(外部機器)間の通信路に対して、コマンドデータの機密性、コマンドの完全性(及びコマンドシークエンスの保証)、コマンドデータ(平文)内のセンシティブデータ(例えば、鍵やPINコード)のさらなる機密性を提供する。GlobalPlatform仕様では、上記(1)〜(7)の機能を実行する場合は、SCP上で実行することが必須とされている。 By supporting the functions (1) to (9) above, ISD realizes the management and security policy of the issuer of the IC card for the card content (application program, application instance, etc.) in the IC card. .. On the other hand, SSD supports the functions (1) to (9) above to realize the management and security policy of a third party who provides services on the IC card for the card content in the IC card. .. Here, the third party who provides the service on the IC card means a person who is in a position other than the issuer of the IC card and the holder of the IC card (the user who is the target of issuing the IC card). Further, in the function (9) above, the SCP indicates the confidentiality of command data, the integrity of commands (and the command sequence) for the communication path between the SD in the IC card and the external entity (external device) of the IC card. Guarantee), provides additional integrity of sensitive data (eg, keys and PIN codes) in command data (plain text). According to the Global Platform specifications, when executing the above functions (1) to (7), it is essential to execute them on SCP.

ここで、図1を用いてSCPについて説明する。図1ではICカードを「card」と表し、外部機器を「host」と表す。 Here, SCP will be described with reference to FIG. In FIG. 1, an IC card is represented by a “card” and an external device is represented by a “host”.

まず、hostはcardに対してcard内のアプリケーションとの通信路を形成するためにSELECTコマンドを送信する(ステップS1)。SELECTコマンドは、通信路の相手先となるアプリケーションを識別するIDであるAIDと、当該アプリケーションとの通信路(ロジカルチャネル)を識別するロジカルチャネル番号を含む。これに対して、cardはコマンドに応じて通信路を形成するための処理を実行し、応答する(ステップS2)。これにより、ロジカルチャネル番号で識別される通信路(ロジカルチャネル)が形成され、以降、hostはコマンドに当該ロジカルチャネル番号を含ませることにより、当該ロジカルチャネル番号で識別される通信路を介して、SELECTコマンドで選択したアプリケーションと通信を行うことができる。次いで、hostは、例えば、アプリケーションに関連するデータ(例えば、アプリケーションがポイント管理アプリであれば、ポイントデータ)を取得するためにGET DATAコマンドをCardに送信する(ステップS3)。これに対して、cardはコマンドに応じた処理を実行し、応答する(例えば、ポイントデータを送信する)(ステップS4)。次いで、hostはcardから取得したデータを参照して、例えば、データを書き換えようとする場合、通信路の機密性を高めるためにそれまでに形成した通信路(ロジカルチャネル)をセキュアな通信路にするセキュア処理(SCPでコマンドを保護するための相互認証処理)を実行する。 First, the host sends a SELECT command to the card in order to form a communication path with the application in the card (step S1). The SELECT command includes an AID that is an ID that identifies an application that is a destination of a communication path, and a logical channel number that identifies a communication path (logical channel) with the application. In response to this, the card executes a process for forming a communication path in response to a command and responds (step S2). As a result, a communication path (logical channel) identified by the logical channel number is formed, and thereafter, by including the logical channel number in the command, the host passes through the communication path identified by the logical channel number. You can communicate with the application selected by the SELECT command. The host then sends, for example, a GET DATA command to the Card to acquire data related to the application (eg, if the application is a point management app, point data) (step S3). On the other hand, the card executes a process according to the command and responds (for example, sends point data) (step S4). Next, the host refers to the data acquired from the card, and when trying to rewrite the data, for example, the communication path (logical channel) formed so far in order to increase the confidentiality of the communication path is changed to a secure communication path. Secure processing (mutual authentication processing to protect commands with SCP) is executed.

相互認証は、プロトコルで決められたアルゴリズムに従い、暗号演算の元となる鍵(Key ID01, Key ID02, Key ID03の3つの鍵)を互いが知っているという前提の基、hostとcardが互いを認証する行為である。具体的には、hostが相互認証用のコマンドであるINITIALIZE UPDATEコマンド及びEXTERNAL AUTHENTICATEコマンドを送信し、cardがそれぞれのコマンドに応じた処理を実行することにより行われる。 Mutual authentication is based on the premise that each other knows the key (Key ID01, Key ID02, Key ID03) that is the basis of the cryptographic operation according to the algorithm determined by the protocol. It is an act of authenticating. Specifically, the host sends the INITIALIZE UPDATE command and the EXTERNAL AUTHENTICATE command, which are commands for mutual authentication, and the card executes the processing according to each command.

まず、hostはHost challengeと呼ばれる乱数を生成し、Host challengeと、キーバージョンを示す値であるキーバージョン情報(「key version number」という場合がある)を含むINITIALIZE UPDATEコマンドをcardへ送信する(ステップS5)。なお、cardとhostは互いに相互認証に使用する3つの鍵からなる鍵の組み合わせを複数のキーバージョン(「key version」という場合がある)分保有している。INITIALIZE UPDATEコマンドに含まれるkey version numberは、互いに保有する複数のkey versionのうち、セキュア処理に使用するkey versionを示している(すなわち、hostがセキュア処理に使用するkey versionを指定する)。 First, host generates a random number called Host challenge and sends a Host challenge and an INITIALIZE UPDATE command containing the key version information (sometimes called "key version number"), which is a value indicating the key version, to the card (step). S5). Note that the card and host have a plurality of key versions (sometimes referred to as "key versions") of key combinations consisting of three keys used for mutual authentication. The key version number included in the INITIALIZE UPDATE command indicates the key version used for secure processing among multiple key versions owned by each other (that is, the key version used by host for secure processing).

これに対してcardはCard challengeと呼ばれる乱数を生成し、Card challenge と、key version numberで指定されたkey versionの鍵(Key ID01, Key ID02, Key ID03の3つの鍵)を基に、各Key ID対応した3つのセッションキーを生成する。例えば、Key ID01を基にKey ID01のセッションキーを生成する。各セッションキーの用途は各プロトコルに従った用途で使用される(例えば、MAC生成用セッションキー、データ暗号化用セッションキー、鍵暗号化用セッションキーの3つが生成される)。また、cardは、生成したCard challengeと受信したHost challengeを材料に、セッションキーを用いてCard cryptogramと呼ばれる暗号文を演算し、hostにCard challengeとCard cryptogramを送信する(ステップS6)。 On the other hand, card generates a random number called Card challenge, and each Key is based on Card challenge and the key of the key version specified by key version number (3 keys of Key ID01, Key ID02, Key ID03). Generate 3 session keys corresponding to ID. For example, a session key of Key ID 01 is generated based on Key ID 01. The usage of each session key is used according to each protocol (for example, a session key for MAC generation, a session key for data encryption, and a session key for key encryption are generated). In addition, the card calculates a ciphertext called a Card cryptogram using the session key using the generated Card challenge and the received Host challenge as materials, and sends the Card challenge and the Card cryptogram to the host (step S6).

次に、hostは、Card側と同様にCard challengeとkey version numberで指定したkey versionの鍵(hostが保有する鍵)を基にセッションキーを生成し、Card challengeとHost challengeを材料に、セッションキーを用いてCard cryptogramを生成する。hostは、自身で生成したCard cryptogramとcard側から受信したCard cryptogramを比較し、一致するか確認することによりcardが鍵値を知る正当な相手であることを確認する。hostは、これを確認すると、Card challengeとHost challengeを材料に、セッションキーを用いてHost cryptogramと呼ばれる暗号文を演算し、Host cryptogramを含むEXTERNAL AUTHENTICATEコマンドをCardに送信する(ステップS7)。 Next, host generates a session key based on the key version key (key held by host) specified by Card challenge and key version number as on the Card side, and uses Card challenge and Host challenge as materials for the session. Generate a Card cryptogram using the key. The host confirms that the card is a legitimate partner who knows the key value by comparing the Card cryptogram generated by itself with the Card cryptogram received from the card side and confirming that they match. Upon confirming this, the host calculates a ciphertext called Host cryptogram using the session key using the Card challenge and Host challenge as materials, and sends an EXTERNAL AUTHENTICATE command including the Host cryptogram to the Card (step S7).

これに対してcardはhost側と同様にCard challengeとHost challengeを材料に、セッションキーを用いてHost cryptogramを生成し、自身で生成したHost cryptogramとhost側から受信したHost cryptogramを比較し、一致するか確認することにより、hostが鍵値を知る正当な相手であることを確認する。cardは、これを確認すると、相互認証が完了したことをhostに知らせる(ステップS8)。 On the other hand, card uses Card challenge and Host challenge as materials like the host side, generates Host cryptogram using the session key, compares the Host cryptogram generated by itself with the Host cryptogram received from the host side, and matches. Confirm that the host is a legitimate partner who knows the key value by confirming whether or not to do so. Upon confirming this, the card notifies the host that mutual authentication has been completed (step S8).

相互認証完了以降は、互いに生成したセッションキーを用いてMAC(Message Authentication Code)と呼ばれるチェックコードを生成・検証することでコマンドを保護する(ステップS9〜ステップS12)。 After the mutual authentication is completed, the command is protected by generating and verifying a check code called MAC (Message Authentication Code) using the session keys generated by each other (steps S9 to S12).

ところで、SDにおいては自身が保有する複数のkey versionの中から1つだけをデフォルトキーバージョン(「デフォルトキー」という場合がある)として設定することができる。相互認証においてデフォルトキーを使用する場合、INITIALIZE UPDATEコマンドにおいてkey version numberを指定する際、「0x00」を指定することが、GlobalPlatformの仕様によって定められている。SDが保有するkey versionは「0x01」〜「0x7F」まで存在し、「0x00」は存在しないが、GlobalPlatform仕様にて定義されるPUT KEYコマンド、STORE DATAコマンドと呼ばれるコマンドにより、key version「0x01」〜「0x7F」の鍵を設定する際に、デフォルトキーを設定することができる。そして、例えば、SDが保有するkey versionの中で、key version number「0x20」のkey versionをデフォルトキーとして設定した場合において、INITIALIZE UPDATEコマンドにおいてkey version number「0x00」が指定されると、key version numberが「0x20」の鍵が使用されることになる。これにより、hostはINITIALIZE UPDATEコマンドの送信時毎に、key version numberを変更しなくても「0x00」を指定することにより同じkey version(デフォルトキー)を使い回すことができ、負荷を軽減することができる。 By the way, in SD, only one of a plurality of key versions owned by itself can be set as a default key version (sometimes referred to as a "default key"). When using the default key for mutual authentication, the Global Platform specification stipulates that "0x00" should be specified when specifying the key version number in the INITIALIZE UPDATE command. The key version possessed by SD exists from "0x01" to "0x7F", and "0x00" does not exist, but the key version "0x01" is obtained by the commands called PUT KEY command and STORE DATA command defined in the Global Platform specifications. ~ When setting the "0x7F" key, you can set the default key. Then, for example, when the key version of the key version number "0x20" is set as the default key among the key versions possessed by the SD, and the key version number "0x00" is specified in the INITIALIZE UPDATE command, the key version The key whose number is "0x20" will be used. As a result, the host can reuse the same key version (default key) by specifying "0x00" without changing the key version number every time the INITIALIZE UPDATE command is sent, reducing the load. Can be done.

特許第4184751号Patent No. 4184751

しかしながら、SDが保有するkey versionにおいて、デフォルトキーとして設定可能なkey versionは1つだけである。これは、デフォルトキーを利用する際は、key version numberを明示的に指定せずとも所定の情報(「0x00」)を指定するだけで、暗黙的にkey version numberを一意に特定できるようにするためである。これにより、hostは、デフォルトキーを使用することで、key version numberを変更する負担を軽減することができるが、例えば、アプリケーションに応じて複数のデフォルトキーを使い分けて使用することができず、利便性が低いという問題がある。 However, in the key version possessed by SD, only one key version can be set as the default key. This makes it possible to implicitly uniquely identify the key version number by simply specifying the specified information ("0x00") without explicitly specifying the key version number when using the default key. Because. As a result, the host can reduce the burden of changing the key version number by using the default key, but for example, it is not possible to use multiple default keys properly according to the application, which is convenient. There is a problem of low sex.

そこで、本発明は、このような点に鑑みてなされたものであり、host等の外部機器とアプリケーション間における開設済の通信路(ロジカルチャネル)をセキュアな通信路にするセキュア処理に用いるキーのキーバージョンについて、外部機器側でキーバージョンを明示的に指定しなくても、複数のデフォルトキーバージョンを使い分けることができる電子情報記憶媒体等を提供する。 Therefore, the present invention has been made in view of these points, and is a key used for secure processing that makes an established communication path (logical channel) between an external device such as a host and an application a secure communication path. Regarding the key version, an electronic information storage medium or the like that can use a plurality of default key versions properly without explicitly specifying the key version on the external device side is provided.

上記課題を解決するために、請求項1に記載の発明は、外部機器とアプリケーション間における開設済の通信路をセキュアな通信路にするセキュア処理に用いるキーをキーバージョン毎に記憶するメモリと、前記セキュア処理に使用するキーのキーバージョンを示すキーバージョン情報を含むコマンドを受信した場合に当該キーバージョンのキーを用いて前記セキュア処理を実行する実行部と、を備える電子情報記憶媒体であって、前記メモリは、前記キーバージョン情報として所定の情報を含む前記コマンドを受信した場合に用いる複数のデフォルトキーバージョンを、これらを識別するための識別情報と対応付けて記憶し、前記実行部は、前記キーバージョン情報として前記所定の情報を含む前記コマンドを受信した場合に、前記開設済の通信路に対応する前記識別情報により識別されるデフォルトキーバージョンのキーを用いて前記セキュア処理を実行することを特徴とする。 In order to solve the above problem, the invention according to claim 1 includes a memory for storing a key used for secure processing for making an established communication path between an external device and an application a secure communication path for each key version. An electronic information storage medium including an execution unit that executes the secure process using the key of the key version when a command including key version information indicating the key version of the key used for the secure process is received. The memory stores a plurality of default key versions used when the command including predetermined information is received as the key version information in association with the identification information for identifying them, and the execution unit stores the key version information. When the command including the predetermined information is received as the key version information, the secure process is executed by using the key of the default key version identified by the identification information corresponding to the opened communication path. It is characterized by.

請求項2に記載の発明は、請求項1に記載の電子情報記憶媒体であって、前記識別情報は、前記開設済の通信路に対応するロジカルチャネル番号を示す情報であって、前記実行部は、前記キーバージョン情報として前記所定の情報を含む前記コマンドを受信した場合に、前記ロジカルチャネル番号に対応するデフォルトキーバージョンのキーを用いて前記セキュア処理を実行することを特徴とする。 The invention according to claim 2 is the electronic information storage medium according to claim 1, wherein the identification information is information indicating a logical channel number corresponding to the established communication path, and is the execution unit. Is characterized in that, when the command including the predetermined information is received as the key version information, the secure process is executed by using the key of the default key version corresponding to the logical channel number.

請求項3に記載の発明は、請求項1に記載の電子情報記憶媒体であって、前記識別情報は、前記開設済の通信路を使用して前記外部機器と通信を行う前記アプリケーションを識別するアプリケーション情報であって、前記実行部は、前記キーバージョン情報として前記所定の情報を含む前記コマンドを受信した場合に、前記アプリケーション情報に対応するデフォルトキーバージョンのキーを用いて前記セキュア処理を実行することを特徴とする。 The invention according to claim 3 is the electronic information storage medium according to claim 1, wherein the identification information identifies the application that communicates with the external device using the established communication path. When the execution unit receives the command including the predetermined information as the key version information, which is the application information, the execution unit executes the secure process by using the key of the default key version corresponding to the application information. It is characterized by that.

請求項4に記載の発明は、外部機器とアプリケーション間における開設済の通信路をセキュアな通信路にするセキュア処理に用いるキーをキーバージョン毎に記憶するメモリと、前記セキュア処理に使用するキーのキーバージョンを示すキーバージョン情報を含むコマンドを受信した場合に当該キーバージョンのキーを用いて前記セキュア処理を実行する実行部と、を備える電子情報記憶媒体によるセキュア処理実行方法であって、前記メモリは、前記キーバージョン情報として所定の情報を含む前記コマンドを受信した場合に用いる複数のデフォルトキーバージョンを、これらを識別するための識別情報と対応付けて記憶し、前記実行部が、前記キーバージョン情報として所定の情報を含む前記コマンドを受信した場合に、前記開設済の通信路に対応する前記識別情報により識別されるデフォルトキーバージョンのキーを用いて前記セキュア処理を実行するステップを含むことを特徴とする。 The invention according to claim 4 is a memory for storing a key used for secure processing for making an established communication path between an external device and an application a secure communication path for each key version, and a key used for the secure processing. A method of executing secure processing by an electronic information storage medium including an execution unit that executes the secure processing using the key of the key version when a command including key version information indicating a key version is received, and the memory. Stores a plurality of default key versions used when receiving the command including predetermined information as the key version information in association with the identification information for identifying them, and the execution unit stores the key version. Including the step of executing the secure process using the default key version of the key identified by the identification information corresponding to the opened communication path when the command including the predetermined information is received as the information. It is a feature.

請求項5に記載の発明は、外部機器とアプリケーション間における開設済の通信路をセキュアな通信路にするセキュア処理に用いるキーをキーバージョン毎に記憶するメモリと、前記セキュア処理に使用するキーのキーバージョンを示すキーバージョン情報を含むコマンドを受信した場合に当該キーバージョンのキーを用いて前記セキュア処理を実行する実行部と、を備え、前記メモリが、前記キーバージョン情報として所定の情報を含む前記コマンドを受信した場合に用いる複数のデフォルトキーバージョンを、これらを識別するための識別情報と対応付けて記憶する電子情報記憶媒体における前記実行部に、前記キーバージョン情報として所定の情報を含む前記コマンドを受信した場合に、前記開設済の通信路に対応する前記識別情報により識別されるデフォルトキーバージョンのキーを用いて前記セキュア処理を実行するステップを実行させることを特徴とする。 The invention according to claim 5 is a memory for storing a key used for secure processing for making an established communication path between an external device and an application a secure communication path for each key version, and a key used for the secure processing. The memory includes an execution unit that executes the secure process using the key of the key version when a command including the key version information indicating the key version is received, and the memory includes predetermined information as the key version information. The execution unit in the electronic information storage medium that stores a plurality of default key versions used when the command is received in association with identification information for identifying them includes predetermined information as the key version information. When a command is received, the step of executing the secure process is executed by using the key of the default key version identified by the identification information corresponding to the opened communication path.

本発明によれば、複数のデフォルトキーバージョンがこれらを識別する識別情報とともに設定され、キーバージョン情報として所定の情報を含むコマンドを受信した場合に、開設済の通信路に対応する識別情報により識別されるデフォルトキーバージョンのキーを用いてセキュア処理を実行する。したがって、デフォルトキーバージョンの使い分け方に応じて識別情報を設定しておくことにより、コマンドにおいてキーバージョン情報を明示的に指定しなくても、複数のデフォルトキーバージョンを使い分けることができる。 According to the present invention, a plurality of default key versions are set together with identification information for identifying them, and when a command including predetermined information is received as key version information, identification is performed by the identification information corresponding to the established communication path. Perform secure processing using the default key version of the key. Therefore, by setting the identification information according to how to use the default key version properly, it is possible to use a plurality of default key versions properly without explicitly specifying the key version information in the command.

相互認証処理の一例を示すシーケンス図である。It is a sequence diagram which shows an example of mutual authentication processing. (A)は、ICカード1に搭載されるICチップ1aのハードウェア構成例を示す図であり、(B)は、ICカード1の機能構成例を示す図である。(A) is a diagram showing a hardware configuration example of the IC chip 1a mounted on the IC card 1, and (B) is a diagram showing a functional configuration example of the IC card 1. (A)は、SDにより管理される論理的な鍵空間の一例を示す図であり、(B)は、デフォルトキーテーブルの一例を示す図である。(A) is a diagram showing an example of a logical key space managed by SD, and (B) is a diagram showing an example of a default key table. 複数のSD及び複数のApplication間で形成される階層構造の一例を示す図である。It is a figure which shows an example of the hierarchical structure formed between a plurality of SDs and a plurality of Applications. コマンド受信時処理の一例を示すフローチャートである。It is a flowchart which shows an example of the processing at the time of command reception. 第2実施形態におけるデフォルトキーテーブルの一例を示す図である。It is a figure which shows an example of the default key table in 2nd Embodiment. 第2実施形態におけるコマンド受信時処理の一例を示すフローチャートである。It is a flowchart which shows an example of the command reception processing in 2nd Embodiment.

[1.第1実施形態]
以下、図面を参照して本発明の第1実施形態について詳細に説明する。以下に説明する実施形態は、ICチップを搭載するICカードに対して本発明を適用した場合の実施の形態である。
[1. First Embodiment]
Hereinafter, the first 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 card on which an IC chip is mounted.

[1.1.ICチップ1aの構成及び機能概要]
まず、図2(A)を参照して、本実施形態に係るICカード1に搭載されるICチップ1aの構成及び機能概要について説明する。図2(A)は、ICカード1に搭載されるICチップ1aのハードウェア構成例を示す図である。ICカード1は、キャッシュカード、クレジットカード、社員カード等として使用される。或いは、ICカード1は、スマートフォンや携帯電話機等の通信機器に組み込まれる。或いは、ICチップ1aが通信機器の回路基板上に直接組み込まれて構成されるようにしてもよい。なお、ICチップ1aは、本発明の電子情報記憶媒体の一例である。
[1.1. Outline of configuration and function of IC chip 1a]
First, with reference to FIG. 2A, the configuration and functional outline of the IC chip 1a mounted on the IC card 1 according to the present embodiment will be described. FIG. 2A is a diagram showing a hardware configuration example of the IC chip 1a mounted on the IC card 1. The IC card 1 is used as a cash card, a credit card, an employee card, and the like. Alternatively, the IC card 1 is incorporated in a communication device such as a smartphone or a mobile phone. Alternatively, the IC chip 1a may be configured by being directly incorporated on the circuit board of the communication device. The IC chip 1a is an example of the electronic information storage medium of the present invention.

図2(A)に示すように、ICチップ1aは、CPU(Central Processing Unit)10、RAM(Random Access Memory)11、ROM(Read Only Memory)12、不揮発性メモリ13、及びI/O回路14を備えて構成される。CPU10は、ROM12または不揮発性メモリ13に記憶された各種プログラムを実行するプロセッサ(コンピュータ)である。なお、I/O回路14は、外部機器2とのインターフェイスを担う。これにより、ICチップ1aは、ICリーダ・ライタを備える外部機器2との間で接触または非接触で通信を行うことができる。接触式のICチップ1aの場合、I/O回路14には、例えば、C1〜C8の8個の端子が備えられている。例えば、C1端子は電源端子(ICチップ1aへ電源供給する端子)、C2端子はリセット端子、C3端子はクロック端子、C5端子はグランド端子、C7端子は外部機器2との間で通信を行うための端子である。一方、非接触式のICチップ1aの場合、I/O回路14には、例えば、アンテナ、及び変復調回路が備えられている。なお、外部機器2の例としては、ICカード発行機、ATM、改札機、認証用ゲート等が挙げられる。或いは、ICチップ1aが通信機器に組み込まれる場合、外部機器2には通信機器の機能を担う制御部が該当する。 As shown in FIG. 2A, the IC chip 1a includes a CPU (Central Processing Unit) 10, a RAM (Random Access Memory) 11, a ROM (Read Only Memory) 12, a non-volatile memory 13, and an I / O circuit 14. Is configured with. The CPU 10 is a processor (computer) that executes various programs stored in the ROM 12 or the non-volatile memory 13. The I / O circuit 14 serves as an interface with the external device 2. As a result, the IC chip 1a can communicate with or without contact with the external device 2 provided with the IC reader / writer. In the case of the contact type IC chip 1a, the I / O circuit 14 is provided with, for example, eight terminals C1 to C8. For example, the C1 terminal is a power supply terminal (terminal that supplies power to the IC chip 1a), the C2 terminal is a reset terminal, the C3 terminal is a clock terminal, the C5 terminal is a ground terminal, and the C7 terminal communicates with an external device 2. It is a terminal of. On the other hand, in the case of the non-contact type IC chip 1a, the I / O circuit 14 is provided with, for example, an antenna and a modulation / demodulation circuit. Examples of the external device 2 include an IC card issuing machine, an ATM, a ticket gate, an authentication gate, and the like. Alternatively, when the IC chip 1a is incorporated in a communication device, the external device 2 corresponds to a control unit that has a function of the communication device.

不揮発性メモリ13には、例えばフラッシュメモリが適用される。不揮発性メモリ13に記憶される各種プログラム及びデータの一部は、ROM12に記憶されてもよい。なお、不揮発性メモリ13は、「Electrically Erasable Programmable Read-Only Memory」であってもよい。本実施形態において、ROM12と不揮発性メモリ13との何れかに記憶されるプログラムには、オペレーティングシステム(Operating System、以下、「OS」という)、複数(つまり、複数種類)のアプリケーションプログラム、及び複数のSDプログラム(複数種類のSD(例えば、ISD、SSD)のそれぞれに対応するSDプログラム)等が含まれる。 For example, a flash memory is applied to the non-volatile memory 13. A part of various programs and data stored in the non-volatile memory 13 may be stored in the ROM 12. The non-volatile memory 13 may be an "Electrically Erasable Programmable Read-Only Memory". In the present embodiment, the programs stored in either the ROM 12 or the non-volatile memory 13 include an operating system (hereinafter referred to as “OS”), a plurality of (that is, a plurality of types) application programs, and a plurality of programs. SD program (SD program corresponding to each of a plurality of types of SD (for example, ISD, SSD)) and the like are included.

ここで、アプリケーションプログラムは、ICカード1においてアプリケーションインスタンス(以下、「Application」という)の機能(言い換えれば、モジュール)を実現するためのプログラムである。これにより、CPU10は、Applicationとして機能する。SDプログラムは、ICカード1においてSDの機能を実現するためのプログラムである。これにより、CPU10は、Application等を管理するSDとして機能する。SCPプログラムは、ICカード1においてSCPの機能を実現するためのプログラムである。SCPは、ICカード1と外部機器2(ホスト)との間でセキュアな通信路を形成するための通信プロトコルの一例である。このような通信路を形成するために、ICカード1と外部機器2(ホスト)とは、SCPで決められたアルゴリズムに従い、暗号演算の元となる鍵を互いが知っているという前提の下、SCPに従った通信路(以下、「SCP通信路」という)を開設するための相互認証を行うようになっている。SCP通信路の開設後、ICカード1と外部機器2の間で送受信されるデータ(例えば、コマンド)は、そのセッションの間、SCPにより保護される。つまり、ICカード1と外部機器2とは、そのセッションの間、相互認証において生成されたセッションキーを用いて、MACと呼ばれるチェックコードを生成、及び検証することでデータを保護する。 Here, the application program is a program for realizing the function (in other words, the module) of the application instance (hereinafter referred to as "Application") in the IC card 1. As a result, the CPU 10 functions as an Application. The SD program is a program for realizing the SD function in the IC card 1. As a result, the CPU 10 functions as an SD that manages Applications and the like. The SCP program is a program for realizing the function of SCP in the IC card 1. SCP is an example of a communication protocol for forming a secure communication path between the IC card 1 and the external device 2 (host). In order to form such a communication path, the IC card 1 and the external device 2 (host) follow the algorithm determined by SCP, and under the premise that they know each other the key that is the basis of the cryptographic calculation. Mutual authentication is to be performed to establish a communication path according to SCP (hereinafter referred to as "SCP communication path"). After the establishment of the SCP communication path, the data (for example, a command) transmitted and received between the IC card 1 and the external device 2 is protected by the SCP during the session. That is, the IC card 1 and the external device 2 protect the data by generating and verifying a check code called MAC by using the session key generated in the mutual authentication during the session.

図2(B)は、ICカード1の機能構成例を示す図である。図2(B)の例では、ICカード1のOS上で、ISD、SSD-1、Application-1、Application-2、Application-3、及びApplication-4が実現されている。つまり、図2(B)の例では、ICカード1は、当該ICカード1にインストールされた各Applicationを管理するSDを複数備えることになる。図2(B)において、SCP通信のICカード1におけるエンドポイントは、ISD及びSSD-1のそれぞれとなる。よって、SCPで用いられる鍵はSD毎に管理される。各SDは、例えば、論理的な鍵空間を鍵ストレージで管理する。鍵ストレージは、例えば不揮発性メモリ13におけるセキュアな記憶領域に設けられる。 FIG. 2B is a diagram showing a functional configuration example of the IC card 1. In the example of FIG. 2B, ISD, SSD-1, Application-1, Application-2, Application-3, and Application-4 are realized on the OS of the IC card 1. That is, in the example of FIG. 2B, the IC card 1 includes a plurality of SDs that manage each Application installed on the IC card 1. In FIG. 2B, the endpoints of the IC card 1 for CP communication are ISD and SSD-1, respectively. Therefore, the key used in SCP is managed for each SD. Each SD manages, for example, a logical key space with a key storage. The key storage is provided, for example, in a secure storage area in the non-volatile memory 13.

図3(A)は、SDにより管理される論理的な鍵空間の一例を示す図である。各SDは、独立した鍵空間を持ち、図3(A)に示すように、鍵空間をkey version number(0x01〜0x7F)で管理する。各SDは、key version numberで管理する鍵空間(鍵ストレージ)へ、key ID(0x00〜0x7F)を割り当てた鍵を格納する。そして、各SDは、key version numberとkey IDを参照し、自己が保持する鍵情報(Key1 ,Key2等)を一意に特定する。このような鍵情報には、鍵の値の他に、key type(DES, AES, RSAなど)、及びkey lengthが含まれる。なお、各SDが実際にメモリ上へ確保する鍵空間のサイズについては例えばICカード1の発行前に決められる。 FIG. 3A is a diagram showing an example of a logical key space managed by SD. Each SD has an independent key space, and as shown in FIG. 3A, the key space is managed by a key version number (0x01 to 0x7F). Each SD stores the key to which the key ID (0x00 to 0x7F) is assigned in the key space (key storage) managed by the key version number. Then, each SD refers to the key version number and the key ID, and uniquely identifies the key information (Key1, Key2, etc.) held by itself. Such key information includes key type (DES, AES, RSA, etc.) and key length in addition to the key value. The size of the key space actually secured by each SD on the memory is determined, for example, before the issuance of the IC card 1.

図3(B)は、SDにより管理されるデフォルトキーテーブルの一例を示す図である。各SDは、独立したデフォルトキーテーブルを持ち、図3(B)に示すように、デフォルトキーテーブルはロジカルチャネル番号(01、02)とデフォルトキーバージョンを示すkey version numberを対応付けている。デフォルトキーテーブルは、外部機器2からkey version numberとして「0x00」を含むINITIALIZE UPDATEコマンドを受信した際にSDにより参照され、SDは当該コマンドに含まれるロジカルチャネル番号に対応するデフォルトキーバージョンに対応する鍵を選択して、セッションキーの作成に使用する。 FIG. 3B is a diagram showing an example of a default key table managed by SD. Each SD has an independent default key table, and as shown in FIG. 3 (B), the default key table associates a logical channel number (01, 02) with a key version number indicating a default key version. The default key table is referenced by the SD when an INITIALIZE UPDATE command containing "0x00" as the key version number is received from the external device 2, and the SD corresponds to the default key version corresponding to the logical channel number included in the command. Select a key to use to create the session key.

このように第1実施形態では、デフォルトキーバージョンに対して、ロジカルチャネルとの紐付けを行い、ロジカルチャネル別にデフォルトキーバージョンが存在することを可能にすることで、複数のデフォルトキーバージョンをロジカルチャネルに応じて使い分けることができる。SDは、鍵を登録する際、PUT KEYコマンド、STORE DATAコマンドと呼ばれるコマンド(GlobalPlatform仕様にて定義)を実行する。当該コマンドを実行する際、既存仕様にて要求される鍵に関する情報(鍵値、鍵長、鍵の暗号アルゴリズム種別(AES/DES/RSAなど)、key version numberなど)に加え、新たに「鍵に紐付けるロジカルチャネル番号」を付与するものとする。

例えば、PUT KEYコマンド実行時に、key version number「0x20」とロジカルチャネル番号「01」を紐付け、key version number「0x30」とロジカルチャネル番号「02」を紐付け、key version number「0x20」及びkey version number「0x30」で示されるキーバージョンをデフォルトキーバージョンとして設定する。この場合、外部機器2は、INITIALIZE UPDATEコマンドをロジカルチャネル番号「01」で識別されるロジカルチャネルを介して送信し、key version numberとして「0x00」を指定すると、暗黙的にロジカルチャネル番号「01」に紐付けられているkey version number「0x20」で示されるキーバージョンの鍵を用いてセッションキーが作成される。
As described above, in the first embodiment, the default key version is associated with the logical channel, and a plurality of default key versions can be logically channeled by enabling the existence of the default key version for each logical channel. It can be used properly according to. When registering a key, SD executes commands called PUT KEY command and STORE DATA command (defined in the Global Platform specifications). When executing the command, in addition to the information about the key required by the existing specifications (key value, key length, key encryption algorithm type (AES / DES / RSA, etc.), key version number, etc.), a new "key" is added. The "logical channel number associated with" shall be assigned.

For example, when executing the PUT KEY command, the key version number "0x20" is associated with the logical channel number "01", the key version number "0x30" is associated with the logical channel number "02", and the key version number "0x20" and key are associated. version number Set the key version indicated by "0x30" as the default key version. In this case, when the external device 2 transmits the INITIALIZE UPDATE command via the logical channel identified by the logical channel number "01" and specifies "0x00" as the key version number, the external device 2 implicitly receives the logical channel number "01". A session key is created using the key version of the key indicated by the key version number "0x20" associated with.

複数のSD及び複数のApplicationは互いの間で階層構造を形成する。図4は、複数のSD及び複数のApplication間で形成される階層構造の一例を示す図である。図4の例では、階層構造における最上位に位置するISDの配下には、SSD-1、Application-1及びApplication-2が位置(存在)するため、SSD-1、Application-1及びApplication-2は、ISDのセキュリティポリシーが適応される。また、SSD-1の配下には、Application-3及びApplication-4が位置するため、Application-3及びApplication-4は、SSD-1のセキュリティポリシーが適応され、さらに、その上位のISDのセキュリティポリシーも適応される。 A plurality of SDs and a plurality of Applications form a hierarchical structure between each other. FIG. 4 is a diagram showing an example of a hierarchical structure formed between a plurality of SDs and a plurality of Applications. In the example of FIG. 4, SSD-1, Application-1 and Application-2 are located (exist) under the ISD located at the highest level in the hierarchical structure, so SSD-1, Application-1 and Application-2 are located. Is subject to the ISD security policy. In addition, since Application-3 and Application-4 are located under SSD-1, the security policy of SSD-1 is applied to Application-3 and Application-4, and the security policy of the higher ISD is applied. Is also applied.

なお、外部機器2とApplication-3との通信路(ロジカルチャネル)についてセキュア処理を実行する場合には、Application-3は独自の鍵ストレージを保有していないので、直ぐ上位のSSD-1にセキュア処理の一部又は全てを実行してもらう。 When executing secure processing on the communication path (logical channel) between the external device 2 and Application-3, Application-3 does not have its own key storage, so it is secured to the SSD-1 immediately above. Have some or all of the processing performed.

[1.2.ICチップ1aにおけるコマンド受信時処理]
次に、図5を用いて、ICチップ1aのSSD-1(SELECTコマンドにより選択されたアプリケーションとしてのSSD-1)が外部機器2からコマンド(SELECTコマンド以外のコマンド)を受信した際の動作について説明する。
[1.2. Processing when a command is received in the IC chip 1a]
Next, using FIG. 5, the operation when the SSD-1 of the IC chip 1a (SSD-1 as an application selected by the SELECT command) receives a command (command other than the SELECT command) from the external device 2 explain.

まず、SSD-1(を実行するCPU10)は、ロジカルチャネルを通じて受信したコマンドがINITIALIZE UPDATEコマンドであるか否かを判定する(ステップS101)。SSD-1は、受信したコマンドがINITIALIZE UPDATEコマンドではないと判定した場合には(ステップS101:NO)、受信したコマンドを実行し(ステップS102)、外部機器2に応答を送信して(ステップS109)、当該フローチャートに示す処理を終了する。一方、SSD-1は、受信したコマンドがINITIALIZE UPDATEコマンドであると判定した場合には(ステップS101:YES)、INITIALIZE UPDATEコマンドに含まれるkey version numberが「0x00」であるか否かを判定する(ステップS103)。 First, the SSD-1 (CPU 10 that executes) determines whether or not the command received through the logical channel is an INITIALIZE UPDATE command (step S101). When the SSD-1 determines that the received command is not an INITIALIZE UPDATE command (step S101: NO), the SSD-1 executes the received command (step S102), sends a response to the external device 2 (step S109). ), The process shown in the flowchart is terminated. On the other hand, when the SSD-1 determines that the received command is an INITIALIZE UPDATE command (step S101: YES), the SSD-1 determines whether or not the key version number included in the INITIALIZE UPDATE command is "0x00". (Step S103).

SSD-1はkey version numberが「0x00」であると判定した場合には(ステップS103:YES)、自らのデフォルトキーテーブルを参照して、INITIALIZE UPDATEコマンドに含まれるチャネル番号に対応するデフォルトキー(key version number)が存在するか否かを確認する(ステップS104)。SSD-1は、デフォルトキーが存在すると判定した場合には(ステップS104:YES)、当該デフォルトキーの3つの鍵を用いてコマンド実行(Card challengeと3つの鍵を基に3つのセッションキーを生成し、Card challengeとHost challengeを材料に、セッションキーを用いてCard cryptogramを演算)して(ステップS105)、次いで、Card challengeとCard cryptogramを含む応答を外部機器2に送信し(ステップS109)、当該フローチャートに示す処理を終了する。また、SSD-1は、デフォルトキー(key version number)が存在しないと判定した場合には(ステップS104:NO)、エラー処理(エラー情報の生成等)を実行し(ステップS106)、外部機器2に応答を送信し(ステップS109)、当該フローチャートに示す処理を終了する。 When the SSD-1 determines that the key version number is "0x00" (step S103: YES), it refers to its own default key table and refers to the default key corresponding to the channel number included in the INITIALIZE UPDATE command (step S103: YES). It is confirmed whether or not the key version number) exists (step S104). When the SSD-1 determines that the default key exists (step S104: YES), the SSD-1 executes a command using the three keys of the default key (Card challenge and generates three session keys based on the three keys). Then, using the Card challenge and Host challenge as materials, the Card cryptogram is calculated using the session key) (step S105), and then the response including the Card challenge and the Card cryptogram is transmitted to the external device 2 (step S109). The process shown in the flowchart is terminated. If the SSD-1 determines that the default key (key version number) does not exist (step S104: NO), the SSD-1 executes error processing (generation of error information, etc.) (step S106), and the external device 2 (Step S109) is transmitted to, and the process shown in the flowchart is terminated.

一方、SSD-1はkey version numberが「0x00」ではないと判定した場合には(ステップS103:NO)、自らの論理的な鍵空間を参照して、INITIALIZE UPDATEコマンドに含まれるkey version numberに対応するキーバージョンの鍵が存在するか否かを確認する(ステップS107)。SSD-1は、key version numberに対応するキーバージョンの鍵が存在すると判定した場合には(ステップS107:YES)、当該key version numberに対応する3つの鍵を用いてコマンド実行(Card challengeと3つの鍵を基に3つのセッションキーを生成し、Card challengeとHost challengeを材料に、セッションキーを用いてCard cryptogramを演算)して(ステップS108)、次いで、Card challengeとCard cryptogramを含む応答を外部機器2に送信し(ステップS109)、当該フローチャートに示す処理を終了する。また、SSD-1は、key version numberに対応するキーバージョンの鍵が存在しないと判定した場合には(ステップS107:NO)、エラー処理(エラー情報の生成等)を実行し(ステップS106)、外部機器2に応答を送信し(ステップS109)、当該フローチャートに示す処理を終了する。 On the other hand, when SSD-1 determines that the key version number is not "0x00" (step S103: NO), it refers to its own logical key space and sets it to the key version number included in the INITIALIZE UPDATE command. It is confirmed whether or not the key of the corresponding key version exists (step S107). When the SSD-1 determines that the key of the key version corresponding to the key version number exists (step S107: YES), the SSD-1 executes a command using the three keys corresponding to the key version number (Card challenge and 3). Generate three session keys based on one key, calculate the Card cryptogram using the session key using the Card challenge and Host challenge as materials) (step S108), and then generate a response including the Card challenge and Card cryptogram. It is transmitted to the external device 2 (step S109), and the process shown in the flowchart is completed. Further, when the SSD-1 determines that the key of the key version corresponding to the key version number does not exist (step S107: NO), the SSD-1 executes error processing (generation of error information, etc.) (step S106). A response is transmitted to the external device 2 (step S109), and the process shown in the flowchart is terminated.

以上のように、第1実施形態のICカード1は、RAM11(「メモリ」の一例)が、外部機器2とApplication間における開設済の通信路(ロジカルチャネル)をセキュアな通信路にするセキュア処理に用いる鍵(「キー」の一例)をkey version number(「キーバージョン」)毎に記憶し、CPU10(「実行部」の一例)がセキュア処理に使用する鍵のkey versionを示すkey version number(「キーバージョン情報」の一例)を含むINITIALIZE UPDATEコマンド(「コマンド」の一例)を受信した場合に当該key versionの鍵を用いてセキュア処理を実行する。また、RAM11は、key version numberとして「0x00」(「所定の情報」の一例)を含むINITIALIZE UPDATEコマンドを受信した場合に用いる複数のデフォルトキーバージョンを、これらを識別するためのロジカルチャネル番号(「識別情報」の一例)と対応付けて記憶し、CPU10は、key version numberとして「0x00」を含むINITIALIZE UPDATEコマンドを受信した場合に、開設済の通信路(ロジカルチャネル)に対応するロジカルチャネル番号により識別されるデフォルトキーバージョンの鍵を用いてセキュア処理を実行する。 As described above, in the IC card 1 of the first embodiment, the RAM 11 (an example of "memory") is a secure process in which the established communication path (logical channel) between the external device 2 and the Application is made into a secure communication path. The key (an example of "key") used for is stored for each key version number ("key version"), and the key version number (key version number) indicating the key version of the key used by CPU 10 (an example of "execution unit") for secure processing When an INITIALIZE UPDATE command (an example of a "command") including an example of "key version information" is received, secure processing is executed using the key of the key version. Further, the RAM 11 sets a plurality of default key versions used when receiving an INITIALIZE UPDATE command including "0x00" (an example of "predetermined information") as a key version number, and a logical channel number ("" When the CPU 10 receives the INITIALIZE UPDATE command including "0x00" as the key version number, it stores it in association with an example of "identification information"), and uses the logical channel number corresponding to the established communication path (logical channel). Perform secure processing with the identified default key version of the key.

したがって、第1実施形態のICカード1によれば、複数のデフォルトキーバージョンがこれらを識別するロジカルチャネル番号とともに設定され、key version numberとして「0x00」を含むINITIALIZE UPDATEコマンドを受信した場合に、開設済の通信路(ロジカルチャネル)に対応するロジカルチャネル番号により識別されるデフォルトキーバージョンの鍵を用いてセキュア処理を実行する。すなわち、デフォルトキーバージョンの使い分け方に応じてロジカルチャネル番号を設定しておくことにより、INITIALIZE UPDATEコマンドにおいてkey version numberを明示的に指定しなくても、複数のデフォルトキーバージョンを使い分けることができる。 Therefore, according to the IC card 1 of the first embodiment, when a plurality of default key versions are set together with a logical channel number for identifying them and an INITIALIZE UPDATE command including "0x00" is received as the key version number, the opening is performed. Secure processing is executed using the default key version of the key identified by the logical channel number corresponding to the completed communication path (logical channel). That is, by setting the logical channel number according to how to use the default key version properly, it is possible to use a plurality of default key versions properly without explicitly specifying the key version number in the INITIALIZE UPDATE command.

[2.第2実施形態]
以下、図面を参照して本発明の第2実施形態について詳細に説明する。なお、第2実施形態は、第1実施形態と一部を除き同様であるので、第1実施形態との相違点を中心に説明する。
[2. Second Embodiment]
Hereinafter, the second embodiment of the present invention will be described in detail with reference to the drawings. Since the second embodiment is the same as the first embodiment except for a part, the differences from the first embodiment will be mainly described.

[2.1.ICチップ1aの構成に関する相違点]
まず、第1実施形態では、図3(B)に示すデフォルトキーテーブルを使用したが、第2実施形態では、図6に示すデフォルトキーテーブルを使用する。本実施形態のデフォルトキーテーブルは、Applicationを識別するAID(Application ID)(01、02)とデフォルトキー(key version number)を対応付ける。デフォルトキーテーブルは、外部機器2からkey version numberとして「0x00」を含むINITIALIZE UPDATEコマンドを受信した際にSDにより参照され、SDは当該コマンドの送信先であるApplicationに対応するデフォルトキー(key version number)に対応する鍵を選択する。
[2.1. Differences regarding the configuration of the IC chip 1a]
First, in the first embodiment, the default key table shown in FIG. 3B is used, but in the second embodiment, the default key table shown in FIG. 6 is used. The default key table of this embodiment associates an AID (Application ID) (01, 02) that identifies an Application with a default key (key version number). The default key table is referenced by the SD when an INITIALIZE UPDATE command containing "0x00" as the key version number is received from the external device 2, and the SD is the default key (key version number) corresponding to the Application to which the command is sent. ) Corresponds to the key.

このように第2実施形態では、デフォルトキーバージョンに対して、Applicationとの紐付けを行い、Application別にデフォルトキーバージョンが存在することを可能にすることで、複数のデフォルトキーバージョンをApplicationに応じて使い分けることができる。SDは、鍵を登録する際、PUT KEYコマンド、STORE DATAコマンドと呼ばれるコマンド(GlobalPlatform仕様にて定義)を実行する。当該コマンドを実行する際、既存仕様にて要求される鍵に関する情報(鍵値、鍵長、鍵の暗号アルゴリズム種別(AES/DES/RSAなど)、key version numberなど)に加え、新たに「鍵に紐付けるアプリケーションを識別するAID」を付与するものとする。AIDとはアプリケーションを一意に特定する名前を意味するものである。 In this way, in the second embodiment, by associating the default key version with the Application and enabling the existence of the default key version for each Application, a plurality of default key versions can be set according to the Application. You can use it properly. When registering a key, SD executes commands called PUT KEY command and STORE DATA command (defined in the Global Platform specifications). When executing the command, in addition to the information about the key required by the existing specifications (key value, key length, key encryption algorithm type (AES / DES / RSA, etc.), key version number, etc.), a new "key" is added. An "AID that identifies the application associated with" shall be assigned. AID means a name that uniquely identifies the application.

SDの配下にApplicationが存在する場合、SDとApplicationは管理者と被管理者の関係にあり、ApplicationはSDに開設済の通信路についてセキュア処理を依頼することが可能である。例えば、図4の階層構造において、PUT KEYコマンド実行時に、key version number「0x20」とApplication-3のAID「03」を紐付け、key version number「0x30」とApplication-4のAID「04」を紐付け、key version number「0x20」及びkey version number「0x30」で示されるキーバージョンをデフォルトキーバージョンとして設定する。この場合、key version number「0x00」を指定するINITIALIZE UPDATEコマンドをApplication-3が実行し、SSD-1にセキュアな通信路の開設を依頼すると、暗黙的にApplication-3に紐付けられているkey version number「0x20」の鍵が使用される。また、key version number「0x00」を指定するINITIALIZE UPDATEコマンドをApplication-4が実行し、SSD-1にセキュアな通信路の開設を依頼すると、暗黙的にApplication-4に紐付けられているkey version number「0x30」の鍵が使用されることになる。アプリケーションが、SDにセキュアな通信路の開設を依頼した場合だけでなく、SDが自身でセキュアな通信路を開設する場合も同様に、INITIALIZE UPDATEコマンドをkey version number「0x00」を指定して実行した場合は、SD自身に紐付けられたデフォルトキーが暗黙的に使用されることになる。 When Application exists under SD, SD and Application are in a relationship of administrator and managed person, and Application can request secure processing for the communication path established in SD. For example, in the hierarchical structure shown in FIG. 4, when executing the PUT KEY command, the key version number "0x20" and the AID "03" of Application-3 are linked, and the key version number "0x30" and the AID "04" of Application-4 are assigned. Link, set the key version indicated by key version number "0x20" and key version number "0x30" as the default key version. In this case, when Application-3 executes the INITIALIZE UPDATE command that specifies the key version number "0x00" and requests SSD-1 to open a secure communication path, the key implicitly associated with Application-3. The key with version number "0x20" is used. Also, when Application-4 executes the INITIALIZE UPDATE command that specifies the key version number "0x00" and requests SSD-1 to open a secure communication path, the key version implicitly associated with Application-4. The key with number "0x30" will be used. Execute the INITIALIZE UPDATE command by specifying the key version number "0x00" not only when the application requests the SD to open a secure communication path but also when the SD opens a secure communication path by itself. If so, the default key associated with the SD itself will be used implicitly.

[2.2.ICチップ1aにおけるコマンド受信時処理]
次に、図7を用いて、第2実施形態におけるICチップ1aの一のApplication(SELECTコマンドにより選択されたApplication)が外部機器2からコマンド(SELECTコマンド以外のコマンド)を受信した際の動作について説明する。
[2.2. Processing when a command is received in the IC chip 1a]
Next, using FIG. 7, the operation when one Application (Application selected by the SELECT command) of the IC chip 1a in the second embodiment receives a command (command other than the SELECT command) from the external device 2 explain.

まず、Application(を実行するCPU10)は、ロジカルチャネルを通じて受信したコマンドがINITIALIZE UPDATEコマンドであるか否かを判定する(ステップS201)。Applicationは、受信したコマンドがINITIALIZE UPDATEコマンドではないと判定した場合には(ステップS201:NO)、受信したコマンドを実行し(ステップS202)、外部機器2に応答を送信して(ステップS209)、当該フローチャートに示す処理を終了する。一方、Applicationは、受信したコマンドがINITIALIZE UPDATEコマンドであると判定した場合には(ステップS201:YES)、コマンド実行を直ぐ上位のSDに依頼する。そして、SD(を実行するCPU10)は、INITIALIZE UPDATEコマンドに含まれるkey version numberが「0x00」であるか否かを判定する(ステップS203)。 First, Application (the CPU 10 that executes) determines whether or not the command received through the logical channel is an INITIALIZE UPDATE command (step S201). If the Application determines that the received command is not an INITIALIZE UPDATE command (step S201: NO), it executes the received command (step S202), sends a response to the external device 2 (step S209), and then The process shown in the flowchart is terminated. On the other hand, when the Application determines that the received command is an INITIALIZE UPDATE command (step S201: YES), the Application requests the upper SD to execute the command immediately. Then, the SD (CPU 10 that executes) determines whether or not the key version number included in the INITIALIZE UPDATE command is "0x00" (step S203).

SDはkey version numberが「0x00」であると判定した場合には(ステップS203:YES)、自らのデフォルトキーテーブルを参照して、INITIALIZE UPDATEコマンドを受信したApplicationを識別するAIDに対応するデフォルトキー(key version number)が存在するか否かを確認する(ステップS204)。SDは、デフォルトキー(key version number)が存在すると判定した場合には(ステップS204:YES)、当該デフォルトキー(key version number)の3つの鍵を用いてコマンド実行(Card challengeと3つの鍵を基に3つのセッションキーを生成し、Card challengeとHost challengeを材料に、セッションキーを用いてCard cryptogramを演算)して(ステップS205)、次いで、Card challengeとCard cryptogramを含む応答を外部機器2に送信し(ステップS209)、当該フローチャートに示す処理を終了する。また、SDは、デフォルトキー(key version number)が存在しないと判定した場合には(ステップS204:NO)、エラー処理(エラー情報の生成等)を実行し(ステップS206)、外部機器2に応答を送信し(ステップS209)、当該フローチャートに示す処理を終了する。 When the SD determines that the key version number is "0x00" (step S203: YES), the SD refers to its own default key table and refers to the default key corresponding to the AID that identifies the Application that received the INITIALIZE UPDATE command. It is confirmed whether or not (key version number) exists (step S204). When the SD determines that the default key (key version number) exists (step S204: YES), the SD executes a command (Card challenge and three keys) using the three keys of the default key (key version number). Based on this, three session keys are generated, Card challenge and Host challenge are used as materials, and Card cryptogram is calculated using the session key) (step S205), and then the response including Card challenge and Card cryptogram is sent to the external device 2 (Step S209), and the process shown in the flowchart is terminated. If the SD determines that the default key (key version number) does not exist (step S204: NO), the SD executes error processing (generation of error information, etc.) (step S206), and responds to the external device 2. Is transmitted (step S209), and the process shown in the flowchart is terminated.

一方、SDはkey version numberが「0x00」ではないと判定した場合には(ステップS203:NO)、自らの論理的な鍵空間を参照して、INITIALIZE UPDATEコマンドに含まれるkey version numberに対応するキーバージョンの鍵が存在するか否かを確認する(ステップS207)。SDは、key version numberに対応するキーバージョンの鍵が存在すると判定した場合には(ステップS207:YES)、当該key version numberに対応する3つの鍵を用いてコマンド実行(Card challengeと3つの鍵を基に3つのセッションキーを生成し、Card challengeとHost challengeを材料に、セッションキーを用いてCard cryptogramを演算)して(ステップS208)、次いで、Card challengeとCard cryptogramを含む応答を外部機器2に送信し(ステップS209)、当該フローチャートに示す処理を終了する。また、SDは、key version numberに対応するキーバージョンの鍵が存在しないと判定した場合には(ステップS207:NO)、エラー処理(エラー情報の生成等)を実行し(ステップS206)、外部機器2に応答を送信し(ステップS209)、当該フローチャートに示す処理を終了する。 On the other hand, when the SD determines that the key version number is not "0x00" (step S203: NO), it refers to its own logical key space and corresponds to the key version number included in the INITIALIZE UPDATE command. It is confirmed whether or not the key of the key version exists (step S207). When the SD determines that a key with a key version corresponding to the key version number exists (step S207: YES), the SD executes a command using the three keys corresponding to the key version number (Card challenge and three keys). Generate three session keys based on the above, calculate the Card cryptogram using the session key using the Card challenge and Host challenge as materials) (step S208), and then send the response including the Card challenge and Card cryptogram to the external device. It is transmitted to No. 2 (step S209), and the process shown in the flowchart is completed. Further, when the SD determines that the key of the key version corresponding to the key version number does not exist (step S207: NO), the SD executes error processing (generation of error information, etc.) (step S206), and performs an external device. A response is transmitted to No. 2 (step S209), and the process shown in the flowchart is terminated.

以上のように、第2実施形態のICカード1は、RAM11(「メモリ」の一例)が、外部機器2とApplication間における開設済の通信路(ロジカルチャネル)をセキュアな通信路にするセキュア処理に用いる鍵(「キー」の一例)をkey version number(「キーバージョン」)毎に記憶し、CPU10(「実行部」の一例)がセキュア処理に使用する鍵のkey version numberを示す情報(「キーバージョン情報」の一例)を含むINITIALIZE UPDATEコマンド(「コマンド」の一例)を受信した場合に当該key version numberの鍵を用いてセキュア処理を実行する。また、RAM11は、key version numberとして「0x00」(「所定の情報」の一例)を含むINITIALIZE UPDATEコマンドを受信した場合に用いる複数のデフォルトキーバージョンを、これらを識別するためのAID(「識別情報」の一例)と対応付けて記憶し、CPU10は、key version numberとして「0x00」を含むINITIALIZE UPDATEコマンドを受信した場合に、開設済の通信路(ロジカルチャネル)に対応するアプリケーションを識別するAIDにより識別されるデフォルトキーバージョンの鍵を用いてセキュア処理を実行する。 As described above, in the IC card 1 of the second embodiment, the RAM 11 (an example of "memory") is a secure process in which the established communication path (logical channel) between the external device 2 and the Application is made into a secure communication path. Information (“key version number”) indicating the key version number of the key used for secure processing by CPU10 (an example of “execution unit”) is stored for each key version number (“key version”). When an INITIALIZE UPDATE command (an example of a "command") including an example of "key version information" is received, secure processing is executed using the key of the key version number. Further, the RAM 11 uses an AID (“identification information”) for identifying a plurality of default key versions used when receiving an INITIALIZE UPDATE command including “0x00” (an example of “predetermined information”) as a key version number. When the CPU 10 receives the INITIALIZE UPDATE command including "0x00" as the key version number, the CPU 10 uses an AID to identify the application corresponding to the established communication path (logical channel). Perform secure processing with the identified default key version of the key.

したがって、第2実施形態のICカード1によれば、複数のデフォルトキーバージョンがこれらを識別するAIDとともに設定され、key version numberとして「0x00」を含むINITIALIZE UPDATEコマンドを受信した場合に、開設済の通信路(ロジカルチャネル)に対応するアプリケーションのAIDにより識別されるデフォルトキーバージョンの鍵を用いてセキュア処理を実行する。すなわち、デフォルトキーバージョンの使い分け方に応じてAIDを設定しておくことにより、INITIALIZE UPDATEコマンドにおいてkey version numberを明示的に指定しなくても、複数のデフォルトキーバージョンを使い分けることができる。 Therefore, according to the IC card 1 of the second embodiment, when a plurality of default key versions are set together with AIDs that identify them and a INITIALIZE UPDATE command including "0x00" is received as the key version number, the opening has been completed. Secure processing is executed using the default key version of the key identified by the AID of the application corresponding to the communication path (logical channel). That is, by setting the AID according to how to use the default key version properly, it is possible to use a plurality of default key versions properly without explicitly specifying the key version number in the INITIALIZE UPDATE command.

1 ICカード
1a ICチップ
2 外部機器
10 CPU
11 RAM
12 ROM
13 不揮発性メモリ
14 I/O回路
1 IC card 1a IC chip 2 External device 10 CPU
11 RAM
12 ROM
13 Non-volatile memory 14 I / O circuit

Claims (5)

外部機器とアプリケーション間における開設済の通信路をセキュアな通信路にするセキュア処理に用いるキーをキーバージョン毎に記憶するメモリと、前記セキュア処理に使用するキーのキーバージョンを示すキーバージョン情報を含むコマンドを受信した場合に当該キーバージョンのキーを用いて前記セキュア処理を実行する実行部と、を備える電子情報記憶媒体であって、
前記メモリは、前記キーバージョン情報として所定の情報を含む前記コマンドを受信した場合に用いる複数のデフォルトキーバージョンを、これらを識別するための識別情報と対応付けて記憶し、
前記実行部は、前記キーバージョン情報として前記所定の情報を含む前記コマンドを受信した場合に、前記開設済の通信路に対応する前記識別情報により識別されるデフォルトキーバージョンのキーを用いて前記セキュア処理を実行することを特徴とする電子情報記憶媒体。
Includes a memory that stores the key used for secure processing to make the established communication path between the external device and the application a secure communication path for each key version, and key version information indicating the key version of the key used for the secure processing. An electronic information storage medium including an execution unit that executes the secure processing using the key of the key version when a command is received.
The memory stores a plurality of default key versions used when receiving the command including predetermined information as the key version information in association with the identification information for identifying them.
When the execution unit receives the command including the predetermined information as the key version information, the execution unit uses the key of the default key version identified by the identification information corresponding to the established communication path to secure the security. An electronic information storage medium characterized by performing processing.
請求項1に記載の電子情報記憶媒体であって、
前記識別情報は、前記開設済の通信路に対応するロジカルチャネル番号を示す情報であって、
前記実行部は、前記キーバージョン情報として前記所定の情報を含む前記コマンドを受信した場合に、前記ロジカルチャネル番号に対応するデフォルトキーバージョンのキーを用いて前記セキュア処理を実行することを特徴とする電子情報記憶媒体。
The electronic information storage medium according to claim 1.
The identification information is information indicating a logical channel number corresponding to the opened communication path.
When the execution unit receives the command including the predetermined information as the key version information, the execution unit executes the secure process by using the key of the default key version corresponding to the logical channel number. Electronic information storage medium.
請求項1に記載の電子情報記憶媒体であって、
前記識別情報は、前記開設済の通信路を使用して前記外部機器と通信を行う前記アプリケーションを識別するアプリケーション情報であって、
前記実行部は、前記キーバージョン情報として前記所定の情報を含む前記コマンドを受信した場合に、前記アプリケーション情報に対応するデフォルトキーバージョンのキーを用いて前記セキュア処理を実行することを特徴とする電子情報記憶媒体。
The electronic information storage medium according to claim 1.
The identification information is application information that identifies the application that communicates with the external device using the established communication path.
When the execution unit receives the command including the predetermined information as the key version information, the execution unit executes the secure process by using the key of the default key version corresponding to the application information. Information storage medium.
外部機器とアプリケーション間における開設済の通信路をセキュアな通信路にするセキュア処理に用いるキーをキーバージョン毎に記憶するメモリと、前記セキュア処理に使用するキーのキーバージョンを示すキーバージョン情報を含むコマンドを受信した場合に当該キーバージョンのキーを用いて前記セキュア処理を実行する実行部と、を備える電子情報記憶媒体によるセキュア処理実行方法であって、
前記メモリは、前記キーバージョン情報として所定の情報を含む前記コマンドを受信した場合に用いる複数のデフォルトキーバージョンを、これらを識別するための識別情報と対応付けて記憶し、
前記実行部が、前記キーバージョン情報として所定の情報を含む前記コマンドを受信した場合に、前記開設済の通信路に対応する前記識別情報により識別されるデフォルトキーバージョンのキーを用いて前記セキュア処理を実行するステップを含むことを特徴とするセキュア処理実行方法。
Includes a memory that stores the key used for secure processing to make the established communication path between the external device and the application a secure communication path for each key version, and key version information indicating the key version of the key used for the secure processing. A secure processing execution method using an electronic information storage medium including an execution unit that executes the secure processing using the key of the key version when a command is received.
The memory stores a plurality of default key versions used when receiving the command including predetermined information as the key version information in association with the identification information for identifying them.
When the execution unit receives the command including predetermined information as the key version information, the secure process is performed by using the key of the default key version identified by the identification information corresponding to the opened communication path. A secure processing execution method characterized by including a step of executing.
外部機器とアプリケーション間における開設済の通信路をセキュアな通信路にするセキュア処理に用いるキーをキーバージョン毎に記憶するメモリと、前記セキュア処理に使用するキーのキーバージョンを示すキーバージョン情報を含むコマンドを受信した場合に当該キーバージョンのキーを用いて前記セキュア処理を実行する実行部と、を備え、前記メモリが、前記キーバージョン情報として所定の情報を含む前記コマンドを受信した場合に用いる複数のデフォルトキーバージョンを、これらを識別するための識別情報と対応付けて記憶する電子情報記憶媒体における前記実行部に、
前記キーバージョン情報として所定の情報を含む前記コマンドを受信した場合に、前記開設済の通信路に対応する前記識別情報により識別されるデフォルトキーバージョンのキーを用いて前記セキュア処理を実行するステップを実行させることを特徴とするセキュア処理実行プログラム。
Includes a memory that stores a key used for secure processing to make an established communication path between an external device and an application a secure communication path for each key version, and key version information indicating the key version of the key used for the secure processing. A plurality of units including an execution unit that executes the secure process using the key of the key version when the command is received, and used when the memory receives the command including predetermined information as the key version information. In the execution unit in the electronic information storage medium that stores the default key version of the above in association with the identification information for identifying them.
When the command including the predetermined information as the key version information is received, the step of executing the secure process using the key of the default key version identified by the identification information corresponding to the opened communication path is performed. A secure processing execution program characterized by being executed.
JP2016221726A 2016-11-14 2016-11-14 Electronic information storage medium, secure processing execution method, and secure processing execution program Active JP6780462B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016221726A JP6780462B2 (en) 2016-11-14 2016-11-14 Electronic information storage medium, secure processing execution method, and secure processing execution program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016221726A JP6780462B2 (en) 2016-11-14 2016-11-14 Electronic information storage medium, secure processing execution method, and secure processing execution program

Publications (2)

Publication Number Publication Date
JP2018082246A JP2018082246A (en) 2018-05-24
JP6780462B2 true JP6780462B2 (en) 2020-11-04

Family

ID=62199038

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016221726A Active JP6780462B2 (en) 2016-11-14 2016-11-14 Electronic information storage medium, secure processing execution method, and secure processing execution program

Country Status (1)

Country Link
JP (1) JP6780462B2 (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09134413A (en) * 1995-11-08 1997-05-20 Tokin Corp Non-contact type data carrier system
US20040185845A1 (en) * 2003-02-28 2004-09-23 Microsoft Corporation Access point to access point range extension
JP2006197059A (en) * 2005-01-12 2006-07-27 Matsushita Electric Ind Co Ltd Communication system and program
US20120036567A1 (en) * 2010-08-05 2012-02-09 Motorola Solutions, Inc. Methods for establishing a security session in a communications system
US9547771B2 (en) * 2013-02-12 2017-01-17 Amazon Technologies, Inc. Policy enforcement with associated data
US10560441B2 (en) * 2014-12-17 2020-02-11 Amazon Technologies, Inc. Data security operations with expectations

Also Published As

Publication number Publication date
JP2018082246A (en) 2018-05-24

Similar Documents

Publication Publication Date Title
US8391837B2 (en) Method, system and trusted service manager for securely transmitting an application to a mobile phone
US8297520B1 (en) Secure application directory
KR100978053B1 (en) Method and apparatus for initializing a secure element in a wireless terminal
US7886970B2 (en) Data communicating apparatus and method for managing memory of data communicating apparatus
ES2708696T3 (en) Method for changing the mobile network operator in an integrated SIM based on a special privilege
TW201248409A (en) Security architecture for using host memory in the design of a secure element
KR101824249B1 (en) Method for managing electronic devices, for example, of integrated circuits type, having internal generation of a personal authetication key
US7516479B2 (en) Data communicating apparatus and method for managing memory of data communicating apparatus
CN114365168A (en) System and method for enabling mobile near field communication to update a display on a payment card
JP2004252707A (en) Memory device
JP6780462B2 (en) Electronic information storage medium, secure processing execution method, and secure processing execution program
JP2015135610A (en) Portable electronic device and electronic circuit
JP6874318B2 (en) Electronic information storage medium, IC card, support information update method, and support information update program
JP2012141754A (en) Ic chip, processing method in ic chip, processing program for ic chip, and portable terminal
CN105790946B (en) Method, system and related equipment for establishing data channel
KR20110035759A (en) Method and system for issuing of mobile application
JP6790839B2 (en) Secure element, UIM card, authentication method, and authentication program
JP7444325B1 (en) Electronic information storage medium, IC chip, IC card, public key management method, and program
JP7009844B2 (en) Update method and update program using electronic information storage medium, IC card, electronic information storage medium
JP2005049957A (en) Ic card and ic card system
US11863681B2 (en) Online service providing system, IC chip, and application program
JP6505893B2 (en) Portable electronic devices
JP6801448B2 (en) Electronic information storage media, authentication systems, authentication methods, and authentication application programs
JP2016057886A (en) Portable electronic device
BRPI0409234B1 (en) secure electronic entity comprising means for storing a maximum allowed number of uses of a secret data and process for modifying a maximum permitted number of uses of a secret data memorized by a secure electronic entity

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190926

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200715

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200928

R150 Certificate of patent or registration of utility model

Ref document number: 6780462

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150