JP2014126935A - Ic card, data duplication control method, and data duplication control program - Google Patents

Ic card, data duplication control method, and data duplication control program Download PDF

Info

Publication number
JP2014126935A
JP2014126935A JP2012281455A JP2012281455A JP2014126935A JP 2014126935 A JP2014126935 A JP 2014126935A JP 2012281455 A JP2012281455 A JP 2012281455A JP 2012281455 A JP2012281455 A JP 2012281455A JP 2014126935 A JP2014126935 A JP 2014126935A
Authority
JP
Japan
Prior art keywords
response data
address
external terminal
data
communication buffer
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
JP2012281455A
Other languages
Japanese (ja)
Other versions
JP6031997B2 (en
Inventor
Takahiko Inamura
孝彦 稲村
Tetsuo Jinriki
哲夫 神力
Masatake Fukunaga
正剛 福永
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP2012281455A priority Critical patent/JP6031997B2/en
Publication of JP2014126935A publication Critical patent/JP2014126935A/en
Application granted granted Critical
Publication of JP6031997B2 publication Critical patent/JP6031997B2/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 an IC card, a data duplication control method and a data duplication control program capable of preventing data from being duplicated illegally and externally even when external attacks are repeated at plural times.SOLUTION: Response data stored in a prescribed address of a memory is duplicated in a communication buffer according to a prescribed size, and it is determined whether the address of the duplication source is proper according to the duplication. When it is determined that the address of the duplication source is not proper, the duplication of the response data is stopped.

Description

本発明は、外部端末から受信したコマンドに対応した所定の処理を実行するコントローラと、当該処理の結果に基づいて前記外部端末へ出力するためのレスポンスデータを記憶するメモリとを備え、前記レスポンスデータを前記メモリから通信用バッファに複製した後、当該通信用バッファに複製された前記レスポンスデータを前記外部端末へ出力するICカードの技術に関する。   The present invention comprises a controller that executes a predetermined process corresponding to a command received from an external terminal, and a memory that stores response data to be output to the external terminal based on a result of the process, the response data The present invention relates to a technology of an IC card that copies the response data copied from the memory to the communication buffer and then outputs the response data copied to the communication buffer to the external terminal.

セキュリティ性が重要視されるICカードでは、外部からの攻撃などによる不正動作に対する防止手段を備えていなければならない。外部からの攻撃とは、故障解析と呼ばれるICカードに搭載されたICチップに誤動作を起こさせるための手段であり、代表的なものとしてDFA(Differential Fault Analysis)が挙げられる。   An IC card that places importance on security must be provided with a means for preventing unauthorized operation due to an attack from the outside. The attack from the outside is a means for causing a malfunction in an IC chip mounted on an IC card called failure analysis, and a typical example is DFA (Differential Fault Analysis).

ICカードは、外部端末との通信に接触I/Fや非接触I/Fを利用する。外部端末から送信されたコマンドをそれらのI/Fにて受信し、解釈、実行した後、レスポンスデータを応答する。このレスポンスデータは、ICカード内に保持する値であったり、カード内で演算した結果の値であったりするが、これらのデータをICカードから外部端末へと返送する際、ICカードは当該データを通信用のバッファへと複製(コピー)し、そこからレスポンスデータとして外部端末へ返送する。この時、通信用バッファへの複製時に外部から攻撃を受けると、誤ったアドレスのデータが通信用のバッファへと複製されることになり、本来は出力してはいけないアドレスのデータが出力されてしまう恐れがある。   The IC card uses a contact I / F or a non-contact I / F for communication with an external terminal. The command transmitted from the external terminal is received by those I / Fs, interpreted and executed, and then response data is returned. This response data is a value held in the IC card or a value obtained by calculation in the card. When returning these data from the IC card to the external terminal, the IC card Is copied (copied) to the communication buffer, and then returned as response data to the external terminal. At this time, if an attack is received from the outside when copying to the communication buffer, the data at the wrong address will be copied to the communication buffer, and data that should not be output will be output. There is a risk.

特許文献1には、外部から不正な攻撃が行なわれた場合に、内部の秘匿したいデータ等を外部へ応答することを防止する技術が開示されている。特許文献1の技術では、ICカードにおいて外部へ応答するための応答データを記憶する応答データエリアを持つメモリから送信バッファに対してデータを転送する前に、当該データの転送元が当該メモリの応答データエリアであることを確認し、この確認の結果、当該データの転送元が当該メモリの応答データエリアである場合は送信バッファへのデータ転送を許可し、そうでない場合は送信バッファへのデータ転送を停止するようになっている。   Patent Document 1 discloses a technique for preventing response of internal confidential data or the like to the outside when an unauthorized attack is performed from the outside. In the technique of Patent Document 1, before transferring data to a transmission buffer from a memory having a response data area for storing response data for response to the outside in the IC card, the transfer source of the data responds to the response of the memory. If the data transfer source is the response data area of the memory, the data transfer to the transmission buffer is permitted, otherwise the data transfer to the transmission buffer is confirmed. Is supposed to stop.

特許第4713878号Japanese Patent No. 4713878

しかしながら、外部からの攻撃が複数回繰り返し行われる場合、特許文献1の技術では、データの転送元がメモリの応答データエリアであることの確認により送信バッファへのデータ転送が許可された後に、外部からの攻撃が行なわれ、不正にデータが複製される可能性がある。   However, when an attack from the outside is repeatedly performed a plurality of times, in the technique of Patent Document 1, after confirming that the data transfer source is the response data area of the memory, data transfer to the transmission buffer is permitted, and then external There is a possibility that data will be copied illegally.

そこで、本発明は、外部からの攻撃が複数回繰り返し行われる場合であっても、不正にデータが外部に複製されることを防止することが可能なICカード、データ複製制御方法、及びデータ複製制御プログラムを提供することを目的とする。   Therefore, the present invention provides an IC card, a data duplication control method, and data duplication that can prevent illegal duplication of data even when an external attack is repeated a plurality of times. An object is to provide a control program.

上記課題を解決するために、請求項1に記載の発明は、外部端末から受信したコマンドに対応した所定の処理を実行するコントローラと、当該処理の結果に基づいて前記外部端末へ出力するためのレスポンスデータを記憶するメモリとを備え、前記レスポンスデータを前記メモリから通信用バッファに複製した後、当該通信用バッファに複製された前記レスポンスデータを前記外部端末へ出力するICカードにおいて、前記メモリの所定のアドレスに記憶された前記レスポンスデータを所定サイズ毎に前記通信用バッファに複製するデータ複製手段と、前記所定サイズの複製毎に複製元の前記アドレスが正当であるかを判定する判定手段と、前記判定手段により前記複製元の前記アドレスが正当でないと判定された場合、前記レスポンスデータの複製を中断する制御手段と、を備えることを特徴とする。   In order to solve the above problem, an invention according to claim 1 is a controller for executing a predetermined process corresponding to a command received from an external terminal, and outputting to the external terminal based on a result of the process. A memory for storing response data, and after replicating the response data from the memory to the communication buffer, an IC card that outputs the response data copied to the communication buffer to the external terminal. Data replication means for replicating the response data stored at a predetermined address to the communication buffer for each predetermined size; and determination means for determining whether the address of the replication source is valid for each replication of the predetermined size; If the determination means determines that the address of the copy source is not valid, the response data Replication interrupting control means of, characterized in that it comprises a.

請求項2に記載の発明は、外部端末から受信したコマンドに対応した所定の処理を実行するコントローラと、当該処理の結果に基づいて前記外部端末へ出力するためのレスポンスデータを記憶するメモリとを備え、前記レスポンスデータを前記メモリから通信用バッファに複製した後、当該通信用バッファに複製された前記レスポンスデータを前記外部端末へ出力するICカードにおいて、前記メモリの所定のアドレスに記憶された前記レスポンスデータを所定サイズ毎に前記通信用バッファに複製するデータ複製手段と、前記所定サイズの複製毎に複製元の前記アドレスが正当であるかを判定する判定手段と、前記データ複製手段により前記レスポンスデータの複製が完了した場合に、当該通信用バッファに複製された前記レスポンスデータを前記外部端末へ出力する制御手段と、を備え、前記制御手段は、前記判定手段により前記複製元の前記アドレスが正当でないと判定された場合にも、前記レスポンスデータの前記所定サイズ毎の複製を継続させ、前記通信用バッファに複製された当該レスポンスデータの前記外部端末への出力を不能にすることを特徴とする。   According to a second aspect of the present invention, there is provided a controller that executes a predetermined process corresponding to a command received from an external terminal, and a memory that stores response data to be output to the external terminal based on a result of the process. An IC card that outputs the response data copied to the communication buffer to the external terminal after the response data is copied from the memory to the communication buffer, and stored in a predetermined address of the memory A data duplicating unit for duplicating response data to the communication buffer for each predetermined size; a determining unit for determining whether the address of the duplication source is valid for each duplication of the predetermined size; and the response by the data duplicating unit When data replication is complete, the response data copied to the communication buffer Control means for outputting the response data to the external terminal, and when the determination means determines that the address of the copy source is not valid, the control means copies the response data for each predetermined size. And the output of the response data copied to the communication buffer to the external terminal is disabled.

請求項3に記載の発明は、請求項1または2に記載のICカードにおいて、前記レスポンスデータの複製開始前に前記アドレスを示す値を前記メモリに複製するアドレス複製手段を更に備え、前記判定手段は、前記レスポンスデータの複製元のアドレスを示す値と、前記メモリに複製されたアドレスを示す値とが一致しているかを判定し、一致していない場合、当該アドレスが正当でないと判定することを特徴とする。   According to a third aspect of the present invention, in the IC card according to the first or second aspect, the IC card further includes an address duplicating unit that duplicates a value indicating the address in the memory before starting the duplication of the response data. Determines whether the value indicating the address from which the response data is copied matches the value indicating the address copied to the memory, and if not, determines that the address is not valid It is characterized by.

請求項4に記載の発明は、請求項1または2に記載のICカードにおいて、前記レスポンスデータの複製開始前に前記アドレスを示す値の反転値を前記メモリに複製するアドレス複製手段を更に備え、前記判定手段は、前記レスポンスデータの複製元のアドレスを示す値と、前記メモリに複製された前記反転値との整合性が取れているか確認し、整合性が取れていない場合、当該アドレスが正当でないと判定することを特徴とする。   According to a fourth aspect of the present invention, the IC card according to the first or second aspect further includes an address duplicating unit that duplicates an inverted value of the value indicating the address into the memory before starting the duplication of the response data. The determination unit confirms whether the value indicating the source address of the response data is consistent with the inverted value copied to the memory. If the consistency is not satisfied, the address is valid. It is characterized by determining that it is not.

請求項5に記載の発明は、請求項1乃至4の何れか一項に記載のICカードにおいて、前記制御手段は、前記判定手段により前記複製元の前記アドレスが正当でないと判定された場合、前記レスポンスデータとは異なるダミーデータを前記外部端末へ出力することを特徴とする。   According to a fifth aspect of the present invention, in the IC card according to any one of the first to fourth aspects, when the control unit determines that the address of the copy source is not valid by the determination unit, Dummy data different from the response data is output to the external terminal.

請求項6に記載の発明は、外部端末から受信したコマンドに対応した所定の処理を実行するコントローラと、当該処理の結果に基づいて前記外部端末へ出力するためのレスポンスデータを記憶するメモリとを備え、前記レスポンスデータを前記メモリから通信用バッファに複製した後、当該通信用バッファに複製された前記レスポンスデータを前記外部端末へ出力するICカードの前記コントローラにより行われるデータ複製制御方法であって、前記メモリの所定のアドレスに記憶された前記レスポンスデータを所定サイズ毎に前記通信用バッファに複製するステップと、前記所定サイズの複製毎に複製元の前記アドレスが正当であるかを判定するステップと、前記複製元の前記アドレスが正当でないと判定された場合、前記レスポンスデータの複製を中断するステップと、を含むことを特徴とする。   The invention described in claim 6 includes a controller that executes a predetermined process corresponding to a command received from an external terminal, and a memory that stores response data to be output to the external terminal based on the result of the process. A data replication control method performed by the controller of the IC card that outputs the response data copied to the communication buffer to the external terminal after replicating the response data from the memory to the communication buffer. Replicating the response data stored at a predetermined address in the memory to the communication buffer for each predetermined size, and determining whether the address of the replication source is valid for each replication of the predetermined size If the address of the copy source is determined to be invalid, the response data Characterized in that it comprises duplicated and the discontinuing of the.

請求項7に記載のデータ複製制御プログラムの発明は、外部端末から受信したコマンドに対応した所定の処理を実行するコントローラと、当該処理の結果に基づいて前記外部端末へ出力するためのレスポンスデータを記憶するメモリとを備え、前記レスポンスデータを前記メモリから通信用バッファに複製した後、当該通信用バッファに複製された前記レスポンスデータを前記外部端末へ出力するICカードにおける前記コントローラを、前記メモリの所定のアドレスに記憶された前記レスポンスデータを所定サイズ毎に前記通信用バッファに複製するデータ複製手段、前記所定サイズの複製毎に複製元の前記アドレスが正当であるかを判定する判定手段、及び、前記判定手段により前記複製元の前記アドレスが正当でないと判定された場合、前記レスポンスデータの複製を中断する制御手段として機能させることを特徴とする。   The invention of the data duplication control program according to claim 7 is a controller for executing a predetermined process corresponding to a command received from an external terminal, and response data for outputting to the external terminal based on a result of the process. The controller in an IC card that outputs the response data copied to the communication buffer to the external terminal after replicating the response data from the memory to the communication buffer. Data duplicating means for duplicating the response data stored at a predetermined address to the communication buffer for each predetermined size, determining means for judging whether the address of the duplication source is valid for each duplication of the predetermined size, and When the determination means determines that the address of the copy source is not valid Characterized in that to function as interrupting control means replication of the response data.

請求項8に記載の発明は、外部端末から受信したコマンドに対応した所定の処理を実行するコントローラと、当該処理の結果に基づいて前記外部端末へ出力するためのレスポンスデータを記憶するメモリとを備え、前記レスポンスデータを前記メモリから通信用バッファに複製した後、当該通信用バッファに複製された前記レスポンスデータを前記外部端末へ出力するICカードの前記コントローラにより行われるデータ複製制御方法であって、前記メモリの所定のアドレスに記憶された前記レスポンスデータを所定サイズ毎に前記通信用バッファに複製するステップと、前記所定サイズの複製毎に複製元の前記アドレスが正当であるかを判定するステップと、前記レスポンスデータの複製が完了した場合に、当該通信用バッファに複製された前記レスポンスデータを前記外部端末へ出力するステップと、を含み、前記データ複製制御方法は、前記複製元の前記アドレスが正当でないと判定された場合にも、前記レスポンスデータの前記所定サイズ毎の複製を継続させ、前記通信用バッファに複製された当該レスポンスデータの前記外部端末への出力を不能にすることを特徴とする。   The invention according to claim 8 includes a controller that executes a predetermined process corresponding to a command received from an external terminal, and a memory that stores response data to be output to the external terminal based on a result of the process. A data replication control method performed by the controller of the IC card that outputs the response data copied to the communication buffer to the external terminal after replicating the response data from the memory to the communication buffer. Replicating the response data stored at a predetermined address in the memory to the communication buffer for each predetermined size, and determining whether the address of the replication source is valid for each replication of the predetermined size And when the response data is copied, it is copied to the communication buffer. Outputting the response data to the external terminal, wherein the data replication control method replicates the response data for each predetermined size even when it is determined that the address of the replication source is not valid. And the output of the response data copied to the communication buffer to the external terminal is disabled.

請求項9に記載のデータ複製制御プログラムの発明は、外部端末から受信したコマンドに対応した所定の処理を実行するコントローラと、当該処理の結果に基づいて前記外部端末へ出力するためのレスポンスデータを記憶するメモリとを備え、前記レスポンスデータを前記メモリから通信用バッファに複製した後、当該通信用バッファに複製された前記レスポンスデータを前記外部端末へ出力するICカードにおける前記コントローラを、前記メモリの所定のアドレスに記憶された前記レスポンスデータを所定サイズ毎に前記通信用バッファに複製するデータ複製手段、前記所定サイズの複製毎に複製元の前記アドレスが正当であるかを判定する判定手段、及び、前記データ複製手段により前記レスポンスデータの複製が完了した場合に、当該通信用バッファに複製された前記レスポンスデータを前記外部端末へ出力する制御手段として機能させ、前記制御手段は、前記判定手段により前記複製元の前記アドレスが正当でないと判定された場合にも、前記レスポンスデータの前記所定サイズ毎の複製を継続させ、前記通信用バッファに複製された当該レスポンスデータの前記外部端末への出力を不能にすることを特徴とする。   The invention of the data replication control program according to claim 9 is a controller for executing a predetermined process corresponding to a command received from an external terminal, and response data for outputting to the external terminal based on a result of the process. The controller in an IC card that outputs the response data copied to the communication buffer to the external terminal after replicating the response data from the memory to the communication buffer. Data duplicating means for duplicating the response data stored at a predetermined address to the communication buffer for each predetermined size, determining means for judging whether the address of the duplication source is valid for each duplication of the predetermined size, and When the response data replication is completed by the data replication means, The control unit functions as a control unit that outputs the response data copied to the communication buffer to the external terminal, and the control unit also includes the determination unit that determines that the address of the copy source is not valid. The replication of the response data for each predetermined size is continued, and output of the response data copied to the communication buffer to the external terminal is disabled.

本発明によれば、メモリの所定のアドレスに記憶されたレスポンスデータを所定サイズ毎に通信用バッファに複製し、当該複製毎に複製元のアドレスが正当であるかを判定して複製元のアドレスが正当でないと判定された場合、レスポンスデータの複製を中断するか、または、レスポンスデータの所定サイズ毎の複製を継続させ通信用バッファに複製されたレスポンスデータの外部端末への出力を不能にするように構成したので、外部からの攻撃が複数回繰り返し行われる場合であっても、不正にデータが外部に複製されることを防止することができる。   According to the present invention, the response data stored at a predetermined address in the memory is copied to the communication buffer for each predetermined size, and the copy source address is determined by determining whether the copy source address is valid for each copy. If it is determined that the response data is not valid, the response data replication is interrupted, or the response data is continuously replicated for each predetermined size, and the response data copied to the communication buffer is disabled from being output to the external terminal. Since it comprised in this way, even if it is a case where the attack from the outside is repeatedly performed several times, it can prevent that data are illegally copied outside.

ICカード1の概要構成例を示す図である。1 is a diagram illustrating a schematic configuration example of an IC card 1. FIG. 複製元のアドレスsrcが、二重化されたアドレスsrc_dualとして複製される様子を示す概念図である。It is a conceptual diagram which shows a mode that the duplication address src is duplicated as the duplication address src_dual. (A)は、データ複製制御方法1における処理を示すフローチャートであり、(B)は、(A)に示す処理に対応する疑似コードの一例を示す図である。(A) is a flowchart which shows the process in the data replication control method 1, (B) is a figure which shows an example of the pseudo code corresponding to the process shown to (A). (A)は、データ複製制御方法2における処理を示すフローチャートであり、(B)は、(A)に示す処理による効果を説明するための図である。(A) is a flowchart which shows the process in the data replication control method 2, (B) is a figure for demonstrating the effect by the process shown to (A).

以下、図面を参照して本発明の実施形態について詳細に説明する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

先ず、図1を参照して、本実施形態に係るICカードについて説明する。図1は、ICカード1の概要構成例を示す図である。なお、ICカード1は、キャッシュカード、クレージットカード、社員カード等として使用される。或いは、ICカード1は、スマートフォンや携帯電話機等に組み込まれる。   First, an IC card according to the present embodiment will be described with reference to FIG. 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, a credit card, an employee card, or the like. Alternatively, the IC card 1 is incorporated into a smartphone, a mobile phone, or the like.

図1に示すように、ICカード1には、ICチップ1aが搭載されている。ICチップ1aは、CPU(Central Processing Unit)11、RAM(Random Access Memory)12、フラッシュメモリ13、及びI/O回路14を備えて構成される。なお、フラッシュメモリの代わりにEEPROM(Electrically Erasable Programmable Read-Only Memory)であっても構わない。   As shown in FIG. 1, an IC chip 1 a is mounted on the IC card 1. The IC chip 1a includes a CPU (Central Processing Unit) 11, a RAM (Random Access Memory) 12, a flash memory 13, and an I / O circuit 14. Note that an EEPROM (Electrically Erasable Programmable Read-Only Memory) may be used instead of the flash memory.

CPU11は、各種プログラムを実行するコントローラであり、本発明のデータ複製制御プログラムにしたがって、外部端末2から受信したコマンドに対応した所定のコマンド処理を実行し、RAM12及びフラッシュメモリ13に対するデータの読み書き処理を行う。外部端末2は、ICカード1との間で接触または非接触で通信を行うためのリーダーライタを備える。外部端末2の例としてはATM、改札機、認証用ゲート等が挙げられる。或いは、ICカード1が携帯端末に搭載される場合、外部端末2には携帯端末の機能を担う制御部が該当する。なお、外部からの攻撃者の外部端末がICカード1の通信相手となる場合もあり、ICカード1は、この場合にも、内部の秘匿したいデータ(本来は出力してはいけないアドレスのデータ)が出力されないように構成される。   The CPU 11 is a controller that executes various programs, executes predetermined command processing corresponding to the command received from the external terminal 2 according to the data replication control program of the present invention, and reads / writes data from / to the RAM 12 and the flash memory 13 I do. The external terminal 2 includes a reader / writer for performing communication with or without contact with the IC card 1. Examples of the external terminal 2 include an ATM, a ticket gate, and an authentication gate. Alternatively, when the IC card 1 is mounted on a mobile terminal, the external terminal 2 corresponds to a control unit responsible for the function of the mobile terminal. In some cases, an external terminal of an attacker from the outside is a communication partner of the IC card 1, and the IC card 1 also in this case is data to be kept confidential (data of an address that should not be output originally). Is configured not to be output.

RAM12は、データを一時的に記憶する揮発性メモリである。RAM12の所定の記憶領域は、通信用バッファとして使用される。通信用バッファに格納されたデータは、I/O回路14を介して外部端末2へ出力されることになる。   The RAM 12 is a volatile memory that temporarily stores data. A predetermined storage area of the RAM 12 is used as a communication buffer. The data stored in the communication buffer is output to the external terminal 2 via the I / O circuit 14.

フラッシュメモリ13は、プログラム(本発明のデータ複製制御プログラムを含む)やデータを格納する不揮発性メモリである。フラッシュメモリ13には、CPU11によるコマンド処理の結果に基づいて外部端末2へ出力するためのレスポンスデータが記憶される。このレスポンスデータは、例えば、ICチップ1a内に保持する値(例えば鍵データ)、またはICチップ1a内で演算した結果の値である。   The flash memory 13 is a nonvolatile memory for storing programs (including the data replication control program of the present invention) and data. The flash memory 13 stores response data to be output to the external terminal 2 based on the result of command processing by the CPU 11. This response data is, for example, a value (eg, key data) held in the IC chip 1a or a value obtained as a result of calculation in the IC chip 1a.

I/O回路14は、外部端末2とのインターフェイスを担う。I/O回路14には、例えばISO/IEC7816によって定められたC1〜C8の8個の端子が設けられている。例えば、C1端子は電源端子、C2端子はリセット端子、C3端子はクロック端子、C5端子はグランド端子、C7端子は外部端末2とのデータ通信を行う端子である。   The I / O circuit 14 serves as an interface with the external terminal 2. The I / O circuit 14 is provided with eight terminals C1 to C8 defined by, for example, ISO / IEC7816. For example, the C1 terminal is a power supply terminal, the C2 terminal is a reset terminal, the C3 terminal is a clock terminal, the C5 terminal is a ground terminal, and the C7 terminal is a terminal that performs data communication with the external terminal 2.

CPU11は、上記コマンド処理において、本発明におけるデータ複製手段として機能することにより、フラッシュメモリ13の所定のアドレスに記憶されたレスポンスデータ(つまり、コマンド処理の結果に基づいて外部端末2へ出力するためのレスポンスデータ)を所定サイズ毎に通信用バッファに複製(コピー)する複製処理を行う。例えばレスポンスデータの先頭から一定長のバイト毎に複数回に亘って通信用バッファに繰り返し複製される。   In the command processing, the CPU 11 functions as data duplicating means in the present invention, thereby outputting response data stored at a predetermined address in the flash memory 13 (that is, for outputting to the external terminal 2 based on the result of the command processing). The response data) is copied (copied) to the communication buffer for each predetermined size. For example, the response data is repeatedly copied to the communication buffer a plurality of times for each fixed-length byte from the top of the response data.

