JP2012243133A - Portable electronic device and control method of portable electronic device - Google Patents

Portable electronic device and control method of portable electronic device Download PDF

Info

Publication number
JP2012243133A
JP2012243133A JP2011113496A JP2011113496A JP2012243133A JP 2012243133 A JP2012243133 A JP 2012243133A JP 2011113496 A JP2011113496 A JP 2011113496A JP 2011113496 A JP2011113496 A JP 2011113496A JP 2012243133 A JP2012243133 A JP 2012243133A
Authority
JP
Japan
Prior art keywords
data
card
hash value
command
memory
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.)
Granted
Application number
JP2011113496A
Other languages
Japanese (ja)
Other versions
JP5677195B2 (en
Inventor
Hiroki Tomoe
裕樹 友枝
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2011113496A priority Critical patent/JP5677195B2/en
Publication of JP2012243133A publication Critical patent/JP2012243133A/en
Application granted granted Critical
Publication of JP5677195B2 publication Critical patent/JP5677195B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Credit Cards Or The Like (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a portable electronic device and a control method of the portable electronic device capable of indirectly inspecting a piece of data with high accuracy.SOLUTION: The portable electronic device includes: a memory that stores data; a receiving section that receives a command transmitted from an external apparatus; a command processing section that, when the receiving section receives an issuance command, obtains a piece of data based on the issued command and writes the obtained data in the memory; a hash value calculation section that, when the receiving section receives an inspection command, calculates a hash value based on the data in the memory; a response processing section that generates a response based on the hash value calculated by the hash value calculation section; and a transmitting section that transmits the response generated by the response processing section to the external apparatus.

Description

本発明の実施形態は、携帯可能電子装置、携帯可能電子装置の制御方法に関する。   Embodiments described herein relate generally to a portable electronic device and a method for controlling the portable electronic device.

一般的に、携帯可能電子装置として用いられるICカードは、プラスチックなどで形成されたカード状の本体と本体に埋め込まれたICモジュールとを備えている。ICモジュールは、ICチップを有している。ICチップは、電源が無い状態でもデータを保持することができるEEPROM(Electrically Erasable Programmable Read−Only Memory)またはフラッシュROMなどの不揮発性メモリと、種々の演算を実行するCPUとを有している。   In general, an IC card used as a portable electronic device includes a card-like main body formed of plastic or the like and an IC module embedded in the main body. The IC module has an IC chip. The IC chip has a nonvolatile memory such as an EEPROM (Electrically Erasable Programmable Read-Only Memory) or a flash ROM that can hold data even in the absence of a power source, and a CPU that executes various operations.

ICカードは、例えば、国際標準規格ISO/IEC7816に準拠したICカードである。ICカードは、携帯性に優れ、且つ、外部装置との通信及び複雑な演算処理を行う事ができる。また、偽造が難しい為、ICカードは、機密性の高い情報などを格納してセキュリティシステム、電子商取引などに用いられることが想定される。   The IC card is, for example, an IC card conforming to the international standard ISO / IEC7816. The IC card is excellent in portability and can perform communication with an external device and complicated calculation processing. Further, since it is difficult to forge, the IC card is assumed to store highly confidential information and be used for a security system, electronic commerce, and the like.

ICカードは、通常、出荷前にアプリケーション、制御データ、または他のデータなどを書き込む発行処理が行われる。このような発行処理によりICカードに書き込まれるデータは、例えば暗号鍵などの高い機密性が要求されるデータである場合が多い。この為、ICカードは、これらのデータを外部に容易に出力しないように構成されている。そこで、ICカードを発行する発行装置は、ICカードにコマンドを送信し、ICカードからのレスポンスが正しいか否かに基づいて、発行処理により正しくデータが格納されたか否かを判断する。   An IC card is normally subjected to an issuing process for writing applications, control data, or other data before shipment. In many cases, data written to the IC card by such issuing processing is data that requires high confidentiality, such as an encryption key. For this reason, the IC card is configured not to easily output these data to the outside. Therefore, the issuing device that issues the IC card transmits a command to the IC card, and determines whether or not the data is correctly stored by the issuing process based on whether or not the response from the IC card is correct.

特開平11−175403号公報JP 11-175403 A

しかし、コマンドに対するレスポンスの正否に基づいてICカード内のデータを検査する場合、全てのデータを確認することができない可能性がある。即ち、ICカードに送信したコマンドにより扱われないデータに不具合が生じている場合、上記の方法によると不具合が発見されない可能性がある。   However, when data in the IC card is inspected based on whether the response to the command is correct or not, there is a possibility that not all data can be confirmed. That is, if a problem occurs in data that is not handled by the command transmitted to the IC card, the problem may not be found by the above method.

そこで、間接的に、且つ、より高い精度でデータを検査することができる携帯可能電子装置、携帯可能電子装置の制御方法を提供することを目的とする。   Therefore, an object of the present invention is to provide a portable electronic device capable of inspecting data indirectly and with higher accuracy, and a method for controlling the portable electronic device.

一実施形態に係る携帯可能電子装置は、データを記憶するメモリと、外部機器から送信されたコマンドを受信する受信部と、前記受信部により発行コマンドを受信した場合、前記発行コマンドに基づいてデータを取得し、取得したデータを前記メモリに書き込むコマンド処理部と、前記受信部により検査コマンドを受信した場合、前記メモリのデータに基づいてハッシュ値を算出するハッシュ値算出部と、前記ハッシュ値算出部により算出されたハッシュ値に基づいてレスポンスを生成するレスポンス処理部と、前記レスポンス処理部により生成されたレスポンスを前記外部機器に送信する送信部と、を具備する。   A portable electronic device according to an embodiment includes a memory that stores data, a receiving unit that receives a command transmitted from an external device, and a data received based on the issuing command when the receiving unit receives the issuing command. A command processing unit that writes the acquired data to the memory, a hash value calculation unit that calculates a hash value based on the data in the memory when the receiving unit receives an inspection command, and the hash value calculation A response processing unit that generates a response based on the hash value calculated by the unit, and a transmission unit that transmits the response generated by the response processing unit to the external device.

図1は、一実施形態に係るICカード処理システムの例について説明するための図である。FIG. 1 is a diagram for explaining an example of an IC card processing system according to an embodiment. 図2は、一実施形態に係るICカードの例について説明するための図である。FIG. 2 is a diagram for explaining an example of an IC card according to an embodiment. 図3は、一実施形態に係るICカード処理システムの例について説明するための図である。FIG. 3 is a diagram for explaining an example of an IC card processing system according to an embodiment. 図4は、一実施形態に係るICカード処理システムの例について説明するための図である。FIG. 4 is a diagram for explaining an example of an IC card processing system according to an embodiment. 図5は、一実施形態に係るICカード処理システムの例について説明するための図である。FIG. 5 is a diagram for explaining an example of an IC card processing system according to an embodiment. 図6は、一実施形態に係るICカード処理システムの例について説明するための図である。FIG. 6 is a diagram for explaining an example of an IC card processing system according to an embodiment.

以下、図面を参照しながら、一実施形態に係る携帯可能電子装置、携帯可能電子装置の処理装置、及び携帯可能電子装置の処理システムについて詳細に説明する。   Hereinafter, a portable electronic device, a processing device for a portable electronic device, and a processing system for a portable electronic device according to an embodiment will be described in detail with reference to the drawings.

本実施形態に係る携帯可能電子装置(ICカード)20及びICカード20を処理する処理装置(端末装置)10は、例えば、接触通信、及び/または非接触通信の機能を備える。これにより、ICカード20及び端末装置10は、互いにデータの送受信を行うことができる。   The portable electronic device (IC card) 20 and the processing device (terminal device) 10 that processes the IC card 20 according to the present embodiment have, for example, functions of contact communication and / or non-contact communication. Thereby, the IC card 20 and the terminal device 10 can transmit and receive data to and from each other.

図1は、一実施形態に係るICカード処理システム1の構成例を示す。
ICカード処理システム1は、ICカード20を処理する端末装置10と、ICカード20と、を備える。
FIG. 1 shows a configuration example of an IC card processing system 1 according to an embodiment.
The IC card processing system 1 includes a terminal device 10 that processes the IC card 20 and an IC card 20.

端末装置10は、CPU11、ROM12、RAM13、不揮発性メモリ14、カードリーダライタ15、操作部17、ディスプレイ18、及び電源部19を備える。CPU11、ROM12、RAM13、不揮発性メモリ14、カードリーダライタ15、操作部17、及びディスプレイ18は、それぞれバスを介して互いに接続されている。   The terminal device 10 includes a CPU 11, a ROM 12, a RAM 13, a nonvolatile memory 14, a card reader / writer 15, an operation unit 17, a display 18, and a power supply unit 19. The CPU 11, the ROM 12, the RAM 13, the nonvolatile memory 14, the card reader / writer 15, the operation unit 17, and the display 18 are connected to each other via a bus.

CPU11は、端末装置10全体の制御を司る制御部として機能する。CPU11は、ROM12又は不揮発性メモリ14に記憶されている制御プログラム及び制御データに基づいて種々の処理を行う。例えば、CPU11は、カードリーダライタ15を介してICカード20とコマンド及びレスポンスの送受信を行う。   The CPU 11 functions as a control unit that controls the entire terminal device 10. The CPU 11 performs various processes based on the control program and control data stored in the ROM 12 or the nonvolatile memory 14. For example, the CPU 11 transmits and receives commands and responses to and from the IC card 20 via the card reader / writer 15.

ROM12は、予め制御用のプログラム及び制御データなどを記憶する不揮発性のメモリである。RAM13は、ワーキングメモリとして機能する揮発性のメモリである。RAM13は、CPU11の処理中のデータなどを一時的に格納する。例えば、RAM13は、カードリーダライタ15を介して外部の機器と送受信するデータを一時的に格納する。また、RAM13は、CPU11が実行するプログラムを一時的に格納する。   The ROM 12 is a non-volatile memory that stores a control program and control data in advance. The RAM 13 is a volatile memory that functions as a working memory. The RAM 13 temporarily stores data being processed by the CPU 11. For example, the RAM 13 temporarily stores data to be transmitted / received to / from an external device via the card reader / writer 15. The RAM 13 temporarily stores a program executed by the CPU 11.

不揮発性メモリ14は、例えばEEPROM、FRAMなどを備える。不揮発性メモリ14は、例えば、制御用のプログラム、制御データ、アプリケーション、及びアプリケーションに用いられるデータなどを記憶する。   The nonvolatile memory 14 includes, for example, an EEPROM, an FRAM, and the like. The nonvolatile memory 14 stores, for example, a control program, control data, an application, and data used for the application.

カードリーダライタ15は、ICカード20と通信を行うためのインターフェース装置である。カードリーダライタ15は、接触通信、または非接触通信によりICカード20とデータの送受信を行う。   The card reader / writer 15 is an interface device for communicating with the IC card 20. The card reader / writer 15 transmits / receives data to / from the IC card 20 by contact communication or non-contact communication.

接触通信のインターフェースとして用いられる場合、カードリーダライタ15は、ICカード20が装着されるスロットと、ICカード20が備えるコンタクトパターンと接続される複数の接触端子を備える。   When used as an interface for contact communication, the card reader / writer 15 includes a slot in which the IC card 20 is mounted and a plurality of contact terminals connected to a contact pattern included in the IC card 20.

スロットにICカード20が装着される場合、カードリーダライタ15の複数の接触端子は、ICカード20のコンタクトパターンに接続される。これにより、端末装置10とICカード20とは電気的に接続される。カードリーダライタ15は、スロットに装着されるICカード20に対して、電力の供給、クロックの供給、リセット信号の入力、及びデータの送受信などを行う。   When the IC card 20 is mounted in the slot, the plurality of contact terminals of the card reader / writer 15 are connected to the contact pattern of the IC card 20. Thereby, the terminal device 10 and the IC card 20 are electrically connected. The card reader / writer 15 performs power supply, clock supply, reset signal input, data transmission / reception, and the like to the IC card 20 installed in the slot.

また、非接触通信のインターフェースとして用いられる場合、カードリーダライタ15は、送受信するデータに対して信号処理を施す信号処理部と、所定の共振周波数を有するアンテナとを備える。   When used as an interface for non-contact communication, the card reader / writer 15 includes a signal processing unit that performs signal processing on data to be transmitted and received, and an antenna having a predetermined resonance frequency.

カードリーダライタ15は、例えば、信号処理部により、送受信するデータに対して符号化、復号、変調、及び復調などの信号処理を行なう。また、カードリーダライタ15は、符号化及び変調を施したデータをアンテナに供給する。アンテナは、供給されたデータに応じて磁界を発生させる。これにより、端末装置10は、通信可能範囲に存在するICカード20に対してデータを非接触で送信することができる。   For example, the card reader / writer 15 performs signal processing such as encoding, decoding, modulation, and demodulation on data to be transmitted and received by a signal processing unit. The card reader / writer 15 supplies the encoded and modulated data to the antenna. The antenna generates a magnetic field according to the supplied data. Thereby, the terminal device 10 can transmit data to the IC card 20 existing in the communicable range in a non-contact manner.

さらに、カードリーダライタ15のアンテナは、磁界を検知し、検知した磁界に応じて信号を生成する。これにより、カードリーダライタ15は、信号を非接触で受信することができる。信号処理部は、アンテナにより受信された信号に対して復調及び復号を行う。これにより、端末装置10は、ICカード20から送信された元のデータを取得することができる。   Further, the antenna of the card reader / writer 15 detects a magnetic field and generates a signal according to the detected magnetic field. Thereby, the card reader / writer 15 can receive a signal in a non-contact manner. The signal processing unit demodulates and decodes the signal received by the antenna. Thereby, the terminal device 10 can acquire the original data transmitted from the IC card 20.

操作部17は、例えば操作キーなどを備え、操作者により入力される操作に基づいて、操作信号を生成する。操作部17は、生成した操作信号をCPUに入力する。これにより、CPU11は、操作者により入力された操作に基づいて処理を事項することができる。   The operation unit 17 includes, for example, operation keys and generates an operation signal based on an operation input by the operator. The operation unit 17 inputs the generated operation signal to the CPU. Thereby, CPU11 can matter about processing based on operation inputted by an operator.

ディスプレイ18は、CPU11、または図示されないグラフィックコントローラなどの表示処理モジュールから入力される映像を表示するための信号に基づいて種々の情報を表示する。   The display 18 displays various information based on signals for displaying video input from the CPU 11 or a display processing module such as a graphic controller (not shown).

電源部19は、端末装置10の各部に電力を供給する。電源部19は、例えば、商用電源より電力を受け取り、所定の電圧に変換し、端末装置10の各部に供給する。   The power supply unit 19 supplies power to each unit of the terminal device 10. For example, the power supply unit 19 receives power from a commercial power supply, converts the power into a predetermined voltage, and supplies the voltage to each unit of the terminal device 10.

図2は、一実施形態に係るICカード20の構成例を示す。
図2に示すように、ICカード20は、例えば、矩形状の本体21と、本体21内に内蔵されたICモジュール22とを備える。ICモジュール22は、ICチップ23と、通信部24とを備える。ICチップ23と通信部24とは、互いに接続された状態でICモジュール22内に形成されている。
FIG. 2 shows a configuration example of the IC card 20 according to one embodiment.
As shown in FIG. 2, the IC card 20 includes, for example, a rectangular main body 21 and an IC module 22 built in the main body 21. The IC module 22 includes an IC chip 23 and a communication unit 24. The IC chip 23 and the communication unit 24 are formed in the IC module 22 while being connected to each other.

なお、本体21は、少なくとも通信部24が配設されるICモジュール22を設置可能な形状であれば、矩形状に限らず如何なる形状であっても良い。   The main body 21 is not limited to a rectangular shape, and may have any shape as long as the IC module 22 in which at least the communication unit 24 is disposed can be installed.

ICチップ23は、通信部24、CPU25、ROM26、RAM27、不揮発性メモリ28、電源部31、及びロジック部32などを備える。通信部24、CPU25、ROM26、RAM27、不揮発性メモリ28、電源部31、及びロジック部32は、バスを介して互いに接続されている。   The IC chip 23 includes a communication unit 24, a CPU 25, a ROM 26, a RAM 27, a nonvolatile memory 28, a power supply unit 31, a logic unit 32, and the like. The communication unit 24, the CPU 25, the ROM 26, the RAM 27, the nonvolatile memory 28, the power supply unit 31, and the logic unit 32 are connected to each other via a bus.

通信部24は、端末装置(外部機器)10のカードリーダライタ15と通信を行うためのインターフェースである。通信部24は、接触通信、または非接触通信により、端末装置10とデータの送受信を行う。   The communication unit 24 is an interface for communicating with the card reader / writer 15 of the terminal device (external device) 10. The communication unit 24 transmits / receives data to / from the terminal device 10 by contact communication or non-contact communication.

接触通信のインターフェースとして用いられる場合、通信部24は、カードリーダライタ15の接触端子と接続されるコンタクトパターンを備える。コンタクトパターンは、導電性を有する金属などによりICモジュール22の表面に形成される接触端子である。即ち、コンタクトパターンは、端末装置10のカードリーダライタ15の接触端子と接触可能に形成されている。   When used as an interface for contact communication, the communication unit 24 includes a contact pattern connected to a contact terminal of the card reader / writer 15. The contact pattern is a contact terminal formed on the surface of the IC module 22 with a conductive metal or the like. That is, the contact pattern is formed so as to be in contact with the contact terminal of the card reader / writer 15 of the terminal device 10.

コンタクトパターンは、金属により形成される面が複数のエリアに区切られて形成される。区切られた各エリアは、それぞれ端子として機能する。通信部24は、コンタクトパターンを介してカードリーダライタ15とデータの送受信を行うことができる。   The contact pattern is formed by dividing a surface formed of metal into a plurality of areas. Each divided area functions as a terminal. The communication unit 24 can transmit / receive data to / from the card reader / writer 15 via the contact pattern.

また、非接触通信のインターフェースとして用いられる場合、通信部24は、信号処理部とアンテナとを備える。   When used as an interface for non-contact communication, the communication unit 24 includes a signal processing unit and an antenna.

信号処理部は、端末装置10に送信するデータに対して符号化、負荷変調などの信号処理を行う。例えば、信号処理部は、端末装置10に送信するデータの変調(増幅)を行う。信号処理部は、信号処理を施したデータをアンテナに供給する。   The signal processing unit performs signal processing such as encoding and load modulation on data to be transmitted to the terminal device 10. For example, the signal processing unit modulates (amplifies) data to be transmitted to the terminal device 10. The signal processing unit supplies the signal-processed data to the antenna.

アンテナは、例えば、ICモジュール22内に所定の形状で配設される金属線により構成される。ICカード20は、端末装置10に送信するデータに応じてアンテナにより磁界を発生させる。これにより、ICカード20は、端末装置10に対してデータを送信することができる。また、ICカード20は、電磁誘導によりアンテナに発生する誘導電流に基づいて端末装置10から送信されるデータを認識する。   The antenna is constituted by, for example, a metal wire disposed in a predetermined shape in the IC module 22. The IC card 20 generates a magnetic field by an antenna according to data transmitted to the terminal device 10. Thereby, the IC card 20 can transmit data to the terminal device 10. Further, the IC card 20 recognizes data transmitted from the terminal device 10 based on an induced current generated in the antenna by electromagnetic induction.

例えば、信号処理部は、アンテナに発生する誘導電流に対して復調、及び復号を行う。例えば、信号処理部は、アンテナにより受信する信号の解析を行う。これにより、通信部24は、2値の論理データを取得する。通信部24は、解析したデータをバスを介してCPU25に送信する。   For example, the signal processing unit demodulates and decodes the induced current generated in the antenna. For example, the signal processing unit analyzes a signal received by the antenna. As a result, the communication unit 24 acquires binary logical data. The communication unit 24 transmits the analyzed data to the CPU 25 via the bus.

CPU25は、ICカード20全体の制御を司る制御部として機能する。CPU25は、ROM26あるいは不揮発性メモリ28に記憶されている制御プログラム及び制御データに基づいて種々の処理を行う。例えば、端末装置10から受信したコマンドに応じて種々の処理を行い、処理結果としてのレスポンスなどのデータの生成を行なう。   The CPU 25 functions as a control unit that controls the entire IC card 20. The CPU 25 performs various processes based on the control program and control data stored in the ROM 26 or the nonvolatile memory 28. For example, various processes are performed in accordance with commands received from the terminal device 10 and data such as responses as processing results is generated.

ROM26は、予め制御用のプログラム及び制御データなどを記憶する不揮発性のメモリである。ROM26は、製造段階で制御プログラム及び制御データなどを記憶した状態でICカード20内に組み込まれる。即ち、ROM26に記憶される制御プログラム及び制御データは、予めICカード20の仕様に応じて組み込まれる。   The ROM 26 is a non-volatile memory that stores a control program and control data in advance. The ROM 26 is incorporated in the IC card 20 in a state where a control program, control data, and the like are stored at the manufacturing stage. That is, the control program and control data stored in the ROM 26 are incorporated in advance according to the specifications of the IC card 20.

RAM27は、ワーキングメモリとして機能する揮発性のメモリである。RAM27は、CPU25の処理中のデータなどを一時的に格納する。例えば、RAM27は、通信部24を介して端末装置10から受信したデータを一時的に格納する。またRAM27は、通信部24を介して端末装置10に送信するデータを一時的に格納する。またさらに、RAM27は、CPU25が実行するプログラムを一時的に格納する。   The RAM 27 is a volatile memory that functions as a working memory. The RAM 27 temporarily stores data being processed by the CPU 25. For example, the RAM 27 temporarily stores data received from the terminal device 10 via the communication unit 24. The RAM 27 temporarily stores data to be transmitted to the terminal device 10 via the communication unit 24. Furthermore, the RAM 27 temporarily stores a program executed by the CPU 25.

不揮発性メモリ28は、例えば、EEPROMあるいはフラッシュROMなどのデータの書き込み及び書換えが可能な不揮発性のメモリを備える。不揮発性メモリ28は、ICカード20の運用用途に応じて制御プログラム及び種々のデータを格納する。   The non-volatile memory 28 includes a non-volatile memory capable of writing and rewriting data, such as an EEPROM or a flash ROM. The nonvolatile memory 28 stores a control program and various data according to the usage application of the IC card 20.

たとえば、不揮発性メモリ28では、プログラムファイル及びデータファイルなどが創成される。創成された各ファイルには、制御プログラム及び種々のデータなどが書き込まれる。CPU25は、不揮発性メモリ28、または、ROM26に記憶されているプログラムを実行することにより、種々の処理を実現することができる。   For example, in the nonvolatile memory 28, a program file and a data file are created. A control program and various data are written in each created file. The CPU 25 can implement various processes by executing programs stored in the nonvolatile memory 28 or the ROM 26.

電源部31は、端末装置10の各部に電力を供給する。ICカード20が接触通信を行う構成を備える場合、電源部31は、通信部24のコンタクトパターンを介してカードリーダライタ15から供給される電力をICカード20の各部に供給する。   The power supply unit 31 supplies power to each unit of the terminal device 10. When the IC card 20 has a configuration for performing contact communication, the power supply unit 31 supplies power supplied from the card reader / writer 15 to each unit of the IC card 20 via the contact pattern of the communication unit 24.

また、ICカード20が非接触通信を行う構成を備える場合、カードリーダライタ15のアンテナから送信される電波、特にキャリア波に基づいて電力を生成する。さらに、電源部31は、動作クロックを生成する。電源部31は、発生させた電力及び動作クロックをICカード20の各部に電力を供給する。ICカード20の各部は、電力の供給を受けた場合、動作可能な状態になる。   In addition, when the IC card 20 has a configuration for performing contactless communication, power is generated based on radio waves transmitted from the antenna of the card reader / writer 15, particularly carrier waves. Furthermore, the power supply unit 31 generates an operation clock. The power supply unit 31 supplies the generated power and operation clock to each unit of the IC card 20. Each unit of the IC card 20 becomes operable when supplied with power.

ロジック部32は、演算処理をハードウエアにより行う演算部である。例えば、ロジック部32は、端末装置10からのコマンドに基づいて、暗号化、復号、ハッシュ計算、及び乱数の生成などの処理を行う。例えば、端末装置10から相互認証コマンドを受信する場合、ロジック部32は、乱数を生成し、生成した乱数をCPU25に伝送する。   The logic unit 32 is an arithmetic unit that performs arithmetic processing by hardware. For example, the logic unit 32 performs processes such as encryption, decryption, hash calculation, and random number generation based on a command from the terminal device 10. For example, when receiving a mutual authentication command from the terminal device 10, the logic unit 32 generates a random number and transmits the generated random number to the CPU 25.

例えば、端末装置10がICカード20の発行装置として機能する場合、端末装置10は、種々のコマンドをICカード20に送信することにより、ICカード20の不揮発性メモリ28内にアプリケーション、制御データ、暗号鍵などの種々のデータを格納することができる。   For example, when the terminal device 10 functions as an issuing device for the IC card 20, the terminal device 10 transmits various commands to the IC card 20, thereby causing applications, control data, Various data such as an encryption key can be stored.

図3は、端末装置10によるICカード20の発行処理の例を示す。
まず、端末装置10は、ICカード20にコマンド(初期化コマンド)を送信することにより、ICカード20の不揮発性メモリ28の初期化を行う(ステップS11)。これにより、端末装置10は、ICカード20の不揮発性メモリ28内にICカード20の使用目的、及び使用用途などに応じた鍵ファイルやデータファイル等を定義する。
FIG. 3 shows an example of the issuing process of the IC card 20 by the terminal device 10.
First, the terminal device 10 initializes the nonvolatile memory 28 of the IC card 20 by transmitting a command (initialization command) to the IC card 20 (step S11). Accordingly, the terminal device 10 defines a key file, a data file, and the like corresponding to the purpose of use and use of the IC card 20 in the nonvolatile memory 28 of the IC card 20.

これにより、端末装置10は、例えば、ISO/IEC7816により規定されているファイル構造を不揮発性メモリ28内に創成する。上記の初期化が行われた不揮発性メモリ28は、Master File(MF)、Dedicated File(DF)、及びElementary File(EF)などを有する。   Thereby, the terminal device 10 creates a file structure defined by, for example, ISO / IEC7816 in the nonvolatile memory 28. The nonvolatile memory 28 that has been initialized includes a master file (MF), a dedicated file (DF), and an elementary file (EF).

MFは、ファイル構造の根幹となるファイルである。DFは、MFの下位に創成される。DFは、アプリケーション及びアプリケーションに用いられるデータなどをグループ化して格納するファイルである。EFは、DFの下位に創成される。EFは、様々なデータを格納するためのファイルである。また、MFの直下にEFが置かれる場合もある。   The MF is a file that is the basis of the file structure. The DF is created below the MF. The DF is a file that stores applications and data used for the applications in groups. EF is created below DF. The EF is a file for storing various data. In some cases, an EF is placed directly under the MF.

EFには、Working Elementary File(WEF)とInternal Elementary File(IEF)などの種類がある。WEFは、作業用EFであり、個人情報などを格納する。IEFは、内部EFであり、例えば、セキュリティのための暗号鍵(暗証番号)などのデータを記憶する。   There are various types of EFs, such as a Working Elementary File (WEF) and an Internal Elementary File (IEF). The WEF is a working EF and stores personal information and the like. The IEF is an internal EF and stores data such as an encryption key (password) for security.

次に、端末装置10は、ICカード20にコマンド(フェーズ切り替えコマンド)を送信することにより、ICカード20フェーズを切り替える(ステップS12)。この場合、端末装置10は、ICカード20のフェーズを初期化処理などが行われる初期フェーズから一次発行が行われる一次発行フェーズに切り替える。   Next, the terminal device 10 switches the IC card 20 phase by transmitting a command (phase switching command) to the IC card 20 (step S12). In this case, the terminal device 10 switches the phase of the IC card 20 from the initial phase in which initialization processing or the like is performed to the primary issue phase in which primary issuance is performed.

端末装置10は、ICカード20にコマンド(一次発行コマンド)を送信することにより、ICカード20の不揮発性メモリ28内に創成されたファイル内に種々のデータを書き込む(ステップS13)。例えば、端末装置10は、WRITEコマンドを複数回ICカード20に送信することにより、上記のようなアプリケーション、制御データ、暗号鍵などの種々のデータを所定のファイルに書き込む。   The terminal apparatus 10 writes various data in a file created in the nonvolatile memory 28 of the IC card 20 by transmitting a command (primary issue command) to the IC card 20 (step S13). For example, the terminal device 10 writes various data such as the above-described application, control data, and encryption key to a predetermined file by transmitting a WRITE command to the IC card 20 a plurality of times.

なお、一次発行で書き込まれるデータは、通常、複数のカードに共通するデータである。また、ICカード20は、一次発行コマンドを受信した場合、上記のロジック部32などにより乱数などのデータを生成し、生成した乱数をファイルに格納する場合もある。即ち、ICカード20の不揮発性メモリ28は、外部から受信した発行コマンドから取得したデータを書き込む領域(第1のメモリ)と、ICカード20内部で生成したデータを書き込む領域(第2のメモリ)とを有する。   The data written in the primary issue is usually data common to a plurality of cards. Further, when the IC card 20 receives the primary issue command, the IC card 20 may generate data such as a random number by the logic unit 32 or the like, and store the generated random number in a file. That is, the non-volatile memory 28 of the IC card 20 has an area for writing data acquired from an issuance command received from the outside (first memory) and an area for writing data generated inside the IC card 20 (second memory). And have.

さらに、端末装置10は、全ての一次発行コマンドの最後のコマンドとして、検査コマンドをICカード20に送信する。ICカード20は、検査コマンドを受信した場合、不揮発性メモリ28内のデータに基づいてハッシュ計算を行い、算出されたハッシュ値を含むレスポンスを端末装置10に送信する。また、端末装置10は、ICカード20に書き込んだデータを逐次認識している。端末装置10は、認識しているICカード20の不揮発性メモリ28のデータに基づいてハッシュ値を算出する。端末装置10は、算出したハッシュ値と、受信したレスポンスに含まれるハッシュ値とが一致する場合、後段の処理を行う。   Furthermore, the terminal device 10 transmits an inspection command to the IC card 20 as the last command of all the primary issue commands. When receiving the inspection command, the IC card 20 performs a hash calculation based on the data in the nonvolatile memory 28 and transmits a response including the calculated hash value to the terminal device 10. Further, the terminal device 10 sequentially recognizes data written to the IC card 20. The terminal device 10 calculates a hash value based on the data in the nonvolatile memory 28 of the recognized IC card 20. If the calculated hash value matches the hash value included in the received response, the terminal device 10 performs subsequent processing.

受信したレスポンスに含まれるハッシュ値が正しい値である場合、端末装置10は、ICカード20にコマンド(フェーズ切り替えコマンド)を送信する。これにより、端末装置10は、ICカード20フェーズを切り替える(ステップS14)。この場合、端末装置10は、ICカード20のフェーズを一次発行フェーズから二次発行が行われる二次発行フェーズに切り替える。   If the hash value included in the received response is a correct value, the terminal device 10 transmits a command (phase switching command) to the IC card 20. Thereby, the terminal device 10 switches the IC card 20 phase (step S14). In this case, the terminal device 10 switches the phase of the IC card 20 from the primary issue phase to the secondary issue phase in which secondary issue is performed.

端末装置10は、ICカード20にコマンド(二次発行コマンド)を送信することにより、ICカード20の不揮発性メモリ28内に創成されたファイル内に種々のデータを書き込む(ステップS15)。例えば、端末装置10は、WRITEコマンドを複数回ICカード20に送信することにより、個人データなどの個別データを所定のファイルに書き込む。なお、一次発行と二次発行とは、それぞれ異なる端末装置10が処理を実行する構成あってもよいし、同じ端末装置10が一次発行及び二次発行を実行する構成であってもよい。   The terminal apparatus 10 writes various data in a file created in the nonvolatile memory 28 of the IC card 20 by transmitting a command (secondary issue command) to the IC card 20 (step S15). For example, the terminal device 10 writes individual data such as personal data in a predetermined file by transmitting a WRITE command to the IC card 20 a plurality of times. The primary issue and the secondary issue may be configured such that different terminal devices 10 execute the processes, or the same terminal device 10 may execute the primary issue and the secondary issue.

二次発行を完了させた場合、端末装置10は、ICカード20にコマンド(フェーズ切り替えコマンド)を送信する。これにより、端末装置10は、ICカード20フェーズを切り替える(ステップS16)。この場合、端末装置10は、ICカード20のフェーズを二次発行フェーズから運用フェーズに切り替える(ステップS17)。これ以降、ICカード20は、端末装置10から受信したコマンドに応じて不揮発性メモリ28に格納されているアプリケーションなどを実行することができる。これにより、ICカード20は、交通系、金融系などの種々の用途に用いられる。   When the secondary issue is completed, the terminal device 10 transmits a command (phase switching command) to the IC card 20. Thereby, the terminal device 10 switches the IC card 20 phase (step S16). In this case, the terminal device 10 switches the phase of the IC card 20 from the secondary issue phase to the operation phase (step S17). Thereafter, the IC card 20 can execute an application stored in the nonvolatile memory 28 in accordance with a command received from the terminal device 10. Thereby, the IC card 20 is used for various applications such as a traffic system and a financial system.

図4は、上記の一次発行、または二次発行におけるICカード20の処理の例を示す。
ICカード20は、端末装置10からのコマンドを待つ状態を保持する。即ち、ICカード20は、一次発行コマンドまたは二次発行コマンドなどの発行コマンドを受信したか否か逐次判定する(ステップS21)。
FIG. 4 shows an example of processing of the IC card 20 in the primary issue or the secondary issue.
The IC card 20 holds a state waiting for a command from the terminal device 10. That is, the IC card 20 sequentially determines whether or not an issue command such as a primary issue command or a secondary issue command has been received (step S21).

ここで、発行コマンドを受信したと判定した場合、ICカード20は、受信した発行コマンドに応じてデータを不揮発性メモリ28の所定のファイルに書き込む(ステップS22)。ICカード20は、データの書き込みを行った後、ステップS21に移行し、次の発行コマンドを待つ状態を維持する。   If it is determined that the issue command has been received, the IC card 20 writes data in a predetermined file in the nonvolatile memory 28 in accordance with the received issue command (step S22). After writing the data, the IC card 20 proceeds to step S21 and maintains a state of waiting for the next issue command.

また、ステップS21で、発行コマンドを受信しなかったと判定した場合、ICカード20は、検査コマンドを受信したか否か判定する(ステップS23)。ここで、検査コマンドを受信しなかったと判定した場合、ICカード20は、ステップS21に移行し、次の発行コマンドを待つ状態を維持する。   If it is determined in step S21 that the issue command has not been received, the IC card 20 determines whether an inspection command has been received (step S23). If it is determined that the inspection command has not been received, the IC card 20 proceeds to step S21 and maintains a state of waiting for the next issue command.

端末装置10は、例えば、図5により示されるようなコマンドをICカード20に送信する。   For example, the terminal device 10 transmits a command as shown in FIG. 5 to the IC card 20.

図5により示されるように、端末装置10がICカード20に送信するコマンドは、
「CLA」501、「INS」502、「P1」503、「P2」504、「Lc」505、「Data」506、及び「Le」507を有する。
As shown in FIG. 5, the command transmitted from the terminal device 10 to the IC card 20 is
“CLA” 501, “INS” 502, “P1” 503, “P2” 504, “Lc” 505, “Data” 506, and “Le” 507.

「CLA」501は、コマンドの層別を示すclass byteである。「INS」502は、コマンドの種別を示すinstruction byteである。「P1」503及び「P2」504は、「INS」502に応じたパラメータを示すparameter byteである。   “CLA” 501 is a class byte indicating the stratification of the command. “INS” 502 is an instruction byte indicating the type of command. “P1” 503 and “P2” 504 are parameter bytes indicating parameters according to “INS” 502.

「Lc」505は、「Data」506のデータの長さ(バイト数)を示すlength field for cording number Ncである。「Data」506は、当該コマンドのデータ本体を示すcommand data fieldである。「Le」507は、当該コマンドに対するレスポンスのデータ長を示すlength field for cording number Neである。   “Lc” 505 is a length field for coding number Nc indicating the data length (number of bytes) of “Data” 506. “Data” 506 is a command data field indicating the data body of the command. “Le” 507 is a length field for coding number Ne indicating the data length of the response to the command.

即ち、「CLA」501及び「INS」502により、当該コマンドが検査コマンドであるのか、発行コマンドであるのか、または他のコマンドであるのかが示される。ICカード20は、受信したコマンドの「CLA」501及び「INS」502の値を解析することにより、受信したコマンドの種類を認識する。   That is, “CLA” 501 and “INS” 502 indicate whether the command is an inspection command, an issued command, or another command. The IC card 20 recognizes the type of the received command by analyzing the values of “CLA” 501 and “INS” 502 of the received command.

例えば、コマンドが書き込みコマンドである場合、ICカード20は、「Data」506内のデータを不揮発性メモリ28の「P1」503及び「P2」504などにより指定された位置、またはファイルに書き込む。   For example, when the command is a write command, the IC card 20 writes the data in “Data” 506 to a location designated by “P1” 503 and “P2” 504 of the nonvolatile memory 28 or a file.

また、「Data」506は、複数のTLVデータオブジェクトを含む構成であってもよい。この場合、「Data」506は、Tag Length Value(TLV)構造のデータを複数含む。TLVデータオブジェクトのTagは、ICカード20のCPU25にTLVデータオブジェクトを識別させる為の情報である。Lengthは、TLVデータオブジェクトのValueのデータ長を示す情報である。Valueは、TLVデータオブジェクトのデータ本体である。   “Data” 506 may include a plurality of TLV data objects. In this case, “Data” 506 includes a plurality of data having a tag length value (TLV) structure. Tag of the TLV data object is information for causing the CPU 25 of the IC card 20 to identify the TLV data object. Length is information indicating the value data length of the TLV data object. Value is the data body of the TLV data object.

例えば、「Data」506が、データの書き込み先を示すTLVデータオブジェクト、及びデータ本体を示すTLVデータオブジェクトなどを有する場合、ICカード20は、TLVデータオブジェクトが示す書き込み先にデータ本体を書き込む。   For example, when the “Data” 506 includes a TLV data object indicating a data writing destination, a TLV data object indicating a data main body, and the like, the IC card 20 writes the data main body in a writing destination indicated by the TLV data object.

さらに、ICカード20のCPU25は、内部でデータを生成することが必要なコマンドを受信した場合、データを生成し、生成されたデータ(生成データ)を不揮発性メモリ28の所定のファイルに書き込む。例えば、CPU25は、ロジック部32により乱数を生成させ、生成された乱数に基づいて、生成データを生成する。さらに、CPU25は、生成データを不揮発性メモリ28内のコマンドにより指定される位置、または、予め設定された位置に書き込む。   Further, when the CPU 25 of the IC card 20 receives a command that needs to generate data internally, the CPU 25 generates data and writes the generated data (generated data) into a predetermined file in the nonvolatile memory 28. For example, the CPU 25 causes the logic unit 32 to generate a random number, and generates generation data based on the generated random number. Further, the CPU 25 writes the generated data at a position designated by a command in the nonvolatile memory 28 or a preset position.

上記の処理を繰り返し行うことにより、ICカード20の不揮発性メモリ28には、種々のデータが書き込まれる。   By repeatedly performing the above processing, various data are written in the nonvolatile memory 28 of the IC card 20.

図6は、ICカード20の不揮発性メモリ28の例を示す。
データ281及び282は、発行コマンドから取得したデータを示す。またデータ283は、上記の処理によりICカード28内部で生成された生成データを示す。さらに、不揮発性メモリ28内には、管理ファイルなどが格納される。ICカード20は、管理ファイルにより、不揮発性メモリ28内のデータをファイル構造として認識することができる。
FIG. 6 shows an example of the nonvolatile memory 28 of the IC card 20.
Data 281 and 282 indicate data acquired from the issue command. Data 283 indicates generated data generated in the IC card 28 by the above processing. Further, a management file or the like is stored in the nonvolatile memory 28. The IC card 20 can recognize the data in the nonvolatile memory 28 as a file structure from the management file.

さらに、ICカード20は、図4により示されたステップS23で、検査コマンドを受信したと判定した場合、不揮発性メモリ28により記憶されているデータに基づいて、ハッシュ値を算出する(ステップS24)。   Further, when it is determined in step S23 shown in FIG. 4 that the IC card 20 has received the inspection command, the IC card 20 calculates a hash value based on the data stored in the nonvolatile memory 28 (step S24). .

ICカード20は、例えば、ハッシュ関数としてSHA256を用いてハッシュ値を算出する。ICカード20は、例えば、不揮発性メモリ28の全てのデータに基づいてハッシュ値を算出する。   For example, the IC card 20 calculates a hash value using SHA256 as a hash function. The IC card 20 calculates a hash value based on all data in the nonvolatile memory 28, for example.

また、検査コマンドの「Data」506に不揮発性メモリ28上の領域を指定するデータが含まれている場合、ICカード20は、不揮発性メモリ28上の検査コマンドにより指定された領域のデータに基づいてハッシュ値を算出する構成であってもよい。この場合、検査コマンドは、例えば、先頭アドレスを示すデータとデータ長を示すデータとを含む。ICカード20は、不揮発性メモリ28に格納されているデータのうちの、先頭アドレスが示す位置からデータ長が示す長さのデータに基づいてハッシュ値を算出する。   If the data “506” of the inspection command includes data specifying an area on the nonvolatile memory 28, the IC card 20 is based on the data of the area specified by the inspection command on the nonvolatile memory 28. The hash value may be calculated. In this case, the inspection command includes, for example, data indicating the head address and data indicating the data length. The IC card 20 calculates a hash value based on the data having the length indicated by the data length from the position indicated by the head address among the data stored in the nonvolatile memory 28.

また、検査コマンドの「Data」506に不揮発性メモリ28上の領域を指定するデータが複数含まれている場合、ICカード20は、不揮発性メモリ28上の検査コマンドにより指定された複数の領域のデータを結合し、結合したデータに基づいてハッシュ値を算出する構成であってもよい。   In addition, when the inspection data “Data” 506 includes a plurality of data specifying the areas on the nonvolatile memory 28, the IC card 20 stores the plurality of areas specified by the inspection commands on the nonvolatile memory 28. The configuration may be such that the data is combined and the hash value is calculated based on the combined data.

またさらに、ハッシュ値の算出に用いるデータの中に、上記したような生成データが含まれている場合、ICカード20は、生成データを予め設定された値(例えば「0」など)に置き換え、置き換えたデータを含むデータに基づいてハッシュ値を算出する構成であってもよい。また、この場合、端末装置10も生成データに該当する領域のデータを予め設定された所定の値に置き換え、ハッシュ値を算出する。なお、ICカード20において置き換えられた値と、端末装置10において置き換えられた値とは一致する必要がある。   Furthermore, if the data used for calculating the hash value includes the generated data as described above, the IC card 20 replaces the generated data with a preset value (for example, “0”, etc.) The configuration may be such that the hash value is calculated based on data including the replaced data. In this case, the terminal device 10 also replaces the data in the area corresponding to the generated data with a predetermined value set in advance, and calculates a hash value. The value replaced in the IC card 20 and the value replaced in the terminal device 10 need to match.

また、ハッシュ値の算出に用いるデータの中に、暗号化されたデータが含まれている場合、ICカード20は、暗号化されたデータを復号し、復号されたデータに基づいてハッシュ値を算出する構成であってもよい。これにより、不揮発性メモリ28に記憶されているデータが暗号化されている場合であっても、ICカード20は、ハッシュ値を算出することができる。   When the data used for calculating the hash value includes encrypted data, the IC card 20 decrypts the encrypted data and calculates the hash value based on the decrypted data. It may be configured to. Thereby, even if the data stored in the nonvolatile memory 28 is encrypted, the IC card 20 can calculate the hash value.

ICカード20は、算出したハッシュ値に基づいて、レスポンスを生成する(ステップS25)。ICカード20は、生成したレスポンスを端末装置10に送信する(ステップS26)。   The IC card 20 generates a response based on the calculated hash value (step S25). The IC card 20 transmits the generated response to the terminal device 10 (step S26).

さらに、ICカード20は、上記のハッシュ値の算出及び算出されたハッシュ値をレスポンスとして出力する機能(総じてハッシュ機能と称する)を停止させ(ステップS27)、処理を終了する。   Further, the IC card 20 stops the calculation of the hash value and the function of outputting the calculated hash value as a response (generally referred to as a hash function) (step S27), and ends the process.

例えば、ICカード20は、ハッシュ機能を停止させるか否かを示す情報(ハッシュフラグ)を不揮発性メモリ28に記憶する。ICカード20は、所定のタイミングでこのハッシュフラグをOFFすることにより、ハッシュ機能を停止させることができる。   For example, the IC card 20 stores information (hash flag) indicating whether or not to stop the hash function in the nonvolatile memory 28. The IC card 20 can stop the hash function by turning off the hash flag at a predetermined timing.

例えば、ICカード20が一次発行フェーズから二次発行フェーズに切り替えられるタイミングでハッシュ機能を停止させる場合、ICカード20は、二次発行フェーズ以降においてハッシュ値の出力を行わない。また、例えば、ICカード20が二次発行フェーズから運用フェーズに切り替えられるタイミングでハッシュ機能を停止させる場合、ICカード20は、運用フェーズにおいてハッシュ値の出力を行わない。これにより、Icカード20のより高いセキュリティ性を実現することができる。   For example, when the hash function is stopped at the timing when the IC card 20 is switched from the primary issue phase to the secondary issue phase, the IC card 20 does not output the hash value after the secondary issue phase. For example, when the hash function is stopped at the timing when the IC card 20 is switched from the secondary issue phase to the operation phase, the IC card 20 does not output the hash value in the operation phase. Thereby, higher security of the Ic card 20 can be realized.

なお、上記の例では、ICカード20は、一次発行フェーズ、または二次発行フェーズの最後の処理としてハッシュ値の算出及び出力を行い、ハッシュ機能を停止させる構成として説明したが、この構成に限定されない。例えば、ICカード20は、フェーズ切り替えコマンドを受信した場合にハッシュ機能を停止させる構成であってもよい。   In the above example, the IC card 20 has been described as a configuration in which the hash value is calculated and output as the last process in the primary issue phase or the secondary issue phase, and the hash function is stopped. Not. For example, the IC card 20 may be configured to stop the hash function when a phase switching command is received.

また、端末装置10は、発行フェーズにおいてICカード20に送信した発行コマンドに基づいて、ICカード20の不揮発性メモリ28の状態を管理(把握)することができる。端末装置10は、自身が管理している不揮発性メモリ28の状態に基づいてハッシュ値を算出する。端末装置10は、算出したハッシュ値と、受信したレスポンスに含まれるハッシュ値とを比較する。端末装置10は、算出したハッシュ値と、受信したレスポンスに含まれるハッシュ値とが一致する場合、後段の処理を行う。   Further, the terminal device 10 can manage (obtain) the state of the nonvolatile memory 28 of the IC card 20 based on the issue command transmitted to the IC card 20 in the issue phase. The terminal device 10 calculates a hash value based on the state of the nonvolatile memory 28 managed by itself. The terminal device 10 compares the calculated hash value with the hash value included in the received response. If the calculated hash value matches the hash value included in the received response, the terminal device 10 performs subsequent processing.

なお、端末装置10は、予めICカード20に書き込むデータが一定である場合、予め算出されたハッシュ値を記憶する構成であってもよい。この場合、端末装置10は、記憶しているハッシュ値と、受信したレスポンスに含まれるハッシュ値とが一致する場合、後段の処理を行う。   The terminal device 10 may be configured to store a hash value calculated in advance when data to be written in the IC card 20 is constant. In this case, when the stored hash value matches the hash value included in the received response, the terminal device 10 performs subsequent processing.

上記したように、一実施形態に係るICカード20は、発行フェーズにおいて検査コマンドを受信した場合、不揮発性メモリ28により記憶されているデータに基づいてハッシュ値を算出する。ICカード20は、算出したハッシュ値をレスポンスに付加し、端末装置10に送信する。端末装置10は、レスポンスに付加されていたハッシュ値が正しいか否か判定することにより、ICカード20に正確にデータを書き込むことが出来たか否かを判断する。   As described above, the IC card 20 according to the embodiment calculates the hash value based on the data stored in the nonvolatile memory 28 when the inspection command is received in the issue phase. The IC card 20 adds the calculated hash value to the response and transmits it to the terminal device 10. The terminal device 10 determines whether or not the data has been correctly written to the IC card 20 by determining whether or not the hash value added to the response is correct.

このように、ハッシュ関数を利用して不揮発性メモリ28のデータに基づいてハッシュ値を算出することにより、ICカード処理システム1は、不揮発性メモリ28内のデータの正確性を1ビット単位で判断することができる。また、ICカード処理システム1は、個人データ、または暗号鍵などのセキュアに管理しなければならない初期化データをICカード20から出力することなく、不揮発性メモリ28内のデータの正確性を確認することができる。この結果、間接的に、且つ、より高い精度でデータを検査することができる携帯可能電子装置、携帯可能電子装置の制御方法を提供することができる。   Thus, by calculating a hash value based on the data in the nonvolatile memory 28 using the hash function, the IC card processing system 1 determines the accuracy of the data in the nonvolatile memory 28 in 1-bit units. can do. Further, the IC card processing system 1 confirms the accuracy of the data in the nonvolatile memory 28 without outputting from the IC card 20 initialization data that must be managed securely, such as personal data or an encryption key. be able to. As a result, it is possible to provide a portable electronic device capable of inspecting data indirectly and with higher accuracy, and a method for controlling the portable electronic device.

なお、上記の実施形態では、ICカード20は、ハッシュ関数としてSHA256を用いてハッシュ値を算出すると説明したが、この構成に限定されない。ICカード20がハッシュ値の算出に用いるハッシュ関数は、少なくとも端末装置10が用いるハッシュ関数と同一であれば如何なるものであってもよい。   In the above embodiment, the IC card 20 has been described as calculating a hash value using SHA256 as a hash function, but the present invention is not limited to this configuration. The hash function used by the IC card 20 for calculating the hash value may be any as long as it is at least the same as the hash function used by the terminal device 10.

なお、上述の各実施の形態で説明した機能は、ハードウエアを用いて構成するに留まらず、ソフトウエアを用いて各機能を記載したプログラムをコンピュータに読み込ませて実現することもできる。また、各機能は、適宜ソフトウエア、ハードウエアのいずれかを選択して構成するものであっても良い。   It should be noted that the functions described in the above embodiments are not limited to being configured using hardware, but can be realized by causing a computer to read a program describing each function using software. Each function may be configured by appropriately selecting either software or hardware.

なお、本発明は上記実施形態そのままに限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で構成要素を変形して具体化できる。また、上記実施形態に開示されている複数の構成要素の適宜な組み合せにより種々の発明を形成できる。例えば、実施形態に示される全構成要素から幾つかの構成要素を削除してもよい。更に、異なる実施形態に亘る構成要素を適宜組み合せてもよい。   Note that the present invention is not limited to the above-described embodiment as it is, and can be embodied by modifying the constituent elements without departing from the scope of the invention in the implementation stage. Further, various inventions can be formed by appropriately combining a plurality of constituent elements disclosed in the embodiment. For example, some components may be deleted from all the components shown in the embodiment. Furthermore, you may combine suitably the component covering different embodiment.

1…ICカード処理システム、10…端末装置、11…CPU、12…ROM、13…RAM、14…不揮発性メモリ、15…カードリーダライタ、17…操作部、18…ディスプレイ、19…電源部、20…ICカード、21…本体、22…ICモジュール、23…ICチップ、24…通信部、25…CPU、26…ROM、27…RAM、28…不揮発性メモリ、31…電源部。   DESCRIPTION OF SYMBOLS 1 ... IC card processing system, 10 ... Terminal device, 11 ... CPU, 12 ... ROM, 13 ... RAM, 14 ... Non-volatile memory, 15 ... Card reader / writer, 17 ... Operation part, 18 ... Display, 19 ... Power supply part, DESCRIPTION OF SYMBOLS 20 ... IC card, 21 ... Main body, 22 ... IC module, 23 ... IC chip, 24 ... Communication part, 25 ... CPU, 26 ... ROM, 27 ... RAM, 28 ... Nonvolatile memory, 31 ... Power supply part.

Claims (7)

データを記憶するメモリと、
外部機器から送信されたコマンドを受信する受信部と、
前記受信部により発行コマンドを受信した場合、前記発行コマンドに基づいてデータを取得し、取得したデータを前記メモリに書き込むコマンド処理部と、
前記受信部により検査コマンドを受信した場合、前記メモリのデータに基づいてハッシュ値を算出するハッシュ値算出部と、
前記ハッシュ値算出部により算出されたハッシュ値に基づいてレスポンスを生成するレスポンス処理部と、
前記レスポンス処理部により生成されたレスポンスを前記外部機器に送信する送信部と、
を具備する携帯可能電子装置。
A memory for storing data;
A receiving unit for receiving a command transmitted from an external device;
When receiving an issue command by the receiving unit, a command processing unit that acquires data based on the issue command and writes the acquired data to the memory;
A hash value calculation unit that calculates a hash value based on the data in the memory, when an inspection command is received by the reception unit;
A response processing unit that generates a response based on the hash value calculated by the hash value calculation unit;
A transmission unit that transmits the response generated by the response processing unit to the external device;
A portable electronic device comprising:
前記コマンド処理部は、前記発行コマンドに基づいてデータを生成し、生成したデータを前記メモリに書き込み、
前記ハッシュ値算出部は、前記メモリの生成されたデータを予め設定されたデータに置き換えて、前記メモリのデータに基づいてハッシュ値を算出する、
請求項1に記載の携帯可能電子装置。
The command processing unit generates data based on the issued command, writes the generated data to the memory,
The hash value calculation unit replaces the data generated in the memory with preset data, and calculates a hash value based on the data in the memory.
The portable electronic device according to claim 1.
前記ハッシュ値算出部は、前記メモリの中の前記検査コマンドにより指定された領域のデータに基づいてハッシュ値を算出する、請求項1に記載の携帯可能電子装置。   The portable electronic device according to claim 1, wherein the hash value calculation unit calculates a hash value based on data in an area specified by the inspection command in the memory. 前記ハッシュ値算出部は、前記メモリの中の前記検査コマンドにより指定された複数の領域のデータを結合し、結合されたデータに基づいてハッシュ値を算出する、請求項3に記載の携帯可能電子装置。   4. The portable electronic device according to claim 3, wherein the hash value calculation unit combines data of a plurality of areas designated by the inspection command in the memory and calculates a hash value based on the combined data. apparatus. 前記ハッシュ値算出部は、前記メモリのデータを復号し、複合されたデータに基づいてハッシュ値を算出する、請求項1に記載の携帯可能電子装置。   The portable electronic device according to claim 1, wherein the hash value calculation unit decodes the data in the memory and calculates a hash value based on the combined data. 前記各部を備えるICモジュールと、
前記ICモジュールが配設される本体と、
を具備する請求項1に記載の携帯可能電子装置。
An IC module comprising the above-mentioned parts;
A main body on which the IC module is disposed;
The portable electronic device according to claim 1, comprising:
データを記憶するメモリを具備する携帯可能電子装置に用いられる携帯可能電子装置の制御方法であって、
外部機器から送信された発行コマンドを受信した場合、前記発行コマンドに基づいてデータを取得し、取得したデータを前記メモリに書き込み、
外部機器から送信された検査コマンドを受信した場合、前記メモリのデータに基づいてハッシュ値を算出し、
算出された前記ハッシュ値に基づいてレスポンスを生成し、
生成された前記レスポンスを前記外部機器に送信する、
携帯可能電子装置の制御方法。
A method of controlling a portable electronic device used in a portable electronic device comprising a memory for storing data,
When an issue command transmitted from an external device is received, data is acquired based on the issue command, and the acquired data is written to the memory.
When a test command transmitted from an external device is received, a hash value is calculated based on the data in the memory,
Generate a response based on the calculated hash value,
Sending the generated response to the external device;
Control method of portable electronic device.
JP2011113496A 2011-05-20 2011-05-20 Portable electronic device and method for controlling portable electronic device Active JP5677195B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011113496A JP5677195B2 (en) 2011-05-20 2011-05-20 Portable electronic device and method for controlling portable electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011113496A JP5677195B2 (en) 2011-05-20 2011-05-20 Portable electronic device and method for controlling portable electronic device

Publications (2)

Publication Number Publication Date
JP2012243133A true JP2012243133A (en) 2012-12-10
JP5677195B2 JP5677195B2 (en) 2015-02-25

Family

ID=47464766

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011113496A Active JP5677195B2 (en) 2011-05-20 2011-05-20 Portable electronic device and method for controlling portable electronic device

Country Status (1)

Country Link
JP (1) JP5677195B2 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09185691A (en) * 1996-01-08 1997-07-15 N T T Data Tsushin Kk System and method for inspecting program in ic card
JP2004336702A (en) * 2003-04-15 2004-11-25 Ntt Communications Kk Data originality securing method and system, and program for securing data originality
JP2005153229A (en) * 2003-11-21 2005-06-16 Canon Inc Image forming apparatus, printing data alteration verifying system, printing data alteration verification method, computer program, and computer readable recording medium
JP2005258968A (en) * 2004-03-15 2005-09-22 Dainippon Printing Co Ltd Validity verification method of data written in ic card, and program for ic card
JP2006228203A (en) * 2005-02-15 2006-08-31 Hitachi Ltd Method of assuring data integrity on storage volume
JP2011053728A (en) * 2009-08-31 2011-03-17 Canon It Solutions Inc Information processing apparatus, information processing method, program, and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09185691A (en) * 1996-01-08 1997-07-15 N T T Data Tsushin Kk System and method for inspecting program in ic card
JP2004336702A (en) * 2003-04-15 2004-11-25 Ntt Communications Kk Data originality securing method and system, and program for securing data originality
JP2005153229A (en) * 2003-11-21 2005-06-16 Canon Inc Image forming apparatus, printing data alteration verifying system, printing data alteration verification method, computer program, and computer readable recording medium
JP2005258968A (en) * 2004-03-15 2005-09-22 Dainippon Printing Co Ltd Validity verification method of data written in ic card, and program for ic card
JP2006228203A (en) * 2005-02-15 2006-08-31 Hitachi Ltd Method of assuring data integrity on storage volume
JP2011053728A (en) * 2009-08-31 2011-03-17 Canon It Solutions Inc Information processing apparatus, information processing method, program, and storage medium

Also Published As

Publication number Publication date
JP5677195B2 (en) 2015-02-25

Similar Documents

Publication Publication Date Title
US20140189223A1 (en) Ic card, portable electronic device, and method of controlling ic card
JP2012208910A (en) Portable electronic device and processing system for portable electronic device
JP2011022841A (en) Processing system for portable electronic apparatus, portable electronic apparatus, and processing apparatus for portable electronic apparatus
JP5677195B2 (en) Portable electronic device and method for controlling portable electronic device
JP5693824B2 (en) IC card processing device, IC card, and IC card processing system
JP5892818B2 (en) Portable electronic device and control program for portable electronic device
JP2013118473A (en) Ic card, portable electronic device and control program of ic card
JP2014186385A (en) Ic card and ic card control method
JP5957577B2 (en) IC card, portable electronic device, and IC card control method
JP6092342B2 (en) Non-contact portable electronic device and method for issuing non-contact portable electronic device
JP5684051B2 (en) Portable electronic device, IC card, and control method for portable electronic device
JP5490044B2 (en) Portable electronic device and method for controlling portable electronic device
US20150324411A1 (en) Data processing apparatus for ic card issuing, ic card issuing apparatus, ic card issuing system, data processing program for ic card issuing, ic card issuing program
JP6009854B2 (en) IC card, portable electronic device, and IC card control program
JP2014063263A (en) Ic card, portable electronic device, and ic card reader/writer
JP5726659B2 (en) IC card, IC card processing device, and IC card processing system
JP5684059B2 (en) IC card and control method of IC card
JP5875772B2 (en) Portable electronic device, control method for portable electronic device, and processing system for portable electronic device
JP5726700B2 (en) IC card and IC card processing method
JP2012198682A (en) Portable electronic device, processor of portable electronic device, and processing system of portable electronic device
JP2013069108A (en) Ic card, portable electronic device and ic card control method
JP6046068B2 (en) Portable electronic device and method for controlling portable electronic device
JP2014063292A (en) Ic card, portable electronic device, and ic card reader/writer
JP2014182644A (en) Ic card substrate, ic card manufacturing method and ic card
JP2014032601A (en) Ic card, portable electronic device, and ic card control program

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20131205

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20131212

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20131219

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20131226

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20140109

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140307

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140903

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140909

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20141020

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20141226

R151 Written notification of patent or utility model registration

Ref document number: 5677195

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151