JPH02187888A - Certification system - Google Patents

Certification system

Info

Publication number
JPH02187888A
JPH02187888A JP1008010A JP801089A JPH02187888A JP H02187888 A JPH02187888 A JP H02187888A JP 1008010 A JP1008010 A JP 1008010A JP 801089 A JP801089 A JP 801089A JP H02187888 A JPH02187888 A JP H02187888A
Authority
JP
Japan
Prior art keywords
data
electronic device
card
key
key data
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.)
Pending
Application number
JP1008010A
Other languages
Japanese (ja)
Inventor
Yasuo Iijima
康雄 飯島
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP1008010A priority Critical patent/JPH02187888A/en
Priority to GB8929239A priority patent/GB2227111B/en
Priority to KR1019900000428A priority patent/KR900012179A/en
Priority to FR9000511A priority patent/FR2641885A1/en
Publication of JPH02187888A publication Critical patent/JPH02187888A/en
Priority to US07/942,337 priority patent/US5293029A/en
Priority to HK98102223A priority patent/HK1003129A1/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To secure the security between applications by selecting key data based on received designated data and ciphering the received data using the selected key data. CONSTITUTION:A terminal equipment 20 generates random number data by a random number generating part 22 and transmits it by a certification preparation command to an IC card 10. In the card 10, when the certification preparation command is received, random number data are generated by a random number generating part 12 and transmitted to the terminal 20. The terminal 20 searches the key data number of ciphering key data designated form the card 10 out of a key list held by the terminal itself and takes out corresponding key data. Further, the terminal 20 ciphers the random number data from the card 10 by the key data in ciphering part 23 using ciphering algorithm. Thus, the key data for recognizing validity to be used in respective applications can be selectively operated, and the security between the application can be secured.

Description

【発明の詳細な説明】 [発明の目的コ (産業上の利用分野) 本発明は、たとえばICカード内のメモリ部に対しデー
タを書込む際、その書込みデータの正当性を確認する認
証方式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Purpose of the Invention (Industrial Application Field) The present invention relates to an authentication method for confirming the validity of written data when writing data to a memory section in an IC card, for example. .

(従来の技術) 近年、新たな携帯可能なデータ記憶媒体として、消去可
能な不揮発性メモリおよび、これらを制御するCPUな
どの制御素子を有するICチップを内蔵した、いわゆる
ICカードが注目されている。
(Prior Art) In recent years, so-called IC cards, which have a built-in IC chip that has erasable non-volatile memory and control elements such as a CPU that controls them, have been attracting attention as a new portable data storage medium. .

従来、このようなICカードを利用したICカードシス
テム(たとえばショッピングシステムやクレジットシス
テムなど)においては、ICカード(実際はICカード
内のメモリ部)へのデータ書込み処理、特に取引データ
を書込む際、センタ(ホストコンピュータ)に送られる
取引データの正当性がセンタ側で確認できなかった。
Conventionally, in an IC card system (for example, a shopping system or a credit system) that uses such an IC card, the process of writing data to the IC card (actually the memory section within the IC card), especially when writing transaction data, The center side could not confirm the validity of the transaction data sent to the center (host computer).

このため、端末装置からデータを書込む命令をICカー
ドが受信すると、ICカード内でキーデータおよび暗号
化アルゴリズムを使用して書込みデータを暗号化し、そ
の暗号化データのうち一部のデータを端末装置に送り、
これを受信した端末装置では、その暗号化データおよび
書込みデータをそれぞれセンタに送り、センタで、これ
らの各データにより書込みデータの正当性を確認する認
証方式が考えられている。
Therefore, when an IC card receives a command to write data from a terminal device, the IC card encrypts the write data using key data and an encryption algorithm, and some of the encrypted data is sent to the terminal. send to the device,
An authentication method is being considered in which the terminal device that receives this sends the encrypted data and the written data to a center, and the center verifies the validity of the written data using these data.

(発明が解決しようとする課題) しかし、このような認証方式では、I’Cカードが多目
的利用されるにつれ、複数のアプリケーションで使用さ
れることになった場合、正当性を確認するための各アプ
リケーションが保管している確認用のキーデータを異な
らせる方が、各アプリケーション間のセキュリティを確
保するためには有効である。
(Problem to be solved by the invention) However, with this type of authentication method, as I'C cards are used for multiple purposes, when used in multiple applications, each It is more effective to have different confirmation key data stored by applications in order to ensure security between applications.

そこで、本発明は、たとえば複数のアプリケーションで
ICカードが使用されることになっても、各アプリケー
ションで使用する正当性確認用のキーデータおよび暗号
化アルゴリズムを選択的に運用でき、アプリケーション
間のセキュリティを確保することが可能となる認証方式
を提供することを目的とする。
Therefore, even if an IC card is used in multiple applications, the present invention makes it possible to selectively operate key data and encryption algorithms for validity confirmation used in each application, thereby ensuring security between applications. The purpose is to provide an authentication method that makes it possible to ensure the following.

また、上記した認証方式では、書込みデータ、キーデー
タおよび暗号化アルゴリズムが同一であれば、ICカー
ドから出力される暗号化データも同一となってしまい、
本来の取引データの正当性確認が困難となるという問題
があった。
Furthermore, in the authentication method described above, if the written data, key data, and encryption algorithm are the same, the encrypted data output from the IC card will also be the same.
There was a problem in that it was difficult to confirm the validity of the original transaction data.

そこで、本発明は、同一の書込みデータ、キーデータお
よび暗号化アルゴリズムであっても、書込み時間が異な
れば出力される暗号化データも異なるものになり、正当
性の確認が容易となる認証方式を提供することを目的と
する。
Therefore, the present invention has developed an authentication method that makes it easy to confirm authenticity because even if the written data, key data, and encryption algorithm are the same, the encrypted data output will be different if the writing time is different. The purpose is to provide.

[発明の構成] (課題を解決するための手段) 本発明の認証方式は、第1の電子装置と、この第1の電
子装置との間で通信可能な第2の電子装置とからなり、
第2の電子装置から第1の電子装置に対し第1のデータ
および、その第1のデータを暗号化するためのキーデー
タを指定する指定データを送信する手段と、第1の電子
装置において、前記第1のデータおよび指定データを受
信すると、あらかじめ用意された少なくとも1つのキー
データの中から前記受信した指定データに基づき1つの
キーデータを選択し、この選択したキーデータを使用し
て前記受信した第1のデータを暗号化する手段と、第1
の電子装置において、前記第1のデータを全て受信した
後に、その暗号化データのうち一部のデータを第2の電
子装置に送信する手段とを具備している。
[Structure of the Invention] (Means for Solving the Problems) The authentication method of the present invention includes a first electronic device and a second electronic device that can communicate with the first electronic device,
means for transmitting first data and designation data specifying key data for encrypting the first data from the second electronic device to the first electronic device; When the first data and specified data are received, one key data is selected based on the received specified data from at least one key data prepared in advance, and this selected key data is used to control the received data. means for encrypting the first data;
The electronic device further includes means for transmitting part of the encrypted data to a second electronic device after receiving all of the first data.

また、本発明の認証方式は、第1の電子装置と、この第
1の電子装置との間で通信可能な第2の電子装置とから
なり、第2の電子装置から第1の電子装置に対し第1の
データおよび、その第1のデータを暗号化するためのキ
ーデータおよび暗号化アルゴリズムを指定する指定デー
タを送信する手段と、第1の電子装置において、前記第
1のデータおよび指定データを受信すると、あらかじめ
用意された少なくとも1つのキーデータおよび少なくと
も1つの暗号化アルゴリズムの中から前記受信した指定
データに基づき1つのキーデータおよび1つの暗号化ア
ルゴリズムを選択し、この選択したキーデータおよび暗
号化アルゴリズムを使用して前記受信した第1のデータ
を暗号化する手段と、第1の電子装置において、前記第
1のデータを全て受信した後に、その暗号化データのう
ち一部のデータを第2の電子装置に送信する手段とを具
備している。
Further, the authentication method of the present invention includes a first electronic device and a second electronic device that can communicate with the first electronic device, and the second electronic device communicates with the first electronic device. means for transmitting first data, key data for encrypting the first data, and specified data specifying an encryption algorithm; When receiving, one key data and one encryption algorithm are selected based on the received specified data from at least one key data and at least one encryption algorithm prepared in advance, and the selected key data and means for encrypting the received first data using an encryption algorithm; and in a first electronic device, after receiving all the first data, encrypting some of the encrypted data; and means for transmitting to a second electronic device.

さらに、本発明の認証方式は、第1の電子装置と、この
第1の電子装置との間で通信可能な第2の電子装置とか
らなり、第2の電子装置から第1の電子装置に対し第1
のデータおよび、その都度内容の異なる第2のデータを
送信する手段と、第1の電子装置において、前記第1の
データおよび第2のデータを受信すると、その受信した
第2のデータ、あらかじめ用意されたキーデータおよび
暗号化アルゴリズムを使用して前記受信した第1のデー
タを暗号化する手段と、第1の電子装置において、前゛
記憶1のデータを全て受信した後に、その暗号化データ
のうち一部のデータを第2の電子装置に送信する手段と
を具備している。
Furthermore, the authentication method of the present invention includes a first electronic device and a second electronic device that can communicate with the first electronic device, On the other hand, the first
and means for transmitting second data having different contents each time; and a first electronic device, upon receiving the first data and second data, transmitting the second data prepared in advance; means for encrypting the received first data using the key data and encryption algorithm; and means for transmitting part of the data to the second electronic device.

(作用) 本発明は、ICカード(第1の電子装置)の内部に保有
している複数のキーデータのうち1つのキーデータを端
末装置(第2の電子装置)から指定し、この指定したキ
ーデータを用いて書込みデータを暗号化することにより
、たとえば複数のアプリケーションでICカードが使用
されることになっても、各アプリケーションで使用する
正当性確認用のキーデータを選択的に運用でき、アプリ
ケーション間のセキュリティを確保することが可能とな
る。
(Operation) The present invention specifies one key data from a terminal device (second electronic device) out of a plurality of key data held inside an IC card (first electronic device), and By encrypting written data using key data, even if an IC card is used in multiple applications, the key data for authenticity confirmation used by each application can be selectively used. It becomes possible to ensure security between applications.

また、本発明は、ICカード(第1の電子装置)の内部
に保有している複数のキーデータおよび複数の暗号化ア
ルゴリズムのうち1つのキーデータおよび1つの暗号化
アルゴリズムを端末装置(第2の電子装置)から指定し
、この指定したキーデータおよび暗号化アルゴリズムを
用いて書込みデータを暗号化することにより、たとえば
複数のアプリケーションでICカードが使用されること
になっても、各アプリケーションで使用する正当性確認
用のキーデータおよび暗号化アルゴリズムを選択的に運
用でき、アプリケーション間のセキュリティを確保する
ことが可能となる。
The present invention also provides a method for transmitting one key data and one encryption algorithm among a plurality of key data and a plurality of encryption algorithms held inside an IC card (first electronic device) to a terminal device (second electronic device). By encrypting the written data using the specified key data and encryption algorithm, for example, even if the IC card is used in multiple applications, it can be used in each application. It is possible to selectively use the key data and encryption algorithm for validity confirmation, thereby ensuring security between applications.

さらに、本発明は、端末装置(第2の電子装置)からI
Cカード(第]の電子装置)に送信された、その都度内
容の異なるデータをパラメータとして書込みデータを暗
号化することにより、同一の書込みデータ、キーデータ
および暗号化アルゴリズムであっても、書込み時間が異
なれば出力される暗号化データも異なるものになり、正
当性の確認が容易となる。
Furthermore, the present invention provides an I/O from a terminal device (second electronic device).
By encrypting the write data using different data sent to the C card (second electronic device) as a parameter, the write time is reduced even if the write data, key data, and encryption algorithm are the same. If the data is different, the encrypted data output will be different, making it easier to confirm authenticity.

(実施例) 以下、本発明の一実施例について図面を参照して説明す
る。
(Example) Hereinafter, an example of the present invention will be described with reference to the drawings.

第8図は、本発明に係るICカード(第1の電子装置)
と、その上位装置である端末装置(第2の電子装置)と
、その上位装置であるセンタ(ホストコンピュータ)と
のシステム構成図である。
FIG. 8 shows an IC card (first electronic device) according to the present invention.
FIG. 2 is a system configuration diagram of a terminal device (second electronic device) that is a higher-level device, and a center (host computer) that is a higher-level device.

ICカード(第1の電子装置)10は、各種データを記
憶するためのメモリ部11、乱数データを発生する乱数
発生部12、データの暗号化を行なう暗号化部13、後
述する端末装置20と通信するためのコンタクト部14
、およびこれらを制御するCPUなどの制御素子15な
どから構成されていて、これらのうちメモリ部11、乱
数発生部12、暗号化部13および制御素子15は、た
とえば1つのICチップ(あるいは複数のICチップ)
で構成されてICカード本体内に埋設されている。
The IC card (first electronic device) 10 includes a memory section 11 for storing various data, a random number generation section 12 for generating random number data, an encryption section 13 for encrypting data, and a terminal device 20 to be described later. Contact section 14 for communication
, and a control element 15 such as a CPU that controls these. Among these, the memory section 11, random number generation section 12, encryption section 13, and control element 15 are configured using, for example, one IC chip (or a plurality of IC chips). IC chip)
It is embedded within the IC card body.

メモリ部11は、たとえばEEFROMなどの不揮発性
メモリによって構成されており、第2図に示すように、
エリア定義テーブル(領域)16とデータファイル(領
域)17とに大きく分割されている。そして、データフ
ァイル17内は、図示するように複数のエリア18.・
・・に分割定義されるもので、これら各エリア18・・
・はエリア定義テーブル16内のエリア定義情報19に
よってそれぞれ定義される。
The memory section 11 is composed of a non-volatile memory such as EEFROM, and as shown in FIG.
It is largely divided into an area definition table (area) 16 and a data file (area) 17. The data file 17 includes a plurality of areas 18 .・
It is defined as divided into 18 areas...
.are defined by the area definition information 19 in the area definition table 16.

ここに、エリア定義情報1つは、たとえばエリアを指定
する識別情報としてのエリア番号(AID)、エリアが
割当てられているメモリ上の先頭アドレス情報、エリア
の容量を規定するサイズ情報および属性情報を対応付け
たデータ列である。なお、属性情報は、たとえば1バイ
トで構成されていて、そのMSBが「0」であれば暗号
化データ書込みエリアであり、「IJであれば入力デー
タ書込みエリアであることを示している。
Here, one piece of area definition information includes, for example, an area number (AID) as identification information that specifies an area, information on the start address in memory to which the area is allocated, size information and attribute information that specify the capacity of the area. This is an associated data string. Note that the attribute information is composed of, for example, 1 byte, and if the MSB is "0", it is an encrypted data writing area, and if it is "IJ", it is an input data writing area.

端末装置(第2の電子装置)20は、ICカード10を
取扱う機能を有し、各種データを記憶するメモリ部21
、乱数データを発生する乱数発生部22、データの暗号
化を行なう暗号化部23、データの入力などを行なうキ
ーボード部24、データを表示する表示部25、ICカ
ード10と通信するためのコンタクト部26、センタ(
ホストコンピュータ)30と通信回線31を介してオン
ラインで通信する通信制御部27、およびこれらを制御
するCPUなとの制御部28から構成されている。
The terminal device (second electronic device) 20 has a function of handling the IC card 10 and has a memory section 21 that stores various data.
, a random number generation section 22 that generates random number data, an encryption section 23 that encrypts data, a keyboard section 24 that inputs data, a display section 25 that displays data, and a contact section that communicates with the IC card 10. 26, Center (
The communication control section 27 communicates online with a host computer 30 via a communication line 31, and a control section 28 such as a CPU that controls these.

次に、このような構成において、本発明に係る認証方式
を第1図を用いて詳細に説明する。なお、端末装置20
のメモリ部21には、図示するようなキーデータリスト
およびキーデータ番号(KID)リストが格納されてい
るものとする。
Next, in such a configuration, an authentication method according to the present invention will be explained in detail using FIG. 1. Note that the terminal device 20
It is assumed that the memory unit 21 stores a key data list and a key data number (KID) list as shown in the figure.

キーデータリストはキーデータ番号とキーデータとを対
応付けたリストであり、KIDリストはキーデータを指
定するキーデータ番号のみがリスト化されたものである
。一方、ICカード10は、独自にキーデータリストを
有しており、これはカード発行時などで内部のメモリ部
11に登録(記憶)される。
The key data list is a list that associates key data numbers with key data, and the KID list is a list of only key data numbers that specify key data. On the other hand, the IC card 10 has its own key data list, which is registered (stored) in the internal memory section 11 when the card is issued.

さて、まずステップ1〜ステツプ8によって、ICカー
ド10と端末装置20との間で行なわれる相互認証のプ
ロセスを説明する。まず、ステップ1において、端末装
置20は、乱数発生部22によって乱数データR1を生
成し、認証準備コマンドEXCHによって、これをIC
カード10に送信する。このとき、端末装置20がIC
カード10を認証するために使用するキーデータのキー
データ蕃号(KID−M)、および端末装置2゜がサポ
ートしている暗号化アルゴリズム(A L G)の指定
データをも合わせて送信する。
First, the process of mutual authentication performed between the IC card 10 and the terminal device 20 will be explained using steps 1 to 8. First, in step 1, the terminal device 20 generates random number data R1 by the random number generator 22, and uses the authentication preparation command EXCH to send it to the IC.
Send to card 10. At this time, the terminal device 20
The key data number (KID-M) of the key data used to authenticate the card 10 and the specification data of the encryption algorithm (ALG) supported by the terminal device 2 are also transmitted.

次に、ステップ2において、ICカード10は、認証準
備コマンドEXCHを受信すると、乱数発生部12によ
って乱数データR2を生成し、それを認証$備コマンド
EXCHに対するレスポンスexchとして端末装置2
0に送信する。このとき、ICカード10は、端末装置
20を認証するために使用するキーデータのキーデータ
番号(KID−N)を自身のもつキーリストより見付け
だし、かつ指定された暗号化アルゴリズム(A L G
)を自身がサポートしているかを判断し、これをalg
として乱数データR2と合わせて端末装置20に送信す
る。
Next, in step 2, when the IC card 10 receives the authentication preparation command EXCH, the random number generation unit 12 generates random number data R2, and sends it to the terminal device 2 as a response EXCH to the authentication preparation command EXCH.
Send to 0. At this time, the IC card 10 finds the key data number (KID-N) of the key data used to authenticate the terminal device 20 from its own key list, and uses the specified encryption algorithm (ALG).
) is supported, and set this to alg
It is transmitted to the terminal device 20 together with the random number data R2.