また、CPU11は、本発明における判定手段として機能することにより、レスポンスデータの所定サイズの複製毎に複製元のアドレス(フラッシュメモリ13のアドレス)が正当であるか否かを判定する判定処理を行う。つまり、上記所定サイズ毎の複製が行われる度に複製元のアドレスがチェックされる。このチェック方法としては、アドレス(アドレスを示す値)の二重化(三重化以上でもよい)により検証する方法や、アドレス(アドレスを示す値)の誤り検出符号により検証する方法が挙げられる。   Further, the CPU 11 functions as a determination unit in the present invention to perform a determination process for determining whether or not the copy source address (address of the flash memory 13) is valid for each copy of the response data having a predetermined size. . In other words, the copy source address is checked each time the copy is performed for each predetermined size. As this check method, there are a method of verifying by duplication (or more than triple) of an address (value indicating an address) and a method of verifying by an error detection code of an address (value indicating an address).

アドレスの二重化により検証する方法では、レスポンスデータの所定サイズの複製開始前に、複製元のアドレスを二重化して保持する。つまり、CPU11は、本発明におけるアドレス複製手段として機能することにより、レスポンスデータの複製開始前に複製元のアドレスをメモリ(例えば、RAM12またはフラッシュメモリ13に設けられたスタック)に複製することで保持する。このとき保持される値は、「複製元のアドレス」と「複製元のアドレスと同じ値」である。   In the method of verifying by duplication of addresses, duplication source addresses are duplicated and held before the start of duplication of a predetermined size of response data. In other words, the CPU 11 functions as the address duplicating means in the present invention, and retains the duplication source address by duplicating it in the memory (for example, the stack provided in the RAM 12 or the flash memory 13) before the response data duplication starts. To do. The values held at this time are “replication source address” and “same value as the replication source address”.

