JP3657315B2 - Portable information recording medium and access method thereof - Google Patents

Portable information recording medium and access method thereof Download PDF

Info

Publication number
JP3657315B2
JP3657315B2 JP20285495A JP20285495A JP3657315B2 JP 3657315 B2 JP3657315 B2 JP 3657315B2 JP 20285495 A JP20285495 A JP 20285495A JP 20285495 A JP20285495 A JP 20285495A JP 3657315 B2 JP3657315 B2 JP 3657315B2
Authority
JP
Japan
Prior art keywords
command
cpu
batch
file
commands
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.)
Expired - Lifetime
Application number
JP20285495A
Other languages
Japanese (ja)
Other versions
JPH0935019A (en
Inventor
和義 入澤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP20285495A priority Critical patent/JP3657315B2/en
Publication of JPH0935019A publication Critical patent/JPH0935019A/en
Application granted granted Critical
Publication of JP3657315B2 publication Critical patent/JP3657315B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は携帯可能情報記録媒体およびそのアクセス方法、特に、CPUを内蔵したICカードに対して利用するのに適した新規なアクセス方法に関する。
【0002】
【従来の技術】
磁気カードに代わる次世代の携帯可能情報記録媒体として、ICカードが注目を集めている。最近では、半導体集積回路の小型化、低コスト化のための技術進歩により、実社会の種々のシステムにおいてICカードが実用されるに至っている。
【0003】
特に、CPUを内蔵したICカードでは、単なる情報記録媒体としての機能だけではなく、情報処理機能が付加されるため、高度なセキュリティを必要とする情報処理システムへの利用が期待されている。現在普及している一般的なICカードは、CPUと、このCPUによってアクセスされる3種類のメモリ、すなわち、ROM,RAM,EEPROMを有している。ROM内には、CPUによって直接実行可能なインストラクションコードからなるプログラムが記憶されており、CPUはこのプログラムに基いて、ICカードを統括制御する機能を有する。RAMは、CPUがこのような統括制御を行う上での作業領域として使用されるメモリである。一方、EEPROMは、CPUを介してデータの読出しおよび書き込みが可能な不揮発性メモリであり、このICカードに記録すべき本来のデータを格納するために用いられる。
【0004】
通常、EEPROMへのアクセスは、すべてCPUを介して行われ、外部からEEPROMを直接アクセスすることはできない。このため、EEPROM内に格納される個々のファイルごとに様々なアクセス権を設定することができ、高度なセキュリティを確保することが可能になる。ICカード内のEEPROMに対して、外部から何らかのアクセスを行いたい場合には、必ずCPUに対して、外部から所定のコマンドを与えるという方法をとることになる。たとえば、EEPROM内の所定のファイルへデータの書き込みを行う場合は、所定の書込コマンドとともに書込対象となるデータをCPUに与え、CPUによる書込コマンドの実行という形式で書込処理が行われることになる。また、EEPROM内の所定のファイルからデータの読出しを行う場合は、所定の読出コマンドをCPUに与え、CPUによる読出コマンドの実行という形式で読出処理が行われることになる。外部からICカードに対して所定のコマンドを与えると、このコマンドに対するレスポンスがICカードから外部に対して返送される。たとえば、書込コマンドを与えた場合には、書込処理が支障なく実行されたか否かを示すレスポンスが返送され、読出コマンドを与えた場合には、読出対象となったデータがレスポンスという形で返送されることになる。
【0005】
セキュリティ確保の上でアクセス権を設定した場合には、特定のコマンドの実行に特定のキーが要求されるようになる。このようなキーが要求されるコマンドを実行させるためには、その前に、キーの照合を行っておく必要がある。このようなキーの照合は、外部からICカードに対して、照合コマンドとともに所定のキーを与えることによって行われる。ICカード内部で、与えられたキーと、EEPROM内に記録されていたキーとが照合され、両者が一致していれば、特定のコマンドの実行が許可される。
【0006】
【発明が解決しようとする課題】
上述のように、CPUを内蔵した携帯可能情報記録媒体では、通常、外部から所定のコマンドを送信し、これに対するレスポンスの返送を受ける、という方法でアクセスが行われる。別言すれば、携帯可能情報記録媒体にどのようなアクセスを行わせる場合であっても、コマンド送信/レスポンス返送/コマンド送信/レスポンス返送/…という処理を繰り返し実行する必要がある。このようなコマンド送信およびレスポンス返送処理は、外部装置と携帯可能情報記録媒体との間に形成されたI/Oラインを介して行われるが、このI/Oラインを介したデータ転送速度は、媒体内部におけるCPU・メモリ間のデータ転送速度に比べて非常に遅くなる。このため、媒体内部のCPUの性能に比して、外部から媒体をアクセスする処理には非常に時間がかかることになる。このように、長い時間にわたって、I/Oライン上に大量のデータが流れるということは、セキュリティの観点からも好ましくない。すなわち、外部装置と媒体との間に形成されるI/Oラインは、外部から物理的にアクセスすることが容易であり、I/Oライン上を流れるデータは、外部から不正に観測される可能性が高く、長時間にわたってデータ転送を行うことは、セキュリティ確保の上から問題になる。また、I/Oラインを介したデータ転送を行う場合、本来転送すべきデータに、所定の伝送プロトコルに従った制御情報(いわゆるヘッダ、フッタ情報)を付加する必要があり、冗長性が高くなるという問題もある。このように、I/Oラインを介したコマンド送信/レスポンス返送という手順による媒体のアクセスは、必ずしも効率的なものにはなっていない。
【0007】
このような問題に対する解決法として、媒体に対するアクセス内容に応じて、その都度、インストラクションコードからなるプログラムを書き、このプログラムをバイナリデータとしてEEPROM内にファイルとして書き込み、媒体内のCPUには、このEEPROM内のインストラクションコードを直接実行させるというアクセス方法も提案されている。この方法によれば、I/Oラインを介したデータ転送は、プログラムをバイナリデータとして転送するだけの短時間ですむ。以後は、CPUはEEPROM内のプログラムを実行すればよいので媒体内だけの処理ですみ、非常に高速な処理が可能になる。しかしながら、この方法は、セキュリティの点で大きな問題がある。すなわち、CPUの制御は、ROM内に用意された通常のルーチンの支配を離れ、EEPROM内に転送されたインストラクションコードのルーチンによって完全に支配されることになる。このため、不正利用者が、不正なプログラムをインストラクションコードで記述してこの方法を利用すれば、CPUはこの不正なプログラムを忠実に実行してしまうことになる。
【0008】
そこで本発明は、十分なセキュリティを確保しつつ、外部からのアクセスを効率的に行うことができる携帯可能情報記録媒体およびそのアクセス方法を提供することを目的とする。
【0009】
【課題を解決するための手段】
(1) 本発明の第1の態様は、CPUと、このCPUによって直接実行可能なインストラクションコードからなるプログラムを記憶したROMと、CPUの作業領域として使用されるRAMと、CPUを介してデータの読出しおよび書き込みが可能な不揮発性メモリと、を備え、外部から与えられたコマンドに基いて、CPUがROM内の所定のプログラムを実行し、その結果をレスポンスとして外部へ返送する機能を有する携帯可能情報記録媒体において、
外部から「複数のコマンドを羅列してなるバッチファイル」を書込対象データとする書込コマンドが与えられたときに、このバッチファイルを不揮発性メモリに書き込む処理を実行し、実行結果を書込コマンドに対するレスポンスとして外部へ返送する処理と、
外部から所定のバッチ処理実行コマンドが与えられたときに、不揮発性メモリに書き込まれたバッチファイルに含まれている複数のコマンドを、外部から与えられたコマンドと解釈して順次実行する処理を行い、バッチファイル内のすべてのコマンドの処理が完了した時点で、これらのコマンドに対する必要なレスポンスを一括して、バッチ処理実行コマンドに対するレスポンスとして外部へ返送する処理と、
を行う機能を設けたものである。
【0010】
(2) 本発明の第2の態様は、上述の第1の態様に係る携帯可能情報記録媒体において、
バッチファイル内の各コマンドの実行によって生じるレスポンスを、RAM内に一時蓄積しておき、バッチファイル内の全コマンドの実行が終了した後、RAM内に蓄積されているレスポンスをバッチ処理実行コマンドに対するレスポンスとして外部へ一括して送出するようにしたものである。
【0011】
(3) 本発明の第3の態様は、上述の第1または第2の態様に係る携帯可能情報記録媒体をアクセスする方法において、
携帯可能情報記録媒体に対して与える複数のコマンドを羅列してなるバッチファイルを用意し、
携帯可能情報記録媒体に対して、所定の書込コマンドとともに用意したバッチファイルを与え、このバッチファイルを不揮発性メモリ内に書き込み、その結果を書込コマンドに対するレスポンスとして外部へ返送させ、
携帯可能情報記録媒体に対して、所定のバッチ処理実行コマンドを与えることにより、不揮発性メモリ内に書き込まれたバッチファイル内の各コマンドを、外部から与えられたコマンドと解釈して実行させ、バッチファイル内のすべてのコマンドの処理が完了した時点で、これらのコマンドに対する必要なレスポンスを一括して、バッチ処理実行コマンドに対するレスポンスとして外部へ返送させるようにしたものである。
【0012】
(4) 本発明の第4の態様は、上述の第3の態様に係る携帯可能情報記録媒体のアクセス方法において、
バッチファイル内の各コマンドの実行によって生じるレスポンスを、RAM内に一時蓄積しておき、バッチファイル内の全コマンドの実行が終了した後、RAM内に蓄積されているレスポンスをバッチ処理実行コマンドに対するレスポンスとして外部へ一括して送出させるようにしたものである。
【0013】
【発明の実施の形態】
本発明に係る携帯可能情報記録媒体には、不揮発性メモリ内に書き込まれたデータを、外部から与えられたコマンドと解釈して実行するバッチ処理実行機能が備わっている。したがって、複数のコマンドを羅列してなるバッチファイルを用意し、このバッチファイルを外部から媒体に書込コマンドとともに与えて不揮発性メモリ内に書き込めば、このバッチ処理実行機能によって、バッチファイルを構成するコマンドを、外部から与えられたコマンドと解釈して実行させることが可能になる。すなわち、媒体内のCPUは、同じ媒体内の不揮発性メモリに格納されているバッチファイル内のコマンドを、あたかも外部から与えられたコマンドであるかのように取り扱い、これを実行することになる。
【0014】
この方法によれば、I/Oラインを介したデータ転送は、バッチファイルを媒体に転送するだけの短時間ですむ。以後、CPUはEEPROM内のコマンドを実行すればよいので媒体内だけの処理ですみ、非常に高速な処理が可能になる。また、バッチファイル内の個々のコマンドについては、所定の伝送プロトコルに従った制御情報(いわゆるヘッダ、フッタ情報)は不要であり、冗長性も低減させることができる。しかも、CPUが実行するのは、あくまでもコマンドであり、インストラクションコードそのものではない。したがって、I/Oラインを介したコマンド送信/レスポンス返送という手順によるアクセスと同じセキュリティを維持させることができる。
【0015】
このように本発明によれば、十分なセキュリティを確保しつつ、外部からのアクセスを効率的に行うことができるようになる。
【0016】
【実施例】
以下、本発明を図示する実施例に基いて説明する。
【0017】
§1. ICカードの一般的なアクセス方法
はじめに、現在普及しているICカードに対する一般的なアクセス方法を説明する。図1は、一般的なICカード10に、外部装置としてのリーダライタ装置20を接続し、アクセスを行っている状態を示すブロック図である。ICカード10とリーダライタ装置20とはI/Oライン30によって相互に接続されている。ここで、ICカード10には、I/Oインタフェース11、CPU12、ROM13、RAM14、EEPROM15が内蔵されている。I/Oインタフェース11は、I/Oライン30を介してデータを送受するための入出力回路であり、CPU12はこのI/Oインタフェース11を介して、リーダライタ装置20と交信することになる。ROM13内には、CPU12によって直接実行可能なインストラクションコードからなるプログラムが記憶されており、CPU12はこのプログラムに基いて、ICカード10を統括制御する機能を有する。RAM14は、CPU12がこのような統括制御を行う上での作業領域として使用されるメモリである。一方、EEPROM15は、このICカード10に記録すべき本来のデータを格納するメモリである。
【0018】
通常、ICカード10に対しては、外部のリーダライタ装置20から電源やクロックが供給される。したがって、ICカード10がリーダライタ装置20と切り離されると、ICカード10への電源およびクロックの供給は停止する。しかしながら、EEPROM15は不揮発性メモリであるため、電源供給が停止した後もその記録内容はそのまま保持される。ただ、RAM14内のデータは、電源供給の停止によりすべて失われる。
【0019】
ICカード10内の各メモリ13,14,15へのアクセスは、すべてCPU12を介して行われ、外部からこれらメモリを直接アクセスすることはできない。すなわち、リーダライタ装置20からCPU12に対して所定の「コマンド」を与えると、CPU12はこの「コマンド」を解釈実行し、その結果を、リーダライタ装置20に対して「レスポンス」として返送することになる。たとえば、EEPROM15内の所定のファイルに書き込みを行う場合には、「書込コマンド」とともに書込対象となるデータをCPU12に与え、CPU12による「書込コマンド」の実行という形式で書込処理が行われることになる。逆に、EEPROM15内の所定のファイルからデータの読出しを行う場合は、所定の「読出コマンド」をCPU12に与え、CPU12による「読出コマンド」の実行という形式で読出処理が行われることになる。このように、ICカード10内において「コマンド」の実行が終了すると、実行した「コマンド」に対する「レスポンス」が外部に対して返送される。たとえば、「書込コマンド」を与えた場合には、書込処理が支障なく実行されたか否かを示す「レスポンス」返送され、「読出コマンド」を与えた場合には、読出対象となったデータがレスポンスという形で返送されることになる。
【0020】
通常、EEPROM15内へは、ファイル単位でデータが格納され、個々のファイルごとにそれぞれアクセス権が設定される。この場合、特定のファイルに対して特定の「コマンド」を実行する場合には、所定のキーの入力が要求される。したがって、「書込コマンド」や「読出コマンド」を実行する前に、所定の「照合コマンド」を実行してキー照合を行わなければならない。このため、EEPROM15内に格納されたデータに対して、高度なセキュリティを確保することが可能になる。
【0021】
図2は、このような一般的なアクセス方法を説明するブロック図である。ICカード10に対するアクセスを行う場合、まず、リーダライタ装置20からI/Oライン30を介してCPU12へ、送信データ31を転送する。この送信データ31は、CPU12に与えるべき本来の「コマンド」の前後に、「ヘッダ」および「フッタ」を付加したものである。この「ヘッダ」および「フッタ」は、I/Oライン30を介した伝送を行う上での所定の伝送プロトコルに従った制御情報である。こうして「コマンド」が転送されてくると、CPU12はこれを解釈して実行し、「レスポンス」を発生させる。この「レスポンス」は、返送データ32としてリーダライタ装置20へと返送される。この返送データ32は、「レスポンス」の前後に、「ヘッダ」および「フッタ」を付加したものである。
【0022】
CPU12に「コマンド」を実行させるために、ROM13内には、個々の「コマンド」ごとにプログラムルーチンが用意されている。たとえば、「書込コマンド」、「読出コマンド」、「照合コマンド」のそれぞれに対応して、ROM13内には、「書込処理ルーチン」、「読出処理ルーチン」、「照合処理ルーチン」が用意されている。実際には、この他にもいくつかの「コマンド」が定義されており、定義された「コマンド」には、それぞれ固有のサブルーチンがROM13内に用意されていることになる。このROM13内のサブルーチンは、CPU12が直接実行可能なインストラクションコード、すなわち、いわゆる「機械語」で記述されたプログラムである。CPU12は、I/Oライン30を介して「コマンド」を受信すると、まず、ROM13内の「共通コマンド処理ルーチン」を実行して受信した「コマンド」を解釈し、その「コマンド」に応じたサブルーチンを選択する。そして、個々の「コマンド」に応じたサブルーチンの先頭のインストラクションコードへのジャンプが起こり、所定の処理が実行される。この処理が完了すると、再び「共通コマンド処理ルーチン」へと戻り、所定の「レスポンス」を返送する処理が行われる。以上が、CPU12に対して1つの「コマンド」が与えられたときの全体の処理の流れである。
【0023】
このように、ICカードに対する一般的なアクセスは、コマンド送信/レスポンス返送/コマンド送信/レスポンス返送/…という処理を繰り返すことによって行われる。このため、▲1▼アクセスに長時間かかる、▲2▼伝送中のセキュリティが低下する、▲3▼冗長性が高くなる、といった問題が生じることは既に述べたとおりである。すなわち、I/Oライン30を介しての「コマンド」および「レスポンス」の転送速度は、CPU12の演算処理速度に比べて非常に遅く、▲1▼アクセスに時間がかかる、という問題が生じることになる。また、I/Oライン30上を流れるデータは、外部から不正に観測される可能性が高く、長時間にわたってデータ転送を行うと、▲2▼伝送中のセキュリティが低下する、という問題が生じることになる。更に、I/Oライン30を介した伝送には、所定の伝送プロトコルに従った「ヘッダ」および「フッタ」といった制御情報を付加する必要性が出てくるので、▲3▼冗長性が高くなる、といった問題も生じる。このように、I/Oライン30を介したコマンド送信/レスポンス返送という手順によるICカード10のアクセスは、必ずしも効率的なものにはなっていない。
【0024】
§2. インストラクションコードを用いたアクセス方法
このような問題に対する解決法として、インストラクションコードを用いたアクセス方法も従来から提案されている。この方法を、図3および図4のブロック図を参照して説明しよう。まず、ICカード10に対するアクセス内容に応じて、その都度、インストラクションコードからなるプログラムを用意する。前述のように、このインストラクションコードは、CPU12が直接実行可能な、いわゆる「機械語」で記述されたプログラムである。もっとも、通常は、高級言語で記述したソースプログラムをコンパイルすることによって、このインストラクションコードからなるプログラムを用意することになる。
【0025】
続いて、この用意したインストラクションコードからなるプログラムを、バイナリデータとしてEEPROM15内に書き込む処理を行う。図3は、この書込処理を示している。図示の例では、送信データ31として、「WRITE BINARY」なる「書込コマンド」をCPU12に送信している。ここで、「書込コマンド」は、「書込コマンドコード」と「書込対象となるデータ」とによって構成されており、「書込対象となるデータ」の部分に、用意したインストラクションコードからなるプログラムを入れている。このプログラムは、バイナリデータとして取り扱われるため、結局、図4に示すように、EEPROM15内の所定のファイル内に、このインストラクションコードからなるプログラムがそのまま書き込まれることになる。
【0026】
次に、図4に示すように、送信データ31として、「GO PROG」なる「プログラム実行コマンド」をCPU12に送信する。この「プログラム実行コマンド」は、ここで述べるインストラクションコードを用いたアクセス方法を行うために特別に定義されたコマンドであり、EEPROM15内に書き込まれたインストラクションコード群をそのまま実行すべきことを指示するコマンドである。このようなコマンドを実行させるためには、ROM13内に、この「プログラム実行コマンド」に対応したサブルーチンを用意しておく必要があるが、そのサブルーチンは非常に単純である。すなわち、EEPROM15内に書き込まれたインストラクションコードの先頭アドレスへのジャンプ命令によって構成しておけばよい。
【0027】
こうして、「プログラム実行コマンド」が実行されると、CPU12は、EEPROM15内に書き込まれたインストラクションコードを直接実行することになる。このようなアクセス方法によれば、I/Oライン30を介したデータ転送は、プログラムをバイナリデータとして転送するだけの短時間ですむ。以後、CPU12はEEPROM15内のプログラムを実行すればよいので、ICカード10内部の処理だけですみ、非常に高速な処理が可能になり、§1で述べた一般的なアクセス方法に比べて、非常に効率的なアクセスが可能になる。
【0028】
しかしながら、このアクセス方法は、既に述べたように、セキュリティの点で大きな問題がある。「プログラム実行コマンド」が実行された後は、CPU12の制御は、EEPROM15内に書き込んだインストラクションコードによって完全に支配されてしまうことになる。このため、不正利用者が、不正なプログラムをインストラクションコードで記述してこの方法を利用すれば、CPUはこの不正なプログラムを忠実に実行してしまうことになる。すなわち、「コマンド」の形式で与えられた命令をCPU12が実行する限りは、ROM13内に用意した正規のセキュリティチェックが機能するが、「インストラクションコード」の形式で与えられた原始的な命令をCPU12が実行する場合には、もはやこのようなセキュリティチェックは機能しなくなってしまうのである。
【0029】
§3. 本発明に係るアクセス方法
以上のように、§1で述べた一般的なアクセス方法にも、§2で述べたインストラクションコードを用いたアクセス方法にも、それぞれ一長一短がある。本発明は、これらの方法の問題点を解決した新規なアクセス方法を提案するものである。以下、この方法を図5および図6のブロック図を参照して説明する。
【0030】
まず、ICカード10に対するアクセス内容に応じて、その都度、コマンドの羅列からなるバッチファイルを用意する。すなわち、§1で述べた一般的なアクセス方法において、送信データ31として送信していた「コマンド」を、いくつか並べることによりバッチファイルを作成するのである。ただし、伝送プロトコルに基いて付加していた「ヘッダ」および「フッタ」は、ここでは必要なく、用意するバッチファイルとしては、「コマンド」の部分だけを羅列したものでよい。
【0031】
続いて、この用意したバッチファイルを、EEPROM15内に書き込む処理を行う。図5は、この書込処理を示している。図示の例では、送信データ31として、「WRITE BINARY」なる「書込コマンド」をCPU12に送信している。ここで、「書込コマンド」は、「書込コマンドコード」と「書込対象となるデータ」とによって構成されており、「書込対象となるデータ」の部分に、用意したバッチファイルを入れている。このバッチファイルは、多数の「コマンド」から構成されているが、ここでは、「コマンド」としてではなく単なるデータとして取り扱われるため、結局、図6に示すように、EEPROM15内に、このバッチファイルがそのまま書き込まれることになる。
【0032】
次に、図6に示すように、送信データ31として、「BATCH」なる「バッチ処理実行コマンド」をCPU12に送信する。この「バッチ処理実行コマンド」は、本発明に係るアクセス方法を行うために特別に定義されたコマンドであり、EEPROM15内に書き込まれたバッチファイル内の「コマンド」を、I/Oライン30を介して外部から与えられた「コマンド」と解釈して実行する処理を行わせるためのコマンドである。このようなコマンドを実行させるためには、ROM13内に、この「バッチ処理実行コマンド」に対応したサブルーチンを用意しておく必要があるが、そのサブルーチンは比較的簡単に追加できる。なぜなら、既に述べたように、ROM13内には、I/Oライン30を介して外部から与えられた「コマンド」を解釈して実行させる「共通コマンド処理ルーチン」が既に用意されているので、この「共通コマンド処理ルーチン」において、外部から与えられた「コマンド」の代わりに、バッチファイル内の「コマンド」を解釈実行するように変更を加えるようにすれば、「バッチ処理実行コマンド」に対応したルーチンを容易に作成することができる。
【0033】
具体的には、この「バッチ処理実行コマンド」を実行中には、バッファポインタBPによって、EEPROM15に格納されているバッチファイル内の「コマンド」を指し示すようにすればよい。この基本概念を、図7を参照して説明しよう。§1で述べた一般的なアクセス方法では、I/Oライン30を介して与えられた「コマンド」は、図7(a) に示すように、RAM14内のバッファに一時的に格納され、バッファポインタBPによって、このバッファ内の「コマンド」の先頭位置が指し示される。CPU12は、このバッファポインタBPを順次移動させながら、この「コマンド」を解釈実行する。すなわち、与えられた「コマンド」に応じたサブルーチンを実行した後、所定の「コマンド」を生成して返送する処理を行うことになる。これに対し、本発明に係るアクセス方法では、「バッチ処理実行コマンド」が与えられると、図7(b) に示すように、EEPROM15内のバッチファイルの先頭位置がバッファポインタBPによって指し示される。そして、このバッファポインタBPを順次移動させながら、この「コマンド」を解釈実行することになる。
【0034】
このように、バッファポインタBPが指し示すメモリ領域は、一方はRAM14内のバッファ領域であり、他方はEEPROM15内のバッチファイル格納領域である点において異なるものの、「コマンド」の実質的な解釈実行処理に関しては、§1で述べた一般的なアクセス方法と本発明によるアクセス方法との間に本質的な差はない。
【0035】
もっとも、「レスポンス」の返送方法に関しては、若干の相違がある。すなわち、I/Oライン30を介して与えられ、RAM14内のバッファに格納された「コマンド」を実行した場合には、この「コマンド」に対する「レスポンス」が直ちに返送されることになるが、EEPROM15内のバッチファイルに格納された「コマンド」を実行した場合には、個々の「コマンド」に対する「レスポンス」は、RAM14内に一時的に蓄積され、バッチファイル内のすべての「コマンド」の処理が完了した時点で、RAM14内に蓄積されていた「レスポンス」を一括して返送することになる。したがって、リーダライタ装置20側から見れば、「BATCH」なる「バッチ処理実行コマンド」をCPU12に送信すると、この「バッチ処理実行コマンド」に対する「レスポンス」として、バッチファイル内の個々の「コマンド」についての「レスポンス」が一括して得られることになる。
【0036】
§1で述べた一般的なアクセス方法では、常に、コマンド送信/レスポンス返送という手順の繰り返しにより、CPU12に所定のコマンドを順次実行させていたが、本発明に係るアクセス方法では、まず、複数の「コマンド」を羅列して記述したバッチファイルを用意し、このバッチファイルをEEPROM15内に書き込んだ後、「バッチ処理実行コマンド」をCPU12に与えればよい。CPU12は、バッチファイル内の個々の「コマンド」を、I/Oライン30を介して外部から与えられた「コマンド」と解釈して順次実行するので、一般的なアクセス方法と同様の処理をCPU12に実行させることができる。この方法によれば、I/Oライン30を介したデータ転送は、バッチファイルをバイナリデータとして転送するだけの短時間ですむ。以後、CPU12はEEPROM15内の「コマンド」を実行すればよいので、ICカード10内部の処理だけですみ、非常に高速な処理が可能になる。また、I/Oライン30を介したデータ転送時間は比較的短くなるため、I/Oライン30を介してデータが外部に不正流出する可能性も低減する。更に、バッチファイル内の個々の「コマンド」には、「ヘッダ」および「フッタ」といった伝送プロトコルに応じた制御情報を付加する必要はないため(このバッチファイルをI/Oライン30を介して転送するときの「書込コマンド」には、「ヘッダ」および「フッタ」を付加する必要はあるが、バッチファイルを構成する個々の「コマンド」のそれぞれに「ヘッダ」および「フッタ」を付加する必要はない)、冗長性も低下することになる。
【0037】
また、この方法は、§2で述べたインストラクションコードを用いたアクセス方法とは異なり、セキュリティの問題も生じない。図4(§2の方法の説明図)と図6(§3の方法の説明図)とを比較すると、両者は、「CPU12がEEPROM15内に書き込まれた命令を実行する」という点で共通するが、前者の命令はインストラクションコード、すなわちCPU12が直接実行可能な「機械語」レベルの命令であるのに対し、後者の命令はI/Oライン30を介して与えられる「コマンド」レベルの命令である点で大きく異なる。すなわち、本発明に係るアクセス方法では、CPU12の実行対象は、あくまでも「コマンド」であり、CPU12が直接実行するインストラクションコードは、ROM13内に用意されたインストラクションコードである。したがって、ROM13内に用意された正規のセキュリティチェックが十分に機能し、インストラクションコードのレベルでの不正アクセスが行われることはない。
【0038】
§4. アクセスの具体例
次に、本発明に係るアクセス方法を具体的な例に基いて説明する。ここでは、図8に示すように、EEPROM15内に存在する6つのファイルに関連したアクセス処理を例にとった説明を行うことにする。これら6つのファイルには、それぞれ固有のファイルID(この例では、16進数による2バイトコード)、すなわち、「2F10」,「2F11」,「2F12」,「2F13」,「2F14」,「2F15」が付与されている。ここで、ファイル「2F10」は、このICカードの所有者であるユーザに関する何らかのユーザデータを格納したデータファイルであり、他の5つのファイルは、このデータファイル「2F10」からユーザデータを読み出すために必要なキーが格納されたキーファイルであるとする。たとえば、第1のキーファイル「2F11」には、第1のキー「1111」が格納されている。データファイル「2F10」からユーザデータを読み出すには、CPU12に対してこのデータファイルを選択する「選択コマンド」を与えた後に「読出コマンド」を与えればよいが、その前に、5つのキーについての照合が完了していなければ、この「読出コマンド」は実行されずに拒絶される。したがって、データファイル「2F10」に対するアクセスを行うためには、「照合コマンド」を繰り返し実行し、5つのキーすべてについての照合を行っておく必要がある。
【0039】
ここでは、まず、§1において述べた一般的なアクセス方法によって、データファイル「2F10」内のユーザデータを読み出すための方法を説明しよう。この場合は、図9に示すような12種類の「コマンド」が必要になる。これら12種類の「コマンド」は、1つずつ、リーダライタ装置20からI/Oライン30を介してCPU12へ送信される。1つの「コマンド」の実行が完了すると、これに対する「レスポンス」がCPU12からI/Oライン30を介してリーダライタ装置20へと返送される。リーダライタ装置20は、この「レスポンス」が返送された後に、次の「コマンド」を送信することになる。こうして、I/Oライン30を介して、「コマンド」と「レスポンス」の往復転送を12回繰り返すと、データファイル「2F10」内のユーザデータがリーダライタ装置20側に読み出されることになる。
【0040】
この図9に示す12種類の「コマンド」を1ステップずつ簡単に説明しておくと、まず、ステップ1の「SELECT FILE 2F11」なる「選択コマンド」は、第1のキーファイル「2F11」を選択するためのコマンドである。CPU12は、このキーファイル「2F11」を選択する処理を行った後、正しく選択が行われたことを示す「レスポンス」を返送する。続くステップ2の「VERIFY 1111」なる「照合コマンド」は、直前に選択されたキーファイル内のキーと、暗証コード「1111」とを比較照合するコマンドである。CPU12は、この照合を実行し、両者が一致しているか否かの結果を「レスポンス」として返送する。また、両者が一致していた場合には、RAM14内にこのキーについての解錠フラグを立てる。続く、ステップ3の「SELECT FILE 2F12」なる「選択コマンド」は、第2のキーファイル「2F12」を選択するためのコマンドであり、ステップ4の「VERIFY 2222」なる「照合コマンド」は、直前に選択されたキーファイル内のキーと、暗証コード「2222」とを比較照合するコマンドである。以下、同様に、ステップ5〜10までの「コマンド」により、5種類のすべてのキーについての照合が行われる。
【0041】
そして、ステップ11の「SELECT FILE 2F10」なる「選択コマンド」によって、目的とするデータファイル「2F10」が選択される。続く、ステップ12の「READ BINARY」なる「読出コマンド」が与えられると、CPU12は、RAM14内の解錠フラグを参照して、データファイル「2F10」に対して「読出コマンド」を実行するために設定されたアクセス権条件が満たされているか否かを判断する。この時点では、既に第1〜第5のすべてのキーについて照合一致が得られているので、CPU12は、この「読出コマンド」を実行することになる。これにより、「レスポンス」として、データファイル「2F10」内のユーザデータがバイナリデータの形でリーダライタ装置20側へ返送されることになる。
【0042】
このように、§1で述べた従来の一般的なアクセス方法によって、データファイル「2F10」に対する読出処理を実行するには、I/Oライン30を介して、図9に示すような12種類の「コマンド」を1つずつ送信し、「レスポンス」の返信を待って次の「コマンド」を送信する、という操作を行わねばならない。このような操作は、CPU12の演算処理速度に比べて非常に遅いことは既に述べたとおりであり、この「コマンド」および「レスポンス」のやりとりは、I/Oライン30から不正に傍受されやすい。しかも、図9に示した各「コマンド」や、これに対する「レスポンス」を伝送する場合には、所定の伝送プロトコルに従った「ヘッダ」や「フッタ」を、個々の「コマンド」や「レスポンス」ごとに付加する必要があり、冗長性が高くなるという問題もある。
【0043】
この同じ読出処理を本発明によって行うには、次のようにすればよい。まず、図10に示すように、EEPROM15内には、前述した6つのファイルの他に、本発明を実施するための専用のデータファイル「2F16」およびキーファイル「2F17」を用意しておく。ここで、データファイル「2F16」は、バッチファイルを格納するためのファイルである。また、キーファイル「2F17」は、このバッチファイルに対して「バッチ処理実行コマンド」を実行するために必要なキーを格納したキーファイルであり、この実施例では、「7777」なるキーが予め書き込まれている。なお、キーファイル「2F17」は本発明の実施に必ずしも必要なものではないが、セキュリティを高めるためには、このようなキーファイルを設けるのが好ましい。
【0044】
一方、リーダライタ装置20側では、図9に示すような12種類の「コマンド」を羅列してなるバッチファイルを用意する。そして、図11に示すような6種類の「コマンド」を、1つずつ、リーダライタ装置20からI/Oライン30を介してCPU12へ送信すればよい。まず、ステップ1の「SELECT FILE 2F16」なる「選択コマンド」は、バッチファイル格納用のデータファイル「2F16」を選択するためのコマンドである。CPU12は、このデータファイル「2F16」を選択する処理を行った後、正しく選択が行われたことを示す「レスポンス」を返送する。次のステップ2の「WRITE BINARY(バッチファイル)」なる「書込コマンド」は、用意したバッチファイルをバイナリデータとして、直前に選択されたデータファイルに書き込む処理を行うコマンドである。この実施例では、データファイル「2F16」に対する書込処理については、何らキー照合を必要としていないので、このステップ2の「書込コマンド」の実行により、図9に示す12種類の「コマンド」を羅列してなるバッチファイルが、データファイル「2F16」にそのまま書込まれることになる。
【0045】
続いて、ステップ3の「SELECT FILE 2F17」なる「選択コマンド」によって、キーファイル「2F17」が選択され、ステップ4の「VERIFY 7777」なる「照合コマンド」によって、選択されたキーファイル内のキーと、暗証コード「7777」とが比較照合される。CPU12は、この照合を実行し、両者が一致しているか否かの結果を「レスポンス」として返送し、両者が一致していた場合には、RAM14内にこのキーについての解錠フラグを立てる。続く、ステップ5の「SELECT FILE 2F16」なる「選択コマンド」によって、バッチファイルを格納したデータファイル「2F16」が再び選択される。そして、最後のステップ6において、「BATCH」なる「バッチ処理実行コマンド」がCPU12に与えられる。CPU12は、RAM14内の解錠フラグを参照して、キー「7777」が既に解錠されていることを確認した上で、「バッチ処理実行コマンド」を実行する。すなわち、バッチファイル内に格納されている図9に示す「コマンド」を、あたかもI/Oライン30を介して順次与えられた「コマンド」として実行し、「レスポンス」をRAM14内に一時的に蓄積しておく。こうして、図9に示すステップ12の「READ BINARY」なる「コマンド」の実行を完了したら、RAM14内に一時的に蓄積しておいた「レスポンス」を、「バッチ処理実行コマンド」の「レスポンス」として返送する。結局、リーダライタ装置20側から見れば、図11のステップ6の「BATCH」なる「コマンド」の「レスポンス」として、データファイル「2F10」内のユーザデータを読み出すことができる。
【0046】
このように、従来の一般的なアクセス方法では、図9に示すような12種類の「コマンド」を順次I/Oライン30を介して転送し、それぞれについて「レスポンス」を待つという操作を行う必要があったのに対し、本発明に係るアクセス方法では、図11に示す6種類の「コマンド」について、同様の操作を行えばすむ。しかも、図9に示す「コマンド」の数がいくつに増えようとも、図11に示す「コマンド」の数は常に6ですむ(ステップ2における「WRITE BINARY」なる「書込コマンド」で書込まれるバッチファイルの容量が増えるだけである)。したがって、よりたくさんのステップからなる一連の「コマンド」群を用いたアクセスを行う場合には、本発明の効果はより顕著になる。また、バッチファイル内のデータは、あくまでも「コマンド」レベルの命令であり、§2で述べた方法で用いた「インストラクションコード」レベルの命令ではないので、セキュリティの面での問題も生じない。たとえば、上述の例では、不正使用者は、「1111」,「2222」,…といった5つのキーを知り得ない限り、データファイル「2F10」内のユーザデータを読み出すことはできない。
【0047】
最後に、「コマンド」を羅列してバッチファイルを構成する場合のフォーマットの一例を図12に示しておく。この例では、2バイトからなるコマンド長を示す部分(図に「XX」と記した部分)に続いて「コマンド」のコードを並べるようにしてあり、最後に、2バイトからなる終端コード「0000」を付加するようにしている。図11のステップ2における「書込コマンド」中のバッチファイルには、この図12に示すようなフォーマットで「コマンド」を羅列したバイナリコードが入ることになる。このバッチファイルのフォーマットとしては、この他どのようなものを用いてもよいが、予め所定のフォーマットを定義しておき、ROM13内の「バッチ処理実行コマンド」に対応する処理ルーチンが、この所定のフォーマットに基いて、バッチファイル内の各「コマンド」を解釈できるようにしておく必要がある。
【0048】
以上、本発明を図示する実施例に基いて説明したが、本発明はこの実施例に限定されるものではなく、この他にも種々の態様で実施可能である。たとえば、上述の実施例では、バッチファイル内の個々の「コマンド」についての「レスポンス」を、RAM14内に一時的に蓄積しておき、最後に一括して返送するようにしているが、必ずしもすべての「レスポンス」を返送する必要はなく、重要性の低い「レスポンス」については返送を省略するようにしてもかまわない。たとえば、図9に示す12種類の「コマンド」については、ステップ12の「読出コマンド」に対する「レスポンス」は、読出対象となるユーザデータを含む重要なものであるが、それ以外の「コマンド」についての「レスポンス」は、単に、ファイルの選択や照合が支障なく実行されたことを確認するためのものであるから、RAM14内に一時的に蓄積せずにそのまま捨ててしまってもかまわない。
【0049】
また、バッチファイル内の一連の「コマンド」を実行中に、何らかのエラー(たとえば、照合の不一致)が発生した場合には、その時点で、「バッチ処理実行コマンド」の実行を中断し、「BATCH」なる「コマンド」に対する「レスポンス」として、エラーの発生を示すステータスを返送するようにすればよい。
【0050】
更に、上述の実施例では、本発明をICカードに適用した例を述べたが、本発明の適用は、ICカードに限定されるものではなく、CPUを内蔵した携帯可能情報記録媒体に広く及ぶものである。
【0051】
【発明の効果】
以上のとおり、本発明に係る携帯可能情報記録媒体では、不揮発性メモリ内に書き込まれたデータを、外部から与えられたコマンドと解釈して実行するバッチ処理実行機能を備えているため、複数のコマンドを羅列してなるバッチファイルを用意し、このバッチファイルを外部から媒体に書込コマンドとともに与えて不揮発性メモリ内に書き込めば、このバッチ処理実行機能によって、バッチファイルを構成するコマンドを、外部から与えられたコマンドと解釈して実行させることが可能になる。このため、十分なセキュリティを確保しつつ、外部からのアクセスを効率的に行うことができるようになる。
【図面の簡単な説明】
【図1】一般的なICカードに、外部装置としてのリーダライタ装置を接続し、アクセスを行っている状態を示すブロック図である。
【図2】ICカードに対する従来の一般的なアクセス方法を説明するブロック図である。
【図3】ICカードに対するインストラクションコードを用いたアクセス方法の前段の操作を説明するブロック図である。
【図4】ICカードに対するインストラクションコードを用いたアクセス方法の後段の操作を説明するブロック図である。
【図5】ICカードに対する本発明に係るアクセス方法の前段の操作を説明するブロック図である。
【図6】ICカードに対する本発明に係るアクセス方法の後段の操作を説明するブロック図である。
【図7】一般的なアクセス方法と本発明に係るアクセス方法とにおけるコマンド解釈処理の相違を説明する図である。
【図8】一般的なICカード内のEEPROMに格納されているファイル群の一例を示す概念図である。
【図9】図8に示すデータファイル「2F10」から、ユーザデータを読み出す操作を行うために必要な「コマンド」群を示す図である。
【図10】本発明を適用するために、図8に示すファイル群に更に別なファイルを付加した状態を示す概念図である。
【図11】本発明によって、図10に示すデータファイル「2F10」から、ユーザデータを読み出す操作を行うために必要な「コマンド」群を示す図である。
【図12】本発明に用いるバッチファイルのフォーマットの一例を示す図である。
【符号の説明】
10…ICカード
11…I/Oインタフェース
12…CPU
13…ROM
14…RAM
15…EEPROM
20…リーダライタ装置
30…I/Oライン
31…送信データ
32…返送データ
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a portable information recording medium and an access method thereof, and more particularly, to a novel access method suitable for use with an IC card incorporating a CPU.
[0002]
[Prior art]
IC cards are attracting attention as next-generation portable information recording media that can replace magnetic cards. Recently, IC cards have been put into practical use in various systems in the real world due to technological advances for miniaturization and cost reduction of semiconductor integrated circuits.
[0003]
In particular, an IC card with a built-in CPU is not only a function as an information recording medium but also an information processing function, so that it is expected to be used in an information processing system that requires high security. A general IC card that is currently popular has a CPU and three types of memories accessed by the CPU, that is, ROM, RAM, and EEPROM. In the ROM, a program made up of instruction codes that can be directly executed by the CPU is stored, and the CPU has a function of comprehensively controlling the IC card based on the program. The RAM is a memory used as a work area when the CPU performs such overall control. On the other hand, the EEPROM is a non-volatile memory capable of reading and writing data via the CPU, and is used for storing original data to be recorded on the IC card.
[0004]
Normally, all access to the EEPROM is performed via the CPU, and the EEPROM cannot be directly accessed from the outside. Therefore, various access rights can be set for each individual file stored in the EEPROM, and a high level of security can be ensured. When it is desired to access the EEPROM in the IC card from the outside, a predetermined command is always given to the CPU from the outside. For example, when data is written to a predetermined file in the EEPROM, the data to be written is given to the CPU together with the predetermined write command, and the writing process is performed in the form of execution of the write command by the CPU. It will be. When data is read from a predetermined file in the EEPROM, a predetermined read command is given to the CPU, and the read process is performed in the form of execution of the read command by the CPU. When a predetermined command is given from the outside to the IC card, a response to this command is returned from the IC card to the outside. For example, when a write command is given, a response indicating whether or not the write process has been executed without any trouble is returned. When a read command is given, the data to be read is in the form of a response. Will be returned.
[0005]
When the access right is set for ensuring security, a specific key is required to execute a specific command. In order to execute a command that requires such a key, it is necessary to collate the key before that. Such key verification is performed by giving a predetermined key together with a verification command to the IC card from the outside. Within the IC card, the given key and the key recorded in the EEPROM are collated, and if both match, execution of a specific command is permitted.
[0006]
[Problems to be solved by the invention]
As described above, a portable information recording medium with a built-in CPU is usually accessed by a method in which a predetermined command is transmitted from the outside and a response to the response is received. In other words, it is necessary to repeatedly execute the process of command transmission / response return / command transmission / response return /... Whatever access is made to the portable information recording medium. Such command transmission and response return processing are performed via an I / O line formed between the external device and the portable information recording medium, and the data transfer speed via this I / O line is: The data transfer speed between the CPU and the memory inside the medium is very slow. For this reason, it takes much time to access the medium from the outside, compared to the performance of the CPU inside the medium. Thus, a large amount of data flowing on the I / O line for a long time is not preferable from the viewpoint of security. That is, the I / O line formed between the external device and the medium can be physically accessed from the outside, and data flowing on the I / O line can be illegally observed from the outside. Since data transfer is performed for a long time, there is a problem in securing security. In addition, when performing data transfer via an I / O line, it is necessary to add control information (so-called header and footer information) according to a predetermined transmission protocol to the data to be originally transferred, which increases redundancy. There is also a problem. As described above, the access of the medium by the procedure of command transmission / response return via the I / O line is not always efficient.
[0007]
As a solution to such a problem, a program consisting of instruction codes is written each time depending on the contents of access to the medium, this program is written as binary data as a file in the EEPROM, and this EEPROM is stored in the CPU in the medium. An access method for directly executing the instruction code is also proposed. According to this method, the data transfer through the I / O line can be performed in a short time only for transferring the program as binary data. Thereafter, since the CPU only needs to execute the program in the EEPROM, only the processing in the medium is required, and very high-speed processing is possible. However, this method has a big problem in terms of security. That is, the control of the CPU is completely controlled by the routine of the instruction code transferred to the EEPROM, away from the control of the normal routine prepared in the ROM. For this reason, if an unauthorized user describes an unauthorized program with an instruction code and uses this method, the CPU will faithfully execute the unauthorized program.
[0008]
Accordingly, an object of the present invention is to provide a portable information recording medium and an access method thereof that can efficiently perform external access while ensuring sufficient security.
[0009]
[Means for Solving the Problems]
  (1) According to a first aspect of the present invention, a CPU, a ROM storing a program made up of instruction codes that can be directly executed by the CPU, a RAM used as a work area of the CPU, a data stored via the CPU, And a non-volatile memory that can be read and written, and the CPU executes a predetermined program in the ROM based on a command given from the outsideThe result is sent back to the outside as a response.In a portable information recording medium having a function to
  When a write command with “batch file consisting of multiple commands listed” is given as data to be written from outside, this batch file is written to nonvolatile memory and the execution result is written. Processing to send back as a response to the command,
When a predetermined batch processing execution command is given from the outside, multiple commands contained in the batch file written in the non-volatile memory are interpreted as commands given from the outside and executed sequentially Once all the commands in the batch file have been processed, the necessary responses to these commands are sent in batches as responses to the batch processing execution command,
I doA function is provided.
[0010]
  (2) According to a second aspect of the present invention, in the portable information recording medium according to the first aspect described above,
  Responses generated by the execution of each command in the batch file are temporarily stored in the RAM. After all commands in the batch file have been executed, the responses stored in the RAM are responses to the batch processing execution command. As a batchIt is what I did.
[0011]
  (3) According to a third aspect of the present invention, in the method for accessing the portable information recording medium according to the first or second aspect described above,
  Prepare a batch file that lists multiple commands to be given to portable information recording media.
  Give a batch file prepared with a predetermined write command to the portable information recording medium, write this batch file in the nonvolatile memory,The result is sent back to the outside as a response to the write command.
  By giving a predetermined batch processing execution command to the portable information recording medium, each command in the batch file written in the nonvolatile memory is interpreted as an externally given command and executed.When all the commands in the batch file have been processed, the necessary responses for these commands are batched and returned as a response to the batch processing execution command.It is made to let you.
[0012]
(4) A fourth aspect of the present invention is the portable information recording medium access method according to the third aspect described above,
Responses generated by the execution of each command in the batch file are temporarily stored in the RAM. After all commands in the batch file have been executed, the responses stored in the RAM are responses to the batch processing execution command. Are sent to the outside in a batch.
[0013]
DETAILED DESCRIPTION OF THE INVENTION
The portable information recording medium according to the present invention has a batch processing execution function for interpreting and executing data written in the nonvolatile memory as a command given from the outside. Therefore, if a batch file consisting of a plurality of commands is prepared, and this batch file is given to the medium from the outside together with a write command and written into the non-volatile memory, the batch file is configured by this batch processing execution function. It becomes possible to interpret the command as an externally given command and execute it. That is, the CPU in the medium handles the command in the batch file stored in the non-volatile memory in the same medium as if it were a command given from the outside, and executes it.
[0014]
According to this method, the data transfer via the I / O line can be performed in a short time only to transfer the batch file to the medium. Thereafter, since the CPU only needs to execute commands in the EEPROM, only processing in the medium is required, and extremely high-speed processing becomes possible. In addition, for each command in the batch file, control information (so-called header and footer information) according to a predetermined transmission protocol is not necessary, and redundancy can be reduced. Moreover, what the CPU executes is only a command, not an instruction code itself. Accordingly, it is possible to maintain the same security as the access by the procedure of command transmission / response return via the I / O line.
[0015]
As described above, according to the present invention, it is possible to efficiently perform external access while ensuring sufficient security.
[0016]
【Example】
Hereinafter, the present invention will be described based on embodiments shown in the drawings.
[0017]
§1. General access method of IC card
First, a general access method for an IC card that is currently popular will be described. FIG. 1 is a block diagram showing a state in which a reader / writer device 20 as an external device is connected to a general IC card 10 and accessed. The IC card 10 and the reader / writer device 20 are connected to each other by an I / O line 30. Here, the IC card 10 includes an I / O interface 11, a CPU 12, a ROM 13, a RAM 14, and an EEPROM 15. The I / O interface 11 is an input / output circuit for transmitting and receiving data via the I / O line 30, and the CPU 12 communicates with the reader / writer device 20 via the I / O interface 11. The ROM 13 stores a program made up of instruction codes that can be directly executed by the CPU 12, and the CPU 12 has a function of performing overall control of the IC card 10 based on this program. The RAM 14 is a memory used as a work area when the CPU 12 performs such overall control. On the other hand, the EEPROM 15 is a memory for storing original data to be recorded on the IC card 10.
[0018]
Normally, power and a clock are supplied to the IC card 10 from an external reader / writer device 20. Therefore, when the IC card 10 is disconnected from the reader / writer device 20, the supply of power and clock to the IC card 10 is stopped. However, since the EEPROM 15 is a non-volatile memory, the recorded content is retained as it is even after the power supply is stopped. However, all the data in the RAM 14 is lost by stopping the power supply.
[0019]
All accesses to the memories 13, 14, and 15 in the IC card 10 are performed via the CPU 12, and these memories cannot be directly accessed from the outside. That is, when a predetermined “command” is given from the reader / writer device 20 to the CPU 12, the CPU 12 interprets and executes this “command” and returns the result as a “response” to the reader / writer device 20. Become. For example, when writing to a predetermined file in the EEPROM 15, data to be written is given to the CPU 12 together with the “write command”, and the writing process is performed in the form of execution of the “write command” by the CPU 12. It will be. Conversely, when data is read from a predetermined file in the EEPROM 15, a predetermined “read command” is given to the CPU 12, and read processing is performed in the form of execution of the “read command” by the CPU 12. As described above, when the execution of the “command” is completed in the IC card 10, a “response” for the executed “command” is returned to the outside. For example, when a “write command” is given, a “response” indicating whether or not the write process has been executed without any trouble is returned. When a “read command” is given, the data to be read is returned. Will be returned in the form of a response.
[0020]
Usually, data is stored in the EEPROM 15 in units of files, and an access right is set for each individual file. In this case, when a specific “command” is executed for a specific file, input of a predetermined key is required. Therefore, before executing the “write command” or the “read command”, the key collation must be performed by executing a predetermined “collation command”. For this reason, it is possible to ensure high security for the data stored in the EEPROM 15.
[0021]
FIG. 2 is a block diagram illustrating such a general access method. When accessing the IC card 10, first, the transmission data 31 is transferred from the reader / writer device 20 to the CPU 12 via the I / O line 30. The transmission data 31 is obtained by adding “header” and “footer” before and after the original “command” to be given to the CPU 12. The “header” and “footer” are control information according to a predetermined transmission protocol for transmission via the I / O line 30. When the “command” is transferred in this way, the CPU 12 interprets and executes it to generate a “response”. This “response” is returned to the reader / writer device 20 as return data 32. The return data 32 is obtained by adding “header” and “footer” before and after “response”.
[0022]
In order to cause the CPU 12 to execute “commands”, a program routine is prepared for each “command” in the ROM 13. For example, corresponding to each of “write command”, “read command”, and “collation command”, “write processing routine”, “read processing routine”, and “collation processing routine” are prepared in ROM 13. ing. Actually, several other “commands” are defined, and each of the defined “commands” has its own subroutine in the ROM 13. The subroutine in the ROM 13 is an instruction code that can be directly executed by the CPU 12, that is, a program described in so-called “machine language”. When the CPU 12 receives the “command” via the I / O line 30, it first interprets the received “command” by executing the “common command processing routine” in the ROM 13, and a subroutine corresponding to the “command”. Select. Then, a jump to the instruction code at the head of the subroutine corresponding to each “command” occurs, and a predetermined process is executed. When this process is completed, the process returns to the “common command process routine” again, and a process of returning a predetermined “response” is performed. The above is the overall processing flow when one “command” is given to the CPU 12.
[0023]
In this way, general access to the IC card is performed by repeating the process of command transmission / response return / command transmission / response return /. For this reason, as described above, (1) it takes a long time to access, (2) security during transmission decreases, and (3) redundancy increases. That is, the transfer speed of the “command” and “response” via the I / O line 30 is very slow compared to the arithmetic processing speed of the CPU 12, and there is a problem that (1) access takes time. Become. In addition, there is a high possibility that data flowing on the I / O line 30 will be illegally observed from the outside. If data is transferred over a long period of time, (2) the security during transmission will be reduced. become. Furthermore, since it becomes necessary to add control information such as “header” and “footer” in accordance with a predetermined transmission protocol for transmission via the I / O line 30, (3) redundancy is increased. The problem of, etc. also arises. Thus, the access of the IC card 10 by the procedure of command transmission / response return via the I / O line 30 is not necessarily efficient.
[0024]
§2. Access method using instruction code
As a solution to such a problem, an access method using an instruction code has been conventionally proposed. This method will be described with reference to the block diagrams of FIGS. First, in accordance with the contents of access to the IC card 10, a program composed of instruction codes is prepared each time. As described above, the instruction code is a program described in so-called “machine language” that can be directly executed by the CPU 12. However, normally, a program composed of this instruction code is prepared by compiling a source program written in a high-level language.
[0025]
Subsequently, a process of writing the program including the prepared instruction code into the EEPROM 15 as binary data is performed. FIG. 3 shows this writing process. In the illustrated example, a “write command” “WRITE BINARY” is transmitted to the CPU 12 as the transmission data 31. Here, the “write command” is composed of “write command code” and “data to be written”, and is composed of prepared instruction codes in the “data to be written” portion. There is a program. Since this program is handled as binary data, as a result, as shown in FIG. 4, the program consisting of this instruction code is written as it is in a predetermined file in the EEPROM 15.
[0026]
Next, as shown in FIG. 4, a “program execution command” “GO PROG” is transmitted to the CPU 12 as the transmission data 31. This “program execution command” is a command specially defined for performing the access method using the instruction code described here, and is a command for instructing that the instruction code group written in the EEPROM 15 should be executed as it is. It is. In order to execute such a command, it is necessary to prepare a subroutine corresponding to the “program execution command” in the ROM 13, but the subroutine is very simple. That is, it may be constituted by a jump instruction to the start address of the instruction code written in the EEPROM 15.
[0027]
Thus, when the “program execution command” is executed, the CPU 12 directly executes the instruction code written in the EEPROM 15. According to such an access method, the data transfer via the I / O line 30 can be performed in a short time only to transfer the program as binary data. Thereafter, since the CPU 12 only has to execute the program in the EEPROM 15, only the processing inside the IC card 10 is required, and very high speed processing is possible. Compared with the general access method described in §1, the CPU 12 Can be accessed efficiently.
[0028]
However, this access method has a big problem in terms of security as already described. After the “program execution command” is executed, the control of the CPU 12 is completely controlled by the instruction code written in the EEPROM 15. For this reason, if an unauthorized user describes an unauthorized program with an instruction code and uses this method, the CPU will faithfully execute the unauthorized program. In other words, as long as the CPU 12 executes an instruction given in the form of “command”, the regular security check prepared in the ROM 13 functions, but the primitive instruction given in the form of “instruction code” is executed by the CPU 12. Such security checks will no longer work when running.
[0029]
§3. Access method according to the present invention
As described above, both the general access method described in §1 and the access method using the instruction code described in §2 have advantages and disadvantages. The present invention proposes a novel access method that solves the problems of these methods. Hereinafter, this method will be described with reference to the block diagrams of FIGS.
[0030]
First, in accordance with the access contents to the IC card 10, a batch file consisting of a list of commands is prepared each time. That is, in the general access method described in §1, a batch file is created by arranging several “commands” transmitted as the transmission data 31. However, the “header” and “footer” added based on the transmission protocol are not necessary here, and the prepared batch file may include only the “command” portion.
[0031]
Subsequently, a process of writing the prepared batch file in the EEPROM 15 is performed. FIG. 5 shows this writing process. In the illustrated example, a “write command” “WRITE BINARY” is transmitted to the CPU 12 as the transmission data 31. Here, the “write command” is composed of “write command code” and “data to be written”, and the prepared batch file is put in the “data to be written” part. ing. This batch file is composed of a large number of “commands”. Here, however, the batch files are handled not as “commands” but as mere data, and as a result, as shown in FIG. It will be written as it is.
[0032]
Next, as shown in FIG. 6, a “batch process execution command” “BATCH” is transmitted to the CPU 12 as the transmission data 31. This “batch processing execution command” is a command specially defined for performing the access method according to the present invention. The “command” in the batch file written in the EEPROM 15 is transferred via the I / O line 30. It is a command for performing processing to be interpreted and executed as a “command” given from the outside. In order to execute such a command, it is necessary to prepare a subroutine corresponding to the “batch processing execution command” in the ROM 13, but the subroutine can be added relatively easily. This is because, as already described, a “common command processing routine” for interpreting and executing a “command” given from the outside via the I / O line 30 is already prepared in the ROM 13. In the “Common Command Processing Routine”, instead of the “Command” given from the outside, if the “Command” in the batch file is changed to be interpreted and executed, it corresponds to the “Batch Processing Execution Command”. Routines can be easily created.
[0033]
Specifically, during execution of the “batch processing execution command”, the “command” in the batch file stored in the EEPROM 15 may be indicated by the buffer pointer BP. This basic concept will be described with reference to FIG. In the general access method described in §1, the “command” given through the I / O line 30 is temporarily stored in a buffer in the RAM 14 as shown in FIG. The start position of the “command” in this buffer is indicated by the pointer BP. The CPU 12 interprets and executes the “command” while sequentially moving the buffer pointer BP. That is, after a subroutine corresponding to a given “command” is executed, a predetermined “command” is generated and returned. On the other hand, in the access method according to the present invention, when a “batch processing execution command” is given, the start position of the batch file in the EEPROM 15 is indicated by the buffer pointer BP as shown in FIG. The “command” is interpreted and executed while sequentially moving the buffer pointer BP.
[0034]
Thus, although the memory area pointed to by the buffer pointer BP is different in that one is a buffer area in the RAM 14 and the other is a batch file storage area in the EEPROM 15, the substantial interpretation processing of “command” is performed. There is no essential difference between the general access method described in §1 and the access method according to the present invention.
[0035]
However, there is a slight difference regarding the method of returning the “response”. That is, when a “command” given through the I / O line 30 and stored in the buffer in the RAM 14 is executed, a “response” to this “command” is immediately returned, but the EEPROM 15 When the “command” stored in the batch file is executed, the “response” for each “command” is temporarily accumulated in the RAM 14 and all the “commands” in the batch file are processed. At the time of completion, the “responses” stored in the RAM 14 are returned in a batch. Accordingly, when viewed from the reader / writer device 20 side, when a “batch processing execution command” “BATCH” is transmitted to the CPU 12, each “command” in the batch file is used as a “response” to this “batch processing execution command”. "Response" can be obtained collectively.
[0036]
In the general access method described in §1, the CPU 12 always executes a predetermined command sequentially by repeating the procedure of command transmission / response return. However, in the access method according to the present invention, first, a plurality of commands are transmitted. A batch file in which “commands” are listed and prepared is prepared, and after writing the batch file in the EEPROM 15, a “batch processing execution command” may be given to the CPU 12. Since the CPU 12 interprets each “command” in the batch file as a “command” given from the outside via the I / O line 30 and executes it sequentially, the CPU 12 performs the same processing as a general access method. Can be executed. According to this method, the data transfer through the I / O line 30 is a short time required to transfer the batch file as binary data. Thereafter, since the CPU 12 only has to execute the “command” in the EEPROM 15, only the processing inside the IC card 10 is required, and extremely high speed processing becomes possible. In addition, since the data transfer time via the I / O line 30 is relatively short, the possibility that data is illegally leaked outside via the I / O line 30 is also reduced. Furthermore, it is not necessary to add control information corresponding to the transmission protocol such as “header” and “footer” to each “command” in the batch file (the batch file is transferred via the I / O line 30). It is necessary to add "Header" and "Footer" to the "Write command", but it is necessary to add "Header" and "Footer" to each "Command" that makes up the batch file. There will be less redundancy.
[0037]
Further, this method does not cause a security problem unlike the access method using the instruction code described in §2. Comparing FIG. 4 (description of the method of §2) and FIG. 6 (description of the method of §3), both are common in that “the CPU 12 executes an instruction written in the EEPROM 15”. However, the former instruction is an instruction code, that is, a “machine language” level instruction that can be directly executed by the CPU 12, whereas the latter instruction is a “command” level instruction given via the I / O line 30. There are some major differences. That is, in the access method according to the present invention, the execution target of the CPU 12 is merely a “command”, and the instruction code directly executed by the CPU 12 is an instruction code prepared in the ROM 13. Therefore, the regular security check prepared in the ROM 13 functions sufficiently, and unauthorized access is not performed at the instruction code level.
[0038]
§4. Examples of access
Next, an access method according to the present invention will be described based on a specific example. Here, as shown in FIG. 8, an explanation will be given taking an example of access processing related to six files existing in the EEPROM 15. Each of these six files has a unique file ID (in this example, a 2-byte code in hexadecimal), that is, “2F10”, “2F11”, “2F12”, “2F13”, “2F14”, “2F15”. Is granted. Here, the file “2F10” is a data file storing some user data related to the user who is the owner of the IC card, and the other five files are for reading user data from the data file “2F10”. It is assumed that the key file stores necessary keys. For example, a first key “1111” is stored in the first key file “2F11”. In order to read user data from the data file “2F10”, a “read command” may be given to the CPU 12 after giving a “select command” for selecting this data file. If the verification is not completed, this “read command” is rejected without being executed. Accordingly, in order to access the data file “2F10”, it is necessary to repeatedly execute the “collation command” and collate all five keys.
[0039]
Here, first, a method for reading user data in the data file “2F10” by the general access method described in §1 will be described. In this case, 12 types of “commands” as shown in FIG. 9 are required. These 12 types of “commands” are transmitted one by one from the reader / writer device 20 to the CPU 12 via the I / O line 30. When the execution of one “command” is completed, a “response” to this is returned from the CPU 12 to the reader / writer device 20 via the I / O line 30. After the “response” is returned, the reader / writer device 20 transmits the next “command”. Thus, when the round-trip transfer of “command” and “response” is repeated 12 times via the I / O line 30, the user data in the data file “2F10” is read to the reader / writer device 20 side.
[0040]
The 12 types of “commands” shown in FIG. 9 will be briefly described step by step. First, the “select command” “SELECT FILE 2F11” in step 1 selects the first key file “2F11”. It is a command to do. After performing the process of selecting the key file “2F11”, the CPU 12 returns a “response” indicating that the selection has been performed correctly. The subsequent “verification command” “VERIFY 1111” in step 2 is a command for comparing and collating the key in the key file selected immediately before with the password code “1111”. The CPU 12 executes this collation, and returns a result indicating whether or not both match as a “response”. If the two match, an unlock flag for this key is set in the RAM 14. The “selection command” “SELECT FILE 2F12” in step 3 is a command for selecting the second key file “2F12”, and the “verification command” “VERIFY 2222” in step 4 is immediately before. This is a command for comparing and collating the key in the selected key file with the password code “2222”. In the same manner, all the five types of keys are collated by the “command” in steps 5 to 10.
[0041]
Then, the target data file “2F10” is selected by the “selection command” “SELECT FILE 2F10” in step 11. Subsequently, when the “read command” “READ BINARY” in step 12 is given, the CPU 12 refers to the unlock flag in the RAM 14 to execute the “read command” on the data file “2F10”. It is determined whether or not the set access right condition is satisfied. At this point, since the collation match has already been obtained for all the first to fifth keys, the CPU 12 executes this “read command”. As a result, the user data in the data file “2F10” is returned as a “response” to the reader / writer device 20 in the form of binary data.
[0042]
As described above, in order to execute the reading process for the data file “2F10” by the conventional general access method described in §1, 12 types as shown in FIG. It is necessary to perform an operation of sending “commands” one by one, waiting for a “response” reply, and sending the next “command”. As described above, such an operation is very slow compared with the arithmetic processing speed of the CPU 12, and the exchange of “command” and “response” is easily intercepted from the I / O line 30. In addition, when each “command” shown in FIG. 9 and “response” corresponding thereto are transmitted, the “header” and “footer” according to a predetermined transmission protocol are transferred to each “command” and “response”. There is also a problem that the redundancy becomes high.
[0043]
In order to perform the same reading process according to the present invention, the following process may be performed. First, as shown in FIG. 10, in addition to the six files described above, a dedicated data file “2F16” and key file “2F17” for carrying out the present invention are prepared in the EEPROM 15. Here, the data file “2F16” is a file for storing a batch file. The key file “2F17” is a key file that stores keys necessary for executing the “batch processing execution command” for the batch file. In this embodiment, a key “7777” is written in advance. It is. Note that the key file “2F17” is not necessarily required to implement the present invention, but it is preferable to provide such a key file in order to increase security.
[0044]
On the other hand, the reader / writer device 20 side prepares a batch file in which 12 types of “commands” as shown in FIG. 9 are listed. Then, six types of “commands” as shown in FIG. 11 may be transmitted one by one from the reader / writer device 20 to the CPU 12 via the I / O line 30. First, the “selection command” “SELECT FILE 2F16” in step 1 is a command for selecting the data file “2F16” for storing the batch file. After performing the process of selecting the data file “2F16”, the CPU 12 returns a “response” indicating that the selection has been performed correctly. The next “write command” “WRITE BINARY (batch file)” in step 2 is a command for writing the prepared batch file as binary data into the data file selected immediately before. In this embodiment, since no key verification is required for the writing process for the data file “2F16”, the 12 types of “commands” shown in FIG. The enumerated batch file is written as it is in the data file “2F16”.
[0045]
Subsequently, the key file “2F17” is selected by the “selection command” “SELECT FILE 2F17” in step 3, and the key in the selected key file is selected by the “verification command” “VERIFY 7777” in step 4. The code code “7777” is compared and collated. The CPU 12 executes this collation, returns a result indicating whether or not both match as a “response”, and if both match, sets an unlock flag for this key in the RAM 14. Subsequently, the data file “2F16” storing the batch file is selected again by the “selection command” “SELECT FILE 2F16” in step 5. In the final step 6, a “batch processing execution command” “BATCH” is given to the CPU 12. The CPU 12 executes the “batch process execution command” after confirming that the key “7777” has already been unlocked by referring to the unlock flag in the RAM 14. That is, the “command” shown in FIG. 9 stored in the batch file is executed as if it were sequentially given as “command” via the I / O line 30 and the “response” is temporarily stored in the RAM 14. Keep it. Thus, when the execution of the “command” “READ BINARY” in step 12 shown in FIG. 9 is completed, the “response” temporarily stored in the RAM 14 is used as the “response” of the “batch processing execution command”. Return it. Eventually, when viewed from the reader / writer device 20, the user data in the data file “2F10” can be read out as the “response” of the “command” “BATCH” in step 6 of FIG.
[0046]
As described above, in the conventional general access method, it is necessary to perform the operation of sequentially transferring 12 types of “commands” as shown in FIG. 9 through the I / O line 30 and waiting for “response” for each of them. On the other hand, in the access method according to the present invention, it is sufficient to perform the same operation for the six types of “commands” shown in FIG. In addition, the number of “commands” shown in FIG. 11 is always 6 regardless of how many “commands” shown in FIG. 9 increase (written by “write command” “WRITE BINARY” in step 2). It only increases the capacity of the batch file). Therefore, the effect of the present invention becomes more prominent when an access is performed using a series of “commands” composed of more steps. The data in the batch file is only a “command” level instruction and not an “instruction code” level instruction used in the method described in §2, so there is no problem in terms of security. For example, in the above-described example, the unauthorized user cannot read the user data in the data file “2F10” unless he / she knows five keys “1111”, “2222”,.
[0047]
Lastly, FIG. 12 shows an example of the format when a batch file is configured by listing “commands”. In this example, the code of “command” is arranged following the part indicating the command length consisting of 2 bytes (the part indicated as “XX” in the figure), and finally the end code “0000” consisting of 2 bytes. "Is added. In the batch file in the “write command” in step 2 of FIG. 11, binary codes in which “commands” are listed in the format shown in FIG. 12 are entered. Any other format may be used as the format of the batch file. A predetermined format is defined in advance, and a processing routine corresponding to the “batch processing execution command” in the ROM 13 It is necessary to be able to interpret each "command" in the batch file based on the format.
[0048]
As mentioned above, although this invention was demonstrated based on the Example shown in figure, this invention is not limited to this Example, It can implement in a various aspect other than this. For example, in the above-described embodiment, “responses” for individual “commands” in the batch file are temporarily stored in the RAM 14 and finally returned in a batch. There is no need to send back the “response”, and it may be omitted for the “response” of low importance. For example, for the 12 types of “commands” shown in FIG. 9, the “response” to “read command” in step 12 is important including user data to be read, but for other “commands”. The “response” is merely for confirming that the file selection or verification has been executed without any problem, and may be discarded without being temporarily stored in the RAM 14.
[0049]
If any error (for example, mismatch of collation) occurs while executing a series of “commands” in the batch file, the execution of the “batch processing execution command” is interrupted at that time, and “BATCH” As a “response” to “command”, a status indicating the occurrence of an error may be returned.
[0050]
Further, in the above-described embodiments, the example in which the present invention is applied to an IC card has been described. However, the application of the present invention is not limited to an IC card, and extends to a portable information recording medium having a built-in CPU. Is.
[0051]
【The invention's effect】
As described above, the portable information recording medium according to the present invention has a batch processing execution function for interpreting and executing data written in the nonvolatile memory as a command given from the outside. If you prepare a batch file with a list of commands, give this batch file to the medium from outside with a write command, and write it in the non-volatile memory, this batch process execution function will change the commands that make up the batch file to the external It is possible to interpret and execute the command given by. For this reason, it is possible to efficiently perform external access while ensuring sufficient security.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a state in which a reader / writer device as an external device is connected to a general IC card and accessed.
FIG. 2 is a block diagram illustrating a conventional general access method for an IC card.
FIG. 3 is a block diagram for explaining an operation in a previous stage of an access method using an instruction code for an IC card.
FIG. 4 is a block diagram for explaining a subsequent operation of an access method using an instruction code for an IC card.
FIG. 5 is a block diagram for explaining an operation in the first stage of an access method according to the present invention for an IC card.
FIG. 6 is a block diagram for explaining a subsequent operation of an access method according to the present invention for an IC card.
FIG. 7 is a diagram for explaining a difference in command interpretation processing between a general access method and an access method according to the present invention.
FIG. 8 is a conceptual diagram showing an example of a file group stored in an EEPROM in a general IC card.
FIG. 9 is a diagram illustrating a “command” group necessary for performing an operation of reading user data from the data file “2F10” illustrated in FIG. 8;
FIG. 10 is a conceptual diagram showing a state in which another file is added to the file group shown in FIG. 8 in order to apply the present invention.
11 is a diagram showing a “command” group necessary for performing an operation of reading user data from the data file “2F10” shown in FIG. 10 according to the present invention.
FIG. 12 is a diagram showing an example of a format of a batch file used in the present invention.
[Explanation of symbols]
10 ... IC card
11 ... I / O interface
12 ... CPU
13 ... ROM
14 ... RAM
15 ... EEPROM
20: Reader / writer device
30 ... I / O line
31 ... transmission data
32 ... Return data