もしこのとき、端末装置20から指定されたキーデータ
番号(K I D−M)がキーリストに存在しなかった
り、あるいはICカード10か端末装置20を認証する
ために使用するキーデータ番号(KID−N)がキーリ
ストに存在しなかったり、あるいは指定された暗号化ア
ルゴリズムをサポートしていなかった場合には、その旨
を端末装置20に通知する。
At this time, if the key data number (KID-M) specified by the terminal device 20 does not exist in the key list, or if the key data number (KID-M) used to authenticate the IC card 10 or the terminal device 20 does not exist in the key list, -N) does not exist in the key list or does not support the specified encryption algorithm, the terminal device 20 is notified of this fact.

次に、ステップ3において、端末装置20は、ICカー
ド10から指定された暗号化キーデータのキーデータ番
号(KID−N)を自己が所有するキーリストから捜し
出し、対応するキーデータ(NNNNN)を取出す。そ
して、暗号化部23によって、暗号化アルゴリズムAL
G(−alg)を使用してキーデータ(NNNNN)に
よりICカード10からの乱数データR2を暗号化し、
その結果、すなわち暗号化データC2を認証コマンドA
UTHによってICカード10に送信する。
Next, in step 3, the terminal device 20 searches the key data number (KID-N) of the encrypted key data specified from the IC card 10 from its own key list, and retrieves the corresponding key data (NNNNN). Take it out. Then, the encryption unit 23 uses the encryption algorithm AL
Encrypt random number data R2 from the IC card 10 with key data (NNNNN) using G (-alg),
As a result, the encrypted data C2 is transferred to the authentication command A.
It is transmitted to the IC card 10 by UTH.

なお、図中、Eは暗号化を実現する機能ボックスを示す
Note that in the figure, E indicates a function box that implements encryption.

次に、ステップ4において、ICカード10が認証コマ
ンドAUTHを受信すると、ICカード10は、先に送
信した暗号化キーデータのキーブタ番号(KID−N)
を自己が所有するキーリストより捜し出し、対応するキ
ーデータ(NNNNN)を取出す。そして、暗号化部1
3によって、認証$備コマンドEXCHで指定された暗
号化アルゴリズム(ALG)を使用してキーデータ(N
NNNN)により乱数データR2を暗号化し、暗号化デ
ータC2Xを得る。
Next, in step 4, when the IC card 10 receives the authentication command AUTH, the IC card 10 receives the keypad number (KID-N) of the previously transmitted encrypted key data.
from the key list it owns, and extracts the corresponding key data (NNNNNN). Then, the encryption unit 1
3, the key data (N
NNNN) to encrypt the random number data R2 to obtain encrypted data C2X.

次に、ステップ5において、ICカード10は、先に受
信した認証コマンドAUTH中の暗号化データC2とス
テップ4で生成した暗号化データC2Xとを比較し、そ
の比較結果Y/Nを得る。
Next, in step 5, the IC card 10 compares the encrypted data C2 in the previously received authentication command AUTH with the encrypted data C2X generated in step 4, and obtains the comparison result Y/N.

次に、ステップ6において、ICカード10は、認証準
備コマンドEXCHで端末装置20から指定された暗号
化キーデータのキーデータ番号(KID−M)に対応す
るキーデータ(MMMMM)を取出す。次に、暗号化部
13によって、暗号化アルゴリズム(A L G)を使
用してキーデータ(MMMMM)により乱数データR1
を暗号化し、暗号化データC1を得る。そして、この暗
号化データC1とステップ5による比較結果Y/Nを、
認証コマンドAUTHに対するレスポンスauthとし
て端末装置20に送信する。
Next, in step 6, the IC card 10 retrieves the key data (MMMM) corresponding to the key data number (KID-M) of the encrypted key data specified by the terminal device 20 in the authentication preparation command EXCH. Next, the encryption unit 13 uses the encryption algorithm (A L G) to generate the random number data R1 using the key data (MMMMMM).
is encrypted to obtain encrypted data C1. Then, the comparison result Y/N of this encrypted data C1 and step 5 is
It is sent to the terminal device 20 as a response auth to the authentication command AUTH.

次に、ステップ7において、端末装置20がレスポンス
authを受信すると、端末装置20は、先に送信した
暗号化キーデータのキーデータ番号(KID−M)に対
応するキーデータ(M M M M M )を取出す。
Next, in step 7, when the terminal device 20 receives the response auth, the terminal device 20 receives the key data (M M M M M ).

そして、暗号化部23によって、暗号化アルゴリズム(
A L G)を使用してキーデータ(〜IMMMM)に
より端末装置20からの乱数データR1を暗号化し、暗
号化ブタCIXを得る。
Then, the encryption unit 23 uses the encryption algorithm (
Random number data R1 from the terminal device 20 is encrypted using the key data (~IMMMM) using ALG) to obtain an encrypted pig CIX.

次に、ステップ8において、端末装置20は、レスポン
スau thによって受信した暗号化ブタC1とステッ
プ7で生成した暗号化データCIXとを比較し、この比
較結果とレスポンスauthにより受信したステップ5
によるICカード10での比較結果とにより、以降のシ
ステム処理の決定を行なう。
Next, in step 8, the terminal device 20 compares the encrypted data C1 received by the response au th with the encrypted data CIX generated in step 7, and the terminal device 20 compares this comparison result with the encrypted data CIX received by the response au th.
The subsequent system processing is determined based on the comparison result with the IC card 10.

次に、ステップ9〜ステツプ23によって1.端末装置
20からICカード10に対しデータを書込むとともに
、書込み処理の正当性を確認するプロセスを説明する。
Next, step 9 to step 23 perform 1. A process of writing data from the terminal device 20 to the IC card 10 and confirming the validity of the writing process will be described.

まず、ステップ9において、端末装置20は、書込みコ
マンドWRITEによりデータを書込む要求をICカー
ド10に送信する。このとき、端末装置20は、Icカ
ード10内のメモリ部11に対する書込み対象エリアの
エリア番号(AID−A)、書込みデータのバイト数(
L−1)、および書込みデータ(Ml)のうちICカー
ド10か入力データとして受信し得るバイト数に分割し
た最初の分割データ(Ml、−1)をICカード10に
送信する。
First, in step 9, the terminal device 20 transmits a request to write data to the IC card 10 using a write command WRITE. At this time, the terminal device 20 determines the area number (AID-A) of the write target area for the memory unit 11 in the IC card 10, the number of bytes of write data (
L-1), and the first divided data (Ml, -1) which is divided into the number of bytes that the IC card 10 can receive as input data from the write data (Ml) are transmitted to the IC card 10.

次に、ステップ10において、ICカード10は、書込
みコマンドWRITEによって受信したエリア番号(A
ID−A)が付されたエリアを第2図のエリア定義テー
ブル16から見付ける。もし見付からなければ、エリア
番号未定義を意味するステータスを書込みコマンドWR
ITEに対するレスポンスwr i t eによって端
末装置20に送信する。もし見付かれば、先に認証準備
コマンドE X CH,または後述する暗号化準備コマ
ンド5RNDが正常終了されているかをチエツクする。
Next, in step 10, the IC card 10 receives the area number (A
The area assigned ID-A) is found from the area definition table 16 in FIG. If it is not found, write a status indicating that the area number is undefined and write the command WR.
The response to the ITE is sent to the terminal device 20 by writing. If found, it is first checked whether the authentication preparation command EXCH or the encryption preparation command 5RND, which will be described later, has been successfully completed.

このチエツクの結果、もし正常終了されていなければ、
実行条件不備ステータスをレスポンスw r i t 
eによって端末装置20に送信する。
As a result of this check, if it has not been completed normally,
Response with execution condition incomplete status
e to the terminal device 20.

上記チエツクの結果、正常終了されていれば、ICカー
ド10は、先の認証準備コマンドEXCHによって通知
された乱数データR1とICカード10の内部で所有す
るカード固有値とにより初期データR1’を生成する。
If the above check has ended normally, the IC card 10 generates initial data R1' using the random number data R1 notified by the previous authentication preparation command EXCH and the card unique value owned within the IC card 10. .

次に、ステップ11において、ICカード10は、先に
認証準備コマンドEXCHで指定された暗号化アルゴリ
ズム(A L G)を使用・して、初期データR1′お
よび先に認証準備コマンドEXCHによって通知された
キーデータ番号(KID−M)に対応するキーデータ (MMMMM)により書込みデータ(Ml−1)を暗号
化し、暗号化データ(CI −1)を得る。
Next, in step 11, the IC card 10 uses the encryption algorithm (ALG) previously specified by the authentication preparation command EXCH and uses the initial data R1' and the encryption algorithm previously notified by the authentication preparation command EXCH. The write data (Ml-1) is encrypted using the key data (MMMMM) corresponding to the key data number (KID-M), and encrypted data (CI-1) is obtained.

次に、アクセス対象となっているエリア番号(AID−
A)のエリアの属性情報を参照することにより、メモリ
部11への書込みデータを入力データ(Ml−1)にす
るか暗号化データ(C1−1)にするかを決定し、書込
み処理を行なう。
Next, the area number (AID-
By referring to the attribute information of area A), it is determined whether the data to be written to the memory unit 11 is input data (Ml-1) or encrypted data (C1-1), and the write process is performed. .