図2は、複製元のアドレスsrcが、二重化されたアドレスsrc_dualとして複製される様子を示す概念図である。そして、二重化されたアドレスが、レスポンスデータの所定サイズの複製時に比較(srcとsrc_dualとが比較)され、互いのアドレスが一致する場合、複製元のアドレスが正当であると判定するように構成する。一方、互いのアドレスが一致しない場合、当該アドレスが正当でないと判定される。或いは、このとき保持される値は、「複製元のアドレス」と「複製元のアドレスの反転値」であってもよい。この場合、「複製元のアドレス」と「複製元のアドレスの反転値」との整合性が取れていることが、レスポンスデータの所定サイズの複製時に確認され、整合性が取れている場合、複製元のアドレスが正当であると判定するように構成する。一方、整合性が取れていない場合、当該アドレスが正当でないと判定される。例えば、図2において、srcに複製元のアドレス、Src_dualに複製元のアドレスの反転値が格納されていた場合、srcと、src_dualの反転値が一致する場合、複製元のアドレスが正当であると判定される。このように反転値を保持しておくことにより、セキュリティ性を向上させることはできる。メモリは特性として「攻撃を受けると特定の値に変化しやすい」という場合がある。この場合、元の値をそのまま二重化して保持していた場合、両方へ攻撃されてしまうと両方とも同じ値に変化してしまう。しかし、反転値を保持していた場合では、両方へ攻撃されて同じ値になっても攻撃を検知することが可能になる。   FIG. 2 is a conceptual diagram showing how the source address src is duplicated as a duplicated address src_dual. Then, the duplicated addresses are compared when the response data is copied at a predetermined size (src and src_dual are compared), and when the addresses match each other, it is determined that the duplication source address is valid. . On the other hand, if the addresses do not match, it is determined that the addresses are not valid. Alternatively, the values held at this time may be “replication source address” and “replication value of the replication source address”. In this case, the consistency between the "replication source address" and the "inverted value of the replication source address" is confirmed at the time of duplication of the response data of the specified size. The original address is determined to be valid. On the other hand, if consistency is not achieved, it is determined that the address is not valid. For example, in FIG. 2, when the source address is stored in src and the inverted value of the source address is stored in Src_dual, if the inverted value of src and src_dual match, the source address is valid. Determined. By holding the inversion value in this way, security can be improved. As a characteristic, the memory may be “easy to change to a specific value when attacked”. In this case, if the original value is kept doubled as it is, if both are attacked, both will change to the same value. However, in the case where the inverted value is held, it is possible to detect the attack even if both are attacked and become the same value.

