JP6287284B2 - IC chip and program encryption method - Google Patents
IC chip and program encryption method Download PDFInfo
- Publication number
- JP6287284B2 JP6287284B2 JP2014020255A JP2014020255A JP6287284B2 JP 6287284 B2 JP6287284 B2 JP 6287284B2 JP 2014020255 A JP2014020255 A JP 2014020255A JP 2014020255 A JP2014020255 A JP 2014020255A JP 6287284 B2 JP6287284 B2 JP 6287284B2
- Authority
- JP
- Japan
- Prior art keywords
- control program
- encrypted
- program
- area
- encryption
- 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
Links
Images
Landscapes
- Storage Device Security (AREA)
Description
本発明は、アプリケーションからAPI(Application Programming Interface)を介して利用可能な複数の処理機能のそれぞれを担う複数の制御プログラムを記憶する不揮発性メモリを備えるICチップ等の技術に関する。 The present invention relates to a technology such as an IC chip including a non-volatile memory that stores a plurality of control programs that respectively perform a plurality of processing functions that can be used from an application via an API (Application Programming Interface).
近年のICカードでは、過去の製品と比べて安価で容量の大きいメモリを搭載したものが増えてきた。そのため、機能を実現するためのプログラム量も過去の製品に比べて大量に格納することが可能となっている。ICカードベンダーは、顧客から要求される機能を実現するために、アプリケーションを作成し、ICカードに格納することになる。このようなアプリケーションの中には、セキュリティを重視する例えばクレジット機能を持つアプリケーション等がある。このようなアプリケーションをICカードに格納して利用可能にさせるためには、対象のブランドの認定を取得したり、セキュリティ評価機関に耐タンパ性(セキュリティの強度)を評価してもらう必要がある。このような評価等は、ICカードの製品ごとに実施されていることが多いため、その費用も、製品数だけ多くなるという問題がある。このため、可能な限り、汎用的な製品を1つ作成し、1回の認定や評価を通した上で、様々な製品に展開できるような仕組みにすることが望まれる。そのためには、様々な製品の機能差分を吸収する仕組みが必要になる。 In recent years, an IC card equipped with a memory having a low cost and a large capacity as compared with past products has been increasing. Therefore, it is possible to store a large amount of programs for realizing the functions as compared with past products. The IC card vendor creates an application and stores it in the IC card in order to realize the function requested by the customer. Among such applications, there is an application having a credit function, for example, which places importance on security. In order to store such an application in an IC card and make it usable, it is necessary to obtain certification of the target brand or to have a security evaluation organization evaluate tamper resistance (security strength). Since such evaluation is often performed for each IC card product, there is a problem that the cost increases by the number of products. For this reason, it is desirable to create a general-purpose product as much as possible and to have a mechanism that can be deployed to various products after a single certification and evaluation. For this purpose, a mechanism for absorbing functional differences between various products is required.
このような機能差分を吸収する仕組みとして、一般的には、製品ごとに機能をJava (登録商標)で記述されるアプリケーションで作成することにより、ICカードの仕様(Global Platform)にあるINSTALL、DELETEといったコマンドで追加、消去する方法がある。しかしながら、機能差分がアプリケーションによって吸収できる範囲であれば問題ないが、OS(Operating System)に機能差分があった場合に問題となる。例えば、製品特有の暗号機能や認証機能を使うといったOSの機能を使用する場合である。暗号機能や認証機能は、ハードウェアのコプロセッサを制御する場合が多く、OSからJava (登録商標)で記述されるアプリケーションに対してAPIを提供する必要がある。OSに機能差分があった場合の解決策として、例えば、A製品とB製品両方のAPIをICカードに搭載することが考えられる。しかしながら、例えば、B製品の提供者がB製品のAPIを、A製品上でA製品のアプリケーション開発者側に公開したくない場合がある。B製品にも同様のことが言える。このような場合、例えば特許文献1に開示されるように、権限によりAPIを使い分けることが考えられる。 As a mechanism for absorbing such functional differences, in general, by creating a function for each product with an application described in Java (registered trademark), INSTALL and DELETE in the IC card specifications (Global Platform) There is a method of adding and deleting by the command. However, there is no problem as long as the functional difference can be absorbed by the application, but there is a problem when there is a functional difference in the OS (Operating System). For example, this is a case where an OS function such as a product-specific encryption function or authentication function is used. The encryption function and the authentication function often control a hardware coprocessor, and it is necessary to provide an API from the OS to an application described in Java (registered trademark). As a solution when there is a functional difference in the OS, for example, it is conceivable to install APIs of both the A product and the B product on the IC card. However, for example, the provider of the B product may not want to disclose the API of the B product to the application developer of the A product on the A product. The same can be said for the B product. In such a case, as disclosed in Patent Document 1, for example, it is conceivable to use APIs depending on authority.
しかしながら、特許文献1に開示されるような権限は、例えば、セキュリティアタックによって不正に取得されてしまうことが想定される。そのため、上述した問題を解決する上で、APIの権限管理だけでは十分ではない。 However, it is assumed that the authority disclosed in Patent Document 1 is illegally acquired by, for example, a security attack. Therefore, API authority management alone is not sufficient to solve the above-described problems.
本発明は、このような点に鑑みてなされたものであり、複数の製品ごとに固有のOS機能を1つのICチップで利用できるようにし、なおかつセキュリティを向上させることが可能なICチップ及びプログラム暗号化方法を提供することを課題とする。 The present invention has been made in view of the above points, and an IC chip and a program capable of using an OS function unique to each of a plurality of products with one IC chip and improving security. It is an object to provide an encryption method.
上記課題を解決するために、請求項1に記載の発明は、アプリケーションからAPI(Application Programming Interface)を介して利用可能な複数の処理機能のそれぞれを担う複数の制御プログラムを記憶する不揮発性メモリを備えるICチップであって、前記不揮発性メモリには、前記処理機能を担う前記制御プログラムを記憶する領域の識別情報と、前記処理機能を担う前記制御プログラムを記憶する領域を示す領域情報と、当該制御プログラムを暗号化するための鍵データとを、前記複数の制御プログラムごとに対応付けたテーブルが記憶されており、前記ICチップは、前記複数の制御プログラムの中の所定の制御プログラムを暗号化する暗号コマンドを外部装置から受信する受信手段と、前記受信された暗号コマンドにより指定された識別情報に対応する前記領域情報に対応付けられた前記鍵データに基づいて、当該領域情報が示す領域に記憶された前記制御プログラムを暗号化する暗号化手段と、を備えることを特徴とする。 In order to solve the above-described problem, the invention described in claim 1 includes a non-volatile memory that stores a plurality of control programs each responsible for a plurality of processing functions that can be used from an application via an API (Application Programming Interface). The non-volatile memory includes identification information of an area for storing the control program responsible for the processing function, area information indicating an area for storing the control program responsible for the processing function, and A table in which key data for encrypting a control program is associated with each of the plurality of control programs is stored, and the IC chip encrypts a predetermined control program in the plurality of control programs Receiving means for receiving an encrypted command from an external device, and an identification designated by the received encrypted command On the basis of the key data associated with the area information corresponding to the distribution, characterized in that it comprises an encryption means for encrypting the control program to which the area information is stored in the area indicated.
請求項2に記載の発明は、請求項1に記載のICチップにおいて、前記テーブルにおける前記領域情報のそれぞれには、それぞれの前記領域に格納された前記制御プログラムが暗号化されているか否かを示すフラグが対応付けられており、前記ICチップは、前記暗号化手段により前記制御プログラムが暗号化された場合には、当該暗号化された制御プログラムに対応する前記フラグを、前記制御プログラムが暗号化されていることを示すように変更する変更手段と、前記アプリケーションから前記APIの呼び出しがあった場合には、当該APIに対応する前記制御プログラムを記憶する領域を示す領域情報に対応付けられた前記フラグを参照し、当該フラグが前記制御プログラムが暗号化されていることを示すか否かを判定する判定手段と、前記判定手段により暗号化されていることを示すと判定された場合、エラー処理を行うエラー処理手段と、を備えることを特徴とする。 According to a second aspect of the present invention, in the IC chip according to the first aspect, each of the area information in the table indicates whether or not the control program stored in each of the areas is encrypted. When the control program is encrypted by the encryption unit, the IC chip encrypts the flag corresponding to the encrypted control program by the control program. When the API is called from the application and the changing means for changing to indicate that the control program is associated, the information is associated with area information indicating an area for storing the control program corresponding to the API. A determination unit that refers to the flag and determines whether the flag indicates that the control program is encrypted. If it is determined that indicates that it is encrypted by the determination means, characterized in that it comprises, and error processing means for performing error processing.
請求項3に記載の発明は、請求項1に記載のICチップにおいて、前記テーブルにおける前記領域情報のそれぞれには、それぞれの前記領域に格納された前記制御プログラムが暗号化されているか否かを示すフラグが対応付けられており、前記ICチップは、前記暗号化手段により前記制御プログラムが暗号化された場合には、当該暗号化された制御プログラムに対応する前記フラグを、前記制御プログラムが暗号化されていることを示すように変更する変更手段と、前記アプリケーションから前記APIの呼び出しがあった場合には、当該APIに対応する前記制御プログラムを記憶する領域を示す領域情報に対応付けられた前記フラグを参照し、当該フラグが前記制御プログラムが暗号化されていることを示すか否かを判定する判定手段と、前記判定手段により暗号化されていることを示さないと判定された場合、前記APIに対応する前記制御プログラムを実行するプログラム実行手段と、を備えることを特徴とする。 According to a third aspect of the present invention, in the IC chip according to the first aspect, each of the area information in the table indicates whether or not the control program stored in each of the areas is encrypted. When the control program is encrypted by the encryption unit, the IC chip encrypts the flag corresponding to the encrypted control program by the control program. When the API is called from the application and the changing means for changing to indicate that the control program is associated, the information is associated with area information indicating an area for storing the control program corresponding to the API. A determination unit that refers to the flag and determines whether the flag indicates that the control program is encrypted. The case where it is determined not to indicate that they are encrypted by the determination means, characterized in that it comprises a program executing means for executing the control program corresponding to the API.
請求項4に記載の発明は、請求項1乃至3の何れか一項に記載のICチップにおいて、前記受信手段は、前記暗号化された前記所定の制御プログラムを復号する復号コマンドを外部装置から受信し、前記受信された復号コマンドにより指定された識別情報に対応する前記領域情報に対応付けられた前記鍵データに基づいて、当該領域情報が示す領域に記憶された前記制御プログラムを復号する復号手段と、を備えることを特徴とする。 According to a fourth aspect of the present invention, in the IC chip according to any one of the first to third aspects, the receiving unit sends a decryption command for decrypting the encrypted predetermined control program from an external device. Receiving and decrypting the control program stored in the area indicated by the area information based on the key data associated with the area information corresponding to the identification information specified by the received decryption command And means.
請求項5に記載の発明は、アプリケーションからAPI(Application Programming Interface)を介して利用可能な複数の処理機能のそれぞれを担う複数の制御プログラムを
記憶する不揮発性メモリを備えるICチップにおけるプログラム暗号化方法であって、前記不揮発性メモリには、前記処理機能を担う前記制御プログラムを記憶する領域の識別情報と、前記処理機能を担う前記制御プログラムを記憶する領域を示す領域情報と、当該制御プログラムを暗号化するための鍵データとを、前記複数の制御プログラムごとに対応付けたテーブルが記憶されており、前記プログラム暗号化方法は、前記複数の制御プログラムの中の所定の制御プログラムを暗号化する暗号コマンドを外部装置から受信する受信ステップと、前記受信された暗号コマンドにより指定された識別情報に対応する前記領域情報に対応付けられた前記鍵データに基づいて、当該領域情報が示す領域に記憶された前記制御プログラムを暗号化する暗号化ステップと、を含むことを特徴とする。
According to a fifth aspect of the present invention, there is provided a method for encrypting a program in an IC chip including a non-volatile memory storing a plurality of control programs each responsible for a plurality of processing functions usable from an application via an API (Application Programming Interface) The non-volatile memory includes identification information of an area for storing the control program responsible for the processing function, area information indicating an area for storing the control program responsible for the processing function, and the control program. A table in which key data for encryption is associated with each of the plurality of control programs is stored, and the program encryption method encrypts a predetermined control program in the plurality of control programs. A receiving step of receiving an encrypted command from an external device, and the received encrypted command An encryption step of encrypting the control program stored in the area indicated by the area information based on the key data associated with the area information corresponding to the specified identification information. And
本発明によれば、複数の製品ごとに固有のOS機能を1つのICチップで利用できるようにし、なおかつセキュリティを向上させることができる。 According to the present invention, an OS function unique to each of a plurality of products can be used with one IC chip, and security can be improved.
以下、図面を参照して本発明の実施形態について詳細に説明する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
先ず、図1を参照して、本実施形態に係るICカード1の構成及び機能概要について説明する。図1は、ICカード1の概要構成例を示す図である。なお、ICカード1は、キャッシュカード、クレジットカード、社員カード等として使用される。或いは、ICカード1は、スマートフォンや携帯電話機等の通信機器に組み込まれる。ICチップ1aは通信機器の回路基板上に直接組み込んで構成するようにしてもよい。 First, with reference to FIG. 1, the configuration and functional overview of the IC card 1 according to the present embodiment will be described. FIG. 1 is a diagram illustrating a schematic configuration example of the IC card 1. The IC card 1 is used as a cash card, credit card, employee card or the like. Alternatively, the IC card 1 is incorporated into a communication device such as a smartphone or a mobile phone. The IC chip 1a may be configured by being directly incorporated on a circuit board of a communication device.
ICカード1には、図1に示すように、ICチップ1aが搭載されている。ICチップ1aは、コンピュータとしてのCPU(Central Processing Unit)10、RAM(Random Access Memory)11、ROM(Read Only Memory)12、不揮発性メモリ13、及びI/O回路14を備えて構成される。なお、I/O回路14は、外部装置2とのインターフェイスを担う。ICカード1が接触ICカードの場合、I/O回路14には、例えばISO/IEC7816によって定められたC1〜C8の8個の端子が設けられている。例えば、C1端子は電源端子、C2端子はリセット端子、C3端子はクロック端子、C5端子はグランド端子、C7端子は外部装置2とのデータ通信を行う端子である。外部装置2の例としては、ICカード発行機、ATM、改札機、認証用ゲート等が挙げられる。或いは、ICカード1が通信機器に組み込まれる場合、外部端末2には通信機器の機能を担うコントローラが該当する。ICカード発行機は、ICカード1の発行処理を行う装置である。なお、本明細書で「発行」とは、ICカードが製品として顧客(例えば、クレジットカード会社等)に提供されるにあたって、例えばICカード発行会社がICカードのICチップに所定の情報(プログラムやデータなど)を書き込むことを意味する。なお、ICカード1が非接触ICカードの場合、I/O回路14には、アンテナ及び変復調回路等が設けられる。
An IC chip 1a is mounted on the IC card 1 as shown in FIG. The IC chip 1 a includes a CPU (Central Processing Unit) 10 as a computer, a RAM (Random Access Memory) 11, a ROM (Read Only Memory) 12, a
CPU10は、ROM12または不揮発性メモリ13に記憶されるプログラムを実行する演算装置である。CPU10は、本発明における受信手段、暗号化手段、変更手段、判定手段、エラー処理手段、プログラム実行手段、及び復号手段として機能する。ROM12は、ICチップ1aに設けられない場合もある。不揮発性メモリ13には、例えばフラッシュメモリが適用される。なお、不揮発性メモリ13は、「Electrically Erasable Programmable Read-Only Memory」であっても構わない。不揮発性メモリ13には、複数(2種類以上)のOS(Operating System)プログラムを格納するプログラム領域と、セキュリティデータ等の各種データを格納するデータ領域とが設けられる。OSプログラムは、制御プログラムの一例である。なお、不揮発性メモリ13には、暗号化プログラムが予め記憶される。
The
図2(A)は、不揮発性メモリ13に設けられたプログラム領域の一例を示す図である。図2(A)に示すプログラム領域では、複数のOSプログラムを保持する複数(2種類以上)のセクションに分かれている。それぞれのセクションには、図2(A)に示すように、A〜C製品で共通のOSプログラム、A製品特有の処理機能を担うOSプログラム(以下、「A製品用OSプログラム」という)、B製品特有の処理機能を担うOSプログラム(以下、「B製品用OSプログラム」という)、及びC製品特有の処理機能を担うOSプログラム(以下、「C製品用OSプログラム」という)のいずれかが保持されている。ここで、処理機能とは、例えばJava(登録商標)等が提供する基本的な処理機能(例えば、暗号機能や認証機能)である。なお、A製品用OSプログラムを保持するセクションをAセクション、B製品用OSプログラムを保持するセクションをBセクション、C製品用OSプログラムを保持するセクションをCセクションという。
FIG. 2A is a diagram illustrating an example of a program area provided in the
A製品用OSプログラム、B製品用OSプログラム、及びC製品用OSプログラムは、それぞれ、アプリケーションからAPI(Application Programming Interface)を介して利用可能な処理機能を担う。アプリケーションは、Java(登録商標)等の特定のプログラムミング言語で作成されるアプリケーションプログラムである。このアプリケーションは、ICカード1の発行処理時、又は顧客に提供された後に不揮発性メモリ13に記憶される。A製品用OSプログラム、B製品用OSプログラム、及びC製品用OSプログラムのそれぞれに対応するAPIは、それぞれの処理機能へのインターフェイスであり、アプリケーションにより呼び出される。
The OS program for the A product, the OS program for the B product, and the OS program for the C product each have a processing function that can be used from an application via an API (Application Programming Interface). The application is an application program created in a specific programming language such as Java (registered trademark). This application is stored in the
また、不揮発性メモリ13に設けられたデータ領域には、鍵データテーブルが記憶される。図2(B)は、鍵データテーブルの一例を示す図である。鍵データテーブルは、図2(B)に示すように、セクションの識別子(識別情報)と、セクションのアドレスと、鍵データと、フラグとを、セクションごとに対応付けて保持する。セクションの識別子は、レコード(テーブルの列)のインデックスであってもよい。セクションのアドレスは、対応するOSプログラムを記憶する領域を示す。鍵データは、対応するOSプログラム(言い換えれば、当該OSプログラムを保持するセクション)を暗号化したり、暗号化されたOSプログラムを復号するためのデータである。フラグは、対応するOSプログラムが暗号化されているか否かを示す。なお、図2(B)に示すように、データ領域に記憶された鍵データテーブルの末尾には、当該鍵データテーブルのCRC(Cyclic Redundancy Check)が記憶される。
A key data table is stored in the data area provided in the
以上のICチップ1aの構成において、CPU10は、複数のOSプログラムの中の所定のOSプログラムを暗号化する暗号コマンド(以下、「コード暗号コマンド」という)をICカード発行機から受信すると、受信されたコード暗号コマンドにより指定された識別子に対応するセクションのアドレスに対応付けられた鍵データに基づいて、当該アドレスが示す領域に記憶されたOSプログラムを暗号化する暗号化処理を行うようになっている。
In the above-described configuration of the IC chip 1a, the
ここで、図3を参照して、コード暗号コマンドを受信したときのCPU10の処理について説明する。図3は、コード暗号コマンドを受信したときのCPU10の処理例を示すフローチャートである。なお、本実施形態においては、コード暗号コマンドは、ICカード1の発行処理時に使用されることを想定している。そのため、ICカード1の不揮発性メモリ13には、ICカード1が、少なくとも、発行状態かそれ以外の状態かの2種類以上のライフサイクルを管理する状態変数が保持されている。
Here, with reference to FIG. 3, the process of the
図3において、CPU10は、ICカード発行機からICチップ1aへ送信されたコード暗号コマンド(例えばB製品用OSプログラムに対するコード暗号コマンド)を受信すると、上記状態変数を参照してICカード1の発行フェーズであるか否かを判定する(ステップS1)。つまり、ICカード1のライフサイクルが発行フェーズであるか否かが判定される。ICカード1の発行フェーズでないと判定された場合(ステップS1:NO)、ステップS2へ進む。ステップS2では、CPU10は、エラー処理を行う。このエラー処理では、ICカード発行機へエラー信号が返信される。
In FIG. 3, when the
一方、ICカード1の発行フェーズであると判定された場合(ステップS1:YES)、ステップS3へ進む。ステップS3では、CPU10は、ステップS1で受信されたコード暗号コマンドから識別子を取得する。次いで、CPU10は、ステップS3で取得された識別子(つまり、コード暗号コマンドにより指定された識別子)を基に、当該識別子に対応するセクションのアドレスに対応付けられた鍵データ(対象セクション用の鍵データ)を鍵データテーブルから取得する(ステップS4)。
On the other hand, when it is determined that it is the issue phase of the IC card 1 (step S1: YES), the process proceeds to step S3. In step S3, the
次いで、CPU10は、ステップS4で取得された鍵データに基づいて、当該識別子に対応するアドレスが示すセクションに記憶されたOSプログラム(例えば、B製品用OSプログラム)を暗号化プログラムにしたがって暗号化(言い換えれば、対象セクションを暗号化)する(ステップS5)。次いで、CPU10は、暗号化されたOSプログラムが記憶された領域を示すアドレスに対応付けられたフラグ(鍵データテーブルで保持されたフラグ)を「0」から「1」に変更(対象セクション用のフラグを有効に設定)する(ステップS6)。つまり、OSプログラムが暗号化された場合には、CPU10は、当該暗号化されたOSプログラムに対応するフラグを、当該OSプログラムが暗号化されていることを示すように変更する。次いで、CPU10は、鍵データテーブルの末尾に記憶されたCRC(テーブル全体のCRC)を更新し(ステップS7)、図3に示す処理を終了する。なお、上記処理により例えばB製品用OSプログラムが暗号化された後、C製品用OSプログラムを暗号化する場合には、ICカード発行機から、C製品用OSプログラムに対するコード暗号コマンドをICチップ1aへ送信すればよい。
Next, the
以上の処理により一部のOSプログラムだけを暗号化することで当該OSプログラムをICカード1の発行処理後に非公開とすることができる。また、暗号化されたOSプログラムは、暗号化した鍵データにより復号することができるので、後に、例えばA製品においてもB製品用OSプログラムを利用する状況となった場合であっても、適切に対応することができる。この場合、CPU10は、図3に示すように暗号化された所定のOSプログラムを復号する復号コマンド(以下、「コード復号コマンド」という)を外部装置2から受信すると、受信されたコード復号コマンドにより指定された識別子に対応するセクションのアドレスに対応付けられた鍵データに基づいて、当該アドレスが示す領域に記憶されたOSプログラムを復号する復号処理を行うようになっている。より具体的には、CPU10は、コード復号コマンドを受信すると、受信したコード復号コマンドから識別子を取得する。次いで、CPU10は、取得した識別子を基に、当該識別子に対応するセクションのアドレスに対応付けられた鍵データを鍵データテーブルから取得する。次いで、CPU10は、取得した鍵データに基づいて、当該識別子に対応するアドレスが示すセクションに記憶されたOSプログラムを復号プログラムにしたがって復号(言い換えれば、対象セクションを復号)する。次いで、CPU10は、復号されたOSプログラムが記憶された領域を示すアドレスに対応付けられたフラグ(鍵データテーブルで保持されたフラグ)を「1」から「0」に変更(対象セクション用のフラグを無効に設定)する。つまり、OSプログラムが復号された場合には、CPU10は、当該復号されたOSプログラムに対応するフラグを、当該OSプログラムが復号されていることを示すように変更する。なお、コード暗号コマンドと、コード復号コマンドとは、1機能、1コマンドとして分けても良いし、同一コマンドにて、暗号と復号とを切り分ける識別情報によって処理を変えても良い。
By encrypting only a part of the OS program by the above processing, the OS program can be made private after the IC card 1 issuance processing. In addition, since the encrypted OS program can be decrypted with the encrypted key data, for example, even in the case where the OS product for the B product is used later, Can respond. In this case, when the
次に、図4(A)を参照して、ICカード1の発行処理後に、一般のコマンドを受信したときのCPU10の処理について説明する。図4(A)は、ICカード1の発行処理後に、一般のコマンドを受信したときのCPU10の処理例を示すフローチャートである。このコマンドは、APDU(Application Protocol Data Unit)として送信される。APDUとして送信されるコマンドのヘッダは、CLA、INS、P1、P2という合計4バイトの情報で形成される。CLA、INSは、主にコマンドの種別等に使われる。本実施形態において、例えば、セクションの識別子はP1に保持される。また、暗号と復号とを同一コマンドで実行させる場合、暗号と復号とを切り分ける識別情報がP2に保持される。
Next, with reference to FIG. 4A, the processing of the
図4(A)において、CPU10は、外部装置2からICチップ1aへ送信されたコマンドを受信すると、当該コマンドが、APIが提供される所定のアプリケーション(例えば、Java Application)に向けられたものか、それ以外(例えば、Native Application)に向けれたものかを判定する(ステップS10)。ここで、Java Applicationとは、Java(登録商標)コードで記述され、JavaVM(仮想マシン)等により当該Javaコードをネイティブコードに変換して実行する仕組みを持ったアプリケーションである。一方、Native Applicationとは、直接ネイティブコードで記述されたアプリケーションである。コマンドが、例えば、Java Applicationに向けられたものでないと判定された場合(ステップS10:NO)、CPU10は、当該コマンドを、例えば、Native Applicationへ配送する(ステップS11)。一方、コマンドが、例えば、Java Applicationに向けられたものであると判定された場合(ステップS10:YES)、ステップS12へ進む。
4A, when the
ステップS12では、CPU10は、例えば、Java Applicationはリセット直後の初回起動であるか否かを判定する。リセット直後の初回起動であると判定された場合(ステップS12:YES)、ステップS13へ進む。一方、リセット直後の初回起動でないと判定された場合(ステップS12:NO)、ステップS14へ進む。ステップS13では、CPU10は、不揮発性メモリ13に記憶された鍵データテーブルのCRCが正常であるか否かを判定する。つまり、CPU10は、不揮発性メモリ13に記憶されたCRCと、このとき算出したCRCとが一致すれば、CRCが正常であると判定し(ステップS13:YES)、ステップS14へ進む。ステップS14では、CPU10は、共通のOSプログラム(例えば、Java OS)を実行してJava Applicationを動作させる。一方、CRCが正常でないと判定された場合(ステップS13:NO)、ステップS15へ進む。ステップS15では、CPU10は、エラー処理を行う。このエラー処理では、外部装置2へエラー信号が返信される。
In step S12, for example, the
次に、図4(B)を参照して、動作中のアプリケーションからAPIの呼び出しがあった場合のCPU10の処理について説明する。図4(B)は、動作中のアプリケーションからAPIの呼び出しがあった場合のCPU10の処理例を示すフローチャートである。
Next, with reference to FIG. 4B, processing of the
図4(B)において、動作中のアプリケーションからAPIの呼び出しがあった場合、CPU10は、当該APIに対応するOSプログラムを記憶する領域(セクション)を示すアドレスに対応付けられたフラグ(対象セクションのフラグを取得)を鍵データテーブルから取得する(ステップS20)。次いで、CPU10は、ステップS20で取得したフラグを参照し、当該フラグが有効であるか否かを判定する(ステップS21)。当該フラグが有効でない(0)と判定された(つまり、暗号化されていないことを示すと判定された)場合(ステップS21:NO)、CPU10は、当該APIに対応するOSプログラム(例えば、A製品用OSプログラム)へジャンプして実行する(ステップS22)。一方、当該フラグが有効である(1)と判定された(つまり、暗号化されていることを示すと判定された)場合(ステップS21:YES)、CPU10は、エラー処理を行う(ステップS23)。このエラー処理では、外部装置2へエラー信号が返信される。
In FIG. 4B, when an API is called from an operating application, the
以上説明したように、上記実施形態によれば、ICチップ1aは、複数のOSプログラムの中の所定のOSプログラムを暗号化するコード暗号コマンドを受信した場合、当該コード暗号コマンドにより指定された識別子に対応するセクションのアドレスに対応付けられた鍵データに基づいて、当該アドレスが示す領域に記憶されたOSプログラムを暗号化するように構成したので、複数の製品ごとに固有のOS機能を1つのICチップで利用できるようにし、なおかつセキュリティを向上させることができる。また、鍵データテーブルを不揮発性メモリ13に記憶させICチップ1a内で管理するように構成したので、鍵データテーブルを外部で管理する場合と比べて、例えば会社間で鍵データをどのように受け渡すかの問題が生じることを回避することができる。また、携帯端末(移動機)等に挿入されているUIMといったICカードであれば、OTA(Over-The-Air)の機能を使うことによって、コマンドを無線通信でICカードに送信することで、市場に出回ってしまったカードでも、所定のOSプログラムを暗号化または復号することができる。つまり、市場のICカードを回収することなく、会社間の契約状況といったことを市場のUIMに反映することができる。なお、OTAとは、OTAサーバと携帯端末が無線通信を利用することで、携帯端末を介し、OTAサーバから送られたコマンドを携帯端末に差し込まれたICカードに送信する仕組みである。例えば、OTAを使って、すでに市場に出回っているICカードの特定の情報を書き換えるような事に使われる。
As described above, according to the embodiment, when the IC chip 1a receives a code encryption command for encrypting a predetermined OS program among a plurality of OS programs, the identifier specified by the code encryption command is used. Since the OS program stored in the area indicated by the address is encrypted based on the key data associated with the address of the section corresponding to, a unique OS function is provided for each of a plurality of products. It can be used in an IC chip, and security can be improved. In addition, since the key data table is stored in the
また、上記実施形態によれば、ICチップ1aは、OSプログラムが暗号化された場合には、当該暗号化されたOSプログラムに対応するフラグを変更(有効設定)し、その後に、アプリケーションからAPIの呼び出しがあった場合には、当該APIに対応するOSプログラムを記憶するセクションに対応付けられたフラグを参照して当該フラグがOSプログラムが暗号化されていることを示すか否かを判定するように構成したので、例えばセキュリティアタックによって不正にAPIが呼び出された場合であっても、APIに対応するOSプログラムにジャンプすることを回避することができる。また、例えばセキュリティアタックによって、上記フラグが改ざんされた場合においても、OSプログラムは暗号化されているため、使用することができない。そのため、セキュリティを、より一層向上させることができる。 Further, according to the above-described embodiment, when the OS program is encrypted, the IC chip 1a changes (enables setting) the flag corresponding to the encrypted OS program, and thereafter, the API from the application Is called, it is determined whether or not the flag indicates that the OS program is encrypted by referring to the flag associated with the section storing the OS program corresponding to the API. Since it is configured as described above, for example, even when an API is illegally called by a security attack, it is possible to avoid jumping to an OS program corresponding to the API. Further, even when the flag is falsified by a security attack, for example, the OS program is encrypted and cannot be used. Therefore, security can be further improved.
1 ICカード
2 外部装置
1a ICチップ
10 CPU
11 RAM
12 ROM
13 不揮発性メモリ
14 I/O回路
1 IC Card 2 External Device
11 RAM
12 ROM
13 Non-volatile memory 14 I / O circuit
Claims (5)
前記不揮発性メモリには、前記処理機能を担う前記制御プログラムを記憶する領域の識別情報と、前記制御プログラムを記憶する領域を示す領域情報と、当該制御プログラムを暗号化するための鍵データとを、前記複数の制御プログラムごとに対応付けたテーブルが記憶されており、
前記ICチップは、
前記複数の制御プログラムの中の所定の制御プログラムを暗号化する暗号コマンドを外部装置から受信する受信手段と、
前記受信された暗号コマンドにより指定された識別情報に対応する前記領域情報に対応付けられた前記鍵データに基づいて、当該領域情報が示す領域に記憶された前記制御プログラムを暗号化する暗号化手段と、
を備えることを特徴とするICチップ。 An IC chip comprising a non-volatile memory for storing a plurality of control programs each responsible for a plurality of processing functions available from an application via an API (Application Programming Interface),
The nonvolatile memory includes identification information of an area for storing the control program responsible for the processing function, area information indicating an area for storing the control program, and key data for encrypting the control program. A table associated with each of the plurality of control programs is stored;
The IC chip is
Receiving means for receiving, from an external device, an encryption command for encrypting a predetermined control program among the plurality of control programs;
Encryption means for encrypting the control program stored in the area indicated by the area information based on the key data associated with the area information corresponding to the identification information designated by the received encryption command When,
An IC chip comprising:
前記ICチップは、
前記暗号化手段により前記制御プログラムが暗号化された場合には、当該暗号化された制御プログラムに対応する前記フラグを、前記制御プログラムが暗号化されていることを示すように変更する変更手段と、
前記アプリケーションから前記APIの呼び出しがあった場合には、当該APIに対応する前記制御プログラムを記憶する領域を示す領域情報に対応付けられた前記フラグを参照し、当該フラグが前記制御プログラムが暗号化されていることを示すか否かを判定する判定手段と、
前記判定手段により暗号化されていることを示すと判定された場合、エラー処理を行うエラー処理手段と、
を備えることを特徴とする請求項1に記載のICチップ。 Each of the area information in the table is associated with a flag indicating whether or not the control program stored in each of the areas is encrypted,
The IC chip is
Changing means for changing the flag corresponding to the encrypted control program to indicate that the control program is encrypted when the control program is encrypted by the encryption means; ,
When the API is called from the application, the flag associated with the area information indicating the area for storing the control program corresponding to the API is referred to, and the flag is encrypted by the control program. Determining means for determining whether or not to indicate
An error processing means for performing an error process when it is determined by the determination means to indicate encryption;
The IC chip according to claim 1, further comprising:
前記ICチップは、
前記暗号化手段により前記制御プログラムが暗号化された場合には、当該暗号化された制御プログラムに対応する前記フラグを、前記制御プログラムが暗号化されていることを示すように変更する変更手段と、
前記アプリケーションから前記APIの呼び出しがあった場合には、当該APIに対応する前記制御プログラムを記憶する領域を示す領域情報に対応付けられた前記フラグを参照し、当該フラグが前記制御プログラムが暗号化されていることを示すか否かを判定する判定手段と、
前記判定手段により暗号化されていることを示さないと判定された場合、前記APIに対応する前記制御プログラムを実行するプログラム実行手段と、
を備えることを特徴とする請求項1に記載のICチップ。 Each of the area information in the table is associated with a flag indicating whether or not the control program stored in each of the areas is encrypted,
The IC chip is
Changing means for changing the flag corresponding to the encrypted control program to indicate that the control program is encrypted when the control program is encrypted by the encryption means; ,
When the API is called from the application, the flag associated with the area information indicating the area for storing the control program corresponding to the API is referred to, and the flag is encrypted by the control program. Determining means for determining whether or not to indicate
A program execution unit that executes the control program corresponding to the API when it is determined by the determination unit that it is not indicated to be encrypted;
The IC chip according to claim 1, further comprising:
前記受信された復号コマンドにより指定された識別情報に対応する前記領域情報に対応付けられた前記鍵データに基づいて、当該領域情報が示す領域に記憶された前記制御プログラムを復号する復号手段と、
を備えることを特徴とする請求項1乃至3の何れか一項に記載のICチップ。 The receiving means receives a decryption command for decrypting the encrypted predetermined control program from an external device;
Decryption means for decrypting the control program stored in the area indicated by the area information, based on the key data associated with the area information corresponding to the identification information specified by the received decryption command;
The IC chip according to any one of claims 1 to 3, further comprising:
能な複数の処理機能のそれぞれを担う複数の制御プログラムを記憶する不揮発性メモリを備えるICチップにおけるプログラム暗号化方法であって、
前記不揮発性メモリには、前記処理機能を担う前記制御プログラムを記憶する領域の識別情報と、前記処理機能を担う前記制御プログラムを記憶する領域を示す領域情報と、当該制御プログラムを暗号化するための鍵データとを、前記複数の制御プログラムごとに対応付けたテーブルが記憶されており、
前記プログラム暗号化方法は、
前記複数の制御プログラムの中の所定の制御プログラムを暗号化する暗号コマンドを外部装置から受信する受信ステップと、
前記受信された暗号コマンドにより指定された識別情報に対応する前記領域情報に対応付けられた前記鍵データに基づいて、当該領域情報が示す領域に記憶された前記制御プログラムを暗号化する暗号化ステップと、
を含むことを特徴とするプログラム暗号化方法。 A program encryption method in an IC chip including a nonvolatile memory storing a plurality of control programs each responsible for a plurality of processing functions available from an application via an API (Application Programming Interface),
In the nonvolatile memory, for identifying the area for storing the control program responsible for the processing function, area information indicating the area for storing the control program responsible for the processing function, and for encrypting the control program And a table in which the key data is associated with each of the plurality of control programs,
The program encryption method includes:
A receiving step of receiving, from an external device, an encryption command for encrypting a predetermined control program among the plurality of control programs;
An encryption step for encrypting the control program stored in the area indicated by the area information based on the key data associated with the area information corresponding to the identification information specified by the received encryption command. When,
A program encryption method comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014020255A JP6287284B2 (en) | 2014-02-05 | 2014-02-05 | IC chip and program encryption method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014020255A JP6287284B2 (en) | 2014-02-05 | 2014-02-05 | IC chip and program encryption method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2015148877A JP2015148877A (en) | 2015-08-20 |
JP6287284B2 true JP6287284B2 (en) | 2018-03-07 |
Family
ID=53892206
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2014020255A Active JP6287284B2 (en) | 2014-02-05 | 2014-02-05 | IC chip and program encryption method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6287284B2 (en) |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2943924B2 (en) * | 1987-02-27 | 1999-08-30 | 株式会社東芝 | Portable electronic devices |
JP2000224160A (en) * | 1999-02-01 | 2000-08-11 | Nippon Telegr & Teleph Corp <Ntt> | Method and system for providing ic card security interface, and storage medium storing with ic card security interface service program stored therein |
JP2003158513A (en) * | 2001-11-20 | 2003-05-30 | Dainippon Printing Co Ltd | Ic card, its writing method and apparatus, and ic card system |
JP3881942B2 (en) * | 2002-09-04 | 2007-02-14 | 松下電器産業株式会社 | Semiconductor device having encryption unit |
-
2014
- 2014-02-05 JP JP2014020255A patent/JP6287284B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2015148877A (en) | 2015-08-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5005811B2 (en) | Method, system and trusted service manager for securely transmitting an application to a mobile phone | |
JP5060620B2 (en) | Mobile communication device and method for disabling applications | |
CN101965597B (en) | Method and devices for installing and retrieving linked MIFARE applications | |
US20110053504A1 (en) | Nfc mobile communication device and nfc reader | |
US9430650B2 (en) | Method for managing memory space in a secure non-volatile memory of a secure element | |
CN104380652A (en) | Multi-issuer secure element partition architecture for NFC enabled devices | |
KR20170102285A (en) | Security Elements | |
KR101783526B1 (en) | Ic card, electronic device and portable electronic device | |
JP5795921B2 (en) | IC card, portable electronic device, and IC card control method | |
US20200074077A1 (en) | Method for Providing a Security-Critical Software Application on a Computer Unit | |
JP6287284B2 (en) | IC chip and program encryption method | |
CN115037496B (en) | Method and computing system for providing security services and related computer storage media | |
CN115037492A (en) | Online security services based on security features implemented in memory devices | |
JP2011060136A (en) | Portable electronic apparatus, and data management method in the same | |
JP4899499B2 (en) | IC card issuing method, IC card issuing system, and IC card | |
EP2985724B1 (en) | Remote load and update card emulation support | |
JP5957577B2 (en) | IC card, portable electronic device, and IC card control method | |
CN115021950B (en) | Online service store for endpoints | |
JP2006338311A (en) | Computer system for processing device loaded with multiple applications, device and computer program | |
CN115021949B (en) | Method and system for identity management of endpoints having memory devices protected for reliable authentication | |
JP5957347B2 (en) | IC card and portable electronic device | |
CN115037491B (en) | Subscription sharing in a group of endpoints with storage devices protected for reliable authentication | |
JP5932588B2 (en) | IC card, portable electronic device, and IC card processing device | |
JP2019028602A (en) | Electronic information storage medium, ic card, update method by electronic information storage medium and update program | |
JP2024139134A (en) | Electronic information storage medium, IC chip, method for writing issuance data, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20161222 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20171017 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20171031 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20171220 |
|
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: 20180109 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20180122 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6287284 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |