JP3173522B2 - Program processing device for IC card - Google Patents
Program processing device for IC cardInfo
- Publication number
- JP3173522B2 JP3173522B2 JP08565392A JP8565392A JP3173522B2 JP 3173522 B2 JP3173522 B2 JP 3173522B2 JP 08565392 A JP08565392 A JP 08565392A JP 8565392 A JP8565392 A JP 8565392A JP 3173522 B2 JP3173522 B2 JP 3173522B2
- Authority
- JP
- Japan
- Prior art keywords
- program
- card
- processing device
- machine language
- language
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Landscapes
- Storage Device Security (AREA)
- Devices For Executing Special Programs (AREA)
Description
【0001】[0001]
【産業上の利用分野】本発明は、ICカード内のプログ
ラム可能な不揮発性メモリに格納される機械語形式に翻
訳することが可能な、ICカードもしくはICカード用
プログラム開発機器等のプログラム処理装置に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program processing apparatus, such as an IC card or an IC card program development device, which can be translated into a machine language format stored in a programmable nonvolatile memory in the IC card. About.
【0002】[0002]
【従来の技術】近年、ICカードを利用したアプリケー
ションが徐々に運用されはじめているが、それらのシス
テムに共通した問題として、「全体の処理に時間がかか
り過ぎる」という問題点が挙げられる。本問題点の原因
を、ここでは電話カード等のプリペイドアプリケーショ
ンを構築する場合を例として、以下に図を参照しつつ説
明する。なお、以降の説明ではICカードのMPU(マ
イクロプロセッサ)として、日立製作所製のH8/31
0(EEPROMを内蔵した8ビットMPU)を想定し
ている。2. Description of the Related Art In recent years, applications using IC cards have begun to operate gradually, but a problem common to these systems is that the entire process takes too long. The cause of this problem will be described below with reference to the drawings, taking as an example a case where a prepaid application such as a telephone card is constructed. In the following description, an H8 / 31 manufactured by Hitachi, Ltd. is used as an MPU (microprocessor) of an IC card.
0 (8-bit MPU with built-in EEPROM) is assumed.
【0003】但しそのメモリ空間は、ROMが$000
0〜27FF($は16進数を示す。以下同じ。)のア
ドレスに割当てられ、EEPROMが$6000〜7F
FFのアドレスに割当てられ、RAMが$FEC0〜F
FBFのアドレスに割当てられている。However, the memory space of the ROM is $ 000.
0 to 27FF ($ indicates a hexadecimal number; the same applies hereinafter), and the EEPROM is $ 6000 to 7F.
RAM is assigned to the address of FF, and
Assigned to the address of the FBF.
【0004】また、前記アプリケーションを実現する場
合のメモリ番地と対応格納データを示すメモリレイアウ
ト例として、(表1)に示す。[0004] Table 1 shows an example of a memory layout showing memory addresses and corresponding storage data when the application is realized.
【0005】[0005]
【表1】 [Table 1]
【0006】なお、ここでシステムプログラムは、IC
カードの動作プログラムを表す。リザーブセクション
は、未使用領域を表す。アプリケーションIDは、カー
ドの正当性確認に使用される20バイトのデータを表
す。Here, the system program is an IC
Indicates the operation program of the card. The reserve section represents an unused area. The application ID represents 20-byte data used for confirming the validity of the card.
【0007】残高は0〜65535の値を示す符号無の
2進で表現された2バイトの残高データを表す。作業領
域は、バッファあるいはスタック等の、システムで使用
する作用領域を表す。The balance represents 2-byte balance data represented by an unsigned binary value indicating a value of 0 to 65535. The work area represents a work area used in the system, such as a buffer or a stack.
【0008】(表2)は、前記アプリケーションを実現
するための端末側の処理シーケンスをステップ順に処理
概要を示した例であるシーケンス1である。[0010] Table 2 shows a sequence 1 as an example showing an outline of the processing sequence on the terminal side for realizing the application in the order of steps.
【0009】[0009]
【表2】 [Table 2]
【0010】なお、ここではカードの具備しているコマ
ンドとして、COMPARE、READおよびWRIT
Eという汎用・単機能コマンドを想定している。[0010] Here, the commands provided in the card are COMPARE, READ and WRITE.
A general-purpose, single-function command E is assumed.
【0011】ここでCOMPAREとは、カード内のア
ドレスA1から格納されているL1バイトのデータと、
本コマンドによって搬送されるL1バイトのデータD1
とを比較し、結果をステータスT1によって出力するコ
マンドである。なお、ステータス=$00は処理が正常
に終了したことを、また$FFは処理が異常終了したこ
とを示す。Here, COMPARE is L1 byte data stored from address A1 in the card,
L1 byte data D1 carried by this command
And outputs the result by the status T1. Note that status = $ 00 indicates that the processing has been completed normally, and $ FF indicates that the processing has been abnormally completed.
【0012】READは、カード内のアドレスA2から
格納されているL2バイトのデータD2を出力するコマ
ンドである。WRITEは、本コマンドによって搬送さ
れるL3バイトのデータD3をカード内のアドレスA3
より格納するコマンドである。READ is a command for outputting L2 byte data D2 stored from address A2 in the card. WRITE transfers the L3 byte data D3 carried by this command to the address A3 in the card.
This is the command to be stored.
【0013】全2重方式の通信機能を有している機器で
は、通信処理とコマンド処理とがある程度並列して実行
可能であるため、通信処理は総処理時間にはあまり影響
しないことが一般的に知られているが、ICカードでは
リソースの問題から単一処理方式を採用せざるを得ない
ため、処理全体に要する時間Tはコマンド処理に要する
時間Tprc と通信に要する時間Tcom の和で規定され
る。In a device having a full-duplex communication function, communication processing and command processing can be executed to some extent in parallel, so that communication processing generally does not significantly affect the total processing time. However, since the IC card has to adopt a single processing method due to resource problems, the time T required for the entire processing is the sum of the time T prc required for command processing and the time T com required for communication. Is defined by
【0014】また、本例ではTprc は、COMPARE
処理に要する時間TC とREAD処理に要する時間Tr
とWRITE処理に要する時間TW の和で示される。In this example, T prc is COMPARE
Time required for processing T C and time required for READ processing Tr
And the time T W required for the WRITE process.
【0015】従って、コマンドの処理時間Tprc は、基
本的に分周比あるいは命令体系等のMPUの性能、内蔵
される不揮発性メモリのアクセス時間、および端末の供
給する駆動周波数fS に依存する性格を有するものであ
り、基本的な改善はカード側では施せない。このため、
コマンドの処理時間Tprc をカード側から見れば一定と
なる。[0015] Thus, the processing time T prc commands basically division ratio or the MPU such instruction system performance, the access time of the nonvolatile memory incorporated, and depending on the drive frequency f S and supplies the terminal It has personality and basic improvements cannot be made on the card side. For this reason,
The command processing time Tprc is constant when viewed from the card side.
【0016】一方、Tcom は、Tcom =T1+nT
Z (但しT1は、後述のヘッダおよびトレーラを除いた
全キャラクタの伝送に要する時間を示し、nは通信電文
数(=〔コマンド数〕+〔レスポンス数〕)を示し、T
Z は、ICカードの国際規格(IS 7816−3)で
定められた、各コマンド/レスポンスに付される最低4
バイトの伝送制御用ヘッダ、トレーラの伝送に要する時
間を示す。以下同じ。)で示される。On the other hand, T com is T com = T1 + nT
Z (where T1 indicates the time required for transmission of all characters excluding a header and a trailer described later), n indicates the number of communication messages (= [number of commands] + [number of responses]), and T
Z is at least 4 attached to each command / response specified in the international standard (IS 7816-3) for IC cards.
Indicates the time required for transmission of the byte transmission control header and trailer. same as below. ).
【0017】T1は基本的に削除不可能なデータ、本実
施例ではアプリケーションIDおよび金額の伝送に要す
る時間であり、その伝送速度と伝送情報量に依存する。
しかし、ICカードではもともとその伝送する情報量が
さほど多くないため、伝送量の圧縮による効果は極めて
低い。T1 is basically the time required for transmission of non-deletable data, in this embodiment, the application ID and the amount of money, and depends on the transmission speed and the amount of transmitted information.
However, since the amount of information transmitted from an IC card is not so large, the effect of compressing the amount of transmission is extremely low.
【0018】また、伝送キャラクタがスタート1ビッ
ト、データ8ビット、垂直パリティ1ビット、およびス
トップ1ビットから構成されるものとした場合、T
Z は、TZ=44(F/(fs・D))(但しFは伝送
制御パラメータ(1)を示し、Dは伝送制御パラメータ
(2)を示し、fS は駆動周波数を示す。以下同じ。)
しなる。 従って、Tcom は近似的には、Tcom =T1
+n(44(F/(fS ・D)))である。If the transmission character is composed of 1 bit of start, 8 bits of data, 1 bit of vertical parity, and 1 bit of stop, T
Z indicates T Z = 44 (F / (fs · D)) (where F indicates the transmission control parameter (1), D indicates the transmission control parameter (2), f S indicates the drive frequency, and so on. .)
Bend. Therefore, T com is approximately T com = T1
Is a + n (44 (F / ( f S · D))).
【0019】この場合に処理時間Tを減少させるには、
通信時間Tcom を減少させれば良い。しかし、ここでは
伝送速度を規定するF、D、およびfS を一定としたた
め、その値は伝送情報量のみに依存することとなる。To reduce the processing time T in this case,
The communication time T com may be reduced. However, since F, D, and f S that define the transmission rate are fixed here, their values depend only on the amount of transmission information.
【0020】しかし、T1と同様にICカードでは、も
ともと伝送する情報量が多くないため伝送量の圧縮によ
る効果は極めて低い。従って、Tcom は近似的にはコマ
ンド/レスポンス交換回数nのみに依存することとな
る。However, in the case of the IC card, as in the case of T1, the amount of information to be transmitted is not originally large, so that the effect of compressing the amount of transmission is extremely low. Therefore, T com approximately depends only on the number n of command / response exchanges.
【0021】次にコマンド/レスポンス交換回数nに関
して検討してみることとする。シーケンス1から明らか
なように、単機能コマンドのみのカードでは、本実施例
の実現にn=6回(S21、22、41、42、61、
62)のコマンド/レスポンス・ブロックの交換を行っ
ているため、その通信時間Tcom 1は、Tcom1=T1
+264(F/(fS ・D))と規定される。Next, consider the command / response exchange count n. As is clear from the sequence 1, in the case of the card having only the single function command, n = 6 times (S21, 22, 41, 42, 61,
Since the command / response block of 62) is exchanged, the communication time T com1 is T com1 = T1
Tasu264 is defined as (F / (f S · D )).
【0022】しかし、COM_ALLのような高機能コ
マンドをカードに搭載することにより、シーケンス1を
(表3)のシーケンス2のように簡略化できる。However, by mounting a high function command such as COM_ALL on the card, Sequence 1 can be simplified as Sequence 2 in (Table 3).
【0023】ただしCOM_ALLは、カード内のアド
レスA1から格納されているL1バイトのデータと、本
コマンドによって搬送されるL1バイトのデータD1と
を比較し、同一であった場合には、カード内のアドレス
A2から格納されているL2バイトのデータD2と、本
コマンドによって搬送されるL2バイトのデータD3を
比較し、D2≧D3である場合に限り、L2バイトのデ
ータ〔D2−D3〕をカード内のアドレスA2より格納
する。なお、処理結果(T1)と〔D2−D3〕をレス
ポンスとして出力するコマンドである。However, COM_ALL compares the L1 byte data stored from the address A1 in the card with the L1 byte data D1 carried by this command. The L2 byte data D2 stored from the address A2 is compared with the L2 byte data D3 conveyed by this command. Only when D2 ≧ D3, the L2 byte data [D2-D3] is stored in the card. From the address A2. This command outputs the processing result (T1) and [D2-D3] as a response.
【0024】[0024]
【表3】 [Table 3]
【0025】このように、単一のコマンド/レスポンス
交換で一連の処理が実行可能であるならば、通信ブロッ
クがS31とS32になり、通信ブロック数nを2にす
ることが可能となるため、その通信時間Tcom をTcom
2=T1+88(F/(fS・D))まで低減すること
が可能となる。As described above, if a series of processes can be executed by a single command / response exchange, the communication blocks become S31 and S32, and the number n of communication blocks can be set to 2. The communication time T com is T com
Until 2 = T1 + 88 (F / (f S · D)) can be reduced.
【0026】しかし、このような高機能コマンドは実際
のアプリケーションが明確化しない限り、その設計が極
めて困難であり、実際にはアプリケーション確定時点で
ICカード自体のソフトウェアであるシステムプログラ
ムを製造者側で変更することが必要であったため、納期
面、あるいはコスト面で市場の要求にそぐわないことが
問題点として挙げられていた。However, it is extremely difficult to design such a high-function command unless the actual application is clarified. In practice, a system program, which is software of the IC card itself, is determined by the manufacturer when the application is determined. Because of the necessity of changing, it was pointed out that the delivery date or cost did not meet the market requirements.
【0027】このような問題点を解決するため、「ユー
ザプログラムをプログラム可能な不揮発性メモリ上に格
納し、カードは同プログラムの起動コマンド(使用デー
タを含む)を受信することにより、同プログラム内で記
述された一連の処理を実行し、処理ステータス(場合に
よりデータを含む)よりなる結果をレスポンスとして返
す」方式が検討されていた。In order to solve such a problem, a user program is stored in a programmable non-volatile memory, and the card receives a start command (including use data) of the program, thereby allowing the program to be stored in the program. A method of executing a series of processes described in (1) and returning a result including a process status (including data in some cases) as a response "has been studied.
【0028】[0028]
【発明が解決しようとする課題】前記方式は、先に記し
た問題点を「各ユーザ毎に、それぞれのアプリケーショ
ンを最も効率良く行うプログラムを作成、登録する」こ
とによって解決するものであり、その具体的な方式とし
て次の2方式が検討されている。The above-mentioned method solves the above-mentioned problem by "creating and registering a program for executing each application most efficiently for each user". The following two methods are being studied as specific methods.
【0029】方式1は、特公昭63−25393号「デ
ータを記憶し処理するための携帯可能なデータ担体」に
見られる、ユーザプログラムを機械語形式で不揮発性メ
モリ内に格納する方式である。方式2は、本出願人の特
願昭59−176329号「ICカード」に見られる、
ユーザプログラムを中間言語形式で不揮発性メモリ内に
格納し、カード内のMPUで逐次これを翻訳、実行する
方式である。Method 1 is a method in which a user program is stored in a non-volatile memory in a machine language format, as found in JP-B-63-25393, "Portable Data Carrier for Storing and Processing Data". Method 2 is disclosed in Japanese Patent Application No. 59-176329 “IC card” of the present applicant.
In this method, a user program is stored in a non-volatile memory in an intermediate language format, and is sequentially translated and executed by an MPU in the card.
【0030】しかし、それらの方式にはそれぞれ以下の
欠点があったため、未だ実用には至っていない。方式1
は、ユーザプログラムが機械語形式で記述されるため、
処理速度およびプログラム自体の容量の面で優れている
が、その反面ユーザプログラムがオブジェクト形式であ
るため、その内部に「カード内データを不正に偽造・改
竄するルーチン」が組み込まれる危険性があった。ここ
では、先のアプリケーションにおける不正ルーチン例を
説明することで、その危険性を説明することとする。な
お、ここでは説明の都合上、シーケンス1のリザーブセ
クション4を機械語形式のユーザプログラムの格納領域
としている。However, these methods have the following disadvantages, and have not been put to practical use yet. Method 1
Is because the user program is written in machine language format,
Although it is excellent in processing speed and capacity of the program itself, on the other hand, since the user program is in the object format, there is a danger that a "routine for illegally falsifying or falsifying data in the card" is incorporated therein. . Here, the danger will be described by describing an example of the unauthorized routine in the above application. Here, for convenience of explanation, the reserve section 4 of the sequence 1 is used as a storage area for a user program in a machine language format.
【0031】以下「アプリケーションIDの一部を不正
に変更する」ウィルスプログラム例である。The following is an example of a virus program that "changes part of the application ID illegally".
【0032】[0032]
【表4】 [Table 4]
【0033】ただし、S100は16ビットのレジスタ
R0に$FFFFをセットし、S110は、16ビット
のレジスタR5にRAMアドレス$FEC0をセット
し、S120は、R0の内容をR5の示すRAM内の作
業領域のアドレスへ複写し、S130は、16ビットの
レジスタR6にEEPROMアドレス$6000をセッ
トし、S140は、8ビットのレジスタR4Lに書込み
データ長2をセットし、S150は、R5で示したメモ
リに格納されているR4LバイトのデータをEEPRO
MのR6番地に書込む(データ$FFFFが、$600
0番地から書込まれる)という意味である。However, S100 sets $ FFFF in the 16-bit register R0, S110 sets the RAM address $ FEC0 in the 16-bit register R5, and S120 sets the contents of R0 in the RAM indicated by R5. Copy to the address of the area, S130 sets the EEPROM address $ 6000 in the 16-bit register R6, S140 sets the write data length 2 in the 8-bit register R4L, and S150 stores the write data length in the memory indicated by R5. The stored R4L byte data is EEPRO
Write to address R6 of M (data $ FFFF is $ 600
(Written from address 0).
【0034】不正者の手によって、本プログラムがカー
ド内に格納された場合、同プログラムの実行コマンド
(以降EXECUTEと略す)が発行される度に、以上
のウィルスプログラムが実行され、不正者の目的は達成
される。なお、実際のウィルスプログラムでは、レスポ
ンス等を正当なプログラムで実行されたものと同一にす
る処理があるが、ここでは省略した。When this program is stored in a card by a fraudulent person, each time an execution command (hereinafter abbreviated as EXECUTE) of the program is issued, the above virus program is executed, and the purpose of the fraudulent person is Is achieved. In an actual virus program, there is a process for making a response or the like identical to that executed by a legitimate program, but is omitted here.
【0035】このようなセキュリティ上の問題を解決す
べく考案されたのが、前記方式2である。同方式では、
ユーザプログラムは中間言語形式で格納されており、ラ
ンタイムでこれを翻訳、実行することが可能であるた
め、不正処理を含むユーザプログラムを検出した場合、
その処理を中断あるいは中止することが理論上可能であ
るという利点を備えている。しかし、同方式を実現し得
る能力を有するMPUが現段階ではリリースされていな
いため、その実現が困難であるという問題点があった。The method 2 is designed to solve such a security problem. In this method,
Since the user program is stored in the intermediate language format and can be translated and executed at runtime, if a user program containing illegal processing is detected,
There is an advantage that it is theoretically possible to interrupt or stop the processing. However, there has been a problem that it is difficult to realize the MPU since an MPU having the capability to realize the method has not been released at this stage.
【0036】本発明は、前記方式1に関するセキュリテ
ィ脅威の要因である「ウィルスプログラム」を、翻訳時
点で検出し除去する手段、および不正装置により開発さ
れたウィルスプログラムを検出するための情報を生成す
る手段とを提供することによって、先の問題点を解決す
るものである。According to the present invention, means for detecting and removing a "virus program" which is a factor of the security threat related to the method 1 at the time of translation, and generating information for detecting a virus program developed by an unauthorized device are generated. The above problem is solved by providing the means.
【0037】[0037]
【課題を解決するための手段】請求項1では、プログラ
ム可能な不揮発性メモリと、その不揮発性メモリ内に格
納されたプログラム命令を実行する処理装置とを備えた
ICカード用プログラム処理装置であって、ICカード
用プログラム処理装置は、少なくとも、機械語以外の言
語のプログラムを機械語のプログラムに翻訳する第1の
手段、およびICカード内の秘密情報の位置特定情報を
記憶する第2の手段を有し、第1の手段は、第2の手段
の位置特定情報を参照し機械語以外の言語のプログラム
を翻訳する作業とともに、その翻訳内容に秘密情報に対
する参照・変更命令を発見した場合、その翻訳を中断あ
るいは中止するようにしたICカード用プログラム処理
装置である。According to a first aspect of the present invention, there is provided a program processing device for an IC card, comprising a programmable non-volatile memory, and a processing device for executing a program command stored in the non-volatile memory. The program processing device for an IC card includes at least a first means for translating a program in a language other than a machine language into a machine language program, and a second means for storing position identification information of secret information in the IC card And the first means refers to the position specifying information of the second means and translates a program in a language other than a machine language, and when a reference / change instruction to confidential information is found in the translated content, This is a program processing device for an IC card in which the translation is interrupted or stopped.
【0038】ここでプログラム可能な不揮発性メモリと
は、バックアップ電源のあるROMでもEPROMでも
よい。なお、機械語以外の言語とは、アセンブラ等の中
間言語に限らず、C等の高級言語も含む。少なくとも1
つの秘密パラメータを考慮に入れた演算処理とは、秘密
情報に対応する参照・命令情報に限らず、そのアドレス
等の間接情報を含んでもよい。Here, the programmable non-volatile memory may be a ROM having a backup power supply or an EPROM. The language other than the machine language is not limited to an intermediate language such as an assembler, but also includes a high-level language such as C. At least one
The arithmetic processing taking into account the two secret parameters is not limited to the reference / instruction information corresponding to the secret information, and may include indirect information such as the address thereof.
【0039】請求項2では、第2の手段が、ICカード
から構成されていることを特徴とする請求項1に記載の
ICカード用プログラム処理装置である。この場合、I
Cカード内の秘密情報の位置特定情報がICカード用プ
ログラム処理装置本体ではなく、それに接続されるIC
カードに保持させるため、セキュリティが向上する意味
がある。但し、ICカード内のメモリーの容量が制限さ
れる場合は、ICカード用プログラム処理装置の外部に
位置特定情報を持たせることもある。According to a second aspect of the present invention, there is provided the program processing device for an IC card according to the first aspect, wherein the second means comprises an IC card. In this case, I
The location identification information of the secret information in the C card is not the main body of the program processing device for the IC card, but the IC connected thereto.
Since the card is held, there is a meaning that security is improved. However, when the capacity of the memory in the IC card is limited, the position specifying information may be provided outside the IC card program processing device.
【0040】請求項3では、プログラム可能な不揮発性
メモリと、その不揮発性メモリ内に格納されたプログラ
ム命令を実行する処理装置とを備えたICカード用プロ
グラム処理装置であって、ICカード用プログラム処理
装置は、少なくとも、機械語以外の言語のプログラムを
機械語のプログラムに翻訳する第1の手段、ICカード
内の秘密情報の位置特定情報を記憶する第2の手段、お
よび出力される翻訳後のプログラムの一部もしくは全部
に対して、少なくとも1つの秘密パラメータを考慮に入
れた演算処理を行い、その演算結果を翻訳内容に付した
形式の機械語に変更する第3の手段とを有し、第1の手
段は、第2の手段の位置特定情報を参照し機械語以外の
言語のプログラムを翻訳し、第3の手段は、その翻訳内
容に演算結果を付した形式の機械語に変更するICカー
ド用プログラム処理装置である。ここでプログラム可能
な不揮発性メモリとは、バックアップ電源のあるROM
でもEPROMでもよい。なお、機械語以外の言語と
は、アセンブラ等の中間言語に限らず、C等の高級言語
も含む。少なくとも1つの秘密パラメータを考慮に入れ
た演算処理とは、秘密情報に対応する参照・命令情報に
限らず、そのアドレス等の間接情報を含んでもよい。According to a third aspect of the present invention, there is provided an IC card program processing device comprising a programmable non-volatile memory and a processing device for executing a program command stored in the non-volatile memory. The processing device includes at least a first unit for translating a program in a language other than a machine language into a machine language program, a second unit for storing position identification information of secret information in an IC card, and an output after translation And a third means for performing an arithmetic operation on at least one secret parameter with respect to a part or the whole of the program, and changing the operation result into a machine language in a format attached to the translation content. The first means translates a program in a language other than the machine language with reference to the position specifying information of the second means, and the third means attaches an operation result to the translated content. And a program processing apparatus for the IC card to change the machine language format. Here, the programmable non-volatile memory is a ROM having a backup power supply.
However, an EPROM may be used. The language other than the machine language is not limited to an intermediate language such as an assembler, but also includes a high-level language such as C. The arithmetic processing taking into account at least one secret parameter is not limited to reference / instruction information corresponding to secret information, and may include indirect information such as its address.
【0041】[0041]
【0042】請求項4では、前記第2の手段が、ICカ
ードから構成されていることを特徴とする第3項記載の
プログラム処理装置である。A fourth aspect of the present invention is the program processing device according to the third aspect, wherein the second means is constituted by an IC card.
【0043】請求項5では、前記第3の手段が、ICカ
ードから構成されていることを特徴とする第3項もしく
は第4項記載のプログラム処理装置である。A fifth aspect of the present invention is the program processing device according to the third or fourth aspect, wherein the third means is constituted by an IC card.
【0044】[0044]
【作用】以上の様に翻訳時点でアプリケーションがウイ
ルスプログラムであるか否かを自動的に検知し、排除す
ることが可能になったため、機械語でそのまま安全にア
プリケーションを処理することが可能となる。As described above, since it is possible to automatically detect whether or not an application is a virus program at the time of translation and to eliminate it, the application can be safely processed in machine language as it is. .
【0045】[0045]
【実施例】既に述べてあるプリペイドアプリケーション
を例として、以下に図を参照しつつその構成要素、処理
の説明を行う。DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Taking the prepaid application described above as an example, its components and processing will be described below with reference to the drawings.
【0046】図1は、プログラム処理装置の一種である
プログラム開発装置の一例であり、半導体メモリ等から
構成される記憶装置1000と、同装置に連結されたC
PU2000から構成される。なお、記憶装置1000
内部は、プログラム格納領域1100と、データ記憶領
域1200とに分割されており、CPUは記憶媒体中に
格納されたプログラムにしたがって処理を行う。FIG. 1 shows an example of a program development device which is a kind of a program processing device, and includes a storage device 1000 composed of a semiconductor memory or the like and a C connected to the device.
It consists of PU2000. The storage device 1000
The inside is divided into a program storage area 1100 and a data storage area 1200, and the CPU performs processing according to a program stored in a storage medium.
【0047】プログラム格納領域1100の内部には、
機械語ではないアセンブラ等のソースプログラムを機械
語に翻訳する翻訳プログラム1110、および前記機械
語プログラムをダウンロード形式に変換する変更プログ
ラム1120とが格納されている。また、データ記憶領
域1200は、ソースプログラム格納領域1210、オ
ブジェクトプログラム格納領域1220、ダウンロード
・プログラム格納領域1230、および秘密情報格納領
域1240とから構成され、秘密情報格納領域1240
内には、カード内の秘密情報位置1241、および秘密
コード1242が格納されている。In the program storage area 1100,
A translation program 1110 for translating a source program such as an assembler that is not a machine language into a machine language, and a change program 1120 for converting the machine language program into a download format are stored. The data storage area 1200 includes a source program storage area 1210, an object program storage area 1220, a download program storage area 1230, and a secret information storage area 1240.
Inside, a secret information position 1241 in the card and a secret code 1242 are stored.
【0048】図2は、上記プログラムおよびデータの機
能的な関係を示すものである。翻訳プログラム1110
は、秘密情報位置1241を参照しつつ、ソースプログ
ラム格納領域1210内に格納されたソースプログラム
の翻訳を行い、結果をオブジェクトプログラム格納領域
1220に出力する。FIG. 2 shows the functional relationship between the program and data. Translation program 1110
Translates the source program stored in the source program storage area 1210 with reference to the secret information position 1241, and outputs the result to the object program storage area 1220.
【0049】変更プログラム1120は、前記オブジェ
クトプログラムに対して、秘密コード1242を考慮に
入れた演算処理を行い、その結果(CER)を前記オブ
ジェクトプログラムに付した形式でダウンロードプログ
ラム格納領域1230に出力する。The change program 1120 performs an arithmetic process on the object program in consideration of the secret code 1242, and outputs the result (CER) to the download program storage area 1230 in a format attached to the object program. .
【0050】図3は、本実施例におけるソース、オブジ
ェクトおよびダウンロードプログラムの格納形式例であ
る。ソースプログラムは、ファイル形式でソースプログ
ラム格納領域1210に格納される。なお、CR(キャ
リッジリターン)等のSp(セパレータ)論理的に区切
られた各命令は、レコード(S(n))として格納さ
れ、その番号(n=0,1,2...)によって参照さ
れる。また、最終レコードにはエンド検出のためのコー
ドEOF(エンドオブファイル)が付される。FIG. 3 shows an example of a storage format of a source, an object, and a download program in this embodiment. The source program is stored in the source program storage area 1210 in a file format. Each instruction logically separated by Sp (separator) such as CR (carriage return) is stored as a record (S (n)), and is referred to by its number (n = 0, 1, 2,...). Is done. Also, a code EOF (end of file) for end detection is added to the last record.
【0051】オブジェクトプログラムは、ファイル形式
でオブジェクトプログラム格納領域1220に格納され
る。Spで論理的に区切られたレコード(T(n))
は、その番号(n=0,1,2...)によって参照さ
れる。なお、同ファイルの先頭にはレコード数iが、ま
た末尾には翻訳処理の結果を示すSTSが、それぞれ付
される。The object program is stored in a file format in the object program storage area 1220. Records logically separated by Sp (T (n))
Are referenced by their numbers (n = 0, 1, 2,...). The number of records i is added to the head of the file, and the STS indicating the result of the translation processing is added to the end.
【0052】ダウンロードプログラムは、オブジェクト
プログラムと類似した形式でダウンロードプログラム格
納領域1230に格納される。ただし、その末尾にはS
TSではなく、正当性コードCERが付される。The download program is stored in the download program storage area 1230 in a format similar to the object program. However, the end is S
The validity code CER is added instead of the TS.
【0053】次に図4を参照しつつ、翻訳プログラムの
動作について説明する。なお、ここでは説明を簡略化す
るため、「秘密情報位置をイミディエート値として取り
扱い、不揮発性メモリに対して不正な書込みを行う」ウ
ィルスプログラムを検出するための処理についてのみ解
説する。また、ここでは1パス型の翻訳プログラムを想
定している。Next, the operation of the translation program will be described with reference to FIG. Here, for simplicity of description, only processing for detecting a virus program that "handles a secret information position as an immediate value and illegally writes in a nonvolatile memory" will be described. Here, a one-pass type translation program is assumed.
【0054】[0054]
【表5】 [Table 5]
【0055】上記処理終了後、CPU2000はSTS
を読み出し、STS=$00であった場合には変更プロ
グラムを起動、そうでなければ処理を中断あるいは中止
することによってウィルス・プログラムの混入を防止す
る。After the above processing is completed, the CPU 2000
Is read, and if STS = $ 00, the change program is started; otherwise, the process is interrupted or stopped to prevent the virus program from being mixed.
【0056】次に不正者が、本装置以外のプログラム開
発装置によってウィルスプログラムを作成、カードに注
入することを防御する方式に関して説明する。Next, a method for preventing a fraudulent person from creating a virus program and injecting it into a card using a program development device other than the present device will be described.
【0057】図5は、そのような不正をカード側で検知
可能とする正当性確認コード(CER)の生成例を示し
たものである。FIG. 5 shows an example of generating a validity confirmation code (CER) that enables such a fraud to be detected on the card side.
【0058】[0058]
【表6】 [Table 6]
【0059】以上の処理によって生成されたダウンロー
ドプログラムをICカードに転送、カードではCERを
チェックし、正常であった場合に限りT(n)を格納す
ることにより、本発明は構成される。The present invention is constituted by transferring the download program generated by the above processing to the IC card, checking the CER in the card, and storing T (n) only when the card is normal.
【0060】本装置を利用することにより、機械語で記
述された(表7)のようなEXECUTEによって起動
されるユーザプログラムを使用することが可能となるた
め、先に記した方式1が実現可能となる。By using the present apparatus, it is possible to use a user program started by EXECUTE as described in the machine language (Table 7), so that the method 1 described above can be realized. Becomes
【0061】[0061]
【表7】 [Table 7]
【0062】このユーザプログラムの概要は、S100
〜200は、カード内に格納されたアプリケーションI
DとデータD1とを比較し、同一であった場合にはS2
00へ、またそうでない場合にはR4Lに$FE(照合
エラーとした)をセットした後S330へ、それぞれ分
岐する処理で、S210〜280は、D2とD3を比較
し、D2≧D3であった場合にはD2−D3をR3にセ
ットした後S280へ、またそうでない場合にはR4L
に$FF(残高不足とした)をセットした後S330
へ、それぞれ分岐する処理で、S290〜340は、R
3の内容を$6100に書込み、またその結果を$FE
C2、$FEC3に登録。その後、R4Hに3を、R4
Lに$00をセットした後S340へ分岐する処理で、
S350は、R4Hに1をセットする処理で、S360
は、R4Hの内容(出力カレングス)を$FEC0に、
R4Lの内容(処理ステータス)を$FEC1に、R3
の内容(更新された残高)を$FEC2および$FEC
3に、それぞれ格納する処理となっている。The outline of this user program is described in S100
To 200 are the applications I stored in the card.
D and data D1 are compared, and if they are the same, S2
00, and otherwise set $ FE (assumed to be a collation error) in R4L and then branch to S330. In steps S210 to S280, D2 and D3 are compared, and D2 ≧ D3. If so, set D2-D3 to R3 and then go to S280, otherwise R4L
After setting $ FF (the balance was insufficient) to S330
In steps S290 to S340, R
3 is written to $ 6100, and the result is written to $ FE
Registered in C2, @ FEC3. After that, 3 is added to R4H,
In the process of setting $ 00 to L and branching to S340,
S350 is a process of setting 1 to R4H.
Sets the content (output length) of R4H to $ FEC0,
R4L contents (processing status) to $ FEC1, R3
Contents (updated balance) of $ FEC2 and $ FEC
3 is a process of storing each.
【0063】このような環境下では、先のプリペイドア
プリケーションを(表8)のシーケンス3のように簡単
に処理することが可能となる。In such an environment, the above prepaid application can be easily processed as shown in Sequence 3 in (Table 8).
【0064】[0064]
【表8】 [Table 8]
【0065】それは、カード内のアドレス$6000か
ら格納されている20バイトのデータと、本コマンドに
よって搬送される20バイトのデータD1とを比較し、
同一であった場合には、カード内のアドレス$6100
から格納されている2バイトのデータD2と、本コマン
ドによって搬送される2バイトのデータD3を比較し、
D2≧D3である場合に限り、2バイトのデータ〔D2
−D3〕をカード内のアドレス$6100より格納す
る。なお、処理結果(T1)と〔D2−D3〕をレスポ
ンスとして出力する。It compares the 20-byte data stored from the address $ 6000 in the card with the 20-byte data D1 carried by this command,
If they are the same, the address in the card is $ 6100
Is compared with the 2-byte data D3 carried by this command,
Only when D2 ≧ D3, 2-byte data [D2
-D3] is stored from address # 6100 in the card. The processing result (T1) and [D2-D3] are output as a response.
【0066】また、受信データD1はアドレス$FEC
0〜に、データD3は$FED4〜に、それぞれ格納さ
れる。送信データは、$FEC0内に出力レングスが、
$FEC1〜に実際の送信データが、それぞれ格納され
るというものである。The received data D1 has the address $ FEC
0, and the data D3 are stored in $ FED4 ~. The transmission data has an output length within $ FEC0,
The actual transmission data is stored in FEC1.
【0067】シーケンス3では、その通信時間Tcom を
Tcom 2=T1+88(F/(fS・D))まで低減す
ることが可能となる。また、ように送信情報量自体も低
減しているため、その効果を大きい。In the sequence 3, the communication time T com can be reduced to T com 2 = T1 + 88 (F / (f S · D)). Further, since the transmission information amount itself is also reduced, the effect is large.
【0068】以上の結果、先のウイルスプログラム例を
処理した場合の不正プログラム翻訳例を記す。As a result of the above, an example of translating an unauthorized program when the above-mentioned example of a virus program is processed will be described.
【0069】[0069]
【表9】 [Table 9]
【0070】以上明らかなように、先に記した不正プロ
グラムはS(5)翻訳時点にて、ASがD(0)に、ま
たAEがD(1)に一致するため、不正プログラムとし
て判断される。As is clear from the above, the malicious program described above is judged as a malicious program at the time of translation of S (5) because AS matches D (0) and AE matches D (1). You.
【0071】また、通信時間Tcom は送信情報量自体も
低減しているため、その効果を大きい。The communication time T com has a large effect because the amount of transmitted information itself is also reduced.
【0072】なお、正当性確認コードの生成関数として
は対称鍵形式の公開型暗号化関数であるDES、FEA
Lあるいは、対称鍵形式の公開型暗号化関数であるRS
A等のセキュリティ強度の高い暗号関数を使用すること
が望ましい。The functions for generating the validity confirmation code are DES and FEA which are public encryption functions in a symmetric key format.
L or RS which is a public encryption function of a symmetric key format.
It is desirable to use a cryptographic function with high security strength such as A.
【0073】[0073]
【発明の効果】本例では、秘密情報および変更処理が開
発装置側にある例を記したが、それらを物理的に安全で
あるICカード内に機械語形式で格納することにより、
更にシステムとしてのセキュリティを高めることが可能
であると同時に、オブジェクト形式であるため、処理速
度が高くなった。In the present embodiment, an example is described in which the secret information and the change processing are on the development device side. However, by storing them in a physically secure IC card in a machine language format,
Further, the security of the system can be enhanced, and at the same time, the processing speed has been increased because of the object format.
【0074】[0074]
【図1】本発明の一実施例の開発装置の構成例である。FIG. 1 is a configuration example of a development device according to an embodiment of the present invention.
【図2】本発明の一実施例の開発装置のシステムフロー
である。FIG. 2 is a system flow of a development device according to an embodiment of the present invention.
【図3】本発明の一実施例の使用ファイルのフォーマッ
トである。FIG. 3 is a format of a file used according to an embodiment of the present invention.
【図4】本発明の一実施例の翻訳プログラムのフローで
ある。FIG. 4 is a flowchart of a translation program according to an embodiment of the present invention.
【図5】本発明の一実施例の変更プログラムのフローで
ある。FIG. 5 is a flowchart of a change program according to an embodiment of the present invention.
1000 記憶装置 1100 プログラム格納領域 1110 翻訳プログラム 1120 変更プログラム 1200 データ記憶領域 1210 ソースプログラム格納領域 1220 オブジェクトプログラム格納領域 1230 ダウンロードプログラム格納領域 1240 秘密情報格納領域 1241 秘密情報位置 1242 秘密コード 2000 CPU 1000 storage device 1100 program storage area 1110 translation program 1120 change program 1200 data storage area 1210 source program storage area 1220 object program storage area 1230 download program storage area 1240 secret information storage area 1241 secret information location 1242 secret code 2000 CPU
Claims (5)
揮発性メモリ内に格納されたプログラム命令を実行する
処理装置とを備えたICカード用プログラム処理装置で
あって、 ICカード用プログラム処理装置は、少なくとも、機械
語以外の言語のプログラムを機械語のプログラムに翻訳
する第1の手段、およびICカード内の秘密情報の位置
特定情報を記憶する第2の手段を有し、 前記第1の手段は、前記第2の手段の位置特定情報を参
照し前記機械語以外の言語のプログラムを翻訳する作業
とともに、その翻訳内容に前記秘密情報に対する参照・
変更命令を発見した場合、その翻訳を中断あるいは中止
するようにしたICカード用プログラム処理装置。1. An IC card program processing device comprising a programmable non-volatile memory and a processing device for executing a program command stored in the non-volatile memory, wherein the IC card program processing device comprises: At least first means for translating a program in a language other than a machine language into a machine language program, and second means for storing position identification information of secret information in an IC card, wherein the first means Translates a program in a language other than the machine language with reference to the position specifying information of the second means, and includes a reference to the secret information in the translated content.
An IC card program processing device for interrupting or stopping translation when a change instruction is found.
れていることを特徴とする請求項1に記載のICカード
用プログラム処理装置。2. The IC card program processing device according to claim 1, wherein said second means comprises an IC card.
揮発性メモリ内に格納されたプログラム命令を実行する
処理装置とを備えたICカード用プログラム処理装置で
あって、 ICカード用プログラム処理装置は、少なくとも、機械
語以外の言語のプログラムを機械語のプログラムに翻訳
する第1の手段、ICカード内の秘密情報の位置特定情
報を記憶する第2の手段、および出力される翻訳後のプ
ログラムの一部もしくは全部に対して、少なくとも1つ
の秘密パラメータを考慮に入れた演算処理を行い、その
演算結果を翻訳内容に付した形式の機械語に変更する第
3の手段とを有し、 前記第1の手段は、前記第2の手段の位置特定情報を参
照し前記機械語以外の言語のプログラムを翻訳し、前記
第3の手段は、その翻訳内容に前記演算結果を付した形
式の機械語に変更するICカード用プログラム処理装
置。3. An IC card program processing device comprising: a programmable non-volatile memory; and a processing device for executing a program command stored in the non-volatile memory. At least a first means for translating a program in a language other than a machine language into a machine language program, a second means for storing position identification information of secret information in an IC card, and a Third means for performing an arithmetic processing on at least one part of the secret parameters in consideration of at least one secret parameter, and changing the arithmetic result into a machine language in a format attached to the translation content; The first means translates a program in a language other than the machine language with reference to the position specifying information of the second means, and the third means translates the operation result into the translated content. Format of the IC card program processing apparatus to change into machine language marked with.
れていることを特徴とする請求項3に記載のICカード
用プログラム処理装置。4. The IC card program processing device according to claim 3, wherein said second means comprises an IC card.
れていることを特徴とする請求項3もしくは請求項4に
記載のICカード用プログラム処理装置。5. The IC card program processing device according to claim 3, wherein said third means is constituted by an IC card.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP08565392A JP3173522B2 (en) | 1992-04-07 | 1992-04-07 | Program processing device for IC card |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP08565392A JP3173522B2 (en) | 1992-04-07 | 1992-04-07 | Program processing device for IC card |
Publications (2)
Publication Number | Publication Date |
---|---|
JPH05290224A JPH05290224A (en) | 1993-11-05 |
JP3173522B2 true JP3173522B2 (en) | 2001-06-04 |
Family
ID=13864791
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP08565392A Expired - Fee Related JP3173522B2 (en) | 1992-04-07 | 1992-04-07 | Program processing device for IC card |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3173522B2 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH1079000A (en) | 1996-09-03 | 1998-03-24 | Hitachi Ltd | Program-writable IC card |
WO2002008896A1 (en) * | 2000-07-26 | 2002-01-31 | Fujitsu Limited | Method of downloading to card-type storage medium, and card-type storage medium having processing function |
JP2007094885A (en) * | 2005-09-29 | 2007-04-12 | Keyence Corp | Radio tag reader/writer, and radio tag read/write method |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2623332B2 (en) * | 1988-02-03 | 1997-06-25 | 日立マクセル株式会社 | IC card and its operation program writing method |
JPH03206536A (en) * | 1990-01-09 | 1991-09-09 | Nec Software Ltd | Data protection system |
-
1992
- 1992-04-07 JP JP08565392A patent/JP3173522B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JPH05290224A (en) | 1993-11-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5856659A (en) | Method of securely modifying data on a smart card | |
US7707408B2 (en) | Key transformation unit for a tamper resistant module | |
US5754762A (en) | Secure multiple application IC card using interrupt instruction issued by operating system or application program to control operation flag that determines the operational mode of bi-modal CPU | |
US7917760B2 (en) | Tamper resistant module having separate control of issuance and content delivery | |
KR910009297B1 (en) | System for a portable data carrier | |
US6488211B1 (en) | System and method for flexibly loading in IC card | |
US7428992B2 (en) | Secure device and system for issuing IC cards | |
EP1223565A1 (en) | Transaction system, portable device, terminal and methods of transaction | |
EP0985204A1 (en) | Ic card transportation key set | |
US7500605B2 (en) | Tamper resistant device and file generation method | |
US4845717A (en) | IC card having two output buffers | |
US6971025B1 (en) | Secure personalization of chip cards | |
JP3173522B2 (en) | Program processing device for IC card | |
US20070106907A1 (en) | Method and device for encryption and decryption on the fly | |
JPH09265254A (en) | Mutual authentication system for information storage media | |
JPH11282991A (en) | IC card | |
KR100562090B1 (en) | How to insecure multiple non-volatile memory locations in microcircuit cards, especially contactless cards | |
US6435405B1 (en) | Method and system for identifying and handling critical chip card commands | |
JP3671238B2 (en) | Dynamic interpretation of data for chip cards | |
JPS61151793A (en) | Ic card security protection system | |
AU749396B2 (en) | Method of loading commands in the security module of a terminal | |
JP2537198B2 (en) | Portable electronic devices | |
JPS62197848A (en) | Portable electronic equipment system | |
JP3789994B2 (en) | IC card | |
JPH03139717A (en) | Ic card command identification system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080330 Year of fee payment: 7 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090330 Year of fee payment: 8 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100330 Year of fee payment: 9 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100330 Year of fee payment: 9 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110330 Year of fee payment: 10 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120330 Year of fee payment: 11 |
|
LAPS | Cancellation because of no payment of annual fees |