一方、アドレスの誤り検出符号により検証する方法では、レスポンスデータの所定サイズの複製開始前に、複製元のアドレスをCRC(Cyclic Redundancy Check, CRC)演算してCRCの値を保持する。そして、レスポンスデータの所定サイズの複製時に複製元のアドレスをCRC演算することで得られたCRCの値と、所定サイズの複製前に演算され保持されたCRCの値とが比較され、互いのCRCの値が一致する場合、複製元のアドレスが正当であると判定するように構成する。或いは、アドレスの誤り検出符号により検証する別の方法では、レスポンスデータの所定サイズの複製開始前に複製元のアドレスのチェックサムを演算してチェックサムの値を保持する。そして、レスポンスデータの所定サイズの複製時に複製元のアドレスのチェックサムを演算することで得られた値と、所定サイズの複製前に演算され保持されたチェックサムの値とが比較され、互いのチェックサムの値が一致する場合、複製元のアドレスが正当であると判定するように構成する。   On the other hand, in the method of verifying with the error detection code of the address, before starting the replication of the response data of a predetermined size, CRC (Cyclic Redundancy Check, CRC) is performed on the replication source address and the CRC value is held. Then, the CRC value obtained by performing CRC calculation on the original address at the time of duplicating the response data with the predetermined size is compared with the CRC value calculated and held before duplicating the predetermined size. If the values match, the address of the copy source is determined to be valid. Alternatively, in another method of verifying with an error detection code for an address, the checksum value is calculated by calculating the checksum of the copy source address before starting to copy the response data with a predetermined size. Then, the value obtained by calculating the checksum of the copy source address at the time of duplicating the response data with the predetermined size is compared with the checksum value calculated and held before duplicating the predetermined size. If the checksum values match, the copy source address is determined to be valid.