そして、端末装置20に対し次の書込みデータを要求す
るためのレスポンス−nb−を送信する。
Then, a response -nb- for requesting the next write data is transmitted to the terminal device 20.

次に、レスポンス nb−を受信すると、端末装置20
は、ステップ12において、次の書込みデータ(Ml−
2)をICカード10に送信する。
Next, upon receiving the response nb-, the terminal device 20
In step 12, the next write data (Ml-
2) is sent to the IC card 10.

次に、ステップ13において、次の書込みデータ(Ml
−2)を受信すると、ICカード10は、再び暗号化ア
ルゴリズム(A L G)を使用して、先に生成した暗
号化データ(C1−1)の最終の8バイトデータおよび
キーデータ番号(KID−M)に対応するキーデータ(
MMMMM)により書込みデータ(Ml−2)を暗号化
し、暗号化データ(CI−2)を得る。次に、ステップ
11と同様に、メモリ部11への書込みデータを入力デ
ータ(Ml−2)にするか暗号化データ(C1−2)に
するかを決定し、選択的にエリアへの書込み処理を行な
う。そして、端末装置20に対し次の書込みデータを要
求するためのレスポンスnb−を送信する。
Next, in step 13, the next write data (Ml
-2), the IC card 10 uses the encryption algorithm (ALG) again to extract the final 8-byte data of the previously generated encrypted data (C1-1) and the key data number (KID). -M) corresponding key data (
The write data (Ml-2) is encrypted by MMMMM) to obtain encrypted data (CI-2). Next, similarly to step 11, it is determined whether the data to be written to the memory unit 11 is input data (Ml-2) or encrypted data (C1-2), and selectively write processing to the area is performed. Do this. Then, it transmits a response nb- for requesting the next write data to the terminal device 20.

以下、ステップ12.13と同様の処理動作を繰返し行
なう。
Thereafter, the same processing operations as steps 12 and 13 are repeated.

さて、ステップ14において、端末装置20が分割デー
タの最終データ(Ml−n)をICカード10に送信す
ると、ステップ15において、ICカード10は同様の
書込み処理を行なう。そして、最終的に生成された暗号
化データ(C1−〇)のうち最終8バイトを確認情報(
ACI)とし、書込みコマンドWRITEに対するレス
ポンスwriteによって端末装置20に送信する。
Now, in step 14, when the terminal device 20 transmits the final data (Ml-n) of the divided data to the IC card 10, in step 15, the IC card 10 performs a similar write process. Then, the last 8 bytes of the finally generated encrypted data (C1-〇) are converted into confirmation information (
ACI) and transmits it to the terminal device 20 in response to the write command WRITE.

すなわち、上記処理においては、あらかじめ相互認証手
順で端末装置20がICカード10を認証するために、
ICカード10に対して指定したキーデータ(MMMM
M)、暗号化アルゴリズム(A L G)および乱数デ
ータ(R1)を使用して、書込みデータM1に対する確
認情報(ACI)が得られている。
That is, in the above process, in order for the terminal device 20 to authenticate the IC card 10 in advance in a mutual authentication procedure,
Key data (MMMM) specified for the IC card 10
M), an encryption algorithm (ALG) and random number data (R1) are used to obtain confirmation information (ACI) for write data M1.

次に、上記とは異なるキーデータ、暗号化アルゴリズム
および乱数データにより確認情報を得るプロセスをステ
ップ16〜ステツプ20によ−って説明する。まず、ス
テップ16において、端末装置20は、乱数発生部22
によって新規の乱数データR3を生成し、暗号化準備コ
マンドS RNDによって、これをICカード10に送
信する。このとき、 ごカード10が確認情報を生成す
るのに使用するキーデータのキーデータ番号(KIDA
)、および暗号化アルゴリズム(ALG”)を合わせて
送信する。
Next, a process of obtaining confirmation information using key data, an encryption algorithm, and random number data different from those described above will be explained using steps 16 to 20. First, in step 16, the terminal device 20
generates new random number data R3, and transmits it to the IC card 10 by the encryption preparation command S_RND. At this time, the key data number (KIDA) of the key data used by the card 10 to generate confirmation information.
), and the encryption algorithm (ALG").

次に、ステップ17において、ICカード10は、暗号
化準備コマンド5RNDを受信すると、キーデータ番号
(KID−A)を自身が所有するキーリストから見付け
だし、対応するキーデータ(AAAAA)を得て、レス
ポンス5rndを端末装置20に送信する。
Next, in step 17, when the IC card 10 receives the encryption preparation command 5RND, it finds the key data number (KID-A) from its own key list and obtains the corresponding key data (AAAA). , response 5rnd is transmitted to the terminal device 20.

次に、ステップ18において、端末装置20は、書込み
コマンドWRITEによりデータを書込む要求をICカ
ード10に送信する。このとき、端末装置20は、IC
カード10内のメモリ部11に対する書込み対象エリア
のエリア番号(AID−B)、書込みデータのバイト数
(L−2) 、および書込みデータ(M2)を送信する
。なお、本ステップ18では、書込みデータ(M2)の
バイト数は、ICカード10が入力データとして受信し
得るバイト数である。
Next, in step 18, the terminal device 20 transmits a request to write data to the IC card 10 using a write command WRITE. At this time, the terminal device 20
The area number (AID-B) of the area to be written to the memory section 11 in the card 10, the number of bytes of write data (L-2), and the write data (M2) are transmitted. Note that in this step 18, the number of bytes of the write data (M2) is the number of bytes that the IC card 10 can receive as input data.

次に、ステップ1つにおいて、ICカード10は、ステ
ップ10と同様にしてエリア番号(AID−B)が付さ
れたエリアを第2図におけるエリア定義テーブル16か
ら見付ける。そして、次にICカード10として、先に
暗号化準備コマンド5RND (または認証準備コマン
ドE X CH)か正常終了されているか否かをチエツ
クする。もし、正常終了されているとすると、ICカー
ド10は、暗号化準備コマンド5RNDによって通知さ
れた乱数データR3とICカード10の内部で所有する
カード固有値とにより初期データR3’を生成する。
Next, in step 1, the IC card 10 finds the area assigned the area number (AID-B) from the area definition table 16 in FIG. 2 in the same manner as in step 10. Then, the IC card 10 first checks whether the encryption preparation command 5RND (or authentication preparation command EXCH) has been normally completed. If the process has been completed normally, the IC card 10 generates initial data R3' from the random number data R3 notified by the encryption preparation command 5RND and the card-specific value owned within the IC card 10.

次に、ステップ20において、ICカード10は、先に
暗号化準備コマンド5RNDで指定された暗号化アルゴ
リズム(ALG’ )を使用、して、初期データR3’
および先に暗号化準備コマンド5RNDにより通知され
たキーデータ番号(KID−A)に対応するキーデータ (AAAAA)により書込みデータ(M2)を暗号化し
、暗号化データC2を得る。次に、アクセス対象となっ
ているエリア番号(AID−B)のエリアの属性情報を
参照することにより、メモリ部]1への書込みデータを
入力データ(M2)にするか暗号化データ(C2)にす
るかを決定し、書込み処理を行なう。そして、端末装置
20に対し、暗号化データ(C2)のうち最終8バイト
のデータを確認情報(AC2)として、書込みコマンド
WRITEに対するレスポンスw r i t eによ
って送信する。
Next, in step 20, the IC card 10 uses the encryption algorithm (ALG') previously specified by the encryption preparation command 5RND to process the initial data R3'.
Then, the write data (M2) is encrypted using the key data (AAAAA) corresponding to the key data number (KID-A) previously notified by the encryption preparation command 5RND, and encrypted data C2 is obtained. Next, by referring to the attribute information of the area with the area number (AID-B) to be accessed, the data to be written to the memory unit]1 can be changed to input data (M2) or encrypted data (C2). Decide whether to write the data and perform the write process. Then, the last 8 bytes of the encrypted data (C2) are sent as confirmation information (AC2) to the terminal device 20 as a response to the write command WRITE.

なお、ICカード10は、第2図のエリア定義テーブル
16内の先頭アドレス情報およびサイズ情報によりメモ
リ部11内の物理的位置を確認する。先頭アドレス情報
は対応するエリアの先頭アドレス値であり、サイズ情報
は先頭アドレス値からのエリアの容量を規定している。
Note that the IC card 10 confirms the physical position in the memory section 11 based on the head address information and size information in the area definition table 16 shown in FIG. The start address information is the start address value of the corresponding area, and the size information defines the capacity of the area from the start address value.

また、属性情報は1ハイドで構成され、そのMSBが「
0」であれば暗号化データ書込みエリアであり、「1」
であれば入力データ書込みエリアであることを示す。
In addition, the attribute information consists of 1 hide, and its MSB is "
If it is 0, it is an encrypted data write area, and if it is 1.
If it is, it indicates that it is an input data writing area.

