JPS62200442A - Ic card - Google Patents
Ic cardInfo
- Publication number
- JPS62200442A JPS62200442A JP61041647A JP4164786A JPS62200442A JP S62200442 A JPS62200442 A JP S62200442A JP 61041647 A JP61041647 A JP 61041647A JP 4164786 A JP4164786 A JP 4164786A JP S62200442 A JPS62200442 A JP S62200442A
- Authority
- JP
- Japan
- Prior art keywords
- data
- file
- secret
- card
- area
- 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
Links
Landscapes
- Credit Cards Or The Like (AREA)
- Storage Device Security (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は、BP−ROM或いはEEP−ROM等の不揮
発性半導体メモリより成る記憶手段と、該記憶手段に対
するデータの書込み、読出し等のデータ処理を制御する
マイクロコンピュータ等より成るデータ処理制御手段と
を備えたICカードに関するものである。Detailed Description of the Invention [Field of Industrial Application] The present invention relates to a storage means made of a non-volatile semiconductor memory such as a BP-ROM or an EEP-ROM, and data processing such as writing and reading data to the storage means. The present invention relates to an IC card equipped with a data processing control means comprising a microcomputer or the like for controlling the IC card.
(従来の技術)
上記ICカードは、旧来の磁気カードと比較して、デー
タの記憶容量が大きいこと、およびデータのセキュリテ
ィ管理が比較的容易に行なえること、等の利点を有して
いる。(Prior Art) The IC card has advantages over conventional magnetic cards, such as a large data storage capacity and relatively easy data security management.
例えば特公昭60−1666号や特開昭59−7538
0号においては、ICカード内の記憶手段の一部に予め
記憶書込みされて成る秘密コードと、該秘密コードに対
応して外部からICカードに対して与えられる照合コー
ドとを、ICカード内のデータ処理制御手段にて所定の
手法で比較し、その結果、正当な照合のとれた場合のみ
、記憶手段内のデータメモリエリアに対するアクセスを
許可するように構成されたIcカードが開示されている
。For example, JP-A-60-1666 and JP-A-59-7538.
In No. 0, a secret code pre-stored in a part of the storage means in the IC card and a verification code given to the IC card from the outside in correspondence with the secret code are stored in the IC card. An IC card is disclosed that is configured to perform a comparison using a predetermined method in a data processing control means, and permit access to a data memory area in a storage means only when a valid match is obtained as a result.
また特公昭58−57785号や特開昭59−7769
9号においては、【Cカード内の記憶手段のデータメモ
リエリアを複数個のブロックに分割するとともに、例え
ば書込みと読出しとの両方を禁止したブロック、書込み
は禁止しながら読出しについては許可したブロック、書
込みと読出しの両方を許可したブロック、さらには記憶
の消去を禁止したブロック等の如く、各ブロックごとに
データのプロテクトの程度を変えて成るICカードが開
示されている。Also, Japanese Patent Publication No. 58-57785 and Japanese Patent Publication No. 59-7769
In No. 9, [the data memory area of the storage means in the C card is divided into a plurality of blocks, and for example, a block in which both writing and reading are prohibited, a block in which writing is prohibited but reading is permitted, An IC card has been disclosed in which the degree of data protection is changed for each block, such as a block that allows both writing and reading, and a block that prohibits erasure of memory.
上記のような従来のICカードは、確かに磁気カードと
比較した場合には、データの記憶容量は大きく、かつデ
ータの保護やセキュリティ管理についても優れたものと
なっている。しかしICカード内に実際に記憶したい様
々なデータについて考えると、誰あるいはどのようなI
Cカード用端末器に対してアクセスを許可するかという
意味での第1のセキュリティのレベルと、書込みと読出
しのうちのどこまでアクセスを許可するかという意味で
の第2のセキュリティのレベルとがあり、この第1と第
2のセキュリティのレベルの両方がデータの性格に基づ
いて常に一義的に決定されるとは限らないというのが現
実である。Conventional IC cards such as those described above certainly have a large data storage capacity and are superior in data protection and security management when compared with magnetic cards. However, when we think about the various data that we actually want to store in an IC card, who or what kind of information is stored in the IC card?
There is a first security level in the sense of whether access is permitted to the C card terminal, and a second security level in the sense of how far access is permitted between writing and reading. The reality is that both the first and second security levels are not always uniquely determined based on the nature of the data.
すなわち金融取引関係用のICカードにおいて、金融機
関側の正規システム内のICカード用端末と正当なカー
ド所有者との組み合わせの下でのデータへのアクセスと
いうものを想定すると、一方で前記第1のセキュリティ
のレベルについて考えると、盗難や拾得されたICカー
ドの不正使用の防止、および不正なカードアクセス用ツ
ール等によるデータの改ざん(不正なデータ書込みや修
正等)の防止のためには、少なくともカードの所有者の
正当性とICカード用端末器の正当性との両方を認証す
ることが必要であり、従ってカード所有者の正当性を判
定するための所有者秘密コード、およびICカード用端
末器の正当性を判定するためのホスト機器秘密コードの
設定と、それらの照合とが必要となる。また前記第2の
セキュリティのレベルから考えると、上記のような場合
には例えば残高や取引き内容等のデータの読出しと書込
みとの両方が許可される必要があることは明らかである
。In other words, in the case of an IC card for financial transactions, assuming that data is accessed through a combination of an IC card terminal in a formal system on the financial institution side and a legitimate cardholder, on the other hand, the first Considering the level of security of the IC card, at least one method is necessary to prevent unauthorized use of stolen or found IC cards, and to prevent data tampering (such as unauthorized data writing or modification) by unauthorized card access tools. It is necessary to authenticate both the validity of the card owner and the validity of the IC card terminal. In order to determine the authenticity of the device, it is necessary to set a host device secret code and check them. Considering the second security level, it is clear that in the above case, it is necessary to permit both reading and writing of data such as balances and transaction details.
しかるに他方では、例えば上記と同じ金融関係用のIC
カードに対して、家庭内に設置された所謂ホームターミ
ナル内のICカード用端末によって、カード所有者が自
分のカード内に記憶されている残高や取引き内容等のデ
ータを読出して確認できるようにすることも提案されて
いる。その場合において前記第1のセキュリティのレベ
ルを考えると、データの読出しを許可する上でプライバ
シーの保護を考慮するとしても、カード所有者秘密コー
ドによってカード所有者の正当性を判定すれば充分であ
り、ホームターミナル内のICカード用端末内にまで、
前述のICカード用端末器の正当性を判定するためのホ
スト機器秘密コードが何らかの形で入り込むということ
は不必要であるばかりか、セキュリティの面でも危険か
つ不都合であることは明らかである。またこの場合の前
記第2のモー1−ユリティのレベルについて考えれば、
ホームターミナル内のICカード用端末に対してはデー
タの書込み(修正も含む)まで許可することは不都合で
あり、読出しのみを許可すれば充分であることは明らか
である。However, on the other hand, for example, the same financial IC as above
Card holders are now able to read and confirm data stored on their cards, such as balances and transaction details, using IC card terminals installed in so-called home terminals installed in their homes. It is also proposed that In that case, considering the first security level, even if privacy protection is taken into account when allowing data reading, it is sufficient to determine the legitimacy of the cardholder based on the cardholder secret code. , even inside the IC card terminal inside the home terminal.
It is clear that it is not only unnecessary but also dangerous and inconvenient in terms of security that the secret code of the host device for determining the validity of the above-mentioned IC card terminal be somehow infiltrated. Also, if we consider the level of the second mo-utility in this case,
It is inconvenient to allow writing (including modification) of data to the IC card terminal in the home terminal, and it is clear that it is sufficient to only allow reading.
以上のようにICカード内の同一のデータというものを
想定しても、一方にはデータの書込みと読出しとの両方
を許可する上で、照合しなければならない種類の秘密コ
ードがあって、他方には読出しのみを許可したい場合に
照合したい種類の秘密コードもあるというように、前述
の第1と第2のセキュリティのレベルの組み合わせが2
つ必要になることも想定されるが、前述のような従来の
ICカードにおいては、そのような意味でのセキュリテ
ィレベルの多様性に対しては、はとんど柔軟な対処はで
きないのが実情である。As mentioned above, even if we assume that the data in the IC card is the same, there is a type of secret code that must be verified to allow both writing and reading of data on one side, and the other side There is also a type of secret code that you want to check when you want to allow reading only, so the combination of the first and second security levels described above is
However, the reality is that conventional IC cards such as those mentioned above cannot flexibly deal with such diversity in security levels. It is.
すなわち一般的には、たとえ同一のブロック内のデータ
についても、前述の第2のセキュリティのレベルの如何
に応じて第1のセキュリティのレベルも変えていく必要
性というものが想定されるのに対して、従来のICカー
ドにおいては、ブロック別に第2のセキュリティのレベ
ルを変えるようなことまではできても、同一のプロ・ツ
ク内のデータに関しては、前述の第1と第2の両方のセ
キュリティのレベルというものを固定して対処すること
しかできず、実際のICカードの使用条件ノ中で想定さ
れる多様な局面に柔軟に対処していくことは不可能であ
った。In other words, it is generally assumed that even for data in the same block, it is necessary to change the first security level depending on the above-mentioned second security level. Therefore, in conventional IC cards, although it is possible to change the second security level for each block, when it comes to data within the same program, both the first and second security levels mentioned above are applied. It was only possible to deal with the situation at a fixed level, and it was impossible to flexibly deal with the various situations that could be expected under the actual usage conditions of the IC card.
本発明の目的は、前述のような第1、第2のセキュリテ
ィのレベルの組み合わせの変化に対して、容易かつ柔軟
に対処していくことができる新規なICカードを提供す
ることにある。さらに具体的には本発明は、同一ブロッ
ク内のデータについても、書込みと読出しとのアクセス
のうちの両方を許可する場合と、読出しのみを許可する
場合とで、互いに異なる種類あるいは互いに異なる種類
の組み合わせにおける秘密コードの照合を許可条件とす
ることができるようなICカードを提供するものである
。An object of the present invention is to provide a new IC card that can easily and flexibly deal with changes in the combination of the first and second security levels as described above. More specifically, the present invention provides for data in the same block to be accessed in different types or different types depending on whether both write and read access is permitted or when only read access is permitted. The present invention provides an IC card in which verification of a secret code in a combination can be a condition for permission.
上記の目的を達成するための本発明の構成を、第1図の
機能ブロック図に基づいて説明する。The configuration of the present invention for achieving the above object will be explained based on the functional block diagram of FIG.
記憶手段は、第1秘密コード〜第m秘密コードより成る
複数種類の秘密コードを記憶する秘密コードメモリエリ
アと、情報データを記憶するための1個以上のブロック
より成るデータメモリエリアと、該データメモリエリア
に対する書込みと読出しとの両方を許可する上で照合を
行うことが必要な秘密コードの種類を指定するための第
1の秘密属性データを記憶する第1秘密属性メモリエリ
アと、前記データメモリエリアに対する書込みと読出し
のうち、読出しのみを許可する上で照合を行うことが必
要な秘密コードの種類を指定するための第2の秘密属性
データを記憶する第2秘密属性メモリエリアとを含んで
いる。またデータ処理制御手段は、前記秘密コードに対
応して外部よりICカードに与えられる照合対象データ
と前記秘密コードとの間の照合を判定する照合判定手段
と、該照合判定手段による照合実行済みの秘密コードの
種類を一時的に記憶しておくための照合実行フラグ部と
、該照合実行フラグ部の内容と前記第1の秘密属性デー
タの内容との相互比較に基づいて、前記データメモリエ
リアに対する書込みと読出しとの両方の許可を決定する
第1のアクセス許可判定手段と、前記照合実行フラグ部
の内容と前記第2の秘密属性データの内容との相互比較
に基づいて、前記データメモリエリアに対する書込みと
読出しのうち続出しのみの許可を決定する第2のアクセ
ス許可判定手段とを含んでいる。すなわち第1の秘密属
性データは、書込みと読出しの両方の許可を得る上で、
前記第1〜第mの秘密コードのうちのいずれに関する照
合を必要とするかを指定しているもので、第2の秘密属
性データは、書込みと読出しのうち読出しのみの許可を
得る上で、いずれに関する照合を必要とするかを指定し
ているものである。また第1のアクセス許可判定手段は
、照合実行フラグ部を参照して、第1の秘密属性データ
によって指定されている種別の秘密コードが既に照合実
行済みであることを確認したときのみ、データメモリエ
リアへの書込みと読出しとの両方のアクセスを許可し、
第2のアクセス許可判定手段は、照合実行フラグ部を参
照して、第2の秘密属性データによって指定されている
種別の秘密コードが既に照合実行済みであることを確認
したときのみ、データメモリエリアへの読出しのみのア
クセスを許可する。すなわち第1の秘密属性データメモ
リーエリアと第1のアクセス許可判定手段とが、第1の
アクセス許可制御手段を構成しており、第2の秘密属性
データメモリーエリアと第2のアクセス許可判定手段と
が、第2のアクセス許可制御手段を構成している。The storage means includes a secret code memory area for storing a plurality of types of secret codes consisting of a first secret code to an mth secret code, a data memory area consisting of one or more blocks for storing information data, and a data memory area for storing information data. a first secret attribute memory area that stores first secret attribute data for specifying the type of secret code that needs to be verified in order to permit both writing and reading from the memory area; and the data memory. and a second secret attribute memory area for storing second secret attribute data for specifying the type of secret code that needs to be verified in order to permit only reading among writing and reading to the area. There is. Further, the data processing control means includes a verification determination means for determining verification between the verification target data given to the IC card from the outside in response to the secret code and the secret code, and a verification determination means that determines the verification between the verification target data given to the IC card from the outside in correspondence with the secret code, and A verification execution flag section for temporarily storing the type of the secret code, and a comparison of the contents of the verification execution flag section and the contents of the first secret attribute data, and the information stored in the data memory area. a first access permission determining means that determines permission for both writing and reading; and a first access permission determining means that determines permission for both writing and reading; A second access permission determination means is included for determining permission for only continuous reading out of writing and reading. In other words, the first secret attribute data is required to obtain permission for both writing and reading.
The second secret attribute data specifies which of the first to m-th secret codes requires verification, and the second secret attribute data is used to obtain permission for only reading out of writing and reading. This specifies which items need to be verified. Further, the first access permission determination means refers to the verification execution flag section and only when it is confirmed that verification has already been performed for the secret code of the type specified by the first secret attribute data, the data memory Allow both write and read access to the area,
The second access permission determination means refers to the verification execution flag section and only when it is confirmed that verification has already been performed for the secret code of the type specified by the second secret attribute data, the data memory area is Allow read-only access to. That is, the first secret attribute data memory area and the first access permission determination means constitute the first access permission control means, and the second secret attribute data memory area and the second access permission determination means constitute the first access permission determination means. constitutes the second access permission control means.
なおICカードと外部との間のデータの送・受信は、所
定のシリアル通信手段を介して行なわれる。Note that data is transmitted and received between the IC card and the outside through a predetermined serial communication means.
以下、本発明の実施例を図に従って説明する。 Embodiments of the present invention will be described below with reference to the drawings.
第2図〜第17図は、本発明の1実施例によるICカー
ドを示す。2 to 17 show an IC card according to one embodiment of the present invention.
第2図はICカードと親機のシステム構成を示すブロッ
ク図であり、(a)はICカード側を、また(b)はリ
ーグ・ライタ機能を含む親機(ICカード用端末)側を
示す。Figure 2 is a block diagram showing the system configuration of the IC card and base unit, with (a) showing the IC card side and (b) showing the base unit (IC card terminal) side including the league writer function. .
ICカード1は、CPU2、データ等の一時的記憶用の
RAM3、プログラム記憶用ROM4、I10ボート5
、およびパスライン6等より成るマイクロコンピュータ
部と、不揮発性半導体メモリより成る記憶手段としての
EEP−ROM7より構成される。なお本実施例におい
ては、EEP−ROM7は、I10ボート5を介してマ
イクロコンピュータ部からアドレス信号、制御信号を受
けたりデータ信号の授受を行うことによって、データ書
込みや読出しが行なわれるように構成されているが、M
NOSあるいはFAMOS等より成るEEP−ROM7
とマイクロコンピュータ部とを合わせて1つのICチッ
プとして構成することも可能である。The IC card 1 includes a CPU 2, a RAM 3 for temporary storage of data, etc., a ROM 4 for program storage, and an I10 board 5.
, a microcomputer section including a pass line 6, etc., and an EEP-ROM 7 as a storage means consisting of a nonvolatile semiconductor memory. In this embodiment, the EEP-ROM 7 is configured to write and read data by receiving address signals and control signals from the microcomputer section via the I10 port 5, and by exchanging data signals. Although, M
EEP-ROM7 consisting of NOS or FAMOS, etc.
It is also possible to configure the microcomputer section and the microcomputer section as one IC chip.
一方、親機10は、CPUII、RAM12、V−RA
M(ビデオRAM)13、ROM14、I10ボート1
5、パスライン16、表示コントローラ17、表示部1
8、およびキーボード19より構成されている。On the other hand, the base device 10 has a CPU II, a RAM 12, a V-RA
M (video RAM) 13, ROM 14, I10 boat 1
5, pass line 16, display controller 17, display section 1
8 and a keyboard 19.
親機10のI10ボート15の一部より導出されている
リセット信号供給端子tOa、クロック信号供給端子1
0bおよび送・受信用シリアル通信端子10Cは、それ
ぞれICカード1側のリセット端子1a、クロック信号
入力端子1bおよび送・受信用シリアル通信端子ICと
対応して設けられているもので、ICカード1が親機1
0に取り込まれている状態においては、上記の対応する
端子が互いに接続し合うように構成されている。A reset signal supply terminal tOa and a clock signal supply terminal 1 derived from a part of the I10 boat 15 of the main unit 10
0b and serial communication terminal 10C for transmission/reception are provided corresponding to reset terminal 1a, clock signal input terminal 1b, and serial communication terminal IC for transmission/reception on the IC card 1 side, respectively. is the main unit 1
In the state where the signal is set to 0, the corresponding terminals are connected to each other.
なおICカード1側と親機10側とは、上記の端子の他
、電源の供給用端子および受給用端子も有しているが、
第2図においては、電源関係のブロックおよびラインは
、図の簡素化のため、に全で省略されている。In addition to the above-mentioned terminals, the IC card 1 side and the base unit 10 side also have power supply terminals and power reception terminals.
In FIG. 2, all power supply related blocks and lines are omitted to simplify the diagram.
次に第3図は、記憶手段として設けられたEEP−RO
Mの概略的なメモリエリア分割状態を示すマツプ図であ
る。本実施例のEEP−ROM7は、自由な読出しが可
能なオープンIDエリア20、複数種類の秘密コードを
記憶するために設けられた秘密コードメモリエリア30
、後述の照合の連続失敗回数やカードの無効化マーク等
を記憶するために設けられたディゼープルフラグエリア
40、ファイルディレクトリエリア50、およびデータ
メモリエリアとして設けられたファイルエリア60等に
分割されている。Next, FIG. 3 shows the EEP-RO installed as a storage means.
FIG. 3 is a map diagram showing a schematic memory area division state of M. FIG. The EEP-ROM 7 of this embodiment includes an open ID area 20 that can be read freely, and a secret code memory area 30 that is provided for storing a plurality of types of secret codes.
, a disaster flag area 40 provided for storing the number of consecutive verification failures, a card invalidation mark, etc., which will be described later, a file directory area 50, and a file area 60 provided as a data memory area. ing.
なお上記オーブンIDエリア20は、カードメーカー、
カード発行者、カード所有者等を示す公開ID情報を記
憶しているデータエリアである。また本実施例では、デ
ータメモリエリアは第1フアイル〜第3フアイルより成
る3個のブロックに分割されている。Note that the oven ID area 20 above is for card manufacturers,
This is a data area that stores public ID information indicating the card issuer, card owner, etc. Further, in this embodiment, the data memory area is divided into three blocks consisting of the first file to the third file.
さらに第4図は、秘密コードメモリエリアの詳細を示す
マツプ図であり、秘密コードメモリエリア30内には、
カード発行者を照合するためのカード発行者IDコード
、カードの所有者を照合するための所有者IDコード、
およびカードの有効流通グループ等を照合するためのグ
ループ【Dコードの3種類の秘密コードを記憶できるよ
うに構成されており、このエリアに関する記憶内容のI
Cカード外部への直接的な読出しは全て禁止されている
。なお」−記グループIDコードは、例えば特定の複数
のカード発行者が互いに他の発行者により発行されたカ
ードを相互に受入れるグループを形成している場合に、
そのグループを特定するためにグループ内の各親機で共
有される秘密コードであり、その意味ではICカード用
端末器の正当性を確認するためのホスト機器秘密コード
としての機能を果たしているものである。Furthermore, FIG. 4 is a map diagram showing the details of the secret code memory area, and the secret code memory area 30 includes:
a card issuer ID code for verifying the card issuer; an owner ID code for verifying the card owner;
and a group for checking the card's effective distribution group, etc. [It is configured so that it can store three types of secret codes such as the D code, and the I/O of the memory contents related to this area.
All direct reading to the outside of the C card is prohibited. Note that the group ID code is used, for example, when a plurality of specific card issuers form a group that mutually accepts cards issued by other issuers.
It is a secret code shared by each base unit in the group to identify the group, and in that sense, it functions as a host device secret code to confirm the validity of the IC card terminal. be.
また第5図は、ファイルディレクトリエリア50の一部
である第1フアイル用デイレクトリエリアを示すマツプ
図である。FIG. 5 is a map showing a first file directory area which is a part of the file directory area 50. As shown in FIG.
各ファイル用ディレクトリエリアは、それぞれファイル
名エリア51、秘密属性メモリエリア52、プロテクト
属性メモリエリア53、ファイルヘッダー先頭アドレス
54より構成されており、このような個別ファイル用デ
ィレクトリ部がデータメモリエリアの各ブロック(ファ
イル)に対応して、それぞれ互いに独立して設けられて
いる。Each file directory area is composed of a file name area 51, a secret attribute memory area 52, a protect attribute memory area 53, and a file header start address 54. Such an individual file directory area is used for each of the data memory areas. They are provided independently from each other in correspondence with blocks (files).
第6図は、1バイト(8ビツト)より成る秘密属性メモ
リエリア52の詳細図であり、このエリアは対応するフ
ァイルに対して、原則的にはデータの凹込みと読出しと
の両方の許可を得る上で、いずれの種類の秘密コードに
関する照合を必要としているか(以下、第1の照合条件
と称する)を記憶している第1の秘密属性メモリエリア
と、データの書込みは禁止しながらデータの読出しは許
可する上で、いずれの種類の秘密コードに関する照合を
必要としているか(以下、第2の照合条件と称する)を
記憶している第2の秘密属性メモリエリアとから構成さ
れている。すなわち第6図において、ビットa、〜a0
が第1の秘密属性メモリエリアを、またビットa7〜a
4が第2の秘密属性メモリエリアを構成しており、それ
ぞれのビットは互いに独立した意味づけを有し、互いに
独立して設定可能となっている。FIG. 6 is a detailed diagram of the secret attribute memory area 52 consisting of 1 byte (8 bits), and this area basically has permission to write and read data to the corresponding file. A first secret attribute memory area that stores which type of secret code is required to be verified (hereinafter referred to as the first verification condition) in order to obtain the data; and a second secret attribute memory area that stores which type of secret code requires verification (hereinafter referred to as a second verification condition) in order to permit reading. That is, in FIG. 6, bits a, ~a0
is the first secret attribute memory area, and bits a7 to a
4 constitutes the second secret attribute memory area, and each bit has an independent meaning and can be set independently of each other.
なお本実施例ではそれぞれ各ビットのうち内容が0”と
なっている場合に、対応する秘密コードの照合が必要で
あることを示し、内容が”1”の場合には照合は不要で
あることを示している。In this embodiment, if the content of each bit is 0, it indicates that the corresponding secret code must be verified, and if the content is 1, verification is not necessary. It shows.
従って、例えば秘密属性メモリエリア52の内容がD9
H”である場合には、第1の秘密属性メモリエリアにつ
いてはビットa2とa、が”O″となっているために、
第1の照合条件では所有者IDコードの照合とグループ
IDコードの照合の必要性を示し、また第2の秘密属性
メモリエリアについてはビットa2のみが0″となって
いるために、第2の照合条件では所有者IDコードのみ
の照合の必要性を示すことになる。Therefore, for example, the contents of the secret attribute memory area 52 are D9.
H”, bits a2 and a are “O” for the first secret attribute memory area, so
The first verification condition indicates the necessity of verifying the owner ID code and the group ID code, and since only bit a2 of the second secret attribute memory area is 0'', the second The verification condition indicates the necessity of verifying only the owner ID code.
さらに第7図は、プロテクト属性メモリエリア53の詳
細図であり、このエリアは対応するファイルに関して、
データの書込み、修正およびファイルの抹消が許可され
ているか禁止されているかを規定するデータ(以下、物
理的プ凸テクト属性と称する)を記憶しているエリアで
ある。このエリアについては、ビットb0の内容が0”
となっている場合には対応するファイル内の新たなデー
タの書込み(追加)が、またピッ)b+の内容が”0″
となっている場合にはデータの修正が、さらにビットb
2の内容が”0”となっている場合にはファイルの抹消
が、それぞれ禁止される。Furthermore, FIG. 7 is a detailed diagram of the protected attribute memory area 53, and this area contains information regarding the corresponding file.
This is an area that stores data (hereinafter referred to as physical protect attribute) that specifies whether writing, modifying, and deleting files are permitted or prohibited. For this area, the content of bit b0 is 0”
, the writing (addition) of new data in the corresponding file will be interrupted, and the contents of b+ will be "0".
If the data is corrected, bit b
If the content of 2 is "0", deletion of the file is prohibited.
次に第8図は、各ファイル部の構成を示すマツプ図であ
る。Next, FIG. 8 is a map diagram showing the configuration of each file section.
まず各ファイルは、その先頭部にファイルヘッダーエリ
アを有しており、該ヘソグーエリアにはフィールド数n
、第1フイールドバイト数f0、第2フイールドバイト
数ft・−・・・−第nフィールドバイト数f’、予約
レコード数R1およびファイルパスワードFPWが、そ
れぞれのメモリエリアを確保して記憶書込みされている
。以上のうちフィールド数nと各フィールドのバイト数
fl−・−−−−−・・ffiによってファイルの構造
が決定され、さらに予約レコード数Rを合わせるとファ
イルのサイズが決定される。またファイルパスワードF
PWは当該ファイルに固をな秘密コードであり、例えば
カードの主発行者の他に副発行者がいる場合等には、副
発行者を確認するための照合コードとしてファイルパス
ワードFPWを用いること等が可能である。First, each file has a file header area at the beginning, and this header area has a number of fields n.
, the number of first field bytes f0, the number of second field bytes ft...-nth field byte number f', the number of reserved records R1, and the file password FPW are stored and written by securing their respective memory areas. There is. Among the above, the structure of the file is determined by the number of fields n and the number of bytes of each field fl-..ffi, and the size of the file is determined by adding the number of reserved records R. Also file password F
PW is a secret code fixed to the file. For example, if there is a sub-issuer in addition to the main issuer of the card, the file password FPW should be used as a verification code to confirm the sub-issuer. is possible.
さらに各レコードエリアは、その先頭部に1バイトのし
:llトド性エリアを有しており、以下、第1フイール
ドデータdl、第2フィールドデータdt・−・・・・
−・−・第nフィールドデータd、、の各メモリエリア
が形成されている。また当該ファイルとしては、上記の
ような構造を有しているレコードを、予約レコード数R
だけ記憶することが可能である。すなわち各ファイルは
、レコードと呼ばれるセクションを1個以上含んでおり
、さらに1つのレコード(セクション)は、レコード属
性エリアと1個以上のフィールドとを含んでいる。Furthermore, each record area has a 1-byte character area at the beginning of the record area, in which the first field data dl, the second field data dt, etc.
---Nth field data d, . . . Memory areas are formed. In addition, the file has records with the above structure, and the number of reserved records is R.
It is possible to memorize only That is, each file includes one or more sections called records, and each record (section) includes a record attribute area and one or more fields.
また、例えばレコード番号とフィールド番号が指定され
れば、フィールド数n、各フィールドバイト数f1・・
−、f、より成るファイル構造を規定するデータに基づ
いて、レコードエリア内の対応アドレスも簡単な演算に
よって求められることは明らかである。For example, if the record number and field number are specified, the number of fields n, the number of bytes of each field f1, etc.
It is clear that the corresponding address in the record area can also be determined by simple calculations based on the data defining the file structure consisting of -, f.
なお本実施例で各レコードごとに設けられたレコード属
性エリアは、当該レコードがデータ未書込み、データ書
込み済、およびデータ無効化のいずれの状態にあるかを
示すためのエリアであり、具体的には未書込みレコード
のレコード属性エリアはFFH″、書込み済の場合には
OFH”さらに書込み済のデータが無効化されている場
合には”OOH”となっている。ここで本実施例におけ
るデータ無効化とは、例えばデータの誤書込み等が生じ
たときでもデータの修正(書き直しや消去)を許すこと
はセキュリティ面で問題がある場合に、そのデータが無
効なものであることを示すだめのマークが付けられてい
るということを意味している。In this example, the record attribute area provided for each record is an area for indicating whether the record is in the state of data not written, data written, or data invalidated. The record attribute area of an unwritten record is FFH'', and if it has been written, it is OFH, and if the written data is invalidated, it is OOH. Here, data invalidation in this embodiment refers to invalidating data when, for example, there is a security problem in allowing data to be modified (rewritten or erased) even if data is written incorrectly. This means that it is marked with a no mark indicating that it is.
次に第9図〜第17図は、ICカード1のROM4内の
プログラムの要部に対応するフローチャート図であり、
以下、これらの図に従って本実施例におけるデータ処理
について説明する。Next, FIGS. 9 to 17 are flowcharts corresponding to the main parts of the program in the ROM 4 of the IC card 1,
Data processing in this embodiment will be described below with reference to these figures.
まず第9図は、メインルーチンを示すものであり、親機
10からのリセット信号に引き続いて動作がスタートし
、親機10からのコマンド受信ステップM1へと進む。First, FIG. 9 shows the main routine, in which the operation starts following a reset signal from the base unit 10, and proceeds to step M1 of receiving a command from the base unit 10.
ここでステップM2でEEP−ROM7のディゼープル
フラグエリア40を参照し、既にディゼープルフラグが
あってカード自体が無効化されている場合には、受信し
たコマンドに応じた処理を行うことなく、カードがディ
ゼーブル化されていることを親機10側に返信するステ
ップM9に進んで処理を終了する。Here, in step M2, the disabled flag area 40 of the EEP-ROM 7 is referred to, and if there is already a disabled flag and the card itself is invalidated, the process according to the received command is not performed. , the process proceeds to step M9 in which a message is sent back to the base unit 10 that the card is disabled, and the process ends.
一方、ディゼープルフラグがない場合には、受信したコ
マンドの内容に応じた処理のステップへと進む。すなわ
ち秘密コード書込みコマンドの場合にはステップM3よ
り秘密コード書込みサブルーチンMIOに、照合要求コ
マンドの場合にはM4より照合サブルーチンMllに、
ファイル作成コマンドの場合にはM5よりファイル作成
サブルーチンM12に、ファイルオーブンコマンドの場
合にはM6よりファイルオーブンサブルーチンM13に
、ファイル参照コマンドの場合にはM7よりファイル参
照サブルーチンM14に、またファイル抹消コマンドの
場合にはM8よりファイル抹消サブルーチンM15へと
それぞれ進む。さらに上記の各処理が終了して各サブル
ーチンよりリターンすると、再びスタートに戻って親機
10からの次のコマンドを待つというように、親機10
から電源供給を絶たれて排出されるまでメインルーチン
の繰り返しを行うことになる。On the other hand, if there is no disabled flag, the process proceeds to a processing step according to the content of the received command. That is, in the case of a secret code write command, the secret code write subroutine MIO is entered from step M3, and in the case of a verification request command, the verification subroutine Mll is entered from M4.
In the case of a file creation command, M5 goes to the file creation subroutine M12; in the case of a file oven command, M6 goes to the file oven subroutine M13; in the case of a file reference command, M7 goes to the file reference subroutine M14; If so, the process proceeds from M8 to the file deletion subroutine M15. Furthermore, when each of the above processes is completed and each subroutine returns, the main unit 10 returns to the start and waits for the next command from the main unit 10.
The main routine will be repeated until the power supply is cut off and the battery is discharged.
次に第1O図は、秘密コード書込みサブルーチンを示す
フローチャート図である。Next, FIG. 1O is a flowchart showing the secret code writing subroutine.
秘密コード書込み処理では、まずコマンドがカード発行
者IDコードの書込みを要求しているものである場合に
は、ステップA1よりカード発行者IDが未書込みであ
るか既に書込み済であるかを調べるステップA5へと進
む。ここで既に書込み済の場合には、親機10に対して
コマンドの処理の拒絶の返信(以下、否定応答と称する
)をA7で行なった後、サブルーチンからリターンする
。In the secret code writing process, first, if the command requests writing of the card issuer ID code, a step of checking from step A1 whether the card issuer ID has not been written or has already been written. Proceed to A5. If the data has already been written, a reply (hereinafter referred to as a negative response) is sent to the base unit 10 to reject the command processing, and then the process returns from the subroutine.
また未書込みである場合には、親機10より指定されて
きたカードIDコードの書込みをA6で行ってからリタ
ーンする。すなわち本実施例では、カード発行者IDコ
ードは、1度だけ書込みが認められていて、一旦書込み
が行なわれた後は、再書込み(変更)が不可能となって
いる。If the card ID code has not been written yet, the card ID code designated by the base unit 10 is written in A6, and then the process returns. That is, in this embodiment, the card issuer ID code is allowed to be written only once, and once written, it cannot be rewritten (changed).
一方、カード発行者IDコード以外の秘密コードの書込
み要求の場合には、A1よりカード発行者IDに関する
照合フラグがセットされているかどうかを調べるステッ
プA2に進み、前記照合フラグがセットされていない場
合には、A7で否定応答を行ってリターンする。また前
記照合フラグがセットされていて、コマンドがグループ
IDコードの書込みを要求するものであった場合には、
A3よりグループIDコードの書込みを行うステップA
8に進んだ後リターンする。さらにコマンドが所有者I
Dコードの書込みを要求するものであった場合には、A
4より所有者IDコードの書込みを行うステップA9に
進んだ後リターンする。On the other hand, in the case of a request to write a secret code other than the card issuer ID code, the process proceeds to step A2 in which it is checked from A1 whether a verification flag related to the card issuer ID is set, and if the verification flag is not set, the process proceeds to step A2. , a negative response is made at A7 and the process returns. Also, if the verification flag is set and the command requests writing of a group ID code,
Step A of writing the group ID code from A3
Proceed to step 8 and then return. Additionally the command is owner I
If the request is to write a D code,
4, the process proceeds to step A9 in which the owner ID code is written, and then returns.
第11図は、照合サブルーチンを示すフローチャート図
である。FIG. 11 is a flowchart showing the verification subroutine.
ここでは親機10から照合を行うことを1旨定された種
類の秘密コードを、まずステップB1で秘密コードメモ
リエリア30より読込んでくる。この読込まれた秘密コ
ードと、前記指定種類の秘密コードに対応して親機IO
から送られてきた照合データとの間で、所定のアルゴリ
ズム等に基づいた照合を82で実行し、照合に失敗した
場合には、ディゼープルフラグエリア40の一部に設け
られた連続照合失敗回数カウンタのうちの、照合対象の
秘密コードに対応したカウンタ部をインクリメントする
ステップB3へと進む。ここで該カウンタ部の内容が3
となっている(すなわち照合に連続して3回失敗してい
る)場合には、B4よりディゼープルフラグエリア40
にカードディゼープルフラグ(カード無効化フラグ)を
書込むステップB5へと進んだ後、B6で親機10側に
カードの無効化を返信してリターンする。また前記カウ
ンタ部が3未満の場合には、親機10に対して否定応答
を行うステップB7へと進んでからリターンする。Here, a secret code of a type that is determined to be verified from the master device 10 is first read from the secret code memory area 30 in step B1. The base unit IO corresponds to this read secret code and the specified type of secret code.
At 82, a comparison is performed based on a predetermined algorithm etc. with the comparison data sent from The process proceeds to step B3 in which the counter portion of the number counter corresponding to the secret code to be verified is incremented. Here, the contents of the counter section are 3
(in other words, the verification has failed three times in a row), the disaster flag area 40 is moved from B4.
After proceeding to step B5 in which a card disable flag is written to the CPU 10, the process returns to step B6 where the invalidation of the card is sent back to the main device 10 side. If the counter value is less than 3, the process proceeds to step B7 in which a negative response is made to the base unit 10, and then returns.
一方、照合に成功した場合には、B2よりRAM5内の
照合実行フラグ部のうちの、照合に成功した秘密コード
の種類に対応した照合実行フラグをセットするステップ
B8へと進み、さらにB9で連続照合失敗回数カウンタ
のうちの、照合対象の秘密コードに対応したカウンタ部
をクリアした後秘密リターンする。On the other hand, if the verification is successful, the process proceeds from step B2 to step B8 in which a verification execution flag corresponding to the type of secret code that was successfully verified is set in the verification execution flag section in the RAM 5, and then continues at step B9. After clearing the counter corresponding to the secret code to be verified in the verification failure count counter, return to the secret.
第12図は、ファイル作成サブルーチンを示すフローチ
ャート図である。FIG. 12 is a flowchart showing the file creation subroutine.
ファイル作成処理では、まずファイルディレクトリエリ
ア50を参照して、ファイル作成個数に残り枠があるか
、およびファイルエリア60内に新規なファイルを作成
する上で必要な残り容量があるかを調べるステップC1
へと進む。ここでファイル作成可能な場合には、親機1
0から送られてきたファイル名の指定およびファイル構
造指定情報に従って、ファイルディレクトリエリア50
およびファイルエリア60内のファイルへ7グーエリア
への書込みを02で実行した後、第13図に示される指
定ファイルオープン後の処理へとジャンプする。In the file creation process, step C1 first refers to the file directory area 50 and checks whether there is a remaining space for the number of files to be created and whether there is enough remaining space in the file area 60 to create a new file.
Proceed to. If a file can be created here, base unit 1
According to the file name specification and file structure specification information sent from 0, the file directory area 50
After executing writing to the file in the file area 60 in step 02, the process jumps to the process after opening the designated file shown in FIG.
また既にファイル作成が不可能な場合には、C3で否定
応答を行った後リターンする。If it is already impossible to create a file, a negative response is made at C3 and the process returns.
なおファイルの作成コマンドの場合には、親機10から
はファイル名の他に、フィールドfin、第1フイール
ドバイト数fI・・・−・−・−・・−・−第nフィー
ルドバイト数f、、、予約レコード数Rより成るファイ
ル構造指定情報が送られてくるが、これらの構造指定前
f[こよって、ファイルの構造とサイズが完全に決定さ
れることになる。またファイルディレクトリエリア50
のうちのファイルヘッダー先頭アドレス54については
、既に先行して作られているファイルのファイルディレ
クトリエリア50内の情報とファイルヘッダ一部の情報
とに基づいて、ファイルヘッダー先頭アドレスも算出さ
れるために、これもファイルの新規作成時に書込まれる
。In addition, in the case of a file creation command, in addition to the file name, the base unit 10 sends the field fin, the number of first field bytes fI...--------- the number of bytes of the nth field f, , , File structure specification information consisting of the number of reserved records R is sent, but before specifying these structures, the structure and size of the file are completely determined. Also file directory area 50
Regarding the file header start address 54, the file header start address is also calculated based on the information in the file directory area 50 of the file that has already been created and the information on a part of the file header. , which is also written when a new file is created.
次に第13図は、ファイルオープンサブルーチンを示す
フローチャート図であり、ここでは指定するファイルに
ついての書込みと読み出しとの両方の許可を得る(以下
、ファイルのオープンと称する)ための処理と、指定さ
れたファイルがオープンされてからの実際のファイル操
作処理(指定ファイルオープン後)とが含まれている。Next, FIG. 13 is a flowchart showing the file open subroutine, which includes processing for obtaining permission for both writing and reading for a specified file (hereinafter referred to as file opening), and processing for obtaining permission for both writing and reading for a specified file. This includes the actual file operation processing after the specified file is opened (after the specified file is opened).
ファイルオープンのための処理については、まずステッ
プDiで指定されたファイルの秘密属性メモリエリア5
2より第1秘密属性データを読込み、さらにB2でRA
M’3内の照合実行フラグを参照する。ここでB3で前
記第1秘密属性データで規定されている第1の照合条件
と照合実行フラグとを比較して、第1の照合条件が満足
されていない場合には、B4で否定応答を行った後、直
ちにすターンする。Regarding the process for opening a file, first, the secret attribute memory area 5 of the file specified in step Di is
Read the first secret attribute data from 2, and then RA from B2.
Refer to the verification execution flag in M'3. Here, in B3, the first matching condition specified in the first secret attribute data and the matching execution flag are compared, and if the first matching condition is not satisfied, a negative response is made in B4. After that, turn immediately.
一方、第1の照合条件が満足されている場合には、指定
ファイルのオープン後の処理へと進んで親機10からの
ファイル操作のための処理命令を受信するステップD5
へと進む。ここで受信した処理命令がクローズ命令の場
合にはD6よりファイルオープン後の処理は終了してリ
ターンし、またそれ以外の命令の場合には受信した命令
の内容に応じた処理のステップへと進む。On the other hand, if the first matching condition is satisfied, step D5 proceeds to processing after opening the specified file and receives a processing command for file operation from the base device 10.
Proceed to. If the processing command received here is a close command, the process after opening the file ends and returns from D6, and if it is any other command, proceed to the processing step according to the content of the received command. .
すなわち秘密属性セット命令の場合には、ステップD7
より後述の第14図の秘密属性書込みサブルーチンD1
3に進み、プロテクト属性セット命令の場合には、D8
より親機10から指定されたプロテクト属性を当該ファ
イルのプロテクト属性メモリエリア53に占込む(変更
も含む)処理を実行するステップD14へと進む。また
ファイルパスワードセント命令の場合には、D9より親
機10から指定されたファイルパスワードを、当該ファ
イルのファイルヘッダーエリアに書込む処理を実行する
ステップD15に進む。In other words, in the case of a secret attribute set command, step D7
Secret attribute writing subroutine D1 in FIG. 14, which will be described later.
Proceed to step 3, and in the case of a protected attribute set command, proceed to D8.
The process then proceeds to step D14 in which a process is executed to populate (including change) the protected attribute specified by the parent device 10 into the protected attribute memory area 53 of the file. Further, in the case of a file password cent command, the process proceeds from step D9 to step D15 in which a process is executed to write the file password designated from the parent device 10 into the file header area of the file.
さらに読出し命令の場合には、DIOより親[10から
指定されたレコード番号のレコードデータを読出して送
信するステップD16に進み、書込み命令の場合には、
Dllより後述の第15図の書込みサブルーチンD17
へと進む。またデータ無効化命令の場合には、ステップ
D12より親機10から指定されたレコード番号のレコ
ード属性エリアに無効化マーク”OOH”を書込むステ
ップD18に進む。Furthermore, in the case of a read command, the process proceeds to step D16 in which the DIO reads and transmits the record data of the record number specified from the parent [10], and in the case of a write command,
Write subroutine D17 in FIG. 15, which will be described later from Dll.
Proceed to. Further, in the case of a data invalidation command, the process proceeds from step D12 to step D18 in which an invalidation mark "OOH" is written in the record attribute area of the record number designated from the parent device 10.
なお上記の各命令に対応した処理が終了すると、再び親
機10からの次の命令を待つというように、親機10か
らクローズ命令を受けるまでファイル操作処理を繰り返
すことができるように構成されている。It should be noted that when the processing corresponding to each of the above commands is completed, the file operation process can be repeated until the close command is received from the base unit 10, such as waiting for the next command from the base unit 10 again. There is.
以上のように本実施例では、セキュリティや物理的プロ
テクトに対して重要な関連性を有する秘密属性やプロテ
クト属性のセット、ファイルパスワードのセット等は、
当該ファイルをオープンした後でなければ設定(変更)
できないように構成されている。すなわち各ファイル操
作処理は、オープンされた状態にある指定ファイルに対
してだけ実行可能なものであるが、例外的に前述のファ
イルの新規作成時についても、特別に指定ファイルオー
プン後の処理ルーチンにジャンプしてくるために、その
場合には上記のように作成済のファイルをオープンした
後と全く同様な処理の実行が可能である。これはファイ
ルの新規作成ということは、その作成ファイルに対する
最初のアクセス実行ということでもあるために、そのフ
ァイル操作の処理を許可する上で、改めてファイルをオ
ープンさせるような必要性はないためである。As described above, in this embodiment, a set of secret attributes and protect attributes, a set of file passwords, etc. that have an important relationship with security and physical protection are
Settings (changes) must be made after opening the file.
It is configured so that it is not possible. In other words, each file operation process can only be executed on a specified file that is open, but as an exception, even when creating a new file as mentioned above, a special processing routine after opening the specified file is executed. Since the file jumps, in that case, it is possible to perform the same processing as after opening the created file as described above. This is because creating a new file also means accessing the created file for the first time, so there is no need to open the file anew to allow file operations. .
第14図は、秘密属性書込みサブルーチンを示すフロー
チャート図である。FIG. 14 is a flowchart showing the secret attribute writing subroutine.
ここでは、まずステップE1で秘密コードメモリエリア
30および当該ファイルヘッダー・のファイルパスワー
ドエリアを参照して、親機10から送られてきた秘密属
性データに対応して照合を要求されることになる種類の
秘密コード(ファイルパスワードも含む)が、既に書込
み済であるかどうかをE2で調べ、書込み済である場合
には親機10から送られてきた秘密属性データを当該フ
ァイルディレクトリ50の秘密属性メモリエリア52に
書込む(変更も含む)ステップE3へと進んだ後リター
ンする。また対応する秘密コードが未書込みである場合
には、秘密属性データに従った照合判定自体が不可能で
あるために、秘密属性データの書込み処理を拒絶する否
定応答をE5で行なった後リターンする。Here, first, in step E1, the secret code memory area 30 and the file password area of the file header are referred to, and the type of verification required for the secret attribute data sent from the base unit 10 is performed. The E2 checks whether the secret code (including the file password) has already been written, and if it has been written, the secret attribute data sent from the base unit 10 is stored in the secret attribute memory of the file directory 50. After proceeding to step E3 in which data is written in the area 52 (including changes), the process returns. If the corresponding secret code has not been written yet, it is impossible to make a verification judgment based on the secret attribute data, so a negative response is made in E5 to reject the secret attribute data writing process, and then the process returns. .
第15図は、書込みサブルーチンを示すフローチャート
図である。FIG. 15 is a flowchart showing the write subroutine.
ここでまず、ステップFlで当該ファイルのプロテクト
属性メモリエリア53よりプロテクト属性を読込んで、
ピッI’boが0”となっていて書込みプロテクトがあ
る場合には、たとえファイルがオープンされていても新
たなレコードデータの書込みはすべて禁止されることに
なるために、否定応答のステップF7に進んでリターン
する。First, in step Fl, the protected attribute is read from the protected attribute memory area 53 of the file,
If the bit I'bo is 0'' and there is write protection, all new record data will be prohibited from being written even if the file is open, so in step F7 of the negative response. Go ahead and return.
また書込みプロテクトが設定されていない場合には、F
3で親機10から書込みを指定されてきているレコード
番号のレコード属性を参照する。ここで該指定レコード
属性が”FFH”であって当該レコードがまだ未書込み
である場合には、F4より当該指定レコードに親機10
から送られてきたデータを書込むステップF9に進んだ
後、さらにFIOで指定レコード属性エリアにデータ書
込み済であることを示すマークとして”OFH”を書込
む属性セットを行ってからリターンする。Also, if write protection is not set, F
3, the record attribute of the record number specified for writing from the base device 10 is referred to. Here, if the specified record attribute is "FFH" and the record has not been written yet, the main device 10 writes the specified record to the specified record from F4.
After proceeding to step F9 to write the data sent from , an attribute setting is performed to write "OFH" as a mark indicating that the data has been written in the specified record attribute area in the FIO, and then the process returns.
一方、当該レコードが書込み済である場合には、レコー
ド属性が”OOH“となっていて当該レコードに無効化
マークが付された状態となっているかをF5で調べる。On the other hand, if the record has already been written, it is checked in F5 whether the record attribute is "OOH" and an invalidation mark has been attached to the record.
無効化マークがない場合には、まだ当該レコードが有効
データを記憶していることを示しているために、ここへ
のデータ書込みを拒絶する否定応答をF7で行った後リ
ターンする。If there is no invalidation mark, this indicates that the record still stores valid data, so a negative response is made at F7 to refuse writing data there, and the process returns.
また無効化マークがある場合には、プロテクト属性のう
ちの修正プロテクトが設定されているかどうかをF6で
調べる。ここでプロテクト属性のビン)b+が0”とな
っていて修正プロテクトがある場合には、同じ(データ
書込みを拒絶する否定応答をF7で行った後リターンす
る。また修正プロテクトがない場合には、当該指定レコ
ードに既に書込まれているデータをステップF8で消去
(指定レコードエリアの” FFH″化)してから、指
定レコードへのデータ書込みを行うステップF9に進み
、さらにFIOで指定レコード属性エリアにデータ書込
み済であることを示すマークとして”OFH”を書込む
属性セットを行ってからリターンする。If there is an invalidation mark, it is checked in F6 whether or not modification protection is set among the protection attributes. Here, if the protect attribute bin) b+ is 0" and there is modification protection, return after making the same negative response (rejecting data writing with F7). Also, if there is no modification protection, After erasing the data already written in the specified record in step F8 (converting the specified record area to "FFH"), proceed to step F9 where data is written to the specified record, and then write the specified record attribute area in FIO. After setting the attribute to write "OFH" as a mark indicating that the data has been written to, the process returns.
なお上記のプロテクト属性について言及すると、ファイ
ルをオープンする資格を有する操作側にとっては、自由
にプロテクト属性の変更を行うことが可能であることか
らもわかるように、あくまでもプロテクト属性自体はフ
ァイルをオープンできる資格者にとっての誤操作防止の
ために設けられた機能である。Regarding the protected attributes mentioned above, as can be seen from the fact that an operator who is qualified to open a file can freely change the protected attributes, the protected attributes themselves do not allow the file to be opened. This function is provided to prevent erroneous operations by qualified personnel.
次に第16図は、ファイル参照サブルーチンを示すフロ
ーチャート図であり、ここでは指定するファイルについ
て、書込みは無条件に禁止しながら読出しについては許
可する(以下、ファイル参照のためのリードオンリーオ
ープンと称する)ための処理と、指定されたファイルが
リードオンリーオープンされてからの実際の続出し等の
処理とが含まれている。Next, FIG. 16 is a flowchart showing a file reference subroutine, in which writing to a specified file is unconditionally prohibited while reading is permitted (hereinafter referred to as read-only open for file reference). ), and the actual processing of subsequent access after the specified file is opened read-only.
リードオンリーオープンのための処理については、まず
ステップG1で親機10から指定されたファイルの秘密
属性エリア53より第2秘密属性データを読込み、さら
にG2でRAM3内の照合実行フラグを参照する。ここ
で03で前記第2秘密属性データで規定されている第2
の照合条件と照合実行フラグとを比較して、第2の照合
条件が満足されていない場合には、G4で否定応答を行
った後、直ちにリターンする。Regarding the process for read-only opening, first, in step G1, the second secret attribute data is read from the secret attribute area 53 of the file specified from the base device 10, and further, in G2, the verification execution flag in the RAM 3 is referred to. Here, in 03, the second secret attribute data specified in the second secret attribute data is
The comparison condition is compared with the comparison execution flag, and if the second comparison condition is not satisfied, a negative response is made in G4, and then the process immediately returns.
一方、第2の照合条件が満足されている場合には、指定
ファイルのリードオンリーオープン後の処理へと進んで
親機10からの処理命令を受信するステップG5へと進
む。ここで受信した処理命令がクローズ命令の場合には
、G6よりリードオンリーオープン後の処理は終了して
リターンする。On the other hand, if the second matching condition is satisfied, the process proceeds to a process after read-only opening of the specified file, and proceeds to step G5 in which a process command from the base device 10 is received. If the processing command received here is a close command, the processing after the read-only open from G6 ends and returns.
また受信した処理命令が読出し命令だった場合には、C
7より親機10から指定されたレコード番号のレコード
データを読出して送信するステップG8に進んだ後、再
び親機10からの処理命令を受信するステップG5へと
戻っていく。受信した命令がクローズ命令と読出し命令
のいずれでもない場合には、G4で否定応答を行った後
、リードオンリーオープン後の処理は終了してリターン
する。Also, if the received processing command is a read command, C
After proceeding from Step 7 to step G8 in which the record data of the designated record number is read and transmitted from the base device 10, the process returns to step G5 in which a processing command is received from the base device 10 again. If the received command is neither a close command nor a read command, a negative response is made at G4, the process after read-only open is completed, and the process returns.
第17図は、ファイル抹消サブルーチンを示すフローチ
ャート図である。FIG. 17 is a flowchart showing the file deletion subroutine.
この場合には、まずステップH1で親機10から指定さ
れたファイルのプロテクト属性メモリエリア53よりプ
ロテクト属性を参照する。ここでビットbtが”0”と
なっていてファイル抹消プロテクトがある場合には、H
5で否定応答を行った後リターンする。またファイル抹
消プロテクトがない場合には、ファイルディレクトリエ
リア50を参照して、ファイルエリア60内に実際に作
成されているファイルのうち゛、当該ファイルが最後尾
に形成されているものであるかをステップH3で調べる
。当該ファイルが最後尾に形成されたものである場合に
は、当該ファイルを完全に抹消した後のエリアに新規な
構造のファイルを作成することが可能であるために、ま
ずステップH6で当該指定ファイルのディレクトリエリ
ア50およびヘッダーエリアを抹消(エリアの”F F
H”化)した後、H4で当該指定ファイルのレコード
エリアの抹消(レコード属性エリアも含む全レコードエ
リアの”FFH”化)を行ってからリターンする。すな
わち、この場合にはファイルディレクトリエリアおよび
ファイルへ・ノダーエリアへの新規なファイル構造指定
データ等の書込みが可能であり、従って次に新規なファ
イルを作成する場合には、抹消された後のエリアを未使
用のファイルエリアと全く同様に使用することが可能で
ある。In this case, first, in step H1, the protect attribute of the file specified from the parent device 10 is referred to from the protect attribute memory area 53. If bit bt is “0” and there is file deletion protection, H
Returns after making a negative response in step 5. In addition, if there is no file deletion protection, refer to the file directory area 50 and check whether the file in question is the last file actually created in the file area 60. Check in step H3. If the file in question was created at the end, it is possible to create a file with a new structure in the area after completely erasing the file, so first, in step H6, the specified file is deleted. Delete directory area 50 and header area (area “FF
H"), deletes the record area of the specified file in H4 (converts all record areas including the record attribute area to "FFH"), and then returns. In other words, in this case, the file directory area and file It is possible to write new file structure specification data, etc. to the Noder area, so when creating a new file next time, the area after deletion is used in exactly the same way as an unused file area. Is possible.
一方、当該ファイルが最後尾に形成されたものではない
場合には、後続のファイルエリアに既にファイルが形成
されていて、必ずしも当該ファイルのエリアを自由に使
用することはできない(例えばサイズの大きなファイル
を作成しようとすれば、後続のファイルエリアと領域が
重なってしまう)ために、上記のようなファイルディレ
クトリエリアおよびファイルへ7グーエリアの抹消は行
うことなく、ステップH4で当該指定ファイルの全レコ
ードエリアの抹消を行った後リターンする。On the other hand, if the relevant file is not the last file created, a file has already been created in the subsequent file area, and the area of the relevant file cannot necessarily be used freely (for example, if the file is large (If you try to create a file, the area will overlap with the subsequent file area), so in step H4, all record areas of the specified file are deleted without deleting the file directory area and file area. Returns after erasing.
すなわち、この場合には当該ファイルのディレクトリエ
リアおよびヘッダーエリアには、ファイル構造を規定す
るデータが残るために、この処理の後の当該ファイルエ
リアには全く新規な構造のファイルを作成することはで
きないが、元からあったファイルと全く同一構造のファ
イルとして、再びレコードデータを書込みして蓄積して
い(ことが可能である。In other words, in this case, data that defines the file structure remains in the directory area and header area of the file, so it is not possible to create a file with a completely new structure in the file area after this process. However, it is possible to write and store record data again as a file with exactly the same structure as the original file.
以上に述べたように本発明によれば、複数種類の秘密コ
ードを記憶する秘密コードメモリエリアと、照合に成功
した秘密コードの種類を一時的に記憶する照合実行フラ
グ部と、該照合実行フラグ部の内容に基づいて、データ
の書込みと読出しとの両方のアクセスの許可を制御する
第1のアクセス制御手段と、前記照合実行フラグ部の内
容に基づいて、データの当込みと読出しのうち読出しの
みのアクセスの許可を制御する第2のアクセス制御手段
とを設けたことにより、同一のデータに対しても、書込
みと読出しとの両方を許可する場合と読出しのみを許可
する場合とで、互いに異なる種類、あるいは互いに異な
る種類の組み合わせの秘密コードの照合を許可条件とし
て設定することが可能となる。この結果、例えばホーム
ターミナル等で金融関係のICカードの読出しを行うよ
うなシステムを構成する場合にも、ホームターミナルの
存在を介してICカードのセキュリティが総体的に脆弱
になっていくようなことは防止される。As described above, according to the present invention, there is a secret code memory area that stores a plurality of types of secret codes, a verification execution flag section that temporarily stores the types of secret codes that have been successfully verified, and the verification execution flag. a first access control means that controls permission for both writing and reading of data based on the contents of the section; By providing a second access control means that controls permission for only access to the It becomes possible to set verification of secret codes of different types or combinations of mutually different types as a permission condition. As a result, even when configuring a system that reads financial IC cards using a home terminal, for example, the overall security of the IC card becomes vulnerable due to the presence of the home terminal. is prevented.
なお前記照合実行フラグ部は、必ずしもRAM内に設け
る必要はなく、例えばデータメモリ用のEEP−ROM
の一部に設けるとともに、一度のカードに対する処理が
終了するごとに、記憶内容をクリアするように構成する
ことも可能である。Note that the verification execution flag section does not necessarily need to be provided in the RAM, but may be provided in an EEP-ROM for data memory, for example.
It is also possible to configure the memory contents to be provided in a part of the card and to clear the stored contents each time processing for one card is completed.
またデータメモリエリアを含む記憶手段内に、第1、第
2の秘密属性記憶部を必ずしも設ける必要は無く、例え
ばROM内のマイクロコンピュータのプログラムの構成
自体によって、前述の実施例における前記第1、第2の
秘密属性記憶部の役割を代替させること等も可能である
。Further, it is not necessarily necessary to provide the first and second secret attribute storage sections in the storage means including the data memory area; for example, the first and second secret attribute storage sections in the above-mentioned embodiments may be provided depending on the configuration of the microcomputer program in the ROM itself. It is also possible to substitute the role of the second secret attribute storage section.
さらにデータメモリエリアを複数のブロックに分割する
場合に、本実施例ではフレキシビリティの考慮されたフ
ァイル構造を採用しているが、例えば各ブロックを予め
決められたサイズのエリアにする等、全てのブロックを
固定的な共通構成のものとしてもよいことは明らかであ
る。Furthermore, when dividing the data memory area into multiple blocks, this embodiment adopts a file structure that takes flexibility into account. It is clear that the blocks may have a fixed common configuration.
第1図〜第17図は、本発明の1実施例によるICカー
ドを示すもので、第1図は機能ブロック図、第2図(a
)および(b)はICカード側および親機側のシステム
構成をそれぞれ示すブロック図。
第3図はEEP−ROMのメモリエリアを示すマツプ図
、第4図は秘密コードメモリエリアのマツプ図、第5図
はファイルディレクトリエリアを示すマツプ図、第6図
および第7図は秘密属性メモリエリアおよびプロテクト
属性メモリエリアの詳細図、第8図はファイルエリアを
示すマツプ図。
第9図〜第17図は、ICカード内のマイクロコンピュ
ータ用プログラムの要部フローチャート図であり、第9
図はメインルーチン、第10図は秘密コード書込みサブ
ルーチン、第11図は照合サブルーチン、第12図はフ
ァイル作成サブルーチン、第13−チン、第16図はフ
ァイル参照サブルーチン、第17図はファイル抹消サブ
ルーチンをそれぞれ示すフローチャート図。
l−・−・−・ICカード、4−・−・ROM、5−・
−・・−I10ボート、?−−−−−・・EIF、P−
ROM、10・−〜−−−−・親機、IC110c・・
・−・シリアル通信端子、30−・・・−秘密コードメ
モリエリア、31−・・−・カード発行者IDコードメ
モリエリア、32・・・−・−所有者IDコードメモリ
エリア、33−・−・・・・グループIDコードメモリ
エリア、40−・・・−ディゼープルフラグエリア、5
0−・−・−ファイルディレクトリエリア、52−・−
−−−一秘密属性メモリエリア、60−・−・−ファイ
ルエリア。
第 2 図
第6図
第7図
”−−7y卆しあL右プロテクト
π; 8 図
TS !J a
11! 16図
第 17 図1 to 17 show an IC card according to an embodiment of the present invention, FIG. 1 is a functional block diagram, and FIG.
) and (b) are block diagrams showing the system configurations of the IC card side and the base device side, respectively. Figure 3 is a map diagram showing the memory area of the EEP-ROM, Figure 4 is a map diagram of the secret code memory area, Figure 5 is a map diagram showing the file directory area, and Figures 6 and 7 are the secret attribute memory. FIG. 8 is a detailed diagram of the area and the protected attribute memory area, and FIG. 8 is a map diagram showing the file area. 9 to 17 are flowcharts of main parts of the microcomputer program in the IC card.
Figure 10 shows the secret code writing subroutine, Figure 11 shows the verification subroutine, Figure 12 shows the file creation subroutine, Figure 13 shows the file reference subroutine, and Figure 17 shows the file deletion subroutine. Flowchart diagrams respectively shown. l-・-・-・IC card, 4-・-・ROM, 5-・
-...-I10 boat? ------・EIF, P-
ROM, 10・-~---・Main unit, IC110c・・
- Serial communication terminal, 30 - Secret code memory area, 31 - Card issuer ID code memory area, 32 - Owner ID code memory area, 33 - - ...Group ID code memory area, 40--Disease flag area, 5
0-・-・-File directory area, 52-・-
---Secret attribute memory area, 60-----File area. Fig. 2 Fig. 6 Fig. 7”--7y volume L right protection π; 8 Fig. TS ! J a 11! Fig. 16 Fig. 17
Claims (2)
憶手段に記憶されるデータの書込みおよび読出し等のア
クセスを制御するためのデータ処理制御手段とを有する
ICカードにおいて、前記記憶手段は複数種類の秘密コ
ードを記憶する秘密コードメモリエリアと、1個以上の
ブロックより成るデータメモリエリアとを含み、前記デ
ータ処理制御手段は照合実行済みの秘密コードの種類を
一時的に記憶しておくための照合実行フラグ部と、該照
合実行フラグ部の内容に基づいて、前記ブロックのデー
タ書込みと読出しとの両方の許可を制御する第1のアク
セス許可制御手段と、前記照合実行フラグ部の内容に基
づいて、前記ブロックのデータ書込みと読出しのうちデ
ータ読出しのみの許可を制御する第2のアクセス許可制
御手段を含んでいることを特徴とするICカード。(1) An IC card having a storage means made of a non-volatile semiconductor memory and a data processing control means for controlling access such as writing and reading of data stored in the storage means, wherein the storage means has a plurality of types. a secret code memory area for storing a secret code; and a data memory area consisting of one or more blocks; a verification execution flag section; a first access permission control means for controlling permission for both data writing and reading of the block based on the contents of the verification execution flag section; An IC card comprising: second access permission control means for controlling permission for only data reading out of data writing and reading of the block.
タ書込みと読出しとの両方を許可する上で照合の必要な
秘密コードの種類を指定するための秘密属性データを記
憶する第1の秘密属性記憶部と、該第1の秘密属性記憶
部の内容と照合実行フラグ部の内容との比較に基づいて
、アクセスの可否を判定する第1のアクセス許可判定手
段とを含み、第2のアクセス許可制御手段は、ブロック
のデータ書込みと読出しのうち読出しのみを許可する上
で照合の必要な秘密コードの種類を指定するための秘密
属性データを記憶する第2の秘密属性記憶部と、該第2
の秘密属性記憶部の内容と照合実行フラグ部の内容との
比較に基づいて、アクセスの可否を判定する第2のアク
セス許可判定手段とを含み、かつ前記第1、第2の秘密
属性記憶部は、不揮発性半導体メモリより成る記憶手段
の一部内に設けられていることを特徴とする特許請求の
範囲第1項記載のICカード。(2) The first access permission control means stores a first secret attribute that stores secret attribute data for specifying the type of secret code that needs to be verified in order to permit both data writing and reading of the block. a storage unit; and a first access permission determination unit that determines whether or not access is permitted based on a comparison between the contents of the first secret attribute storage unit and the contents of the matching execution flag unit; The control means includes a second secret attribute storage section that stores secret attribute data for specifying the type of secret code that needs to be verified in order to permit only reading out of data writing and reading of the block;
a second access permission determination means for determining whether or not access is permitted based on a comparison between the contents of the secret attribute storage section and the contents of the verification execution flag section, and the first and second secret attribute storage sections. 2. The IC card according to claim 1, wherein is provided in a part of storage means made of a non-volatile semiconductor memory.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP61041647A JPS62200442A (en) | 1986-02-28 | 1986-02-28 | Ic card |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP61041647A JPS62200442A (en) | 1986-02-28 | 1986-02-28 | Ic card |
Publications (1)
Publication Number | Publication Date |
---|---|
JPS62200442A true JPS62200442A (en) | 1987-09-04 |
Family
ID=12614137
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP61041647A Pending JPS62200442A (en) | 1986-02-28 | 1986-02-28 | Ic card |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPS62200442A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005306490A (en) * | 2004-04-16 | 2005-11-04 | Nec Corp | Id issue management system, article information management system and id issue management method |
JP2008090431A (en) * | 2006-09-29 | 2008-04-17 | Hitachi Ltd | Data carrier and its system |
JP2009223685A (en) * | 2008-03-17 | 2009-10-01 | Felica Networks Inc | Authentication system, authentication method, reader/writer and program |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS60205688A (en) * | 1984-03-29 | 1985-10-17 | Toshiba Corp | Portable medium |
JPS62154190A (en) * | 1985-12-27 | 1987-07-09 | Toppan Moore Co Ltd | Ic card |
-
1986
- 1986-02-28 JP JP61041647A patent/JPS62200442A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS60205688A (en) * | 1984-03-29 | 1985-10-17 | Toshiba Corp | Portable medium |
JPS62154190A (en) * | 1985-12-27 | 1987-07-09 | Toppan Moore Co Ltd | Ic card |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005306490A (en) * | 2004-04-16 | 2005-11-04 | Nec Corp | Id issue management system, article information management system and id issue management method |
JP4720098B2 (en) * | 2004-04-16 | 2011-07-13 | 日本電気株式会社 | ID issue management system, article information management system, and ID issue management method |
JP2008090431A (en) * | 2006-09-29 | 2008-04-17 | Hitachi Ltd | Data carrier and its system |
JP2009223685A (en) * | 2008-03-17 | 2009-10-01 | Felica Networks Inc | Authentication system, authentication method, reader/writer and program |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11868278B2 (en) | Block or page lock features in serial interface memory | |
US6094724A (en) | Secure memory having anti-wire tapping | |
JP3396043B2 (en) | Micro circuit | |
RU2214008C2 (en) | Protected memory having plurality of protection levels | |
US4295041A (en) | Device for the protection of access to a permanent memory of a portable data carrier | |
JP2623332B2 (en) | IC card and its operation program writing method | |
US6453397B1 (en) | Single chip microcomputer internally including a flash memory | |
JP3662946B2 (en) | File management system and portable electronic device | |
JPH01500379A (en) | System for portable data carriers | |
JPH0833912B2 (en) | Secure file system for portable data carriers | |
JPS63788A (en) | Portable electronic equipment | |
EP1172822A1 (en) | Semiconductor device and control device for use therewith | |
WO2004066196A1 (en) | Smartcard with protected memory access | |
EP0593244B1 (en) | Secure IC card system with reusable prototype card | |
JP2575358B2 (en) | IC card | |
US7797553B2 (en) | Memory device | |
JPS62200441A (en) | Ic card | |
JP4443699B2 (en) | Portable electronic device and method for controlling portable electronic device | |
JPS62200442A (en) | Ic card | |
KR930004944B1 (en) | Memory system | |
JPH10198776A (en) | Portable information recording medium, and its information writing and reading method | |
JP2005011161A (en) | Ic card and ic card program | |
US7296289B2 (en) | Setting or changing an access condition for an access management apparatus and method of a portable electronic device | |
JP2501050Y2 (en) | IC card | |
JPS5998395A (en) | Ic card |