アドレスの二重化により検証する方法とアドレスの誤り検出符号により検証する方法とを比較すると、アドレスの二重化により検証する方法の方が、アドレスの誤り検出符号により検証する方法よりも処理時間を短縮することができる。一方、アドレスの誤り検出符号により検証する方法の方が、アドレスの二重化により検証する方法よりもメモリ容量を抑えることができる。   Comparing the verification method using address duplication with the error detection code of the address, the method of verification using address duplication and the processing time is shorter than the verification method using the error detection code of the address. Can do. On the other hand, the method of verifying with the error detection code of the address can suppress the memory capacity than the method of verifying with the double address.

そして、CPU11は、本発明における制御手段として機能することにより、複製元のアドレスが正当でないと判定されることなく複製が完了した場合に、当該通信用バッファに複製されたレスポンスデータをI/O回路14を介して外部端末2へ出力する。一方、CPU11は、上記複製処理及び判定処理の途中で、複製元のアドレスが正当でないと判定した場合、レスポンスデータの複製処理を中断する(データ複製制御方法1)。或いは、CPU11は、上記複製処理及び判定処理の途中で、複製元のアドレスが正当でないと判定された場合にも、レスポンスデータの所定サイズ毎の複製を継続させ複製完了した後に以降の処理を中断する(データ複製制御方法2)。データ複製制御方法2の場合、CPU11は、通信用バッファに複製されたレスポンスデータの外部端末2への出力を不能にする。   Then, the CPU 11 functions as a control unit in the present invention, so that when the duplication is completed without determining that the duplication source address is not valid, the response data duplicated in the communication buffer is I / O The data is output to the external terminal 2 via the circuit 14. On the other hand, if the CPU 11 determines that the duplication source address is not valid during the duplication processing and determination processing, the CPU 11 interrupts the response data duplication processing (data duplication control method 1). Alternatively, even when it is determined that the copy source address is not valid during the copy process and the determination process, the CPU 11 continues the copy of the response data for each predetermined size and stops the subsequent process after the copy is completed. (Data replication control method 2). In the case of the data duplication control method 2, the CPU 11 disables output of the response data duplicated in the communication buffer to the external terminal 2.

次に、図3及び図4を参照して、外部端末2からコマンドを受信したときのCPU11の処理について説明する。図3(A)は、データ複製制御方法1における処理を示すフローチャートであり、図3(B)は、図3(A)に示す処理に対応する疑似コードの一例を示す図である。図4(A)は、データ複製制御方法2における処理を示すフローチャートであり、図4(B)は、図4(A)に示す処理による効果を説明するための図である。なお、図3(A)及び図4(A)は、アドレスの二重化により検証する方法を適用した場合の処理であり、例えばデータの読み出しコマンドを受信した場合に開始される。   Next, the processing of the CPU 11 when receiving a command from the external terminal 2 will be described with reference to FIGS. FIG. 3A is a flowchart showing processing in the data replication control method 1, and FIG. 3B is a diagram showing an example of pseudo code corresponding to the processing shown in FIG. FIG. 4A is a flowchart showing processing in the data replication control method 2, and FIG. 4B is a diagram for explaining the effect of the processing shown in FIG. 4A. FIG. 3A and FIG. 4A are processes in the case of applying the method of verification by address duplication, and are started when, for example, a data read command is received.

先ず、図3(A)に示すデータ複製制御方法1における処理について説明する。図3(A)に示すステップS1では、CPU11は、上述したように、複製元のアドレスを二重化して保持する。次いで、CPU11は、複製処理を開始し(ステップS2)、レスポンスデータの複製元のアドレスが正当であるか否かを判定する(ステップS3)。例えば、CPU11は、レスポンスデータの複製元のアドレスと、ステップS1で保持されたアドレスとが一致しているかを判定し、一致している場合、当該アドレスが正当であると判定する(ステップS3:YES)。このようにアドレスが正当であると判定された場合、CPU11は、レスポンスデータの一定長を通信用バッファに複製(言い換えれば、通信用バッファに転送)する(ステップS4)。   First, processing in the data replication control method 1 shown in FIG. In step S1 shown in FIG. 3A, the CPU 11 duplicates and holds the duplication source address as described above. Next, the CPU 11 starts duplication processing (step S2), and determines whether or not the duplication source address of the response data is valid (step S3). For example, the CPU 11 determines whether or not the response data replication source address matches the address stored in step S1, and if they match, the CPU 11 determines that the address is valid (step S3: YES). When it is determined that the address is valid in this way, the CPU 11 copies the predetermined length of the response data to the communication buffer (in other words, transfers it to the communication buffer) (step S4).

次いで、CPU11は、レスポンスデータの複製が完了したか否かを判定する(ステップS5)。そして、レスポンスデータの複製が完了していない場合(ステップS5:NO)、CPU11は、ステップS2に戻り、レスポンスデータの一定長毎の複製処理を継続する。一方、レスポンスデータの複製が完了した場合(ステップS5:YES)、CPU11は、通信用バッファに複製されたレスポンスデータをI/O回路14を介して外部端末2へ出力する(ステップS6)。   Next, the CPU 11 determines whether or not the response data has been copied (step S5). If the response data has not been replicated (step S5: NO), the CPU 11 returns to step S2 and continues the replication process for each predetermined length of the response data. On the other hand, when copying of the response data is completed (step S5: YES), the CPU 11 outputs the response data copied to the communication buffer to the external terminal 2 via the I / O circuit 14 (step S6).