次に、ステップ21において、端末装置20は、ICカ
ード10へのデータ書込みを終了すると、書込みデータ
(Ml、M2)に対応する乱数ブタ(R1,R3) 、
キーデータ番号(KID−M。
Next, in step 21, when the terminal device 20 finishes writing data to the IC card 10, the terminal device 20 inputs random number pigs (R1, R3) corresponding to the written data (Ml, M2),
Key data number (KID-M.

KID−A)、確認情報(ACI、AC2) 、および
使用アルゴリズム指定値(ALG  ALG’ )によ
り、データ書込み処理リストを作成する。なお、このと
きカード固有値もリストに対応付けておく。そして、こ
の作成したリストをセンタ30へ送信する。
A data write processing list is created using the KID-A), confirmation information (ACI, AC2), and specified algorithm used (ALG ALG'). Note that at this time, the card unique value is also associated with the list. This created list is then sent to the center 30.

次に、ステップ22において、センタ30は、端末装置
20からのリストを受信すると、そのリストから書込み
データ(Ml)を取出し、対応するキーデータ番号(K
IDI−M)により、キーデータ(M M M M M
)を自身が所有するキーリストから見付けだし、かつ自
身が所有する取引きリストで対応付けられている乱数デ
ータ(R1)および暗号化アルゴリズム(A L G)
により確認情報(ACIX)を生成する。
Next, in step 22, upon receiving the list from the terminal device 20, the center 30 extracts the write data (Ml) from the list, and retrieves the corresponding key data number (K
IDI-M), the key data (M M M M M
) from the key list owned by the user, and random number data (R1) and encryption algorithm (ALG) that are associated with the transaction list owned by the user.
Confirmation information (ACIX) is generated.

そして、ステップ23において、リストで対応付けられ
た確認情報(ACI)とステップ22で生成した確認情
報(A CI X)とを比較し、両者が一致していれば
センタ30は書込みデータ(Ml)に対する書込み処理
の正当性を確認する。
Then, in step 23, the confirmation information (ACI) associated with the list is compared with the confirmation information (ACI Check the validity of the write process.

書込みデータ(M2)以降についても、ステップ22.
23と同様な処理により正当性を確認する。
For write data (M2) and subsequent steps, step 22.
The validity is confirmed by the same process as in 23.

次に、ICカード10としての動作を第7図を用いて説
明する。まず、制御素子15は、端末装置20からの制
御信号によって電気的活性化を経た後、アンサ−・ツー
・リセットと称する初期応答データを端末装置20へ出
力する(Sl)。そして、制御素子15は、認証準備コ
マンド完了フラグおよび暗号化準備コマンド完了フラグ
をオフしくS2)、命令データ待ち状態に移る。
Next, the operation of the IC card 10 will be explained using FIG. 7. First, the control element 15 is electrically activated by a control signal from the terminal device 20, and then outputs initial response data called answer-to-reset to the terminal device 20 (Sl). Then, the control element 15 turns off the authentication preparation command completion flag and the encryption preparation command completion flag (S2), and shifts to an instruction data waiting state.

この状態で、命令データを受信すると(S3)制御素子
15は、まず、この命令データが第3図に示す認証準備
コマンドEXCHであるか否かを判断しくS4) 、も
しそうでないと判断すると次のフローに移る。
In this state, when command data is received (S3), the control element 15 first determines whether this command data is the authentication preparation command EXCH shown in FIG. 3 (S4), and if it is determined not to be so, the next Move on to the flow.

ステップS4において、認証準備コマンドEXCHであ
ると判断すると、制御素子15は、認証準備コマンド中
のキーデータ番号(K I D)フィールドの内容をピ
ックアップし、メモリ部ll内に登録されているキーリ
ストから同一のキーデータ番号を見付ける(S5)。
In step S4, if it is determined that the authentication preparation command is EXCH, the control element 15 picks up the contents of the key data number (KID) field in the authentication preparation command and inputs the contents of the key data number (KID) field registered in the memory unit ll. The same key data number is found from (S5).

そして、もしキーデータ番号が見付からなければ(S6
)、制御素子15は、キーデータ指定エラーステータス
を出力しくS7)、命令データ待ち状態に戻る。もし、
キーデータ番号が見付かれば(S6)、制御素子15は
、対応するキーデータを内部RAM上の第1キーバツフ
アにセーブする(S8)。
If the key data number is not found (S6
), the control element 15 outputs a key data specification error status (S7), and returns to the instruction data waiting state. if,
If the key data number is found (S6), the control element 15 saves the corresponding key data in the first key buffer on the internal RAM (S8).

次に、制御素子15は、認証準備コマンド中の暗号化ア
ルゴリズム指定データ(A L G)フィールドを参照
することにより、メモリ上に登録されている暗号化アル
ゴリズムであるか否かをチエツクする(S9) このチ
エツクの結果、指定された暗号化アルゴリズムが存在し
ない場合(SIO)、制御素子15は、指定アルゴリズ
ムエラーステータスを出力しくS 11) 、命令デー
タ待ち状態に戻る。上記チエツクの結果、指定された暗
号化アルゴリズムが存在する場合(S10)、制御素子
15は、その暗号化アルゴリズムの番号をセーブしてお
く(S12)。
Next, the control element 15 checks whether the encryption algorithm is registered in the memory by referring to the encryption algorithm specification data (ALG) field in the authentication preparation command (S9). ) As a result of this check, if the specified encryption algorithm does not exist (SIO), the control element 15 outputs the specified algorithm error status (S11) and returns to the instruction data waiting state. As a result of the above check, if the specified encryption algorithm exists (S10), the control element 15 saves the number of the encryption algorithm (S12).

次に、制御素子15は、認証準備コマンド中の乱数デー
タ(R1)を内部RAM上の第1乱数バツフアにセーブ
しく813)、その後、先のキーリストからICカード
認証用キーデータのキーデータ番号(KID’)を見付
ける(S14)。
Next, the control element 15 saves the random number data (R1) in the authentication preparation command to the first random number buffer on the internal RAM (813), and then selects the key data number of the key data for IC card authentication from the previous key list. (KID') is found (S14).

そして、もしキーデータ番号が見付からなければ(S1
5)、制御素子15は、キーデータ未登録エラーステー
タスを出力しく516)、命令データ待ち状態に戻る。
Then, if the key data number is not found (S1
5) The control element 15 outputs the key data unregistered error status 516) and returns to the command data waiting state.

もし、キーデータ番号が見付かれば(S 15) 、制
御素子15は、対応するキーデータを内部RAM上の第
2キーバツフアにセーブする(S 17)。
If the key data number is found (S15), the control element 15 saves the corresponding key data in the second key buffer on the internal RAM (S17).

次に、制御素子15は、乱数発生部12によって乱数デ
ータR2を生成し、内部RAM上の第2乱数バツフアに
セーブする(318)。そして、制御素子15は、認証
準備コマンド完了フラグをオンしくS 19)  かつ
、生成した乱数データR2を先のキーデータ番号(KJ
D’)および認証$備コマンド中の暗号化アルゴリズム
指定データ(ALG)フィールドの内容とともに、認証
準備コマンドEXCHに対するレスポンスexchとし
て端末装置20に出力しく520)、命令データ待ち状
態に戻る。
Next, the control element 15 generates random number data R2 by the random number generator 12, and saves it in the second random number buffer on the internal RAM (318). Then, the control element 15 turns on the authentication preparation command completion flag (S19) and transfers the generated random number data R2 to the previous key data number (KJ
D') and the contents of the encryption algorithm designation data (ALG) field in the authentication $preparation command are output to the terminal device 20 as a response exch to the authentication preparation command EXCH (520), and the process returns to the command data waiting state.

ステップS4において、認証率ORコマンドEXCHで
ないと判断すると、制御素子15は、第4図に示す認証
コマンドAUTHであるか否かを判断しく521)、も
しそうでないと判断すると次のフローへ移る。
In step S4, if it is determined that it is not the authentication rate OR command EXCH, the control element 15 determines whether it is the authentication command AUTH shown in FIG. 4 (521), and if it is determined that it is not, it moves to the next flow.

ステップ21において、認証コマンドAUTHであると
判断すると、制御素子15は、認証準備コマンド完了フ
ラグがオンされているか否かを判断しく522)、もし
オフであれば実行条件不備エラーステータスを出力しく
823)、命令データ待ち状態に戻る。
In step 21, when determining that the authentication command is AUTH, the control element 15 determines whether the authentication preparation command completion flag is turned on (522), and if it is turned off, outputs an execution condition insufficient error status (823). ), returns to the instruction data waiting state.

ステップ22において、認証準備コマンド完了フラグが
オンであれば、制御素子15は、暗号化部13により、
第2キーバツフアの内容を暗号化のキーデータとして第
2乱数バツフアの内容を暗号化する(S24)。このと
きの暗号化アルゴリズムは、セーブされた暗号化アルゴ
リズム番号に対応する暗号化アルゴリズムを使用する。
In step 22, if the authentication preparation command completion flag is on, the control element 15 causes the encryption unit 13 to
The contents of the second random number buffer are encrypted using the contents of the second key buffer as key data for encryption (S24). At this time, the encryption algorithm that corresponds to the saved encryption algorithm number is used.

そして、制御素子15は、上記暗号化の結果と認証コマ
ンドAUTHで送られた入力データとを比較しく525
)、その比較結果に応じて一致フラグをオンまたはオフ
する(826〜528)。
Then, the control element 15 compares the result of the encryption with the input data sent in the authentication command AUTH.
), the match flag is turned on or off depending on the comparison result (826-528).