Claims (4)

CPUと、このCPUによって直接実行可能なインストラクションコードからなるプログラムを記憶したROMと、前記CPUの作業領域として使用されるRAMと、前記CPUを介してデータの読出しおよび書き込みが可能な不揮発性メモリと、を備え、外部から与えられたコマンドに基いて、前記CPUが前記ROM内の所定のプログラムを実行し、その結果をレスポンスとして外部へ返送する機能を有する携帯可能情報記録媒体において、
外部から「複数のコマンドを羅列してなるバッチファイル」を書込対象データとする書込コマンドが与えられたときに、前記バッチファイルを前記不揮発性メモリに書き込む処理を実行し、実行結果を前記書込コマンドに対するレスポンスとして外部へ返送する処理と、
外部から所定のバッチ処理実行コマンドが与えられたときに、前記不揮発性メモリに書き込まれた前記バッチファイルに含まれている複数のコマンドを、外部から与えられたコマンドと解釈して順次実行する処理を行い、前記バッチファイル内のすべてのコマンドの処理が完了した時点で、これらのコマンドに対する必要なレスポンスを一括して、前記バッチ処理実行コマンドに対するレスポンスとして外部へ返送する処理と、
を行う機能を有することを特徴とする携帯可能情報記録媒体。
A CPU, a ROM storing a program comprising instruction codes that can be directly executed by the CPU, a RAM used as a work area of the CPU, and a non-volatile memory capable of reading and writing data via the CPU In accordance with a command given from the outside, the portable information recording medium having a function for the CPU to execute a predetermined program in the ROM and return the result to the outside as a response .
When a write command having a “batch file formed by listing a plurality of commands” from outside is given as write target data, a process of writing the batch file to the nonvolatile memory is executed, and the execution result is Processing to send back as a response to the write command;
When a predetermined batch processing execution command is given from outside, a plurality of commands included in the batch file written in the non-volatile memory are interpreted as commands given from outside and sequentially executed When the processing of all the commands in the batch file is completed, the necessary responses to these commands are batched and returned to the outside as a response to the batch processing execution command;
A portable information recording medium having a function of performing
請求項1に記載の媒体において、
バッチファイル内の各コマンドの実行によって生じるレスポンスを、RAM内に一時蓄積しておき、バッチファイル内の全コマンドの実行が終了した後、RAM内に蓄積されているレスポンスをバッチ処理実行コマンドに対するレスポンスとして外部へ一括して送出することを特徴とする携帯可能情報記録媒体。
The medium of claim 1, wherein
Responses generated by the execution of each command in the batch file are temporarily stored in the RAM. After all commands in the batch file have been executed, the responses stored in the RAM are displayed as responses to the batch processing execution command. A portable information recording medium characterized by being collectively sent to the outside.
CPUと、このCPUによって直接実行可能なインストラクションコードからなるプログラムを記憶したROMと、前記CPUの作業領域として使用されるRAMと、前記CPUを介してデータの読出しおよび書き込みが可能な不揮発性メモリと、を備え、外部から与えられたコマンドに基いて、前記CPUが前記ROM内の所定のプログラムを実行し、その結果をレスポンスとして外部へ返送する機能を有する携帯可能情報記録媒体、をアクセスする方法において、
前記携帯可能情報記録媒体に対して与える複数のコマンドを羅列してなるバッチファイルを用意し、
前記携帯可能情報記録媒体に対して、所定の書込コマンドとともに前記バッチファイルを与え、前記バッチファイルを前記不揮発性メモリ内に書き込み、その結果を前記書込コマンドに対するレスポンスとして外部へ返送させ、
前記携帯可能情報記録媒体に対して、所定のバッチ処理実行コマンドを与えることにより、前記不揮発性メモリ内に書き込まれたバッチファイル内の各コマンドを、外部から与えられたコマンドと解釈して実行させ、前記バッチファイル内のすべてのコマンドの処理が完了した時点で、これらのコマンドに対する必要なレスポンスを一括して、前記バッチ処理実行コマンドに対するレスポンスとして外部へ返送させるようにしたことを特徴とする携帯可能情報記録媒体のアクセス方法。
A CPU, a ROM storing a program comprising instruction codes that can be directly executed by the CPU, a RAM used as a work area of the CPU, and a non-volatile memory capable of reading and writing data via the CPU And a portable information recording medium having a function of executing a predetermined program in the ROM and returning the result to the outside as a response based on a command given from the outside In
Prepare a batch file that lists a plurality of commands to be given to the portable information recording medium,
Giving the batch file together with a predetermined write command to the portable information recording medium, writing the batch file in the nonvolatile memory, returning the result to the outside as a response to the write command,
To the portable information recording medium, by applying a predetermined batch processing execution command, each command of said nonvolatile written batch file in memory, to be executed by interpreting the command given from the outside When all the commands in the batch file have been processed, necessary responses to these commands are collectively returned to the outside as responses to the batch processing execution command. Possible information recording medium access method.
請求項3に記載のアクセス方法において、
バッチファイル内の各コマンドの実行によって生じるレスポンスを、RAM内に一時蓄積しておき、バッチファイル内の全コマンドの実行が終了した後、RAM内に蓄積されているレスポンスをバッチ処理実行コマンドに対するレスポンスとして外部へ一括して送出させることを特徴とする携帯可能情報記録媒体のアクセス方法。
The access method according to claim 3, wherein
Responses generated by the execution of each command in the batch file are temporarily stored in the RAM. After all commands in the batch file have been executed, the responses stored in the RAM are displayed as responses to the batch processing execution command. A method for accessing a portable information recording medium, characterized by:
JP20285495A 1995-07-17 1995-07-17 Portable information recording medium and access method thereof Expired - Lifetime JP3657315B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP20285495A JP3657315B2 (en) 1995-07-17 1995-07-17 Portable information recording medium and access method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP20285495A JP3657315B2 (en) 1995-07-17 1995-07-17 Portable information recording medium and access method thereof