一方、ステップS3において、レスポンスデータの複製元のアドレスと、ステップS1で保持されたアドレスとが一致していない場合、CPU11は、当該アドレスが正当でないと判定(異常検知)し(ステップS3:NO)、レスポンスデータの複製を中断して動作停止(システム停止)する(ステップS7)。つまり、上記アドレスが一致しないことにより異常が検知された場合、外部からの攻撃があったものとみなし、複製処理が中断される。なお、ステップS7において、CPU11は、外部端末2へエラーを応答してもよい。また、ステップS7において、CPU11は、レスポンスデータとは異なるダミーデータ(固定値または乱数)を外部(例えば、攻撃者の外部端末)へ出力するように構成すれば、当該攻撃者に対して、出力されたデータが内部の秘匿したいデータであるか否かを絞らせないようにすることができる。   On the other hand, when the response data replication source address does not match the address held in step S1 in step S3, the CPU 11 determines that the address is not valid (detects an abnormality) (step S3: NO). ) Response data replication is interrupted to stop the operation (system stop) (step S7). That is, when an abnormality is detected due to the mismatch of the addresses, it is considered that there has been an attack from the outside, and the replication process is interrupted. In step S7, the CPU 11 may respond an error to the external terminal 2. In step S7, if the CPU 11 is configured to output dummy data (fixed value or random number) different from the response data to the outside (for example, the attacker's external terminal), the CPU 11 outputs the data to the attacker. Therefore, it is possible not to narrow down whether or not the processed data is data to be kept secret.

以上説明したように、上記データ複製制御方法1によれば、CPU11は、レスポンスデータを所定サイズ毎に通信用バッファに複製する複製処理を行い、所定サイズの複製毎に複製元のアドレスが正当であるかを判定し、当該複製処理の途中で複製元のアドレスが正当でないと判定した場合、当該複製処理を中断するように構成したので、外部からの攻撃が複数回繰り返し行われる場合であっても、内部の秘匿したいデータが外部へ出力されることを防止(データが不正に外部に複製されることを防止)することができる。   As described above, according to the data duplication control method 1, the CPU 11 performs duplication processing for duplicating the response data in the communication buffer for each predetermined size, and the duplication source address is valid for each duplication of the predetermined size. If it is determined that the replication source address is not valid in the middle of the replication process, the replication process is configured to be interrupted. However, it is possible to prevent internal confidential data from being output to the outside (to prevent data from being illegally copied to the outside).

次に、図4(A)に示すデータ複製制御方法2における処理について説明する。データ複製制御方法2における処理の前提として、異常が検知されたことを記録する領域(以下、「異常検知フラグ」という)が用意される。図4(A)に示すステップS11では、図3(A)に示すステップS1と同様、CPU11は、複製元のアドレスを二重化して保持する。次いで、CPU11は、異常検知フラグをオフに(つまり、リセット)する(ステップS12)。次いで、CPU11は、複製処理を開始し(ステップS13)、図3(A)に示すステップS3と同様、レスポンスデータの複製元のアドレスが正当であるか否かを判定する(ステップS14)。そして、上記アドレスが正当であると判定された場合(ステップS14:YES)、図3(A)に示すステップS4と同様、CPU11は、レスポンスデータの一定長を通信用バッファに複製する(ステップS15)。一方、上記アドレスが正当でないと判定(異常検知)された場合(ステップS14:NO)、CPU11は、異常検知フラグをオンに(例えば、異常が検知されたことを記録する領域のデータ“0”を“1”に更新)し(ステップS16)、レスポンスデータの一定長を通信用バッファに複製する(ステップS15)。つまり、CPU11は、複製処理の途中で異常が検知された場合、外部からの攻撃があったものとみなし、異常検知フラグをオンするが、複製処理は継続して実行する。   Next, processing in the data replication control method 2 shown in FIG. As a premise of processing in the data replication control method 2, an area (hereinafter referred to as “abnormality detection flag”) for recording that an abnormality has been detected is prepared. In step S11 shown in FIG. 4A, as in step S1 shown in FIG. 3A, the CPU 11 holds the duplication source address in duplicate. Next, the CPU 11 turns off (that is, resets) the abnormality detection flag (step S12). Next, the CPU 11 starts duplication processing (step S13), and determines whether or not the duplication source address of the response data is valid as in step S3 shown in FIG. 3A (step S14). If it is determined that the address is valid (step S14: YES), the CPU 11 copies the fixed length of the response data to the communication buffer, similarly to step S4 shown in FIG. 3A (step S15). ). On the other hand, when it is determined that the address is not valid (abnormality detection) (step S14: NO), the CPU 11 turns on the abnormality detection flag (for example, data “0” in an area for recording that an abnormality has been detected). Is updated to “1”) (step S16), and a predetermined length of the response data is copied to the communication buffer (step S15). That is, if an abnormality is detected during the replication process, the CPU 11 considers that there has been an external attack and turns on the abnormality detection flag, but the replication process is continued.

