JP2005100378A - Program execution device and authentication station device - Google Patents

Program execution device and authentication station device Download PDF

Info

Publication number
JP2005100378A
JP2005100378A JP2004246984A JP2004246984A JP2005100378A JP 2005100378 A JP2005100378 A JP 2005100378A JP 2004246984 A JP2004246984 A JP 2004246984A JP 2004246984 A JP2004246984 A JP 2004246984A JP 2005100378 A JP2005100378 A JP 2005100378A
Authority
JP
Japan
Prior art keywords
program
key
computer program
processing
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2004246984A
Other languages
Japanese (ja)
Other versions
JP4691337B2 (en
JP2005100378A5 (en
Inventor
Hideki Matsushima
秀樹 松島
Teruto Hirota
照人 廣田
Yukie Shoda
幸恵 庄田
Toshiharu Harada
俊治 原田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2004246984A priority Critical patent/JP4691337B2/en
Publication of JP2005100378A publication Critical patent/JP2005100378A/en
Publication of JP2005100378A5 publication Critical patent/JP2005100378A5/ja
Application granted granted Critical
Publication of JP4691337B2 publication Critical patent/JP4691337B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Storage Device Security (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a program execution device for securely executing programs by preventing unauthorized alteration and analysis. <P>SOLUTION: The program execution device includes; a processing means to be operated in accordance with a first and a second computer program and for controlling the operation in accordance with instructions from an external device; a first protection means for disconnecting the processing means from the external device while the processing means is operated in accordance with the first computer program; and a second protection means for protecting the first computer program while the processing means is operated in accordance with the second computer program. Thus, the program execution device protects the programs against an attack by external hardware as well as the attack by software. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、プログラムの不正な改竄や解析を防止する技術に関する。   The present invention relates to a technique for preventing unauthorized tampering and analysis of a program.

近年、PCやインターネットの普及に伴い、デジタルコンテンツを容易にコピーや編集することが可能となっている。このようなソフトウェアに対する不正な解析や改竄を防止するために、耐タンパ技術が必要不可欠となっている。
耐タンパ技術については以前から研究されており、非特許文献1には、ソフトウェアの解析を防ぐための基本原則や具体的手法に関して記述されている。また、非特許文献2にはソフトウェアの解析防止について、技術的課題と対策について記述されている。
「逆解析や改変からソフトを守る」日経エレクトロニクス1998.1.5(209〜220ページ) 「ソフトウェアの耐タンパー化技術」富士ゼロックス テクニカルレポート No.13(20〜28ページ)
In recent years, with the spread of PCs and the Internet, digital contents can be easily copied and edited. In order to prevent such illegal analysis and falsification of software, tamper resistant technology is indispensable.
Tamper resistance technology has been studied for some time, and Non-Patent Document 1 describes basic principles and specific methods for preventing software analysis. Non-Patent Document 2 describes technical problems and countermeasures regarding software analysis prevention.
"Protect software from reverse analysis and modification" Nikkei Electronics 1998.1.5 (pp. 209-220) “Software tamper resistance technology” Fuji Xerox Technical Report No. 13 (20-28 pages)

しかしながら、悪意のある利用者からプログラムを保護するためには、多様な保護技術の提供が要望されている。   However, in order to protect the program from malicious users, provision of various protection technologies is desired.

発明の開示
そこで本発明はかかる問題点に鑑みてなされたものであり、不正な改竄、解析を防止し、セキュアにプログラムを実行するプログラム実行装置を提供することを目的とする。
上記目的を達成するために本発明は、プログラム実行装置であって、第1及び第2コンピュータプログラムに従って動作する,また、外部装置からの指示に従って前記動作を制御する処理手段と、前記処理手段が前記第1コンピュータプログラムに従って動作する場合に、前記外部装置から前記処理手段を切り離す第1保護手段と、前記処理手段が前記第2コンピュータプログラムに従って動作する場合に、前記第1コンピュータプログラムを保護する第2保護手段とを備えることを特徴とするプログラム実行装置である。
DISCLOSURE OF THE INVENTION Accordingly, the present invention has been made in view of such problems, and an object thereof is to provide a program execution apparatus that prevents unauthorized tampering and analysis and executes a program securely.
In order to achieve the above object, the present invention provides a program execution device that operates in accordance with the first and second computer programs, and that controls the operation in accordance with an instruction from an external device; A first protection means for separating the processing means from the external device when operating in accordance with the first computer program; and a first protection means for protecting the first computer program when the processing means operates in accordance with the second computer program. 2 is a program execution device.

これによって、外部からのハードウェアによる攻撃と、ソフトウェアによる攻撃との両方からプログラムを保護することが出来る。   As a result, the program can be protected from both external hardware attacks and software attacks.

本発明は、上記構成のプログラム実行装置である。
この構成によると、外部からのハードウェアによる攻撃と、ソフトウェアによる攻撃との両方からプログラムを保護することが出来る。また、外部装置から切り離すので、高いセキュリティを保つことが出来る。
ここで、前記第2保護手段は、前記処理手段が前記第1コンピュータプログラムに従って動作している場合に、前記処理手段がデータを書き込む記憶領域を含み、前記処理手段が、前記第1コンピュータプログラムから第2コンピュータプログラムに切り替える直前に、前記記憶領域に書き込まれているデータを暗号化し、前記第2コンピュータプログラムから第1コンピュータプログラムに切り替えると、前記暗号化したデータを復号するとしても良い。
The present invention is a program execution device configured as described above.
According to this configuration, the program can be protected from both external hardware attacks and software attacks. Also, since it is disconnected from the external device, high security can be maintained.
Here, the second protection means includes a storage area in which the processing means writes data when the processing means operates in accordance with the first computer program, and the processing means includes the first computer program. Immediately before switching to the second computer program, the data written in the storage area may be encrypted, and when the second computer program is switched to the first computer program, the encrypted data may be decrypted.

また、前記第1コンピュータプログラムは、更に、前記第2コンピュータプログラムを呼び出す呼出命令を含み、前記第2保護手段は、前記処理手段が前記呼出命令を実行して前記第2コンピュータプログラムに切り替える直前に、前記記憶領域に書き込まれているデータを暗号化するとしても良い。
この構成によると、第1コンピュータプログラムの実行中に、他のプログラムへ制御が移る場合に、記憶領域に書き込まれているデータを暗号化するので、第1コンピュータプログラムで扱うデータを他のプログラムから保護することが出来、第1コンピュータプログラムの解析を防止することが出来る。また、領域内のデータを暗号化するので、少ないメモリ使用量で処理を実行可能となる。これにより、携帯電話機やPDAなど、CPUの処理速度やメモリ容量などのリソースが限られている機器においても、高いセキュリティを保つことが出来る。
The first computer program further includes a call instruction for calling the second computer program, and the second protection means immediately before the processing means executes the call instruction and switches to the second computer program. The data written in the storage area may be encrypted.
According to this configuration, when control is transferred to another program during execution of the first computer program, the data written in the storage area is encrypted, so that the data handled by the first computer program is transferred from the other program. It can be protected and analysis of the first computer program can be prevented. Further, since the data in the area is encrypted, the processing can be executed with a small amount of memory usage. As a result, high security can be maintained even in devices such as mobile phones and PDAs that have limited resources such as CPU processing speed and memory capacity.

ここで、前記プログラム実行装置は、更に、割り込みの発生を検出する割込検出手段を備え、前記第2コンピュータプログラムは、割り込みが発生した場合に行う処理を示し、前記第2保護手段は、前記処理手段が前記第1コンピュータプログラム実行中に前記割込検出手段が割り込みを検出すると、前記記憶領域に書き込まれているデータを暗号化し、暗号化後に、前記処理手段が前記第2コンピュータプログラムに従って動作することを許可するとしても良い。   Here, the program execution device further includes an interrupt detection means for detecting the occurrence of an interrupt, the second computer program indicates a process to be performed when an interrupt occurs, and the second protection means If the interrupt detection means detects an interrupt while the processing means is executing the first computer program, the data written in the storage area is encrypted, and after the encryption, the processing means operates according to the second computer program. It may be allowed to do.

この構成によると、割り込みが発生した場合に、割り込み処理である第2コンピュータの実行前に、第1コンピュータプログラムで扱うデータを暗号化するので、割り込み処理を用いたソフトウェアによる解析から第1コンピュータプログラムを保護することが出来る。
ここで、前記プログラム実行装置は、更に、割り込みの発生を検出する割込検出手段を備え、前記第1コンピュータプログラムを暗号化して生成される暗号化プログラムを記憶する記憶手段を備え、前記第2コンピュータプログラムは、割り込みが発生した場合に行う処理を示し、前記第2保護手段は、前記処理手段が前記第2コンピュータプログラムに従って動作することを禁止し、プログラム復号鍵を取得し、取得したプログラム復号鍵を用いて前記暗号化プログラムを復号して前記第1コンピュータプログラムを生成し、前記プログラム復号鍵を消去し、前記プログラム復号鍵を消去した後に、前記処理手段が前記第2コンピュータプログラムに従って動作することを許可するとしても良い。
According to this configuration, when an interrupt occurs, the data handled by the first computer program is encrypted before the execution of the second computer, which is an interrupt process, so that the first computer program is analyzed from software analysis using the interrupt process. Can be protected.
Here, the program execution device further includes interrupt detection means for detecting occurrence of an interrupt, and further comprises storage means for storing an encrypted program generated by encrypting the first computer program, The computer program indicates processing to be performed when an interrupt occurs, and the second protection unit prohibits the processing unit from operating according to the second computer program, acquires a program decryption key, and acquires the acquired program decryption The encryption program is decrypted using a key to generate the first computer program, the program decryption key is erased, and after the program decryption key is erased, the processing means operates according to the second computer program You may allow that.

この構成によると、暗号化プログラムを復号するプログラム鍵を保持している間は、割り込みを受け付けないので、割り込みを利用した解析からプログラム復号鍵を保護することが出来るので、第1コンピュータプログラムを不正な解析から防ぐこと出来る。
ここで、前記第2保護手段は、前記第1コンピュータプログラムを含む処理プログラムが生成されたときに少なくとも一部に基づいて生成される第1改竄検出値を取得し、前記処理手段が前記第1コンピュータプログラムを実行する前に、前記処理プログラムの少なくとも一部に基づいて第2改竄検出値を生成し、前記第1改竄検出値と前記第2改竄検出値とが異なる場合、前記処理手段が前記第1コンピュータプログラムに従って動作することを抑制するとしても良い。
According to this configuration, since the interrupt is not accepted while the program key for decrypting the encrypted program is held, the program decryption key can be protected from the analysis using the interrupt. Can be prevented from serious analysis.
Here, the second protection means acquires a first falsification detection value generated based on at least a part when a processing program including the first computer program is generated, and the processing means is configured to acquire the first falsification value. Before executing the computer program, a second falsification detection value is generated based on at least a part of the processing program, and if the first falsification detection value and the second falsification detection value are different, the processing means The operation according to the first computer program may be suppressed.

この構成によると、第2保護手段は、保護プログラムの改竄が検出された場合に、前記処理手段が第1コンピュータプログラムを実行することを禁止するので、仮に第1コンピュータプログラムが改竄されたとしても、改竄された第1コンピュータプログラムを実行することは無く、被害を少なくすることが出来る。
ここで、前記処理プログラムは、前記第1改竄検出値を含み、前記第2保護手段は、前記処理プログラムから、前記第1改竄検出値を取得するとしても良い。
According to this configuration, the second protection means prohibits the processing means from executing the first computer program when a falsification of the protection program is detected. Even if the first computer program is falsified, The falsified first computer program is not executed and damage can be reduced.
Here, the processing program may include the first tampering detection value, and the second protection unit may acquire the first tampering detection value from the processing program.

この構成によると、処理プログラムの少なくとも一部に基づいて生成される改竄検出値を、処理プログラムが保持しているので、処理プログラムが改竄された場合など、処理プログラムに変更が必要になった場合に、プログラム実行装置の他の処理手段に変更を加えることなく、処理プログラムのみを変更することが出来る。   According to this configuration, when the processing program holds a falsification detection value generated based on at least a part of the processing program, such as when the processing program is falsified, it is necessary to change the processing program In addition, only the processing program can be changed without changing other processing means of the program execution apparatus.

以下、本発明の実施の形態について図面を用いて詳細に説明する。
1.セキュア処理システム1の構成
セキュア処理システム1は、図1に示すように、認証局装置100、ROMライター200、携帯端末300及びメモリカード400から構成される。
セキュア処理システム1は、携帯端末300によって実行されるプログラムを不正な解析や改竄から保護するシステムである。保護対象のプログラムは、認証局装置100において生成され、ROMライター200によってROMに書き込まれる。プログラムが書き込まれたROMは携帯端末300に組み込まれる。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
1. Configuration of Secure Processing System 1 The secure processing system 1 includes a certificate authority device 100, a ROM writer 200, a portable terminal 300, and a memory card 400, as shown in FIG.
The secure processing system 1 is a system that protects a program executed by the mobile terminal 300 from unauthorized analysis and tampering. The program to be protected is generated in the certificate authority device 100 and written to the ROM by the ROM writer 200. The ROM in which the program is written is incorporated in the mobile terminal 300.

ここで、保護対象のプログラムは、メモリカード400に記録されている暗号化された音楽データを復号する暗号化音楽データ復号プログラムである場合を例として説明する。
1.1 認証局装置100
認証局装置100は、領域確保プログラム、割込禁止プログラム、呼出プログラム、鍵受信プログラム、実行フラグ、割込ハンドラ、復号プログラム及びセキュアプログラムから成る第2セキュア処理プログラムを生成する装置である。セキュアプログラムは保護対象となる暗号化音楽データ復号プログラムを含む。
Here, the case where the program to be protected is an encrypted music data decryption program for decrypting encrypted music data recorded on the memory card 400 will be described as an example.
1.1 Certificate Authority Device 100
The certificate authority device 100 is a device that generates a second secure processing program including an area reservation program, an interrupt prohibition program, a calling program, a key reception program, an execution flag, an interrupt handler, a decryption program, and a secure program. The secure program includes an encrypted music data decryption program to be protected.

生成した第2セキュア処理プログラムは、ROMライター200でROMに記録され、携帯端末300に組み込まれる。
各プログラムについては後述する。
認証局装置100は、図2に示すように、コンパイラ101、プログラム暗号化部102、鍵暗号化部103、ハッシュ値算出部104、データ埋込部105、記憶部106及び送信部107から構成される。
The generated second secure processing program is recorded in the ROM by the ROM writer 200 and incorporated into the portable terminal 300.
Each program will be described later.
As shown in FIG. 2, the certificate authority device 100 includes a compiler 101, a program encryption unit 102, a key encryption unit 103, a hash value calculation unit 104, a data embedding unit 105, a storage unit 106, and a transmission unit 107. The

認証局装置100は、具体的には、マイクロプロセッサ、ROM、RAM、ハードディスクユニット、ディスプレィユニット、キーボードなどから構成されるコンピュータシステムである。前記RAM又は前記ハードディスクユニットには、コンピュータプログラムが記憶されている。前記マイクロプロセッサが、前記コンピュータプログラムに従って動作することにより、認証局装置100は、その機能を達成する。
(1)コンパイラ101
コンパイラ101は、領域確保プログラム、割込禁止プログラム、鍵受信プログラム、実行フラグ及び割込ハンドラから成る保護プログラム、呼出プログラム、復号プログラム及びセキュアプログラムのソースコードを入力として受け付ける。呼出プログラムは、第2セキュア処理プログラムを実行する際に、改竄されているか否かを検出する際に利用するデータを送信するプログラムであり、TRS領域先頭アドレスを含む。TRS領域プログラムは、第2セキュア処理プログラムの復号プログラム516及び暗号化プログラム517の部分に相当する。TRS領域先頭アドレスは、携帯端末300に組み込まれた後のメモリ上での先頭アドレスである。
Specifically, the certificate authority device 100 is a computer system including a microprocessor, ROM, RAM, a hard disk unit, a display unit, a keyboard, and the like. A computer program is stored in the RAM or the hard disk unit. The certificate authority apparatus 100 achieves its functions by the microprocessor operating according to the computer program.
(1) Compiler 101
The compiler 101 receives as input the source code of an area reservation program, an interrupt prohibition program, a key reception program, a protection program including an execution flag and an interrupt handler, a calling program, a decryption program, and a secure program. The calling program is a program that transmits data used when detecting whether or not the second secure processing program has been tampered with, and includes a TRS area head address. The TRS area program corresponds to the decryption program 516 and the encryption program 517 of the second secure processing program. The TRS area head address is the head address on the memory after being incorporated in the mobile terminal 300.

コンパイラ101は、呼出プログラム、復号プログラム、セキュアプログラム及び保護プログラムのソースコードを受け付けると、図3に示すように、各プログラムをコンパイルする。まず、字句解析を行い(ステップS621)、構文解析を行い(ステップS622)、実行形式のプログラムであるバイナリデータを生成する(ステップS623)。
コンパイラ101は、生成した呼出プログラムバイナリデータ及び保護プログラムバイナリデータをデータ埋込部105へ出力する。また、復号プログラムバイナリデータ及びセキュアプログラムバイナリデータをプログラム暗号化部102へ出力する。
(2)プログラム暗号化部102
プログラム暗号化部102は、復号プログラムバイナリデータ及びセキュアプログラムバイナリデータを受け取る。また、プログラム鍵の入力を受け付ける。プログラム暗号化部102は、プログラム鍵を用いて、セキュアプログラムに暗号化アルゴリズムE1を施して暗号化プログラムを生成する。暗号化アルゴリズムE1は、一例としてAES(Advanced Encryption Standard)である。AESについては公知であるので、説明を省略する。なお、他の暗号化アルゴリズムを用いても良いのは勿論である。
When the compiler 101 receives the source code of the calling program, the decryption program, the secure program, and the protection program, the compiler 101 compiles each program as shown in FIG. First, lexical analysis is performed (step S621), syntax analysis is performed (step S622), and binary data that is an executable program is generated (step S623).
The compiler 101 outputs the generated calling program binary data and protection program binary data to the data embedding unit 105. Also, the decryption program binary data and the secure program binary data are output to the program encryption unit 102.
(2) Program encryption unit 102
The program encryption unit 102 receives decryption program binary data and secure program binary data. It also accepts program key input. The program encryption unit 102 generates an encrypted program by applying the encryption algorithm E1 to the secure program using the program key. As an example, the encryption algorithm E1 is AES (Advanced Encryption Standard). Since AES is publicly known, description thereof is omitted. Of course, other encryption algorithms may be used.

プログラム暗号化部102は、復号プログラムと暗号化プログラムとを、TRS領域プログラムとしてデータ埋込部105へ出力する。
また、生成したTRS領域プログラムをハッシュ値算出部104へ出力する。
(3)鍵暗号化部103
鍵暗号化部103は、プログラム鍵とマスタ鍵との入力を受け付ける。
The program encryption unit 102 outputs the decryption program and the encryption program to the data embedding unit 105 as a TRS area program.
The generated TRS area program is output to the hash value calculation unit 104.
(3) Key encryption unit 103
The key encryption unit 103 accepts input of a program key and a master key.

鍵暗号化部103は、マスタ鍵を用いてプログラム鍵に暗号化アルゴリズムE1を施して暗号化し、暗号化鍵を生成する。生成した暗号化鍵をデータ埋込部105へ出力する。
(4)ハッシュ値算出部104
ハッシュ値算出部104は、第2セキュア処理プログラムの少なくとも一部に対してハッシュ値を算出する。
The key encryption unit 103 encrypts the program key by applying the encryption algorithm E1 using the master key, and generates an encryption key. The generated encryption key is output to the data embedding unit 105.
(4) Hash value calculation unit 104
The hash value calculation unit 104 calculates a hash value for at least a part of the second secure processing program.

ここでは、TRS領域プログラムと、秘密鍵とを入力として受け付け、秘密鍵を用いてTRS領域プログラムに対するハッシュ値を算出する。
ハッシュ値の算出には一例として、HMAC(Keyed-Hashing for Message Authentication)で用いられるアルゴリズムを使用するものとする。
ここで、Hをハッシュ関数、Kを秘密鍵とし、textをハッシュ対象となるデータ、opadは、バイト値Ox36を64回繰り返した文字列、ipadは、バイト値Ox5Cを64回繰り返した文字列とすると、ハッシュ値算出のアルゴリズムは、H(K XOR opad ,H(K XOR ipad, text))のように表される。
Here, a TRS area program and a secret key are accepted as inputs, and a hash value for the TRS area program is calculated using the secret key.
For example, an algorithm used in HMAC (Keyed-Hashing for Message Authentication) is used to calculate the hash value.
Here, H is a hash function, K is a secret key, text is data to be hashed, opad is a character string in which the byte value Ox36 is repeated 64 times, ipad is a character string in which the byte value Ox5C is repeated 64 times, and Then, the algorithm for calculating the hash value is expressed as H (K XOR opad, H (K XOR ipad, text)).

また、ハッシュ値算出部104は、TRS領域プログラムのバイナリサイズを導出する。
ハッシュ値算出部104は、生成したハッシュ値と、ハッシュ値算出の対象となったTRS領域プログラムのバイナリサイズとをデータ埋込部105へ出力する。
(5)データ埋込部105
データ埋込部105は、コンパイラ101から呼出プログラムバイナリデータと保護プログラムバイナリデータとを受け取り、ハッシュ値算出部104からハッシュ値及びバイナリサイズを受け取る。また、鍵暗号化部103から暗号化鍵を受け取り、プログラム暗号化部102からTRS領域プログラムを受け取る。
Further, the hash value calculation unit 104 derives the binary size of the TRS area program.
The hash value calculation unit 104 outputs the generated hash value and the binary size of the TRS area program that is the target of hash value calculation to the data embedding unit 105.
(5) Data embedding unit 105
The data embedding unit 105 receives calling program binary data and protection program binary data from the compiler 101, and receives a hash value and a binary size from the hash value calculation unit 104. Also, the encryption key is received from the key encryption unit 103 and the TRS area program is received from the program encryption unit 102.

データ埋込部105は、ハッシュ値算出部104から受け取ったハッシュ値を改竄検出値として呼出プログラムに埋め込む。また、バイナリサイズ及び暗号化鍵を呼出プログラムに埋め込む。また、データを埋め込んだ呼出プログラムを保護プログラムに含め、保護プログラムと、プログラム暗号化部102から受け取るTRS領域プログラムとを合わせて第2セキュア処理プログラムを生成し、記憶部106へ書き込む。
(6)記憶部106
記憶部106は、データ埋込部105によって書き込まれる第2セキュア処理プログラムを記憶する。
(7)送信部107
送信部107は、記憶部106に記憶している第2セキュア処理プログラムをROMライターへ出力する。
1.2 ROMライター200
ROMライターは、認証局装置100に接続されており、認証局装置100から受け取る第2セキュア処理プログラムをROMに書き込む。ROMライター200によってプログラムが書き込まれたROMは、携帯端末300へ組み込まれる。
1.3 メモリカード400
メモリカード400は、図4に示すように、制御部401、入出力部402、認証部403及び情報記憶部404から構成される。
(1)入出力部402
入出力部402は、メモリカード400が他の機器に接続された場合に、他の機器と制御部401との間でデータの入出力を行う。
(2)情報記憶部404
また、情報記憶部404は、データ領域410とセキュア領域420とを含む。
The data embedding unit 105 embeds the hash value received from the hash value calculation unit 104 in the calling program as a falsification detection value. Also, the binary size and the encryption key are embedded in the calling program. In addition, the calling program in which data is embedded is included in the protection program, and the protection program and the TRS area program received from the program encryption unit 102 are combined to generate a second secure processing program and write it to the storage unit 106.
(6) Storage unit 106
The storage unit 106 stores the second secure processing program written by the data embedding unit 105.
(7) Transmitter 107
The transmission unit 107 outputs the second secure processing program stored in the storage unit 106 to the ROM writer.
1.2 ROM writer 200
The ROM writer is connected to the certificate authority device 100 and writes a second secure processing program received from the certificate authority device 100 to the ROM. The ROM in which the program is written by the ROM writer 200 is incorporated into the portable terminal 300.
1.3 Memory card 400
As illustrated in FIG. 4, the memory card 400 includes a control unit 401, an input / output unit 402, an authentication unit 403, and an information storage unit 404.
(1) Input / output unit 402
The input / output unit 402 performs input / output of data between the other device and the control unit 401 when the memory card 400 is connected to another device.
(2) Information storage unit 404
The information storage unit 404 includes a data area 410 and a secure area 420.

データ領域410は、暗号化音楽データ411を記憶している。暗号化音楽データ411は、MP3形式の音楽データに、タイトル鍵421を用いて暗号化アルゴリズムE1を施して生成される。
セキュア領域420は、タイトル鍵421を記憶しており、認証部403との相互認証に成功した機器のみが読み出すことが出来る。
The data area 410 stores encrypted music data 411. The encrypted music data 411 is generated by applying the encryption algorithm E1 to the music data in MP3 format using the title key 421.
The secure area 420 stores a title key 421 and can be read only by a device that has been successfully mutually authenticated with the authentication unit 403.

なお、情報記憶部404にデータを記録する際には、メモリカード400に固有の情報に基づいて暗号化して記録するなどとしても良い。
(3)認証部403
認証部403は、携帯端末300とCPRM(Content Protection for Recordable Media)の仕組みに基づいて相互認証を行い、認証に成功した場合に、認証した機器と鍵を共有する。共有した鍵を制御部401へ出力する。なお、CPRMについては、公知であるので説明を省略する。また、他の認証方法に従って認証するとしても良い。
(4)制御部401
制御部401は、入出力部402を介して他の機器と情報の入出力を行う。セキュア領域420に記憶されているデータは、認証部403による認証に成功した機器にのみアクセスを許可する。なお、セキュア領域420に記憶されているデータを出力する場合には、認証部403による認証で生成した共有鍵を用いて暗号化して出力する。
When data is recorded in the information storage unit 404, it may be encrypted and recorded based on information unique to the memory card 400.
(3) Authentication unit 403
The authentication unit 403 performs mutual authentication based on the mobile terminal 300 and a CPRM (Content Protection for Recordable Media) mechanism, and shares the key with the authenticated device when the authentication is successful. The shared key is output to the control unit 401. Since CPRM is publicly known, description thereof is omitted. Further, authentication may be performed according to another authentication method.
(4) Control unit 401
The control unit 401 inputs / outputs information with other devices via the input / output unit 402. The data stored in the secure area 420 permits access only to devices that have been successfully authenticated by the authentication unit 403. In addition, when outputting the data memorize | stored in the secure area | region 420, it encrypts using the shared key produced | generated by the authentication by the authentication part 403, and outputs it.

データ領域410に記憶されているデータは、認証を行わずに、他の機器からのアクセスを許可する。
1.4 携帯端末300
携帯端末300は、図5に示すように、CPU301、デバッガインターフェース302、デバッガ無効化回路303、割り込みコントローラ304、メモリ305、メモリカードインターフェース306、入力部307、表示部308、スピーカ309、デコーダ310、マイク312、変換部313、無線制御部314、無線部315及びアンテナ316から構成され、これらがバス317によって接続されており、割込コントローラ304からCPU301へは割込線318が接続されている。
The data stored in the data area 410 permits access from other devices without performing authentication.
1.4 Mobile device 300
As shown in FIG. 5, the portable terminal 300 includes a CPU 301, a debugger interface 302, a debugger invalidation circuit 303, an interrupt controller 304, a memory 305, a memory card interface 306, an input unit 307, a display unit 308, a speaker 309, a decoder 310, The microphone 312, the conversion unit 313, the radio control unit 314, the radio unit 315, and the antenna 316 are connected by a bus 317, and an interrupt line 318 is connected from the interrupt controller 304 to the CPU 301.

以下、各構成について説明する。
(1)デバッガ無効化回路303、デバッガインターフェース302
デバッガ無効化回路303は、CPU301とデバッガインターフェース302との間に設けられ、CPU301とデバッガインターフェース302とを接続又は切断することができる。
Each configuration will be described below.
(1) Debugger invalidation circuit 303, debugger interface 302
The debugger invalidation circuit 303 is provided between the CPU 301 and the debugger interface 302, and can connect or disconnect the CPU 301 and the debugger interface 302.

デバッガ無効化回路303は、CPU301から「有効」を示すデバッガ制御信号を受け取ると、CPU301とデバッガインターフェース302とを接続し、CPU301から「無効」を示すデバッガ制御信号を受け取ると、CPU301とデバッガインターフェース302とを切断する。
CPU301とデバッガインターフェース302とが接続されているときは、デバッガインターフェース302の外部に接続されるデバッガが有効であり、CPU301とデバッガインターフェース302とが切断されているときは、デバッガインターフェース302の外部に接続されるデバッガが無効である。具体例として、デバッガ無効化回路303は、スイッチにより実現される。なお、スイッチ回路のように物理的に接続を切るとしても良いし、電気的に切断するとしても良い。
When receiving a debugger control signal indicating “valid” from the CPU 301, the debugger invalidation circuit 303 connects the CPU 301 and the debugger interface 302, and when receiving a debugger control signal indicating “invalid” from the CPU 301, the CPU 301 and the debugger interface 302. And disconnect.
When the CPU 301 and the debugger interface 302 are connected, the debugger connected to the outside of the debugger interface 302 is effective, and when the CPU 301 and the debugger interface 302 are disconnected, the debugger 301 is connected to the outside. The debugger to be used is invalid. As a specific example, the debugger invalidation circuit 303 is realized by a switch. Note that the connection may be physically disconnected like a switch circuit, or may be electrically disconnected.

デバッガインターフェース302は、携帯端末300と外部のデバッガとを接続するためのインターフェースである。
(2)メモリ305
メモリ305は、図6に示す、第1セキュア処理プログラム501、第2セキュア処理プログラム502、ベクタテーブル503、音楽再生プログラム504及びアプリケーション505を記憶している。
The debugger interface 302 is an interface for connecting the mobile terminal 300 to an external debugger.
(2) Memory 305
The memory 305 stores a first secure processing program 501, a second secure processing program 502, a vector table 503, a music playback program 504, and an application 505 shown in FIG.

(A)第2セキュア処理プログラム502
第2セキュア処理プログラム502は、前述の認証局装置100によって生成されROMに記録されたプログラムであり、図7に示す各プログラムによって構成される。
以下、各プログラムについて説明する。
(領域確保プログラム511)
領域確保プログラム511は、認証通信プログラム523及び暗号化音楽データ復号プログラム524の実行中に使用する動的メモリを確保するためのメモリ領域を確保する。
(A) Second secure processing program 502
The second secure processing program 502 is a program generated by the certificate authority device 100 described above and recorded in the ROM, and is configured by each program shown in FIG.
Each program will be described below.
(Area reservation program 511)
The area securing program 511 secures a memory area for securing a dynamic memory used during execution of the authentication communication program 523 and the encrypted music data decryption program 524.

(割込禁止プログラム512)
割込禁止プログラム512は、割り込みをマスクすることにより、割り込みの処理を禁止する。
(呼出プログラム513)
呼出プログラム513は、第1セキュア処理プログラム501を呼び出して起動する。
(Interrupt prohibited program 512)
The interrupt prohibition program 512 prohibits interrupt processing by masking interrupts.
(Calling program 513)
The calling program 513 calls and starts the first secure processing program 501.

呼出プログラム513は、図8に示す改竄検出値541、TRS領域先頭アドレス542、バイナリサイズ543及び暗号化鍵544から成る改竄検出データを含む。第1セキュア処理プログラム501を呼び出すと共に改竄検出データを送信する。改竄検出データは、認証局装置100のデータ埋込部105にて埋め込まれたデータである。
改竄検出値541は、認証局装置100によって、第2セキュア処理プログラム502のTRS領域の範囲に対して算出されたハッシュ値である。
The calling program 513 includes falsification detection data including a falsification detection value 541, a TRS area head address 542, a binary size 543, and an encryption key 544 shown in FIG. The first secure processing program 501 is called and falsification detection data is transmitted. The falsification detection data is data embedded in the data embedding unit 105 of the certificate authority device 100.
The falsification detection value 541 is a hash value calculated by the certificate authority device 100 for the range of the TRS area of the second secure processing program 502.

TRS領域先頭アドレス542は、ハッシュ値算出の対象となるデータの、メモリ305における先頭アドレスを示す。
バイナリサイズ543は、ハッシュ値算出の対象となるデータのバイナリサイズを示す。
暗号化鍵544は、認証局装置100の鍵暗号化部103によって、マスタ鍵を用いてプログラム鍵を暗号化して生成されたものである。
The TRS area head address 542 indicates the head address in the memory 305 of the data for which the hash value is calculated.
The binary size 543 indicates the binary size of the data for which the hash value is calculated.
The encryption key 544 is generated by encrypting the program key using the master key by the key encryption unit 103 of the certificate authority device 100.

(鍵受信プログラム514)
鍵受信プログラム514は、第1セキュア処理プログラム501から送信されるプログラム鍵を受信し、復号プログラム516へ送信する。
(実行フラグ515)
実行フラグ515は、セキュアプログラムが実行中であるか否かを示す。復号プログラム516が暗号化プログラム517を復号する前に、セキュアプログラムを実行中であることを示す「ON」の状態にし、セキュアプログラムの実行が終了するときに「OFF」の状態にする。
(Key reception program 514)
The key reception program 514 receives the program key transmitted from the first secure processing program 501 and transmits it to the decryption program 516.
(Execution flag 515)
The execution flag 515 indicates whether or not the secure program is being executed. Before the decryption program 516 decrypts the encryption program 517, it is set to “ON” indicating that the secure program is being executed, and is set to “OFF” when the execution of the secure program is completed.

(復号プログラム516)
復号プログラム516は、鍵受信プログラム514からプログラム鍵を受け取り、プログラム鍵を用いて暗号化プログラム517に復号アルゴリズムD1を施して復号し、セキュアプログラムを生成する。
ここで、暗号化プログラムの復号には、WO04/013744 (2004.02.12)で公開されている技術を用いる。この技術は、暗号化プログラムを少しずつメモリにロードして実行していく。そのため、復号後のプログラム全体がメモリ上に存在するわけではないので、外部からメモリ内のデータを不正に読み込まれてもプログラムを解析されない。
(Decryption program 516)
The decryption program 516 receives the program key from the key receiving program 514, decrypts the encryption program 517 using the decryption algorithm D1 using the program key, and generates a secure program.
Here, for decryption of the encryption program, a technique disclosed in WO04 / 013744 (2004.02.12) is used. This technology loads the encryption program into the memory little by little and executes it. For this reason, the entire decrypted program does not exist in the memory, and therefore the program is not analyzed even if the data in the memory is illegally read from the outside.

(暗号化プログラム517)
暗号化プログラム517は、セキュアプログラムが暗号化されて生成されたものである。セキュアプログラムは、図7に示す割込禁止解除プログラム521、領域初期化プログラム522、認証通信プログラム523、暗号化音楽データ復号プログラム524、領域鍵525、領域暗号化プログラム526、領域復号プログラム527及び領域終了処理プログラム528から構成される。割込禁止解除プログラム521、領域初期化プログラム522、認証通信プログラム523、領域鍵525、領域暗号化プログラム526、領域復号プログラム527及び領域終了処理プログラム528は、暗号化音楽データ復号プログラム524を他のプログラムから保護する。
(Encryption program 517)
The encryption program 517 is generated by encrypting a secure program. The secure program includes an interrupt prohibition release program 521, an area initialization program 522, an authentication communication program 523, an encrypted music data decryption program 524, an area key 525, an area encryption program 526, an area decryption program 527, and an area shown in FIG. It is composed of an end processing program 528. The interrupt prohibition release program 521, the area initialization program 522, the authentication communication program 523, the area key 525, the area encryption program 526, the area decryption program 527, and the area end processing program 528 are used to transfer the encrypted music data decryption program 524 to the other Protect from programs.

(a)割込禁止解除プログラム521
割込禁止解除プログラム521は、上記割込禁止プログラム512で行った割込禁止を解除する。
(b)領域初期化プログラム522
領域初期化プログラム522は、上記領域確保プログラム511によって確保されたメモリ領域を初期化し、暗号化対象となる記憶領域を確保する。
(A) Interrupt prohibition release program 521
The interrupt prohibition cancel program 521 cancels the interrupt prohibition performed by the interrupt prohibition program 512.
(B) Area initialization program 522
The area initialization program 522 initializes the memory area secured by the area securing program 511 and secures a storage area to be encrypted.

記憶領域は、認証通信プログラム523及び暗号化音楽データ復号プログラム524によって利用される記憶領域であり、実行中に使用するデータが書き込まれる。
(b)認証通信プログラム523
認証通信プログラム523は、認証鍵531を保持する。
認証通信プログラム523は、第1セキュア処理プログラム501が正当なプログラムであるか否かの片方向認証を行う。
The storage area is a storage area used by the authentication communication program 523 and the encrypted music data decryption program 524, in which data used during execution is written.
(B) Authentication communication program 523
The authentication communication program 523 holds an authentication key 531.
The authentication communication program 523 performs one-way authentication as to whether or not the first secure processing program 501 is a valid program.

(c)暗号化音楽データ復号プログラム524
暗号化音楽データ復号プログラム524は、メモリカード400に記録されている暗号化音楽データ411に対して、タイトル鍵を用い、復号アルゴリズムD1を施して復号し、音楽データを生成する。なお、復号アルゴリズムD1は、暗号化アルゴリズムE1の逆の処理を行うアルゴリズムである。
(C) Encrypted music data decryption program 524
The encrypted music data decryption program 524 decrypts the encrypted music data 411 recorded on the memory card 400 by using the title key and the decryption algorithm D1 to generate music data. The decryption algorithm D1 is an algorithm that performs the reverse process of the encryption algorithm E1.

(d)領域鍵525
領域鍵525は、下記領域暗号化プログラム526において、記憶領域内のデータを暗号化する際、及び、暗号化されたデータを領域復号プログラム527において復号する際に用いられる。
(e)領域暗号化プログラム526
領域暗号化プログラム526は、領域鍵525を用いて、上記記憶領域内のデータに暗号化アルゴリズムE2を施して暗号化する。なお、暗号化アルゴリズムE2は、暗号化アルゴリズムE1よりも高速に処理を行うことが出来るアルゴリズムであり、一例としてXOR演算である。なお、暗号化アルゴリズムE2は、XOR演算に限定されず、他の暗号化アルゴリズムを用いても良く、要求されるセキュリティ強度やCPUの処理能力によって決定される。
(D) Area key 525
The area key 525 is used when the data in the storage area is encrypted in the area encryption program 526 described below, and when the encrypted data is decrypted in the area decryption program 527.
(E) Area encryption program 526
The area encryption program 526 uses the area key 525 to encrypt the data in the storage area by applying the encryption algorithm E2. Note that the encryption algorithm E2 is an algorithm that can perform processing faster than the encryption algorithm E1, and is an XOR operation as an example. Note that the encryption algorithm E2 is not limited to the XOR operation, and other encryption algorithms may be used, which are determined by required security strength and CPU processing capability.

領域暗号化プログラム526は、第2セキュア処理プログラム502から、第1セキュア処理プログラム501を呼び出す場合、第1セキュア処理プログラム501に制御が移る前に記憶領域内のデータを暗号化する。
(f)領域復号プログラム527
領域復号プログラム527は、第1セキュア処理プログラム501から第2セキュア処理プログラム502に制御が戻ると、記憶領域内の暗号化されているデータに復号アルゴリズムD2を施して復号し、平文のデータに戻す。
When the first secure processing program 501 is called from the second secure processing program 502, the region encryption program 526 encrypts data in the storage region before the control is transferred to the first secure processing program 501.
(F) Area decoding program 527
When the control returns from the first secure processing program 501 to the second secure processing program 502, the area decryption program 527 decrypts the encrypted data in the storage area by applying the decryption algorithm D2, and returns it to plaintext data. .

(g)領域終了処理プログラム528
領域終了処理プログラム528は、領域初期化プログラム522で確保した記憶領域を開放し、第1セキュア処理プログラム501の終了関数を呼び出し、音楽データ再生処理を終了する。
(割込ハンドラ518)
割込ハンドラ518は、第2セキュア処理プログラム502の実行中に割り込みが発生した場合に実行される。割込ハンドラ518は、図示していない暗号復号鍵を保持する。
(G) Area end processing program 528
The area end processing program 528 releases the storage area secured by the area initialization program 522, calls the end function of the first secure processing program 501, and ends the music data reproduction process.
(Interrupt handler 518)
The interrupt handler 518 is executed when an interrupt occurs during the execution of the second secure processing program 502. The interrupt handler 518 holds an encryption / decryption key (not shown).

図9に割込ハンドラ518の処理を示す。なお、割込ハンドラ518は、実際にはコンピュータプログラムであるが、図9では簡単のため、フローチャートを用いて説明する。
実行フラグ515を読み込む(ステップS611)。次に、読み込んだ実行フラグ515が「ON」を示すか「OFF」を示すかを判断し(ステップS612)、「ON」を示す場合(ステップS612でON)、暗号復号鍵を用い 、記憶領域内のデータに暗号化アルゴリズムE2を施して暗号化する(ステップS613)。その後、割り込み処理へ移る。また、読み込んだ実行フラグが「OFF」を示す場合(ステップS612でOFF)、記憶領域内のデータの暗号化は行わずに、割り込み処理へ移る。
FIG. 9 shows the processing of the interrupt handler 518. Note that the interrupt handler 518 is actually a computer program, but will be described with reference to a flowchart in FIG. 9 for simplicity.
The execution flag 515 is read (step S611). Next, it is determined whether the read execution flag 515 indicates “ON” or “OFF” (step S612). If it indicates “ON” (ON in step S612), the storage area is stored using the encryption / decryption key. The data is encrypted by applying the encryption algorithm E2 (step S613). Thereafter, the process proceeds to interrupt processing. If the read execution flag indicates “OFF” (OFF in step S612), the process proceeds to interrupt processing without encrypting the data in the storage area.

割り込み処理が終了すると、実行フラグが「ON」を示す場合(ステップS614でON)、暗号復号鍵を用い、記憶領域内のデータに復号アルゴリズムD2を施して復号し(ステップS615)、元の処理に戻る。実行フラグが「OFF」を示す場合(ステップS614でOFF)、復号処理は行わずに元の処理へ戻る。
(B)第1セキュア処理プログラム501
第1セキュア処理プログラム501は、図10に示すように、回路切断プログラム551、改竄検出プログラム552、鍵復号プログラム553、鍵送信プログラム554及び認証通信プログラム555、データ読出プログラム556及び回路接続プログラム557から構成され、CPU301のセキュア処理モードにて実行される。セキュア処理モードについては後述する。
When the interrupt processing is completed, if the execution flag indicates “ON” (ON in step S614), the data in the storage area is decrypted by applying the decryption algorithm D2 using the encryption / decryption key (step S615), and the original processing Return to. When the execution flag indicates “OFF” (OFF in step S614), the process returns to the original process without performing the decoding process.
(B) First secure processing program 501
As shown in FIG. 10, the first secure processing program 501 includes a circuit disconnection program 551, a falsification detection program 552, a key decryption program 553, a key transmission program 554, an authentication communication program 555, a data read program 556, and a circuit connection program 557. Configured and executed in the secure processing mode of the CPU 301. The secure processing mode will be described later.

(回路切断プログラム551)
第1セキュア処理プログラム501が起動されると、回路切断プログラム551は、デバッガ無効化回路303へ「無効」を示すデバッガ制御信号を出力する。
(改竄検出プログラム552)
改竄検出プログラム552は、秘密鍵562を含み、第2セキュア処理プログラム502の改竄検出を行う。改竄検出プログラム552は、第2セキュア処理プログラム502から改竄検出データを取得する。
(Circuit cutting program 551)
When the first secure processing program 501 is activated, the circuit disconnection program 551 outputs a debugger control signal indicating “invalid” to the debugger invalidation circuit 303.
(Falsification detection program 552)
The falsification detection program 552 includes a secret key 562 and detects falsification of the second secure processing program 502. The falsification detection program 552 acquires falsification detection data from the second secure processing program 502.

改竄検出プログラム552は、メモリ305の、取得したTRS領域先頭アドレスが示す位置から、バイナリサイズが示すサイズのデータを、ハッシュ値算出の対象となるTRS領域プログラムであるとして読み出す。読み出したTRS領域プログラムに、秘密鍵562を用いてハッシュ関数を施してハッシュ値を算出する。算出したハッシュ値と、取得した改竄検出値とを比較し、同一の場合、改竄されていないと判断する。同一でない場合、改竄されていると判断し、以降の処理を禁止する。   The falsification detection program 552 reads the data of the size indicated by the binary size from the position indicated by the acquired TRS area start address in the memory 305 as the TRS area program that is the target of hash value calculation. A hash function is calculated by applying a hash function to the read TRS area program using the secret key 562. The calculated hash value is compared with the acquired falsification detection value. If they are the same, it is determined that the falsification has not been made. If they are not the same, it is determined that they have been tampered with, and subsequent processing is prohibited.

(鍵復号プログラム553)
鍵復号プログラム553は、マスタ鍵563を含む。鍵復号プログラム553は、改竄検出プログラム552によって、第2セキュア処理プログラム502の改竄が検出されなかった場合、マスタ鍵563を用いて暗号化鍵544に復号アルゴリズムD1を施して復号し、プログラム鍵を生成する。生成したプログラム鍵を、鍵送信プログラム554へ送信する。
(Key decryption program 553)
The key decryption program 553 includes a master key 563. If the falsification detection program 552 does not detect falsification of the second secure processing program 502, the key decryption program 553 decrypts the encryption key 544 with the decryption algorithm D1 using the master key 563, and decrypts the program key. Generate. The generated program key is transmitted to the key transmission program 554.

(鍵送信プログラム554)
鍵送信プログラム554は、鍵復号プログラム553からプログラム鍵を受信し、第2セキュア処理プログラム502へ送信する。
(認証通信プログラム555)
認証通信プログラム555は、認証鍵565を含み、認証鍵565を用いて第2セキュア処理プログラム502と認証を行う。また、認証に成功した場合、セッション鍵を共有する。以降、第2セキュア処理プログラム502とデータの送受信を行う場合には、セッション鍵を用いて暗号通信を行う。
(Key transmission program 554)
The key transmission program 554 receives the program key from the key decryption program 553 and transmits it to the second secure processing program 502.
(Authentication communication program 555)
The authentication communication program 555 includes an authentication key 565, and authenticates with the second secure processing program 502 using the authentication key 565. If authentication is successful, the session key is shared. Thereafter, when transmitting / receiving data to / from the second secure processing program 502, encrypted communication is performed using the session key.

(データ読出プログラム556)
データ読出プログラム556は、メモリカード400との間でCPRMの方法に従って相互認証を行い、認証に成功した場合に、メモリカード400のセキュア領域420にアクセスしてタイトル鍵421を取得する。
(回路接続プログラム557)
回路接続プログラム557は、デバッガ無効化回路303へ「有効」を示すデバッガ制御信号を出力する。
(Data reading program 556)
The data reading program 556 performs mutual authentication with the memory card 400 according to the CPRM method, and when the authentication is successful, accesses the secure area 420 of the memory card 400 and acquires the title key 421.
(Circuit connection program 557)
The circuit connection program 557 outputs a debugger control signal indicating “valid” to the debugger invalidation circuit 303.

(C)ベクタテーブル503
ベクタテーブル503は、図11に示すように、ソフトウェア割り込み、例外、ハードウェア割り込み発生時の処理先が記述されている。
(D)音楽再生プログラム504
音楽再生プログラム504は、第2セキュア処理プログラム502によって復号された音楽データを再生処理を行うプログラムであり、再生する音楽データをバッファ311に送る。
(C) Vector table 503
As shown in FIG. 11, the vector table 503 describes processing destinations when software interrupts, exceptions, and hardware interrupts occur.
(D) Music playback program 504
The music reproduction program 504 is a program for performing reproduction processing on the music data decrypted by the second secure processing program 502, and sends the music data to be reproduced to the buffer 311.

(E)アプリケーション505
アプリケーション505は、ユーザの操作による入力を受け付ける。また、入力に従い、第2セキュア処理プログラム502を起動する。
(3)CPU301
CPU301は、メモリ305に記憶しているプログラムに従って動作する。また、デバッガインターフェース302を介して接続されるデバッガの指示によって動作を制御する。CPU301は、図12に示すように、メモリ305に記憶しているプログラムの命令をフェッチし(ステップS601)、読み出した命令を解釈し(ステップS602)、実行する(ステップS603)。また、プログラムカウンタのアドレスを進めて(ステップS604)、次の命令をフェッチし、処理を繰り返す。
(E) Application 505
The application 505 receives an input by a user operation. Further, the second secure processing program 502 is activated in accordance with the input.
(3) CPU301
The CPU 301 operates in accordance with a program stored in the memory 305. Further, the operation is controlled by an instruction of a debugger connected via the debugger interface 302. As shown in FIG. 12, the CPU 301 fetches an instruction of the program stored in the memory 305 (step S601), interprets the read instruction (step S602), and executes it (step S603). Further, the address of the program counter is advanced (step S604), the next instruction is fetched, and the process is repeated.

ここで、CPU301は、セキュア処理モード及び通常処理モードの何れかのモードで処理を行う。通常処理モードは、CPU301が通常処理を行っている状態を示し、セキュア処理モードは、高いセキュリティを持ち、メモリ内のデータを外部から観察できないように、高いセキュリティを保ちながら処理を行うモードである。
CPU301は、セキュア処理モードで第1セキュア処理プログラム501を実行し、通常モードで第2セキュア処理プログラム502を実行する。
Here, the CPU 301 performs processing in one of the secure processing mode and the normal processing mode. The normal processing mode indicates a state in which the CPU 301 is performing normal processing, and the secure processing mode is a mode in which processing is performed with high security so that the data in the memory cannot be observed from the outside with high security. .
The CPU 301 executes the first secure processing program 501 in the secure processing mode and executes the second secure processing program 502 in the normal mode.

また、CPU301は、割り込みコントローラ304から割込線318を介して割り込み信号を受け付ける。CPU301は、第2セキュア処理プログラム502の割込禁止プログラム512を実行している場合には、割り込みを受け付けない。割込禁止が解除された場合に割り込み信号を受け付けると、図11のベクタテーブルを参照し、受け付けた割り込み信号の処理に該当するアドレスを読み込む。読み込んだアドレスの割り込みハンドラに従って処理を行い、割り込み処理が終了すると、元の処理へ戻る。   In addition, the CPU 301 receives an interrupt signal from the interrupt controller 304 via the interrupt line 318. The CPU 301 does not accept an interrupt when the interrupt prohibition program 512 of the second secure processing program 502 is being executed. When the interrupt signal is accepted when the interrupt inhibition is released, the address corresponding to the processing of the accepted interrupt signal is read with reference to the vector table of FIG. Processing is performed according to the interrupt handler of the read address, and when the interrupt processing ends, the processing returns to the original processing.

第2セキュア処理プログラム502実行中に割り込み信号を受け付けると、CPU301は、ベクタテーブル503を参照し、図9に示す割込ハンドラ518を実行する。
(4)入力部307
入力部307は、ユーザによる外部からの入力を受け付ける。
入力部307は、外部からの入力を受け付けると、割込みコントローラ304へ割り込みの発生を通知する。
(5)割り込みコントローラ304
割り込みコントローラ304は、入力部307又は無線制御部314から、メール受信や着信、ユーザによる操作などの割り込みの発生を通知されると、割込線318により、CPU301へ割り込み信号を出力する。
(6)スピーカ309、デコーダ310
デコーダ310は、バッファ311を含み、バッファ311は、CPU301から受け取る音声データをバッファし、スピーカ309は、バッファ311に記憶されている音声データから音声信号を生成して出力する。
(7)メモリカードインターフェース306
メモリカードインターフェース306は、携帯端末300とメモリカード400とを接続するためのインターフェースであり、CPU301の制御の下、メモリカード400へデータを出力し、メモリカード400からデータを受け取ると、CPU301へ出力する。
(8)無線制御部314、無線部315、アンテナ316
アンテナ316、無線部315及び無線制御部314は、無線基地局及び携帯電話網を介して、接続された相手の装置との間で、音声又は情報の送受信を行う。
When receiving an interrupt signal during the execution of the second secure processing program 502, the CPU 301 refers to the vector table 503 and executes the interrupt handler 518 shown in FIG.
(4) Input unit 307
The input unit 307 receives an external input from the user.
When receiving an input from the outside, the input unit 307 notifies the interrupt controller 304 of the occurrence of an interrupt.
(5) Interrupt controller 304
The interrupt controller 304 outputs an interrupt signal to the CPU 301 through the interrupt line 318 when notified of the occurrence of an interrupt such as mail reception, incoming call, or user operation from the input unit 307 or the wireless control unit 314.
(6) Speaker 309 and decoder 310
The decoder 310 includes a buffer 311, the buffer 311 buffers audio data received from the CPU 301, and the speaker 309 generates and outputs an audio signal from the audio data stored in the buffer 311.
(7) Memory card interface 306
The memory card interface 306 is an interface for connecting the mobile terminal 300 and the memory card 400, and outputs data to the memory card 400 under the control of the CPU 301, and outputs data to the CPU 301 when data is received from the memory card 400. To do.
(8) Radio control unit 314, radio unit 315, antenna 316
The antenna 316, the radio unit 315, and the radio control unit 314 perform transmission / reception of voice or information with a connected partner device via a radio base station and a mobile phone network.

ここで、無線制御部314は、アンテナ316及び無線部315を介してメールを受信する場合、及び着信がある場合に、割込みコントローラ304へ割り込みを通知する。
(9)マイク312、変換部313
変換部313は、マイク312から受け取る音声を電気信号に変換し、無線制御部314へ出力する。
2. セキュア処理システムの動作
2.1 認証局装置100の動作
コンパイラ101は、呼出プログラムソースコード及び保護プログラムソースコードの入力を受け付けると、コンパイルして呼出プログラムバイナリデータ及び保護プログラムバイナリデータを生成し、生成したバイナリデータをデータ埋込部105へ出力する。また、復号プログラムソースコード及びセキュアプログラムソースコードの入力を受け付け、コンパイルして各プログラムのバイナリデータを生成し、生成したバイナリデータをプログラム暗号化部102へ出力する。
Here, the radio control unit 314 notifies the interrupt controller 304 of an interrupt when receiving a mail via the antenna 316 and the radio unit 315 and when there is an incoming call.
(9) Microphone 312 and conversion unit 313
The conversion unit 313 converts the sound received from the microphone 312 into an electrical signal and outputs it to the wireless control unit 314.
2. Operation of Secure Processing System 2.1 Operation of Certificate Authority Device 100 When the compiler 101 receives input of the calling program source code and the protection program source code, the compiler 101 generates and generates the calling program binary data and the protection program binary data. The binary data is output to the data embedding unit 105. Also, it receives input of the decryption program source code and secure program source code, compiles to generate binary data of each program, and outputs the generated binary data to the program encryption unit 102.

プログラム暗号化部102は、復号プログラム及びセキュアプログラムのバイナリデータを受け取り、プログラム鍵を受け取ると、プログラム鍵を用いてセキュアプログラムを暗号化し、暗号化プログラムを生成する。復号プログラム及び生成した暗号化プログラムをTRS領域プログラムとしてデータ埋込部105及びハッシュ値算出部104へ出力する。   When the program encryption unit 102 receives the decryption program and the binary data of the secure program and receives the program key, the program encryption unit 102 encrypts the secure program using the program key and generates an encrypted program. The decryption program and the generated encryption program are output to the data embedding unit 105 and the hash value calculation unit 104 as a TRS area program.

ハッシュ値算出部104は、TRS領域プログラムを受け取り、秘密鍵を受け取ると、ハッシュ関数を施して、TRS領域プログラムに対するハッシュ値を算出する。また、TRS領域プログラムバイナリデータのサイズを導出する。ハッシュ値算出部104は、ハッシュ値及びバイナリサイズをデータ埋込部105へ出力する。
鍵暗号化部103は、プログラム鍵及びマスタ鍵の入力を受け付けると、マスタ鍵を用いてプログラム鍵を暗号化し、暗号化鍵を生成する。生成した暗号化鍵をデータ埋込部105へ出力する。
When the hash value calculation unit 104 receives the TRS area program and receives the secret key, it applies a hash function to calculate a hash value for the TRS area program. Also, the size of the TRS area program binary data is derived. The hash value calculation unit 104 outputs the hash value and binary size to the data embedding unit 105.
When receiving the input of the program key and the master key, the key encryption unit 103 encrypts the program key using the master key and generates an encryption key. The generated encryption key is output to the data embedding unit 105.

データ埋込部105は、呼出プログラムバイナリデータを受け取り、ハッシュ値、バイナリサイズ及び暗号化鍵を受け取ると、ハッシュ値を改竄検出値として呼出プログラムに埋め込み、更にバイナリサイズ及び暗号化鍵を呼出プログラムバイナリデータに埋め込む。また、コンパイラから保護プログラムバイナリデータを受け取り、プログラム暗号化部102からTRS領域プログラムを受け取ると、呼出プログラムを含めた保護プログラムと、TRS領域プログラムとを合わせて第2セキュア処理プログラムを生成し記憶部106に書き込む。   When the data embedding unit 105 receives the calling program binary data and receives the hash value, binary size, and encryption key, the data embedding unit 105 embeds the hash value in the calling program as a falsification detection value, and further stores the binary size and encryption key in the calling program binary. Embed in data. When the protection program binary data is received from the compiler and the TRS area program is received from the program encryption unit 102, the second secure processing program is generated by combining the protection program including the calling program and the TRS area program, and the storage unit 106 is written.

送信部107は、記憶部106から第2セキュア処理プログラムを読み出してROMライター200へ出力する。
2.2 携帯端末300における音楽データ再生処理の動作
(1)携帯端末300がメモリカード400に記録されている音楽データを再生する際の動作について、図13〜図17を参照して説明する。
The transmission unit 107 reads the second secure processing program from the storage unit 106 and outputs it to the ROM writer 200.
2.2 Operation of Music Data Reproduction Process in Portable Terminal 300 (1) The operation when the portable terminal 300 reproduces music data recorded on the memory card 400 will be described with reference to FIGS.

ユーザの操作により携帯端末300の入力部307から、メモリカード400に記録されている音楽データを再生する旨の入力を受け付けると、アプリケーション505は、第2セキュア処理プログラム502を起動する(ステップS701)。
第2セキュア処理プログラム502は、領域確保プログラム511を実行することによって、TRS領域プログラムを実行中に動的にメモリ確保を行うための仮想メモリ空間の確保を行う(ステップS702)。また、割込禁止プログラム512を実行して割り込みを禁止し、割り込みを用いたプログラムの解析行為を無効とする(ステップS703)。以降、割込禁止を解除するまで割り込みをマスクする。次に、呼出プログラム513を実行し、改竄検出データを送信して第1セキュア処理プログラム501を呼び出す(ステップS704)。
When receiving an input to reproduce the music data recorded on the memory card 400 from the input unit 307 of the portable terminal 300 by the user's operation, the application 505 activates the second secure processing program 502 (step S701). .
The second secure processing program 502 secures a virtual memory space for dynamically securing the memory while executing the TRS area program by executing the area securing program 511 (step S702). Also, the interrupt prohibition program 512 is executed to prohibit interrupts and invalidate the program analysis action using the interrupts (step S703). After that, interrupts are masked until interrupt disable is released. Next, the calling program 513 is executed to transmit the falsification detection data and call the first secure processing program 501 (step S704).

第1セキュア処理プログラム501は、第2セキュア処理プログラム502から改竄検出データとして、改竄検出値、TRS領域先頭アドレス、バイナリサイズ及び暗号化鍵を受信する(ステップS705)。また、回路切断プログラム551を実行してデバッガ無効化回路303へ「無効」を示すデバッガ制御信号を出力する(ステップS706)。これにより、デバッガ無効化回路303はスイッチの接続を切り、デバッガによる解析を無効化する。   The first secure processing program 501 receives the falsification detection value, the TRS area head address, the binary size, and the encryption key as falsification detection data from the second secure processing program 502 (step S705). The circuit disconnection program 551 is executed to output a debugger control signal indicating “invalid” to the debugger invalidation circuit 303 (step S706). As a result, the debugger invalidation circuit 303 disconnects the switch and invalidates the analysis by the debugger.

また、以下のように改竄検出プログラム552を実行する。
改竄検出プログラム552は、ステップS705で受信したTRS領域先頭アドレスが示す位置から、バイナリサイズが示す範囲のデータをハッシュ値算出の対象データとして読み出す。また、秘密鍵を用いて、取り出した対象データに対するハッシュ値を算出する(ステップS709)。
Further, the falsification detection program 552 is executed as follows.
The falsification detection program 552 reads data in a range indicated by the binary size as target data for hash value calculation from the position indicated by the TRS area head address received in step S705. Also, a hash value for the extracted target data is calculated using the secret key (step S709).

算出したハッシュ値と、ステップS708で受信した改竄検出値とを比較し、一致するか否かを判断する(ステップS710)。一致しない場合(ステップS710でNO)、改竄されているものとして、以降の処理を抑制する。また、回路接続プログラム557を実行して、デバッガ無効化回路303へ、「有効」を示すデバッガ制御信号を出力し(ステップS737)、処理を終了する。   The calculated hash value is compared with the falsification detection value received in step S708, and it is determined whether or not they match (step S710). If they do not match (NO in step S710), the subsequent processing is suppressed as having been tampered with. Also, the circuit connection program 557 is executed to output a debugger control signal indicating “valid” to the debugger invalidation circuit 303 (step S737), and the process is terminated.

ステップS709で算出したハッシュ値と改竄検出値とが一致する場合(ステップS710YES)、改竄されていないものとして、以降の処理を継続する。第1セキュア処理プログラム501は、鍵復号プログラム553を実行する。鍵復号プログラム553は、マスタ鍵563を用いて、ステップS708で受信した暗号化鍵を復号し、プログラム鍵を生成する(ステップS711)。生成したプログラム鍵を鍵送信プログラム554へ送信する。鍵送信プログラム554は、受信したプログラム鍵を、第2セキュア処理プログラム502へ送信する(ステップS712)。   If the hash value calculated in step S709 matches the falsification detection value (YES in step S710), the subsequent processing is continued assuming that the falsification has not been made. The first secure processing program 501 executes the key decryption program 553. The key decryption program 553 decrypts the encryption key received in step S708 using the master key 563, and generates a program key (step S711). The generated program key is transmitted to the key transmission program 554. The key transmission program 554 transmits the received program key to the second secure processing program 502 (step S712).

第2セキュア処理プログラム502は、鍵受信プログラム514を実行することによって、プログラム鍵を受信する(ステップS713)。また、実行フラグを「ON」にする(ステップS714)。次に、復号プログラム516を実行する。復号プログラム516は、受信したプログラム鍵を用いて暗号化プログラム517を復号し、セキュアプログラムを生成する(ステップS715)。セキュアプログラムを生成すると、復号に用いたプログラム鍵を消去する(ステップS716)。   The second secure processing program 502 receives the program key by executing the key receiving program 514 (step S713). Further, the execution flag is set to “ON” (step S714). Next, the decryption program 516 is executed. The decryption program 516 decrypts the encryption program 517 using the received program key to generate a secure program (step S715). When the secure program is generated, the program key used for decryption is deleted (step S716).

第2セキュア処理プログラム502は、セキュアプログラムの実行を開始する(ステップS717)。
まず、割込禁止解除プログラム521を実行する。割込禁止解除プログラム521は、ステップS703で行った割込禁止を解除する(ステップS718)。以降、割り込みが発生した場合は、セキュアプログラムを中断して割り込み処理を実行することになる。割り込みが発生した場合の処理については後述する。
The second secure processing program 502 starts executing the secure program (step S717).
First, the interrupt prohibition release program 521 is executed. The interrupt prohibition cancellation program 521 cancels the interrupt prohibition performed in step S703 (step S718). Thereafter, when an interrupt occurs, the secure program is interrupted and interrupt processing is executed. Processing when an interrupt occurs will be described later.

次に、領域初期化プログラム522を実行して、メモリ空間に暗号化の対象となる記憶領域を確保する(ステップS719)。
第2セキュア処理プログラム502は、認証通信プログラム523を実行し、後述の処理を行って第1セキュア処理プログラム501を認証する(ステップS720)。また、第1セキュア処理プログラム501は、認証通信プログラム555を実行して認証を受ける。第2セキュア処理プログラム502は、認証に失敗した場合、以降の処理を抑制する。認証に失敗した場合、第1セキュア処理プログラム501は、デバッガ無効化回路303へ「有効」を示すデバッガ制御信号を出力して(ステップS737)処理を終了する。
Next, the area initialization program 522 is executed to secure a storage area to be encrypted in the memory space (step S719).
The second secure processing program 502 executes the authentication communication program 523 and performs the processing described below to authenticate the first secure processing program 501 (step S720). The first secure processing program 501 executes the authentication communication program 555 and receives authentication. If the authentication fails, the second secure processing program 502 suppresses subsequent processing. If the authentication fails, the first secure processing program 501 outputs a debugger control signal indicating “valid” to the debugger invalidation circuit 303 (step S737) and ends the process.

認証に成功した場合、第2セキュア処理プログラム502及び第1セキュア処理プログラム501は、セッション鍵を共有する。以降、第2セキュア処理プログラム502及び第1セキュア処理プログラム501の間で通信を行う場合には、共有したセッション鍵を用いて暗号通信を行う。
第2セキュア処理プログラム502は、認証に成功した場合に、音楽再生プログラムへ制御を移す。
If the authentication is successful, the second secure processing program 502 and the first secure processing program 501 share the session key. Thereafter, when communication is performed between the second secure processing program 502 and the first secure processing program 501, encrypted communication is performed using the shared session key.
The second secure processing program 502 transfers control to the music playback program when the authentication is successful.

音楽再生プログラム504は、メモリカード400から暗号化音楽データ411を読み出す(ステップS721)。また、音楽再生プログラム504は、暗号化音楽データ411の復号を第2セキュア処理プログラム502へ要求する(ステップS722)。
第2セキュア処理プログラム502は、暗号化音楽データ411の復号を要求されると、領域暗号化プログラム526を実行する。領域暗号化プログラム526は、ステップS719で確保した記憶領域内のデータを、領域鍵525を用いて暗号化する(ステップS723)。記憶領域が暗号化されると、第2セキュア処理プログラム502は、第1セキュア処理プログラム501に、タイトル鍵の取得を要求する(ステップS724)。
The music playback program 504 reads the encrypted music data 411 from the memory card 400 (step S721). In addition, the music playback program 504 requests the second secure processing program 502 to decrypt the encrypted music data 411 (step S722).
When requested to decrypt the encrypted music data 411, the second secure processing program 502 executes the area encryption program 526. The area encryption program 526 encrypts the data in the storage area secured in step S719 using the area key 525 (step S723). When the storage area is encrypted, the second secure processing program 502 requests the first secure processing program 501 to obtain a title key (step S724).

第1セキュア処理プログラム501は、データ読出プログラム556を実行する。データ読出プログラム556は、メモリカード400の認証部403と相互認証を行い(ステップS725)、認証に成功した場合に(ステップS726でYES)、メモリカード400の情報記憶部404にアクセスしてタイトル鍵を取得する。なお、認証に失敗した場合は、タイトル鍵を取得できず、第1セキュア処理プログラム501は、デバッガ無効化回路303へ「有効」を示すデバッガ制御信号を出力して(ステップS737)処理を終了する。   The first secure processing program 501 executes the data reading program 556. The data read program 556 performs mutual authentication with the authentication unit 403 of the memory card 400 (step S725). When the authentication is successful (YES in step S726), the data read program 556 accesses the information storage unit 404 of the memory card 400 to access the title key. To get. If the authentication fails, the title key cannot be acquired, and the first secure processing program 501 outputs a debugger control signal indicating “valid” to the debugger invalidation circuit 303 (step S737) and ends the process. .

第1セキュア処理プログラム501は、メモリカード400との相互認証に成功してタイトル鍵を取得すると(ステップS727)、ステップS720で共有したセッション鍵を用いてタイトル鍵を暗号化し、暗号化タイトル鍵を生成する(ステップS728)。生成した暗号化タイトル鍵を第2セキュア処理プログラム502へ送信する。
第2セキュア処理プログラム502は、領域復号プログラム527を実行する。領域復号プログラム527は、領域鍵525を用いて暗号化された記憶領域を復号し、元の状態に戻す(ステップS729)。また、認証通信プログラム523は、第1セキュア処理プログラム501から受信した暗号化タイトル鍵を、セッション鍵を用いて復号し、タイトル鍵を得る(ステップS730)。次に、第2セキュア処理プログラム502は、暗号化音楽データ復号プログラム524を実行する。暗号化音楽データ復号プログラム524は、タイトル鍵を用いて、音楽再生プログラムがメモリカード400から読み出した暗号化音楽データ411を復号し(ステップS731)、音楽データを生成する。生成した音楽データは、音楽再生プログラムへ送信する。
When the first secure processing program 501 succeeds in mutual authentication with the memory card 400 and acquires the title key (step S727), the first secure processing program 501 encrypts the title key using the session key shared in step S720, and uses the encrypted title key. Generate (step S728). The generated encrypted title key is transmitted to the second secure processing program 502.
The second secure processing program 502 executes the area decryption program 527. The area decryption program 527 decrypts the encrypted storage area using the area key 525 and returns it to the original state (step S729). Further, the authentication communication program 523 decrypts the encrypted title key received from the first secure processing program 501 using the session key, and obtains a title key (step S730). Next, the second secure processing program 502 executes the encrypted music data decryption program 524. Using the title key, the encrypted music data decryption program 524 decrypts the encrypted music data 411 read from the memory card 400 by the music playback program (step S731), and generates music data. The generated music data is transmitted to the music playback program.

音楽再生プログラムは、受信する音楽データを再生する(ステップS732)。
音楽データの再生が終了すると(ステップS733)、第2セキュア処理プログラム502に制御を移し、第2セキュア処理プログラム502は、領域終了処理プログラム528を実行する。領域終了処理プログラム528は、ステップS719で確保した記憶領域を開放し(ステップS734)、第1セキュア処理プログラム501の終了関数を呼び出す(ステップS735)。また、実行フラグを「OFF」にする(ステップS736)。
The music playback program plays back the received music data (step S732).
When the reproduction of the music data is finished (step S733), the control is transferred to the second secure processing program 502, and the second secure processing program 502 executes the region end processing program 528. The area end processing program 528 releases the storage area secured in step S719 (step S734) and calls the end function of the first secure processing program 501 (step S735). Further, the execution flag is set to “OFF” (step S736).

第1セキュア処理プログラム501は、回路接続プログラム557を実行し、デバッガ無効化回路303へ「有効」を示すデバッガ制御信号を出力し(ステップS737)、処理を終了する。
(2)認証
上述のステップS720で第2セキュア処理プログラム502が第1セキュア処理プログラム501を認証する際の処理について、図18を参照して説明する。
The first secure processing program 501 executes the circuit connection program 557, outputs a debugger control signal indicating “valid” to the debugger invalidation circuit 303 (step S737), and ends the processing.
(2) Authentication Processing when the second secure processing program 502 authenticates the first secure processing program 501 in step S720 described above will be described with reference to FIG.

第2セキュア処理プログラム502は、乱数R0を生成し、第1セキュア処理プログラム501へ送信する(ステップS751)。
第1セキュア処理プログラム501は、乱数R0を受信し、認証鍵565を用いて受信した乱数R0を暗号化し、認証値R1を生成する(ステップS752)。生成した認証値R1を第2セキュア処理プログラム502へ送信する(ステップS753)。
The second secure processing program 502 generates a random number R0 and transmits it to the first secure processing program 501 (step S751).
The first secure processing program 501 receives the random number R0, encrypts the received random number R0 using the authentication key 565, and generates an authentication value R1 (step S752). The generated authentication value R1 is transmitted to the second secure processing program 502 (step S753).

第2セキュア処理プログラム502は、第1セキュア処理プログラム501から認証値R1を受信する。また、認証鍵531を用いて生成した乱数R0を暗号化し、認証値R2を生成する(ステップS754)。第2セキュア処理プログラム502は、受信した認証値R1と、生成した認証値R2とを比較し(ステップS755)、一致しない場合(ステップS755でNO)、第1セキュア処理プログラム501へ「異なる」を示す判断結果を送信し、処理を終了する。また、ステップS755での比較結果が一致する場合(ステップS755でYES)、第1セキュア処理プログラム501へ「同じ」を示す判断結果を送信する。また、生成した乱数R0と認証鍵531とから、一方向性関数を用いてセッション鍵を生成する(ステップS759)。   The second secure processing program 502 receives the authentication value R1 from the first secure processing program 501. Also, the random number R0 generated using the authentication key 531 is encrypted to generate an authentication value R2 (step S754). The second secure processing program 502 compares the received authentication value R1 and the generated authentication value R2 (step S755), and if they do not match (NO in step S755), “different” is indicated to the first secure processing program 501. The determination result shown is transmitted, and the process ends. If the comparison results in step S755 match (YES in step S755), a determination result indicating “same” is transmitted to the first secure processing program 501. Further, a session key is generated from the generated random number R0 and the authentication key 531 using a one-way function (step S759).

第1セキュア処理プログラム501は、受信する判断結果が「異なる」を示す場合(ステップS758で異)、処理を終了する。また、受信する判断結果が「同じ」を示す場合(ステップS758で同)、乱数R0と認証鍵565とから、一方向性関数を用いてセッション鍵を生成する(ステップS760)。
このようにして、第2セキュア処理プログラム502は第1セキュア処理プログラム501を認証し、認証に成功した場合にはセッション鍵を共有する。以降、第2セキュア処理プログラム502と第1セキュア処理プログラム501との間でデータの送受信を行う場合は、このセッション鍵を用いて暗号化して通信する。
(3)割り込み
割り込みがあった場合のCPU301の動作について、図19を参照して説明する。なお、ここではメールを受信した場合を一例として説明する。
If the received determination result indicates “different” (difference in step S758), the first secure processing program 501 ends the process. If the received determination result indicates “same” (same in step S758), a session key is generated from the random number R0 and the authentication key 565 using a one-way function (step S760).
In this way, the second secure processing program 502 authenticates the first secure processing program 501 and shares the session key if the authentication is successful. Thereafter, when data is transmitted and received between the second secure processing program 502 and the first secure processing program 501, the communication is performed by encrypting using the session key.
(3) Interrupt The operation of the CPU 301 when there is an interrupt will be described with reference to FIG. Here, a case where mail is received will be described as an example.

CPU301は、割込みコントローラ304から割込信号を受け取ると(ステップS771)、ベクタテーブルを読み込む(ステップS772)。また、ベクタテーブルに従って、割り込みハンドラを実行する(ステップS773)。
まず、実行フラグを読み込み(ステップS774)、「ON」であるか「OFF」であるかを判断する(ステップS775)。「ON」の場合(ステップS775でON)、領域鍵525を用いて記憶領域内のデータを暗号化する(ステップS776)。また、コンテキストを退避し(ステップS777)、メール受信の処理を行う(ステップS778)。実行フラグが「OFF」である場合は(ステップS775でOFF)、記憶領域内の暗号化を行わずに、ステップS777、778の処理を行う。
When receiving an interrupt signal from the interrupt controller 304 (step S771), the CPU 301 reads the vector table (step S772). Further, the interrupt handler is executed according to the vector table (step S773).
First, an execution flag is read (step S774), and it is determined whether it is “ON” or “OFF” (step S775). If “ON” (ON in step S775), the data in the storage area is encrypted using the area key 525 (step S776). Further, the context is saved (step S777), and mail reception processing is performed (step S778). If the execution flag is “OFF” (OFF in step S775), the processes in steps S777 and 778 are performed without performing encryption in the storage area.

メール受信処理が終了すると、実行フラグが「ON」の場合は(ステップS779でON)、記憶領域内のデータを復号し(ステップS780)、元の処理に戻る。実行フラグが「OFF」の場合は(ステップS779でOFF)、復号処理を行わずに元の処理へ戻る。
3.その他の変形例
なお、本発明を上記の実施の形態に基づいて説明してきたが、本発明は、上記の実施の形態に限定されないのはもちろんである。以下のような場合も本発明に含まれる。
(1)本実施の形態では、携帯端末で実行される暗号化音楽データ復号プログラムを保護する場合を一例として説明したが、本発明がこれに限定されないのは勿論である。
When the mail reception process ends, if the execution flag is “ON” (ON in step S779), the data in the storage area is decrypted (step S780), and the process returns to the original process. If the execution flag is “OFF” (OFF in step S779), the process returns to the original process without performing the decoding process.
3. Other Modifications Although the present invention has been described based on the above-described embodiment, it is needless to say that the present invention is not limited to the above-described embodiment. The following cases are also included in the present invention.
(1) In the present embodiment, the case where the encrypted music data decryption program executed on the portable terminal is protected has been described as an example, but the present invention is not limited to this.

保護対象となるプログラムを実行する装置は、DVDプレーヤ、DVDレコーダ、PC、PDAなどであっても良い。
また、保護対象となるプログラムは、携帯端末で映像コンテンツやゲームなどを実行する際に利用する復号プログラムであっても良いし、DVDレコーダでコンテンツを記録する際に利用する記録プログラムであっても良く、不正な解析、改竄を防止したいプログラムであれば良い。
(2)本実施の形態では、改竄検出値としてハッシュ値を用いるとしたが、改竄検出値は、TRS領域プログラムに対して一意に定まる値であれば良く、TRS領域プログラムに対するディジタル署名であっても良いし、TRS領域プログラムを暗号化して生成される暗号化データを改竄検出値として用いるとしても良い。また、ハッシュ値の算出は他のアルゴリズムを利用するとしても良い。
A device that executes a program to be protected may be a DVD player, a DVD recorder, a PC, a PDA, or the like.
Further, the program to be protected may be a decryption program used when executing video content or a game on a portable terminal, or may be a recording program used when recording content with a DVD recorder. Any program that wants to prevent unauthorized analysis and tampering can be used.
(2) Although the hash value is used as the falsification detection value in this embodiment, the falsification detection value may be a value uniquely determined for the TRS area program, and is a digital signature for the TRS area program. Alternatively, encrypted data generated by encrypting the TRS area program may be used as the falsification detection value. The hash value may be calculated using another algorithm.

また、改竄検出値はTRS領域プログラムに対して生成されるとしたが、TRS領域プログラムの少なくとも一部に対して生成されるとしても良く、また、第2セキュア処理プログラムの少なくとも一部に対して生成されるとしても良い。
また、第2セキュア処理プログラム又はTRS領域プログラムの一部若しくは全部を対象としたマッチングや、擬似乱数の埋め込みによる改竄の検出などでも良く、実行するプログラムが生成時と同一であるか否かを検出可能な方法であれば、他の改竄検出方法を用いても良い。
Further, although the falsification detection value is generated for the TRS area program, it may be generated for at least a part of the TRS area program, or for at least a part of the second secure processing program. It may be generated.
It is also possible to perform matching for a part or all of the second secure processing program or TRS area program, or to detect falsification by embedding pseudo-random numbers, and detect whether the program to be executed is the same as when it was generated. If possible, other tamper detection methods may be used.

また、本実施の形態では、改竄検出を、デバッガ無効化回路の切断後に行っているが、デバッガ無効化回路の切断前に改竄検出を行い、改竄が検出されなかった場合にデバッガ無効化回路を切断し、以降の処理を行うとしても良い。
(3)改竄検出データは、第2セキュア処理プログラムの呼出プログラムが第1セキュア処理プログラム501に送信するとしたが、第2セキュア処理プログラムとは別のプログラムが送信するとしても良い。この場合、呼出プログラムは、第1セキュア処理プログラム501の呼び出しのみを行い、改竄検出データの送信処理を行う送信プログラムがメモリ305に記憶されており、第1セキュア処理プログラム501は、第2セキュア処理プログラムに呼び出されて起動すると、送信プログラムに改竄検出データの送信を要求する。送信プログラムは、要求に応じて改竄検出データを送信する。
In this embodiment, the falsification detection is performed after the debugger invalidation circuit is disconnected. However, the falsification detection is performed before the debugger invalidation circuit is disconnected, and if no falsification is detected, the debugger invalidation circuit is set. It is good also as cutting and performing a subsequent process.
(3) The falsification detection data is transmitted by the calling program of the second secure processing program to the first secure processing program 501, but may be transmitted by a program different from the second secure processing program. In this case, the calling program only calls the first secure processing program 501, and the transmission program for transmitting the falsification detection data is stored in the memory 305. The first secure processing program 501 is the second secure processing program 501. When called by the program and activated, it requests the transmission program to transmit falsification detection data. The transmission program transmits the falsification detection data in response to the request.

この場合、認証局装置100は、送信プログラムを保護プログラムに含めず、第2セキュア処理プログラムとは別のプログラムとして生成する。
また、第1セキュア処理プログラム501が第2セキュア処理プログラムの改竄検出データを予め保持しているとしても良い。
(4)本実施の形態では、第2セキュア処理プログラムが第1セキュア処理プログラム501の認証を行う片方向認証としたが、双方向に認証を行うとしても良い。また、チャレンジ・レスポンス型の認証を行うとしたが、これに限定されず、通信相手の正当性を認証可能であれば他の認証方法を利用するとしても良い。
In this case, the certificate authority device 100 does not include the transmission program in the protection program and generates it as a program different from the second secure processing program.
Further, the first secure processing program 501 may hold the alteration detection data of the second secure processing program in advance.
(4) In this embodiment, the second secure processing program uses the one-way authentication for authenticating the first secure processing program 501, but the authentication may be performed in both directions. Further, although challenge-response type authentication is performed, the present invention is not limited to this, and other authentication methods may be used as long as the authenticity of the communication partner can be authenticated.

また、認証値R1及びR2は、乱数R0を認証鍵を用いて暗号化して生成するとしたが、乱数R0に一方向性関数を施して生成するとしても良い。
また、乱数R0と認証鍵とから、一方向性関数を用いてセッション鍵を生成するとしたが、暗号化方式を用いて生成するとしても良い。
(5)領域暗号化プログラム526は、第2セキュア処理プログラムから第1セキュア処理プログラム501を呼び出す場合に、記憶領域を暗号化するとしたが、第2セキュア処理プログラムから外部関数を呼び出す場合など、第2セキュア処理プログラム以外のプログラムに制御が移る場合に、記憶領域を暗号化して、記憶領域内のデータを保護する。
The authentication values R1 and R2 are generated by encrypting the random number R0 using the authentication key, but may be generated by applying a one-way function to the random number R0.
In addition, the session key is generated from the random number R0 and the authentication key using a one-way function, but may be generated using an encryption method.
(5) The area encryption program 526 encrypts the storage area when calling the first secure processing program 501 from the second secure processing program. However, when calling the external function from the second secure processing program, 2. When control is transferred to a program other than the secure processing program, the storage area is encrypted to protect the data in the storage area.

また、領域復号プログラム527は、他のプログラムから第2セキュア処理プログラムに制御が戻った場合に、記憶領域内のデータを復号して、元のデータに戻す。
(6)マスタ鍵は、保護対象となるプログラムを実行する装置毎に固有であるとしても良い。この場合、不正なユーザにマスタ鍵を奪われたとしても、鍵を奪われた装置以外は、他の鍵を用いて暗号化されている為、不正なマスタ鍵を用いても他の装置は正常に動作しない。よって、不正に行為による被害を少なくすることが出来る。
(7)認証鍵は、第1セキュア処理プログラム501及び第2セキュア処理プログラムが保持する構成としたが、プログラム鍵や改竄検出値に基づいて算出されるものであっても良い。
Further, when the control returns from the other program to the second secure processing program, the area decryption program 527 decrypts the data in the storage area and restores the original data.
(6) The master key may be unique for each device that executes a program to be protected. In this case, even if the master key is stolen by an unauthorized user, the device other than the device whose key was stolen is encrypted using another key. It does not work properly. Therefore, damage caused by illegal acts can be reduced.
(7) The authentication key is configured to be held by the first secure processing program 501 and the second secure processing program, but may be calculated based on the program key or the falsification detection value.

また、認証局装置100はマスタ鍵を用いて認証鍵を暗号化するとしても良い。この場合、暗号化プログラムを復号するプログラム鍵は、認証鍵に基づいて算出される。
このように、認証に利用する鍵と暗号化プログラムの復号に用いる鍵とが依存関係にあれば、何れの鍵を暗号化するとしても良い。また、暗号化された鍵を更に他の鍵を用いて暗号化するなど、更に多くの鍵を用いて暗号化の階層を深くしても良い。
(8)本発明は、上記に示す方法であるとしてもよい。また、これらの方法をコンピュータにより実現するコンピュータプログラムであるとしてもよいし、前記コンピュータプログラムからなるデジタル信号であるとしてもよい。
Further, the certificate authority device 100 may encrypt the authentication key using the master key. In this case, the program key for decrypting the encrypted program is calculated based on the authentication key.
As described above, any key may be encrypted as long as the key used for authentication and the key used for decryption of the encryption program have a dependency. Further, the encryption hierarchy may be deepened using more keys, such as encrypting the encrypted key with another key.
(8) The present invention may be the method described above. Further, the present invention may be a computer program that realizes these methods by a computer, or may be a digital signal composed of the computer program.

また、本発明は、前記コンピュータプログラム又は前記デジタル信号をコンピュータ読み取り可能な記録媒体、例えば、フレキシブルディスク、ハードディスク、CD−ROM、MO、DVD、DVD−ROM、DVD−RAM、BD(Blu−ray Disc)、半導体メモリなど、に記録したものとしてもよい。また、これらの記録媒体に記録されている前記コンピュータプログラム又は前記デジタル信号であるとしてもよい。   The present invention also provides a computer-readable recording medium such as a flexible disk, hard disk, CD-ROM, MO, DVD, DVD-ROM, DVD-RAM, BD (Blu-ray Disc). ), Recorded in a semiconductor memory or the like. Further, the present invention may be the computer program or the digital signal recorded on these recording media.

また、本発明は、前記コンピュータプログラム又は前記デジタル信号を、電気通信回線、無線又は有線通信回線、インターネットを代表とするネットワーク等を経由して伝送するものとしてもよい。
また、本発明は、マイクロプロセッサとメモリとを備えたコンピュータシステムであって、前記メモリは、上記コンピュータプログラムを記憶しており、前記マイクロプロセッサは、前記コンピュータプログラムに従って動作するとしてもよい。
In the present invention, the computer program or the digital signal may be transmitted via an electric communication line, a wireless or wired communication line, a network represented by the Internet, or the like.
The present invention may be a computer system including a microprocessor and a memory, wherein the memory stores the computer program, and the microprocessor operates according to the computer program.

また、前記プログラム又は前記デジタル信号を前記記録媒体に記録して移送することにより、又は前記プログラム又は前記デジタル信号を前記ネットワーク等を経由して移送することにより、独立した他のコンピュータシステムにより実施するとしてもよい。
(9)上記実施の形態及び上記変形例をそれぞれ組み合わせるとしてもよい。
In addition, the program or the digital signal is recorded on the recording medium and transferred, or the program or the digital signal is transferred via the network or the like, and is executed by another independent computer system. It is good.
(9) The above embodiment and the above modifications may be combined.

映画や音楽などの著作物がデジタル化されたコンテンツやコンピュータプログラムなどのソフトウェアを提供するソフトウェア産業において、本発明は、経営的に、また反復的、継続的に使用することが出来る。また、本発明のプログラム実行装置は、電器製品等の製造産業において、生産し、販売することが出来る。   In the software industry that provides software such as contents and computer programs in which works such as movies and music are digitized, the present invention can be used managemently, repetitively, and continuously. In addition, the program execution device of the present invention can be produced and sold in the manufacturing industry of electrical appliances and the like.

セキュア処理システム1の全体の構成を示す。1 shows the overall configuration of a secure processing system 1. 認証局装置100の構成を示すブロック図である。2 is a block diagram showing a configuration of a certificate authority device 100. FIG. コンパイラの処理内容を示すフローチャートである。It is a flowchart which shows the processing content of a compiler. メモリカード400の構成を示すブロック図である。3 is a block diagram showing a configuration of a memory card 400. FIG. 携帯端末300の構成を示すブロック図である。2 is a block diagram showing a configuration of a mobile terminal 300. FIG. メモリ305に記録されているプログラムを示す。A program recorded in the memory 305 is shown. 第2セキュア処理プログラムのデータ構成を示す。The data structure of a 2nd secure processing program is shown. 呼出プログラムのデータ構成を示す。The data structure of a calling program is shown. 割込ハンドラの処理内容を示すフローチャートである。It is a flowchart which shows the processing content of an interrupt handler. 第1セキュア処理プログラム501のデータ構成を示す。The data structure of the 1st secure processing program 501 is shown. ベクタテーブルの構成を示す。The structure of a vector table is shown. CPU301の動作を示す。The operation of the CPU 301 is shown. 音楽データ再生処理を示すフローチャートである。図14に続く。It is a flowchart which shows a music data reproduction process. Continuing with FIG. 音楽データ再生処理を示すフローチャートである。図15に続く。It is a flowchart which shows a music data reproduction process. Continuing with FIG. 音楽データ再生処理を示すフローチャートである。図16に続く。It is a flowchart which shows a music data reproduction process. Continuing with FIG. 音楽データ再生処理を示すフローチャートである。図17に続く。It is a flowchart which shows a music data reproduction process. Continuing with FIG. 音楽データ再生処理を示すフローチャートである。It is a flowchart which shows a music data reproduction process. 認証処理を示すフローチャートである。It is a flowchart which shows an authentication process. 割り込み発生時のCPU301の動作を示すフローチャートである。It is a flowchart which shows operation | movement of CPU301 at the time of interruption generation | occurrence | production.

符号の説明Explanation of symbols

1 セキュア処理システム
100 認証局装置
101 コンパイラ
102 プログラム暗号化部
103 鍵暗号化部
104 ハッシュ値算出部
105 データ埋込部
200 ROMライター
300 携帯端末
303 デバッガ無効化回路
304 割込コントローラ
305 メモリ
306 メモリカードインターフェース
317 バス
318 割込線
400 メモリカード
421 タイトル鍵
501 セキュア処理プログラム
502 セキュア処理プログラム
DESCRIPTION OF SYMBOLS 1 Secure processing system 100 Certificate authority apparatus 101 Compiler 102 Program encryption part 103 Key encryption part 104 Hash value calculation part 105 Data embedding part 200 ROM writer 300 Portable terminal 303 Debugger invalidation circuit 304 Interrupt controller 305 Memory 306 Memory card Interface 317 Bus 318 Interrupt line 400 Memory card 421 Title key 501 Secure processing program 502 Secure processing program

Claims (11)

プログラム実行装置であって、
第1及び第2コンピュータプログラムに従って動作する,また、外部装置からの指示に従って前記動作を制御する処理手段と、
前記処理手段が前記第1コンピュータプログラムに従って動作する場合に、前記外部装置から前記処理手段を切り離す第1保護手段と、
前記処理手段が前記第2コンピュータプログラムに従って動作する場合に、前記第1コンピュータプログラムを保護する第2保護手段と
を備えることを特徴とするプログラム実行装置。
A program execution device,
Processing means that operates in accordance with the first and second computer programs, and that controls the operation in accordance with instructions from an external device;
First protection means for disconnecting the processing means from the external device when the processing means operates in accordance with the first computer program;
And a second protection means for protecting the first computer program when the processing means operates in accordance with the second computer program.
前記第2保護手段は、
前記処理手段が前記第1コンピュータプログラムに従って動作している場合に、前記処理手段がデータを書き込む記憶領域を含み、
前記処理手段が、前記第1コンピュータプログラムから第2コンピュータプログラムに切り替える直前に、前記記憶領域に書き込まれているデータを暗号化し、前記第2コンピュータプログラムから第1コンピュータプログラムに切り替えると、前記暗号化したデータを復号する
ことを特徴とする請求項1記載のプログラム実行装置。
The second protection means includes
When the processing means is operating according to the first computer program, the processing means includes a storage area for writing data,
When the processing means encrypts data written in the storage area immediately before switching from the first computer program to the second computer program and switches from the second computer program to the first computer program, the encryption The program execution device according to claim 1, wherein the data is decrypted.
前記第1コンピュータプログラムは、更に、前記第2コンピュータプログラムを呼び出す呼出命令を含み、
前記第2保護手段は、前記処理手段が前記呼出命令を実行して前記第2コンピュータプログラムに切り替える直前に、前記記憶領域に書き込まれているデータを暗号化する
ことを特徴とする請求項2記載のプログラム実行装置。
The first computer program further includes a call instruction for calling the second computer program,
The second protection unit encrypts data written in the storage area immediately before the processing unit executes the call instruction and switches to the second computer program. Program execution device.
前記プログラム実行装置は、更に、
割り込みの発生を検出する割込検出手段を備え、
前記第2コンピュータプログラムは、割り込みが発生した場合に行う処理を示し、
前記第2保護手段は、前記処理手段が前記第1コンピュータプログラム実行中に前記割込検出手段が割り込みを検出すると、前記記憶領域に書き込まれているデータを暗号化し、暗号化後に、前記処理手段が前記第2コンピュータプログラムに従って動作することを許可する
ことを特徴とする請求項2記載のプログラム実行装置。
The program execution device further includes:
An interrupt detection means for detecting the occurrence of an interrupt is provided,
The second computer program indicates processing to be performed when an interrupt occurs,
The second protection means encrypts data written in the storage area when the interrupt detection means detects an interrupt while the processing means is executing the first computer program, and after the encryption, the processing means 3. The program execution device according to claim 2, wherein the program execution device is permitted to operate according to the second computer program.
前記プログラム実行装置は、更に、
割り込みの発生を検出する割込検出手段を備え、
前記第1コンピュータプログラムを暗号化して生成される暗号化プログラムを記憶する記憶手段を備え、
前記第2コンピュータプログラムは、割り込みが発生した場合に行う処理を示し、
前記第2保護手段は、
前記処理手段が前記第2コンピュータプログラムに従って動作することを禁止し、
プログラム復号鍵を取得し、取得したプログラム復号鍵を用いて前記暗号化プログラムを復号して前記第1コンピュータプログラムを生成し、前記プログラム復号鍵を消去し、
前記プログラム復号鍵を消去した後に、前記処理手段が前記第2コンピュータプログラムに従って動作することを許可する
ことを特徴とする請求項1記載のプログラム実行装置。
The program execution device further includes:
An interrupt detection means for detecting the occurrence of an interrupt is provided,
Storage means for storing an encrypted program generated by encrypting the first computer program;
The second computer program indicates processing to be performed when an interrupt occurs,
The second protection means includes
Prohibiting the processing means from operating in accordance with the second computer program;
Obtaining a program decryption key, decrypting the encrypted program using the obtained program decryption key to generate the first computer program, erasing the program decryption key,
The program execution device according to claim 1, wherein after the program decryption key is erased, the processing means is allowed to operate according to the second computer program.
前記第2保護手段は、前記第1コンピュータプログラムを含む処理プログラムが生成されたときに少なくとも一部に基づいて生成される第1改竄検出値を取得し、
前記処理手段が前記第1コンピュータプログラムを実行する前に、前記処理プログラムの少なくとも一部に基づいて第2改竄検出値を生成し、
前記第1改竄検出値と前記第2改竄検出値とが異なる場合、前記処理手段が前記第1コンピュータプログラムに従って動作することを抑制する
ことを特徴とする請求項1のプログラム実行装置。
The second protection means acquires a first tampering detection value generated based on at least a part when a processing program including the first computer program is generated,
Before the processing means executes the first computer program, a second falsification detection value is generated based on at least a part of the processing program,
2. The program execution device according to claim 1, wherein when the first falsification detection value and the second falsification detection value are different, the processing unit is prevented from operating according to the first computer program.
前記処理プログラムは、前記第1改竄検出値を含み、
前記第2保護手段は、前記処理プログラムから、前記第1改竄検出値を取得する
ことを特徴とする請求項6記載のプログラム実行装置。
The processing program includes the first falsification detection value,
The program execution device according to claim 6, wherein the second protection means acquires the first falsification detection value from the processing program.
保護対象プログラムを含む処理プログラムの少なくとも一部に基づいて改竄検出値を生成する改竄検出値生成手段と、
前記処理プログラムに、前記生成した改竄検出値を埋め込む埋込手段と
を備えることを特徴とする認証局装置。
Falsification detection value generation means for generating a falsification detection value based on at least a part of the processing program including the protection target program;
A certificate authority apparatus comprising: an embedding unit that embeds the generated falsification detection value in the processing program.
前記認証局装置は、更に、
前記第1コンピュータプログラムを暗号化した暗号化プログラムの復号に用いられるプログラム復号鍵を、前記保護対象プログラムの実行を許可されたプログラム実行装置が保持するデバイス鍵に基づいて暗号化して暗号化鍵を生成する鍵暗号化手段を備え、
前記埋込手段は、更に、前記暗号化鍵を前記処理プログラムに埋め込む
ことを特徴とする請求項8記載の認証局装置。
The certificate authority device further includes:
An encryption key is obtained by encrypting a program decryption key used for decrypting an encrypted program obtained by encrypting the first computer program based on a device key held by a program execution device permitted to execute the protection target program. A key encryption means for generating,
The certificate authority apparatus according to claim 8, wherein the embedding unit further embeds the encryption key in the processing program.
プログラム実行装置で用いられるプログラムであって、
前記プログラム実行装置は、保護対象プログラムの実行中に利用する記憶領域を備え、
前記プログラムは、
前記保護対象プログラムの実行中に、当該保護対象プログラムから他のプログラムに切り替える直前に、前記記憶領域内のデータを暗号化する暗号化ステップと、
前記他のプログラムから前記保護対象プログラムに切り替わると前記記憶領域内のデータを復号する復号ステップと
を含むことを特徴とするプログラム。
A program used in a program execution device,
The program execution device includes a storage area used during execution of the protection target program,
The program is
An encryption step for encrypting data in the storage area immediately before switching from the protection target program to another program during execution of the protection target program;
And a decryption step of decrypting data in the storage area when the protection program is switched from the other program.
前記プログラム実行装置は、前記保護対象プログラムを含むセキュアプログラムを暗号化した暗号化プログラムを保持し、
前記プログラムは、更に、
他のプログラムの実行を禁止する禁止ステップと、
禁止された後に、前記暗号化プログラムの復号に利用するプログラム復号鍵を取得する取得ステップと、
前記プログラム復号鍵を用いて、前記暗号化プログラムを復号して前記セキュアプログラムを生成するプログラム復号ステップと、
前記プログラム復号鍵を消去する消去ステップと、
前記プログラム復号鍵が消去された後に、前記他のプログラムの実行を許可する許可ステップとを含む
ことを特徴とする請求項10記載のプログラム。
The program execution device holds an encrypted program obtained by encrypting a secure program including the protection target program,
The program further includes:
A prohibition step that prohibits execution of other programs;
Obtaining a program decryption key used for decrypting the encrypted program after being prohibited; and
A program decrypting step of decrypting the encrypted program and generating the secure program using the program decryption key;
An erasing step of erasing the program decryption key;
The program according to claim 10, further comprising: a permission step for permitting execution of the other program after the program decryption key is erased.
JP2004246984A 2003-08-26 2004-08-26 Program execution device, certificate authority device Active JP4691337B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004246984A JP4691337B2 (en) 2003-08-26 2004-08-26 Program execution device, certificate authority device

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2003301554 2003-08-26
JP2003301554 2003-08-26
JP2004246984A JP4691337B2 (en) 2003-08-26 2004-08-26 Program execution device, certificate authority device

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2009025043A Division JP4892018B2 (en) 2003-08-26 2009-02-05 Information processing apparatus, secure processing method, computer program, and recording medium.

Publications (3)

Publication Number Publication Date
JP2005100378A true JP2005100378A (en) 2005-04-14
JP2005100378A5 JP2005100378A5 (en) 2007-09-13
JP4691337B2 JP4691337B2 (en) 2011-06-01

Family

ID=34467168

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004246984A Active JP4691337B2 (en) 2003-08-26 2004-08-26 Program execution device, certificate authority device

Country Status (1)

Country Link
JP (1) JP4691337B2 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007133104A (en) * 2005-11-09 2007-05-31 Sony Corp Digital broadcasting receiving system and digital broadcasting receiver
JP2008033457A (en) * 2006-07-26 2008-02-14 Internatl Business Mach Corp <Ibm> Method and central processing unit for processing encrypted software
JP2009525556A (en) * 2006-04-07 2009-07-09 インテル・コーポレーション Method and apparatus for matching an external code image to a private key on a chip
JP2010182296A (en) * 2009-01-08 2010-08-19 Panasonic Corp Program execution apparatus, control method, control program and integrated circuit
JP2012186553A (en) * 2011-03-03 2012-09-27 Toshiba Corp Communication device and communication method
US8286001B2 (en) 2005-07-27 2012-10-09 International Business Machines Corporation Method and central processing unit for processing encrypted software

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002202720A (en) * 2000-12-28 2002-07-19 Toshiba Corp Method for sharing enciphered data area among processes in a tamper-resistant processor
JP2002526822A (en) * 1998-09-25 2002-08-20 ヒューズ・エレクトロニクス・コーポレーション Apparatus for providing a security processing environment
JP2002358137A (en) * 2001-05-15 2002-12-13 Internatl Business Mach Corp <Ibm> Method for setting security computer environment and computer system
JP2003223235A (en) * 2001-11-26 2003-08-08 Matsushita Electric Ind Co Ltd Application authentication system
JP2003233795A (en) * 1999-04-27 2003-08-22 Matsushita Electric Ind Co Ltd Semiconductor memory card and reading device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002526822A (en) * 1998-09-25 2002-08-20 ヒューズ・エレクトロニクス・コーポレーション Apparatus for providing a security processing environment
JP2003233795A (en) * 1999-04-27 2003-08-22 Matsushita Electric Ind Co Ltd Semiconductor memory card and reading device
JP2002202720A (en) * 2000-12-28 2002-07-19 Toshiba Corp Method for sharing enciphered data area among processes in a tamper-resistant processor
JP2002358137A (en) * 2001-05-15 2002-12-13 Internatl Business Mach Corp <Ibm> Method for setting security computer environment and computer system
JP2003223235A (en) * 2001-11-26 2003-08-08 Matsushita Electric Ind Co Ltd Application authentication system

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8286001B2 (en) 2005-07-27 2012-10-09 International Business Machines Corporation Method and central processing unit for processing encrypted software
JP2007133104A (en) * 2005-11-09 2007-05-31 Sony Corp Digital broadcasting receiving system and digital broadcasting receiver
US7869594B2 (en) 2005-11-09 2011-01-11 Sony Corporation Digital broadcasting receiving system and digital broadcasting receiving device
JP4631658B2 (en) * 2005-11-09 2011-02-16 ソニー株式会社 Digital broadcast receiving system and digital broadcast receiving apparatus
JP2009525556A (en) * 2006-04-07 2009-07-09 インテル・コーポレーション Method and apparatus for matching an external code image to a private key on a chip
JP2008033457A (en) * 2006-07-26 2008-02-14 Internatl Business Mach Corp <Ibm> Method and central processing unit for processing encrypted software
JP2010182296A (en) * 2009-01-08 2010-08-19 Panasonic Corp Program execution apparatus, control method, control program and integrated circuit
JP2012186553A (en) * 2011-03-03 2012-09-27 Toshiba Corp Communication device and communication method

Also Published As

Publication number Publication date
JP4691337B2 (en) 2011-06-01

Similar Documents

Publication Publication Date Title
JP5291159B2 (en) Information processing apparatus, secure processing method, computer program, and recording medium.
JP2010267240A (en) Recording device
JP4691337B2 (en) Program execution device, certificate authority device
JP3837368B2 (en) Copyright protection system, recording device and decryption device
JP2008011219A (en) Digital watermark embedding system, device and program
JP4529879B2 (en) Data recording system
JP2004252852A (en) Information processor and information processing method
KR101177111B1 (en) Method and apparatus for forbidding consuming digital contents against copy control information
JP2007158559A (en) Recording apparatus and method

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070726

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070726

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100817

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20101006

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20101026

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110112

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20110117

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110201

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110221

R150 Certificate of patent or registration of utility model

Ref document number: 4691337

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20140225

Year of fee payment: 3

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350