Publications (2)

Publication Number Publication Date
JPH0935019A JPH0935019A (en) 1997-02-07
JP3657315B2 true JP3657315B2 (en) 2005-06-08

Family

ID=16464300

Family Applications (1)

Application Number Title Priority Date Filing Date
JP20285495A Expired - Lifetime JP3657315B2 (en) 1995-07-17 1995-07-17 Portable information recording medium and access method thereof

Country Status (1)

Country Link
JP (1) JP3657315B2 (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5197664B2 (en) * 2010-03-18 2013-05-15 株式会社東芝 IC card, communication apparatus, command processing method, communication system
US9501399B2 (en) 2011-02-04 2016-11-22 Kabushiki Kaisha Toshiba Memory system capable of controlling wireless communication function
JP5372049B2 (en) 2011-02-04 2013-12-18 株式会社東芝 Memory system
JP2012194918A (en) * 2011-03-17 2012-10-11 Toshiba Corp Communication medium, ic card, and communication method
JP5677249B2 (en) * 2011-09-21 2015-02-25 株式会社東芝 IC card
JP5832963B2 (en) * 2012-06-29 2015-12-16 株式会社東芝 Memory system
JP5779148B2 (en) * 2012-07-06 2015-09-16 株式会社東芝 Memory system
JP5779147B2 (en) * 2012-07-06 2015-09-16 株式会社東芝 Memory system
JP2019168944A (en) * 2018-03-23 2019-10-03 大日本印刷株式会社 Electronic information storage medium, IC card, command group execution method, and command group execution program

Also Published As

Publication number Publication date
JPH0935019A (en) 1997-02-07

Similar Documents

Publication Publication Date Title
RU2148856C1 (en) Information exchange system
US6886083B2 (en) Apparatus and method for controlling a card device
EP0451936B1 (en) Program control system for portable data storage device
JP3568970B2 (en) IC card issuing device
EP1450299B1 (en) Portable information recording medium
PL182666B1 (en) Method of simplifying communication with microprocessor cards
JP3657315B2 (en) Portable information recording medium and access method thereof
JP4747451B2 (en) Data access method to portable information recording medium
JPH0935018A (en) Portable information recording medium and its access method
JP3545045B2 (en) Creating a pattern file for IC card access
US8245941B2 (en) Recording method, recorder and IC card
JP2001067210A (en) Ic card, and method for installation of application on ic card
JP3195122B2 (en) Check method of instruction format given to IC card
JP3775697B2 (en) Portable information storage media
JPH06282700A (en) Information recording medium containing cpu
JPH08171621A (en) Ic card
JP3576233B2 (en) Information storage medium issuance processing data creation device and creation method
JP2001291066A (en) Method for issuing ic card
JP2618953B2 (en) Transmission processing method, data storage medium and IC chip
JP2002352205A (en) Portable electronic equipment and access management method
JPS6383894A (en) Portable electronic device
JP4026796B2 (en) IC card with command distribution function
JPH07311684A (en) Method for generating pattern file for ic card access
JPH0736153B2 (en) Data transmission system
JPH07325894A (en) Ic card controller

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040820

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040928

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20041129

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050309

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090318

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090318

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100318

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100318

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110318

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110318

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120318

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130318

Year of fee payment: 8