次いで、CPU11は、レスポンスデータの複製が完了したか否かを判定し(ステップS17)、レスポンスデータの複製が完了していない場合(ステップS17:NO)、ステップS13に戻り、レスポンスデータの一定長毎の複製処理を継続する。一方、レスポンスデータの複製が完了した場合(ステップS17:YES)、CPU11は、異常検知フラグがオンであるか否かを判定する(ステップS18)。そして、異常検知フラグがオンでないと判定された場合(ステップS18:NO)、CPU11は、通信用バッファに複製されたレスポンスデータをI/O回路14を介して外部端末2へ出力する(ステップS19)。一方、異常検知フラグがオンであると判定された場合(ステップS18:YES)、動作停止する(ステップS20)。つまり、データ複製制御方法2では、CPU11は、全ての複製処理が完了した後、異常検知フラグを確認し、オフの場合はそのまま処理を継続してレスポンスデータの出力し、オンになっていた場合は以降の処理を中断することで通信用バッファに複製されたレスポンスデータの外部端末2への出力を不能にする。なお、ステップS20において、CPU11は、外部端末2へエラーを応答してもよい。また、ステップS20において、CPU11は、ステップS7と同様、レスポンスデータとは異なるダミーデータ(固定値または乱数)を外部(例えば、攻撃者の外部端末)へ出力するように構成してもよい。   Next, the CPU 11 determines whether or not the response data has been duplicated (step S17). If the response data has not been duplicated (step S17: NO), the CPU 11 returns to step S13, and the response data has a fixed length. Continue the replication process for each. On the other hand, when copying of the response data is completed (step S17: YES), the CPU 11 determines whether or not the abnormality detection flag is on (step S18). If it is determined that the abnormality detection flag is not on (step S18: NO), the CPU 11 outputs the response data copied to the communication buffer to the external terminal 2 via the I / O circuit 14 (step S19). ). On the other hand, when it is determined that the abnormality detection flag is on (step S18: YES), the operation is stopped (step S20). That is, in the data duplication control method 2, the CPU 11 checks the abnormality detection flag after all duplication processing is completed, and when it is off, continues the processing and outputs response data, and is on. Suspends the subsequent processing to disable output of the response data copied to the communication buffer to the external terminal 2. In step S20, the CPU 11 may respond an error to the external terminal 2. Further, in step S20, the CPU 11 may be configured to output dummy data (fixed value or random number) different from the response data to the outside (for example, an attacker's external terminal) as in step S7.

以上説明したように、上記データ複製制御方法2によれば、CPU11は、レスポンスデータを所定サイズ毎に通信用バッファに複製する複製処理を行い、所定サイズの複製毎に複製元のアドレスが正当であるかを判定し、当該複製処理の途中で複製元のアドレスが正当でないと判定した場合、当該複製処理を継続して複製完了した後に以降の処理を中断することで通信用バッファに複製されたレスポンスデータの外部端末2への出力を不能にするように構成したので、外部からの攻撃が複数回繰り返し行われる場合であっても、内部の秘匿したいデータが外部へ出力されることを防止することができる。更に、上記データ複製制御方法2によれば、複製処理の途中で複製元のアドレスが正当でないと判定された場合であっても当該複製処理を継続して複製完了した後に以降の処理を中断するように構成したので、どのタイミングで異常が検知されたかを攻撃者に観測(把握)させないようにすることができる。つまり、図4(B)に示すように、所定サイズ毎の複製が、1回目から4回目まであったと仮定した場合において、複製2回目で攻撃があったとすると、その攻撃タイミングでは複製が中断されず、複製4回目まで完了した後に動作停止するので、攻撃者は攻撃タイミングが間違っていないかどうかを判断することができない。   As described above, according to the data duplication control method 2, the CPU 11 performs duplication processing for duplicating the response data to the communication buffer for each predetermined size, and the duplication source address is valid for each duplication of the predetermined size. If the copy source address is determined to be invalid during the replication process, the replication process is continued and the replication is completed. Since it is configured to disable output of response data to the external terminal 2, even if an attack from the outside is repeatedly performed a plurality of times, it is possible to prevent the data to be kept secret from being output to the outside. be able to. Furthermore, according to the data replication control method 2, even if it is determined that the replication source address is not valid during the replication process, the replication process is continued and the subsequent process is interrupted after the replication is completed. With this configuration, it is possible to prevent an attacker from observing (ascertaining) at which timing an abnormality has been detected. In other words, as shown in FIG. 4B, assuming that there is an attack from the first time to the fourth time, and if there is an attack at the second time, the duplication is interrupted at the attack timing. Since the operation stops after completing the fourth replication, the attacker cannot determine whether the attack timing is correct.

1 ICカード
1a ICチップ
11 CPU
12 RAM
13 フラッシュメモリ
14 I/O回路
1 IC card 1a IC chip 11 CPU
12 RAM
13 Flash memory 14 I / O circuit

Claims (9)

外部端末から受信したコマンドに対応した所定の処理を実行するコントローラと、当該処理の結果に基づいて前記外部端末へ出力するためのレスポンスデータを記憶するメモリとを備え、前記レスポンスデータを前記メモリから通信用バッファに複製した後、当該通信用バッファに複製された前記レスポンスデータを前記外部端末へ出力するICカードにおいて、
前記メモリの所定のアドレスに記憶された前記レスポンスデータを所定サイズ毎に前記通信用バッファに複製するデータ複製手段と、
前記所定サイズの複製毎に複製元の前記アドレスが正当であるかを判定する判定手段と、
前記判定手段により前記複製元の前記アドレスが正当でないと判定された場合、前記レスポンスデータの複製を中断する制御手段と、
を備えることを特徴とするICカード。
A controller that executes a predetermined process corresponding to a command received from an external terminal; and a memory that stores response data to be output to the external terminal based on a result of the process; After copying to the communication buffer, in the IC card that outputs the response data copied to the communication buffer to the external terminal,
Data replication means for replicating the response data stored at a predetermined address of the memory to the communication buffer for each predetermined size;
Determining means for determining whether the address of the copy source is valid for each copy of the predetermined size;
Control means for interrupting replication of the response data when the determination means determines that the address of the copy source is not valid;
An IC card comprising:
外部端末から受信したコマンドに対応した所定の処理を実行するコントローラと、当該処理の結果に基づいて前記外部端末へ出力するためのレスポンスデータを記憶するメモリとを備え、前記レスポンスデータを前記メモリから通信用バッファに複製した後、当該通信用バッファに複製された前記レスポンスデータを前記外部端末へ出力するICカードにおいて、
前記メモリの所定のアドレスに記憶された前記レスポンスデータを所定サイズ毎に前記通信用バッファに複製するデータ複製手段と、
前記所定サイズの複製毎に複製元の前記アドレスが正当であるかを判定する判定手段と、
前記データ複製手段により前記レスポンスデータの複製が完了した場合に、当該通信用バッファに複製された前記レスポンスデータを前記外部端末へ出力する制御手段と、
を備え、
前記制御手段は、前記判定手段により前記複製元の前記アドレスが正当でないと判定された場合にも、前記レスポンスデータの前記所定サイズ毎の複製を継続させ、前記通信用バッファに複製された当該レスポンスデータの前記外部端末への出力を不能にすることを特徴とするICカード。
A controller that executes a predetermined process corresponding to a command received from an external terminal; and a memory that stores response data to be output to the external terminal based on a result of the process; After copying to the communication buffer, in the IC card that outputs the response data copied to the communication buffer to the external terminal,
Data replication means for replicating the response data stored at a predetermined address of the memory to the communication buffer for each predetermined size;
Determining means for determining whether the address of the copy source is valid for each copy of the predetermined size;
Control means for outputting the response data copied to the communication buffer to the external terminal when the response data is copied by the data copying means;
With
The control means continues the replication of the response data for each predetermined size even when the determination means determines that the address of the copy source is not valid, and the response copied to the communication buffer. An IC card that disables output of data to the external terminal.
請求項1または2に記載のICカードにおいて、
前記レスポンスデータの複製開始前に前記アドレスを示す値を前記メモリに複製するアドレス複製手段を更に備え、
前記判定手段は、前記レスポンスデータの複製元のアドレスを示す値と、前記メモリに複製されたアドレスを示す値とが一致しているかを判定し、一致していない場合、当該アドレスが正当でないと判定することを特徴とするICカード。
In the IC card according to claim 1 or 2,
Further comprising address duplicating means for duplicating the value indicating the address in the memory before starting the duplication of the response data;
The determination means determines whether a value indicating the address from which the response data is copied matches a value indicating the address copied to the memory, and if not, the address is not valid. An IC card characterized by determining.
請求項1または2に記載のICカードにおいて、
前記レスポンスデータの複製開始前に前記アドレスを示す値の反転値を前記メモリに複製するアドレス複製手段を更に備え、
前記判定手段は、前記レスポンスデータの複製元のアドレスを示す値と、前記メモリに複製された前記反転値との整合性が取れているか確認し、整合性が取れていない場合、当該アドレスが正当でないと判定することを特徴とするICカード。
In the IC card according to claim 1 or 2,
An address duplicating unit for duplicating the inverted value of the value indicating the address in the memory before starting the duplication of the response data;
The determination unit confirms whether the value indicating the source address of the response data is consistent with the inverted value copied to the memory. If the consistency is not satisfied, the address is valid. IC card characterized by not being determined.
請求項1乃至4の何れか一項に記載のICカードにおいて、
前記制御手段は、前記判定手段により前記複製元の前記アドレスが正当でないと判定された場合、前記レスポンスデータとは異なるダミーデータを前記外部端末へ出力することを特徴とするICカード。
The IC card according to any one of claims 1 to 4,
The IC card, wherein the control unit outputs dummy data different from the response data to the external terminal when the determination unit determines that the address of the copy source is not valid.
外部端末から受信したコマンドに対応した所定の処理を実行するコントローラと、当該処理の結果に基づいて前記外部端末へ出力するためのレスポンスデータを記憶するメモリとを備え、前記レスポンスデータを前記メモリから通信用バッファに複製した後、当該通信用バッファに複製された前記レスポンスデータを前記外部端末へ出力するICカードの前記コントローラにより行われるデータ複製制御方法であって、
前記メモリの所定のアドレスに記憶された前記レスポンスデータを所定サイズ毎に前記通信用バッファに複製するステップと、
前記所定サイズの複製毎に複製元の前記アドレスが正当であるかを判定するステップと、
前記複製元の前記アドレスが正当でないと判定された場合、前記レスポンスデータの複製を中断するステップと、
を含むことを特徴とするデータ複製制御方法。
A controller that executes a predetermined process corresponding to a command received from an external terminal; and a memory that stores response data to be output to the external terminal based on a result of the process; A data replication control method performed by the controller of the IC card that outputs the response data replicated in the communication buffer to the external terminal after being replicated in the communication buffer,
Replicating the response data stored in a predetermined address of the memory to the communication buffer for each predetermined size;
Determining whether the address of the copy source is valid for each copy of the predetermined size;
If it is determined that the address of the replication source is not valid, the step of interrupting the replication of the response data;
A data duplication control method comprising:
外部端末から受信したコマンドに対応した所定の処理を実行するコントローラと、当該処理の結果に基づいて前記外部端末へ出力するためのレスポンスデータを記憶するメモリとを備え、前記レスポンスデータを前記メモリから通信用バッファに複製した後、当該通信用バッファに複製された前記レスポンスデータを前記外部端末へ出力するICカードにおける前記コントローラを、
前記メモリの所定のアドレスに記憶された前記レスポンスデータを所定サイズ毎に前記通信用バッファに複製するデータ複製手段、
前記所定サイズの複製毎に複製元の前記アドレスが正当であるかを判定する判定手段、及び、
前記判定手段により前記複製元の前記アドレスが正当でないと判定された場合、前記レスポンスデータの複製を中断する制御手段として機能させることを特徴とするデータ複製制御プログラム。
A controller that executes a predetermined process corresponding to a command received from an external terminal; and a memory that stores response data to be output to the external terminal based on a result of the process; After copying to the communication buffer, the controller in the IC card that outputs the response data copied to the communication buffer to the external terminal,
Data replication means for replicating the response data stored at a predetermined address of the memory to the communication buffer for each predetermined size;
A determination means for determining whether the address of the copy source is valid for each copy of the predetermined size; and
A data replication control program that functions as a control unit that interrupts replication of the response data when the determination unit determines that the address of the replication source is not valid.
外部端末から受信したコマンドに対応した所定の処理を実行するコントローラと、当該処理の結果に基づいて前記外部端末へ出力するためのレスポンスデータを記憶するメモリとを備え、前記レスポンスデータを前記メモリから通信用バッファに複製した後、当該通信用バッファに複製された前記レスポンスデータを前記外部端末へ出力するICカードの前記コントローラにより行われるデータ複製制御方法であって、
前記メモリの所定のアドレスに記憶された前記レスポンスデータを所定サイズ毎に前記通信用バッファに複製するステップと、
前記所定サイズの複製毎に複製元の前記アドレスが正当であるかを判定するステップと、
前記レスポンスデータの複製が完了した場合に、当該通信用バッファに複製された前記レスポンスデータを前記外部端末へ出力するステップと、
を含み、
前記データ複製制御方法は、前記複製元の前記アドレスが正当でないと判定された場合にも、前記レスポンスデータの前記所定サイズ毎の複製を継続させ、前記通信用バッファに複製された当該レスポンスデータの前記外部端末への出力を不能にすることを特徴とするデータ複製制御方法。
A controller that executes a predetermined process corresponding to a command received from an external terminal; and a memory that stores response data to be output to the external terminal based on a result of the process; A data replication control method performed by the controller of the IC card that outputs the response data replicated in the communication buffer to the external terminal after being replicated in the communication buffer,
Replicating the response data stored in a predetermined address of the memory to the communication buffer for each predetermined size;
Determining whether the address of the copy source is valid for each copy of the predetermined size;
When copying of the response data is completed, outputting the response data copied to the communication buffer to the external terminal;
Including
The data replication control method continues the replication of the response data for each predetermined size even when it is determined that the address of the replication source is not valid, and the response data copied to the communication buffer A data replication control method, wherein output to the external terminal is disabled.
外部端末から受信したコマンドに対応した所定の処理を実行するコントローラと、当該処理の結果に基づいて前記外部端末へ出力するためのレスポンスデータを記憶するメモリとを備え、前記レスポンスデータを前記メモリから通信用バッファに複製した後、当該通信用バッファに複製された前記レスポンスデータを前記外部端末へ出力するICカードにおける前記コントローラを、
前記メモリの所定のアドレスに記憶された前記レスポンスデータを所定サイズ毎に前記通信用バッファに複製するデータ複製手段、
前記所定サイズの複製毎に複製元の前記アドレスが正当であるかを判定する判定手段、及び、
前記データ複製手段により前記レスポンスデータの複製が完了した場合に、当該通信用バッファに複製された前記レスポンスデータを前記外部端末へ出力する制御手段として機能させ、
前記制御手段は、前記判定手段により前記複製元の前記アドレスが正当でないと判定された場合にも、前記レスポンスデータの前記所定サイズ毎の複製を継続させ、前記通信用バッファに複製された当該レスポンスデータの前記外部端末への出力を不能にすることを特徴とするデータ複製制御プログラム。
A controller that executes a predetermined process corresponding to a command received from an external terminal; and a memory that stores response data to be output to the external terminal based on a result of the process; After copying to the communication buffer, the controller in the IC card that outputs the response data copied to the communication buffer to the external terminal,
Data replication means for replicating the response data stored at a predetermined address of the memory to the communication buffer for each predetermined size;
A determination means for determining whether the address of the copy source is valid for each copy of the predetermined size; and
When replication of the response data is completed by the data replication unit, the response data copied to the communication buffer is made to function as a control unit that outputs to the external terminal,
The control means continues the replication of the response data for each predetermined size even when the determination means determines that the address of the copy source is not valid, and the response copied to the communication buffer. A data duplication control program that disables output of data to the external terminal.
JP2012281455A 2012-12-25 2012-12-25 IC card, data replication control method, and data replication control program Active JP6031997B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012281455A JP6031997B2 (en) 2012-12-25 2012-12-25 IC card, data replication control method, and data replication control program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012281455A JP6031997B2 (en) 2012-12-25 2012-12-25 IC card, data replication control method, and data replication control program

Publications (2)

Publication Number Publication Date
JP2014126935A true JP2014126935A (en) 2014-07-07
JP6031997B2 JP6031997B2 (en) 2016-11-24

Family

ID=51406403

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012281455A Active JP6031997B2 (en) 2012-12-25 2012-12-25 IC card, data replication control method, and data replication control program

Country Status (1)

Country Link
JP (1) JP6031997B2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0778126A (en) * 1993-09-08 1995-03-20 Kyodo Printing Co Ltd Microcomputer for ic card
JP2006172005A (en) * 2004-12-14 2006-06-29 Toshiba Corp Portable electronic instrument
JP2010033121A (en) * 2008-07-25 2010-02-12 Rohm Co Ltd Storage device
JP2011150495A (en) * 2010-01-21 2011-08-04 Rohm Co Ltd Storage device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0778126A (en) * 1993-09-08 1995-03-20 Kyodo Printing Co Ltd Microcomputer for ic card
JP2006172005A (en) * 2004-12-14 2006-06-29 Toshiba Corp Portable electronic instrument
JP2010033121A (en) * 2008-07-25 2010-02-12 Rohm Co Ltd Storage device
JP2011150495A (en) * 2010-01-21 2011-08-04 Rohm Co Ltd Storage device

Also Published As

Publication number Publication date
JP6031997B2 (en) 2016-11-24

Similar Documents

Publication Publication Date Title
JP6373888B2 (en) Information processing apparatus and control method
CN100489805C (en) Autonomous memory checker for runtime security assurance and method therefore
JP2007515708A (en) How to update data in a mobile device
US9262631B2 (en) Embedded device and control method thereof
US20080215955A1 (en) Semiconductor storage device
JP2009530697A (en) Auto-configurable smart card and smart card auto-configuration method
TW201928991A (en) Transparently attached flash memory security
US20080263422A1 (en) Control of the integrity of a memory external to a microprocessor
JP6622360B2 (en) Information processing device
JP6031997B2 (en) IC card, data replication control method, and data replication control program
CN115454517B (en) Method, system, storage medium, device and chip for multi-medium secure boot
KR20210134053A (en) How to Validate Over-the-Air Updates
JP2008542941A (en) ITSOVC2 application monitor
US9652232B2 (en) Data processing arrangement and method for data processing
US7916549B2 (en) Memory self-test circuit, semiconductor device and IC card including the same, and memory self-test method
JP2000322535A (en) Information processing method and system for ic card
JP2008204085A (en) Semiconductor memory
JP4899499B2 (en) IC card issuing method, IC card issuing system, and IC card
US20230274002A1 (en) Firmware authenticity check
JP7097407B2 (en) Systems and methods for prioritizing bit error correction trial and error
JP5949357B2 (en) Security token, data falsification detection method, and computer program
JP2010128510A (en) Biological information authentication system
JP5200686B2 (en) Information processing apparatus, normal processing determination method, and information processing program
EP2877957B1 (en) Method and device for protecting against fault attack(s) an electronic device using a cache memory
CN118051919A (en) Data processing method, chip, electronic device and storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20151029

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160620

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160705

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160829

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20161010

R150 Certificate of patent or registration of utility model

Ref document number: 6031997

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150