次に、制御素子15は、暗号化部13により、第1キー
バツフアの内容を暗号化のキーデータとして第1乱数バ
ツフアの内容を暗号化する(S 29)。このときの暗
号化アルゴリズムも上記同様のものを使用する。そして
、制御素子15は、この暗号化の結果を先の一致フラグ
の内容とともに、認証コマンドAUTHに対するレスポ
ンスauthとして端末装置20に出力しく530)、
命令データ待ち状態に戻る。
Next, the control element 15 causes the encryption unit 13 to encrypt the contents of the first random number buffer using the contents of the first key buffer as key data for encryption (S29). At this time, the same encryption algorithm as above is used. Then, the control element 15 outputs the result of this encryption together with the contents of the matching flag to the terminal device 20 as a response auth to the authentication command AUTH (530).
Return to command data waiting state.

ステップS21において、認証コマンドAUTHでない
と判断すると、制御素子15は、第5図に示す暗号化/
$備コマンド5RNDであるか否かを判断しくS 31
)  もしそうでないと判断すると次のフローへ移ル。
In step S21, if it is determined that the authentication command is not AUTH, the control element 15 performs the encryption/
Determine whether it is $bi command 5RND or not S 31
) If it is determined that this is not the case, move on to the next flow.

ステップ31において、暗号化準備コマンド5RNDで
あると判断すると、制御素子15は、暗号化準備コマン
ド中のキーデータ番号(KID)フィールドの内容をピ
ックアップし、メ゛モリ部11内に登録されているキー
リストから同一のキーデータ番号を見付ける(S 32
)。
In step 31, when determining that it is the encryption preparation command 5RND, the control element 15 picks up the contents of the key data number (KID) field in the encryption preparation command, and selects the contents registered in the memory section 11. Find the same key data number from the key list (S32
).

そして、もしキーデータ番号が見付からなければ(33
3)、制御素子15は、キーデータ指定エラーステータ
スを出力しく534)、命令データ待ち状態に戻る。も
し、キーデータ番号が見付かれば(833)、制御素子
15は、対応するキーデータを内部RAM上の第1キー
バツフアにセーブする(S 35)。
And if the key data number is not found (33
3), the control element 15 outputs the key data specification error status 534) and returns to the command data waiting state. If the key data number is found (833), the control element 15 saves the corresponding key data in the first key buffer on the internal RAM (S35).

次に、制御素子15は、暗号化準備コマンド中の暗号化
アルゴリズム指定データ(A L G)フィールドを参
照することにより、メモリ上に登録されている暗号化ア
ルゴリズムであるか否かをチエツクする(S36)。こ
のチエツクの結果、指定された暗号化アルゴリズムが存
在しない場合(S37)、制御素子15は、指定アルゴ
リズムエラーステータスを出力しく838)、命令デー
タ待ち伏聾に戻る。上記チエツクの結果、指定された暗
号化アルゴリズムが存在する場合(S37)、制御素子
15は、その暗号化アルゴリズムの番号をセーブしてお
く  (S39)。
Next, the control element 15 checks whether the encryption algorithm is registered in the memory by referring to the encryption algorithm specification data (ALG) field in the encryption preparation command ( S36). As a result of this check, if the specified encryption algorithm does not exist (S37), the control element 15 outputs the specified algorithm error status (838) and returns to the command data ambush mode. As a result of the above check, if the specified encryption algorithm exists (S37), the control element 15 saves the number of the encryption algorithm (S39).

次に、制御素子15は、暗号化準備コマンド中の乱数デ
ータ(R3)を内部RA M上の第1乱数バツフアにセ
ーブしく540)、その後、暗号化準備コマンド完了フ
ラグをオンしく541)、かつ暗号化準備コマンド完了
ステータスを端末装置20に出力しく542)、命令デ
ータ待ち状態に戻る。
Next, the control element 15 saves the random number data (R3) in the encryption preparation command to the first random number buffer on the internal RAM (540), then turns on the encryption preparation command completion flag 541), and The encryption preparation command completion status is output to the terminal device 20 (542), and the process returns to the command data waiting state.

ステップS31において、暗号化$備コマンド5RND
でないと判断すると、制御素子15は、第6図(a)ま
たは(b)に示す書込みコマンドWRITEであるか否
かを判断しくS5]、)、もしそうでないと判断すると
、他のコマンド(たとえばデータの読出しコマンド)で
あるか否かの判断を行ない、対応する処理へ移行する。
In step S31, the encrypted $bi command 5RND
If not, the control element 15 determines whether or not it is the write command WRITE shown in FIG. 6(a) or (b). It is determined whether the command is a data read command) and the process moves to the corresponding process.

ステップS51において、書込みコマンドWRITEで
あると判断すると、制御素子15は、その書込みコマン
ドが第6図(a)の形式か(b)の形式かを判断しく5
52)、第6図(a)の書込みコマンドであれば、認証
準備コマンド完了フラグおよび暗号化準備コマンド完了
フラグを参照しく553)、どちらかでもオフとなって
いれば(S 54) 、条件不備ステータスを出力しく
555)、命令データ待ち状態に戻る。もしどちらかの
フラグがオンとなっていれば(S 54)、制御素子1
5は、書込みコマンド中のデータ部の内容を内部RA 
M上の第2ライトバツフアにセーブする(S56)。
In step S51, if it is determined that the write command is WRITE, the control element 15 determines whether the write command is in the format shown in FIG. 6(a) or in the format shown in FIG. 6(b).
52), if it is the write command in FIG. 6(a), refer to the authentication preparation command completion flag and the encryption preparation command completion flag 553), and if either is off (S 54), the condition is inadequate. Output the status (555) and return to the command data waiting state. If either flag is on (S54), control element 1
5 transfers the contents of the data section in the write command to the internal RA
Save to the second write buffer on M (S56).

ステップS52において、第6図(b)の書込みコマン
ドであれば、制御素子15は、内部で保持している書込
みコマンド継続フラグがオンか否かを判断する(S57
)。もしオフとなっていれば、制御素子15は、要求エ
ラーステータスを出力しく558)  命令データ待ち
状態に戻る。
In step S52, if the write command is shown in FIG. 6(b), the control element 15 determines whether the write command continuation flag held internally is on (S57
). If it is off, the control element 15 outputs a request error status (558) and returns to the command data waiting state.

もしオンとなっていれば、制御素子15は、内部RA 
M上のデータセーブバッファの内容に書返みコマンド中
のデータ部の内容(入力データ)を付加し、内部RAM
上の第2ライトバツフアにセーブする(S59)。
If it is on, the control element 15 controls the internal RA
The contents of the data section (input data) in the write-back command are added to the contents of the data save buffer on M, and the contents are saved in the internal RAM.
Save to the second write buffer above (S59).

そして、制御素子15は、書込みコマンド中のデータ部
の内容(入力データ)のみを内部RA M上の第1ライ
トバツフアにセーブする(S60)。
Then, the control element 15 saves only the contents (input data) of the data portion of the write command in the first write buffer on the internal RAM (S60).

次に、制御素子15は、第6図(a)または(b)の書
込みコマンドによって送られた入力データに書込み後続
データが存在するか否かをチエツクしく561)、書込
み後続データが存在すれば後続フラグをオンしく562
)、書込み後続データが存在しなければ後続フラグをオ
フする(363)。
Next, the control element 15 checks whether writing succeeding data exists in the input data sent by the write command of FIG. 6(a) or (b) (561), and if writing succeeding data exists, Turn on the subsequent flag 562
), and if there is no subsequent write data, the subsequent flag is turned off (363).

次に、制御素子15は、内部RAM上の第2ライトバツ
フア内のデータのバイト数が例えば「8」の倍数である
か否かをチエツクしく564)、もしそうであればステ
ップS70に移行する。もしそうでなければ、制御素子
15は、後続フラグを参照してオフとなっていれば(S
65)  内部RAM上の第2ライトバツフア内のデー
タにパディング処理(たとえば−20−Hexデータを
後ろに付加)L (S66)、「8」の倍数分のデータ
を生成してステップS70に移行する。
Next, the control element 15 checks whether the number of bytes of data in the second write buffer on the internal RAM is, for example, a multiple of "8" (564), and if so, proceeds to step S70. If not, the control element 15 refers to the subsequent flag and if it is off (S
65) Pad the data in the second write buffer on the internal RAM (for example, add -20-Hex data to the end) L (S66), generate data for a multiple of "8", and proceed to step S70.

ステップS65において、後続フラグがオンとなってい
れば、制御素子15は、「8」の倍数分のデータを残し
、残りのデータを内部RAM上のデータセーブバッファ
に移動する(S 67)。すなわち、たとえば第2ライ
トバツフアに18バイトのデータが存在すれば、16バ
イトのデータのみを残して残りの2バイトはデータセー
ブバッファに移動する。このとき、内部RAM上の第2
ライトバツフア内が空となっていなければ(’568)
、ステップS70に移行する。
If the subsequent flag is on in step S65, the control element 15 leaves the data for a multiple of "8" and moves the remaining data to the data save buffer on the internal RAM (S67). That is, for example, if 18 bytes of data exist in the second write buffer, only 16 bytes of data are left and the remaining 2 bytes are moved to the data save buffer. At this time, the second
If the write buffer is not empty ('568)
, the process moves to step S70.

ステ・シブ368において、内部RAM上の第2ライト
バツフア内が空となっていれば(たとえば第2ライトバ
ツフア内に7バイトのデータがあれば、先の処理で第2
ライトバツフア内のデータ全てがデータセーブバッファ
に移動されるため、結果として第2ライトバツフアは空
となる)、制御素子15は、今回アクセスしているエリ
アが書込み時に暗号化するエリアか否かを判断する(S
 69)。そして、もしそうでなければステップS71
に移行し、もしそうであればステップS79に移行する
In step 368, if the second write buffer on the internal RAM is empty (for example, if there is 7 bytes of data in the second write buffer, the second
(Since all the data in the write buffer is moved to the data save buffer, the second write buffer becomes empty as a result).The control element 15 determines whether the area being accessed this time is an area to be encrypted when writing. (S
69). If not, step S71
If so, the process moves to step S79.

さて、ステップS70において、制御素子15は、暗号
化部13により、内部RAM上の第2ライトバツフア内
のデータを例えばCBCモードで暗号化する。このとき
、継続フラグがオフとなっていれば、内部RAM上の第
1乱数バツフアの内容にカード固有値を排他的論理和し
たものを、また継続フラグがオンとなっていれば、前回
の書込みで暗号化したデータの最終8バイトをそれぞれ
初期値として、今回のCBCモード暗号化に使用する。
Now, in step S70, the control element 15 causes the encryption unit 13 to encrypt the data in the second write buffer on the internal RAM in, for example, CBC mode. At this time, if the continuation flag is off, the content of the first random number buffer on the internal RAM is written using the exclusive OR of the card-specific value, and if the continuation flag is on, the content of the previous write is used. The last 8 bytes of the encrypted data are used as initial values for the current CBC mode encryption.

また、このときのキーデータは第1キーバツフアの内容
を使用し、暗号化アルゴリズムは保持されている暗号化
アルゴリズム番号により選択的に使用する。そして、こ
の処理が終了するとステップS71に移行する。
Further, the contents of the first key buffer are used as the key data at this time, and the encryption algorithm is selectively used depending on the stored encryption algorithm number. When this process ends, the process moves to step S71.

ステップS71において、制御素子15は、継続フラグ
かオンされているか否かを判断し、オンされていればア
クセス対象エリアが暗号化を要するエリアか否かを判断
する(S72)。もし暗号化を要するエリアでなければ
、制御素子15は、内部RAM上の第1ライトバツフア
の内容に書込みコマンド中の書込みデータのバイト数L
Xを付加して、メモリ部11のアクセス対象エリア内に
データを書込む(37B)。また、もし暗号化を要する
エリアであれば、制御素子15は、書込みデータのバイ
ト数LXよりも大なる「8」の倍数で、最少の値をLX
’ とし、これを第2ライトバツフア内のデータを付加
して書込む(S 74)。
In step S71, the control element 15 determines whether the continuation flag is on, and if so, determines whether the access target area is an area that requires encryption (S72). If the area does not require encryption, the control element 15 writes the number of bytes L of write data in the write command to the contents of the first write buffer on the internal RAM.
The data is written in the access target area of the memory unit 11 by adding an X (37B). In addition, if the area requires encryption, the control element 15 selects a minimum value LX that is a multiple of "8" that is larger than the number of bytes LX of the write data.
' and writes this with the data in the second write buffer added (S74).

ステップS71において、継続フラグがオンされていれ
ば、制御素子15は、アクセス対象エリアが暗号化を要
するエリアか否かを判断する(S 75)。もし暗号化
を要するエリアでなければ、制御素子15は、内部RA
M上の第1ライトバツフアの内容を先に書込んだデータ
に追加して書込む(S76)。また、もし暗号化を要す
るエリアであれば、1す御素子15は、内部RAM上の
第2ライトバツフアの内容を同様に書込む(S 77)
If the continuation flag is turned on in step S71, the control element 15 determines whether the access target area is an area that requires encryption (S75). If the area does not require encryption, the control element 15 uses the internal RA
The contents of the first write buffer on M are added to the previously written data and written (S76). If the area requires encryption, the first control element 15 similarly writes the contents of the second write buffer on the internal RAM (S77).
.

さて、データを書込んだ後は、制御素子15は、後続フ
ラグがオンされているか否かを判断しく878)、オン
されていれば継続フラグをオンしてレスポンス−nb−
を出力しくS 79)命令データ待ち状態に戻る。もし
、後続フラグがオフとなっていれば、制御素子15は、
内部RA M上の第2ライトバツフアの内容の最終8バ
イトを出力して継続フラグをオフしく580)、命令デ
ータ待ち状態に戻る。
Now, after writing the data, the control element 15 judges whether or not the subsequent flag is turned on (878). If it is turned on, it turns on the continuation flag and responds -nb-
S79) Return to command data waiting state. If the subsequent flag is off, the control element 15
It outputs the last 8 bytes of the contents of the second write buffer on the internal RAM, turns off the continuation flag (580), and returns to the instruction data waiting state.

このように、ICカードの内部に保有している複数のキ
ーデータおよび複数の暗号化アルゴリズムのうち1つの
キーデータおよび1つの暗号化アルゴリズムを端末装置
から指定し、この指定したキーデータおよび暗号化アル
ゴリズムを用いて書込みデータを暗号化することにより
、複数のアプリケーションでICカードが使用されるこ
とになっても、各アプリケーションで使用する正当性確
語用のキーデータおよび暗号化アルゴリズムを選択的に
運用でき、アプリケーション間のセキュリティを確保す
ることが可能となる。
In this way, one key data and one encryption algorithm from among the plurality of key data and plurality of encryption algorithms held inside the IC card are specified from the terminal device, and the specified key data and encryption By encrypting written data using an algorithm, even if an IC card is used in multiple applications, the key data and encryption algorithm for confirming validity can be selectively used in each application. This makes it possible to maintain security between applications.

なお、端末装置20からICカード10に送信される乱
数データR1,R3は、その都度内容が同一のデータで
あってもよいが、その都度内容の異なるデータとするこ
とにより、同一の書込みデータ、キーデータおよび暗号
化アルゴリズムであっても、書込み時間が異なれば出力
される暗号化データも異なるものになり、正当性の確認
が容易となる。
Note that the random number data R1 and R3 transmitted from the terminal device 20 to the IC card 10 may have the same content each time, but by making the random number data R1 and R3 different each time, the same write data, Even if the key data and encryption algorithm are different, if the writing time is different, the encrypted data output will be different, making it easy to confirm the authenticity.

この場合、端末装置20内において、たとえば時計回路
を設け、この時計回路から発生する時間情報を用いて乱
数データR1,R3を生成することにより、容易にその
都度内容の異なるデータを得ることができる。
In this case, by providing, for example, a clock circuit in the terminal device 20 and generating random number data R1 and R3 using time information generated from this clock circuit, it is possible to easily obtain data with different contents each time. .

[発明の効果コ 以上詳述したように本発明の認証方式によれば、たとえ
ば複数のアプリケーションでICカドが使用されること
になっても、各アプリケーションで使用する正当性確認
用のキーデータおよび暗号化アルゴリズムを選択的に運
用でき、アプリケーション間のセキュリティを確保する
ことが可能となる。
[Effects of the Invention] As detailed above, according to the authentication method of the present invention, even if an IC card is used in multiple applications, key data and key data for validation used in each application can be used. Encryption algorithms can be used selectively, making it possible to ensure security between applications.

また、本発明の認証方式によれば、同一の書込みデータ
、キーデータおよび暗号化アルゴリズムであっても、書
込み時間が異なれば出力される暗号化データも異なるも
のになり、正当性の確認が容易となる。
Furthermore, according to the authentication method of the present invention, even if the written data, key data, and encryption algorithm are the same, if the writing time is different, the output encrypted data will be different, making it easy to confirm the authenticity. becomes.

【図面の簡単な説明】[Brief explanation of the drawing]

図は本発明の一実施例を説明するだめのもので、第1図
はICカードと端末装置との間の相互認証手順および端
末装置からICカードへのデータ書込み手順を示す図、
第2図はメモリ部の構成を示す図、第3図は認証L$8
コマンドのフォーマット例を示す図、第4図は認証コマ
ンドのフォーマット例を示す図、第5図は暗号化準備コ
マンドのフォーマット例を示す図、第6図は書込みコマ
ンドのフォーマット例を示す図、第7図はICカードの
動作を説明するフローチャート、第8図はICカードと
端末装置とセンタとのシステム構成図である。 10・・・ICカード(第1の電子装置)、11・・・
メモリ部、12・・・乱数発生部、13・・・暗号化部
、14・・・コンタクト部、15・・・制御素子、20
・・・端末装置(第2の電子装置) 21・・・メモ′
り部、22・・・乱数発生部、23・・・暗号化部、2
6・・・コンタクト部、27・・・通信制御部、28・
・・制御部、30・・・センタ(ホストコンピュータ)
。 第3図 第4図 第5図
The figures are for explaining one embodiment of the present invention, and FIG. 1 is a diagram showing a mutual authentication procedure between an IC card and a terminal device and a data writing procedure from the terminal device to the IC card.
Figure 2 is a diagram showing the configuration of the memory section, Figure 3 is the authentication L$8
FIG. 4 is a diagram showing an example format of a command. FIG. 5 is a diagram showing an example format of an encryption preparation command. FIG. 6 is a diagram showing an example format of a write command. FIG. 7 is a flowchart explaining the operation of the IC card, and FIG. 8 is a system configuration diagram of the IC card, terminal device, and center. 10... IC card (first electronic device), 11...
Memory section, 12... Random number generation section, 13... Encryption section, 14... Contact section, 15... Control element, 20
...Terminal device (second electronic device) 21...Memo'
22... Random number generation section, 23... Encryption section, 2
6... Contact section, 27... Communication control section, 28.
...Control unit, 30...Center (host computer)
. Figure 3 Figure 4 Figure 5

Claims (4)

【特許請求の範囲】[Claims] (1) 第1の電子装置と、この第1の電子装置との間
で通信可能な第2の電子装置とからなり、第2の電子装
置から第1の電子装置に対し第1のデータおよび、その
第1のデータを暗号化するためのキーデータを指定する
指定データを送信する手段と、 第1の電子装置において、前記第1のデータおよび指定
データを受信すると、あらかじめ用意された少なくとも
1つのキーデータの中から前記受信した指定データに基
づき1つのキーデータを選択し、この選択したキーデー
タを使用して前記受信した第1のデータを暗号化する手
段と、 第1の電子装置において、前記第1のデータを全て受信
した後に、その暗号化データのうち一部のデータを第2
の電子装置に送信する手段とを具備したことを特徴とす
る認証方式。
(1) Consisting of a first electronic device and a second electronic device that can communicate with the first electronic device, the second electronic device transmits first data and data to the first electronic device. , means for transmitting specification data specifying key data for encrypting the first data; and when the first electronic device receives the first data and the specification data, at least one means for selecting one key data based on the received specified data from among the two key data and encrypting the received first data using the selected key data; , after receiving all the first data, some of the encrypted data is sent to the second
An authentication method characterized by comprising a means for transmitting data to an electronic device.
(2) 第1の電子装置と、この第1の電子装置との間
で通信可能な第2の電子装置とからなり、第2の電子装
置から第1の電子装置に対し第1のデータおよび、その
第1のデータを暗号化するためのキーデータおよび暗号
化アルゴリズムを指定する指定データを送信する手段と
、 第1の電子装置において、前記第1のデータおよび指定
データを受信すると、あらかじめ用意された少なくとも
1つのキーデータおよび少なくとも1つの暗号化アルゴ
リズムの中から前記受信した指定データに基づき1つの
キーデータおよび1つの暗号化アルゴリズムを選択し、
この選択したキーデータおよび暗号化アルゴリズムを使
用して前記受信した第1のデータを暗号化する手段と、
第1の電子装置において、前記第1のデータを全て受信
した後に、その暗号化データのうち一部のデータを第2
の電子装置に送信する手段とを具備したことを特徴とす
る認証方式。
(2) Consisting of a first electronic device and a second electronic device capable of communicating with the first electronic device, the second electronic device transmits first data and data to the first electronic device. , means for transmitting key data for encrypting the first data and specification data specifying an encryption algorithm; selecting one key data and one encryption algorithm from among the at least one key data and at least one encryption algorithm based on the received specified data;
means for encrypting the received first data using the selected key data and encryption algorithm;
After receiving all of the first data, the first electronic device transfers some of the encrypted data to a second electronic device.
An authentication method characterized by comprising a means for transmitting data to an electronic device.
(3) 第1の電子装置と、この第1の電子装置との間
で通信可能な第2の電子装置とからなり、第2の電子装
置から第1の電子装置に対し第1のデータおよび、その
都度内容の異なる第2のデータを送信する手段と、 第1の電子装置において、前記第1のデータおよび第2
のデータを受信すると、その受信した第2のデータ、あ
らかじめ用意されたキーデータおよび暗号化アルゴリズ
ムを使用して前記受信した第1のデータを暗号化する手
段と、 第1の電子装置において、前記第1のデータを全て受信
した後に、その暗号化データのうち一部のデータを第2
の電子装置に送信する手段とを具備したことを特徴とす
る認証方式。
(3) Consisting of a first electronic device and a second electronic device capable of communicating with the first electronic device, the second electronic device transmits first data and data to the first electronic device. , means for transmitting second data having different contents each time; and means for transmitting second data having different contents each time;
means for encrypting the received first data using the received second data, key data prepared in advance, and an encryption algorithm; After receiving all the first data, some of the encrypted data is transferred to the second
An authentication method characterized by comprising a means for transmitting data to an electronic device.
(4) 第1の電子装置は、少なくとも1つのメモリ部
と、このメモリ部に受信した第1のデータを記憶する手
段を更に具備したことを特徴とする請求項1ないし3記
載の認証方式。
(4) The authentication method according to claim 1, wherein the first electronic device further comprises at least one memory section and means for storing the received first data in the memory section.
JP1008010A 1989-01-17 1989-01-17 Certification system Pending JPH02187888A (en)

Priority Applications (6)

Application Number Priority Date Filing Date Title
JP1008010A JPH02187888A (en) 1989-01-17 1989-01-17 Certification system
GB8929239A GB2227111B (en) 1989-01-17 1989-12-28 Certification system
KR1019900000428A KR900012179A (en) 1989-01-17 1990-01-15 Data authentication system and its authentication method
FR9000511A FR2641885A1 (en) 1989-01-17 1990-01-17 DATA VERIFICATION SYSTEM FOR A PAYMENT CARD
US07/942,337 US5293029A (en) 1989-01-17 1992-09-09 System for mutually certifying an IC card and an IC card terminal
HK98102223A HK1003129A1 (en) 1989-01-17 1998-03-17 Certification system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1008010A JPH02187888A (en) 1989-01-17 1989-01-17 Certification system

Publications (1)

Publication Number Publication Date
JPH02187888A true JPH02187888A (en) 1990-07-24

Family

ID=11681381

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1008010A Pending JPH02187888A (en) 1989-01-17 1989-01-17 Certification system

Country Status (1)

Country Link
JP (1) JPH02187888A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002345037A (en) * 2001-05-17 2002-11-29 Sony Corp Portable communication apparatus, communication system and communication method therefor
US6526511B1 (en) 1997-12-25 2003-02-25 Nippon Telegraph And Telephone Corporation Apparatus and method for modifying microprocessor system at random and maintaining equivalent functionality in spite of modification, and the same microprocessor system
US8879724B2 (en) 1998-01-02 2014-11-04 Rambus Inc. Differential power analysis—resistant cryptographic processing
US9852572B2 (en) 1998-07-02 2017-12-26 Cryptography Research, Inc. Cryptographic token with leak-resistant key derivation

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62118471A (en) * 1985-11-19 1987-05-29 Nec Corp Accounting device
JPS62166489A (en) * 1986-01-20 1987-07-22 Nippon Telegr & Teleph Corp <Ntt> Ic card system
JPS63273980A (en) * 1987-05-01 1988-11-11 Toshiba Corp Mutual confirmation system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62118471A (en) * 1985-11-19 1987-05-29 Nec Corp Accounting device
JPS62166489A (en) * 1986-01-20 1987-07-22 Nippon Telegr & Teleph Corp <Ntt> Ic card system
JPS63273980A (en) * 1987-05-01 1988-11-11 Toshiba Corp Mutual confirmation system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6526511B1 (en) 1997-12-25 2003-02-25 Nippon Telegraph And Telephone Corporation Apparatus and method for modifying microprocessor system at random and maintaining equivalent functionality in spite of modification, and the same microprocessor system
US8879724B2 (en) 1998-01-02 2014-11-04 Rambus Inc. Differential power analysis—resistant cryptographic processing
US9419790B2 (en) 1998-01-02 2016-08-16 Cryptography Research, Inc. Differential power analysis—resistant cryptographic processing
US9852572B2 (en) 1998-07-02 2017-12-26 Cryptography Research, Inc. Cryptographic token with leak-resistant key derivation
JP2002345037A (en) * 2001-05-17 2002-11-29 Sony Corp Portable communication apparatus, communication system and communication method therefor

Similar Documents

Publication Publication Date Title
US5293029A (en) System for mutually certifying an IC card and an IC card terminal
US5225664A (en) Mutual authentication system
US5202922A (en) Data communication system
JP4681314B2 (en) Wireless communication system, reader / writer device, key management method, and computer program
JPH04143881A (en) Mutual authenticating system
WO2005098622A1 (en) Semiconductor memory
JP2005056305A (en) Information storage device with split area in memory area
JP3480746B2 (en) Portable electronic devices
GB2227111A (en) Certification system
US20080284572A1 (en) Data control system, control server, data control method, and program
JPH02187888A (en) Certification system
JPH02187785A (en) Authenticating system
JP2856415B2 (en) Portable electronic devices
US11455617B2 (en) Type 4 NFC tags as protocol interface
JP3545045B2 (en) Creating a pattern file for IC card access
JP3526287B2 (en) Portable electronic device and data writing method thereof
JP5022434B2 (en) IC chip supporting large capacity memory and supporting method
JPH02255397A (en) Portable electronic device
JP2537200B2 (en) Portable electronic devices
JPH02255396A (en) Portable electronic device
JPH09179949A (en) Portable information recording medium and its reader/ writer device
JPH02255399A (en) Portable electronic device
JPH02255395A (en) Portable electronic device
JP3231466B2 (en) Information recording medium storing keys
JP3911153B2 (en) Multi-application IC card and writing method thereof