JP2014048866A - Execution method of application program - Google Patents

Execution method of application program Download PDF

Info

Publication number
JP2014048866A
JP2014048866A JP2012190943A JP2012190943A JP2014048866A JP 2014048866 A JP2014048866 A JP 2014048866A JP 2012190943 A JP2012190943 A JP 2012190943A JP 2012190943 A JP2012190943 A JP 2012190943A JP 2014048866 A JP2014048866 A JP 2014048866A
Authority
JP
Japan
Prior art keywords
program
application program
application
information
stage
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
JP2012190943A
Other languages
Japanese (ja)
Other versions
JP5126447B1 (en
Inventor
Akihiko Yoshida
亮彦 吉田
Yoshihiro Yano
義博 矢野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP2012190943A priority Critical patent/JP5126447B1/en
Application granted granted Critical
Publication of JP5126447B1 publication Critical patent/JP5126447B1/en
Priority to PCT/JP2013/062311 priority patent/WO2013161974A1/en
Publication of JP2014048866A publication Critical patent/JP2014048866A/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To determine whether an application program has been tampered or not to automatically register applications which have been not tampered, with an execution permission list.SOLUTION: An instruction to start an application is received to confirm validity of signature information by an OS (S7), and further, validity of secret information generated on the basis of the signature information is confirmed by the application itself (S9). In a case of successful validity confirmation in both of the OS and the application, the application is determined to be not tampered, and an identification code of the application is automatically registered with an execution permission list (S14), and then the execution of the application is continued (S12). If the application is determined to be tampered, the execution of the application is stopped (S11). A monitoring program independent of the application is operated in parallel by multitask processing of the OS, and a user is made to answer whether an application not registered with the list should be registered or not if the application has been started. The application is registered when the user answers that it should be registered, but the execution of the application is stopped when the user answers that it should not be registered.

Description

本発明は、アプリケーションプログラムの実行方法に関し、特に、アプリケーションプログラムの改竄を検知する処理を行った上で、これを実行する技術に関する。   The present invention relates to an application program execution method, and more particularly to a technique for executing a process for detecting falsification of an application program.

ここ数年来、電子機器は、パソコン、スマートホン、電子タブレット等と様々な形態のものが普及してきており、これら様々な電子機器において多様なアプリケーションプログラムが利用されている。このため、実社会で利用されているアプリケーションプログラムの数は膨大な数にのぼり、今後も急激な勢いでその数を増してゆくものと予想される。一方、アプリケーションプログラムの配布形態も、光学的記録媒体やICメモリに格納して提供する形態や、インターネットなどを介してオンラインでデータファイルのみを送信する形態が普及しており、一般ユーザは、様々なルートで入手した様々なアプリケーションプログラムを電子機器にインストールして利用することができる。   In recent years, various types of electronic devices such as personal computers, smart phones, electronic tablets and the like have become widespread, and various application programs are used in these various electronic devices. For this reason, the number of application programs used in the real world is enormous and is expected to increase rapidly in the future. On the other hand, application programs are distributed in a form that is stored and provided in an optical recording medium or IC memory, or in which only a data file is transmitted online via the Internet. Various application programs obtained through various routes can be installed and used in electronic devices.

このように、膨大な数のアプリケーションプログラムが様々な配布形態で提供されている現状では、配布途中のアプリケーションプログラムは、悪意をもったクラッカーによる改竄の標的になりやすい。たとえば、クラッカーは、インターネット経由で任意のアプリケーションプログラムを入手することが可能であり、入手したアプリケーションプログラムに対して改竄を施した後、これを再びインターネット経由あるいは様々な記録媒体に格納して再配布することができる。   Thus, in the present situation where a huge number of application programs are provided in various distribution forms, the application program being distributed is likely to be a target of falsification by a malicious cracker. For example, a cracker can obtain any application program via the Internet, and after tampering with the obtained application program, it is stored again via the Internet or various recording media for redistribution. can do.

一般ユーザにとって、実社会に配布されているアプリケーションプログラムが、正規のプロバイダーから提供された純正のものであるのか、クラッカーによる改竄が施されたものであるのかを見分けることは困難である。特に、改竄されたアプリケーションプログラムが、正規のアプリケーションプログラムと同じファイル名をもつファイルとして配布されていると、一般ユーザが両者を区別することは非常に困難であり、両者を混同せざるを得ない。   It is difficult for a general user to distinguish whether an application program distributed in the real world is a genuine application program provided by a legitimate provider or has been altered by a cracker. In particular, if a falsified application program is distributed as a file with the same file name as a legitimate application program, it is very difficult for general users to distinguish between the two, and both must be confused. .

改竄されたアプリケーションプログラムを実行することによって受ける被害は、改竄の内容によって様々である。たとえば、ウイルスを混入させる改竄が行われた場合には、ユーザの電子機器内のファイルが破壊されたり、個人情報が外部へ漏洩されたり、重大な被害が生じることになる。一方、画像データや文字データを差し替えるような改竄が行われた場合、ウイルスほどの被害は生じないにしても、提示される情報が本来のものではなくなってしまうため、ユーザに混乱を生じさせることになる。   Damage caused by executing a falsified application program varies depending on the contents of the falsification. For example, when tampering with a virus is performed, files in the user's electronic device are destroyed, personal information is leaked to the outside, and serious damage occurs. On the other hand, if tampering is performed that replaces image data or text data, even if the damage is not as great as that of a virus, the information that is presented will not be the original information, causing confusion to the user. become.

しかも、このような改竄されたアプリケーションプログラムの流布による被害は、一般ユーザだけではなく、コンテンツプロバイダにまで及ぶことになる。たとえば、コンテンツプロバイダであるA社が配布した正規のアプリケーションプログラムが、クラッカーによる改竄を受け、改竄されたアプリケーションプログラムが、あたかもA社の正規の製品であるかのようにして再配布された場合を考えてみよう。この場合、改竄されたアプリケーションプログラムをインストールしたユーザが、当該プログラムをA社から提供された正規の製品であると信じて実行したとすれば、A社は不当な評価を受けることになる。たとえば、改竄によってプログラムの動作に不具合が生じたり、公序良俗に反するような内容が表示されたりすれば、A社の製品に対するユーザの評価は低下することになり、A社は風評被害を受けることになる。   Moreover, the damage caused by the spread of such altered application programs extends not only to general users but also to content providers. For example, when a legitimate application program distributed by company A, which is a content provider, has been falsified by a cracker and the falsified application program is redistributed as if it were a legitimate product of company A. Let's think about it. In this case, if the user who installed the altered application program believes that the program is a legitimate product provided by Company A, Company A will receive an unfair evaluation. For example, if a flaw occurs in the operation of the program due to tampering, or content that is contrary to public order and morals is displayed, the user's evaluation of the product of Company A will be reduced, and Company A will suffer reputational damage. Become.

このように、コンテンツプロバイダがアプリケーションプログラムを配布し、一般ユーザの電子機器にインストールして実行してもらう上では、クラッカーによる改竄を防止することが不可欠である。通常、デジタルデータの改竄を防止するためには、電子署名の技術が利用されている。たとえば、下記の特許文献1には、携帯電話のメモリ内のデータに電子署名を施し、これをチェックすることにより改竄の有無を検出するシステムが開示されている。また、特許文献2には、情報処理装置内のアプリケーションプログラムの改竄の有無を、電子署名やハッシュ値を利用して監視するシステムが開示されている。   Thus, in order for a content provider to distribute an application program, install it on an electronic device of a general user, and execute it, it is essential to prevent tampering by a cracker. Usually, in order to prevent tampering of digital data, a digital signature technique is used. For example, Patent Literature 1 below discloses a system that detects the presence or absence of tampering by applying an electronic signature to data in a memory of a mobile phone and checking the data. Patent Document 2 discloses a system that monitors whether an application program in an information processing apparatus has been tampered with using an electronic signature or a hash value.

一方、下記の特許文献3および特許文献4には、予め実行対象となるアプリケーションプログラムを登録しておき、未登録のプログラムについては実行を許可しない処理を行う技術が開示されている。この技術を利用すれば、改竄のおそれがない安全なアプリケーションプログラムと判断できるもののみを予め登録しておくようにし、改竄のおそれがあるアプリケーションプログラムの実行を抑制することができるようになる。   On the other hand, the following Patent Document 3 and Patent Document 4 disclose a technique in which an application program to be executed is registered in advance, and processing for not permitting execution of an unregistered program is disclosed. If this technology is used, only those that can be determined as safe application programs that are not likely to be tampered with are registered in advance, and execution of application programs that are likely to be tampered with can be suppressed.

特開2007−293847号公報JP 2007-293847 A 国際公開第WO2008−047830号公報International Publication No. WO2008-047830 特開2002−304318号公報JP 2002-304318 A 特開2005−157429号公報JP 2005-157429 A

上述したとおり、デジタルデータの改竄を防止するために、当該デジタルデータに対して電子署名を施すことは様々な産業分野で利用されており、前掲の特許文献1,2にも記載されているように、電子機器に配布するアプリケーションプログラムに対する改竄防止にも利用されている。たとえば、Android(登録商標)をOSとして採用するスマートホンの場合、インストールするアプリケーションプログラムには、必ず電子署名が付加されていることが仕様によって定められており、電子署名が付加されていないアプリケーションプログラムや、付加されている電子署名に不整合が生じているアプリケーションプログラムは、OSによって不正なプログラムと判断され、実行が許可されない。   As described above, in order to prevent falsification of digital data, applying a digital signature to the digital data is used in various industrial fields, as described in the above-mentioned Patent Documents 1 and 2. It is also used to prevent falsification of application programs distributed to electronic devices. For example, in the case of a smartphone that employs Android (registered trademark) as an OS, the application program to be installed is stipulated by the specification that an electronic signature is always added, and an application program without an electronic signature is added. In addition, an application program having an inconsistency in the added electronic signature is determined as an illegal program by the OS, and execution is not permitted.

しかしながら、電子署名は、あくまでも署名対象データの内容を署名者が保証するものであり、署名者の身元まで保証するものではない。このため、クラッカーは、アプリケーションプログラムの内容を改竄した後、改竄後のアプリケーションプログラムを署名対象データとして自分自身を署名者とする電子署名を新たに行い、この新たな電子署名を付加して改竄後のアプリケーションプログラムを再配布することが可能である。このように、電子署名に対する改竄が行われた場合、上述したAndroid(登録商標)をOSとして利用している端末装置などでは、有効な改竄検知を行うことができない。   However, the digital signature guarantees the content of the data to be signed to the last, and does not guarantee the identity of the signer. For this reason, after falsifying the contents of the application program, the cracker newly creates an electronic signature with the altered application program as the signature target data and signing itself as the signer. The application program can be redistributed. As described above, when the electronic signature is falsified, the terminal device using the above-described Android (registered trademark) as an OS cannot perform effective falsification detection.

一方、前掲の特許文献3,4に記載されているように、予め登録されているアプリケーションプログラムだけについて、その実行を許可するような運用を行った場合、適切な登録作業が行われている限り、改竄されたプログラムの実行を阻止することができる。しかしながら、実際には、配布を受けたプログラムが改竄されたものであるか否かをユーザが正しく判断することは困難であり、また、仮に改竄されていないプログラムであることが判明した場合でも、ユーザがこれを個別に登録する作業を行う必要があるため、ユーザに煩雑な作業負担を課す結果になる。   On the other hand, as described in the above-mentioned Patent Documents 3 and 4, only the application program registered in advance is operated so as to permit its execution, as long as appropriate registration work is performed. The execution of the altered program can be prevented. However, in practice, it is difficult for the user to correctly determine whether the distributed program has been tampered with, and even if it turns out that the program has not been tampered with, Since it is necessary for the user to perform an operation of individually registering this, a burden is imposed on the user.

そこで本発明は、電子署名に対する改竄が行われた場合にも、有効な改竄検知を行うことができ、更に、改竄なしと判定されたアプリケーションプログラムについては、ユーザに登録作業の負担を課すことなしに、実行許可リストへの自動登録が行われるアプリケーションプログラムの実行方法を提供することを目的とする。   Therefore, the present invention can perform effective tampering detection even when tampering with an electronic signature is performed, and further, does not impose a burden of registration work on a user for an application program that has been determined not to tamper. Another object of the present invention is to provide a method of executing an application program that is automatically registered in the execution permission list.

(1) 本発明の第1の態様は、コンピュータが、アプリケーションプログラムを実行するアプリケーションプログラムの実行方法において、
コンピュータが、実行対象となるアプリケーションプログラムを含むデータファイルを入力する入力段階と、
コンピュータが、入力したアプリケーションプログラムが改竄されているか否かを判定する改竄判定段階と、
コンピュータが、改竄判定段階において改竄されていない旨の判定がなされたアプリケーションプログラムの識別コードを、実行許可リストに登録するリスト自動登録段階と、
コンピュータが、起動状態にあるアプリケーションプログラムの識別コードを認識する起動アプリ認識段階と、
コンピュータが、起動アプリ認識段階において認識した識別コードが実行許可リストに登録されているか否かを判定する登録有無判定段階と、
コンピュータが、登録有無判定段階において未登録と判定された場合に、当該未登録アプリを登録するか否かをユーザに問い合わせる登録照会段階と、
コンピュータが、問い合わせに対するユーザの回答として、登録する旨の回答があった場合には、未登録アプリの識別コードを実行許可リストに登録した上で当該アプリの実行を許可し、登録しない旨の回答があった場合には、当該未登録アプリの実行を中止させる回答処理段階と、
を行い、
入力段階では、改竄チェック機能付アプリケーションプログラムと、署名情報と、秘匿情報もしくはその所在を示す所在情報と、を含むデータファイルを入力し、
署名情報は、アプリケーションプログラムを署名対象データとする電子署名処理によって得られた情報であり、
秘匿情報は、改竄チェック機能付アプリケーションプログラムおよび署名情報を構成するデータの中の所定部分を秘匿化対象データとして抽出し、抽出した秘匿化対象データに対する秘匿化処理を施して得られた情報であり、
改竄判定段階は、署名情報に基づいて改竄の有無を確認する第1の確認段階と、秘匿情報に基づいて改竄の有無を確認する第2の確認段階と、を有し、
改竄チェック機能付アプリケーションプログラムには、秘匿化処理で行われた処理プロセスを勘案して秘匿化対象データに対する秘匿情報の正当性を確認する改竄チェックルーチンが含まれており、改竄チェックルーチンを実行することにより第2の確認段階が行われるようにしたものである。
(1) According to a first aspect of the present invention, there is provided an application program execution method in which a computer executes an application program.
An input stage in which a computer inputs a data file containing an application program to be executed;
A tampering determination stage in which the computer determines whether the input application program has been tampered with;
A list automatic registration stage in which an identification code of an application program that has been determined that the computer has not been falsified in the falsification determination stage,
A startup application recognition stage in which the computer recognizes the identification code of the application program in the startup state;
A registration presence / absence determination step in which the computer determines whether or not the identification code recognized in the activation app recognition step is registered in the execution permission list;
When the computer is determined to be unregistered in the registration presence / absence determination step, a registration inquiry step for inquiring the user whether to register the unregistered app;
If the computer responds that the user has registered as a response to the inquiry, the identification code of the unregistered application is registered in the execution permission list, the execution of the application is permitted, and the response that the application is not registered If there is a response processing stage to stop the execution of the unregistered application,
And
At the input stage, a data file including an application program with a falsification check function, signature information, and confidential information or location information indicating the location is input,
The signature information is information obtained by electronic signature processing using the application program as signature target data.
Confidential information is information obtained by extracting a predetermined portion of the data constituting the application program with falsification check function and signature information as the data to be concealed and performing the concealment process on the extracted data to be concealed ,
The falsification determination stage includes a first confirmation stage for confirming whether or not falsification is performed based on the signature information, and a second confirmation stage for confirming whether or not falsification is performed based on the confidential information.
The application program with a falsification check function includes a falsification check routine for confirming the validity of the confidential information for the data to be concealed in consideration of the processing process performed in the concealment process, and executes the falsification check routine. Thus, the second confirmation step is performed.

(2) 本発明の第2の態様は、上述した第1の態様に係るアプリケーションプログラムの実行方法において、
一方の鍵を用いて暗号化したデータを他方の鍵を用いて復号できる性質をもった一対の鍵を用い、
秘匿情報が、秘匿化対象データを一方の鍵を用いて暗号化することにより得られた情報であり、
改竄チェックルーチンが、入力段階で入力したデータファイルに含まれている秘匿情報もしくは入力段階で入力したデータファイルに含まれている所在情報に基づいて入手した秘匿情報を他方の鍵を用いて復号し、この復号によって得られた秘匿化対象データと、入力段階で入力したデータファイルから抽出した秘匿化対象データとが一致していた場合に改竄なしとの確認を行うようにしたものである。
(2) According to a second aspect of the present invention, in the method for executing an application program according to the first aspect described above,
Using a pair of keys that have the property that data encrypted using one key can be decrypted using the other key,
Confidential information is information obtained by encrypting the data to be concealed using one key,
The falsification check routine uses the other key to decrypt the confidential information included in the data file input at the input stage or the confidential information obtained based on the location information included in the data file input at the input stage. When the data to be concealed obtained by this decryption matches the data to be concealed extracted from the data file input at the input stage, it is confirmed that there is no falsification.

(3) 本発明の第3の態様は、上述した第1の態様に係るアプリケーションプログラムの実行方法において、
秘匿情報が、秘匿化対象データに対して、所定の特定鍵をパラメータとして用いた一方向性関数を作用させるダイジェスト化処理を施して作成された情報であり、
改竄チェックルーチンが、入力段階で入力したデータファイルから抽出した秘匿化対象データに対して、特定鍵を用いたダイジェスト化処理を施して得られる情報が、入力段階で入力したデータファイルに含まれている秘匿情報もしくは入力段階で入力したデータファイルに含まれている所在情報に基づいて入手した秘匿情報と一致していた場合に改竄なしとの確認を行うようにしたものである。
(3) According to a third aspect of the present invention, in the method for executing an application program according to the first aspect described above,
The confidential information is information created by performing a digest process that applies a one-way function using a predetermined specific key as a parameter to the data to be concealed,
Information obtained by the digest check process using the specific key for the data to be concealed extracted from the data file input by the falsification check routine is included in the data file input at the input stage. If the confidential information is the same as the confidential information acquired based on the location information included in the confidential information or the data file input in the input stage, it is confirmed that there is no falsification.

(4) 本発明の第4の態様は、上述した第1〜第3の態様に係るアプリケーションプログラムの実行方法において、
OSプログラムの管理下でアプリケーションプログラムの実行を行うコンピュータが、第1の確認段階をOSプログラムに基づいて実行し、第2の確認段階をアプリケーションプログラム内の改竄チェックルーチンに基づいて実行するようにしたものである。
(4) According to a fourth aspect of the present invention, in the method for executing an application program according to the first to third aspects described above,
A computer that executes an application program under the management of an OS program executes the first confirmation stage based on the OS program, and executes the second confirmation stage based on a falsification check routine in the application program. Is.

(5) 本発明の第5の態様は、上述した第4の態様に係るアプリケーションプログラムの実行方法において、
OSプログラムが、複数のアプリケーションプログラムを所定のタイミングで切り替えながら実行させるマルチタスク処理機能を有しており、
コンピュータが、アプリケーションプログラムの1つとして用意された監視プログラムによって、リスト自動登録段階、起動アプリ認識段階、登録有無判定段階、登録照会段階、回答処理段階を実行するようにしたものである。
(5) According to a fifth aspect of the present invention, in the method for executing an application program according to the fourth aspect described above,
The OS program has a multitask processing function for executing a plurality of application programs while switching at a predetermined timing.
A computer executes a list automatic registration stage, a startup application recognition stage, a registration presence / absence judgment stage, a registration inquiry stage, and an answer processing stage by a monitoring program prepared as one of application programs.

(6) 本発明の第6の態様は、上述した第5の態様に係るアプリケーションプログラムの実行方法において、
コンピュータが、OSプログラムによって、個々のアプリケーションプログラムについて、識別コード・起動時・終了時を示すログ情報を記録する処理を実行し、
コンピュータが、監視プログラムによって起動アプリ認識段階を実行する際に、ログ情報を参照することにより起動状態にあるアプリケーションプログラムの識別コードを認識するようにしたものである。
(6) According to a sixth aspect of the present invention, in the method for executing an application program according to the fifth aspect described above,
The computer executes a process of recording log information indicating an identification code, start time, and end time for each application program by the OS program,
When the computer executes the activated application recognition stage by the monitoring program, the identification code of the activated application program is recognized by referring to the log information.

(7) 本発明の第7の態様は、上述した第1〜第6の態様に係るアプリケーションプログラムの実行方法において、
リスト自動登録段階、回答処理段階、および起動アプリ認識段階において、バージョンの異なるアプリケーションプログラムについては、それぞれ異なる識別コードを用いた処理を行うようにしたものである。
(7) According to a seventh aspect of the present invention, in the method for executing an application program according to the first to sixth aspects described above,
In the list automatic registration stage, answer processing stage, and activated application recognition stage, application programs having different versions are processed using different identification codes.

(8) 本発明の第8の態様は、上述した第7の態様に係るアプリケーションプログラムの実行方法において、
同一のファイル名をもったデータファイルに含まれるアプリケーションプログラムであっても、ハッシュ値が異なる場合は、異なるバージョンと認識するようにしたものである。
(8) An eighth aspect of the present invention provides an application program execution method according to the seventh aspect described above,
Even application programs included in data files having the same file name are recognized as different versions if the hash values are different.

(9) 本発明の第9の態様は、上述した第1〜第8の態様に係るアプリケーションプログラムの実行方法において、
リスト自動登録段階もしくは回答処理段階で実行許可リストへの登録を行う際に、コンピュータが外部の記憶装置もしくはサーバ装置内に保存された実行許可リストに対する登録を行い、
登録有無判定段階で、コンピュータが外部の記憶装置もしくはサーバ装置内に保存された実行許可リストを参照することにより判定を行うようにしたものである。
(9) According to a ninth aspect of the present invention, in the method for executing an application program according to the first to eighth aspects described above,
When registering to the execution permission list in the list automatic registration stage or answer processing stage, the computer performs registration to the execution permission list stored in the external storage device or server device,
In the registration presence / absence determination stage, the computer makes a determination by referring to an execution permission list stored in an external storage device or server device.

(10) 本発明の第10の態様は、上述した第1〜第9の態様に係るアプリケーションプログラムの実行方法において、
リスト自動登録段階もしくは回答処理段階で実行許可リストへの登録を行う際に、コンピュータが実行許可リストを暗号化する処理を行い、
登録有無判定段階で、コンピュータが暗号化されている実行許可リストを復号して内容の参照を行うようにしたものである。
(10) According to a tenth aspect of the present invention, in the method for executing an application program according to the first to ninth aspects described above,
When registering to the execution permission list at the list automatic registration stage or answer processing stage, the computer performs the process of encrypting the execution permission list,
At the registration presence / absence determination stage, the computer decrypts the encrypted execution permission list and refers to the contents.

(11) 本発明の第11の態様は、上述した第1〜第10の態様に係るアプリケーションプログラムの実行方法において、
リスト自動登録段階もしくは回答処理段階で実行許可リストへの登録を行う際に、コンピュータが、識別コードとともに、入力段階で入力したデータファイル内に含まれている所定のチェックコードを登録するようにし、
登録有無判定段階で、コンピュータが、データファイル内に含まれているチェックコードと実行許可リストに登録されているチェックコードとの一致を確認し、一致確認がなされることを条件として、実行許可リストに登録されている旨の判定を行うようにしたものである。
(11) An eleventh aspect of the present invention is the application program execution method according to the first to tenth aspects described above,
When registering to the execution permission list in the list automatic registration stage or answer processing stage, the computer registers a predetermined check code included in the data file input in the input stage together with the identification code,
At the registration presence / absence determination stage, the computer checks whether the check code included in the data file matches the check code registered in the execution permission list, and the execution permission list is obtained on condition that the match is confirmed. It is determined that it is registered in.

(12) 本発明の第12の態様は、上述した第1〜第10の態様に係るアプリケーションプログラムの実行方法において、
リスト自動登録段階もしくは回答処理段階で実行許可リストへの登録を行う際に、コンピュータが、識別コードとともに、入力段階で入力したデータファイル内に含まれている所定の情報に対して一方向性関数を作用させるダイジェスト化処理を行うことにより得られるチェックコードを登録するようにし、
登録有無判定段階で、コンピュータが、データファイル内に含まれている上記所定の情報に対して上記一方向性関数を作用させるダイジェスト化処理を行うことにより得られるチェックコードと、実行許可リストに登録されているチェックコードとの一致を確認し、一致確認がなされることを条件として、実行許可リストに登録されている旨の判定を行うようにしたものである。
(12) According to a twelfth aspect of the present invention, in the method for executing an application program according to the first to tenth aspects described above,
When registering to the execution permission list in the list automatic registration stage or answer processing stage, the computer uses a one-way function for the predetermined information contained in the data file input in the input stage together with the identification code. Register the check code obtained by performing the digest process that works
At the registration presence / absence determination stage, the computer registers the check code obtained by performing the digest processing that causes the one-way function to act on the predetermined information included in the data file, and the execution permission list. The check code is matched with the check code, and it is determined that the check code is registered in the execution permission list on condition that the match is confirmed.

(13) 本発明の第13の態様は、上述した第5または第6の態様に係るアプリケーションプログラムの実行方法に用いる監視プログラムを独立して配布するようにしたものである。   (13) According to a thirteenth aspect of the present invention, a monitoring program used in the application program execution method according to the fifth or sixth aspect described above is independently distributed.

本発明に係るアプリケーションプログラムの実行方法では、アプリケーションプログラムは、署名情報と、秘匿情報もしくはその所在を示す所在情報と、を含むデータファイルとして入力され、署名情報の正当性だけでなく、秘匿情報の正当性の確認も行われる。このため、アプリケーションパッケージ自体の改竄だけでなく、署名情報の改竄も検知することができるようになり、電子署名に対する改竄が行われた場合にも、有効な改竄検知が可能になる。しかも、アプリケーションプログラムに、自分自身が改竄されているか否かを判定する改竄チェックルーチンが含まれているため、当該アプリケーションプログラムを実行することにより、改竄の検知が可能になる。また、改竄されていない旨の判定がなされた場合には、実行許可リストへの自動登録が行われるため、ユーザが登録作業を行う必要はなくなる。   In the execution method of the application program according to the present invention, the application program is input as a data file including signature information and confidential information or location information indicating the location, and not only the validity of the signature information but also the confidential information Validity is also confirmed. For this reason, not only the falsification of the application package itself but also the falsification of the signature information can be detected, and even when the digital signature is falsified, effective falsification detection is possible. Moreover, since the application program includes a falsification check routine for determining whether or not the application program itself has been falsified, falsification can be detected by executing the application program. In addition, when it is determined that the file has not been tampered with, automatic registration to the execution permission list is performed, so that the user need not perform registration work.

署名情報を付加した従来の一般的なアプリケーションプログラムの配布方法を示すブロック図である。It is a block diagram which shows the distribution method of the conventional general application program which added signature information. 図1に示す配布用ファイル20の具体的な作成方法を示すブロック図である。It is a block diagram which shows the specific preparation method of the file 20 for distribution shown in FIG. 図2に示す配布用ファイル20について、署名情報22の正当性を確認する処理を示すブロック図である。FIG. 3 is a block diagram showing processing for confirming the validity of signature information 22 for the distribution file 20 shown in FIG. 2. 図1に示す従来の配布方法に対してクラッカーXが試みる改竄プロセスを示すブロック図である。It is a block diagram which shows the falsification process which the cracker X tries with respect to the conventional distribution method shown in FIG. 本発明に係るアプリケーションプログラムの配布方法の基本原理を示すブロック図である。It is a block diagram which shows the basic principle of the distribution method of the application program which concerns on this invention. 図5に示す配布用ファイル20Aについて、署名情報22Aの正当性および秘匿情報23Aの正当性を確認する処理を示すブロック図である。It is a block diagram which shows the process which confirms the correctness of the signature information 22A and the confidential information 23A about the distribution file 20A shown in FIG. 本発明に係るアプリケーションプログラムの配布実行方法の基本手順を示す流れ図である。It is a flowchart which shows the basic procedure of the distribution execution method of the application program which concerns on this invention. 図5に示す本発明に係る配布方法に対してクラッカーXが試みる改竄プロセスを示すブロック図である。FIG. 6 is a block diagram showing a tampering process attempted by cracker X for the distribution method according to the present invention shown in FIG. 5. 図5に示す本発明の基本的な実施形態に係る配布方法のバリエーションを示すブロック図である。It is a block diagram which shows the variation of the distribution method which concerns on basic embodiment of this invention shown in FIG. 図5に示す本発明の基本的な実施形態に係る配布方法の別なバリエーションを示すブロック図である。FIG. 6 is a block diagram showing another variation of the distribution method according to the basic embodiment of the present invention shown in FIG. 5. 図5に示す本発明に係る配布方法において、秘匿情報23Aとして暗号化された情報を用いる具体的実施例を示すブロック図である。FIG. 6 is a block diagram showing a specific example using information encrypted as confidential information 23A in the distribution method according to the present invention shown in FIG. 図11に示す配布用ファイル20Aについて、署名情報22Aの正当性および秘匿情報23Aの正当性を確認する処理を示すブロック図である。12 is a block diagram showing processing for confirming the validity of signature information 22A and the validity of confidential information 23A for the distribution file 20A shown in FIG. 図5に示す本発明に係る配布方法において、秘匿情報23Aとしてダイジェスト化された情報を用いる具体的実施例を示すブロック図である。FIG. 6 is a block diagram showing a specific example in which digested information is used as confidential information 23A in the distribution method according to the present invention shown in FIG. 図13に示す配布用ファイル20Aについて、署名情報22Aの正当性および秘匿情報23Aの正当性を確認する処理を示すブロック図である。It is a block diagram which shows the process which confirms the correctness of the signature information 22A and the confidential information 23A about the distribution file 20A shown in FIG. 本発明に係るアプリケーションプログラムの配布用ファイル作成装置の基本構成を示すブロック図である。It is a block diagram which shows the basic composition of the file creation apparatus for application program distribution concerning this invention. 本発明に係るアプリケーションプログラムの配布実行方法の変形例を示すブロック図である。It is a block diagram which shows the modification of the distribution execution method of the application program which concerns on this invention. 本発明に係るアプリケーションプログラムの実行方法で利用される監視プログラムの監視ルーチンの手順を示す流れ図である。It is a flowchart which shows the procedure of the monitoring routine of the monitoring program utilized with the execution method of the application program which concerns on this invention. 図17に示す起動アプリ認識段階S21で起動アプリの認識に利用されるログ情報の一例を示す図である。It is a figure which shows an example of the log information utilized for recognition of a starting application in the starting application recognition step S21 shown in FIG. 本発明に係るアプリケーションプログラムの実行方法で利用される実行許可リストの一例を示す図である。It is a figure which shows an example of the execution permission list utilized with the execution method of the application program which concerns on this invention. 図17に示す登録照会段階S24でユーザに提示されるメッセージ画面の一例を示す図である。It is a figure which shows an example of the message screen shown to a user by registration inquiry step S24 shown in FIG. 自己改竄チェック機能をもたない通常アプリを起動したときの処理手順を示す流れ図である。It is a flowchart which shows the process sequence when starting the normal application which does not have a self-tampering check function. 自己改竄チェック機能をもつアプリを起動したときの処理手順を示す流れ図である。It is a flowchart which shows the process sequence when starting the application which has a self-tampering check function.

以下、本発明を図示する実施形態に基づいて説明する。なお、本発明に係るアプリケーションプログラムの実行方法は、特願2012−099139号(平成24年4月24日出願、早期審査に基づき平成24年6月28日特許査定)に記載された発明(以下、先願発明という)に係るアプリケーションプログラムの配布実行方法および改竄検知方法を利用することを前提としている。そこで、以下、§1〜§8において、先願発明に係るアプリケーションプログラムの配布実行方法および改竄検知方法を説明し、§9および§10において、これを利用した本発明に係るアプリケーションプログラムの実行方法を説明することにする。§1〜§8に記載した実施形態は、先願の§1〜§8に記載した実施形態と同一である。   Hereinafter, the present invention will be described based on the illustrated embodiments. The application program execution method according to the present invention is an invention described in Japanese Patent Application No. 2012-099139 (filed on April 24, 2012, patent approved on June 28, 2012 based on accelerated examination) It is assumed that the application program distribution execution method and falsification detection method are used. Therefore, §1 to §8 describe the application program distribution execution method and falsification detection method according to the invention of the prior application, and §9 and §10 use the same to execute the application program according to the present invention. Will be explained. The embodiments described in §1 to §8 are the same as the embodiments described in §1 to §8 of the prior application.

<<< §1.署名情報を付加する一般的な配布方法 >>>
ここでは、説明の便宜上、署名情報を付加した従来の一般的なアプリケーションプログラムの配布方法を簡単に説明しておく。図1は、このような従来の配布方法を示すブロック図である。ここでは、具体的な例として、Android(登録商標)をOSとして採用するスマートホンやタブレット型電子機器(いわゆる、Android端末)に対して、アプリケーションプログラムを配布する場合を例にとって説明する。
<<< §1. General distribution method for adding signature information >>>
Here, for convenience of explanation, a conventional general distribution method of application programs to which signature information is added will be briefly described. FIG. 1 is a block diagram showing such a conventional distribution method. Here, as a specific example, a case where an application program is distributed to a smartphone or a tablet electronic device (so-called Android terminal) that employs Android (registered trademark) as an OS will be described as an example.

Android端末用のアプリケーションプログラムのデータ構造およびその配布形態については、世界的な標準仕様が定められており、一般的なアプリケーションプログラムは、いずれもこの標準仕様に基づいて作成され、配布されることになる。   A global standard specification has been established for the data structure and distribution form of application programs for Android devices, and all general application programs are created and distributed based on this standard specification. Become.

具体的には、プログラム提供者A(コンテンツプロバイダー)は、まず、図1の上段に示すようなデータ構造を有するアプリケーションプログラム10を作成する。Androidの標準仕様では、アプリケーションプログラム10は、基本的には、図示のとおり、プログラム本体部11,リソースデータ12,サブルーチン群13,補助ファイル14によって構成され、場合によっては、この他にもいくつかのファイルが付加されたり、いくつかが省略されたりする(たとえば、プログラム本体部11がサブルーチンを利用しないケースでは、サブルーチン群13は不要である)。   Specifically, the program provider A (content provider) first creates an application program 10 having a data structure as shown in the upper part of FIG. In the standard specification of Android, the application program 10 is basically composed of a program body 11, a resource data 12, a subroutine group 13, and an auxiliary file 14 as shown in the figure. Are added or some of them are omitted (for example, in the case where the program body 11 does not use a subroutine, the subroutine group 13 is unnecessary).

ここで、プログラム本体部11はJava(登録商標)で記述されたプログラムのコンパイル後のファイルであり、アプリケーションプログラムの中枢を構成する要素になる。アプリケーションプログラム10が起動されると、このプログラム本体部11の先頭から命令コードが順次実行されることになる。   Here, the program main body 11 is a file after compiling a program described in Java (registered trademark), and is an element constituting the center of the application program. When the application program 10 is activated, instruction codes are sequentially executed from the top of the program main body 11.

リソースデータ12は、プログラム本体部11が必要に応じて利用する画像や文字列のデータ群である。画像データは、JPEG形式、GIF形式、BMP形式、PNG形式など、様々なフォーマットで記述されたデータファイルとして用意され、文字列データも同様に、XML形式など、様々なフォーマットで記述されたデータファイルとして用意される。   The resource data 12 is a data group of images and character strings used as necessary by the program body 11. Image data is prepared as a data file described in various formats such as JPEG format, GIF format, BMP format, and PNG format. Similarly, character string data is a data file described in various formats such as XML format. Prepared as.

一方、サブルーチン群13は、「Shared Object」と呼ばれている汎用のサブルーチンプログラム群から構成される。個々のサブルーチンは、プログラム本体部11からのサブルーチンコール命令によって呼び出され、それぞれの役割に応じた所定の処理を実行する。呼び出されたサブルーチンプログラムがその任務を完了すると、制御は再びプログラム本体部11内のプログラムに戻ることになる。プログラム本体部11は、サブルーチンコールを行う際に、必要に応じて何らかのデータを引数としてサブルーチンへ引き渡すことができ、各サブルーチンプログラムは、必要に応じて、その実行結果をプログラム本体部11へ引き渡すことができる。   On the other hand, the subroutine group 13 is composed of a general-purpose subroutine program group called “Shared Object”. Each subroutine is called by a subroutine call instruction from the program body 11 and executes a predetermined process according to each role. When the called subroutine program completes its mission, control returns to the program in the program body 11 again. When making a subroutine call, the program body 11 can pass some data as an argument to the subroutine as necessary, and each subroutine program delivers the execution result to the program body 11 as necessary. Can do.

補助ファイル14は、一般に「マニフェスト」と呼ばれている補助的な情報を記述したXML形式のファイルである。ここには、Android端末で当該アプリケーションプログラムを実行する際のパーミッション情報(たとえば、当該プログラムが、インターネット接続を行うか否か、GPS情報を参照するか否か、電話機能を利用するか否か、といった情報)などが記録される。このパーミッション情報は、当該アプリケーションプログラムのインストール時や起動時にユーザに提示され、ユーザがこれに納得する旨の確認入力を行った場合に限り、インストールや起動が行われることになる。   The auxiliary file 14 is an XML format file describing auxiliary information generally called “manifest”. Here, permission information when executing the application program on the Android terminal (for example, whether the program makes an Internet connection, whether to refer to GPS information, whether to use a telephone function, Are recorded). This permission information is presented to the user at the time of installation or activation of the application program, and the installation or activation is performed only when the user inputs a confirmation that the user agrees with the permission information.

以上、Android端末用アプリケーションプログラム10の基本データ構造を説明したが、アプリケーションプログラム10は、このままの状態では配布することができない。Androidの標準仕様によると、このアプリケーションプログラム10を配布する際には、パッケージ化処理および署名情報付加処理が必要である。   Although the basic data structure of the Android terminal application program 10 has been described above, the application program 10 cannot be distributed as it is. According to the standard specification of Android, when the application program 10 is distributed, a packaging process and a signature information adding process are required.

パッケージ化処理は、主に、アプリケーションプログラム10を構成する個々のファイルを圧縮して1つのパッケージにまとめる処理であり(その他、中間コンパイル処理なども併せて行われる)、図1の中段に示すように、このパッケージ化処理を施すことにより、アプリケーションプログラム10は、1つのアプリケーションパッケージ21にまとめられる。圧縮プロセスを経ることにより、アプリケーションパッケージ21のデータ容量は元のアプリケーションプログラム10の容量に比べて削減され、配布に適した形になる。   The packaging process is mainly a process of compressing individual files constituting the application program 10 and combining them into one package (otherwise, an intermediate compilation process is also performed), as shown in the middle part of FIG. In addition, the application program 10 is combined into one application package 21 by performing the packaging process. Through the compression process, the data capacity of the application package 21 is reduced as compared with the capacity of the original application program 10 and is in a form suitable for distribution.

一方、署名情報付加処理は、このアプリケーションパッケージ21を署名対象データDとして、プログラム提供者Aが自己の署名を施す処理であり、この処理によって、Aの署名情報22が作成される。具体的には、公開鍵暗号方式を利用した電子署名処理が採用されており、プログラム提供者Aの第1の鍵K(a1)を用いて、署名対象データD(すなわち、アプリケーションパッケージ21)に対する署名値S(A)を作成する処理が行われ、作成された署名値S(A)と、プログラム提供者Aの第2の鍵K(a2)とを含むAの署名情報22が作成される。図1において太線で囲って示す部分は、署名対象データDとなる部分を示しており、署名情報22は、この太線枠内のデータに対して、プログラム提供者Aが署名したことを示す情報ということになる。   On the other hand, the signature information adding process is a process in which the program provider A uses the application package 21 as signature target data D to apply its own signature, and the signature information 22 of A is created by this process. Specifically, an electronic signature process using a public key cryptosystem is employed, and the signature target data D (that is, the application package 21) is used with the first key K (a1) of the program provider A. A process for creating a signature value S (A) is performed, and A signature information 22 including the created signature value S (A) and the second key K (a2) of the program provider A is created. . In FIG. 1, a part surrounded by a thick line indicates a part to be the signature target data D, and the signature information 22 is information indicating that the program provider A has signed the data in the thick line frame. It will be.

ここで、第1の鍵K(a1)と第2の鍵K(a2)とは、公開鍵暗号方式における秘密鍵と公開鍵との関係を有するデジタルデータであり、一方の鍵を用いて暗号化したデータを他方の鍵を用いて復号できる性質をもっている。通常、第1の鍵K(a1)として秘密鍵が、第2の鍵K(a2)として公開鍵が、それぞれ用いられ、Androidの標準仕様上では、前者を秘密にし、後者を公開する取り決めになっているが、本願では、単に、第1の鍵K(a1),第2の鍵K(a2)と呼ぶことにする。   Here, the first key K (a1) and the second key K (a2) are digital data having a relationship between the secret key and the public key in the public key cryptosystem, and are encrypted using one of the keys. The data can be decrypted using the other key. Usually, a private key is used as the first key K (a1) and a public key is used as the second key K (a2). According to the standard specification of Android, the former is kept secret and the latter is made public. However, in the present application, they are simply referred to as a first key K (a1) and a second key K (a2).

こうして作成されたAの署名情報22は、署名対象となるアプリケーションパッケージ21について、プログラム提供者Aがその内容を保証するための情報であり、万一、アプリケーションパッケージ21の内容が改竄されていた場合には、後述するように、Aの署名情報22との間に不整合が生じることになるので、このAの署名情報22を利用した改竄検知が可能になる。   The signature information 22 of A created in this way is information for the program provider A to guarantee the contents of the application package 21 to be signed. If the contents of the application package 21 are falsified, As will be described later, a mismatch occurs between the signature information 22 of A and tampering detection using the signature information 22 of A becomes possible.

配布用ファイル20は、アプリケーションパッケージ21にAの署名情報22を付加することによって構成されるファイルである。プログラム提供者Aは、アプリケーションプログラム10に対して、上述したパッケージ化処理および署名情報付加処理を施して配布用ファイル20を作成し、インターネット等を介して多数のユーザU1,U2,U3へと配布することになる。もちろん、光学的記録媒体やICメモリ等に格納した状態で配布することも可能である。   The distribution file 20 is a file configured by adding the A signature information 22 to the application package 21. The program provider A performs the above-described packaging process and signature information addition process on the application program 10 to create a distribution file 20, and distributes it to a large number of users U1, U2, U3 via the Internet or the like. Will do. Of course, it is also possible to distribute it in a state stored in an optical recording medium, an IC memory or the like.

Androidの仕様では、このようなデータ構造を有する配布用ファイル20は、APKファイルと呼ばれており、Android端末に配布するアプリケーションプログラムは、すべてこのAPKファイルの形式で配布する必要がある。別言すれば、Androidの仕様では、配布するすべてのアプリケーションプログラムに署名情報を付加することが義務づけられており、Android端末では、配布されたAPKファイルを実行する際に、署名情報に基づく改竄検知が行われることになる。   In the Android specification, the distribution file 20 having such a data structure is called an APK file, and all application programs distributed to Android terminals need to be distributed in the form of this APK file. In other words, Android specifications require that signature information be added to all application programs to be distributed. On Android devices, when a distributed APK file is executed, falsification detection based on the signature information is performed. Will be done.

図2は、図1に示す配布用ファイル20の具体的な作成方法、特に、署名情報22の具体的な作成方法を示すブロック図である。署名情報付加処理では、まず、署名対象データD(すなわち、アプリケーションパッケージ21)に対してハッシュ関数HASHを作用させた不可逆変換が行われ、ハッシュ値H=HASH(D)が求められる。ハッシュ関数は代表的な一方向性関数であり、もとのデータDに対しては常に一義的なハッシュ値Hが得られるが、逆に、ハッシュ値HからはもとのデータDを復元することはできない性質をもっている。このため、ハッシュ値Hは、もとのデータD(図示の例の場合は、アプリケーションパッケージ21を構成する全データ)に比べてデータ容量を極めて小さくできる。   FIG. 2 is a block diagram showing a specific method for creating the distribution file 20 shown in FIG. 1, in particular, a specific method for creating the signature information 22. In the signature information addition processing, first, irreversible transformation is performed by applying the hash function HASH to the signature target data D (that is, the application package 21), and a hash value H = HASH (D) is obtained. The hash function is a typical one-way function, and a unique hash value H is always obtained for the original data D. Conversely, the original data D is restored from the hash value H. It has a nature that cannot be done. For this reason, the hash value H can have an extremely small data capacity compared to the original data D (in the example shown, all data constituting the application package 21).

次に、このハッシュ値Hを、プログラム提供者Aの第1の鍵K(a1)を用いた公開鍵暗号方式の暗号化アルゴリズムを用いて暗号化し、署名値S(A)を求める。すなわち、署名値S(A)は、ハッシュ値Hを暗号化したデータであり、プログラム提供者Aの第2の鍵K(a2)を用いた復号を行うことにより、元のハッシュ値Hが得られることになる。結局、アプリケーションパッケージ21を署名対象データDとして、プログラム提供者Aの第1の鍵K(a1)を用いた暗号化を利用した電子署名処理を行って署名値S(A)を生成し、この署名値S(A)とプログラム提供者Aの第2の鍵K(a2)とによって、Aの署名情報22が作成されることになる。   Next, the hash value H is encrypted by using an encryption algorithm of a public key cryptosystem using the first key K (a1) of the program provider A to obtain a signature value S (A). That is, the signature value S (A) is data obtained by encrypting the hash value H, and the original hash value H is obtained by performing decryption using the second key K (a2) of the program provider A. Will be. Eventually, using the application package 21 as the signature target data D, the digital signature process using encryption using the first key K (a1) of the program provider A is performed to generate the signature value S (A). The signature information 22 of A is created by the signature value S (A) and the second key K (a2) of the program provider A.

前述したとおり、配布用ファイル(APKファイル)20は、アプリケーションパッケージ21にAの署名情報22を付加したファイルであり、Android端末に対しては、このような形式をもったファイルとして、アプリケーションプログラム10が配布されることになる。ここでは、便宜上、この配布用ファイル20が「PatGame.apk」なるファイル名をもったゲーム用アプリケーションファイルとして配布されたものとしよう(ファイル名の拡張子.apkは、このファイルがAPKファイルであることを示している)。   As described above, the distribution file (APK file) 20 is a file in which the signature information 22 of A is added to the application package 21, and for the Android terminal, the application program 10 is a file having such a format. Will be distributed. Here, for convenience, it is assumed that the distribution file 20 is distributed as a game application file having a file name “PatGame.apk” (the file name extension .apk is an APK file). It is shown that).

この配布用ファイル20の実行時には、上述したとおり、署名情報に基づく改竄検知(署名情報22の正当性確認)が行われる。図3は、Android端末において実行される署名情報22の正当性確認処理を示すブロック図である。   When the distribution file 20 is executed, as described above, falsification detection based on the signature information (validity confirmation of the signature information 22) is performed. FIG. 3 is a block diagram showing the validity confirmation process of the signature information 22 executed in the Android terminal.

Android端末が入手した「PatGame.apk」なるファイル名をもった配布用ファイル20には、アプリケーションパッケージ21とAの署名情報22とが含まれている。ここで、署名情報22には、署名値S(A)とAの第2の鍵K(a2)とが含まれており、前述したように、署名値S(A)に対して、Aの第2の鍵K(a2)を用いた復号処理を行うことにより、元のハッシュ値Hを得ることができる。図3では、このような署名値S(A)の復号によって得られたハッシュ値をハッシュ値H1と呼ぶことにする。   The distribution file 20 having the file name “PatGame.apk” obtained by the Android terminal includes an application package 21 and A signature information 22. Here, the signature information 22 includes the signature value S (A) and the second key K (a2) of A, and as described above, the signature value S (A) with respect to the signature value S (A). The original hash value H can be obtained by performing a decryption process using the second key K (a2). In FIG. 3, the hash value obtained by decoding the signature value S (A) is referred to as a hash value H1.

一方、アプリケーションパッケージ21(署名対象データD)に対して、図2に示すハッシュ関数HASHを作用させた不可逆変換を行い、ハッシュ値H=HASH(D)を求める処理も行う。図3では、このような不可逆変換によって得られたハッシュ値をハッシュ値H2と呼ぶことにする。もし、Android端末が入手した「PatGame.apk」なるファイル名をもった配布用ファイル20に含まれているアプリケーションパッケージ21の内容が、図2の上段に示すアプリケーションパッケージ21の内容と完全に同一であれば、ハッシュ値H1,H2は一致するはずである。   On the other hand, the application package 21 (signature target data D) is subjected to irreversible transformation using the hash function HASH shown in FIG. 2 to obtain a hash value H = HASH (D). In FIG. 3, the hash value obtained by such irreversible transformation is referred to as a hash value H2. If the contents of the application package 21 included in the distribution file 20 having the file name “PatGame.apk” obtained by the Android terminal are completely the same as the contents of the application package 21 shown in the upper part of FIG. If there are, the hash values H1 and H2 should match.

そこで、ユーザUが利用するAndroid端末において、ハッシュ値H1,H2の一致を確認する処理を実行すれば、アプリケーションパッケージ21に対する改竄が行われているか否かを判定することができる。AndroidOSには、アプリケーションプログラムの実行前にこのような一致確認を行い、両者が不一致であった場合には、アプリケーションパッケージ21に対して何らかの改竄が行われたものと判断し、当該アプリケーションプログラムの実行を中止する機能が備わっている。   Therefore, if an Android terminal used by the user U executes a process for confirming a match between the hash values H1 and H2, it can be determined whether or not the application package 21 has been tampered with. The Android OS performs such a match check before executing the application program. If the two do not match, it is determined that some alteration has been made to the application package 21, and the execution of the application program is executed. It has a function to cancel.

<<< §2.従来の配布方法の具体的な問題点 >>>
§1で述べたとおり、Android端末用のアプリケーションプログラムは、図1に示すように、配布用ファイル(APKファイル)20の形式で広く配布されることになるので、一般ユーザU1,U2,U3は、インターネット等を介してこれをダウンロードすることにより容易に入手することができる。これは、悪意をもったクラッカーXも、配布用ファイル20を容易に入手できることを意味する。したがって、クラッカーXが、入手した配布用ファイル20に対して改竄を施し、これをインターネット等を介して再配布することも容易である。
<<< §2. Specific problems of conventional distribution methods >>
As described in §1, application programs for Android terminals are widely distributed in the form of a distribution file (APK file) 20 as shown in FIG. 1, so that general users U1, U2, U3 It can be easily obtained by downloading it via the Internet or the like. This means that a malicious cracker X can easily obtain the distribution file 20. Therefore, it is easy for the cracker X to tamper with the obtained distribution file 20 and redistribute it via the Internet or the like.

しかも、APKファイルの仕様は広く公開されているため、クラッカーXの立場からすると、改竄も容易であり、かつ、再配布も容易であるという、不正行為が行いやすい環境が整っていることになる。特に、アプリケーションプログラム10を構成する各要素のうち、リソースデータ12や補助ファイル14に対する改竄は非常に容易である。   Moreover, since the specification of the APK file is widely disclosed, from the standpoint of Cracker X, it is easy to tamper with and easy to redistribute. . In particular, it is very easy to tamper with the resource data 12 and the auxiliary file 14 among the elements constituting the application program 10.

たとえば、リソースデータ12を構成する画像データファイルや文字列データファイルは、JPEG形式,GIF形式,BMP形式,PNG形式,XML形式など、ごく一般的なファイルフォーマットで記述されたデータであるため、ファイルの内容を書き換えたり、ファイルを入れ替えるだけで改竄が可能になる。このため、本来の画像を猥褻な画像に入れ替えたり、本来の文字列を不適切な文字列に入れ替えたりする改竄は容易に行い得る。また、「YESボタン」の画像と「NOボタン」の画像とを入れ替えるような改竄が行われると、一見したところ改竄の事実に気づかないが、ユーザの回答入力画面における「YES」と「NO」の表示だけが入れ替わってしまうという重大な支障が生じることになる。   For example, the image data file and the character string data file constituting the resource data 12 are data described in a very general file format such as JPEG format, GIF format, BMP format, PNG format, XML format, etc. Falsification is possible just by rewriting the contents of or changing the file. For this reason, it is possible to easily perform alterations such as replacing the original image with an obscene image or replacing the original character string with an inappropriate character string. In addition, if tampering is performed that replaces the image of the “YES button” and the image of the “NO button”, at first glance, the fact of tampering will not be noticed, but “YES” and “NO” on the user's answer input screen This will cause a serious problem that only the display will be replaced.

一方、補助ファイル14(マニフェストファイル)も、XML形式で記載された判読容易な文字列データによって構成されているため、改竄の対象になりやすい。具体的には、補助ファイル14内には、当該アプリケーションプログラムが、インターネット接続を行うか否か、GPS情報を参照するか否か、電話機能を利用するか否か、といったパーミッション情報が含まれており、この情報が改竄されると、ユーザが許可していない動作が実行されることになる。たとえば、インターネット接続および電話機能の利用を「行う」旨のパーミッション情報をもつアプリケーションプログラムについて、更に、GPS情報の参照を「行う」旨のパーミッション情報を追加するような改竄が行われると、本来のパーミッション情報では許可していない「GPS情報の参照」という動作が実行されることになり、GPS情報が外部に流出するといった被害が発生するおそれがある。   On the other hand, the auxiliary file 14 (manifest file) is also composed of easy-to-read character string data written in the XML format, and thus is easily subject to falsification. Specifically, the auxiliary file 14 includes permission information such as whether the application program makes an Internet connection, whether to reference GPS information, and whether to use a telephone function. If this information is tampered with, an operation not permitted by the user is executed. For example, if an application program that has permission information that “performs” to use the Internet connection and the telephone function is further altered such that permission information that “performs” GPS information is added, The operation of “referencing GPS information”, which is not permitted in the permission information, is executed, and there is a possibility that damage such as leakage of GPS information to the outside may occur.

このような改竄による被害は、ユーザだけではなく、コンテンツプロバイダにまで及ぶ。たとえば、プログラム提供者Aが配布している「PatGame.apk」なるアプリケーションプログラムの評判を聞いたユーザUが、当該プログラムの正規の配布用ファイルの代わりに、改竄されたファイルをダウンロードして実行してしまった場合を考えてみよう。クラッカーXは、通常、元のファイルと同じファイル名で改竄したファイルを再配布するので、「PatGame.apk」というファイル名を確認しただけでは、それが純正のファイルであるのか、改竄されたファイルであるのかを識別することができない。   Damage caused by such tampering extends not only to users but also to content providers. For example, a user U who has heard the reputation of the application program “PatGame.apk” distributed by the program provider A downloads and executes a falsified file instead of the regular distribution file of the program. Let's think about the case. Cracker X usually redistributes a file that has been falsified with the same file name as the original file, so if you just check the file name “PatGame.apk”, whether it is a genuine file or a falsified file Cannot be identified.

この場合、たとえば、プログラム提供者Aの本来のロゴ画像が猥褻な画像に入れ替わっているような顕著な改竄が行われたケースであれば、ユーザは、実行しているアプリケーションプログラムが改竄されたものであると認識することができるであろう。しかしながら、ユーザが改竄に気づかないケースでは、当該アプリケーションプログラムの不具合の責任は、プログラム提供者Aにあると考えるであろう。このような不当な評価がインターネット等を介して流布すると、プログラム提供者Aは風評被害を受けることになる。   In this case, for example, in the case where a noticeable alteration has been made such that the original logo image of the program provider A has been replaced with an obscene image, the user has altered the application program being executed. It can be recognized that However, in the case where the user is unaware of falsification, the program provider A will be responsible for the malfunction of the application program. If such an unfair evaluation is disseminated via the Internet or the like, the program provider A will suffer reputation damage.

もちろん、Androidの仕様によれば、§1で述べたとおり、配布用ファイル20には、アプリケーションパッケージ21とともに署名情報22が付加されており、Android端末では、図3に示す手順に従って、アプリケーションパッケージ21に対する署名情報22の正当性が確認される。したがって、クラッカーXが、リソースデータ12内の画像ファイルや文字列ファイルを別なファイルに差し替えたり、補助ファイル14内のパーミッション情報を書き替えたりしただけでは、図3に示す確認処理において不一致が生じ、改竄の事実を検知することができる。   Of course, according to the specification of Android, as described in §1, signature information 22 is added to the distribution file 20 together with the application package 21, and the application package 21 follows the procedure shown in FIG. The validity of the signature information 22 is confirmed. Therefore, if the cracker X simply replaces the image file or the character string file in the resource data 12 with another file or rewrites the permission information in the auxiliary file 14, a mismatch occurs in the confirmation processing shown in FIG. The fact of tampering can be detected.

すなわち、図3に示す例において、クラッカーXがアプリケーションパッケージ21の内容を書き替えた場合、署名対象データDがD′に変わってしまうため、得られるハッシュ値H2も変わってしまうことになる。その結果、署名対象データDに基づいて作成された署名値S(A)を復号して得られるハッシュ値H1と不一致が生じることになり、改竄の事実が検知される。   That is, in the example shown in FIG. 3, when the cracker X rewrites the contents of the application package 21, the signature target data D changes to D ′, and thus the obtained hash value H2 also changes. As a result, a mismatch occurs with the hash value H1 obtained by decrypting the signature value S (A) created based on the signature target data D, and the fact of falsification is detected.

このように、§1で述べた従来の配布方法では、アプリケーションパッケージ21のみに対して行われた改竄については検知が可能である。しかしながら、署名情報22に対する改竄まで行われてしまうと、これを検知することはできない。以下にその理由を説明する。   As described above, in the conventional distribution method described in §1, it is possible to detect tampering performed only on the application package 21. However, if the signature information 22 has been tampered with, it cannot be detected. The reason will be described below.

ここでは、図1に示すように、プログラム提供者Aが配布した正規の配布用ファイル20を、クラッカーXが入手したものとしよう。図4は、このようにして入手した正規の配布用ファイル20に対して、クラッカーXが試みる改竄プロセスを示すブロック図である。クラッカーXは、まず、入手した配布用ファイル20に含まれるアプリケーションパッケージ21に対して伸張処理を実行し、元のアプリケーションプログラム10を復元する。パッケージ化処理は、基本的にはファイルの圧縮処理であるため、この圧縮処理に応じた伸張処理を行うことにより、元のアプリケーションプログラム10を容易に復元することができる。§1で述べたとおり、アプリケーションプログラム10は、プログラム本体部11,リソースデータ12,サブルーチン群13,補助ファイル14という要素によって構成されている(この他にもいくつかの要素が付加される場合もある)。   Here, it is assumed that the cracker X has obtained the regular distribution file 20 distributed by the program provider A as shown in FIG. FIG. 4 is a block diagram showing a tampering process attempted by cracker X for the regular distribution file 20 obtained in this way. The cracker X first performs decompression processing on the application package 21 included in the obtained distribution file 20 to restore the original application program 10. Since the packaging process is basically a file compression process, the original application program 10 can be easily restored by performing a decompression process corresponding to the compression process. As described in §1, the application program 10 is configured by the elements of the program body 11, the resource data 12, the subroutine group 13, and the auxiliary file 14 (in addition, some elements may be added). is there).

クラッカーXは、これらの各要素に対して改竄を施すことになるが、前述したとおり、リソースデータ12や補助ファイル14に対する改竄は非常に容易であり、データファイルの入れ替えや、テキストデータの書き替えという簡単な作業によって行うことができる。そこで、ここでは、クラッカーXが、図示のとおり、リソースデータ12をリソースデータ12Xに改竄し、補助ファイル14を補助ファイル14Xに改竄したものとしよう。プログラム本体部11およびサブルーチン群13に対する改竄は行われていないが、改竄されたリソースデータ12Xおよび改竄された補助ファイル14Xを含むアプリケーションプログラム10Xは、もはや正常動作を行わないものになっている。   Although the cracker X will tamper with each of these elements, as described above, tampering with the resource data 12 and the auxiliary file 14 is very easy, and data file replacement and text data rewriting are easy. This can be done by a simple task. Therefore, here, it is assumed that the cracker X has altered the resource data 12 to the resource data 12X and the auxiliary file 14 to the auxiliary file 14X as illustrated. Although the program body 11 and the subroutine group 13 have not been tampered with, the application program 10X including the tampered resource data 12X and the tampered auxiliary file 14X no longer performs normal operations.

続いて、クラッカーXは、アプリケーションプログラム10Xに対する再パッケージ化処理を行い、改竄されたアプリケーションパッケージ21Xを生成する。こうして生成したアプリケーションパッケージ21Xを、正規の配布用ファイル20内の正規のアプリケーションパッケージ21とすり替えただけでは、Android端末で行われる通常の改竄検知処理によって改竄の事実が検知されることになる。すなわち、Aの署名情報22の正当性を確認する処理で不一致が生じることになる。   Subsequently, the cracker X performs a repackaging process on the application program 10X, and generates a falsified application package 21X. By simply replacing the generated application package 21X with the regular application package 21 in the regular distribution file 20, the fact of falsification is detected by the normal falsification detection process performed on the Android terminal. That is, a mismatch occurs in the process of confirming the validity of the signature information 22 of A.

ところが、クラッカーXは、改竄されたアプリケーションパッケージ21Xを署名対象データD′として、自分自身を署名者とする署名を行うことにより、Xの署名情報22Xを作成することができる。具体的には、クラッカーXの第1の鍵K(x1)を用いて、署名対象データD′(すなわち、改竄されたアプリケーションパッケージ21X)に対する署名値S(X)を作成する処理を行い、作成された署名値S(X)と、クラッカーXの第2の鍵K(x2)とを含むXの署名情報22Xを作成すればよい。   However, the cracker X can create the signature information 22X of X by performing a signature with the altered application package 21X as the signature target data D ′ and signing itself as the signer. Specifically, using the first key K (x1) of the cracker X, a process for creating a signature value S (X) for the signature target data D ′ (that is, the altered application package 21X) is performed. The signature information 22X of X including the signature value S (X) thus made and the second key K (x2) of the cracker X may be created.

プログラム提供者Aが、第1の鍵K(a1)を秘密鍵として管理していれば、クラッカーXは、Aの第1の鍵K(a1)を入手することができないので、クラッカーXが、改竄された署名対象データD′に対して、署名者Aとして署名を行うことはできない。しかしながら、クラッカーXは、自分自身の第1の鍵K(x1)を用いて、署名者Xとして署名を行うことは可能であり、そのようにして得られた署名値S(X)に、自分自身の第2の鍵K(x2)を付加して、Xの署名情報22Xを作成することはできる。こうして作成された署名情報22Xは、いわばクラッカーXによる再署名というべき情報であり、改竄されたアプリケーションパッケージ21Xに対して正当性を有している。   If the program provider A manages the first key K (a1) as a secret key, the cracker X cannot obtain the first key K (a1) of A. The signer A cannot sign the tampered signature target data D ′. However, the cracker X can sign as the signer X using the first key K (x1) of his / her own, and the signature value S (X) obtained in this way is added to the cracker X. It is possible to create X signature information 22X by adding its own second key K (x2). The signature information 22X created in this way is information that should be called a resignature by the cracker X, and has validity for the falsified application package 21X.

こうして、クラッカーXが、改竄されたアプリケーションパッケージ21XにXの署名情報22Xを付加すれば、改竄された配布用ファイル20Xを得ることができる。そして、この配布用ファイル20Xを、「PatGame.apk」なるファイル名をもったAPKファイルとして再配布すれば、一見したところ、正規のAPKファイルと区別できない改竄されたファイルを流布させることができる。   Thus, if the cracker X adds the X signature information 22X to the altered application package 21X, the altered distribution file 20X can be obtained. If the distribution file 20X is redistributed as an APK file having the file name “PatGame.apk”, it is possible to disseminate a falsified file that cannot be distinguished from a regular APK file at first glance.

Androidの仕様は広く公開されており、APKファイルの作成作業を支援するための様々なツールも広く普及している。たとえば、アプリケーションプログラム10をパッケージ化してアプリケーションパッケージ21を作成するツール、アプリケーションパッケージ21に任意の者の署名情報22を付加してAPKファイル20を作成するツール、APKファイル20内のアプリケーションパッケージ21を伸張して元のアプリケーションプログラム10を復元するツールなどは、インターネット上の様々なサイトから入手可能であり、クラッカーXは、これらのツールを利用して、図4に示す改竄プロセスを実行し、改竄されたAPKファイル20Xを作成することができる。   Android specifications are widely available, and various tools for supporting the creation of APK files are also widely used. For example, a tool for creating the application package 21 by packaging the application program 10, a tool for creating the APK file 20 by adding the signature information 22 of an arbitrary person to the application package 21, and decompressing the application package 21 in the APK file 20 Tools for restoring the original application program 10 can be obtained from various sites on the Internet, and the cracker X uses these tools to execute the falsification process shown in FIG. An APK file 20X can be created.

このように、アプリケーションパッケージ21に対する改竄とともに、署名情報22に対する改竄が行われた場合、図3に示す従来の改竄検知方法では、改竄の検知を行うことができない。すなわち、図4に示す配布用ファイル20Xにおいて、Xの署名情報22Xは、アプリケーションパッケージ21Xを署名対象データD′としてクラッカーXが署名を行うことによって得られた情報であるから、図3に示す従来の改竄検知方法では何ら支障なく一致確認が得られることになる。したがって、一般ユーザUが、改竄された配布用ファイル20XをAndroid端末にダウンロードして実行すれば、改竄されたアプリケーションプログラム10Xは、正規のアプリケーションプログラムとして実行されてしまうことになる。   In this way, when the signature information 22 is tampered with the application package 21, the conventional tampering detection method shown in FIG. 3 cannot detect tampering. That is, in the distribution file 20X shown in FIG. 4, the X signature information 22X is information obtained by the cracker X signing with the application package 21X as the signature target data D ′. In this tamper detection method, a coincidence confirmation can be obtained without any trouble. Therefore, if the general user U downloads the falsified distribution file 20X to the Android terminal and executes it, the falsified application program 10X is executed as a regular application program.

このように、改竄されたアプリケーションパッケージ21に対してクラッカーXによる再署名が行われ、この再署名によって得られた署名情報による差し替えが行われてしまうと、署名情報の正当性は確保されてしまうため、Android端末の一般的な改竄検知機能によっては改竄の検知を行うことができない。これは、Androidの仕様が、そもそも署名者の身元まで確認した改竄検知を行うようになっていないためである。すなわち、Android端末は、正規のコンテンツプロバイダーであるプログラム提供者AとクラッカーXとを区別することはできないので、署名者がAであろうがXであろうが、署名対象データと署名情報との間に整合性が確認できれば、改竄なしと判断せざるを得ない。   As described above, if the altered application package 21 is re-signed by the cracker X and replaced by the signature information obtained by the re-signing, the validity of the signature information is ensured. For this reason, it is not possible to detect falsification using the general falsification detection function of Android devices. This is because the Android specification doesn't detect falsification by checking the identity of the signer in the first place. That is, since the Android terminal cannot distinguish between the program provider A and the cracker X, which are legitimate content providers, the signer is either A or X, but the data to be signed and the signature information If consistency can be confirmed in the meantime, it must be judged that there is no falsification.

もちろん、認証サーバなどへ問い合わせを行えば、署名者の身元確認を行うことができる。官公庁への電子申請や電子商取引などを行う場合、通常、認証サーバなどへ問い合わせを行い、署名者の身元確認を行う処理が行われる。しかしながら、Android端末の場合、少なくともアプリケーションプログラムを実行する際の改竄判定処理では、署名者の身元確認まで行う仕様にはなっていない。これは、Android端末がオフライン状態(外部の認証サーバへの問い合わせができない状態)であっても、アプリケーションプログラムを支障なく実行できるようにするためだと思われる。   Of course, the identity of the signer can be confirmed by making an inquiry to the authentication server or the like. When an electronic application to a public office or an electronic commerce is performed, a process of inquiring an authentication server and confirming the identity of the signer is usually performed. However, in the case of an Android terminal, at least the falsification determination process at the time of executing the application program is not designed to perform the identity verification of the signer. This seems to make it possible to run application programs without any trouble even when the Android device is offline (inquiries to external authentication servers are not possible).

このように、署名情報の一致確認は行うものの、署名者の身元確認までは行わない端末装置に対してアプリケーションプログラムを配信する場合に、署名情報に対する改竄までが行われてしまうと、有効な改竄検知を行うことができない。本発明は、このような問題に対処するための新たなアプリケーションプログラムの効果的な配布実行方法を提供するものである。   As described above, when an application program is distributed to a terminal device that performs signature information match verification but does not perform identity verification of the signer, if the signature information is falsified, effective falsification is performed. Detection cannot be performed. The present invention provides an effective method for distributing and executing a new application program to cope with such problems.

<<< §3.本発明の基本的な実施形態に係る配布実行方法 >>>
ここに示す基本的な実施形態の原理は、図1に示す配布用ファイル20において、配布前に、Aの署名情報22についての何らかのマーキングを行っておき、実行時には、このマーキングを利用して、Aの署名情報22に対する改竄の有無を検知する、というものである。クラッカーXが、図4に示す方法で、Aの署名情報22をXの署名情報22Xにすり替えたとしても、Aの署名情報22に関する何らかの痕跡をマーキングしておけば、署名情報のすり替えを検知することができる。
<<< §3. Distribution execution method according to basic embodiment of the present invention >>
The principle of the basic embodiment shown here is that the distribution file 20 shown in FIG. 1 performs some marking on the signature information 22 of A before distribution, and at the time of execution, uses this marking. In other words, whether or not the signature information 22 of A is falsified is detected. Even if the cracker X replaces the signature information 22 of A with the signature information 22X of X by the method shown in FIG. 4, it is detected that the signature information is replaced if any traces related to the signature information 22 of A are marked. be able to.

もっとも、このマーキングの内容がクラッカーXに察知されてしまうと、マーキングを含めた改竄が行われてしまうことになる。そこで、本発明では、マーキング対象を特定の方法で秘匿化するようにし、クラッカーXにマーキングの内容が察知されないようにするとともに、秘匿化された情報に基づいてマーキングの内容の正当性を確認する改竄チェックルーチンを、アプリケーションプログラム10自身に組み込むという手法を採る。以下、その基本原理を詳細に説明する。   However, if the content of the marking is detected by the cracker X, tampering including the marking is performed. Therefore, in the present invention, the marking target is concealed by a specific method so that the cracker X does not detect the marking content, and the validity of the marking content is confirmed based on the concealed information. A method of incorporating a falsification check routine into the application program 10 itself is adopted. Hereinafter, the basic principle will be described in detail.

図5は、本発明の基本的な実施形態に係るアプリケーションプログラムの配布方法の基本原理を示すブロック図である。この方法では、プログラム提供者Aは、図1に示すアプリケーションプログラム10の代わりに、図5に示すアプリケーションプログラム10Aを用意し、これをパッケージ化してアプリケーションパッケージ21Aを作成する。アプリケーションプログラム10Aは、アプリケーションプログラム10内のプログラム本体部11をプログラム本体部11Aに置き換え、サブルーチン群13をサブルーチン群13Aに置き換えたものである。   FIG. 5 is a block diagram showing the basic principle of the application program distribution method according to the basic embodiment of the present invention. In this method, the program provider A prepares an application program 10A shown in FIG. 5 instead of the application program 10 shown in FIG. 1, and packages it to create an application package 21A. The application program 10A is obtained by replacing the program body 11 in the application program 10 with the program body 11A, and replacing the subroutine group 13 with the subroutine group 13A.

サブルーチン群13Aは、サブルーチン群13に、改竄チェックルーチンFを付加したものである。この改竄チェックルーチンFは、後述するアルゴリズムに基づいて、Aの署名情報22Aが改竄されているかどうかを確認する機能をもったサブルーチンプログラムであり、第1の特定鍵K(s1)を内蔵している。この第1の特定鍵K(s1)は、Aの署名情報22Aの改竄の有無を調べるために必須の鍵になる。   The subroutine group 13A is obtained by adding a falsification check routine F to the subroutine group 13. The falsification check routine F is a subroutine program having a function of confirming whether or not the signature information 22A of A is falsified based on an algorithm to be described later, and includes a first specific key K (s1). Yes. This first specific key K (s1) is an indispensable key for checking whether or not the signature information 22A of A is falsified.

一方、プログラム本体部11Aは、プログラム本体部11の所定箇所に、改竄チェックルーチンFをコールするサブルーチンコール命令と、改竄チェックルーチンFから「改竄あり」との判定結果が返された場合に、以後の命令群の実行を中止する命令と、を挿入したものである。したがって、改竄チェックルーチンFから「改竄なし」との判定結果が返された場合には、プログラム本体部11Aは、以後の命令群の実行を引き続き実行することになるが、改竄チェックルーチンFから「改竄あり」との判定結果が返された場合には、以後の命令群の実行は中止され、アプリケーションプログラム10Aは終了することになる。   On the other hand, the program body 11A, when a subroutine call instruction for calling the falsification check routine F and a determination result “falsification exists” are returned from the falsification check routine F to a predetermined location of the program body 11 And an instruction to stop execution of the instruction group. Therefore, when the determination result “No falsification” is returned from the falsification check routine F, the program body 11A continues to execute the subsequent instruction group. When the determination result “has falsification” is returned, the subsequent execution of the instruction group is stopped and the application program 10A is terminated.

結局、アプリケーションプログラム10Aは、基本的には、アプリケーションプログラム10と同等の処理機能をもったプログラムであるが、改竄チェックルーチンFを利用した自己改竄チェック機能が付加されたプログラムと言うことができる。Android端末において、このアプリケーションプログラム10Aが実行されると、改竄チェックルーチンFによる改竄チェック処理が実行され、署名情報22Aに対する改竄の有無が判定される。そして、改竄ありとの判定結果が得られた場合には、アプリケーションプログラム10Aの実行は中止されることになる。したがって、実用上は、プログラム本体部11Aにおけるアプリケーションプログラム本来の機能を果たすための命令群の前に、改竄チェックルーチンFをコールするサブルーチンコール命令を組み込むようにし、アプリケーションプログラム10Aの実行初期段階で改竄チェックルーチンFが実行されるようにするのが好ましい。   After all, the application program 10A is basically a program having a processing function equivalent to that of the application program 10, but can be said to be a program to which a self-falsification check function using a falsification check routine F is added. When the application program 10A is executed in the Android terminal, the falsification check process by the falsification check routine F is executed to determine whether or not the signature information 22A has been falsified. Then, when the determination result that there is falsification is obtained, the execution of the application program 10A is stopped. Therefore, in practice, a subroutine call instruction for calling the falsification check routine F is incorporated in front of the instruction group for performing the original function of the application program in the program main body 11A, and falsification is performed at the initial stage of execution of the application program 10A. The check routine F is preferably executed.

続いて、§1で述べた従来方法と同様に、パッケージ化によって得られたアプリケーションパッケージ21Aを署名対象データDとして、プログラム提供者Aの第1の鍵K(a1)を用いた暗号化を利用した電子署名処理を行って署名値S(A)を生成し、この署名値S(A)とプログラム提供者Aの第2の鍵K(a2)とを含む署名情報22Aを作成する。   Subsequently, similarly to the conventional method described in §1, the encryption using the program provider A's first key K (a1) is used with the application package 21A obtained by packaging as the signature target data D. The digital signature process is performed to generate a signature value S (A), and signature information 22A including the signature value S (A) and the second key K (a2) of the program provider A is created.

ここで述べる基本的な実施形態では、更に、Aの署名情報22Aを秘匿化対象データCとして抽出し(図5では、秘匿化対象データCを太線枠で示す)、この秘匿化対象データCに対して第2の特定鍵K(s2)を用いた秘匿化処理を施して秘匿情報23Aを作成する。秘匿化処理の具体的な方法は、§6で実例を挙げて説明するが、第2の特定鍵K(s2)を用いた何らかの演算処理によって、元の秘匿化対象データCに対して一義的に秘匿情報23Aを決定することができる処理であって、この第2の特定鍵K(s2)に対して特別な関係をもった第1の特定鍵K(s1)(すなわち、改竄チェックルーチンFに内蔵されている鍵)を用いることによってのみ、秘匿化対象データCに対する秘匿情報23Aの正当性が確認できる、という条件を満たす処理であれば、どのような処理を秘匿化処理として採用してもかまわない(後述するように、第1の特定鍵K(s1)および第2の特定鍵K(s2)として、同一の共通特定鍵K(s0)を用いることも可能である)。   In the basic embodiment described here, the signature information 22A of A is further extracted as the data to be concealed C (in FIG. 5, the data to be concealed C is indicated by a thick line frame). On the other hand, the concealment process using the second specific key K (s2) is performed to create the concealment information 23A. A specific method of the concealment process will be described with reference to an example in §6. The first specific key K (s1) having a special relationship with the second specific key K (s2) (that is, the falsification check routine F) As long as the process satisfies the condition that the validity of the confidential information 23A with respect to the data C to be concealed can be confirmed only by using a key embedded in the data, any process is adopted as the concealment process. (As will be described later, the same common specific key K (s0) may be used as the first specific key K (s1) and the second specific key K (s2)).

こうして、秘匿情報23Aが作成できたら、プログラム提供者Aは、アプリケーションパッケージ21Aと、Aの署名情報22Aと、秘匿情報23Aと、を含む配布用ファイル20Aを作成し、これをAPKファイルとして配布すればよい。ここで、Aの署名情報22Aは、アプリケーションパッケージ21Aが改竄されていないことを確認するために用いられるプログラム提供者Aによる電子署名であり、秘匿情報23Aは、このAの署名情報22Aが改竄されていないことを確認するために用いられるマーキング情報ということになる。Android端末では、Aの署名情報22Aの正当性を確認するとともに、秘匿情報23Aの正当性を確認することにより、アプリケーションパッケージ21Aに対する改竄のみならず、Aの署名情報22Aに対する改竄を検知することができる。   When the confidential information 23A is created in this way, the program provider A creates a distribution file 20A including the application package 21A, the signature information 22A of the A, and the confidential information 23A, and distributes it as an APK file. That's fine. Here, the A signature information 22A is an electronic signature by the program provider A used to confirm that the application package 21A has not been tampered with, and the confidential information 23A is the A signature information 22A that has been tampered with. This is marking information that is used to confirm that it is not. The Android terminal can detect not only the application package 21A but also the A signature information 22A by checking the validity of the A signature information 22A and the validity of the confidential information 23A. it can.

図6は、図5に示す配布用ファイル20Aについて、署名情報22Aの正当性および秘匿情報23Aの正当性を確認する処理を示すブロック図である。ユーザUが、Android端末に配布用ファイル20Aをインストールし、これを実行しようとすると、アプリケーションプログラム10Aの実行前に、AndroidOSの基本機能により、Aの署名情報22Aの正当性を確認する処理が実行される。   FIG. 6 is a block diagram showing processing for confirming the validity of the signature information 22A and the validity of the confidential information 23A for the distribution file 20A shown in FIG. When the user U installs the distribution file 20A on the Android terminal and tries to execute it, a process for confirming the validity of the signature information 22A of A is executed by the basic function of the Android OS before executing the application program 10A. Is done.

すなわち、§1でも述べたように、まず、署名情報22Aから署名値S(A)およびAの第2の鍵K(a2)を抽出し、署名値S(A)に対してAの第2の鍵K(a2)を用いた復号処理を行うことにより、ハッシュ値H1を得る処理が行われる。続いて、アプリケーションパッケージ21A(署名対象データD)に対して、ハッシュ関数HASHを作用させた不可逆変換を行い、ハッシュ値H2を求める処理を行う。そして、ハッシュ値H1とハッシュ値H2とが一致するか否かを確認する処理を行う。ここでは、このような確認処理のプロセスを第1の確認段階と呼ぶことにする。この第1の確認段階では、アプリケーションパッケージ21Aに対する署名情報22Aの正当性を確認する処理が行われることになる。   That is, as described in §1, first, the signature value S (A) and the second key K (a2) of A are extracted from the signature information 22A, and the second value of A is extracted from the signature value S (A). The process of obtaining the hash value H1 is performed by performing the decryption process using the key K (a2). Subsequently, the application package 21A (signature target data D) is subjected to an irreversible transformation using a hash function HASH to obtain a hash value H2. And the process which confirms whether the hash value H1 and the hash value H2 correspond is performed. Here, such a confirmation process is referred to as a first confirmation stage. In the first confirmation stage, processing for confirming the validity of the signature information 22A for the application package 21A is performed.

AndroidOSは、この第1の確認段階によって、署名情報22Aの正当性が確認できた場合、アプリケーションパッケージ21Aは改竄されていないものと判断し、そこに含まれているアプリケーションプログラム10Aを実行する。ただ、アプリケーションプログラム10Aの構成要素となるプログラム本体部11Aには、前述したとおり、改竄チェックルーチンFをコールするサブルーチンコール命令が組み込まれているため、アプリケーションプログラム10Aの実行により、改竄チェックルーチンFが実行されることになる。   If the legitimacy of the signature information 22A can be confirmed in the first confirmation stage, the Android OS determines that the application package 21A has not been tampered with, and executes the application program 10A included therein. However, since the subroutine call instruction for calling the falsification check routine F is incorporated in the program body 11A, which is a component of the application program 10A, as described above, the falsification check routine F is executed by executing the application program 10A. Will be executed.

ここで、改竄チェックルーチンFは、内蔵している第1の特定鍵K(s1)を利用して、秘匿化対象データC(この例の場合は、Aの署名情報22A)に対する秘匿情報23Aの正当性を確認する処理を行う。ここでは、このような確認処理のプロセスを第2の確認段階と呼ぶことにする。前述したとおり、秘匿情報23Aは、秘匿化対象データCに対して第2の特定鍵K(s2)を用いた秘匿化処理を施して得られた情報であり、秘匿化対象データC(Aの署名情報22A)に対する秘匿情報23Aの正当性は、第1の特定鍵K(s1)を用いて確認することができる。   Here, the tampering check routine F uses the first specific key K (s1) built in to store the confidential information 23A for the confidential data C (in this example, the signature information 22A of A). A process for confirming validity is performed. Here, such a confirmation process is referred to as a second confirmation stage. As described above, the concealment information 23A is information obtained by performing concealment processing using the second specific key K (s2) on the concealment target data C, and the concealment target data C (A The validity of the confidential information 23A with respect to the signature information 22A) can be confirmed using the first specific key K (s1).

改竄チェックルーチンFは、こうして実行された第2の確認段階の結果を、サブルーチンの実行結果としてプログラム本体部11Aへと返すことになる。プログラム本体部11Aは、改竄チェックルーチンFから肯定的な判定結果(秘匿情報23Aの正当性が確認された旨の判定結果)が返された場合には、以後の命令群を引き続き実行することになるが、否定的な実行結果(秘匿情報23Aの正当性が確認されなかった旨の判定結果)が返された場合には、以後の命令群の実行を中止する。   The falsification check routine F returns the result of the second confirmation stage executed in this way to the program main body 11A as the execution result of the subroutine. When a positive determination result (determination result indicating that the validity of the confidential information 23A is confirmed) is returned from the falsification check routine F, the program body 11A continues to execute the subsequent instruction group. However, if a negative execution result (determination result that the validity of the confidential information 23A has not been confirmed) is returned, the subsequent execution of the instruction group is stopped.

かくして、Android端末では、第1の確認段階において、アプリケーションパッケージ21Aに対する署名情報22Aの正当性が確認され、かつ、第2の確認段階において、署名情報22Aに対する秘匿情報23Aの正当性が確認された場合にのみ、アプリケーションプログラム10Aは正常に実行されることになる。   Thus, in the Android terminal, the validity of the signature information 22A for the application package 21A is confirmed in the first confirmation stage, and the validity of the confidential information 23A for the signature information 22A is confirmed in the second confirmation stage. Only in this case, the application program 10A is normally executed.

図7は、ここに示す基本的な実施形態の基本手順を示す流れ図である。この基本手順は、アプリケーションプログラムを配布する配布プロセスと、配布されたアプリケーションプログラムを実行する実行プロセスと、によって構成されるアプリケーションプログラムの配布実行方法の手順ということになる。図示のとおり、前半の配布プロセスでは、ステップS1〜S5の各段階が実行され、後半の実行プロセスでは、ステップS6〜S12の各段階が実行される。以下、これら各ステップの内容を順に説明する。   FIG. 7 is a flowchart showing the basic procedure of the basic embodiment shown here. This basic procedure is a procedure of an application program distribution execution method constituted by a distribution process for distributing an application program and an execution process for executing the distributed application program. As illustrated, in the first half of the distribution process, steps S1 to S5 are executed, and in the second half of the execution process, steps S6 to S12 are executed. Hereinafter, the contents of these steps will be described in order.

ここでは、便宜上、前半の配布プロセス(ステップS1〜S5)は、プログラム提供者Aが利用するコンピュータによって実行され、後半の実行プロセス(ステップS6〜S12)は、ユーザUが利用するアプリケーション実行用コンピュータ(スマートホンなどのAndroid端末)によって実行されるものとして以下の説明を行うことにする。なお、前半の配布プロセスを構成するステップS1〜S5は、必ずしも同一のコンピュータで実行する必要はないが、後半の実行プロセスを構成するステップS6〜S12は、ユーザUが利用する同一のアプリケーション実行用コンピュータにおいて実行されることになる。   Here, for convenience, the first half distribution process (steps S1 to S5) is executed by a computer used by the program provider A, and the second half execution process (steps S6 to S12) is an application execution computer used by the user U. The following description will be given on the assumption that it is executed by (an Android terminal such as a smart phone). The steps S1 to S5 constituting the first half of the distribution process are not necessarily executed by the same computer, but the steps S6 to S12 constituting the second half of the execution process are for executing the same application used by the user U. It will be executed on the computer.

まず、ステップS1のパッケージ化段階では、図5に示すように、第1の特定鍵K(s1)を含むアプリケーションプログラム10Aに対して、少なくとも圧縮処理を含むパッケージ化処理を施し、アプリケーションパッケージ21Aを作成する処理が行われる。ここで、パッケージ化処理の対象となるアプリケーションプログラム10Aには、図6に示す第2の確認段階を実行するための改竄チェックルーチンFが含まれており、第1の特定鍵K(s1)は、この改竄チェックルーチンF内に含まれている。   First, in the packaging stage of step S1, as shown in FIG. 5, the application program 10A including the first specific key K (s1) is subjected to packaging processing including at least compression processing, and the application package 21A is obtained. Processing to create is performed. Here, the application program 10A to be packaged includes an alteration check routine F for executing the second confirmation stage shown in FIG. 6, and the first specific key K (s1) is This is included in the falsification check routine F.

特に、Android端末に配布する場合は、その仕様により、アプリケーションプログラム10Aには、プログラム本体部11Aと、このプログラム本体部11Aから呼び出されるサブルーチン群13Aと、画像および文字列を含むリソースデータ12と、XML形式のデータからなる補助ファイル14(マニフェストファイル)とが含まれることになり、ステップS1のパッケージ化段階では、ZIP方式の圧縮処理を含むパッケージ化処理が実行されることになる。   In particular, when distributed to Android terminals, according to the specifications, the application program 10A includes a program main body 11A, a subroutine group 13A called from the program main body 11A, resource data 12 including images and character strings, An auxiliary file 14 (manifest file) made up of XML format data is included, and in the packaging stage of step S1, packaging processing including ZIP compression processing is executed.

続くステップS2の署名情報作成段階では、図5に示すように、ステップS1で作成されたアプリケーションパッケージ21Aを署名対象データDとして、プログラム提供者Aの第1の鍵K(a1)を用いた暗号化を利用した電子署名処理を行って署名値S(A)を生成し、この署名値S(A)とプログラム提供者Aの第2の鍵K(a2)とを含むAの署名情報22Aを作成する処理が実行される。ここで、プログラム提供者Aの第1の鍵K(a1)および第2の鍵K(a2)としては、公開鍵暗号方式に利用される一対の鍵、すなわち、一方の鍵を用いて暗号化したデータを他方の鍵を用いて復号できる性質をもった一対の鍵が用いられる。   In the subsequent signature information creation stage of step S2, as shown in FIG. 5, the application package 21A created in step S1 is used as signature target data D, and encryption using the first key K (a1) of the program provider A is performed. A signature value S (A) is generated by performing an electronic signature process using the encryption, and A signature information 22A including the signature value S (A) and the second key K (a2) of the program provider A is obtained. The process to create is executed. Here, as the first key K (a1) and the second key K (a2) of the program provider A, a pair of keys used in the public key cryptosystem, that is, encryption using one key is performed. A pair of keys having a property that the decrypted data can be decrypted using the other key is used.

次に、ステップS3の秘匿情報作成段階では、Aの署名情報22Aを秘匿化対象データCとして抽出し、抽出した秘匿化対象データCに対して第2の特定鍵K(s2)を用いた秘匿化処理を施して秘匿情報23Aを作成する処理が実行される。ここで、第1の特定鍵K(s1)および第2の特定鍵K(s2)としては、一方の鍵を用いて秘匿化処理を施したデータの正当性を他方の鍵を用いて確認できる性質をもった一対の鍵が用いられる(後述するように、両者は同一の共通鍵でもかまわない)。   Next, in the secret information creation stage of step S3, the signature information 22A of A is extracted as the concealment target data C, and concealment using the second specific key K (s2) is performed on the extracted concealment target data C. The process of creating the confidential information 23A by performing the conversion process is executed. Here, as the first specific key K (s1) and the second specific key K (s2), the validity of the data subjected to the concealment process using one key can be confirmed using the other key. A pair of keys having properties is used (both may be the same common key as described later).

このステップS3で実行する秘匿化処理としては、前述したとおり、第2の特定鍵K(s2)を用いた何らかの演算処理によって、元の秘匿化対象データCに対して一義的に秘匿情報23Aを決定することができる処理であって、第1の特定鍵K(s1)を用いることによってのみ、秘匿化対象データCに対する秘匿情報23Aの正当性が確認できる、という条件を満たす処理であれば、どのような処理であってもかまわない。秘匿化処理の具体例は§6で例示する。   As the concealment process executed in step S3, as described above, the concealment information 23A is uniquely set to the original concealment target data C by some arithmetic process using the second specific key K (s2). If it is a process that can be determined and satisfies the condition that only the first specific key K (s1) can be used to confirm the validity of the confidential information 23A with respect to the concealment target data C, Any processing is acceptable. A specific example of the concealment process is illustrated in §6.

一方、ステップS4の配布用ファイル作成段階では、ステップS1で作成されたアプリケーションパッケージ21Aと、ステップS2で作成された署名情報22Aと、ステップS3で作成された秘匿情報23Aと、をまとめることにより、配布用ファイル20Aが作成される。Android端末に配布する場合は、この配布用ファイル作成段階において、APK形式のフォーマットをもった配布用ファイル20A(拡張子.apkが付されたAPKファイル)が作成されることになる。   On the other hand, in the distribution file creation stage in step S4, the application package 21A created in step S1, the signature information 22A created in step S2, and the confidential information 23A created in step S3 are collected. A distribution file 20A is created. When distributing to an Android terminal, a distribution file 20A (APK file with an extension .apk) having an APK format is generated at the distribution file creation stage.

なお、APKファイルの実体は、ZIP方式の圧縮フォーマットで圧縮されたファイルであるので、ステップS4の配布用ファイル作成段階でAPKファイルを作成する場合は、ZIP方式の圧縮フォーマットにおけるコメント領域に秘匿情報23Aを記録することができる。このコメント領域は、本来、APKファイルの作成者が、任意のコメント文を記載できるようにするために設けられた領域であるから、秘匿情報23Aを構成するデータをコメント文の代わりに記録しても、何ら支障は生じない。別言すれば、コメント領域に秘匿情報23Aを記録した本発明に係る配布用ファイル20Aは、Androidの仕様に合致したAPKファイルとしての条件を満たしており、そのままAndroid端末に配布しても何ら支障はなく、AndroidOSによって、仕様通りのAPKファイルとして取り扱われることになる。   Since the APK file is a file compressed in the ZIP compression format, when the APK file is created in the distribution file creation stage in step S4, the confidential information is stored in the comment area in the ZIP compression format. 23A can be recorded. Since this comment area is originally an area provided so that the creator of the APK file can write an arbitrary comment sentence, the data constituting the confidential information 23A is recorded instead of the comment sentence. However, no trouble occurs. In other words, the distribution file 20A according to the present invention in which the confidential information 23A is recorded in the comment area satisfies the conditions as an APK file that conforms to the specifications of Android, and can be distributed to an Android terminal as it is. Rather, it will be handled as an APK file by AndroidOS.

配布プロセスの最後には、ステップS5のファイル出力段階が行われる。この段階では、ステップS4で作成された配布用ファイル20A(ここに示す例の場合、Androidの仕様通りのAPKファイル)が配布のために出力されることになる。たとえば、配布用のWebサーバなどに出力すれば、配布用ファイル20Aはインタネットを介して一般ユーザへ配布されることになり、光学的記録媒体やICメモリ等の物理的記録媒体に記録して出力すれば、配布用ファイル20Aは、このような物理的記録媒体に格納された状態で配布されることになる。   At the end of the distribution process, the file output stage of step S5 is performed. At this stage, the distribution file 20A created in step S4 (in the example shown here, an APK file according to the Android specification) is output for distribution. For example, if output to a distribution Web server or the like, the distribution file 20A is distributed to general users via the Internet, and is recorded and output on a physical recording medium such as an optical recording medium or IC memory. Then, the distribution file 20A is distributed in a state stored in such a physical recording medium.

続いて、後半の実行プロセスについて説明する。まず、ステップS6のファイル入力段階では、ユーザUが利用するアプリケーション実行用コンピュータによって、前半の配布プロセスによって配布された配布用ファイル20Aが入力される。たとえば、ユーザUがAndroid端末を利用している場合、APKファイルの配布サイトからインターネット経由で配布用ファイル20Aをダウンロードする指示を与えることにより、当該Android端末に配布用ファイル20Aが取り込まれることになり、更に、ユーザUの了承を得て、配布用ファイル20Aのインストールが行われることになる。Android端末の場合、このような処理は、OSプログラムの基本機能によって実行される。   Next, the second half execution process will be described. First, in the file input stage of step S6, the distribution file 20A distributed by the first half distribution process is input by the application execution computer used by the user U. For example, when the user U is using an Android terminal, the distribution file 20A is taken into the Android terminal by giving an instruction to download the distribution file 20A from the APK file distribution site via the Internet. Further, with the consent of the user U, the distribution file 20A is installed. In the case of an Android terminal, such processing is executed by the basic function of the OS program.

続くステップS7以降の各段階は、ユーザUもしくは他のアプリケーションやサービスが、ステップS6でインストールしたアプリケーションプログラム(配布用ファイル20A)について、実行指示を与えた場合に行われる(第1のアプリケーションプログラムが、第2のアプリケーションプログラムを起動する機能を有しているケースでは、ユーザUが、当該第1のアプリケーションプログラムの実行指示を与えた時点ではなく、その後、当該第1のアプリケーションプログラムが、当該第2のアプリケーションプログラムを起動する処理を実行した時点で、ステップS7以降の各段階が行われることになる。)。   The subsequent steps after step S7 are performed when the user U or another application or service gives an execution instruction for the application program (distribution file 20A) installed in step S6 (the first application program is changed). In the case of having the function of starting the second application program, not when the user U gives an instruction to execute the first application program, but after that, the first application program When the process of starting the application program 2 is executed, the steps after step S7 are performed.)

まず、ステップS7では、図6に示す第1の確認段階が行われる。この第1の確認段階では、アプリケーションパッケージ21Aに対する署名情報22Aの正当性を確認する処理が行われる。すなわち、ステップS6で入力した配布用ファイル20Aについて、Aの署名情報22Aに含まれているプログラム提供者Aの第2の鍵K(a2)を用いた復号を利用した署名確認処理を行って、アプリケーションパッケージ21Aに対する署名情報22Aの正当性が確認される。   First, in step S7, the first confirmation stage shown in FIG. 6 is performed. In the first confirmation stage, processing for confirming the validity of the signature information 22A for the application package 21A is performed. That is, for the distribution file 20A input in step S6, a signature verification process using decryption using the second key K (a2) of the program provider A included in the A signature information 22A is performed. The validity of the signature information 22A for the application package 21A is confirmed.

具体的には、図6を用いて説明したように、署名情報22Aから署名値S(A)およびAの第2の鍵K(a2)を抽出し、署名値S(A)に対してAの第2の鍵K(a2)を用いた復号処理を行うことによりハッシュ値H1を求め、アプリケーションパッケージ21A(署名対象データD)に対して、ハッシュ関数HASHを作用させた不可逆変換を行いハッシュ値H2を求め、ハッシュ値H1とハッシュ値H2との一致確認が行われることになる。Android端末の場合、この第1の確認段階も、OSプログラムの基本機能によって実行される。   Specifically, as described with reference to FIG. 6, the signature value S (A) and the second key K (a2) of A are extracted from the signature information 22A, and A is applied to the signature value S (A). A hash value H1 is obtained by performing a decryption process using the second key K (a2), and an irreversible transformation is performed on the application package 21A (signature target data D) by applying a hash function HASH. H2 is obtained, and a match between the hash value H1 and the hash value H2 is confirmed. In the case of an Android terminal, this first confirmation stage is also executed by the basic function of the OS program.

ステップS7の第1の確認段階において肯定的な結果が得られた場合、すなわち、アプリケーションパッケージ21Aに対する署名情報22Aの正当性が確認された場合には、ステップS8を経てステップS9へと進み、第2の確認段階が実行される。これに対して、ステップS7の第1の確認段階において否定的な結果が得られた場合、すなわち、アプリケーションパッケージ21Aに対する署名情報22Aの正当性が確認されなかった場合には、「改竄あり」との判定がなされ、ステップS8を経てステップS11へと進み、当該アプリケーションの実行は中止される。   If a positive result is obtained in the first confirmation stage of step S7, that is, if the validity of the signature information 22A for the application package 21A is confirmed, the process proceeds to step S9 via step S8, Two confirmation steps are performed. On the other hand, if a negative result is obtained in the first confirmation stage of step S7, that is, if the validity of the signature information 22A for the application package 21A is not confirmed, “There is falsification”. The process proceeds to step S11 via step S8, and the execution of the application is stopped.

Android端末の場合、ステップS8の分岐処理もOSプログラムの基本機能によって実行される。すなわち、ステップS7で肯定的な結果が得られた場合は、OSプログラムはアプリケーションプログラム10Aを起動する処理を行い、ステップS7で否定的な結果が得られた場合は、OSプログラムはアプリケーションプログラム10Aの起動を中止する。このような処理は、AndroidOSの標準仕様に基づく処理である。   In the case of an Android terminal, the branch process in step S8 is also executed by the basic function of the OS program. That is, when a positive result is obtained in step S7, the OS program performs a process of starting the application program 10A, and when a negative result is obtained in step S7, the OS program is the application program 10A. Cancel startup. Such processing is processing based on the standard specification of AndroidOS.

ステップS9では、図6に示す第2の確認段階が行われる。この第2の確認段階では、署名情報22Aに対する秘匿情報23Aの正当性を確認する処理が行われる。すなわち、ステップS6で入力した配布用ファイル20Aから、秘匿化対象データCとなるAの署名情報22Aおよび秘匿情報23Aを抽出し、秘匿化対象データCに対する秘匿情報23Aの正当性が確認される。実際には、アプリケーションパッケージ21Aを伸張して得られるアプリケーションプログラム10Aに含まれている改竄チェックルーチンFによって、第2の確認段階の処理が行われる。   In step S9, the second confirmation stage shown in FIG. 6 is performed. In this second confirmation stage, processing for confirming the validity of the confidential information 23A with respect to the signature information 22A is performed. That is, A's signature information 22A and confidential information 23A, which are the confidential data C, are extracted from the distribution file 20A input in step S6, and the validity of the confidential information 23A for the confidential data C is confirmed. Actually, the process of the second confirmation stage is performed by the falsification check routine F included in the application program 10A obtained by expanding the application package 21A.

前述したとおり、改竄チェックルーチンFは、第1の特定鍵K(s1)を内蔵しており、この第1の特定鍵K(s1)を用いて、秘匿化対象データCに対する秘匿情報23Aの正当性を確認する。正当性を確認するための具体的な処理については、§6において実例を挙げて説明する。改竄チェックルーチンFは、アプリケーションプログラム10A内に組み込まれているサブルーチンであるから、結局、ステップS9の処理は、アプリケーションプログラム10Aによって実行される処理ということになる。   As described above, the falsification check routine F incorporates the first specific key K (s1), and the validity of the confidential information 23A for the data C to be concealed using the first specific key K (s1). Check sex. Specific processing for confirming validity will be described with reference to §6. Since the falsification check routine F is a subroutine incorporated in the application program 10A, the process in step S9 is a process executed by the application program 10A.

ステップS9の第2の確認段階において肯定的な結果が得られた場合、すなわち、秘匿化対象データCに対する秘匿情報23Aの正当性が確認された場合には、ステップS10を経てステップS12へと進み、アプリケーションプログラム10Aの処理を続行する実行段階が行われる。これに対して、ステップS9の第2の確認段階において否定的な結果が得られた場合、すなわち、秘匿化対象データCに対する秘匿情報23Aの正当性が確認されなかった場合には、「改竄あり」との判定がなされ、ステップS10を経てステップS11へと進み、当該アプリケーションの実行は中止される。   If a positive result is obtained in the second confirmation stage of step S9, that is, if the validity of the confidential information 23A for the confidential data C is confirmed, the process proceeds to step S12 via step S10. Then, an execution stage for continuing the processing of the application program 10A is performed. On the other hand, if a negative result is obtained in the second confirmation step of step S9, that is, if the validity of the confidential information 23A for the confidential data C is not confirmed, “There is tampering”. Is determined, and the process proceeds to step S11 via step S10, and the execution of the application is stopped.

結局、ステップS8およびステップS10は、「改竄あり」もしくは「改竄なし」との判断を行う改竄判定段階を構成する処理になる。すなわち、ステップS6で入力した配布用ファイル20Aについて、ステップS7の第1の確認段階およびステップS9の第2の確認段階の双方において肯定的な結果が得られた場合には「改竄なし」との判断が行われ、第1の確認段階および第2の確認段階の少なくとも一方において否定的な結果が得られた場合には「改竄あり」との判断が行われる。   Eventually, step S8 and step S10 constitute a tampering determination stage in which it is determined that “tampered” or “not tampered”. That is, regarding the distribution file 20A input in step S6, if a positive result is obtained in both the first confirmation stage in step S7 and the second confirmation stage in step S9, “no falsification” is indicated. When a determination is made and a negative result is obtained in at least one of the first confirmation stage and the second confirmation stage, it is determined that “tampering exists”.

そして、この改竄判定段階において、「改竄なし」との判断が得られた場合は、ステップS12へと進み、配布されたアプリケーションプログラム10Aを正常に実行する実行段階が行われるが、「改竄あり」との判断が行われた場合は、ステップS11へと進み、配布されたアプリケーションプログラム10Aの実行は中止される。   If it is determined in this tampering determination stage that “no tampering” is obtained, the process proceeds to step S12, and an execution stage in which the distributed application program 10A is normally executed is performed. Is determined, the process proceeds to step S11, and the execution of the distributed application program 10A is stopped.

このように、実行プロセスを、OSプログラムの管理下でアプリケーションプログラムの実行を行うアプリケーション実行用コンピュータを用いる場合、ステップS7の第1の確認段階をOSプログラムに基づいて実行し、ステップS9の第2の確認段階をアプリケーションプログラム内の改竄チェックルーチンに基づいて実行する、という役割分担を行うことができる。Android端末のように、もともとOSプログラムが第1の確認段階を行う機能を備えている場合には、このような役割分担を行えば、第1の確認段階を行うためのプログラムを別途用意する手間を省くことができる。   Thus, when the execution process uses an application execution computer that executes an application program under the management of the OS program, the first confirmation step of step S7 is executed based on the OS program, and the second of step S9. This division of roles can be performed in such a manner that the confirmation stage is executed based on a falsification check routine in the application program. If the OS program originally has a function for performing the first confirmation step, such as an Android terminal, it is troublesome to separately prepare a program for performing the first confirmation step by performing such a division of roles. Can be omitted.

Android端末の場合、ステップS7の第1の確認段階は、OSプログラムの基本機能によって実行され、ステップS8において「改竄あり」との判断に基づいてステップS11に分岐した場合の実行中止処理は、OSプログラムによって実行されることになる。この場合、ユーザUからは、アプリケーションプログラム10Aを起動する旨の指示が与えられているものの、実際には、アプリケーションプログラム10Aはまだ起動していない状態である。したがって、ステップS8からステップS11に分岐した場合の実行中止処理とは、ユーザUからの指示にかかわらず、OSプログラムがアプリケーションプログラム10Aの起動を拒否する処理ということになる。   In the case of an Android terminal, the first confirmation stage of step S7 is executed by the basic function of the OS program, and execution stop processing when branching to step S11 based on the determination that “tampered” is made in step S8 is OS It will be executed by the program. In this case, although the user U is instructed to start the application program 10A, the application program 10A is not yet started. Therefore, the execution cancellation process when branching from step S8 to step S11 is a process in which the OS program rejects the activation of the application program 10A regardless of an instruction from the user U.

一方、ステップS9の第2の確認段階は、アプリケーションプログラム10Aが起動された後に、当該アプリケーションプログラム10A内の改竄チェックルーチンによって実行される処理ということになる。より詳細に説明すれば、アプリケーションプログラム10A内のプログラム本体部11Aからサブルーチン群13A内の改竄チェックルーチンFがサブルーチンとしてコールされ、当該サブルーチン内のプロセスとして、第2の確認段階が実行されることになる。したがって、ステップS10からステップS11に分岐した場合の実行中止処理とは、アプリケーションプログラム10A自身が、以後の処理の実行を中止して終了する処理(制御をOSプログラムへ返す処理)ということになる。もちろん、ステップS10において「改竄なし」との判断がなされた場合は、ステップS12の実行段階の処理、すなわち、アプリケーションプログラム10Aが、以後の処理を継続して実行する処理が行われることなる。   On the other hand, the second confirmation stage of step S9 is a process executed by the falsification check routine in the application program 10A after the application program 10A is activated. More specifically, the falsification check routine F in the subroutine group 13A is called as a subroutine from the program body 11A in the application program 10A, and the second confirmation stage is executed as a process in the subroutine. Become. Therefore, the execution cancellation process when branching from step S10 to step S11 is a process in which the application program 10A itself stops the execution of the subsequent processes and terminates (a process for returning control to the OS program). Of course, if it is determined in step S10 that “no falsification”, processing in the execution stage of step S12, that is, processing in which the application program 10A continuously executes the subsequent processing is performed.

要するに、図7に示す実施形態では、OSプログラムに基づく第1の確認段階(ステップS7)が行われた後に、アプリケーションプログラム内の改竄チェックルーチンFに基づく第2の確認段階(ステップS9)が実行されるようにしつつ、第1の確認段階において否定的な結果が得られた場合には、OSプログラムにより改竄ありとの判断を伴う改竄判定段階(ステップS8)を実行し、第2の確認段階(ステップS9)を行わずに、当該判断対象となったアプリケーションプログラムの実行をOSプログラムの管理下で中止(ステップS11)することになる。   In short, in the embodiment shown in FIG. 7, after the first confirmation step (step S7) based on the OS program is performed, the second confirmation step (step S9) based on the falsification check routine F in the application program is executed. In the case where a negative result is obtained in the first confirmation stage, the falsification determination stage (step S8) accompanied by the determination that there is falsification is executed by the OS program, and the second confirmation stage. Without performing (Step S9), the execution of the application program as the determination target is stopped under the management of the OS program (Step S11).

一方、第1の確認段階(ステップS7)において肯定的な結果が得られた場合には、OSプログラムの管理下で当該判断対象となったアプリケーションプログラムを実行して第2の確認段階(ステップS9)を行う。そして、この第2の確認段階において否定的な結果が得られた場合には、当該アプリケーションプログラム自身により改竄ありとの判断を伴う改竄判定段階(ステップS10)を実行し、当該アプリケーションプログラム自身により、以後の処理の実行を中止(ステップS11)する。また、第2の確認段階(ステップS9)において肯定的な結果が得られた場合には、当該アプリケーションプログラム自身により改竄なしとの判断を伴う改竄判定段階(ステップS10)を実行し、当該アプリケーションプログラム自身により、以後の処理を引き続き実行する(ステップS12)ことになる。   On the other hand, if an affirmative result is obtained in the first confirmation stage (step S7), the application program that is the determination target is executed under the management of the OS program to execute the second confirmation stage (step S9). )I do. If a negative result is obtained in the second confirmation stage, the application program itself performs a tampering determination stage (step S10) involving determination that tampering has occurred. Subsequent processing is stopped (step S11). Further, when a positive result is obtained in the second confirmation stage (step S9), the application program itself executes a tampering judgment stage (step S10) accompanied by a judgment that there is no tampering, and the application program The subsequent processing is subsequently executed by itself (step S12).

<<< §4.本発明の基本的な実施形態による改竄検知 >>>
ここでは、クラッカーXが、図5に示す方法で作成された配布用ファイル20Aを入手し、これに改竄を加えて再配布した場合に、Android端末において、どのような方法で改竄検知が行われるかについて説明しよう。
<<< §4. Tamper detection according to a basic embodiment of the present invention >>>
Here, when the cracker X obtains the distribution file 20A created by the method shown in FIG. 5 and redistributes the file by falsifying it, the falsification is detected by any method on the Android terminal. Let's explain what.

図8は、図5に示す配布方法に対してクラッカーXが試みる改竄プロセスを示すブロック図である。クラッカーXは、まず、入手した配布用ファイル20Aに含まれるアプリケーションパッケージ21Aに対して伸張処理を実行し、元のアプリケーションプログラム10Aを復元し、その中味について改竄を行う。   FIG. 8 is a block diagram showing a tampering process attempted by cracker X for the distribution method shown in FIG. First, the cracker X performs an expansion process on the application package 21A included in the obtained distribution file 20A, restores the original application program 10A, and falsifies the contents.

図8の上段の図は、このような改竄が行われた後のアプリケーションプログラム10X′を示す図である。§2でも述べたとおり、Android端末用のアプリケーションプログラム10の構成要素の中でも、リソースデータ12や補助ファイル14は、容易に改竄することができる。そこで、ここでも、クラッカーXが、リソースデータ12および補助ファイル14に対して改竄を施したものとしよう。図8に示すリソースデータ12Xおよび補助ファイル14Xは、クラッカーXによる改竄を受けたものである。続いて、クラッカーXは、アプリケーションプログラム10X′に対する再パッケージ化処理を行い、改竄されたアプリケーションパッケージ21X′を生成する。   The upper part of FIG. 8 is a diagram showing the application program 10X ′ after such tampering. As described in §2, among the components of the application program 10 for the Android terminal, the resource data 12 and the auxiliary file 14 can be easily falsified. Therefore, again, assume that the cracker X has altered the resource data 12 and the auxiliary file 14. The resource data 12X and the auxiliary file 14X shown in FIG. 8 have been falsified by the cracker X. Subsequently, the cracker X performs repackaging processing on the application program 10X ′ to generate a falsified application package 21X ′.

もし、クラッカーXが、こうして生成したアプリケーションパッケージ21X′を、正規の配布用ファイル20A内の正規のアプリケーションパッケージ21Aとすり替えて再配布した場合、Android端末で行われる通常の改竄検知処理によって改竄の事実が検知されることは、既に§2で述べたとおりである。すなわち、Aの署名情報22Aの正当性を確認する処理で不一致が生じることになる。本発明においても、図7に示す実行プロセスにおけるステップS7の第1の確認段階において、OSプログラムによって当該改竄の検知が行われる。   If the cracker X replaces and redistributes the application package 21X 'generated in this way with the regular application package 21A in the regular distribution file 20A, the fact of falsification is detected by the normal falsification detection process performed on the Android terminal. Is detected as described in §2. That is, a mismatch occurs in the process of confirming the validity of the A signature information 22A. Also in the present invention, the falsification is detected by the OS program in the first confirmation stage of step S7 in the execution process shown in FIG.

そこで、ここでは、クラッカーXが署名情報に対する改竄も行った場合を考えてみる。すなわち、図8の下段に示すように、クラッカーXは、自分の第1の鍵K(x1)を用いて、署名対象データD′(すなわち、改竄されたアプリケーションパッケージ21X′)に対する署名値S(X′)を作成する処理を行い、作成された署名値S(X′)と、自分の第2の鍵K(x2)とを含むXの署名情報22X′を作成し、改竄されたアプリケーションパッケージ21X′にXの署名情報22X′を付加することにより、改竄された配布用ファイル20X′を作成する。   Therefore, consider the case where the cracker X has also altered the signature information. That is, as shown in the lower part of FIG. 8, the cracker X uses the first key K (x1) of its own to sign the signature value S (for the signature target data D ′ (that is, the altered application package 21X ′). X ′) is generated, X signature information 22X ′ including the generated signature value S (X ′) and its own second key K (x2) is generated, and the application package is falsified. By adding X signature information 22X ′ to 21X ′, a falsified distribution file 20X ′ is created.

このように署名情報に対する改竄も行われると、クラッカーXによる再署名が行われたことになるので、Xの署名情報22X′は署名対象データD′に対する正当性を有する。したがって、従来の方法では、このようにして作成された配布用ファイル20X′については、改竄検知を行うことができない。本発明においても、図7に示す実行プロセスにおけるステップS7の第1の確認段階では、このような改竄を検知することはできない。   If the signature information is tampered in this way, re-signing by the cracker X is performed, so that the X signature information 22X ′ has the validity for the signature target data D ′. Therefore, in the conventional method, falsification cannot be detected for the distribution file 20X ′ created in this way. Also in the present invention, such falsification cannot be detected in the first confirmation stage of step S7 in the execution process shown in FIG.

しかしながら、本発明に係る方法で配布される配布用ファイル20Aには、更に、秘匿情報23Aが付加されており、この秘匿情報23Aについての正当性が、ステップS9の第2の確認段階で確認される。秘匿情報23Aは、図5の下段に示すとおり、秘匿化対象データC(この例では、Aの署名情報22A)を第2の特定鍵K(s2)を用いて秘匿化することによって得られる情報であるが、第2の特定鍵K(s2)が秘密の状態で管理されていれば、クラッカーXはこれを入手することができない。したがって、クラッカーXは、自身で作成したXの署名情報22X′を秘匿化対象データC′として、第2の特定鍵K(s2)を用いた秘匿化処理を行い、改竄された秘匿情報23Xを作成することはできない。図8の下段において、×印が付された部分は、実際には、クラッカーXが行うことができない処理やクラッカーXが作成することができない情報を示している。   However, confidential information 23A is further added to the distribution file 20A distributed by the method according to the present invention, and the validity of the confidential information 23A is confirmed at the second confirmation stage of step S9. The The secret information 23A is information obtained by concealing the data C to be concealed (in this example, the signature information 22A of A) using the second specific key K (s2), as shown in the lower part of FIG. However, if the second specific key K (s2) is managed in a secret state, the cracker X cannot obtain it. Accordingly, the cracker X performs the concealment process using the second specific key K (s2) using the X signature information 22X ′ created by itself as the concealment target data C ′, and the falsified concealment information 23X is obtained. It cannot be created. In the lower part of FIG. 8, the part marked with “x” indicates a process that the cracker X cannot actually perform or information that the cracker X cannot create.

結局、クラッカーXは、作成した配布用ファイル20X′内の秘匿情報については、元のままの状態(秘匿情報23Aのまま)にしておくか、これを削除してしまうか、あるいは新たに作成した任意の秘匿情報に置き換えるしかない。いずれの方法を採っても、図7に示す実行プロセスにおけるステップS9の第2の確認段階において、正当性の確認ができないため、改竄の検知が行われることになる。   Eventually, the cracker X keeps the secret information in the created distribution file 20X ′ as it is (the secret information 23A), deletes it, or creates a new one. There is no choice but to replace it with arbitrary confidential information. Regardless of which method is used, since the validity cannot be confirmed in the second confirmation stage of step S9 in the execution process shown in FIG. 7, tampering is detected.

すなわち、元のままの状態にしておいた場合、第2の確認段階において、Xの署名情報22X′に対する秘匿情報23Aの正当性を確認する処理が行われることになるが、秘匿情報23Aは、Aの署名情報22Aに対して正当性を有する情報であるため、Xの署名情報22X′に対する正当性は確認できない。一方、秘匿情報を削除してしまった場合は、Xの署名情報22X′に対する正当性確認の対象物がないため、そもそも正当性確認の処理を行うことができない。また、新たに作成した任意の秘匿情報に置き換えた場合も、当該置換後の秘匿情報が、Xの署名情報22X′を第2の特定鍵K(s2)を用いて秘匿化することによって得られる情報(別言すれば、第1の特定鍵K(s1)を用いて正当性確認がなされる情報)に偶然一致しない限り、第2の確認段階における正当性確認はなされない。   That is, if the original state is left as it is, a process of confirming the validity of the confidential information 23A for the X signature information 22X ′ is performed in the second confirmation stage. Since the information is valid for the A signature information 22A, the validity for the X signature information 22X 'cannot be confirmed. On the other hand, when the confidential information is deleted, since there is no object for the validity confirmation for the signature information 22X ′ of X, the validity confirmation process cannot be performed in the first place. In addition, when replaced with newly created arbitrary confidential information, the confidential information after the replacement is obtained by concealing the signature information 22X ′ of X using the second specific key K (s2). As long as it does not coincide with the information (in other words, the information whose validity is confirmed using the first specific key K (s1)), the validity is not confirmed in the second confirmation stage.

結局、クラッカーXが、アプリケーションパッケージ10Aおよび署名情報22Aに対する改竄を行ったとしても、秘匿情報23Aに対する改竄を行うことができなければ、第2の確認段階において改竄が検知されるので、改竄されたアプリケーションプログラムの実行は中止され、改竄検知後のプロセスが正常に実行されることはない。このように、本発明に係るアプリケーションプログラムの配布実行方法によれば、電子署名に対する改竄が行われた場合にも、有効な改竄検知を行うことが可能になり、改竄検知後は、当該アプリケーションプログラムの実行を中止することが可能になる。   Eventually, even if the cracker X performs falsification on the application package 10A and the signature information 22A, if falsification is not performed on the confidential information 23A, the falsification is detected in the second confirmation stage. Execution of the application program is stopped and the process after falsification detection is not executed normally. As described above, according to the distribution execution method of the application program according to the present invention, it is possible to perform effective tampering detection even when tampering with the electronic signature is performed. It becomes possible to cancel execution of.

もちろん、本発明に係るアプリケーションプログラムの配布実行方法による改竄検知機能は、100%完全なものではない。理論的には、第1の確認段階と第2の確認段階との双方をパスするような改竄を施すことは可能である。   Of course, the falsification detection function by the application program distribution execution method according to the present invention is not 100% complete. Theoretically, it is possible to perform tampering that passes both the first confirmation stage and the second confirmation stage.

たとえば、サブルーチン群13Aを解析することにより、第1の特定鍵K(s1)の所在を特定することができれば、この第1の特定鍵K(s1)を別な鍵に書き替えることにより、第2の確認段階で正当性が確認されるような改竄を行うことが可能になる。また、サブルーチン群13Aを解析することにより、改竄チェックルーチンFを構成するコード群を特定することができれば、改竄チェックルーチンF自身を改竄してしまうことにより、どのような場合にも第2の確認段階では改竄検知ができないようにすることも可能である。あるいは、プログラム本体部11Aを解析することにより、改竄チェックルーチンFを呼び出すサブルーチンコール命令の所在を特定することができれば、当該サブルーチンコール命令を無意味な別な命令に書き替えてしまうことにより、改竄チェックルーチンFが実行されないようにすることも可能である。   For example, if the location of the first specific key K (s1) can be specified by analyzing the subroutine group 13A, the first specific key K (s1) is rewritten to another key. It is possible to perform falsification so that the legitimacy is confirmed in the second confirmation stage. Further, if the code group constituting the falsification check routine F can be specified by analyzing the subroutine group 13A, the falsification check routine F itself is falsified, so that the second confirmation is performed in any case. It is also possible to prevent tampering detection at the stage. Alternatively, if the location of the subroutine call instruction that calls the falsification check routine F can be specified by analyzing the program main body 11A, the subroutine call instruction is rewritten to another meaningless instruction, thereby falsification. It is possible to prevent the check routine F from being executed.

このように、プログラム本体部11A内のプログラムやサブルーチン群13A内のプログラムの内容を逐一解析した上で、プログラム本体部11Aやサブルーチン群13Aに対して第2の確認段階を不正な方法で回避するような改竄が施された場合、本発明では改竄検知を行うことはできない(もちろん、改竄チェックルーチン以外のサブルーチンの改竄や、改竄チェックルーチンをコールする部分以外のプログラム本体部の改竄など、第2の確認段階の実行が回避されないような改竄であれば、本発明により当該改竄の検知を行うことができる。)。しかしながら、実際には、プログラム本体部11Aやサブルーチン群13Aに対する改竄を行うには、プログラムに関する高度な知識をもったクラッカーが、十分な時間と労力を費やして作業を行う必要がある。これに対して、リソースデータ12や補助ファイル14に対する改竄は、APKファイルに対する若干の知識をもったクラッカーであれば行うことができ、時間や労力も必要としない。   In this way, after analyzing the contents of the program in the program main body 11A and the program in the subroutine group 13A one by one, the second confirmation step is avoided in an illegal manner for the program main body 11A and the subroutine group 13A. When such alterations are made, the present invention cannot detect alterations (of course, second alterations such as alteration of a subroutine other than the alteration check routine, alteration of a program body other than the portion calling the alteration check routine, etc.) If the alteration is such that execution of the confirmation stage is not avoided, the alteration can be detected by the present invention.) However, actually, in order to falsify the program main body 11A and the subroutine group 13A, it is necessary for a cracker with advanced knowledge about the program to perform work with sufficient time and labor. On the other hand, falsification of the resource data 12 and the auxiliary file 14 can be performed by a cracker having some knowledge of the APK file, and does not require time and labor.

本発明は、このように比較的簡単に行われる可能性のある改竄に対して有効な検知方法を提供することを主目的とするものであり、実用上、改竄されたアプリケーションプログラムの多くを検知する十分な効果を奏するものである。特に、これまで述べてきた基本的実施形態では、改竄チェックルーチンFがサブルーチン群13A内の1つのサブルーチンとして、アプリケーションプログラム10A内に組み込まれているため、第2の確認段階を実施するために、別なプログラムを改めて用意する必要はない。すなわち、配布用ファイル20Aの中に、自分自身が改竄されているか否かを判定する改竄チェックルーチンFが組み込まれていることになり、これを実行するコンピュータ側には、改竄チェックのために別なアプリケーションを用意する必要はない。   The main object of the present invention is to provide an effective detection method for tampering that can be performed relatively easily as described above. In practice, many of the tampered application programs are detected. It has a sufficient effect. In particular, in the basic embodiment described so far, the falsification check routine F is incorporated in the application program 10A as one subroutine in the subroutine group 13A, so that the second confirmation stage is performed. There is no need to prepare another program. That is, a falsification check routine F that determines whether or not the distribution file 20A has been falsified is incorporated, and the computer that executes the falsification check routine F has a separate check for falsification. There is no need to prepare a simple application.

一般に、改竄チェック用のアプリケーションを別途用意すると、当該アプリケーションを管理し、これを配布するための余分なコストが必要になる。そこで、これまで述べてきた基本的実施形態のように、改竄チェックルーチンFをアプリケーションプログラム10A内に組み込む方法を採用すれば、改竄チェックプログラムを別体として管理したり配布したりする必要がなくなり、アプリケーションプログラム10Aだけを管理・配布すれば足りるため、余分なコストを削減できるというメリットが得られる。また、アプリケーション実行用コンピュータ側でも、アプリケーションプログラム10Aだけを実行すれば改竄チェックが可能になる。すなわち、アプリケーションプログラムの配布、インストール、実行という一連の流れに着目した場合、従来どおりの流れを何ら阻害せずに本発明を適用して改竄検知を行うことが可能になる。   Generally, if an application for tampering check is separately prepared, an extra cost is required for managing and distributing the application. Therefore, if the method of incorporating the falsification check routine F into the application program 10A as in the basic embodiment described so far is adopted, it is not necessary to manage or distribute the falsification check program separately. Since it is sufficient to manage and distribute only the application program 10A, there is an advantage that extra costs can be reduced. Further, the falsification check can be performed on the application execution computer side by executing only the application program 10A. That is, when attention is paid to a series of flow of distribution, installation and execution of application programs, it becomes possible to detect falsification by applying the present invention without obstructing the conventional flow.

たとえば、Android端末に対して配布するアプリケーションプログラムに本発明を適用する場合、入手した配布用ファイル20A(すなわち、APKファイル)が改竄されているか否かを判定する改竄チェックルーチンFが、当該APKファイル自身に含まれているため、AndroidOSは、当該APKファイルに対して、通常どおり第1の確認段階を実行して署名情報の正当性を確認した後、当該APKファイルに含まれるアプリケーションプログラムを実行する処理を行うだけでよい。Android端末は、本発明に係るAPKファイルを、一般のAPKファイルと同等に取り扱うことができ、APKファイルの実行により第2の確認段階が行われるので、Android端末に特別な機能は要求されない。また、第2の確認段階を行う際に、外部の認証サーバへの問い合わせ処理なども不要であり、改竄チェックルーチンFは、Android端末がオフライン状態(外部に対する通信が遮断されている状態)であっても、何ら支障なくその処理機能を果たすことができる。   For example, when the present invention is applied to an application program distributed to an Android terminal, the falsification check routine F for determining whether or not the obtained distribution file 20A (that is, APK file) has been falsified is the APK file. Since it is included in the Android OS, the Android OS executes the first confirmation step on the APK file as usual to confirm the validity of the signature information, and then executes the application program included in the APK file. You just need to do the processing. The Android terminal can handle the APK file according to the present invention in the same way as a general APK file, and the second confirmation stage is performed by executing the APK file, so that no special function is required for the Android terminal. In addition, when performing the second confirmation stage, there is no need to process an inquiry to an external authentication server, and the falsification check routine F is in an offline state (a state where communication with the outside is blocked). However, the processing function can be performed without any trouble.

<<< §5.秘匿化対象データのバリエーション >>>
§3で説明した本発明の基本的な実施形態に係る配布実行方法では、図5に太線枠で囲って示すように、Aの署名情報22A全体(すなわち、署名値S(A)とAの第2の鍵K(a2))を秘匿化対象データCとして、第2の特定鍵K(s2)を用いた秘匿化処理を行い、秘匿情報23Aを作成している。このようにして作成された秘匿情報23Aは、Aの署名情報22Aの痕跡を残す情報というべきものであり、第1の特定鍵K(s2)を用いた所定の確認方法により、Aの署名情報22Aに対する正当性の確認が可能になるという固有の性質を有している。
<<< §5. Variation of data to be concealed >>>
In the distribution execution method according to the basic embodiment of the present invention described in § 3, the entire signature information 22A of A (that is, the signature values S (A) and A Using the second key K (a2)) as the concealment target data C, concealment processing using the second specific key K (s2) is performed to create the concealment information 23A. The secret information 23A created in this way is information that leaves a trace of the signature information 22A of A, and the signature information of A is obtained by a predetermined confirmation method using the first specific key K (s2). It has a unique property that it is possible to confirm the validity of 22A.

このような性質を有する秘匿情報23Aを配布用ファイル20Aに含ませておけば、Aの署名情報22Aに対する秘匿情報23Aの正当性を確認する処理(第2の確認処理)を行うことにより、Aの署名情報22Aに対する改竄の有無を確認することができるようになる。   If the confidential information 23A having such properties is included in the distribution file 20A, a process for confirming the validity of the confidential information 23A with respect to the signature information 22A of A (second confirmation process) is performed. It is possible to confirm whether or not the signature information 22A is falsified.

もっとも、本発明を実施する上で用いる秘匿化対象データCは、必ずしもAの署名情報22Aのみに限定されるものではない。ここでは、秘匿化対象データCのバリエーションをいくつか述べておく。   However, the concealment target data C used for carrying out the present invention is not necessarily limited to the A signature information 22A. Here, some variations of the concealment target data C will be described.

図9は、図5に示す本発明の基本的な実施形態に係る配布方法のバリエーションを示すブロック図である。図5に示す実施形態との相違点は、秘匿化対象データCの設定方法だけである。図5に示す例では、太線枠で囲って示すように、Aの署名情報22A全体を秘匿化対象データCに設定しているが、図9に示すバリエーションでは、太線枠で囲って示すように、Aの署名情報22Aに含まれるAの第2の鍵K(a2)を構成するデータのみを秘匿化対象データCに設定している。   FIG. 9 is a block diagram showing a variation of the distribution method according to the basic embodiment of the present invention shown in FIG. The only difference from the embodiment shown in FIG. 5 is the method of setting the concealment target data C. In the example shown in FIG. 5, the entire signature information 22A of A is set as the concealment target data C as shown by being surrounded by a thick line frame. However, in the variation shown in FIG. , Only the data constituting the second key K (a2) of A included in the signature information 22A of A is set as the concealment target data C.

したがって、図9に示すバリエーションの場合、図7のステップS3の秘匿情報作成段階において、第2の特定鍵K(s2)を用いてAの第2の鍵K(a2)を秘匿化することにより秘匿情報23A′を作成することになる。また、ステップS9の第2の確認段階において、Aの署名情報22Aに対する秘匿情報23Aの正当性を確認する代わりに、このバリエーションにおける秘匿化対象データCであるAの第2の鍵K(a2)に対する秘匿情報23A′の正当性が確認されることになる。   Therefore, in the case of the variation shown in FIG. 9, the second key K (a2) of A is concealed using the second specific key K (s2) in the secret information creation stage in step S3 of FIG. The secret information 23A ′ is created. Further, in the second confirmation stage of step S9, instead of confirming the validity of the confidential information 23A with respect to the signature information 22A of A, the second key K (a2) of A which is the data C to be concealed in this variation The validity of the confidential information 23A ′ is confirmed.

このように、秘匿化対象データCとして、Aの署名情報22Aの代わりにAの第2の鍵K(a2)を用いたとしても、署名情報に対する改竄が行われたか否かを検知する上では支障は生じない。そもそもAの署名情報22Aは、プログラム提供者Aがアプリケーションパッケージ21Aを署名対象データDとして、その内容を保証することを示すものであり、プログラム提供者Aの痕跡はAの第2の鍵K(a2)として記録されていることになる。そして、クラッカーXが、署名情報に対する改竄を行う場合、図8に示すように、Aの署名情報22AをそっくりXの署名情報22X′に差し替えることになるので、当然、Aの第2の鍵K(a2)もXの第2の鍵K(x2)に差し替えられることになる。   As described above, even when the second key K (a2) of A is used as the concealment target data C instead of the signature information 22A of A, it is necessary to detect whether or not the signature information has been tampered with. There will be no hindrance. In the first place, the signature information 22A of A indicates that the program provider A guarantees the contents of the application package 21A as the signature target data D, and the trace of the program provider A is the second key K ( It is recorded as a2). When the cracker X tampers with the signature information, the signature information 22A of A is replaced with the signature information 22X ′ of X as shown in FIG. (A2) is also replaced with the second key K (x2) of X.

したがって、Aの第2の鍵K(a2)を秘匿化対象データCに設定し、これを秘匿化して秘匿情報23A′を作成し、第2の確認段階において、Aの第2の鍵K(a2)に対する秘匿情報23A′の正当性を確認するようにしても、署名情報に対する改竄の有無を検知することができる。Aの第2の鍵K(a2)がXの第2の鍵K(x2)に差し替えられていた場合、秘匿情報23A′は、Aの第2の鍵K(a2)を秘匿化対象データCとして作成された情報であるから、差し替えられたXの第2の鍵K(x2)に対しての正当性は確認できない。   Therefore, the second key K (a2) of A is set as the data C to be concealed, and is concealed to create the concealment information 23A ′. In the second confirmation stage, the second key K ( Even if the validity of the confidential information 23A ′ for a2) is confirmed, it is possible to detect whether the signature information has been tampered with. When the second key K (a2) of A is replaced with the second key K (x2) of X, the confidential information 23A ′ uses the second key K (a2) of A as the data C to be concealed. Therefore, the validity of the replaced second key K (x2) of X cannot be confirmed.

結局、秘匿化対象データCとして、少なくともプログラム提供者Aの第2の鍵K(a2)を含むデータを用いるようにすれば、クラッカーXが、署名情報に対する改竄を行ったとしても、第2の確認段階において、これを検知することができる。クラッカーXは、第2の特定鍵K(s2)を入手しない限り、改竄チェックルーチンF(第1の特定鍵K(s1)によって正当性の確認を行うルーチン)によって正当性の確認が可能な秘匿情報23Xを作成することはできないので、Aの署名情報22AをそっくりXの署名情報22X′に差し替えたとしても、第2の確認段階における改竄検知を免れることはできない。   Eventually, if data including at least the second key K (a2) of the program provider A is used as the concealment target data C, even if the cracker X performs falsification on the signature information, the second This can be detected in the confirmation stage. As long as the second specific key K (s2) is not obtained, the cracker X is a secret that can be confirmed by the falsification check routine F (a routine for confirming the validity by the first specific key K (s1)). Since the information 23X cannot be created, even if the A signature information 22A is completely replaced with the X signature information 22X ′, tampering detection at the second confirmation stage cannot be avoided.

このように、図5に示す例のように、Aの署名情報22Aを秘匿化対象データCとして設定することもできるし、図9に示すバリエーションのように、Aの第2の鍵K(a2)を秘匿化対象データCとして設定することもできるし、その他にも種々のバリエーションを採用することができる。   As described above, the signature information 22A of A can be set as the concealment target data C as in the example shown in FIG. 5, and the second key K (a2 of A) can be set as in the variation shown in FIG. ) Can be set as the concealment target data C, and various other variations can be employed.

図10は、別なバリエーションを示すブロック図である。このバリエーションでは、太線枠で囲って示すように、アプリケーションパッケージ21AとAの署名情報22Aとの双方を構成するデータ全体を秘匿化対象データCに設定している。したがって、このバリエーションの場合、第2の特定鍵K(s2)を用いて、図に太線枠で囲った部分のデータ全体を秘匿化することにより秘匿情報23A''を作成することになる。そして第2の確認段階では、この太線枠で囲った部分のデータ全体に対する秘匿情報23A''の正当性が確認されることになる。   FIG. 10 is a block diagram showing another variation. In this variation, the entire data constituting both the application package 21A and the signature information 22A of A is set as the concealment target data C as shown by being surrounded by a thick line frame. Therefore, in the case of this variation, the confidential information 23A ″ is created by concealing the entire data in the portion surrounded by the thick line frame in the drawing using the second specific key K (s2). In the second confirmation stage, the validity of the secret information 23A ″ for the entire data in the portion surrounded by the bold frame is confirmed.

この図10に示すバリエーションでも、秘匿化対象データCにAの第2の鍵K(a2)が含まれているため、クラッカーXがAの署名情報22AをXの署名情報22X′に差し替える改竄を行っても、第2の確認段階による改竄検知が有効に機能することになる。   Even in the variation shown in FIG. 10, since the second key K (a2) of A is included in the data C to be concealed, the cracker X performs falsification to replace the signature information 22A of A with the signature information 22X ′ of X. Even if it does, tampering detection in the second confirmation stage will function effectively.

結局、プログラム提供者Aが署名した痕跡を何らかの形で配布用ファイル20Aに残しておくには、図7のステップS3の秘匿情報作成段階において、アプリケーションパッケージ21Aおよび署名情報22Aを構成するデータの中から、プログラム提供者の第2の鍵K(a2)を含む所定部分を秘匿化対象データCとして抽出し、抽出した秘匿化対象データCに対して第2の特定鍵K(s2)を用いた秘匿化処理を施して秘匿情報を作成するようにすればよい。   Eventually, in order to leave a trace of the signature of the program provider A in the distribution file 20A in some form, in the secret information creation stage of step S3 in FIG. 7, in the data constituting the application package 21A and the signature information 22A Then, a predetermined part including the second key K (a2) of the program provider is extracted as the concealment target data C, and the second specific key K (s2) is used for the extracted concealment target data C. Concealment processing may be performed to create confidential information.

図5に示す例は、署名情報22Aを構成するデータ全体を秘匿化対象データCに設定して秘匿情報23Aを作成した例であり、図9に示す例は、署名情報22Aに含まれるプログラム提供者の第2の鍵K(a2)を構成するデータを秘匿化対象データCに設定して秘匿情報23A′を作成した例であり、図10に示す例は、アプリケーションパッケージ21Aと署名情報22Aとの双方を構成するデータ全体を秘匿化対象データCに設定して秘匿情報23A''を作成した例ということになる。   The example shown in FIG. 5 is an example in which the entire data constituting the signature information 22A is set as the concealment target data C and the secret information 23A is created, and the example shown in FIG. 9 is a program provided in the signature information 22A. FIG. 10 shows an example in which confidential information 23A ′ is created by setting the data constituting the second key K (a2) of the user as the confidential data C, and the example shown in FIG. 10 includes the application package 21A, the signature information 22A, This is an example in which the secret data 23A ″ is created by setting the entire data constituting both of the data to be concealed.

プログラム提供者Aが署名した痕跡を残しておく、という目的を達成する上では、図9に示す例のように、プログラム提供者の第2の鍵K(a2)のみを秘匿化対象データCとする方法が最も簡便で直接的な方法である。このような観点からは、図5に示す例や図10に示す例は、冗長な方法と言うことができる。しかしながら、プログラム提供者Aが署名した痕跡に加えて、アプリケーションパッケージ21Aに関する何らかの痕跡も残しておく、という観点では、図5に示す例や図10に示す例は意味のある方法になる。   In order to achieve the purpose of leaving the trace signed by the program provider A, only the second key K (a2) of the program provider is concealed with the data C to be concealed as in the example shown in FIG. This is the simplest and most direct method. From this point of view, the example shown in FIG. 5 and the example shown in FIG. 10 can be said to be redundant methods. However, from the viewpoint of leaving some trace regarding the application package 21A in addition to the trace signed by the program provider A, the example shown in FIG. 5 and the example shown in FIG. 10 are meaningful methods.

たとえば、図10に示す例では、太線枠で囲ったアプリケーションパッケージ21Aと署名情報22Aとの双方が秘匿化対象データCに設定されており、第2の確認段階では、これらのデータ全体に対する秘匿情報23A''の正当性の確認が行われることになるので、アプリケーションパッケージ21Aに対する改竄検知と署名情報22Aに対する改竄検知との両方を行うことが可能である。   For example, in the example shown in FIG. 10, both the application package 21A and the signature information 22A surrounded by a thick frame are set as the data C to be concealed. Since the validity of 23A ″ is confirmed, it is possible to perform both falsification detection for the application package 21A and falsification detection for the signature information 22A.

図5に示す基本的な実施形態では、アプリケーションパッケージ21Aに対する改竄検知は、Aの署名情報22Aを用いた第1の確認段階で行い、署名情報22Aに対する改竄検知は、秘匿情報23Aを用いた第2の確認段階で行うことになるが、図10に示すバリエーションの場合、アプリケーションパッケージ21Aに対する改竄検知は、Aの署名情報22Aを用いた第1の確認段階で行われるとともに、秘匿情報23A''を用いた第2の確認段階でも重ねて行われることになる。   In the basic embodiment shown in FIG. 5, falsification detection for the application package 21A is performed in the first confirmation stage using the signature information 22A of A, and falsification detection for the signature information 22A is performed using the confidential information 23A. In the case of the variation shown in FIG. 10, tampering detection for the application package 21A is performed in the first confirmation stage using the signature information 22A of A and the confidential information 23A ″. This is also repeated in the second confirmation stage using.

これまで述べてきた実施形態では、第2の確認段階の処理を、署名情報の改竄検知を行うための処理として捉えてきたが、第2の確認段階の処理は、上述したとおり、アプリケーションパッケージ21Aに対する改竄検知にも利用することが可能である。   In the embodiments described so far, the process in the second confirmation stage has been regarded as a process for detecting falsification of the signature information. However, as described above, the process in the second confirmation stage is performed by the application package 21A. It can also be used to detect tampering.

したがって、第2の確認段階の処理を、署名情報の改竄検知ではなく、アプリケーションパッケージ21Aに対する改竄検知のみに利用するのであれば、秘匿化対象データCには、必ずしもプログラム提供者Aの第2の鍵K(a2)が含まれている必要はない。たとえば、アプリケーションパッケージ21Aの部分のみを秘匿化対象データCに設定して、秘匿情報23A'''を作成した場合、第2の確認段階では、Aの署名情報22Aに対する改竄検知を行うことはできないが、アプリケーションパッケージ21Aに対する改竄検知を行うことは可能である。   Therefore, if the processing in the second confirmation stage is used only for falsification detection for the application package 21A, not for falsification detection of the signature information, the concealment target data C does not necessarily include the second data of the program provider A. The key K (a2) need not be included. For example, when only the part of the application package 21A is set as the concealment target data C and the concealment information 23A ′ ″ is created, tampering detection for the signature information 22A of A cannot be performed in the second confirmation stage. However, it is possible to detect falsification for the application package 21A.

結局、本発明の基本的な技術思想は、アプリケーションプログラムの改竄を検知する方法として捉えることが可能である。この改竄検知方法は、コンピュータが、アプリケーションプログラム10A(これまで述べてきた実施形態の場合は、パッケージ化された状態のアプリケーションパッケージ21A)と、署名情報22Aと、秘匿情報23A(上述した各バリエーションの場合は、23A′,23A'',23A''')とを含むデータファイルを入力する入力段階と、コンピュータが、当該アプリケーションプログラム10Aが改竄されているか否かを判定する判定段階と、を有する。   After all, the basic technical idea of the present invention can be understood as a method for detecting falsification of an application program. In this falsification detection method, the computer uses an application program 10A (in the case of the embodiment described so far, packaged application package 21A), signature information 22A, and confidential information 23A (for each of the above-described variations). In this case, there is an input stage for inputting a data file including 23A ′, 23A ″, 23A ′ ″) and a determination stage for determining whether or not the application program 10A has been tampered with. .

ここで、署名情報22Aは、アプリケーションプログラム10A(もしくは、アプリケーションパッケージ21A)を署名対象データDとする電子署名処理によって得られた情報であり、秘匿情報23A(もしくは、23A′,23A'',23A''')は、当該アプリケーションプログラム10A(もしくは、アプリケーションパッケージ21A)および署名情報22Aを構成するデータの中の所定部分を秘匿化対象データCとして抽出し、抽出した秘匿化対象データCに対する秘匿化処理を施して得られた情報ということになる。   Here, the signature information 22A is information obtained by electronic signature processing using the application program 10A (or application package 21A) as signature target data D, and the confidential information 23A (or 23A ′, 23A ″, 23A). '' ') Extracts a predetermined portion of the data constituting the application program 10A (or application package 21A) and signature information 22A as the concealment target data C, and conceals the extracted concealment target data C. This is information obtained by processing.

そして、判定段階は、署名情報22Aに基づいて改竄の有無を確認する第1の確認段階と、秘匿情報23A(もしくは、23A′,23A'',23A''')に基づいて改竄の有無を確認する第2の確認段階と、を有しており、アプリケーションプログラム10Aには、秘匿化処理で行われた処理プロセスを勘案して秘匿化対象データCに対する秘匿情報の正当性を確認する改竄チェックルーチンが含まれており、この改竄チェックルーチンを実行することにより第2の確認段階が行われることになる。   In the determination stage, the first confirmation stage for confirming the presence / absence of falsification based on the signature information 22A and the presence / absence of falsification based on the confidential information 23A (or 23A ′, 23A ″, 23A ′ ″). A tampering check for confirming the validity of the confidential information for the data C to be concealed in consideration of the processing process performed in the concealment process. A routine is included, and the second confirmation step is performed by executing this tampering check routine.

これまで述べてきた実施例は、このような改竄検知方法をアプリケーションプログラムの配布実行方法に組み込んだものであり、プログラム提供者の第2の鍵K(a2)を含む所定部分を秘匿化対象データCとして用い、OSプログラムの管理下でアプリケーションプログラムの実行を行うコンピュータによって、第1の確認段階をOSプログラムに基づいて実行し、第2の確認段階をアプリケーションプログラム内の改竄チェックルーチンに基づいて実行するようにした例ということになる。   In the embodiments described so far, such a falsification detection method is incorporated into the application program distribution execution method, and a predetermined part including the second key K (a2) of the program provider is concealed. Used as C and executed by the computer executing the application program under the control of the OS program, the first confirmation stage is executed based on the OS program, and the second confirmation stage is executed based on the falsification check routine in the application program It will be an example of doing so.

<<< §6.秘匿化処理の具体的な実施形態 >>>
ここでは、本発明における秘匿情報作成段階(図7のステップS3)で行われる秘匿化処理の具体的な実施形態を述べる。図5に示すように、本発明における秘匿情報作成段階では、秘匿化対象データCに対して、第2の特定鍵K(s2)を用いた秘匿化処理が行われ、秘匿情報23Aが作成される。ここで、秘匿情報23Aは、秘匿化対象データCおよび第2の特定鍵K(s2)が与えられれば一義的に定まる何らかのデータであり、改竄チェックルーチンによって実行される第1の特定鍵K(s1)を用いた所定のチェック処理によって、秘匿化対象データCに対する秘匿情報23Aの正当性が確認されることになる。
<<< §6. Specific Embodiment of Concealment Processing >>>
Here, a specific embodiment of the concealment process performed in the concealment information creation stage (step S3 in FIG. 7) in the present invention will be described. As shown in FIG. 5, in the secret information creation stage in the present invention, the concealment process using the second specific key K (s2) is performed on the data C to be concealed, and the secret information 23A is created. The Here, the concealment information 23A is some data that is uniquely determined when the concealment target data C and the second specific key K (s2) are given, and the first specific key K ( By the predetermined check process using s1), the validity of the confidential information 23A with respect to the confidential data C is confirmed.

秘匿化対象データCを秘匿化して秘匿情報23Aを作成するには、第2の特定鍵K(s2)が必要である。したがって、第2の特定鍵K(s2)を秘密に管理していれば、クラッカーXは秘匿情報23Aを生成することができない。また、秘匿情報23Aは、文字通り「元の秘匿化対象データCを秘匿化」した情報になっており、秘匿情報23Aだけを用いて、元の秘匿化対象データCを復元することはできない。以下、このような性質を有する秘匿情報23Aを作成するための具体的な秘匿化処理の方法を述べる。   In order to conceal the concealment target data C and create the concealment information 23A, the second specific key K (s2) is required. Therefore, if the second specific key K (s2) is secretly managed, the cracker X cannot generate the secret information 23A. Further, the concealment information 23A is literally “information that conceals the original concealment target data C”, and the original concealment target data C cannot be restored using only the concealment information 23A. Hereinafter, a specific method of concealment processing for creating the concealment information 23A having such properties will be described.

なお、以下の説明は、§3で述べた基本的な実施形態と同様に、Aの署名情報22Aを秘匿化対象データCに設定した例(図5の例)についてのものであるが、もちろん、以下に述べる秘匿化処理の具体的な処理方法は、§5で述べたように、秘匿化対象データCについて様々な設定を行うバリエーション(たとえば、図9や図10の例)についても有効である。   The following description is for an example (example in FIG. 5) in which the signature information 22A of A is set as the concealment target data C, as in the basic embodiment described in §3. The specific processing method of the concealment process described below is also effective for variations (for example, examples of FIGS. 9 and 10) in which various settings are made for the concealment target data C as described in §5. is there.

<6−1:暗号化処理>
本発明における秘匿化処理に適した第1の処理は、暗号化処理である。秘匿化処理として暗号化処理を利用する場合、秘匿化対象データCと秘匿情報23Aとの関係は、前者を暗号化することにより後者が得られ、後者を復号することにより前者が得られる、という関係になる。
<6-1: Encryption processing>
The first process suitable for the concealment process in the present invention is an encryption process. When the encryption process is used as the concealment process, the relationship between the concealment target data C and the concealment information 23A is obtained by encrypting the former and obtaining the latter by decrypting the latter. Become a relationship.

このような暗号化および復号を行うには、公開鍵暗号方式を利用するのが好ましい。公開鍵暗号方式では、一方の鍵を用いて暗号化したデータを他方の鍵を用いて復号できる性質をもった一対の鍵が用いられる。したがって、秘匿情報23Aは、秘匿化対象データCを一方の鍵を用いて暗号化することにより得られることになり、改竄チェックルーチンFは、この秘匿情報23Aを他方の鍵を用いて復号し、この復号によって得られた秘匿化対象データと、入力段階で入力したデータファイル20Aから抽出した秘匿化対象データCとが一致していた場合に改竄なしとの確認を行うことになる。   In order to perform such encryption and decryption, it is preferable to use a public key cryptosystem. In the public key cryptosystem, a pair of keys having a property that data encrypted using one key can be decrypted using the other key is used. Accordingly, the confidential information 23A is obtained by encrypting the confidential data C using one key, and the tampering check routine F decrypts the confidential information 23A using the other key, When the data to be concealed obtained by this decryption matches the data to be concealed C extracted from the data file 20A input at the input stage, it is confirmed that there is no falsification.

図11は、図5に示す配布方法における秘匿情報23Aとして、暗号化された情報を用いる具体的実施例を示すブロック図である。この実施例では、プログラム提供者Aが配布用ファイル20Aを配布する際に、プログラム保証者Gの助力を受けることになる。プログラム保証者Gは、公的機関であってもよいし、民間企業であってもよいが、社会的に信用があり、安全に鍵を管理する能力をもった団体がその役割を担うようにするのが好ましい。   FIG. 11 is a block diagram showing a specific embodiment in which encrypted information is used as the confidential information 23A in the distribution method shown in FIG. In this embodiment, the program provider A receives the assistance of the program guarantor G when distributing the distribution file 20A. The program guarantor G may be a public institution or a private company, but an organization that has social credibility and the ability to safely manage keys will play its role. It is preferable to do this.

上述したとおり、秘匿化処理として、公開鍵暗号方式を利用した暗号化処理を採用する場合、図5に示す第1の特定鍵K(s1)および第2の特定鍵K(s2)として、一方の鍵を用いて暗号化したデータを他方の鍵を用いて復号できる性質をもった一対の鍵を用いることになる。図11に示す例は、プログラム保証者Gの第1の鍵K(g1)を第1の特定鍵K(s1)として用い、プログラム保証者Gの第2の鍵K(g2)を第2の特定鍵K(s2)として用いた例である。より具体的には、第1の鍵K(g1)としては、プログラム保証者Gの公開鍵を用い、第2の鍵K(g2)としては、プログラム保証者Gの秘密鍵を用いればよい。もっとも、公開鍵と秘密鍵とを入れ替えて用いても、本発明を実施することは可能である。   As described above, when the encryption process using the public key cryptosystem is adopted as the concealment process, the first specific key K (s1) and the second specific key K (s2) shown in FIG. A pair of keys having the property that data encrypted using one key can be decrypted using the other key is used. In the example shown in FIG. 11, the first key K (g1) of the program guarantor G is used as the first specific key K (s1), and the second key K (g2) of the program guarantor G is used as the second key. This is an example used as the specific key K (s2). More specifically, the public key of the program guarantor G may be used as the first key K (g1), and the secret key of the program guarantor G may be used as the second key K (g2). However, the present invention can be implemented even if the public key and the secret key are used interchangeably.

プログラム保証者Gは、予め、自分の第1の鍵K(g1)を内蔵した改竄チェックルーチンFを作成しておき、この改竄チェックルーチンFと、自分の第2の鍵K(g2)とを記録した媒体を、プログラム提供者Aに貸し与えればよい。そうすれば、プログラム提供者Aは、この媒体を利用して、配布用ファイル20Aを作成することができる。したがって、ここに示す実施形態では、Aの署名情報22Aは、プログラム提供者Aが、自分自身の鍵を用いてアプリケーションパッケージ21Aの内容を保証するために付加する情報としての役割を果たし、秘匿情報23Aは、プログラム保証者Gが、自分自身の鍵を用いてAの署名情報22Aの内容を保証するために付加する情報としての役割を果たすことになる。   The program guarantor G creates in advance a falsification check routine F having its own first key K (g1) built therein, and uses this falsification check routine F and its second key K (g2). The recorded medium may be lent to the program provider A. Then, the program provider A can create the distribution file 20A using this medium. Therefore, in the embodiment shown here, the signature information 22A of A serves as information to be added by the program provider A to guarantee the contents of the application package 21A by using its own key. 23A serves as information to be added by the program guarantor G to guarantee the content of the signature information 22A of A using its own key.

プログラム提供者Aは、まず、従来と同様の方法で、図1の上段に示すようなアプリケーションプログラム10を作成する。続いて、プログラム保証者Gから借り受けた媒体から、改竄チェックルーチンFを読み出し、これをサブルーチン群13に付加することにより、図11の上段に示すようなサブルーチン群13Aを作成する。また、プログラム本体部11に、改竄チェックルーチンFを呼び出すためのサブルーチンコール命令と、この改竄チェックルーチンFから返された実行結果に基づいて、プログラムの実行を続行するか中止する処理プログラム(「改竄なし」の実行結果が返された場合には、プログラムの実行を続行し、「改竄あり」の実行結果が返された場合には、プログラムの実行を中止するプログラム)とを追加することにより、プログラム本体部11Aを作成する。   The program provider A first creates an application program 10 as shown in the upper part of FIG. 1 by the same method as before. Subsequently, the falsification check routine F is read from the medium borrowed from the program guarantor G and added to the subroutine group 13, thereby creating a subroutine group 13A as shown in the upper part of FIG. In addition, based on the subroutine call instruction for calling the falsification check routine F in the program body 11 and the execution result returned from the falsification check routine F, a processing program that continues or stops the execution of the program (“falsification”). If "None" is returned, the program will continue to run, and if "Tampered" is returned, the program will be suspended. A program body 11A is created.

このようなプロセスを経れば、図11の上段に示すようなアプリケーションプログラム10Aを作成できる。このアプリケーションプログラム10Aには、プログラム保証者Gの第1の鍵K(g1)を含む改竄チェックルーチンFが組み込まれていることになる。こうしてアプリケーションプログラム10Aが用意できたら、これを従来の方法と同様にパッケージ化し(APKファイル作成用の専用プログラムを用いればよい)、アプリケーションパッケージ21Aを作成する(図7のステップS1のパッケージ化段階)。次に、プログラム提供者Aは、このアプリケーションパッケージ21Aを署名対象データDとして、自分の第1の鍵K(a1)を用いた電子署名処理を行い、Aの署名情報22Aを作成する(図7のステップS2の署名情報作成段階)。   Through such a process, an application program 10A as shown in the upper part of FIG. 11 can be created. In this application program 10A, a falsification check routine F including the first key K (g1) of the program guarantor G is incorporated. When the application program 10A is prepared in this way, it is packaged in the same manner as in the conventional method (a dedicated program for creating an APK file may be used) to create an application package 21A (the packaging stage in step S1 in FIG. 7). . Next, the program provider A uses the application package 21A as signature target data D, performs electronic signature processing using its own first key K (a1), and creates A signature information 22A (FIG. 7). Step S2 of signature information creation step).

続いて、今度は、プログラム保証者Gから借り受けた媒体から、Gの第2の鍵K(g2)を読み出し、Aの署名情報22Aを秘匿化対象データCとして、Gの第2の鍵K(g2)を用いた秘匿化処理を行い、秘匿情報23Aを作成する(図7のステップS3の秘匿情報作成段階)。この図11に示す実施例の場合、秘匿化処理として暗号化処理を採用しているため、秘匿情報作成段階では、第2の特定鍵(すなわち、プログラム保証者Gの第2の鍵K(g2))を用いて、秘匿化対象データCに対する暗号化処理を施して秘匿情報23Aが作成される。   Subsequently, the second key K (g2) of G is read from the medium borrowed from the program guarantor G, the signature information 22A of A is used as the concealment target data C, and the second key K of G ( The concealment process using g2) is performed to create the concealment information 23A (the concealment information creation stage of step S3 in FIG. 7). In the case of the embodiment shown in FIG. 11, since the encryption process is adopted as the concealment process, the second specific key (that is, the second key K of the program guarantor G (g2 )), The encryption information 23A is encrypted and the confidential information 23A is created.

最後に、アプリケーションパッケージ21A、Aの署名情報22A、秘匿情報23Aをまとめれば、配布用ファイル20A(APKファイル)を作成することができる(図7のステップS4の配布用ファイル作成段階)。そこで、これをWebサーバや物理的媒体に出力して(図7のステップS5のファイル出力段階)、任意の方法で配布すればよい。   Finally, the distribution file 20A (APK file) can be created by collecting the signature information 22A and the confidential information 23A of the application packages 21A and A (distribution file creation stage in step S4 in FIG. 7). Therefore, this may be output to a Web server or a physical medium (file output stage in step S5 in FIG. 7) and distributed by any method.

一方、アプリケーション実行用コンピュータ(Android端末)は、このような方法で作成された配布用ファイル20A(APKファイル)を入手し(図7のステップS6のファイル入力段階)、これを実行することになるが、まず、OSプログラムの機能により署名情報22Aの正当性が確認され(図7のステップS7の第1の確認段階)、続いて、当該配布用ファイル20Aに組み込まれている改竄チェックルーチンFの機能により秘匿情報23Aの正当性が確認される(図7のステップS9の第2の確認段階)。   On the other hand, the application execution computer (Android terminal) obtains the distribution file 20A (APK file) created by such a method (file input stage in step S6 in FIG. 7) and executes it. First, the validity of the signature information 22A is confirmed by the function of the OS program (the first confirmation stage of step S7 in FIG. 7), and then the falsification check routine F incorporated in the distribution file 20A is executed. The validity of the confidential information 23A is confirmed by the function (second confirmation stage of step S9 in FIG. 7).

図12は、図11に示す配布用ファイル20Aについて、署名情報22Aの正当性および秘匿情報23Aの正当性を確認する処理を示すブロック図である。   FIG. 12 is a block diagram showing processing for confirming the validity of the signature information 22A and the validity of the confidential information 23A for the distribution file 20A shown in FIG.

まず、署名情報22Aの正当性の確認(第1の確認段階)は、既に述べたように、次のようにして行われる。はじめに、署名情報22Aから署名値S(A)およびAの第2の鍵K(a2)を抽出し、署名値S(A)に対してAの第2の鍵K(a2)を用いた復号処理を行うことにより、ハッシュ値H1を得る。次に、アプリケーションパッケージ21A(署名対象データD)に対して、ハッシュ関数HASHを作用させた不可逆変換を行い、ハッシュ値H2を求める処理を行う。そして、ハッシュ値H1とハッシュ値H2とが一致するか否かを確認する処理を行えば、第1の確認段階は終了する。   First, the validity of the signature information 22A (first confirmation stage) is performed as follows, as described above. First, the signature value S (A) and the second key K (a2) of A are extracted from the signature information 22A, and the signature value S (A) is decrypted using the second key K (a2) of A. By performing the processing, the hash value H1 is obtained. Next, the application package 21A (signature target data D) is subjected to an irreversible transformation using a hash function HASH to obtain a hash value H2. When the process of confirming whether or not the hash value H1 and the hash value H2 match is performed, the first confirmation stage is completed.

一方、秘匿情報23Aの正当性の確認(第2の確認段階)は、公開鍵暗号方式の基本原理を利用することによって行われる。すなわち、ここに示す実施例では、プログラム保証者Gの第1の鍵K(g1)と第2の鍵K(g2)とは、公開鍵暗号方式における一対の鍵を構成しており、第2の鍵K(g2)を用いて暗号化したデータは、第1の鍵K(g1)を用いて復号することができる。そこで、改竄チェックルーチンFは、次のような方法で第2の確認段階の処理を実行する。   On the other hand, the validity (second confirmation stage) of the confidential information 23A is confirmed by utilizing the basic principle of the public key cryptosystem. That is, in the embodiment shown here, the first key K (g1) and the second key K (g2) of the program guarantor G constitute a pair of keys in the public key cryptosystem, and the second key The data encrypted using the first key K (g2) can be decrypted using the first key K (g1). Therefore, the falsification check routine F executes the process of the second confirmation stage by the following method.

はじめに、図12に示すように、改竄チェックルーチンFに内蔵されているプログラム保証者Gの第1の鍵K(g1)を用いて、入力した配布用ファイル20Aから抽出した秘匿情報23Aを復号し、元の秘匿化対象データCを得る。続いて、この復号によって得られた秘匿化対象データCと、入力した配布用ファイル20Aから抽出した秘匿化対象データC(この例の場合は、Aの署名情報22A)とが一致していた場合に、秘匿情報23Aが正当である旨の確認を行えばよい。   First, as shown in FIG. 12, the secret information 23A extracted from the input distribution file 20A is decrypted using the first key K (g1) of the program guarantor G built in the falsification check routine F. The original concealment target data C is obtained. Subsequently, the concealment target data C obtained by this decryption and the concealment target data C extracted from the input distribution file 20A (in this example, the signature information 22A of A) match. In addition, it may be confirmed that the confidential information 23A is valid.

結局、ここで述べた方法は、秘匿化対象データCを暗号化という手法で秘匿化して、秘匿情報23Aという形で配布用ファイル20Aに付加して配布し、アプリケーション実行用コンピュータ(Android端末)では、秘匿情報23Aを復号した結果が秘匿化対象データCに一致することを確認することにより、改竄の有無を検知する方法ということができる。クラッカーXは、暗号化に用いられたプログラム保証者Gの第2の鍵K(g2)を入手することができないため、秘匿情報23Aの改竄を行うことはできない。   After all, in the method described here, the data C to be concealed is concealed by a method called encryption, and is added to the distribution file 20A in the form of concealment information 23A and distributed, and the application execution computer (Android terminal) It can be said that the method of detecting the presence or absence of falsification by confirming that the result of decrypting the confidential information 23A matches the confidential data C. Since the cracker X cannot obtain the second key K (g2) of the program guarantor G used for encryption, the secret information 23A cannot be falsified.

<6−2:ダイジェスト化処理>
本発明における秘匿化処理に適した第2の処理は、ダイジェスト化処理である。秘匿化処理としてダイジェスト化処理を利用する場合、秘匿化対象データCと秘匿情報23Aとの関係は、前者をダイジェスト化することにより後者が得られる、という関係になる。
<6-2: Digest processing>
The second process suitable for the concealment process in the present invention is a digest process. When digest processing is used as the concealment processing, the relationship between the concealment target data C and the concealment information 23A is such that the latter can be obtained by digesting the former.

ここで、ダイジェスト化とは、元の情報から情報量を減らす演算処理を行って、元の情報に基づいて一義的に決定できる別な情報を得る処理である。具体的には、元の情報を構成するデータに対して、何らかの一方向性関数を作用させる処理を行えばよい。この場合、秘匿情報23Aは、秘匿化対象データCに対して、所定の特定鍵をパラメータとして用いた一方向性関数を作用させるダイジェスト化処理を施して得られることになり、改竄チェックルーチンFは、入力段階で入力したデータファイル20Aから抽出した秘匿化対象データCに対して、上記特定鍵と同一の鍵を用いた上記ダイジェスト化処理と同一の処理を施して得られる情報が、入力段階で入力したデータファイル20Aに含まれている秘匿情報20Aと一致していた場合に改竄なしとの確認を行うことになる。   Here, digesting is a process of obtaining another information that can be uniquely determined based on the original information by performing a calculation process that reduces the amount of information from the original information. Specifically, a process for applying some one-way function to the data constituting the original information may be performed. In this case, the concealment information 23A is obtained by subjecting the concealment target data C to digest processing that applies a one-way function using a predetermined specific key as a parameter. Information obtained by performing the same process as the digest process using the same key as the specific key on the concealment target data C extracted from the data file 20A input at the input stage is obtained at the input stage. If it matches the confidential information 20A included in the input data file 20A, it is confirmed that there is no falsification.

図13は、図5に示す配布方法における秘匿情報23Aとして、ダイジェスト化された情報を用いる具体的実施例を示すブロック図である。この実施例でも、プログラム提供者Aが配布用ファイル20Aを配布する際に、プログラム保証者Gの助力を受けることになる。ただ、第1の特定鍵K(s1)および第2の特定鍵K(s2)としては、同一の共通特定鍵K(s0)を用いる。   FIG. 13 is a block diagram showing a specific example in which digested information is used as the confidential information 23A in the distribution method shown in FIG. Also in this embodiment, the program provider A receives the assistance of the program guarantor G when distributing the distribution file 20A. However, the same common specific key K (s0) is used as the first specific key K (s1) and the second specific key K (s2).

プログラム保証者Gは、予め、自己が秘密状態で管理している共通特定鍵K(s0)を内蔵した改竄チェックルーチンFを作成しておき、この改竄チェックルーチンFと、当該共通特定鍵K(s0)とを記録した媒体を、プログラム提供者Aに貸し与えればよい。そうすれば、プログラム提供者Aは、この媒体を利用して、配布用ファイル20Aを作成することができる。   The program guarantor G creates in advance a falsification check routine F containing a common specific key K (s0) that it manages in a secret state, and this falsification check routine F and the common specific key K ( The medium on which s0) is recorded may be lent to the program provider A. Then, the program provider A can create the distribution file 20A using this medium.

具体的には、プログラム提供者Aは、上述した暗号化処理を採用する実施例と同様に、プログラム保証者Gから借り受けた媒体を利用して、図13の上段に示すようなアプリケーションプログラム10Aを作成する。このアプリケーションプログラム10Aには、プログラム保証者Gの共通特定鍵K(s0)を含む改竄チェックルーチンFが組み込まれていることになる。   Specifically, the program provider A uses the medium borrowed from the program guarantor G as in the embodiment employing the above-described encryption processing, and uses the application program 10A as shown in the upper part of FIG. create. In this application program 10A, a falsification check routine F including the common specific key K (s0) of the program guarantor G is incorporated.

こうしてアプリケーションプログラム10Aが用意できたら、これをパッケージ化し、アプリケーションパッケージ21Aを作成する。そして、プログラム提供者Aは、このアプリケーションパッケージ21Aを署名対象データDとして、自分の第1の鍵K(a1)を用いた電子署名処理を行い、Aの署名情報22Aを作成する。   When the application program 10A is prepared in this way, it is packaged to create an application package 21A. Then, the program provider A uses the application package 21A as signature target data D, performs electronic signature processing using its own first key K (a1), and creates A signature information 22A.

続いて、プログラム保証者Gから借り受けた媒体から、共通特定鍵K(s0)を読み出し、Aの署名情報22Aを秘匿化対象データCとして、共通特定鍵K(s0)を用いた秘匿化処理を行い、秘匿情報23Aを作成する。この図13に示す実施例の場合、秘匿化処理としてダイジェスト化処理を採用しているため、秘匿情報作成段階では、共通特定鍵K(s0)を用いて、秘匿化対象データCに対するダイジェスト化処理を施して秘匿情報23Aが作成される。   Subsequently, the common specific key K (s0) is read from the medium borrowed from the program guarantor G, and the concealment process using the common specific key K (s0) is performed using the A signature information 22A as the concealment target data C. The secret information 23A is created. In the embodiment shown in FIG. 13, since the digest process is adopted as the concealment process, the digest process for the concealment target data C is performed using the common specific key K (s0) at the secret information creation stage. The secret information 23A is created.

ダイジェスト化処理は、前述したように、秘匿化対象データCに対して、共通特定鍵K(s0)をパラメータとして用いた一方向性関数を作用させる処理である。具体的には、共通特定鍵K(s0)をパラメータとして用いたハッシュ関数を作用させる処理を行い、得られるハッシュ値を秘匿情報23Aとすればよい。   As described above, the digesting process is a process in which a one-way function using the common specific key K (s0) as a parameter is applied to the concealment target data C. Specifically, a process of applying a hash function using the common specific key K (s0) as a parameter is performed, and the obtained hash value may be used as the confidential information 23A.

最後に、アプリケーションパッケージ21A、Aの署名情報22A、秘匿情報23Aをまとめて配布用ファイル20A(APKファイル)を作成し、これを配布すればよい。   Finally, the distribution information 20A (APK file) may be generated by distributing the signature information 22A and the confidential information 23A of the application packages 21A and A together.

一方、アプリケーション実行用コンピュータ(Android端末)は、このような方法で作成された配布用ファイル20A(APKファイル)について、図14のブロック図に示す方法を行い、署名情報22Aの正当性および秘匿情報23Aの正当性を確認する処理を行う。   On the other hand, the application execution computer (Android terminal) performs the method shown in the block diagram of FIG. 14 on the distribution file 20A (APK file) created by such a method, and the validity and confidential information of the signature information 22A. Processing for confirming the validity of 23A is performed.

ここで、署名情報22Aの正当性の確認(第1の確認段階)は、これまで述べてきた実施例と全く同様である。すなわち、署名値S(A)に対してAの第2の鍵K(a2)を用いた復号処理を行うことによりハッシュ値H1を得る処理を行うとともに、アプリケーションパッケージ21A(署名対象データD)に対して、ハッシュ関数HASHを作用させた不可逆変換を行ってハッシュ値H2を得る処理を行い、ハッシュ値H1とハッシュ値H2とが一致するか否かを確認する処理を行うことになる。   Here, confirmation of the validity of the signature information 22A (first confirmation stage) is exactly the same as the embodiments described so far. That is, the signature value S (A) is decrypted using the second key K (a2) of A to obtain the hash value H1, and the application package 21A (signature target data D) is processed. On the other hand, a process for obtaining a hash value H2 by performing an irreversible transformation using the hash function HASH is performed, and a process for confirming whether or not the hash value H1 and the hash value H2 match each other is performed.

一方、秘匿情報23Aの正当性の確認(第2の確認段階)は、プログラム提供者Aが秘匿情報23Aを作成する際に行った処理と全く同じ処理を実行し、同じ結果が得られるか否かを確認することによって行われる。   On the other hand, in the confirmation of the validity of the confidential information 23A (second confirmation stage), whether or not the same result is obtained by executing exactly the same processing as the processing performed when the program provider A creates the confidential information 23A. Is done by checking.

具体的には、まず、入力した配布用ファイル20Aから秘匿化対象データC(この例の場合、Aの署名情報22A)および改竄チェックルーチンFに内蔵されている共通特定鍵K(s0)を抽出する。そして、抽出した秘匿化対象データCに対して、抽出した共通特定鍵K(s0)を用いたダイジェスト化処理(配布プロセスの秘匿情報作成段階で行われた処理と同一の処理)を実行する。すなわち、配布プロセスで行ったように、共通特定鍵K(s0)をパラメータとして用いたハッシュ関数を作用させる処理を行い、ハッシュ値を得るようにすればよい。このダイジェスト化処理によって得られたハッシュ値が、入力した配布用ファイル20Aに含まれている秘匿情報23Aと一致していた場合に、当該秘匿情報23Aが正当である旨の確認を行うことになる。   Specifically, first, the concealment target data C (in this example, the signature information 22A of A) and the common specific key K (s0) incorporated in the falsification check routine F are extracted from the input distribution file 20A. To do. Then, a digest process using the extracted common specific key K (s0) (the same process as the process performed at the secret information creation stage of the distribution process) is executed on the extracted concealment target data C. In other words, as in the distribution process, a hash function may be obtained by performing a process of applying a hash function using the common specific key K (s0) as a parameter. When the hash value obtained by the digest processing matches the confidential information 23A included in the input distribution file 20A, it is confirmed that the confidential information 23A is valid. .

結局、ここで述べた方法は、秘匿化対象データCをダイジェスト化という手法で秘匿化して、秘匿情報23Aという形で配布用ファイル20Aに付加して配布し、アプリケーション実行用コンピュータ(Android端末)では、同じ手法で秘匿化対象データCをダイジェスト化して、付加されていた秘匿情報23Aに一致することを確認することにより、改竄の有無を検知する方法ということができる。クラッカーXは、ダイジェスト化に用いられたプログラム保証者Gの共通特定鍵K(s0)を入手することができないため、秘匿情報23Aの改竄を行うことはできない。   Eventually, the method described here conceals the data C to be concealed by a method of digesting, adding it to the distribution file 20A in the form of concealment information 23A, and the application execution computer (Android terminal) It can be said that a method of detecting the presence / absence of falsification by digesting the concealment target data C by the same method and confirming that it matches the concealment information 23A added. Since the cracker X cannot obtain the common specific key K (s0) of the program guarantor G used for digesting, the secret information 23A cannot be falsified.

秘匿化処理として暗号化を採用した場合、得られる秘匿情報には、復号によって元の秘匿化対象データCを復元するために必要な情報がそのまま含まれている。したがって、元の秘匿化対象データCの情報量が多ければ、得られる秘匿情報の情報量も多くなる。このため、たとえば、図10に示す例のように、アプリケーションパッケージ21AおよびAの署名情報22Aをそっくり含むデータを秘匿化対象データCとして用いる場合は、得られる秘匿情報23A''のデータ容量はかなり大きくなり、配布用ファイル20A''の肥大化を招くことになる。   When encryption is adopted as the concealment process, the obtained concealment information includes information necessary for restoring the original concealment target data C by decryption. Therefore, if the amount of information of the original concealment target data C is large, the amount of information of the obtained confidential information also increases. For this reason, for example, when the data including the signature information 22A of the application packages 21A and A is used as the concealment target data C as in the example shown in FIG. 10, the data capacity of the obtained confidential information 23A ″ is considerably large. This increases the size of the distribution file 20A ″.

これに対して、秘匿化処理としてダイジェスト化を採用した場合、得られる秘匿情報から元の秘匿化対象データCを復元する必要はないため、秘匿情報の情報量を大幅に削減することが可能である。このため、たとえば、図10に示す例のように、かなり大きなデータ容量をもつ秘匿化対象データCを設定した場合でも、ダイジェスト化を採用すれば、得られる秘匿情報23A''のデータ容量を低く抑えることができ、配布用ファイル20A''の肥大化を防ぐことができる。   On the other hand, when digesting is adopted as the concealment process, it is not necessary to restore the original concealment target data C from the obtained concealment information, so that it is possible to greatly reduce the amount of information of the concealment information. is there. Therefore, for example, as shown in the example of FIG. 10, even when the concealment target data C having a considerably large data capacity is set, if the digesting is employed, the data capacity of the obtained confidential information 23A ″ is reduced. This can prevent the enlargement of the distribution file 20A ″.

<6−3:その他の秘匿化処理>
以上、本発明における秘匿化処理の具体的な実施形態として、暗号化処理とダイジェスト化処理を例示したが、本発明を実施するにあたり、秘匿化処理の具体的な形態は、これら2つの処理に限定されるものではない。
<6-3: Other concealment processing>
As described above, the encryption process and the digest process are illustrated as specific embodiments of the concealment process in the present invention. However, in carrying out the present invention, the specific form of the concealment process includes these two processes. It is not limited.

本発明における秘匿化処理は、互いに特別な関係をもった第1の特定鍵K(s1)と第2の特定鍵K(s2)とを用いることを前提とした処理であり、第2の特定鍵K(s2)を用いた何らかの演算処理によって、元の秘匿化対象データCに対して一義的に秘匿情報23Aを決定することができ、しかも第1の特定鍵K(s1)を用いることによって、秘匿化対象データCに対する秘匿情報23Aの正当性が確認できる(すなわち、改竄を受けていないことを確認できる)、という条件を満たす処理であれば、どのような処理を秘匿化処理として採用してもかまわない。   The concealment process in the present invention is a process based on the premise that the first specific key K (s1) and the second specific key K (s2) having a special relationship with each other are used. By performing some arithmetic processing using the key K (s2), the secret information 23A can be uniquely determined for the original data C to be concealed, and by using the first specific key K (s1) Any process can be adopted as the concealment process as long as the process satisfies the condition that the validity of the concealment information 23A with respect to the concealment target data C can be confirmed (that is, it can be confirmed that it has not been tampered with). It doesn't matter.

前述した暗号化処理では、第1の特定鍵K(s1)および第2の特定鍵K(s2)として、「公開鍵暗号方式に用いる一対の鍵」という互いに特別な関係をもった鍵がが採用されることになる。また、前述したダイジェスト化処理では、第1の特定鍵K(s1)および第2の特定鍵K(s2)として、「同一の共通特定鍵K(s0)である」という互いに特別な関係をもった鍵が採用されることになる。   In the above-described encryption processing, the first specific key K (s1) and the second specific key K (s2) are keys having a special relationship with each other as “a pair of keys used in the public key cryptosystem”. Will be adopted. In the digest process described above, the first specific key K (s1) and the second specific key K (s2) have a special relationship with each other as “the same common specific key K (s0)”. Key will be adopted.

<<< §7.配布用ファイル作成装置 >>>
次に、本発明に係る配布用ファイル作成装置の基本構成および動作を、図15に示す実施形態に基づいて説明する。図15にブロック図を示す装置は、アプリケーションプログラムの配布用ファイルを作成する装置であり、図7に示す配布プロセス(ステップS1〜S5)を実行する機能を有する。ここでは、プログラム提供者Aが、この装置を用いて、Android端末に配布するための配布用ファイル(APKファイル)を作成する場合を例にとって、装置の構成および動作を説明する。
<<< §7. Distribution file creation device >>>
Next, the basic configuration and operation of the distribution file creation apparatus according to the present invention will be described based on the embodiment shown in FIG. The apparatus shown in the block diagram of FIG. 15 is an apparatus for creating a distribution file of an application program, and has a function of executing the distribution process (steps S1 to S5) shown in FIG. Here, the configuration and operation of the apparatus will be described by taking as an example the case where the program provider A creates a distribution file (APK file) for distribution to an Android terminal using this apparatus.

図15のブロック図において、矩形のブロックは、この配布用ファイル作成装置の基本構成要素を示し、楕円のブロックは、これらの基本構成要素によって取り扱われる情報(プログラム、データ、ファイル)を示している。なお、楕円のブロックで示す個々の情報については、これまでの説明で用いてきた符号と同一の符号を付してある。   In the block diagram of FIG. 15, rectangular blocks indicate basic components of the distribution file creation apparatus, and elliptic blocks indicate information (programs, data, files) handled by these basic components. . In addition, about the individual information shown by an elliptical block, the code | symbol same as the code | symbol used by the description so far is attached | subjected.

図示のとおり、この作成装置は、3つの格納ユニット110,120,130を有している。アプリケーションプログラム格納ユニット110は、配布対象となるアプリケーションプログラム10を格納するためのユニットである。ここで言う配布対象となるアプリケーションプログラム10とは、図1の上段に示す形態のものに対応し、パッケージ化や本発明に特有の処理を行う前の状態のアプリケーションプログラムを指している。   As shown in the figure, this creating apparatus has three storage units 110, 120, and 130. The application program storage unit 110 is a unit for storing the application program 10 to be distributed. The application program 10 to be distributed here corresponds to the form shown in the upper part of FIG. 1 and refers to an application program in a state before packaging or processing specific to the present invention.

既に述べたとおり、Android仕様によると、このアプリケーションプログラム10は、プログラム本体部11と、画像および文字列を含むリソースデータ12と、プログラム本体部11から呼び出されるサブルーチン群13と、XML形式のデータからなる補助ファイル(マニフェストファイル)14と、を含んでいる。   As already described, according to the Android specification, the application program 10 includes a program body 11, resource data 12 including images and character strings, a subroutine group 13 called from the program body 11, and XML format data. Auxiliary file (manifest file) 14.

一方、改竄チェックルーチン格納ユニット120は、第1の特定鍵K(s1)を内蔵した改竄チェックルーチンFを格納したユニットであり、鍵格納ユニット130は、第2の特定鍵K(s2)、プログラム提供者Aの第1の鍵K(a1)、プログラム提供者Aの第2の鍵K(a2)を格納したユニットである。もちろん、本願における「鍵」とは、特定の者によって管理される特定の文字やコードの配列からなるデータであり、鍵格納ユニット130は、そのようなデータを記録する機能をもった構成要素であれば、どのような形態のものでもかまわない。   On the other hand, the falsification check routine storage unit 120 is a unit that stores a falsification check routine F containing the first specific key K (s1), and the key storage unit 130 includes the second specific key K (s2), a program The unit stores the first key K (a1) of the provider A and the second key K (a2) of the program provider A. Of course, the “key” in the present application is data consisting of a specific character or code arrangement managed by a specific person, and the key storage unit 130 is a component having a function of recording such data. Any form can be used.

ここで、プログラム提供者Aの第1の鍵K(a1)および第2の鍵K(a2)は、一方の鍵を用いて暗号化したデータを他方の鍵を用いて復号できる性質をもった一対の鍵であり、より具体的には、プログラム提供者A自身の公開鍵および秘密鍵(公開鍵暗号方式に用いる一対の鍵)である。これに対して、第1の特定鍵K(s1)および第2の特定鍵K(s2)は、一方の鍵を用いて秘匿化処理を施したデータの正当性を他方の鍵を用いて確認できる性質をもった一対もしくは同一の鍵であり、プログラム提供者A自身が管理する鍵でもよいが、§6で述べたように、プログラム保証者Gが介在する実施形態を採用する場合は、当該プログラム保証者Gが管理する鍵ということになる。   Here, the first key K (a1) and the second key K (a2) of the program provider A have the property that data encrypted using one key can be decrypted using the other key. A pair of keys, more specifically, a public key and a private key of the program provider A itself (a pair of keys used for a public key cryptosystem). On the other hand, the first specific key K (s1) and the second specific key K (s2) confirm the validity of the data subjected to the concealment process using one key using the other key. It is a pair or the same key having a property that can be performed, and may be a key managed by the program provider A itself. However, as described in §6, when the embodiment in which the program guarantor G intervenes is adopted, This is a key managed by the program guarantor G.

改竄チェックルーチン付加ユニット140は、アプリケーションプログラム格納ユニット110に格納されているアプリケーションプログラム10に改竄チェックルーチン格納ユニット120に格納されている改竄チェックルーチンFを付加する処理を行うユニットである。すなわち、図1の上段に示すアプリケーションプログラム10内のサブルーチン群13に、改竄チェックルーチンFを付加して、図5の上段に示すサブルーチン群13Aを作成する処理を実行する。   The falsification check routine adding unit 140 is a unit that performs processing for adding the falsification check routine F stored in the falsification check routine storage unit 120 to the application program 10 stored in the application program storage unit 110. That is, the alteration check routine F is added to the subroutine group 13 in the application program 10 shown in the upper part of FIG. 1, and the process of creating the subroutine group 13A shown in the upper part of FIG. 5 is executed.

一方、プログラム提供者Aは、アプリケーションプログラム10に、この改竄チェックルーチンFを呼び出すためのサブルーチンコール命令と、この改竄チェックルーチンFから返された実行結果に基づいて、プログラムの実行を続行するか中止する続行中止処理プログラムとを追加することにより、図5の上段に示すプログラム本体部11Aを作成する。   On the other hand, the program provider A continues or cancels the execution of the program based on the subroutine call instruction for calling the falsification check routine F to the application program 10 and the execution result returned from the falsification check routine F. A program main body 11A shown in the upper part of FIG.

なお、アプリケーションプログラム10をアプリケーションプログラム10Aに変更する処理は、プログラム提供者Aによる手作業ではなく、改竄チェックルーチン付加ユニット140による自動作業によって行うようにしてもよい。具体的には、改竄チェックルーチン付加ユニット140内に、予め、上述したサブルーチンコール命令および続行中止処理プログラムを用意しておけば、これらをアプリケーションプログラム10の所定箇所(たとえば、プログラムの先頭や、Android仕様によって必須の初期設定処理が終了した直後など)に自動的に挿入する機能を、ユニット140自身にもたせることができる。そうすれば、アプリケーションプログラム10をアプリケーションプログラム10Aに変更する処理は、すべて改竄チェックルーチン付加ユニット140による自動作業によって行うことができるようになる。   Note that the process of changing the application program 10 to the application program 10A may be performed not by the manual operation by the program provider A but by the automatic operation by the falsification check routine adding unit 140. Specifically, if the subroutine call instruction and the continuation stop processing program described above are prepared in advance in the alteration check routine adding unit 140, these are stored in predetermined locations (for example, the top of the program, Android Depending on the specifications, the unit 140 itself can be provided with a function of being automatically inserted (for example, immediately after completion of the essential initial setting process). Then, all the processes for changing the application program 10 to the application program 10 </ b> A can be performed automatically by the falsification check routine adding unit 140.

もちろん、アプリケーションプログラム格納ユニット110内に、プログラム本体部11A(上述したサブルーチンコール命令および続行中止処理プログラムが組み込まれたプログラム)を含むアプリケーションプログラムを用意しておくようにすれば、改竄チェックルーチン付加ユニット140は、サブルーチン群13に、改竄チェックルーチンFを付加してサブルーチン群13Aを作成する処理を行うだけでよい。   Of course, if an application program including the program body 11A (a program in which the subroutine call instruction and the continuation stop processing program described above are incorporated) is prepared in the application program storage unit 110, a falsification check routine addition unit is prepared. 140 only needs to add the falsification check routine F to the subroutine group 13 to create the subroutine group 13A.

パッケージ化処理ユニット150は、改竄チェックルーチンFが付加されたアプリケーションプログラム10Aに対して、少なくとも圧縮処理を含むパッケージ化処理を施し、アプリケーションパッケージ21Aを作成する処理を行う。Android仕様によれば、ZIP方式の圧縮処理を含むパッケージ化処理が実行されることになる。   The packaging process unit 150 performs a process of creating an application package 21A by performing a packaging process including at least a compression process on the application program 10A to which the falsification check routine F is added. According to the Android specification, a packaging process including a ZIP type compression process is executed.

署名情報作成ユニット160は、こうして作成されたアプリケーションパッケージ21Aを署名対象データとして、プログラム提供者Aの第1の鍵K(a1)を用いた暗号化を利用した電子署名処理を行って署名値S(A)を生成し、この署名値S(A)とプログラム提供者の第2の鍵K(a2)とを含むAの署名情報22Aを作成する。   The signature information creation unit 160 uses the application package 21A created in this way as signature target data, performs electronic signature processing using encryption using the first key K (a1) of the program provider A, and performs a signature value S. (A) is generated, and A signature information 22A including the signature value S (A) and the second key K (a2) of the program provider is created.

一方、秘匿情報作成ユニット170は、アプリケーションパッケージ21Aおよび署名情報22Aを構成するデータの中から、プログラム提供者Aの第2の鍵を含む所定部分を秘匿化対象データCとして抽出し、抽出した秘匿化対象データCに対して第2の特定鍵K(s2)を用いた秘匿化処理を施して秘匿情報23Aを作成する。   On the other hand, the secret information creation unit 170 extracts a predetermined portion including the second key of the program provider A from the data constituting the application package 21A and the signature information 22A as the secret data C, and extracts the secret Concealment processing using the second specific key K (s2) is performed on the data to be activated C to create confidential information 23A.

図5に示す実施形態の場合、Aの署名情報22Aを秘匿化対象データCとして設定しているため、図15に示すように、秘匿情報作成ユニット170は、署名情報作成ユニット160が作成した署名情報22Aを構成するデータ全体を秘匿化対象データCとして、秘匿情報23Aを作成する処理を行うことになる。もちろん、図9に示すバリエーションを採用する場合は、秘匿情報作成ユニット170は、署名情報22Aに含まれるプログラム提供者Aの第2の鍵K(a2)を構成するデータ部分だけを秘匿化対象データCとして用いることになり、図10に示すバリエーションを採用する場合は、秘匿情報作成ユニット170は、アプリケーションパッケージ21Aと署名情報22Aとの双方を構成するデータ全体を秘匿化対象データCとして用いることになる。   In the case of the embodiment shown in FIG. 5, since the signature information 22A of A is set as the concealment target data C, as shown in FIG. 15, the secret information creation unit 170 has the signature created by the signature information creation unit 160. The entire data constituting the information 22A is set as the concealment target data C, and the process of creating the confidential information 23A is performed. Of course, when the variation shown in FIG. 9 is adopted, the concealment information creation unit 170 may conceal only the data portion constituting the second key K (a2) of the program provider A included in the signature information 22A. When the variation shown in FIG. 10 is adopted, the confidential information creation unit 170 uses the entire data constituting both the application package 21A and the signature information 22A as the confidential data C. Become.

配布用ファイル作成ユニット180は、アプリケーションパッケージ21Aと、署名情報22Aと、秘匿情報23Aと、をまとめることにより、図5の下段に示すような配布用ファイル20Aを作成する処理を行う。Android仕様に基づくのであれば、APK形式のフォーマットをもった配布用ファイルを作成する処理が行われることになる。前述したとおり、ZIP方式の圧縮フォーマットを採用したAPKファイルには、任意のコメント文が記載可能なコメント領域が設けられているので、秘匿情報23Aを、このコメント領域に記録するようにすれば、配布用ファイル20Aは、Android仕様に合致したAPKファイルとしての条件を満たすことになる。この配布用ファイル20Aは、デジタルデータとしてデータ記録媒体に格納した状態で配布することもできるし、インターネットなどのネットワークを介してデジタルデータの形のまま配布することもできる。   The distribution file creation unit 180 collects the application package 21A, the signature information 22A, and the confidential information 23A, thereby creating a distribution file 20A as shown in the lower part of FIG. If it is based on the Android specification, a process of creating a distribution file having an APK format is performed. As described above, the APK file that employs the ZIP compression format is provided with a comment area where any comment text can be written. Therefore, if the confidential information 23A is recorded in this comment area, The distribution file 20A satisfies the conditions as an APK file that conforms to the Android specification. The distribution file 20A can be distributed as digital data stored in a data recording medium, or can be distributed in the form of digital data via a network such as the Internet.

こうして配布された配布用ファイル(APKファイル)20Aには、自分自身が改竄されているか否かを、付加された秘匿情報23Aを利用して判定する改竄チェックルーチンFが含まれており、アプリケーション実行用コンピュータにおいて、この改竄チェックルーチンFを実行することにより改竄検知を行うことができる。   The distribution file (APK file) 20A distributed in this way includes a falsification check routine F for determining whether or not it is falsified by using the added confidential information 23A. In the computer, the falsification can be detected by executing the falsification check routine F.

既に述べたとおり、改竄チェックルーチンFは、配布用ファイル20Aから秘匿化対象データCおよび秘匿情報23Aを抽出し、秘匿化対象データCに対する秘匿情報23Aの正当性を、内蔵している第1の特定鍵K(s1)を用いて確認し、正当性が確認できない場合には、アプリケーションプログラムが改竄された旨の判定を行う機能を有している。そして、アプリケーションプログラムが改竄された旨の判定が行われた場合には、当該アプリケーションプログラムの以後の処理の実行を中止させる処理を行う機能も有している。   As already described, the falsification check routine F extracts the concealment target data C and the concealment information 23A from the distribution file 20A, and incorporates the validity of the concealment information 23A for the concealment target data C. When the specific key K (s1) is used for confirmation and the validity cannot be confirmed, the application program has a function of determining that the application program has been tampered with. In addition, when it is determined that the application program has been tampered with, it also has a function of performing processing for stopping execution of subsequent processing of the application program.

秘匿情報作成ユニット170が秘匿情報23Aを作成する際に行う秘匿化処理の具体的な方法としては、§6−1で述べた暗号化処理や、§6−2で述べたダイジェスト化処理を採用すればよい。   As a specific method of the concealment process performed when the concealment information creation unit 170 creates the concealment information 23A, the encryption process described in §6-1 and the digestion process described in §6-2 are adopted. do it.

暗号化処理を採用する場合は、第1の特定鍵K(s1)および第2の特定鍵K(s2)として、一方の鍵を用いて暗号化したデータを他方の鍵を用いて復号できる性質をもった一対の鍵(公開鍵暗号方式に用いる一対の鍵)を用意し、秘匿情報作成ユニット170が、第2の特定鍵K(s2)を用いて、秘匿化対象データCに対する暗号化処理を施して秘匿情報23Aを作成すればよい。   In the case of adopting encryption processing, as the first specific key K (s1) and the second specific key K (s2), the property that data encrypted using one key can be decrypted using the other key A pair of keys having a key (a pair of keys used in the public key cryptosystem) is prepared, and the secret information creation unit 170 uses the second specific key K (s2) to encrypt the secret data C And secret information 23A may be created.

プログラム保証者Gを介在させる実施形態の場合、第1の特定鍵K(s1)としてプログラム保証者Gの第1の鍵K(g1)(たとえば、公開鍵)を用い、第2の特定鍵K(s2)としてプログラム保証者Gの第2の鍵K(g2)(たとえば、秘密鍵)を用い、Gの第2の鍵K(g2)を用いて暗号化したデータを、Gの第1の鍵K(g1)を用いて復号できるようにしておけばよい。秘匿情報作成ユニット170は、Gの第2の鍵K(s2)を用いて、秘匿化対象データCに対する暗号化処理を施して秘匿情報23Aを作成することになる。   In the embodiment in which the program guarantor G is interposed, the first specific key K (s1) is the first key K (g1) (for example, public key) of the program guarantor G, and the second specific key K is used. Using (s2) the second key K (g2) (for example, a secret key) of the program guarantor G, the data encrypted using the second key K (g2) of G is What is necessary is just to enable it to decrypt using the key K (g1). The secret information creation unit 170 creates the secret information 23A by performing the encryption process on the secret data C using the second key K (s2) of G.

一方、改竄チェックルーチン格納ユニット120には、第1の特定鍵K(s1)(すなわち、プログラム保証者Gの第1の鍵K(g1))を用いて秘匿情報23Aを復号し、この復号によって得られた秘匿化対象データCと、配布用ファイル20Aから抽出した秘匿化対象データCとが一致していた場合に、秘匿情報23Aが正当である旨の確認を行う機能をもった改竄チェックルーチンFを用意しておけばよい。   On the other hand, the tampering check routine storage unit 120 decrypts the confidential information 23A using the first specific key K (s1) (that is, the first key K (g1) of the program guarantor G), A falsification check routine having a function of confirming that the concealment information 23A is valid when the obtained concealment target data C and the concealment target data C extracted from the distribution file 20A match. Prepare F.

これに対して、ダイジェスト化処理を採用する場合は、第1の特定鍵K(s1)および第2の特定鍵K(s2)として同一の共通特定鍵K(s0)を用いるようにし、秘匿情報作成ユニット170が、秘匿化対象データCに対して、共通特定鍵K(s0)をパラメータとして用いた一方向性関数を作用させるダイジェスト化処理を施して秘匿情報23Aを作成すればよい。具体的には、共通特定鍵K(s0)をパラメータとして用いたハッシュ関数を作用させるダイジェスト化処理を施して得られるハッシュ値を秘匿情報23Aとすればよい。   On the other hand, when the digesting process is adopted, the same common specific key K (s0) is used as the first specific key K (s1) and the second specific key K (s2), and the confidential information is used. The creation unit 170 may create the confidential information 23 </ b> A by performing a digest process that applies a one-way function using the common specific key K (s <b> 0) as a parameter to the confidential data C. Specifically, a hash value obtained by performing a digest process that applies a hash function using the common specific key K (s0) as a parameter may be used as the secret information 23A.

この場合、改竄チェックルーチン格納ユニット120には、配布用ファイル20Aから秘匿化対象データCおよび共通特定鍵K(s0)を抽出し、抽出した秘匿化対象データCに対して、抽出した共通特定鍵K(s0)を用いたダイジェスト化処理(秘匿情報作成ユニット170で実行されたダイジェスト化処理と全く同じ処理)を施して得られる情報が、配布用ファイル20Aに含まれている秘匿情報23Aと一致していた場合に、当該秘匿情報23Aが正当である旨の確認を行う機能をもった改竄チェックルーチンFを用意しておけばよい。   In this case, the falsification check routine storage unit 120 extracts the concealment target data C and the common specific key K (s0) from the distribution file 20A, and extracts the extracted common specific key for the concealment target data C. Information obtained by applying digest processing using K (s0) (exactly the same processing as digest processing executed by the confidential information creating unit 170) is identical to the confidential information 23A included in the distribution file 20A. If it has been done, a falsification check routine F having a function of confirming that the confidential information 23A is valid may be prepared.

なお、図15に示す配布用ファイル作成装置は、実際には、汎用のコンピュータに専用のプログラムやデータを組み込むことによって構成されるものである。この場合、図15に矩形ブロックで示す各構成要素は、必ずしも1台の同一コンピュータによって構成する必要はなく、各構成要素を、互いにネットワークで接続可能な複数台のコンピュータに分散して配置するようにしてもかまわない。   The distribution file creation apparatus shown in FIG. 15 is actually configured by incorporating a dedicated program or data into a general-purpose computer. In this case, each component shown by a rectangular block in FIG. 15 is not necessarily configured by one identical computer, and each component is distributed and arranged in a plurality of computers that can be connected to each other via a network. It doesn't matter.

<<< §8.その他の変形例 >>>
最後に、これまで述べてきた種々の実施形態について適用可能な変形例をいくつか述べておく。
<<< §8. Other variations >>
Finally, some modifications that can be applied to the various embodiments described so far will be described.

<8−1:改竄検知時の中止処理>
図5に示す基本的な実施形態の場合、アプリケーションプログラム10Aには、プログラム本体部11Aと、このプログラム本体部11Aから呼び出されるサブルーチン群13Aと、が含まれており、サブルーチン群13Aには、改竄チェックルーチンFが含まれている。
<8-1: Canceling process when tampering is detected>
In the case of the basic embodiment shown in FIG. 5, the application program 10A includes a program main body 11A and a subroutine group 13A called from the program main body 11A. A check routine F is included.

ここで、この改竄チェックルーチンFは、プログラム本体部11Aから呼び出されたときに、秘匿化対象データCに対する秘匿情報23Aの正当性を確認する第2の確認段階を実行して、その実行結果をサブルーチンの実行結果としてプログラム本体部11Aへ返す機能を有している。   Here, when the alteration check routine F is called from the program main body 11A, it executes a second confirmation stage for confirming the validity of the confidential information 23A with respect to the confidential data C, and the execution result is obtained. It has a function of returning to the program body 11A as a subroutine execution result.

一方、プログラム本体部11Aには、改竄チェックルーチンFをコールするサブルーチンコール命令と、改竄チェックルーチンFから返された実行結果に応じて、以後の処理の続行もしくは中止を行う続行中止プログラムと、が組み込まれている。この続行中止プログラムは、改竄チェックルーチンFから返された実行結果が肯定的な結果であった場合には以後の命令群を引き続き実行し、否定的な結果であった場合には以後の命令群の実行を中止する。   On the other hand, the program body 11A includes a subroutine call instruction for calling the falsification check routine F and a continuation cancellation program for continuing or canceling the subsequent processing in accordance with the execution result returned from the falsification check routine F. It has been incorporated. If the execution result returned from the falsification check routine F is a positive result, the subsequent stop program continues to execute the subsequent instruction group, and if the execution result is negative, the subsequent instruction group is executed. Cancels execution of.

このように、これまで述べた実施形態では、改竄チェックルーチンFは、あくまでも秘匿情報23Aの正当性を確認する第2の確認段階を実行し、その結果をプログラム本体部11Aに報告する機能しか有していなかった。別言すれば、第2の確認段階において改竄が検知された場合、改竄チェックルーチンFは、否定的な実行結果をプログラム本体部11Aに返す処理を行い、プログラム本体部11A内の続行中止プログラムによって、以後の命令群の実行が中止されることになる。すなわち、アプリケーションプログラムの中止処理は、あくまでもプログラム本体部11Aの機能として実行されることになる(具体的には、プログラム本体部11A内のプログラムによって、アプリケーションを終了する処理が行われ、制御がOSプログラムに返されることになる)。   Thus, in the embodiments described so far, the falsification check routine F has only a function of executing the second confirmation stage for confirming the validity of the confidential information 23A and reporting the result to the program main body 11A. I did not. In other words, when falsification is detected in the second confirmation stage, the falsification check routine F performs a process of returning a negative execution result to the program main body 11A and is executed by the continuation cancellation program in the program main body 11A. Thereafter, the execution of the instruction group is stopped. In other words, the application program cancellation process is executed only as a function of the program main body 11A (specifically, a program in the program main body 11A is used to end the application, and the control is performed by the OS). Will be returned to the program).

一般に、サブルーチン群13Aを構成するサブルーチンプログラムは、プログラム本体部11Aから呼び出されて実行される性質のプログラムであり、サブルーチンの実行が完了すれば、元のプログラム本体部11A内の命令群が引き続き実行されることになる。したがって、通常は、プログラム本体部11Aからサブルーチンが呼び出されると、CPUの実行対象コードは、一旦、サブルーチン内のコードに移り、サブルーチンが終了した時点で、再びプログラム本体部11A内のコードに戻ることになる。これまで述べた実施形態は、このような一般原則に基づいた処理であり、改竄チェックルーチンFによって改竄が検知された場合も、プログラム本体部11Aによって、アプリケーションを終了する処理が行われることになる。   In general, the subroutine program that constitutes the subroutine group 13A is a program that is called and executed by the program body 11A. When the execution of the subroutine is completed, the instruction group in the original program body 11A is continuously executed. Will be. Therefore, normally, when a subroutine is called from the program main body 11A, the execution target code of the CPU temporarily moves to the code in the subroutine, and returns to the code in the program main body 11A again when the subroutine ends. become. The embodiments described so far are processes based on such general principles, and even when falsification is detected by the falsification check routine F, the program main body 11A performs the process of terminating the application. .

ただ、改竄が検知された場合のアプリケーション終了処理は、必ずしもプログラム本体部11Aによって行う必要はなく、改竄チェックルーチンFによって行ってもかまわない。上述したように、一般原則に従えば、サブルーチンの処理が終了した場合には、当該サブルーチンを呼び出したプログラム本体部11Aに制御を戻すべきであるが、改竄チェックルーチンFによって改竄が検知された場合は、いずれにしても当該アプリケーションを終了する必要があるので、制御をプログラム本体部11Aに戻すことなしに、改竄チェックルーチンF自身によって当該アプリケーションを終了する処理を行う運用を採ってもかまわない。   However, the application termination process when tampering is detected is not necessarily performed by the program main body 11A, and may be performed by the tampering check routine F. As described above, according to the general principle, when processing of a subroutine is completed, control should be returned to the program body 11A that called the subroutine, but when falsification is detected by the falsification check routine F In any case, since it is necessary to terminate the application, it is possible to adopt an operation of performing the process of terminating the application by the falsification check routine F itself without returning the control to the program main body 11A.

このような運用を採る場合、プログラム本体部11Aには、改竄チェックルーチンFをコールするサブルーチンコール命令と、この改竄チェックルーチンFから肯定的な結果が返された場合に、以後の命令群を引き続き実行するプログラムを組み込んでおき、改竄チェックルーチンFには、第2の確認段階の実行結果が肯定的な結果であった場合には、当該結果をサブルーチンの実行結果としてプログラム本体部11Aに返す機能と、第2の確認段階の実行結果が否定的な結果であった場合には、当該アプリケーションプログラムの実行を中止する機能(アプリケーションを終了して、制御をOSプログラムに返す機能)とを組み込んでおけばよい。   When such an operation is adopted, the program body 11A continues to receive a subroutine call instruction for calling the falsification check routine F and subsequent instruction groups when a positive result is returned from the falsification check routine F. A function for incorporating a program to be executed and returning to the falsification check routine F, if the execution result of the second confirmation stage is an affirmative result, to the program body 11A as a subroutine execution result. If the execution result of the second confirmation stage is a negative result, a function for stopping the execution of the application program (a function for terminating the application and returning control to the OS program) is incorporated. Just keep it.

なお、改竄チェックルーチンFの実行は、できるだけ早く改竄検知を行うことができるように、できるだけ早い段階で行うのが好ましい。したがって、実用上は、プログラム本体部11Aには、アプリケーションプログラムの本来の機能を果たすための命令群の前に(たとえば、プログラム本体部11Aの先頭部分に)改竄チェックルーチンFをコールするサブルーチンコール命令を組み込んでおくようにし、アプリケーションプログラムの本来の機能に関する命令群が実行される前に、改竄の検知が行われるようにするのが好ましい。   The execution of the falsification check routine F is preferably performed as early as possible so that falsification can be detected as soon as possible. Therefore, in practice, the program body 11A has a subroutine call instruction for calling the falsification check routine F before a group of instructions for performing the original function of the application program (for example, at the head of the program body 11A). It is preferable that tampering is detected before the instruction group related to the original function of the application program is executed.

<8−2:プログラム保証者Gによる貸与形態>
§7では、プログラム保証者Gが介在する実施形態を述べた。このように、プログラム保証者Gが介在する場合は、第1の特定鍵K(s1)および第2の特定鍵K(s2)は、プログラム保証者Gから提供される鍵となり、改竄チェックルーチンFも、プログラム保証者Gから提供されるプログラムになる。
<8-2: Loan form by program guarantor G>
In §7, the embodiment in which the program guarantor G intervenes was described. Thus, when the program guarantor G intervenes, the first specific key K (s1) and the second specific key K (s2) are keys provided from the program guarantor G, and the tampering check routine F Is also a program provided by the program guarantor G.

この場合、プログラム保証者Gは、改竄チェックルーチンFと、第2の特定鍵K(s2)と、図15に示す各ユニット140,150,160,170,180としての機能をコンピュータに実行させるためのプログラムと、を含むデジタルデータの記録媒体を、プログラム提供者Aに貸し与えるようにすればよい。そうすれば、プログラム提供者Aは、汎用のコンピュータに、この記録媒体に記録されているデータやプログラムをインストールすることにより、図15に示す配布用ファイル作成装置を構成することができる(プログラム提供者Aの第1の鍵K(a1)および第2の鍵K(a2)については、自分が管理している鍵を鍵格納ユニット130に組み込む必要がある)。   In this case, the program guarantor G causes the computer to execute the functions of the falsification check routine F, the second specific key K (s2), and the units 140, 150, 160, 170, and 180 shown in FIG. A digital data recording medium including the above program may be lent to the program provider A. Then, the program provider A can configure the distribution file creation apparatus shown in FIG. 15 by installing the data and programs recorded in the recording medium in a general-purpose computer (program provision). As for the first key K (a1) and the second key K (a2) of the person A, it is necessary to incorporate the key managed by the user A into the key storage unit 130).

なお、第1の特定鍵K(s1)を含む改竄チェックルーチンFや、第2の特定鍵K(s2)は、本来、プログラム保証者Gが秘密状態で管理すべき情報であるため、これらは、十分なセキュリティが確保された電子トークン(たとえば、ICカードやUSBメモリなど)に格納した状態でプログラム提供者Aに貸与するようにし、プログラム提供者Aによる直接アクセスができない状態にしておくのが好ましい。   The falsification check routine F including the first specific key K (s1) and the second specific key K (s2) are information that the program guarantor G should originally manage in a secret state. It is preferable to lend the program provider A in a state where it is stored in an electronic token (for example, an IC card or a USB memory) with sufficient security so that the program provider A cannot directly access it. .

<8−3:プログラム提供者の識別コードの埋め込み>
前述したように、プログラム保証者Gが介在する実施形態を採用する場合、プログラム保証者Gは、プログラム提供者Aだけでなく、他のプログラム提供者B,C等に対しても同様のサービスを提供するのが一般的である。このような場合、各プログラム提供者A,B,Cに貸し与える改竄チェックルーチンF内に、各プログラム提供者(コンテンツプロバイダー)の識別コードを埋め込んでおくようにするのが好ましい。
<8-3: Embedding identification code of program provider>
As described above, when the embodiment in which the program guarantor G intervenes is adopted, the program guarantor G provides the same service not only to the program provider A but also to other program providers B and C. It is common to provide. In such a case, it is preferable to embed the identification code of each program provider (content provider) in the falsification check routine F that is lent to each program provider A, B, C.

そうすれば、各プログラム提供者A,B,Cが、汎用のコンピュータを用いて、それぞれ図15に示すような配布用ファイル作成装置を構築した場合、改竄チェックルーチン格納ユニット120に格納されている改竄チェックルーチンFに、プログラム提供者A,B,Cの識別コードが埋め込まれることになるので、各プログラム提供者A,B,Cが作成した配布用ファイル20Aに含まれている改竄チェックルーチンFにも識別コードが埋め込まれた状態になり、配布用ファイル20Aを解析すれば、どのプログラム提供者が作成したファイルであるかを確認することができる。   Then, when each program provider A, B, C constructs a distribution file creation device as shown in FIG. 15 using a general-purpose computer, it is stored in the falsification check routine storage unit 120. Since the identification codes of the program providers A, B, and C are embedded in the falsification check routine F, the falsification check routine F included in the distribution file 20A created by each program provider A, B, and C If the distribution file 20A is analyzed, it is possible to confirm which program provider created the file.

たとえば、プログラム保証者Gが、プログラム提供者A,B,Cに貸し与える改竄チェックルーチンFに、それぞれプログラム提供者A,B,Cの識別コードID(A),ID(B),ID(C)を埋め込んでおくようにすれば(最も単純な埋め込み方法としては、改竄チェックルーチンFのファイル名に識別コードID(A),ID(B),ID(C)を含ませればよい)、個々の改竄チェックルーチンF(A),F(B),F(C)は相互に区別することができるようになる。そうすれば、配布用ファイル20Aには、どのプログラム提供者に貸し与えた改竄チェックルーチンFが含まれているのかを確認することができるので、万一、改竄チェックルーチンF自体が漏洩するような事態が生じても、責任の所在を明確にすることができるようになる。   For example, the program guarantor G applies the identification codes ID (A), ID (B), ID (C) of the program providers A, B, and C to the falsification check routine F that is lent to the program providers A, B, and C, respectively. ) (The simplest embedding method is to include the identification code ID (A), ID (B), ID (C) in the file name of the falsification check routine F). The falsification check routines F (A), F (B), and F (C) can be distinguished from each other. Then, it can be confirmed which falsification check routine F lent to the program provider is included in the distribution file 20A, so that the falsification check routine F itself may leak. Even if a situation arises, the location of responsibility can be clarified.

<8−4:第1および第2の確認段階の役割分担>
これまで述べてきた実施形態は、アプリケーションパッケージ21Aに対する署名情報22Aの正当性を確認する第1の確認段階(アプリケーションパッケージ21Aが改竄されていないことを、署名情報22Aを利用して確認する段階)を、アプリケーション実行用のコンピュータのOSプログラムによって実行し、秘匿化対象データCに対する秘匿情報23Aの正当性を確認する第2の確認段階(署名情報22Aが改竄されていないことを、秘匿情報23Aを利用して確認する段階)を、アプリケーションパッケージ21Aに含まれる改竄チェックプログラムによって実行する、という役割分担を行っている。
<8-4: Division of roles in the first and second confirmation stages>
In the embodiments described so far, the first confirmation stage for confirming the validity of the signature information 22A for the application package 21A (stage for confirming that the application package 21A has not been tampered with using the signature information 22A). Is executed by the OS program of the computer for executing the application to confirm the validity of the confidential information 23A with respect to the confidential data C (the confidential information 23A indicates that the signature information 22A has not been tampered with). The division of roles is performed such that the step of using and confirming is executed by the falsification check program included in the application package 21A.

このような役割分担は、Android仕様のアプリケーションを配布して、Android端末においてこれを実行する環境では極めて有効である。すなわち、上記役割分担を行えば、本発明を実施する上で、Android端末側には何ら改変を加える必要はなく、配布対象となるAPKファイルを図15に示す装置で作成すれば足りる。   Such division of roles is extremely effective in an environment where an Android-specific application is distributed and executed on an Android terminal. That is, if the above roles are divided, it is not necessary to modify the Android terminal side to implement the present invention, and it is sufficient to create an APK file to be distributed with the apparatus shown in FIG.

しかしながら、本発明の適用は、現在のAndroid仕様のアプリケーションの配布および実行に限定されるものではないので、上記役割分担は、本発明に必須のものではない。   However, since the application of the present invention is not limited to the distribution and execution of the current Android-specific application, the above division of roles is not essential to the present invention.

たとえば、将来、Android仕様が変更になり、AndroidOS自身に、第2の確認段階を実行するプログラムが組み込まれるようになれば、配布する個々のアプリケーションパッケージ20Aには、第1の特定鍵K(s1)のみを組み込んでおけば足り、改竄チェックルーチンFのその余の部分は組み込む必要はなくなる。この場合、第2の確認段階はOSプログラムによって実行されることになり、改竄が検知された場合のアプリケーションの中止処理も、OSプログラムによって実行されることになる。別言すれば、第1の確認段階と第2の確認段階との双方が、OSプログラムによって行われることになる。   For example, if the Android specification is changed in the future and a program for executing the second confirmation stage is incorporated in the Android OS itself, each distributed application package 20A has a first specific key K (s1 ) Need only be incorporated, and the rest of the falsification check routine F need not be incorporated. In this case, the second confirmation stage is executed by the OS program, and application cancellation processing when tampering is detected is also executed by the OS program. In other words, both the first confirmation stage and the second confirmation stage are performed by the OS program.

逆に、将来、Android仕様が変更になり、現AndroidOSの機能から、第1の確認段階を行う処理機能が除外された場合には、第1の確認段階と第2の確認段階との双方を、アプリケーションプログラム側で行うようにすることも可能である。   Conversely, if the Android specification changes in the future, and the processing function that performs the first confirmation stage is excluded from the current Android OS functions, both the first confirmation stage and the second confirmation stage are performed. It is also possible to perform it on the application program side.

<8−5:秘匿情報の引き渡し方法の変形例>
本発明に係るアプリケーションプログラムの配布実行方法では、まず、配布プロセスにおいて秘匿情報を作成し、続いて、実行プロセスにおいて、この秘匿情報を利用した改竄有無の判定を行うことになる。したがって、配布プロセスで作成した秘匿情報を、何らかの方法で実行プロセスに引き渡す必要がある。これまで述べてきた実施形態は、配布用ファイル作成段階において作成する配布用ファイル内に、作成した秘匿情報を組み込むことにより、配布用ファイルとともに秘匿情報の引き渡しが行われるようにしていた。
<8-5: Modification of secret information delivery method>
In the application program distribution execution method according to the present invention, first, confidential information is created in the distribution process, and subsequently, in the execution process, the presence / absence of tampering using the confidential information is determined. Therefore, it is necessary to transfer the confidential information created in the distribution process to the execution process in some way. In the embodiment described so far, the confidential information is delivered together with the distribution file by incorporating the generated confidential information into the distribution file created in the distribution file creation stage.

たとえば、図5に示す実施形態の場合、秘匿情報23Aは配布用ファイル20A内に組み込まれた状態で配布されることになり、図9に示す実施形態の場合、秘匿情報23A′は配布用ファイル20A′内に組み込まれた状態で配布されることになり、図10に示す実施形態の場合、秘匿情報23A''は配布用ファイル20A''内に組み込まれた状態で配布されることになる。このように、秘匿情報を配布用ファイル内に組み込んでしまえば、アプリケーション実行用コンピュータは、配布用ファイルを入手した時点で、秘匿情報も併せて入手することが可能になる。   For example, in the embodiment shown in FIG. 5, the confidential information 23A is distributed in a state of being incorporated in the distribution file 20A. In the embodiment shown in FIG. 9, the confidential information 23A ′ is distributed. In the embodiment shown in FIG. 10, the confidential information 23A ″ is distributed in a state incorporated in the distribution file 20A ″. . As described above, if the confidential information is incorporated into the distribution file, the application execution computer can also acquire the confidential information when the distribution file is obtained.

ただ、秘匿情報の引き渡し方法は、必ずしも配布用ファイル内に組み込む方法に限定されるものではない。ここでは、秘匿情報の引き渡し方法の変形例を述べておく。図16は、図5に示す基本的な実施形態について、秘匿情報の引き渡し方法を変えた変形例を示すブロック図である。図の上段はプログラム提供者Aによって実行される配布プロセスを示し、下段はユーザUによって実行される実行プロセスを示している。この変形例の特徴は、配布プロセスで作成した秘匿情報23Aを、サーバ30を介して実行プロセスに引き渡す方法を採る点である。   However, the method of delivering confidential information is not necessarily limited to the method of incorporating it in the distribution file. Here, a modified example of the secret information delivery method will be described. FIG. 16 is a block diagram showing a modified example of the basic embodiment shown in FIG. 5 in which the secret information delivery method is changed. The upper part of the figure shows the distribution process executed by the program provider A, and the lower part shows the execution process executed by the user U. A feature of this modification is that a secret information 23A created in the distribution process is transferred to the execution process via the server 30.

すなわち、図5に示す基本的な実施形態の場合、秘匿情報23Aは配布用ファイル20Aに組み込まれて配布されることになるが、図16に示す変形例の場合、秘匿情報23Aはサーバ30に格納され、その代わりに、この秘匿情報23Aの所在を示す所在情報24Aが配布用ファイル20AAに組み込まれて配布されることになる。図5に示す配布用ファイル20Aと図16に示す配布用ファイル20AAとの相違は、前者の秘匿情報23Aが後者では所在情報24Aになっている点のみである。一般に、秘匿情報23Aのデータ容量が嵩むケースでは、秘匿情報23Aを配布用ファイル20Aに組み込んでしまうと、配布用ファイル20Aのデータ容量も嵩むことになる。このようなケースでは、図16に示す変形例を採れば、秘匿情報23Aに比べてデータ容量の小さい所在情報24Aを組み込んて配布用ファイル20AAを作成することができるので、配布用ファイル20AAのデータ容量を抑えることができ便利である。   That is, in the case of the basic embodiment shown in FIG. 5, the confidential information 23A is incorporated and distributed in the distribution file 20A. However, in the modified example shown in FIG. Instead, the location information 24A indicating the location of the confidential information 23A is incorporated into the distribution file 20AA and distributed. The only difference between the distribution file 20A shown in FIG. 5 and the distribution file 20AA shown in FIG. 16 is that the former confidential information 23A is location information 24A in the latter. In general, in a case where the data capacity of the confidential information 23A increases, if the confidential information 23A is incorporated into the distribution file 20A, the data capacity of the distribution file 20A also increases. In such a case, if the modification shown in FIG. 16 is adopted, the distribution file 20AA can be created by incorporating the location information 24A having a smaller data capacity than the confidential information 23A. Convenient because capacity can be reduced.

サーバ30は、アプリケーション実行用コンピュータがネットワークを介してアクセス可能なサーバであれば、どのようなサーバであってもかまわない。ここに示す例では、インターネットに接続された任意のファイルサーバをサーバ30として利用している。所在情報24Aは、サーバ30およびその中における秘匿情報23Aの格納場所を特定する情報であり、具体的には、秘匿情報23Aの格納場所を示すURLを所在情報24Aとして用いればよい。結局、図16に示す変形例の場合、プログラム提供者Aは、所在情報24Aが組み込まれた配布用ファイル20AAを配布することになる。一方、ユーザUは、この配布用ファイル20AAを入手することにより、所在情報24A(この例の場合は、秘匿情報23Aの格納場所を示すURL)を入手することができるので、この所在情報24Aを用いてインターネットにアクセスし、秘匿情報23Aを入手することが可能になる。   The server 30 may be any server as long as the application execution computer can be accessed via the network. In the example shown here, an arbitrary file server connected to the Internet is used as the server 30. The location information 24A is information for specifying the storage location of the server 30 and the confidential information 23A therein. Specifically, a URL indicating the storage location of the confidential information 23A may be used as the location information 24A. After all, in the modification shown in FIG. 16, the program provider A distributes the distribution file 20AA in which the location information 24A is incorporated. On the other hand, the user U can obtain the location information 24A (in this example, the URL indicating the storage location of the confidential information 23A) by obtaining the distribution file 20AA. It becomes possible to access the Internet by using it and obtain the confidential information 23A.

このように、この変形例においても、プログラム提供者AからユーザUに対して、秘匿情報23Aが引き渡される点は、これまで述べてきた実施形態と変わりはないので、秘匿情報23Aを用いた改竄有無判定処理も、これまで述べてきた実施形態と同様の処理を行えばよいことになる。要するに、本発明の配布プロセスにおける配布用ファイル作成段階では、アプリケーションパッケージと、署名情報と、秘匿情報もしくは秘匿情報の所在を示す所在情報と、を含む配布用ファイルを作成すればよく、実施プロセスにおける第2の確認段階では、入力した配布用ファイルに基づいて秘匿化対象データおよび秘匿情報を入手し、秘匿化対象データに対する秘匿情報の正当性を確認すればよい。   Thus, also in this modified example, the point that the confidential information 23A is handed over from the program provider A to the user U is the same as the embodiment described so far, and therefore, falsification using the confidential information 23A is performed. The presence / absence determination process may be performed in the same manner as in the embodiments described so far. In short, in the distribution file creation stage in the distribution process of the present invention, a distribution file including an application package, signature information, and location information indicating the location of confidential information or confidential information may be generated. In the second confirmation stage, the data to be concealed and the confidential information may be obtained based on the input distribution file, and the validity of the confidential information with respect to the data to be concealed may be confirmed.

配布用ファイル作成段階で、秘匿情報23Aを含む配布用ファイル20Aを作成した場合(図5に示す実施形態の場合)は、第2の確認段階で、配布用ファイル20Aから秘匿情報23Aを直接抽出することにより、秘匿情報23Aの入手を行うことができる。これに対して、配布用ファイル作成段階で、秘匿情報23Aを所定の格納場所(サーバ30)に格納する処理を行うとともに、当該格納場所を示す所在情報24Aを含む配布用ファイル20AAを作成した場合(図16に示す変形例の場合)は、第2の確認段階で、配布用ファイル20AAから所在情報24Aを抽出し、この所在情報24Aに基づいて格納場所(サーバ30)を認識し、格納場所(サーバ30)から秘匿情報23Aを取り出すことにより、当該秘匿情報の入手を行うことができる。   When the distribution file 20A including the confidential information 23A is generated at the distribution file creation stage (in the case of the embodiment shown in FIG. 5), the confidential information 23A is directly extracted from the distribution file 20A at the second confirmation stage. By doing so, the confidential information 23A can be obtained. On the other hand, when the process of storing the confidential information 23A in a predetermined storage location (server 30) is performed and the distribution file 20AA including the location information 24A indicating the storage location is created in the distribution file creation stage. (In the case of the modification shown in FIG. 16), in the second confirmation stage, the location information 24A is extracted from the distribution file 20AA, and the storage location (server 30) is recognized based on the location information 24A. By extracting the confidential information 23A from the (server 30), the confidential information can be obtained.

なお、サーバ30から秘匿情報23Aを入手する処理は、アプリケーション実行用コンピュータが、配布用ファイル20AAに含まれているアプリケーションについての第2の確認段階を実行するたびに毎回行うようにしてもよいが、実用上は、アプリケーション実行用コンピュータ内に、入力した個々の配布用ファイルについて、それぞれ秘匿情報を保存する保存場所(たとえば、アプリケーション実行用コンピュータ内の不揮発性メモリ内の、当該アプリケーションに割り当てられた領域)を設けておき、秘匿情報23Aを一度入手したら、これをその保存場所に保存するようにし、次回からは、この保存場所に保存されている秘匿情報23Aを利用するようにするのが好ましい。そうすれば、保存場所に秘匿情報23Aを保存した後は、インターネットに接続できない状態でも、当該アプリケーションを起動させることができる。   Note that the process of obtaining the confidential information 23A from the server 30 may be performed each time the application execution computer executes the second confirmation step for the application included in the distribution file 20AA. In practice, the storage location for storing the confidential information of each input distribution file in the application execution computer (for example, the storage location assigned to the application in the nonvolatile memory in the application execution computer) Area), and once the confidential information 23A is obtained, it is preferably stored in the storage location, and from the next time, it is preferable to use the confidential information 23A stored in the storage location. . Then, after the confidential information 23A is stored in the storage location, the application can be activated even in a state where the connection to the Internet is not possible.

すなわち、アプリケーション実行用コンピュータが第2の確認段階を実行する際に、所定の保存場所に、必要な秘匿情報23Aが保存されていない場合には、配布用ファイル20AAから所在情報24Aを抽出し、この所在情報24Aに基づいて格納場所(サーバ30)を認識し、この格納場所(サーバ30)から秘匿情報23Aを取り出すことにより、当該秘匿情報の入手を行うとともに、入手した秘匿情報23Aをアプリケーション実行用コンピュータ内の保存場所に保存する処理を行うようにすればよい。そして、アプリケーション実行用コンピュータが第2の確認段階を実行する際に、当該コンピュータ内の保存場所に、必要な秘匿情報23Aが保存されている場合には、この保存場所から秘匿情報23Aを取り出すことにより、当該秘匿情報の入手を行うようにすればよい。   That is, when the application execution computer executes the second confirmation step, if the necessary confidential information 23A is not stored in a predetermined storage location, the location information 24A is extracted from the distribution file 20AA, Based on the location information 24A, the storage location (server 30) is recognized, and the confidential information 23A is extracted from the storage location (server 30), thereby obtaining the confidential information and executing the acquired confidential information 23A as an application. The process of saving in the storage location in the computer for use may be performed. When the application execution computer executes the second confirmation stage, if the necessary confidential information 23A is stored in the storage location in the computer, the confidential information 23A is extracted from the storage location. Thus, the confidential information may be obtained.

もちろん、ここで述べる変形例は、図5に示す基本的な実施形態だけでなく、その他の実施形態に対しても適用可能である。また、配布プロセスにおいて、秘匿情報23Aを任意のサーバに格納する際には、必ずしも1箇所のサーバ30に格納しておく必要はなく、複数箇所に分散して格納するようにしてもよい。たとえば、秘匿情報23Aを3つのファイルに分割し、第1の分割ファイルを第1のサーバ31に格納し、第2の分割ファイルを第2のサーバ32に格納し、第3の分割ファイルを第3のサーバ33に格納する、という格納方法を採ってもかまわない。この場合、所在情報24Aは、これら3箇所の格納場所を示す情報ということになる。また、この場合、所在情報24Aに、分割方法を示す情報も含ませておけば、実行プロセスにおいて、3箇所から入手した個々の分割ファイルに対して、分割方法を参照した合成処理を行い、元の秘匿情報23Aを復元することができる。   Of course, the modification described here is applicable not only to the basic embodiment shown in FIG. 5 but also to other embodiments. Further, in the distribution process, when the confidential information 23A is stored in an arbitrary server, it is not always necessary to store the confidential information 23A in one server 30, and it may be distributed and stored in a plurality of locations. For example, the confidential information 23A is divided into three files, the first divided file is stored in the first server 31, the second divided file is stored in the second server 32, and the third divided file is stored in the first file. The storage method of storing in the third server 33 may be adopted. In this case, the location information 24A is information indicating these three storage locations. In this case, if the location information 24A also includes information indicating the division method, the execution process performs a synthesis process with reference to the division method on the individual divided files obtained from the three locations. The secret information 23A can be restored.

ここで述べた変形例を採用する場合、図15に示す配布用ファイル作成装置にも若干の変更を行う必要がある。前述の§7で説明した配布用ファイル作成装置の場合、配布用ファイル作成ユニット180は、秘匿情報23Aを含む配布用ファイル20Aを作成し、改竄チェックルーチン格納ユニット120に格納されている改竄チェックルーチンFは、配布用ファイル20Aから秘匿情報23Aを抽出することにより、当該秘匿情報の入手を行うことになっていた。   When adopting the modification described here, it is necessary to make some changes to the distribution file creation apparatus shown in FIG. In the case of the distribution file creation device described in §7, the distribution file creation unit 180 creates the distribution file 20A including the confidential information 23A and stores the falsification check routine stored in the falsification check routine storage unit 120. F is to obtain the confidential information by extracting the confidential information 23A from the distribution file 20A.

これに対して、ここで述べた変形例を採用する場合は、配布用ファイル作成ユニット180が、秘匿情報作成ユニット170によって作成された秘匿情報23Aを所定の格納場所(たとえば、図16のサーバ30)に格納する処理を行うとともに、当該格納場所を示す所在情報24Aを含む配布用ファイル20AAを作成し、改竄チェックルーチン格納ユニット120に格納されている改竄チェックルーチンFが、この配布用ファイル20AAから所在情報24Aを抽出し、この所在情報24Aに基づいて格納場所(たとえば、図16のサーバ30)を認識し、認識した格納場所から秘匿情報23Aを取り出すことにより、当該秘匿情報の入手を行うようにすればよい。   On the other hand, when the modification described here is adopted, the distribution file creation unit 180 stores the secret information 23A created by the secret information creation unit 170 in a predetermined storage location (for example, the server 30 in FIG. 16). ), A distribution file 20AA including location information 24A indicating the storage location is created, and the falsification check routine F stored in the falsification check routine storage unit 120 is read from the distribution file 20AA. The location information 24A is extracted, the storage location (for example, the server 30 in FIG. 16) is recognized based on the location information 24A, and the confidential information 23A is extracted from the recognized storage location, thereby obtaining the confidential information. You can do it.

また、アプリケーション実行用コンピュータ内に秘匿情報23Aの保存場所を確保するようにする場合は、改竄チェックルーチン格納ユニット120に格納されている改竄チェックルーチンFが、当該改竄チェックルーチンを実行しているコンピュータ内に設けられた秘匿情報の保存場所に秘匿情報23Aが保存されていない場合には、配布用ファイル20AAから所在情報24Aを抽出し、この所在情報24Aに基づいて格納場所を認識し、この格納場所から秘匿情報23Aを取り出すことにより、当該秘匿情報の入手を行うとともに、入手した秘匿情報23Aを保存場所に保存する処理を行い、この保存場所に秘匿情報23Aが保存されている場合には、この保存場所から秘匿情報23Aを取り出すことにより、当該秘匿情報の入手を行うようにすればよい。   Further, when securing the storage location of the confidential information 23A in the application execution computer, the falsification check routine F stored in the falsification check routine storage unit 120 is the computer executing the falsification check routine. If the confidential information 23A is not stored in the storage location of the confidential information provided within, the location information 24A is extracted from the distribution file 20AA, the storage location is recognized based on the location information 24A, and this storage is stored. When the confidential information 23A is extracted from the location, the confidential information is obtained, and the obtained confidential information 23A is stored in a storage location. When the confidential information 23A is stored in the storage location, The confidential information 23A is extracted from the storage location to obtain the confidential information. It should be so.

<<< §9.実行許可リストに基く実行制御 >>>
本発明に係るアプリケーションプログラムの実行方法の特徴は、アプリケーションプログラムの実行プロセスにおいて、実行許可リストに予め登録されているアプリケーションプログラムについてのみ、その実行を許可するという実行制御方法を採用しつつ、§1〜§8において述べた改竄検知方法を実行し、改竄が検知されなかったアプリケーションプログラムについては、リストへの自動登録を行うようにする点にある。そこで、まず、実行許可リストに基いてアプリケーションプログラムの実行制御を行う具体的な方法を説明する。
<<< §9. Execution control based on execution permission list >>>
The application program execution method according to the present invention is characterized in that, in the application program execution process, an execution control method that permits execution of only an application program registered in advance in the execution permission list is §1. The falsification detection method described in .about.§8 is executed, and the application program in which falsification is not detected is automatically registered in the list. First, a specific method for controlling the execution of an application program based on the execution permission list will be described.

ここでは、これまで述べてきた例と同様に、Android(登録商標)をOSとして採用したスマートホンやタブレット型電子機器(いわゆる、Android端末)への適用例を述べることにする。この場合、Android端末に与えられるデータファイル(改竄チェック機能付アプリケーションプログラムが含まれているデータファイル)は、たとえば、図5に示すような配布用ファイル20A(APKファイル)の形式で配布されることになる。ここで述べる実施形態では、アプリケーションプログラムの実行端末において、実行許可リストに基づく制御を行うために、専用のプログラムが用意される。このプログラムは、OSの管理下で動作するアプリケーションプログラムの1つであるが、その役割は、専ら他のアプリケーションプログラムの動作を監視し、その制御を行うことにある。そこで、本願では、このプログラムのことを、他のアプリケーションプログラムとは区別して「監視プログラム」と呼ぶことにする。また、以下の説明では、単に「アプリケーションプログラム」といった場合、「監視プログラム」を除くアプリケーションプログラムを意味するものとする。   Here, as in the example described so far, an application example to a smart phone or a tablet electronic device (so-called Android terminal) adopting Android (registered trademark) as an OS will be described. In this case, the data file (data file including the application program with a tamper check function) given to the Android terminal is distributed in the form of a distribution file 20A (APK file) as shown in FIG. 5, for example. become. In the embodiment described here, a dedicated program is prepared for performing control based on the execution permission list in the execution terminal of the application program. This program is one of application programs that operate under the management of the OS, and its role is to monitor and control the operation of other application programs exclusively. Therefore, in the present application, this program is called a “monitoring program” in distinction from other application programs. Further, in the following description, an “application program” simply means an application program excluding a “monitoring program”.

Androidをはじめとする多くのOSは、複数のアプリケーションプログラムを並行して実行させるマルチタスク処理機能を有している。もちろん、一般的なCPUは、同時には1つのアプリケーションプログラムを実行する機能しか有していないが、マルチタスク処理機能を有するOSプログラムは、複数のアプリケーションプログラムを所定のタイミングで順次切り替えながらCPUに実行させる処理を行うことができる。したがって、複数のアプリケーションプログラムを同時に起動状態にして、これらを時分割で切り替えることにより、あたかも複数のアプリケーションプログラムが同時に実行されているような制御が可能になる。   Many OSs including Android have a multitask processing function for executing a plurality of application programs in parallel. Of course, a general CPU has only a function for executing one application program at the same time, but an OS program having a multitask processing function is executed by the CPU while sequentially switching a plurality of application programs at a predetermined timing. Can be performed. Therefore, by making a plurality of application programs active at the same time and switching them in a time division manner, it is possible to perform control as if the plurality of application programs are being executed simultaneously.

ここで述べる実施形態の場合、監視プログラムは、いわゆる「常駐プログラム」として常に起動状態に維持され、他のアプリケーションプログラムの監視を行う。上述したように、マルチタスク処理機能を有するOS制御下では、複数のアプリケーションプログラムを同時に起動状態にすることができるので、監視プログラムを常に起動状態に維持したとしても、他のアプリケーションプログラムの起動に支障が生じることはない。なお、この監視プログラムそれ自体が攻撃されて改竄されてしまうことを防ぐために、実用上は、何らかの耐タンパ化処理が施された監視プログラムを用いるのが好ましい。   In the case of the embodiment described here, the monitoring program is always maintained in the activated state as a so-called “resident program” and monitors other application programs. As described above, under OS control having a multitask processing function, a plurality of application programs can be activated at the same time. Therefore, even if the monitoring program is always kept activated, other application programs can be activated. There will be no hindrance. In order to prevent the monitoring program itself from being attacked and tampered with, it is practically preferable to use a monitoring program subjected to some tamper resistance processing.

図17は、アプリケーションプログラムの実行端末に組み込まれた監視プログラムによって実行される監視ルーチンの手順を示す流れ図である。標題部に「監視プログラム(1)」と記載されているのは、ここに示す手順が、監視プログラムに含まれている監視ルーチンの手順であることを示すものである。後述するように、この監視プログラムには、「監視プログラム(2)」として示すリスト自動登録ルーチンの手順も含まれている。   FIG. 17 is a flowchart showing the procedure of the monitoring routine executed by the monitoring program incorporated in the application program execution terminal. “Heading program (1)” is described in the title section to indicate that the procedure shown here is the procedure of the monitoring routine included in the monitoring program. As will be described later, this monitoring program includes a procedure of a list automatic registration routine indicated as “monitoring program (2)”.

まず、ステップS21において、現在、起動状態にあるアプリケーションプログラムの識別コードを認識する起動アプリ認識段階が実行される。Androidをはじめとする一般的なOSには、個々のアプリケーションプログラムについて、識別コード・起動時・終了時を示すログ情報を記録する処理機能が備わっている。したがって、監視プログラムによって起動アプリ認識段階S21を実行する際には、このログ情報を参照することにより、現時点で起動状態にあるアプリケーションプログラムの識別コードを認識することができる。   First, in step S21, an activated application recognition stage for recognizing an identification code of an application program currently in an activated state is executed. A general OS such as Android has a processing function for recording log information indicating an identification code, start time, and end time for each application program. Therefore, when executing the activation application recognition step S21 by the monitoring program, the identification code of the application program currently in the activated state can be recognized by referring to the log information.

図18は、AndroidOSによって作成されたログ情報の一例を示す図である。この例では、AP3,AP1,AP6といったアプリケーションプログラムのファイル名を個々のアプリケーションを特定する識別コードとして用いている。そして、この識別コードと、起動もしくは終了のいずれか一方の動作と、日時と、を並べた1行分のデータが単位ログを構成しており、このような単位ログを時系列で複数組並べた集合体によってログ情報が構成されている。   FIG. 18 is a diagram illustrating an example of log information created by the Android OS. In this example, file names of application programs such as AP3, AP1, and AP6 are used as identification codes that specify individual applications. One line of data in which this identification code, one of activation and termination operations, and date and time are arranged constitutes a unit log, and a plurality of such unit logs are arranged in time series. Log information is configured by the aggregate.

具体的には、1行目の単位ログは、識別コード「AP3」で特定されるアプリケーションAP3が、2012年7月21日16時51分に起動されたことを示し、2行目の単位ログは、識別コード「AP1」で特定されるアプリケーションAP1が、2012年7月21日16時58分に起動されたことを示し、3行目の単位ログは、識別コード「AP1」で特定されるアプリケーションAP1が、2012年7月21日17時14分に終了されたことを示し、4行目の単位ログは、識別コード「AP6」で特定されるアプリケーションAP6が、2012年7月21日17時33分に起動されたことを示し、5行目の単位ログは、識別コード「AP3」で特定されるアプリケーションAP3が、2012年7月21日17時53分に終了されたことを示している。結局、図示のようなログ情報が得られた時点では、アプリケーションAP6のみが起動状態であるとの認識がなされる。   Specifically, the unit log on the first line indicates that the application AP3 specified by the identification code “AP3” was started at 16:51 on July 21, 2012, and the unit log on the second line Indicates that the application AP1 specified by the identification code “AP1” was started at 16:58 on July 21, 2012, and the unit log on the third line is specified by the identification code “AP1”. The application AP1 has been terminated at 17:14 on July 21, 2012, and the unit log on the fourth line shows that the application AP6 identified by the identification code “AP6” The unit log on the fifth line indicates that the application AP3 identified by the identification code “AP3” was completed at 17:53 on July 21, 2012. It is shown that was. Eventually, when log information as shown in the figure is obtained, it is recognized that only the application AP 6 is in an activated state.

AndroidOSは、インストールされているアプリケーションプログラムが起動されたり、終了されたりするたびに、図示のようなログ情報をOS用の記録領域に記録してゆくことになる。もちろん、監視プログラムもアプリケーションプログラムの1つであるので、監視プログラム自身の起動や終了を示すログも、ログ情報として記録されることになる。   The Android OS records log information as shown in the OS recording area every time an installed application program is activated or terminated. Of course, since the monitoring program is one of the application programs, a log indicating activation and termination of the monitoring program itself is recorded as log information.

一方、監視プログラム用の記録領域には、図19に例示するような実行許可リストが用意されている。この実行許可リストは、実行が許可されているアプリケーションプログラムの識別コードを記録したリストであり、いわば「ホワイトリスト」と呼ぶべきリストである。図19(a) に示す例は、AP1,AP2,AP3といったアプリケーションプログラムのファイル名を個々のアプリケーションを特定する識別コードとして用い、これら識別コードを列挙することにより実行許可リストが構成されている。   On the other hand, an execution permission list illustrated in FIG. 19 is prepared in the monitoring program recording area. This execution permission list is a list in which identification codes of application programs that are permitted to be executed are recorded. In other words, the execution permission list is called a “white list”. In the example shown in FIG. 19A, the file names of application programs such as AP1, AP2, and AP3 are used as identification codes for identifying individual applications, and the execution permission list is configured by enumerating these identification codes.

これに対して、図19(b) に示す例は、アプリケーションプログラムのファイル名にそのバージョン番号を括弧書きで付加したものを識別コードとして用いたものであり、バージョンが異なるアプリケーションプログラムには、それぞれ異なる識別コードが付与され、相互に区別されることになる。たとえば、同一のファイル名AP1をもったアプリケーションプログラムであっても、バージョン1.0のプログラムには識別コードAP1(1.0)が付与され、バージョン2.0のプログラムには識別コードAP1(2.0)が付与され、相互に異なるアプリケーションプログラムとして取り扱われることになる。なお、バージョンを区別して取り扱う場合は、図18に示すログ情報にも、AP1(1.0)のようにバージョン番号を付加した識別コードを用いるようにする。   On the other hand, the example shown in FIG. 19 (b) uses an application program file name with the version number added in parentheses as an identification code. Different identification codes are assigned and distinguished from each other. For example, even if the application program has the same file name AP1, the identification code AP1 (1.0) is assigned to the version 1.0 program, and the identification code AP1 (2) is assigned to the version 2.0 program. .0) are assigned and are handled as different application programs. In the case of handling the versions separately, an identification code to which a version number is added is also used for the log information shown in FIG. 18 as AP1 (1.0).

さて、図17に示す起動アプリ認識段階S21において、現時点で起動状態にあるアプリケーションプログラム(以下、単に、起動アプリという)の識別コードが認識できたら、続いて、認識した識別コードが実行許可リストに登録されているか否かを判定する登録有無判定段階が実行される。すなわち、ステップS22において、図19(a) に示すような実行許可リストが参照され、ステップS23において、認識された起動アプリの識別コードがリストに掲載されているか否かが判定される。なお、ステップS21において起動アプリが複数認識された場合は、ステップS22以下の処理は、ステップS28を経て、個々の起動アプリごとにそれぞれ繰り返し実行されることになる。   If the identification code of the application program that is currently activated (hereinafter simply referred to as the activation application) can be recognized in the activation application recognition step S21 shown in FIG. 17, then the recognized identification code is added to the execution permission list. A registration presence / absence determination step is performed to determine whether or not it is registered. That is, in step S22, an execution permission list as shown in FIG. 19A is referred to, and in step S23, it is determined whether or not the recognized activation application identification code is listed. When a plurality of activated apps are recognized in step S21, the processing in step S22 and subsequent steps is repeatedly executed for each activated app via step S28.

前述したように、図18に示すようなログ情報が得られた場合は、アプリケーションAP6が起動アプリとして認識されるので、ステップS22において、実行許可リストを参照することにより、識別コードAP6が掲載されているか否かが判定される。ここで、図19(a) に示すような実行許可リストが用意されていたとすると、識別コードAP6は掲載されているため、起動アプリAP6は登録済みのアプリケーションプログラムと判定されることになる。その結果、ステップS23からステップS28へ進むことになる。   As described above, when the log information as shown in FIG. 18 is obtained, the application AP6 is recognized as the activation application. Therefore, in step S22, the identification code AP6 is posted by referring to the execution permission list. It is determined whether or not. Here, if an execution permission list as shown in FIG. 19A is prepared, since the identification code AP6 is posted, the activation application AP6 is determined to be a registered application program. As a result, the process proceeds from step S23 to step S28.

これに対して、登録有無判定段階において未登録と判定された場合、すなわち、ステップS23においてリストに掲載されていないと判定された場合は、ステップS24へ進み登録照会段階が行われる。たとえば、ログ情報から、アプリケーションプログラムAP7が起動アプリとして認識された場合は、識別コードAP7は図19(a) に示す実行許可リストには掲載されていないので、未登録アプリと判定される。その結果、ステップS23からステップS24へと進み、登録照会段階が実行される。   On the other hand, when it is determined that it is unregistered in the registration presence / absence determination step, that is, when it is determined that it is not listed in the list in step S23, the process proceeds to step S24 and a registration inquiry step is performed. For example, when the application program AP7 is recognized as a startup application from the log information, the identification code AP7 is not listed in the execution permission list shown in FIG. As a result, the process proceeds from step S23 to step S24, and the registration inquiry stage is executed.

ステップS24の登録照会段階では、当該未登録アプリAP7を実行許可リストに登録するか否かをユーザに問い合わせる処理が行われる。たとえば、Android端末のディスプレイ画面上に、図20に示すようなメッセージ画面を提示する処理を行えばよい。ユーザは、このようなメッセージ画面による問い合わせに対して、「登録する」ボタンまたは「登録しない」ボタンをタップすることにより回答を行う。「登録する」旨の回答は、未登録アプリAP7を登録して実行する指示に相当し、「登録しない」旨の回答は、未登録アプリAP7を登録せず、実行もしない指示に相当する。   In the registration inquiry stage of step S24, a process of inquiring the user whether or not to register the unregistered application AP7 in the execution permission list is performed. For example, a process of presenting a message screen as shown in FIG. 20 on the display screen of the Android terminal may be performed. The user responds to such an inquiry on the message screen by tapping the “Register” button or the “Do not register” button. The answer “register” corresponds to an instruction to register and execute the unregistered application AP7, and the answer “do not register” corresponds to an instruction not to register and execute the unregistered application AP7.

ユーザがいずれかのボタンをタップして、問い合わせに対する回答を行うと、当該回答に基づいて回答処理段階が行われる。すなわち、「登録する」ボタンのタップによって登録する旨の回答があった場合には、ステップS25からステップS26へと進み、当該未登録アプリAP7の識別コードを新たに実行許可リストに登録する処理が行われる。この場合、起動状態にある当該アプリAP7は、正式に実行が許可されたことになり、そのまま実行し続けることになる。一方、「登録しない」ボタンのタップによって登録しない旨の回答があった場合には、ステップS25からステップS27へと進み、当該未登録アプリAP7の実行を中止させる処理が行われる。   When the user taps one of the buttons and makes an answer to the inquiry, an answer processing stage is performed based on the answer. That is, if there is an answer to register by tapping the “Register” button, the process proceeds from step S25 to step S26, and processing for newly registering the identification code of the unregistered application AP7 in the execution permission list is performed. Done. In this case, the application AP7 in the activated state is officially permitted to be executed and continues to be executed as it is. On the other hand, if there is a reply indicating that registration is not performed by tapping the “not register” button, the process proceeds from step S25 to step S27, and processing for stopping execution of the unregistered application AP7 is performed.

以上述べたステップS22〜S27の処理が、全起動アプリについて完了するまで、ステップS28を介して繰り返し実行されることになる。そして、全起動アプリについて処理が完了したら、ステップS28からステップS29へ進み、監視プログラムに対する終了指示が与えられていない限り、再び、ステップS21からの処理が繰り返されることになる。前述したとおり、この監視プログラムは、本来、「常駐プログラム」として常に起動状態に維持され、他のアプリケーションプログラムの監視を行うべきものである。したがって、通常は、ユーザによって監視プログラムに対する終了指示が与えられることはなく、ステップS29からステップS21へ戻る処理が繰り返されることになる。   The processes in steps S22 to S27 described above are repeatedly executed through step S28 until the processes for all the activated applications are completed. When the processes for all activated applications are completed, the process proceeds from step S28 to step S29, and the process from step S21 is repeated again unless an end instruction for the monitoring program is given. As described above, this monitoring program is originally always maintained in the activated state as a “resident program” and should monitor other application programs. Therefore, normally, the user does not give an end instruction for the monitoring program, and the process of returning from step S29 to step S21 is repeated.

上述したように、マルチタスク処理機能を有するOS制御下では、同時に起動状態となっている複数のアプリケーションプログラムが所定のタイミングで切り替えられながら順番に実行されることになる。したがって、図17に示す監視プログラムによる監視ルーチンの手順においても、ある時点で中断され、別なアプリケーションプログラムの実行に制御が移り、再び監視プログラムに制御が戻ってきた時点で中断されていた手順が再開される、という処理が繰り返されることになる。   As described above, under OS control having a multitask processing function, a plurality of application programs that are simultaneously activated are sequentially executed while being switched at a predetermined timing. Therefore, even in the procedure of the monitoring routine by the monitoring program shown in FIG. 17, there is a procedure that is interrupted when the control is interrupted at a certain point, control is transferred to the execution of another application program, and control returns to the monitoring program again. The process of being resumed is repeated.

もっとも、マルチタスク処理によるアプリケーションプログラムの切替期間は、msec程度のオーダーであるため、ユーザの立場からは、監視プログラムを含めた複数のアプリケーションプログラムが同時に動作しているように見える。たとえば、新たなアプリケーションプログラムAP7を起動させると、監視プログラムに制御が移った段階で、アプリAP7が起動アプリとして認識され、ステップS24の登録照会段階が行われる。したがって、ユーザから見ると、アプリAP7を起動させる操作を行ったら、直ちに図20に示すようなメッセージ画面が表示された状態になるので、監視プログラムの処理動作に切り替わったという違和感は生じない。   However, since the switching period of the application program by the multitask processing is on the order of about msec, it seems that a plurality of application programs including the monitoring program are operating simultaneously from the viewpoint of the user. For example, when the new application program AP7 is activated, the application AP7 is recognized as an activated application when the control is transferred to the monitoring program, and the registration inquiry step in step S24 is performed. Therefore, from the viewpoint of the user, when an operation for starting the application AP7 is performed, a message screen as shown in FIG. 20 is immediately displayed, so that there is no sense of incongruity that the operation has been switched to the processing operation of the monitoring program.

なお、監視プログラムもアプリAP7も、アプリケーションプログラムという点では対等であり、いずれもOSプログラムの制御下で動作するプログラムであるが、OSの機能を利用して、一方のアプリケーションプログラムから他方のアプリケーションプログラムを強制終了させることが可能である。ステップS27の実行中止処理も、このようなOSの機能を利用して、監視プログラムからアプリAP7を強制終了させる方法を採ればよい。具体的には、監視プログラムからOSに対して、アプリAP7を強制終了させるコマンドを引き渡すようにすれば、OSの制御機能により、アプリAP7を強制終了させ、実行を中止させることができる。   Note that both the monitoring program and the application AP7 are equivalent in terms of application programs, and both are programs that operate under the control of the OS program. However, by using the function of the OS, one application program can be changed from the other application program to the other application program. Can be forcibly terminated. The execution stop processing in step S27 may be performed by using the OS function to forcibly terminate the application AP7 from the monitoring program. Specifically, if a command for forcibly terminating the application AP7 is delivered from the monitoring program to the OS, the application AP7 can be forcibly terminated and the execution can be stopped by the control function of the OS.

結局、監視プログラムは、図17に示す監視ルーチンを継続的に実行することにより、実行許可リストに登録されていない未登録アプリが起動状態になったか否かを常に監視する処理を行い、もし未登録アプリが起動状態になっていた場合には、ステップS24の登録照会段階を実行し、ユーザの回答に応じて、当該未登録アプリを登録して実行を許可するか、登録せずに実行を中止させるか、いずれかの処理を採ることになる。かくして、実行許可リストに登録されているアプリケーションプログラムのみが実行を許可されるような制御が可能になる。   Eventually, the monitoring program continuously executes the monitoring routine shown in FIG. 17 to perform a process of constantly monitoring whether or not an unregistered application not registered in the execution permission list has been activated. If the registered application is in the activated state, the registration inquiry step of step S24 is executed, and depending on the user's answer, the unregistered application is registered and allowed to execute or executed without being registered. Either stop or take one of the processes. Thus, it is possible to control such that only application programs registered in the execution permission list are permitted to be executed.

以上、図17の流れ図を参照しながら、監視プログラムによる監視ルーチンの手順を説明した。続いて、個々のアプリケーションプログラムを起動する際の手順を述べながら、監視プログラムとの関係を説明しよう。   The monitoring routine procedure by the monitoring program has been described above with reference to the flowchart of FIG. Next, let's explain the relationship with the monitoring program, describing the procedure for starting each application program.

まず、「通常アプリ」を起動するときの処理手順を図21の流れ図を参照して説明する。ここでいう「通常アプリ」とは、自己改竄チェック機能を有していない、従来の一般的なアプリケーションプログラム(たとえば、図1に示すアプリケーションプログラム10)を指す。アプリケーションプログラムは、OSの制御下で起動される。すなわち、特定のアプリケーションプログラムを起動する旨の指示が与えられると、OSが当該特定のアプリケーションプログラムを実行するための環境を整える作業を行う。そして、準備が完了した時点で、当該特定のアプリケーションプログラムのルーチンが実行されることになる。   First, the processing procedure when starting the “normal application” will be described with reference to the flowchart of FIG. Here, the “normal application” refers to a conventional general application program (for example, the application program 10 shown in FIG. 1) that does not have a self-tampering check function. The application program is activated under the control of the OS. That is, when an instruction to start a specific application program is given, the OS performs an operation for preparing an environment for executing the specific application program. When the preparation is completed, the routine of the specific application program is executed.

図21の流れ図は、「通常アプリ」に対して起動指示が与えられた場合の処理手順を示している。起動指示は、たとえば、ユーザによる起動操作によって与えられる。Android端末の場合、ユーザがホーム画面上で特定のアプリケーションプログラムのアイコンをタップする操作を行うと、当該プログラムに対する起動指示が与えられる。なお、既に述べたとおり、起動指示は、必ずしもユーザから与えられるとは限らず、場合によっては、OSや別なアプリケーションプログラムによって与えられる場合もある。   The flowchart of FIG. 21 shows a processing procedure when an activation instruction is given to the “normal application”. The activation instruction is given by an activation operation by the user, for example. In the case of an Android terminal, when the user performs an operation of tapping an icon of a specific application program on the home screen, an activation instruction for the program is given. As described above, the activation instruction is not necessarily given by the user, and in some cases, it may be given by the OS or another application program.

実は、この図21に示されているステップS7,S8,S11,S12の手順は、図7の流れ図に実行プロセスとして示されている同符号の各手順と同じものであり、各ステップの右脇に記載した括弧書きは、個々の手順の実行主体となるプログラムを示している。   In fact, the procedures of steps S7, S8, S11, and S12 shown in FIG. 21 are the same as the procedures of the same symbols shown as the execution process in the flowchart of FIG. The parentheses described in indicate the program that is the execution subject of each procedure.

まず、ステップS7では、OSプログラムによって、図6に示す第1の確認段階が行われる。この第1の確認段階は、アプリケーションパッケージ21Aに対する署名情報22Aの正当性を確認する処理であり、その詳細は§3で述べたとおりである。第1の確認段階において否定的な結果が得られた場合、すなわち、署名情報の正当性が確認されなかった場合には、「改竄あり」との判定がなされ、ステップS8を経てステップS11へと進み、当該アプリケーションの実行は中止される。すなわち、当該アプリケーションプログラムに含まれるルーチンが実行される前に、OSによって、実行が阻止されることになる。一方、第1の確認段階において肯定的な結果が得られた場合は、ステップS8を経てステップS12へと進み、当該アプリケーションプログラムが実行される。前述したとおり、Android端末の場合、ステップS7,S8,S11の処理は、OSプログラムの標準仕様に基づく処理である。   First, in step S7, the first confirmation stage shown in FIG. 6 is performed by the OS program. This first confirmation stage is a process of confirming the validity of the signature information 22A for the application package 21A, and details thereof are as described in §3. If a negative result is obtained in the first confirmation stage, that is, if the validity of the signature information is not confirmed, it is determined that “tampered”, and the process proceeds to step S11 via step S8. The execution of the application is stopped. That is, the execution is blocked by the OS before the routine included in the application program is executed. On the other hand, when a positive result is obtained in the first confirmation stage, the process proceeds to step S12 through step S8, and the application program is executed. As described above, in the case of an Android terminal, the processes in steps S7, S8, and S11 are processes based on the standard specification of the OS program.

続いて、「自己改竄チェック機能をもつアプリ」を起動するときの処理手順を図22の流れ図を参照して説明する。ここでいう「自己改竄チェック機能をもつアプリ」とは、図5に示すアプリケーションプログラム10Aのように、改竄チェックルーチンFを含んでおり、自分自身で改竄チェック処理を行う機能をもった本発明に特有のアプリケーションプログラムを指す。   Next, a processing procedure when starting “an app having a self-tampering check function” will be described with reference to a flowchart of FIG. The “application having a self-tampering check function” here includes a tampering check routine F as in the application program 10A shown in FIG. 5, and the present invention has a function of performing tampering check processing by itself. Refers to a specific application program.

図22の流れ図は、「自己改竄チェック機能をもつアプリ」に対して起動指示が与えられた場合の処理手順を示している。この場合も、起動指示は、ユーザから与えられる場合もあれば、OSや別なアプリケーションプログラムによって与えられる場合もある。この図22に示されている手順のうち、ステップS7〜S12の手順は、図7の流れ図に実行プロセスとして示されている同符号の各手順と同じものである。一方、ステップS13,S14の手順は、監視プログラムによるリスト自動登録ルーチンの手順である。この図22でも、各ステップの右脇に記載した括弧書きは、個々の手順の実行主体となるプログラムを示している。ステップS13,S14の脇に「監視プログラム(2)」と記載されているのは、これらの手順が監視プログラムに含まれているリスト自動登録ルーチンの手順であることを示すものである。   The flowchart of FIG. 22 shows a processing procedure when an activation instruction is given to “an app having a self-tampering check function”. Also in this case, the activation instruction may be given by the user, or may be given by the OS or another application program. Of the procedures shown in FIG. 22, the procedures of steps S7 to S12 are the same as the procedures of the same reference numerals shown as the execution process in the flowchart of FIG. On the other hand, the procedures of steps S13 and S14 are procedures of a list automatic registration routine by the monitoring program. Also in FIG. 22, the parentheses written on the right side of each step indicate a program that is an execution subject of each procedure. The fact that “monitoring program (2)” is written next to steps S13 and S14 indicates that these procedures are procedures of a list automatic registration routine included in the monitoring program.

要するに、図22の流れ図に示す手順は、図7の流れ図におけるステップS7以降の手順に、新たにステップS13,S14を追加したものである。§3で述べたとおり、「自己改竄チェック機能をもつアプリ」に対して起動指示が与えられた場合、まずOSプログラムにより、署名情報の正当性を確認する第1の確認段階S7が実行される。そして、改竄なしとの結果が得られた場合は、当該アプリが起動され、自分自身によって、秘匿情報の正当性を確認する第2の確認段階S9が実行される。これらステップS7〜S10の手順は改竄判定段階を構成することになり、ステップS10において肯定的な判定がなされた場合には、署名情報と秘匿情報の双方について正当性が確認されたことになり、最終的に改竄なしとの判定結果が得られたことになる。一方、ステップS8,S10のいずれかで否定的な判定がなされた場合には、改竄判定段階において改竄ありとの判定結果が得られたことになり、ステップS11へと進み、当該「自己改竄チェック機能をもつアプリ」の実行は中止される。   In short, the procedure shown in the flowchart of FIG. 22 is obtained by adding steps S13 and S14 to the procedure after step S7 in the flowchart of FIG. As described in §3, when an activation instruction is given to “an app having a self-tampering check function”, the OS program first executes the first confirmation step S7 for confirming the validity of the signature information. . If a result of no falsification is obtained, the application is activated, and a second confirmation step S9 for confirming the validity of the confidential information is performed by itself. The procedure of these steps S7 to S10 constitutes a tampering determination stage. If a positive determination is made in step S10, the validity of both the signature information and the confidential information is confirmed. In the end, the determination result that there was no falsification was obtained. On the other hand, if a negative determination is made in either step S8 or S10, a determination result indicating that there is a falsification is obtained in the falsification determination stage, and the process proceeds to step S11. Execution of “application with function” is stopped.

ステップS13,S14の手順は、この改竄判定段階において改竄されていない旨の判定がなされたアプリケーションプログラムの識別コードを、実行許可リストに登録するリスト自動登録段階の手順であり、監視プログラム内の自動登録ルーチンによって実行されることになる。すなわち、ステップS13において、当該「自己改竄チェック機能をもつアプリ」の識別コードが既に実行許可リストに登録されているか否かの判定が行われ、登録済みであった場合には、ステップS13からステップS12へと進むが、未登録であった場合には、ステップS14において、当該識別コードを実行許可リストに登録した上で、ステップS12へと進む処理が行われる。いずれの場合も、ステップS12において、当該アプリが実行されることになり、しかも当該アプリの識別コードが実行許可リストに登録された状態になる。   The procedure of steps S13 and S14 is a procedure of a list automatic registration stage for registering an identification code of an application program that has been determined not to be falsified in the falsification determination stage in the execution permission list. It will be executed by the registration routine. That is, in step S13, it is determined whether or not the identification code of the “app having the self-falsification check function” has already been registered in the execution permission list. The process proceeds to S12, but if it is not registered, the process proceeds to Step S12 after the identification code is registered in the execution permission list in Step S14. In any case, the application is executed in step S12, and the identification code of the application is registered in the execution permission list.

なお、図22の流れ図では、説明の便宜上、ステップS10→S13→S14→S12のような順序で各手順が実行される様子が示されているが、実際には、自己改竄チェック機能をもつアプリと監視プログラムとは、OSプログラムのマルチタスク処理機能により並行して動作していることになるので、この流れ図は必ずしも時系列的な順序を示しているわけではない。たとえば、ステップS10で肯定的な判定がなされた場合、アプリケーションプログラムは、監視プログラムに対して、自己の識別コードを引き渡して実行許可リストに登録する旨の登録コマンドを与え、そのままステップS12の実行段階を行えばよい。一方、登録コマンドを受け取った監視プログラムは、引き渡された識別コードについて、リスト自動登録段階(ステップS13,S14)を実行すればよい。あるいは、ステップS8を経てアプリが起動されたことを監視プログラムが検知した場合に、監視プログラムによって当該アプリの実行を一旦停止させ、ステップS9,S10をスキップしてステップS13の登録済か否かの判断を行うようにしてもよい。この場合、当該アプリが実行許可リストに登録済であれば、ステップS12へと進み、未登録であれば、ステップS9へ戻るようにすればよい。   Note that, in the flowchart of FIG. 22, for convenience of explanation, a state in which each procedure is executed in the order of steps S10 → S13 → S14 → S12 is shown, but in actuality, an application having a self-tampering check function Since the monitoring program and the monitoring program are operating in parallel by the multitask processing function of the OS program, this flowchart does not necessarily indicate a time-series order. For example, if an affirmative determination is made in step S10, the application program gives a registration command to hand over its identification code and register it in the execution permission list to the monitoring program, and the execution stage of step S12 as it is Can be done. On the other hand, the monitoring program that has received the registration command may execute the list automatic registration stage (steps S13 and S14) for the delivered identification code. Alternatively, when the monitoring program detects that the application has been started through step S8, the monitoring program temporarily stops execution of the application, skips steps S9 and S10, and determines whether or not step S13 has been registered. You may make it judge. In this case, if the application has been registered in the execution permission list, the process proceeds to step S12. If the application has not been registered, the process may return to step S9.

続いて、各アプリケーションプログラムと監視プログラムとの関係を見てみよう。まず、従来の「通常アプリ」を初めて起動した場合を考えてみる。この場合、図21の流れ図に示すように、ステップS7の第1の確認段階において署名情報の確認が行われ、改竄なしと判断された場合には、ステップS12において、当該「通常アプリ」が起動され、その実行が開始される。ただ、監視プログラムが並行して実行されているため、図17の流れ図のステップS21において、当該「通常アプリ」の起動が認識される。当該「通常アプリ」は実行許可リストには登録されていない未登録アプリであるため、ステップS24の登録照会段階が実行され、図20に例示するようなメッセージが提示され、登録するか否かの選択が行われる。もちろん、このとき、当該「通常アプリ」も起動状態にあるが、OSのマルチタスク処理機能により、監視プログラムに切り替えられた時点で、図示のメッセージが提示されることになる。   Next, let's look at the relationship between each application program and the monitoring program. First, consider the case where a conventional “normal application” is started for the first time. In this case, as shown in the flowchart of FIG. 21, the signature information is confirmed in the first confirmation stage of step S7. If it is determined that there is no falsification, the “normal application” is activated in step S12. And its execution is started. However, since the monitoring program is executed in parallel, the activation of the “normal application” is recognized in step S21 in the flowchart of FIG. Since the “normal application” is an unregistered application that is not registered in the execution permission list, the registration inquiry stage in step S24 is executed, and a message as illustrated in FIG. A selection is made. Of course, at this time, the “normal application” is also in the activated state, but the illustrated message is presented when the OS is switched to the monitoring program by the multitask processing function of the OS.

結局、ユーザがホーム画面やアプリ画面からアイコンをタップして未登録の「通常アプリ」を起動したり、他のアプリケーションプログラムからの指示に基づいて未登録の「通常アプリ」が起動したりした場合、図20のようなメッセージが提示され、実行許可リストに登録するか否かの選択を迫られることになる。「通常アプリ」の場合も、一応、署名情報の正当性確認が行われているので、ユーザは、当該「通常アプリ」の安全性をある程度認識することができる。ただ、前述したとおり、署名情報自体が改竄されているケースもあるので、安全性はそれほど高いものではない。したがって、ユーザは、当該アプリの実行により得られるであろうメリットと、改竄されていた場合に被るであろう損害のデメリットとを天秤にかけ、「登録する」/「登録しない」のいずれかを選択することになる。   Eventually, when the user taps an icon from the home screen or application screen to start an unregistered "normal application", or an unregistered "normal application" starts based on an instruction from another application program A message as shown in FIG. 20 is presented, and the user is forced to select whether or not to register in the execution permission list. In the case of the “normal application”, since the validity of the signature information is once confirmed, the user can recognize the safety of the “normal application” to some extent. However, as described above, since the signature information itself may be falsified, the security is not so high. Therefore, the user balances the merits that will be obtained by executing the app and the demerits of damage that would be incurred if tampered, and selects either “Register” or “Do not register” Will do.

ユーザが、当該アプリの実行を許可してもよいと判断した場合は、「登録する」ボタンをタップすればよい。そうすれば、ステップS26によって、当該アプリの識別コードが実行許可リストに登録されることになるので、以後、当該アプリに関して図20のようなメッセージが提示されることはなくなる。一方、ユーザが、少なくともその時点では、当該アプリの実行を許可しない方がよいと判断した場合は、「登録しない」ボタンをタップすればよい。そうすれば、ステップS27によって、当該アプリの実行は中止され、未登録の状態のままにおかれる。この場合、当該アプリを起動するたびに、図20のようなメッセージが提示されることになる。   If the user determines that the execution of the application may be permitted, the user may tap the “Register” button. Then, in step S26, the identification code of the application is registered in the execution permission list, and thereafter, no message as shown in FIG. 20 is presented for the application. On the other hand, if the user determines that it is better not to permit the execution of the application at least at that time, a “do not register” button may be tapped. If it does so, execution of the said application will be stopped by step S27, and it will be left in the unregistered state. In this case, every time the application is activated, a message as shown in FIG. 20 is presented.

このように、監視プログラムによって、常時、起動状態にあるアプリケーションプログラムの監視を行い、未登録アプリが起動状態にあることが検知されたら、ステップS24の登録照会段階によってユーザの判断を仰ぐようにすれば、実行対象となるプログラムを、ユーザの意思で実行許可リストに登録したプログラムのみに制限することができる。   As described above, the monitoring program constantly monitors the application program in the activated state, and if it is detected that the unregistered application is in the activated state, the user is asked to make a decision in the registration inquiry stage in step S24. For example, the program to be executed can be limited to only programs registered in the execution permission list by the user's intention.

しかしながら、実際には、上記運用は必ずしも奏功していない。その第1の理由は、一般ユーザにとって、個々のアプリケーションプログラムが改竄されているか否かを判定することが難しいためである。一般ユーザにとって、アプリケーションプログラムの信頼性を評価する手掛かりは、著名なソフトウエアであるとか、信頼性あるベンダーから供給されたソフトウエアであるとか、信頼性あるサイトからダウンロードしたソフトウエアであるといった情報であるが、クラッカーによって改竄されたソフトウエアが流通した場合、これらの手掛かりは役に立たない。したがって、実用上、一般ユーザが、個々のアプリケーションプログラムについて、改竄されているか否かを判定することは極めて困難である。   However, in practice, the above operation has not always been successful. The first reason is that it is difficult for general users to determine whether or not individual application programs have been tampered with. For general users, the information that the clues to evaluate the reliability of application programs are prominent software, software supplied by a reliable vendor, or software downloaded from a reliable site However, these clues are useless when software falsified by crackers is distributed. Therefore, in practice, it is extremely difficult for a general user to determine whether or not each application program has been tampered with.

そして、第2の理由は、一般ユーザにとって、図20に示すようなメッセージに応じて、未登録アプリを実行許可リストに手動登録する作業は煩雑であり、事実上、どのようなアプリケーションプログラムであっても「登録する」ボタンをタップすることが習慣化してしまうためである。もちろん、Android端末の工場出荷時にプリインストールされているアプリケーションプログラム(安全性が保証されているプログラム)については、当初から実行許可リストに掲載しておくようにすれば、初回起動時にユーザが手動登録の操作を行うことを省くことができるが、端末購入後にユーザがダウンロードした「通常アプリ」については、初回起動時にユーザが手動登録せざるを得ない。   The second reason is that it is complicated for a general user to manually register an unregistered application in the execution permission list in response to a message as shown in FIG. However, it is because it becomes customary to tap the “Register” button. Of course, application programs preinstalled at the factory of Android devices (programs with guaranteed safety) can be added to the execution permission list from the beginning, so that users can register manually at the first startup. However, the “normal application” downloaded by the user after purchasing the terminal must be manually registered at the first activation.

本発明に係る「自己改竄チェック機能をもつアプリ」を利用すれば、上記問題を解決することができる。すなわち、「自己改竄チェック機能をもつアプリ」を初めて起動した場合、図22の流れ図に示すように、改竄判定段階(ステップS7〜S10)によって署名情報の正当性および秘匿情報の正当性の確認が行われ、最終的に改竄なしと判定されると、監視プログラムによってリスト自動登録段階(ステップS13,S14)が実行される。これにより、当該アプリの識別コードが実行許可リストに自動登録されることになる。一方、並行して実行されている監視プログラムでは、図17の流れ図のステップS21において、当該「自己改竄チェック機能をもつアプリ」の起動が認識されるが、ステップS23において登録アプリと判定されるため、登録照会段階S24が実行されることはない。   If the “application having a self-tampering check function” according to the present invention is used, the above problem can be solved. That is, when “an app having a self-tampering check function” is activated for the first time, as shown in the flowchart of FIG. When it is determined that there is finally no falsification, the list automatic registration stage (steps S13 and S14) is executed by the monitoring program. Thereby, the identification code of the application is automatically registered in the execution permission list. On the other hand, in the monitoring program executed in parallel, the activation of the “app having a self-tampering check function” is recognized in step S21 in the flowchart of FIG. 17, but it is determined as a registered app in step S23. The registration inquiry step S24 is not executed.

結局、ユーザがホーム画面やアプリ画面からアイコンをタップして未登録の「自己改竄チェック機能をもつアプリ」を起動したり、他のアプリケーションプログラムからの指示に基づいて未登録の「自己改竄チェック機能をもつアプリ」が起動したりした場合、当該アプリが改竄されていなければ、そのまま実行が継続されることになる(改竄されていた場合は、図22のステップS11において実行中止される)。すなわち、ユーザには、図20のようなメッセージが提示されることはないので、ユーザが「登録する」/「登録しない」の選択を行う必要はなくなる。   Eventually, the user taps an icon on the home screen or application screen to start an unregistered “App with self-tampering check function”, or an unregistered “self-tampering check function based on instructions from other application programs” When the “app having“ ”is activated, if the application is not falsified, the execution is continued as it is (if it has been falsified, execution is stopped in step S11 of FIG. 22). That is, since the message as shown in FIG. 20 is not presented to the user, it is not necessary for the user to select “register” / “not register”.

もちろん、改竄判定段階(ステップS7〜S10)による判定結果は、必ずしも100%の精度をもった結果ではないが、一般ユーザによる判定に比べてはるかに高い精度をもった結果であり、実用上、十分に信頼できる結果である。しかも、そのような十分に信頼できる結果に基づいて、実行許可リストへの自動登録が行われることになる。かくして、ユーザは、改竄の有無を判定したり、煩雑な手動登録の操作を行ったりする必要がなくなる。このように、監視プログラムを導入した装置で、本発明に係る「自己改竄チェック機能をもつアプリ」を実行すれば、改竄なしと判定されたアプリケーションプログラムについては、ユーザに登録作業の負担を課すことなしに実行許可リストへの自動登録を行うことができるメリットが得られる。   Of course, the determination result in the tampering determination stage (steps S7 to S10) is not necessarily a result with 100% accuracy, but is a result with much higher accuracy than the determination by a general user. This is a sufficiently reliable result. In addition, automatic registration to the execution permission list is performed based on such a sufficiently reliable result. Thus, the user does not need to determine the presence or absence of tampering or perform a complicated manual registration operation. In this way, if the “app having a self-tampering check function” according to the present invention is executed on a device in which a monitoring program is introduced, the application program that is determined not to be tampered is burdened with a registration work on the user. There is an advantage that automatic registration to the execution permission list can be performed without the need.

<<< §10.実行許可リストに基く実行制御の変形例 >>>
最後に、§9で述べた実行許可リストに基く実行制御を行う上でのいくつかの変形例を述べておく。
<<< §10. Variation of execution control based on execution permission list >>>
Finally, some modified examples for performing execution control based on the execution permission list described in §9 will be described.

<10−1:アプリケーションプログラムのバーションの区別>
本発明に用いる実行許可リストは、実行が許可されたアプリケーションプログラムを特定する識別コードを掲載した「ホワイトリスト」というべきものである。図19(a) には、識別コードとして、各アプリケーションプログラムのファイル名を用いた例を示し、図19(b) には、ファイル名にバージョン番号を付加したコードを用いた例を示した。
<10-1: Differentiation of application program versions>
The execution permission list used in the present invention should be a “white list” on which an identification code for specifying an application program permitted to be executed is posted. FIG. 19A shows an example in which the file name of each application program is used as an identification code, and FIG. 19B shows an example in which a code with a version number added to the file name is used.

一般に、アプリケーションプログラムのバージョンアップ版を提供する場合、差分データファイルだけを配布する形態が採られたり、新バージョンのデータファイルをそっくり配布する形態が採られたりする。後者の場合は、新バージョンのプログラムは旧バージョンのプログラムとは全く別の独立したプログラムになるため、実行許可リスト上でも別個のアプリケーションプログラムとして取り扱うのが好ましい。したがって、実用上は、図19(b) に示す例のように、バージョンごとにそれぞれ異なる識別コードを付与するようにし、リスト自動登録段階、回答処理段階、および起動アプリ認識段階において、バージョンの異なるアプリケーションプログラムについては、それぞれ異なる識別コードを用いた処理を行うようにするのが好ましい。   In general, when an upgraded version of an application program is provided, a form in which only a differential data file is distributed is used, or a form in which a new version of a data file is distributed is used. In the latter case, the new version of the program is an entirely separate program from the old version of the program, and is therefore preferably handled as a separate application program on the execution permission list. Therefore, in practice, as shown in the example shown in FIG. 19B, different identification codes are assigned to the respective versions, and the versions are different in the list automatic registration stage, the answer processing stage, and the activation application recognition stage. The application program is preferably processed using different identification codes.

なお、バージョンの異なるアプリケーションプログラムを確実に区別するには、同一のファイル名をもったデータファイルに含まれるアプリケーションプログラムであっても、ハッシュ値が異なる場合は、異なるバージョンと認識するようにすればよい。一般に、アプリケーションプログラムを構成するデータの内容が完全に同一でなければ、ハッシュ値も同一にはならない。したがって、たとえば、アプリケーションプログラムを構成するデータ(APKファイル全体でもよいし、その一部でもよい)のハッシュ値を、当該アプリケーションプログラムの識別コードとして利用するようにすれば、バージョンの異なるアプリケーションプログラムの識別コードを確実に区別することができる。   In order to ensure that different versions of application programs are identified, even if the application programs included in the data file with the same file name have different hash values, they should be recognized as different versions. Good. In general, if the contents of data constituting the application program are not completely the same, the hash values are not the same. Therefore, for example, if a hash value of data constituting an application program (which may be the whole APK file or a part thereof) is used as an identification code of the application program, the identification of application programs of different versions is possible. The code can be reliably distinguished.

<10−2:実行許可リストの格納場所>
上述したAndroid端末を用いた実施形態の場合、実行許可リストは、Android端末内で「常駐プログラム」として動作する監視プログラムによってアクセスされる情報であるので、Android端末内の記憶装置内に格納するのが最も一般的である。ただ、実行許可リストの格納場所は、必ずしもAndroid端末内に限定されるわけではなく、たとえば、Android端末に接続される外部の記憶装置や、Android端末からネットワークを介してアクセスされるサーバ装置に実行許可リストを格納してもかまわない。
<10-2: Storage location of execution permission list>
In the case of the embodiment using the Android terminal described above, the execution permission list is information accessed by a monitoring program that operates as a “resident program” in the Android terminal, and therefore is stored in a storage device in the Android terminal. Is the most common. However, the storage location of the execution permission list is not necessarily limited to the Android terminal. For example, it is executed on an external storage device connected to the Android terminal or a server apparatus accessed via the network from the Android terminal. You can store the allow list.

この場合、リスト自動登録段階および回答処理段階で実行許可リストへの登録を行う際に、Android端末等のコンピュータは、外部の記憶装置もしくはサーバ装置内に保存された実行許可リストに対する登録を行い、登録有無判定段階では、当該外部の記憶装置もしくはサーバ装置内に保存された実行許可リストを参照することになる。   In this case, when performing registration to the execution permission list at the list automatic registration stage and the answer processing stage, a computer such as an Android terminal performs registration with respect to the execution permission list stored in an external storage device or server device, In the registration presence / absence determination stage, the execution permission list stored in the external storage device or server device is referred to.

<10−3:実行許可リストの暗号化>
§9で述べたアプリケーションプログラムの実行方法では、実行許可リストが重要な役割を果たすことになり、この実行許可リストが何らかの不正操作によって改竄されてしまうと、監視プログラムによる本来の実行制御機能は失われてしまう。そこで、より信頼性の高い制御を行うためには、実行許可リストに対して暗号化対策を施すようにすればよい。
<10-3: Encryption of execution permission list>
In the application program execution method described in §9, the execution permission list plays an important role. If this execution permission list is altered by some unauthorized operation, the original execution control function by the monitoring program is lost. It will be broken. Therefore, in order to perform control with higher reliability, it is only necessary to take an encryption measure for the execution permission list.

具体的には、リスト自動登録段階もしくは回答処理段階で実行許可リストへの登録を行う際に、実行許可リストを暗号化する処理を行うようにすればよい。たとえば、実行許可リストに登録する識別コードや後述するチェックコードを個別に暗号化した上で登録するようにしてもよいし、実行許可リストを復号した状態で新たな識別コードやチェックコードを登録し、登録後の実行許可リストを再び暗号化するようにしてもよい。登録有無判定段階では、暗号化されている実行許可リストを復号して内容の参照を行うことになる。なお、暗号化および復号には、監視プログラム内に含まれている専用鍵を用いるようにすればよい。   Specifically, when performing registration in the execution permission list in the list automatic registration stage or the answer processing stage, a process for encrypting the execution permission list may be performed. For example, an identification code to be registered in the execution permission list or a check code to be described later may be individually encrypted and registered, or a new identification code or check code may be registered with the execution permission list decrypted. The execution permission list after registration may be encrypted again. In the registration presence / absence determination stage, the encrypted execution permission list is decrypted and the contents are referred to. For encryption and decryption, a dedicated key included in the monitoring program may be used.

<10−4:チェックコードの付加>
実行許可リストの信頼性を高める別な方法は、識別コードの他に何らかのチェックコードを登録しておく方法である。すなわち、リスト自動登録段階もしくは回答処理段階で実行許可リストへの登録を行う際に、識別コードとともに、入力段階で入力したデータファイル内に含まれている何らかのデータをチェックコードとして登録するようにし、登録有無判定段階で、データファイル内に含まれているチェックコードと実行許可リストに登録されているチェックコードとの一致を確認し、一致確認がなされることを条件として、実行許可リストに登録されている旨の判定を行うようにすればよい。
<10-4: Add check code>
Another method for increasing the reliability of the execution permission list is to register some check code in addition to the identification code. That is, when registering in the execution permission list in the list automatic registration stage or the answer processing stage, some data included in the data file input in the input stage is registered as a check code together with the identification code, At the registration presence / absence determination stage, the check code included in the data file is checked for a match with the check code registered in the execution permission list, and is registered in the execution permission list on the condition that the matching is confirmed. What is necessary is just to make a determination to the effect.

たとえば、図5に示すAPKファイル20Aの場合、「Aの第2の鍵K(a2)」(プログラム提供者の公開鍵)をチェックコードとして用い、当該アプリケーションプログラムを実行許可リストに登録する際には、識別コードとともに、「Aの第2の鍵K(a2)」をチェックコードとして登録しておくようにする。そして、登録有無判定段階(図17のステップS22,S23)では、実行許可リストに当該識別コードと当該チェックコードの双方が登録されていることが確認された場合に、「登録されている」との判定を行うようにすればよい。   For example, in the case of the APK file 20A shown in FIG. 5, when “A second key K (a2)” (program provider's public key) is used as a check code and the application program is registered in the execution permission list. In addition to the identification code, “A second key K (a2)” is registered as a check code. In the registration presence / absence determination step (steps S22 and S23 in FIG. 17), if it is confirmed that both the identification code and the check code are registered in the execution permission list, “registered” is determined. This determination may be made.

もし、識別コードは掲載されているものの、チェックコードが不一致ということになった場合は、実行許可リストに対して何らかの不正行為(たとえば、不正な方法で、実行許可リストに掲載されている識別コードを別なアプリの識別コードに書き換えるような行為)が行われた可能性があると判断することができる。   If the identification code is posted but the check code does not match, some illegal act against the execution permission list (for example, an identification code posted on the execution permission list in an unauthorized manner) It may be determined that there is a possibility that an action (such as rewriting the ID code of another application) has been performed.

もちろん、チェックコードは、プログラム提供者の公開鍵に限定されるものではなく、この他にも様々な情報をチェックコードとして用いることができる。たとえば、図5に示すAPKファイル20Aの場合、「Aの第2の鍵K(a2)」(プログラム提供者の公開鍵)の他、Aの署名情報22A全体やAPKファイル20A全体をチェックコードとして用いてもかまわない。   Of course, the check code is not limited to the public key of the program provider, and various other information can be used as the check code. For example, in the case of the APK file 20A shown in FIG. 5, in addition to “A second key K (a2)” (public key of the program provider), the entire A signature information 22A and the entire APK file 20A are used as check codes. You can use it.

もっとも、Aの署名情報22A全体やAPKファイル20A全体を、そのままチェックコードとして用いると、チェックコードのデータ容量が膨大なものになり、チェックコードを登録する実行許可リストのデータ容量も膨大なものになってしまう。そこで、実用上は、入力段階で入力したデータファイル内に含まれている所定の情報(たとえば、図5に示すAの署名情報22A全体やAPKファイル20A全体)に対してハッシュ関数のような一方向性関数を作用させるダイジェスト化処理を行い、その結果得られたデータをチェックコードとして登録すればよい。   However, if the entire A signature information 22A or the entire APK file 20A is used as it is as a check code, the data capacity of the check code becomes enormous, and the data capacity of the execution permission list for registering the check code also becomes enormous. turn into. Therefore, practically, a predetermined function such as a hash function is applied to predetermined information (for example, the entire signature information 22A of A and the entire APK file 20A shown in FIG. 5) included in the data file input at the input stage. A digest process for applying a directional function may be performed, and the data obtained as a result may be registered as a check code.

この場合、登録有無判定段階では、データファイル内に含まれている上記所定の情報に対して、上記一方向性関数を作用させるダイジェスト化処理を行うことにより得られるチェックコードと、実行許可リストに登録されているチェックコードとの一致を確認し、一致確認がなされることを条件として、実行許可リストに登録されている旨の判定を行うことになる。なお、ダイジェスト化には、監視プログラム内に含まれている専用鍵を用いるようにすればよい。   In this case, in the registration presence / absence determination step, a check code obtained by performing a digesting process that causes the one-way function to act on the predetermined information included in the data file, and an execution permission list A match with the registered check code is confirmed, and on the condition that the match is confirmed, it is determined that the check code is registered in the execution permission list. In addition, what is necessary is just to use the exclusive key contained in the monitoring program for digesting.

<10−5:監視プログラムの代替>
これまで述べてきた実施形態では、監視プログラムに、図17の流れ図に示す監視ルーチン(監視プログラム(1)として示す手順)と、図22の流れ図に示すリスト自動登録段階のルーチン(監視プログラム(2)として示す手順)とが含まれる例を示したが、もちろん、監視プログラム(1)と監視プログラム(2)とは、それぞれ別個のプログラムによって構成してもかまわない。
<10-5: Replacement of monitoring program>
In the embodiment described so far, the monitoring program includes a monitoring routine (procedure shown as the monitoring program (1)) shown in the flowchart of FIG. 17 and a list automatic registration stage routine (monitoring program (2) shown in the flowchart of FIG. However, the monitoring program (1) and the monitoring program (2) may, of course, be configured by separate programs.

また、監視プログラム(2)の手順は、「自己改竄チェック機能をもつアプリ」内に組み込んでしまうことも可能である。この場合、図22に示すステップS13,S14の手順は「自己改竄チェック機能をもつアプリ」によって実行されることになり、当該アプリケーションプログラムは、自分自身の改竄チェックを行う機能に加えて、自分自身を実行許可リストに登録する機能を備えることになる。   Further, the procedure of the monitoring program (2) can be incorporated in “an app having a self-tampering check function”. In this case, the procedure of steps S13 and S14 shown in FIG. 22 is executed by “an app having a self-tampering check function”, and the application program itself has a function of checking its own tampering. Is registered in the execution permission list.

あるいは、監視プログラム(1)および監視プログラム(2)の手順を、そっくりOSプログラムに組み込んでしまうことも可能である。この場合、これまで述べてきた実施形態において監視プログラムの役割として述べた処理は、すべてOSプログラムによって実行されることになる。   Alternatively, the procedures of the monitoring program (1) and the monitoring program (2) can be incorporated into the OS program. In this case, all the processes described as the role of the monitoring program in the embodiments described so far are executed by the OS program.

ただ、現在提供されているAndroidOSには、監視プログラム(1),(2)の機能は備わっていないので、現在のAndroid端末を利用して本発明を実施する場合には、上述した実施形態のように、監視プログラムとして機能するアプリケーションプログラムを用意するのが好ましい。要するに、端末装置のOSプログラムが、複数のアプリケーションプログラムを所定のタイミングで切り替えながら実行させるマルチタスク処理機能を有していれば、アプリケーションプログラムの1つとして用意された監視プログラムによって、リスト自動登録段階、起動アプリ認識段階、登録有無判定段階、登録照会段階、回答処理段階を実行することができる。   However, since the currently provided Android OS does not have the functions of the monitoring programs (1) and (2), when implementing the present invention using the current Android terminal, Thus, it is preferable to prepare an application program that functions as a monitoring program. In short, if the OS program of the terminal device has a multitask processing function that allows a plurality of application programs to be executed while switching at a predetermined timing, the list automatic registration stage is performed by a monitoring program prepared as one of the application programs. The activation application recognition stage, the registration presence / absence determination stage, the registration inquiry stage, and the answer processing stage can be executed.

10:アプリケーションプログラム
10A:アプリケーションプログラム
10X,10X′:改竄されたアプリケーションプログラム
11:プログラム本体部
11A:プログラム本体部
12:リソースデータ
12X:改竄されたリソースデータ
13:サブルーチン群
13A:サブルーチン群
14:補助ファイル
14X:改竄された補助ファイル
20:配布用ファイル
20A,20A′,20A'',20AA:配布用ファイル
20X,20X′:改竄された配布用ファイル
21:アプリケーションパッケージ
21A:アプリケーションパッケージ
21X,21X′:改竄されたアプリケーションパッケージ
22:Aの署名情報
22A:Aの署名情報
22X,22X′:Xの署名情報
23A,23A′,23A'':秘匿情報
23X:改竄された秘匿情報
24A:所在情報
30:サーバ
110:アプリケーションプログラム格納ユニット
120:改竄チェックルーチン格納ユニット
130:鍵格納ユニット
140:改竄チェックルーチン付加ユニット
150:パッケージ化処理ユニット
160:署名情報作成ユニット
170:秘匿情報作成ユニット
180:配布用ファイル作成ユニット
A:プログラム提供者
AP1〜AP7:アプリケーションプログラムのファイル名
C,C′:秘匿化対象データ
D,D′:署名対象データ
F:改竄チェックルーチン
G:プログラム保証者
H,H1,H2:ハッシュ値
K(a1):Aの第1の鍵
K(a2):Aの第2の鍵
K(g1):Gの第1の鍵
K(g2):Gの第2の鍵
K(s0):共通特定鍵
K(s1):第1の特定鍵
K(s2):第2の特定鍵
K(x1):Xの第1の鍵
K(x2):Xの第2の鍵
S(A):署名値
S(X),S(X′):署名値
S1〜S29:流れ図の各ステップ
U,U1〜U3:ユーザ
X:クラッカー
10: Application program 10A: Application program 10X, 10X ': Tampered application program 11: Program body 11A: Program body 12: Resource data 12X: Tampered resource data 13: Subroutine group 13A: Subroutine group 14: Auxiliary File 14X: Tampered auxiliary file 20: Distribution file 20A, 20A ', 20A'', 20AA: Distribution file 20X, 20X': Tampered distribution file 21: Application package 21A: Application package 21X, 21X ' : Falsified application package 22: A signature information 22A: A signature information 22X, 22X ′: X signature information 23A, 23A ′, 23A ″: confidential information 23X: falsified confidentiality Information 24A: Location information 30: Server 110: Application program storage unit 120: Tamper check routine storage unit 130: Key storage unit 140: Tamper check routine addition unit 150: Packaging processing unit 160: Signature information creation unit 170: Secret information creation Unit 180: Distribution file creation unit A: Program providers AP1 to AP7: Application program file names C, C ': Concealment target data D, D': Signature target data F: Tamper check routine G: Program guarantor H , H1, H2: Hash value K (a1): A first key K (a2): A second key K (g1): G first key K (g2): G second Key K (s0): Common specific key K (s1): First specific key K (s2): Second specific key K ( 1): X first key K (x2): X second key S (A): Signature value S (X), S (X ′): Signature value S1 to S29: Steps U in the flowchart, U1-U3: User X: Cracker

結局、クラッカーXが、アプリケーションパッケージ21Aおよび署名情報22Aに対する改竄を行ったとしても、秘匿情報23Aに対する改竄を行うことができなければ、第2の確認段階において改竄が検知されるので、改竄されたアプリケーションプログラムの実行は中止され、改竄検知後のプロセスが正常に実行されることはない。このように、本発明に係るアプリケーションプログラムの配布実行方法によれば、電子署名に対する改竄が行われた場合にも、有効な改竄検知を行うことが可能になり、改竄検知後は、当該アプリケーションプログラムの実行を中止することが可能になる。 Eventually, even if the cracker X performs falsification on the application package 21A and the signature information 22A, if falsification is not performed on the confidential information 23A, the falsification is detected in the second confirmation stage. Execution of the application program is stopped and the process after falsification detection is not executed normally. As described above, according to the distribution execution method of the application program according to the present invention, it is possible to perform effective tampering detection even when tampering with the electronic signature is performed. It becomes possible to cancel execution of.

<<< §5.秘匿化対象データのバリエーション >>>
§3で説明した本発明の基本的な実施形態に係る配布実行方法では、図5に太線枠で囲って示すように、Aの署名情報22A全体(すなわち、署名値S(A)とAの第2の鍵K(a2))を秘匿化対象データCとして、第2の特定鍵K(s2)を用いた秘匿化処理を行い、秘匿情報23Aを作成している。このようにして作成された秘匿情報23Aは、Aの署名情報22Aの痕跡を残す情報というべきものであり、第1の特定鍵K(s1)を用いた所定の確認方法により、Aの署名情報22Aに対する正当性の確認が可能になるという固有の性質を有している。
<<< §5. Variation of data to be concealed >>>
In the distribution execution method according to the basic embodiment of the present invention described in § 3, the entire signature information 22A of A (that is, the signature values S (A) and A Using the second key K (a2)) as the concealment target data C, concealment processing using the second specific key K (s2) is performed to create the concealment information 23A. The secret information 23A created in this way is information that leaves a trace of the signature information 22A of A, and the signature information of A is obtained by a predetermined confirmation method using the first specific key K (s1). It has a unique property that it is possible to confirm the validity of 22A.

このような性質を有する秘匿情報23Aを配布用ファイル20Aに含ませておけば、Aの署名情報22Aに対する秘匿情報23Aの正当性を確認する処理(第2の確認段階)を行うことにより、Aの署名情報22Aに対する改竄の有無を確認することができるようになる。 If the confidential information 23A having such properties is included in the distribution file 20A, a process (second confirmation stage) for confirming the validity of the confidential information 23A with respect to the signature information 22A of A is performed. It is possible to confirm whether or not the signature information 22A is falsified.

Claims (13)

コンピュータが、アプリケーションプログラムを実行する方法であって、
コンピュータが、実行対象となるアプリケーションプログラムを含むデータファイルを入力する入力段階と、
コンピュータが、入力したアプリケーションプログラムが改竄されているか否かを判定する改竄判定段階と、
コンピュータが、前記改竄判定段階において改竄されていない旨の判定がなされたアプリケーションプログラムの識別コードを、実行許可リストに登録するリスト自動登録段階と、
コンピュータが、起動状態にあるアプリケーションプログラムの識別コードを認識する起動アプリ認識段階と、
コンピュータが、前記起動アプリ認識段階において認識した識別コードが前記実行許可リストに登録されているか否かを判定する登録有無判定段階と、
コンピュータが、前記登録有無判定段階において未登録と判定された場合に、当該未登録アプリを登録するか否かをユーザに問い合わせる登録照会段階と、
コンピュータが、前記問い合わせに対するユーザの回答として、登録する旨の回答があった場合には、前記未登録アプリの識別コードを前記実行許可リストに登録した上で当該アプリの実行を許可し、登録しない旨の回答があった場合には、当該未登録アプリの実行を中止させる回答処理段階と、
を有し、
前記入力段階では、改竄チェック機能付アプリケーションプログラムと、署名情報と、秘匿情報もしくはその所在を示す所在情報と、を含むデータファイルを入力し、
前記署名情報は、前記アプリケーションプログラムを署名対象データとする電子署名処理によって得られた情報であり、
前記秘匿情報は、前記改竄チェック機能付アプリケーションプログラムおよび前記署名情報を構成するデータの中の所定部分を秘匿化対象データとして抽出し、抽出した前記秘匿化対象データに対する秘匿化処理を施して得られた情報であり、
前記改竄判定段階は、前記署名情報に基づいて改竄の有無を確認する第1の確認段階と、前記秘匿情報に基づいて改竄の有無を確認する第2の確認段階と、を有し、
前記改竄チェック機能付アプリケーションプログラムには、前記秘匿化処理で行われた処理プロセスを勘案して前記秘匿化対象データに対する前記秘匿情報の正当性を確認する改竄チェックルーチンが含まれており、前記改竄チェックルーチンを実行することにより前記第2の確認段階が行われることを特徴とするアプリケーションプログラムの実行方法。
A computer is a method for executing an application program,
An input stage in which a computer inputs a data file containing an application program to be executed;
A tampering determination stage in which the computer determines whether the input application program has been tampered with;
A list automatic registration stage in which the computer registers the identification code of the application program in which it is determined in the falsification determination stage that it has not been falsified in the execution permission list;
A startup application recognition stage in which the computer recognizes the identification code of the application program in the startup state;
A registration presence / absence determination step in which the computer determines whether or not the identification code recognized in the activation application recognition step is registered in the execution permission list;
If the computer is determined to be unregistered in the registration presence / absence determination step, a registration inquiry step for inquiring the user whether or not to register the unregistered app;
When the computer responds to the inquiry as to the user's response, the computer registers the unregistered application identification code in the execution permission list, permits execution of the application, and does not register If there is an answer to that effect, an answer processing stage for stopping execution of the unregistered application,
Have
In the input step, a data file including an application program with a falsification check function, signature information, and confidential information or location information indicating the location is input,
The signature information is information obtained by electronic signature processing using the application program as signature target data,
The concealment information is obtained by extracting a predetermined portion of the data constituting the falsification check function application program and the signature information as concealment target data and performing concealment processing on the extracted concealment target data. Information,
The falsification determining step includes a first confirmation step of confirming whether or not falsification is performed based on the signature information, and a second confirmation step of confirming whether or not falsification is performed based on the confidential information.
The application program with a falsification check function includes a falsification check routine for confirming the validity of the confidential information with respect to the data to be concealed in consideration of a processing process performed in the concealment process. A method for executing an application program, wherein the second confirmation step is performed by executing a check routine.
請求項1に記載のアプリケーションプログラムの実行方法において、
一方の鍵を用いて暗号化したデータを他方の鍵を用いて復号できる性質をもった一対の鍵を用い、
秘匿情報が、秘匿化対象データを前記一方の鍵を用いて暗号化することにより得られた情報であり、
改竄チェックルーチンが、入力段階で入力したデータファイルに含まれている秘匿情報もしくは入力段階で入力したデータファイルに含まれている所在情報に基づいて入手した秘匿情報を前記他方の鍵を用いて復号し、この復号によって得られた秘匿化対象データと、入力段階で入力したデータファイルから抽出した秘匿化対象データとが一致していた場合に改竄なしとの確認を行うことを特徴とするアプリケーションプログラムの実行方法。
In the execution method of the application program of Claim 1,
Using a pair of keys that have the property that data encrypted using one key can be decrypted using the other key,
The secret information is information obtained by encrypting the data to be concealed using the one key,
The tampering check routine decrypts the confidential information included in the data file input in the input stage or the confidential information obtained based on the location information included in the data file input in the input stage using the other key. An application program characterized by confirming that there is no falsification when the data to be concealed obtained by this decryption and the data to be concealed extracted from the data file input at the input stage match. How to run
請求項1に記載のアプリケーションプログラムの実行方法において、
秘匿情報が、秘匿化対象データに対して、所定の特定鍵をパラメータとして用いた一方向性関数を作用させるダイジェスト化処理を施して作成された情報であり、
改竄チェックルーチンが、入力段階で入力したデータファイルから抽出した秘匿化対象データに対して、前記特定鍵を用いた前記ダイジェスト化処理を施して得られる情報が、入力段階で入力したデータファイルに含まれている秘匿情報もしくは入力段階で入力したデータファイルに含まれている所在情報に基づいて入手した秘匿情報と一致していた場合に改竄なしとの確認を行うことを特徴とするアプリケーションプログラムの実行方法。
In the execution method of the application program of Claim 1,
The confidential information is information created by performing a digest process that applies a one-way function using a predetermined specific key as a parameter to the data to be concealed,
The data file input at the input stage includes information obtained by performing the digest processing using the specific key on the data to be concealed extracted from the data file input at the input stage by the falsification check routine Execution of an application program that confirms that there is no falsification if it matches the confidential information obtained based on the location information contained in the data information entered at the input stage Method.
請求項1〜3のいずれかに記載のアプリケーションプログラムの実行方法において、
OSプログラムの管理下でアプリケーションプログラムの実行を行うコンピュータが、第1の確認段階を前記OSプログラムに基づいて実行し、第2の確認段階をアプリケーションプログラム内の改竄チェックルーチンに基づいて実行することを特徴とするアプリケーションプログラムの実行方法。
In the execution method of the application program in any one of Claims 1-3,
A computer that executes an application program under the management of an OS program executes a first confirmation step based on the OS program, and executes a second confirmation step based on a falsification check routine in the application program. An application program execution method.
請求項4に記載のアプリケーションプログラムの実行方法において、
OSプログラムが、複数のアプリケーションプログラムを所定のタイミングで切り替えながら実行させるマルチタスク処理機能を有しており、
コンピュータが、アプリケーションプログラムの1つとして用意された監視プログラムによって、リスト自動登録段階、起動アプリ認識段階、登録有無判定段階、登録照会段階、回答処理段階を実行することを特徴とするアプリケーションプログラムの実行方法。
In the execution method of the application program of Claim 4,
The OS program has a multitask processing function for executing a plurality of application programs while switching at a predetermined timing.
Execution of an application program characterized in that a computer executes a list automatic registration stage, a startup application recognition stage, a registration presence / absence judgment stage, a registration inquiry stage, and an answer processing stage by a monitoring program prepared as one of the application programs Method.
請求項5に記載のアプリケーションプログラムの実行方法において、
コンピュータが、OSプログラムによって、個々のアプリケーションプログラムについて、識別コード・起動時・終了時を示すログ情報を記録する処理を実行し、
コンピュータが、監視プログラムによって起動アプリ認識段階を実行する際に、前記ログ情報を参照することにより起動状態にあるアプリケーションプログラムの識別コードを認識することを特徴とするアプリケーションプログラムの実行方法。
In the execution method of the application program of Claim 5,
The computer executes a process of recording log information indicating an identification code, start time, and end time for each application program by the OS program,
A method for executing an application program, wherein the computer recognizes an identification code of an application program in an activated state by referring to the log information when the activated application recognition step is executed by the monitoring program.
請求項1〜6のいずれかに記載のアプリケーションプログラムの実行方法において、
リスト自動登録段階、回答処理段階、および起動アプリ認識段階において、バージョンの異なるアプリケーションプログラムについては、それぞれ異なる識別コードを用いた処理を行うことを特徴とするアプリケーションプログラムの実行方法。
In the execution method of the application program in any one of Claims 1-6,
A method for executing an application program, wherein different versions of application programs are processed using different identification codes in the list automatic registration stage, answer processing stage, and activated application recognition stage.
請求項7に記載のアプリケーションプログラムの実行方法において、
同一のファイル名をもったデータファイルに含まれるアプリケーションプログラムであっても、ハッシュ値が異なる場合は、異なるバージョンと認識することを特徴とするアプリケーションプログラムの実行方法。
In the execution method of the application program of Claim 7,
An application program execution method characterized in that even if application programs included in a data file having the same file name have different hash values, they are recognized as different versions.
請求項1〜8のいずれかに記載のアプリケーションプログラムの実行方法において、
リスト自動登録段階もしくは回答処理段階で実行許可リストへの登録を行う際に、コンピュータが外部の記憶装置もしくはサーバ装置内に保存された実行許可リストに対する登録を行い、
登録有無判定段階で、コンピュータが前記外部の記憶装置もしくはサーバ装置内に保存された実行許可リストを参照することにより判定を行うことを特徴とするアプリケーションプログラムの実行方法。
In the execution method of the application program in any one of Claims 1-8,
When registering to the execution permission list in the list automatic registration stage or answer processing stage, the computer performs registration to the execution permission list stored in the external storage device or server device,
A method for executing an application program, characterized in that, in a registration presence / absence determination step, a computer makes a determination by referring to an execution permission list stored in the external storage device or server device.
請求項1〜9のいずれかに記載のアプリケーションプログラムの実行方法において、
リスト自動登録段階もしくは回答処理段階で実行許可リストへの登録を行う際に、コンピュータが実行許可リストを暗号化する処理を行い、
登録有無判定段階で、コンピュータが暗号化されている実行許可リストを復号して内容の参照を行うことを特徴とするアプリケーションプログラムの実行方法。
In the execution method of the application program in any one of Claims 1-9,
When registering to the execution permission list at the list automatic registration stage or answer processing stage, the computer performs the process of encrypting the execution permission list,
A method for executing an application program, characterized in that, in a registration presence / absence determination step, a computer decrypts an encrypted execution permission list and refers to the contents.
請求項1〜10のいずれかに記載のアプリケーションプログラムの実行方法において、
リスト自動登録段階もしくは回答処理段階で実行許可リストへの登録を行う際に、コンピュータが、識別コードとともに、入力段階で入力したデータファイル内に含まれている所定のチェックコードを登録するようにし、
登録有無判定段階で、コンピュータが、データファイル内に含まれているチェックコードと実行許可リストに登録されているチェックコードとの一致を確認し、一致確認がなされることを条件として、実行許可リストに登録されている旨の判定を行うことを特徴とするアプリケーションプログラムの実行方法。
In the execution method of the application program in any one of Claims 1-10,
When registering to the execution permission list in the list automatic registration stage or answer processing stage, the computer registers a predetermined check code included in the data file input in the input stage together with the identification code,
At the registration presence / absence determination stage, the computer checks whether the check code included in the data file matches the check code registered in the execution permission list, and the execution permission list is obtained on condition that the match is confirmed. A method for executing an application program, characterized in that it is determined that the application program has been registered.
請求項1〜10のいずれかに記載のアプリケーションプログラムの実行方法において、
リスト自動登録段階もしくは回答処理段階で実行許可リストへの登録を行う際に、コンピュータが、識別コードとともに、入力段階で入力したデータファイル内に含まれている所定の情報に対して一方向性関数を作用させるダイジェスト化処理を行うことにより得られるチェックコードを登録するようにし、
登録有無判定段階で、コンピュータが、データファイル内に含まれている前記所定の情報に対して前記一方向性関数を作用させるダイジェスト化処理を行うことにより得られるチェックコードと、実行許可リストに登録されているチェックコードとの一致を確認し、一致確認がなされることを条件として、実行許可リストに登録されている旨の判定を行うことを特徴とするアプリケーションプログラムの実行方法。
In the execution method of the application program in any one of Claims 1-10,
When registering to the execution permission list in the list automatic registration stage or answer processing stage, the computer uses a one-way function for the predetermined information contained in the data file input in the input stage together with the identification code. Register the check code obtained by performing the digest process that works
In the registration presence / absence determination stage, the computer registers the check code obtained by performing the digest processing that causes the one-way function to act on the predetermined information included in the data file and the execution permission list. A method for executing an application program, comprising: confirming a match with a check code that is registered, and determining that the check code is registered in the execution permission list on condition that the match is confirmed.
請求項5または6に記載のアプリケーションプログラムの実行方法に用いる監視プログラム。   The monitoring program used for the execution method of the application program of Claim 5 or 6.
JP2012190943A 2012-04-24 2012-08-31 Application program execution method Active JP5126447B1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2012190943A JP5126447B1 (en) 2012-08-31 2012-08-31 Application program execution method
PCT/JP2013/062311 WO2013161974A1 (en) 2012-04-24 2013-04-19 Method for distributing and executing application program capable of detecting falsification

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012190943A JP5126447B1 (en) 2012-08-31 2012-08-31 Application program execution method

Publications (2)

Publication Number Publication Date
JP5126447B1 JP5126447B1 (en) 2013-01-23
JP2014048866A true JP2014048866A (en) 2014-03-17

Family

ID=47692925

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012190943A Active JP5126447B1 (en) 2012-04-24 2012-08-31 Application program execution method

Country Status (1)

Country Link
JP (1) JP5126447B1 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018503153A (en) * 2014-11-28 2018-02-01 トムソン ライセンシングThomson Licensing Method and device for providing verification of application integrity
JP2018503157A (en) * 2014-11-28 2018-02-01 トムソン ライセンシングThomson Licensing Method and device for providing application integrity verification
US20190294308A1 (en) * 2013-12-20 2019-09-26 EMC IP Holding Company LLC System and method of smart framework for troubleshooting performance issues
US10915623B2 (en) 2017-09-04 2021-02-09 Kabushiki Kaisha Toshiba Information processing apparatus, information processing method, and computer program product
JP2021508880A (en) * 2017-12-27 2021-03-11 中国▲銀▼▲聯▼股▲ふん▼有限公司 Terminal application management method, application server and terminal
JP2021140678A (en) * 2020-03-09 2021-09-16 株式会社東芝 Information processing device
US11132467B2 (en) 2018-09-18 2021-09-28 Kabushiki Kaisha Toshiba Information processing device, information processing method, and computer program product

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014164392A (en) * 2013-02-22 2014-09-08 Dainippon Printing Co Ltd Information processing device and information processing system
JP6258001B2 (en) * 2013-10-31 2018-01-10 株式会社東芝 Electronic apparatus and method
JP6728113B2 (en) * 2017-08-22 2020-07-22 株式会社東芝 Information processing apparatus, information processing method, and information processing program
JP7074805B2 (en) * 2020-07-01 2022-05-24 株式会社東芝 Information processing equipment, information processing methods, and information processing programs
CN112885175B (en) * 2021-01-15 2022-10-21 杭州安恒信息安全技术有限公司 Information security question generation method and device, electronic device and storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2886969B2 (en) * 1990-10-29 1999-04-26 株式会社日立製作所 Program conversion method
JPH07146788A (en) * 1993-11-22 1995-06-06 Fujitsu Ltd System and method for preparing virus diagnostic mechanism and virus diagnostic mechanism and diagnostic method
JP2002230511A (en) * 2001-02-01 2002-08-16 Dainippon Printing Co Ltd Multiple authentication portable information processing medium
JP2004213339A (en) * 2002-12-27 2004-07-29 Toshiba Corp Software radio and its control process
JP2005293109A (en) * 2004-03-31 2005-10-20 Canon Inc Software execution management device, software execution management method, and control program
EP1783580A4 (en) * 2004-08-12 2011-03-23 Fujitsu Ltd Java applet, jar file creating method, jar file creating program, and jar file creating device
JP2007249782A (en) * 2006-03-17 2007-09-27 Nifty Corp Electronic data leakage prevention program
US8001596B2 (en) * 2007-05-03 2011-08-16 Microsoft Corporation Software protection injection at load time

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190294308A1 (en) * 2013-12-20 2019-09-26 EMC IP Holding Company LLC System and method of smart framework for troubleshooting performance issues
US11561681B2 (en) * 2013-12-20 2023-01-24 EMC IP Holding Company LLC System and method of smart framework for troubleshooting performance issues
JP2018503153A (en) * 2014-11-28 2018-02-01 トムソン ライセンシングThomson Licensing Method and device for providing verification of application integrity
JP2018503157A (en) * 2014-11-28 2018-02-01 トムソン ライセンシングThomson Licensing Method and device for providing application integrity verification
US10915623B2 (en) 2017-09-04 2021-02-09 Kabushiki Kaisha Toshiba Information processing apparatus, information processing method, and computer program product
JP2021508880A (en) * 2017-12-27 2021-03-11 中国▲銀▼▲聯▼股▲ふん▼有限公司 Terminal application management method, application server and terminal
JP7087085B2 (en) 2017-12-27 2022-06-20 中国▲銀▼▲聯▼股▲ふん▼有限公司 Terminal application management methods, application servers and terminals
US11449616B2 (en) 2017-12-27 2022-09-20 China Unionpay Co., Ltd. Application management method for terminal, application server, and terminal
US11132467B2 (en) 2018-09-18 2021-09-28 Kabushiki Kaisha Toshiba Information processing device, information processing method, and computer program product
JP2021140678A (en) * 2020-03-09 2021-09-16 株式会社東芝 Information processing device
JP7249968B2 (en) 2020-03-09 2023-03-31 株式会社東芝 Information processing equipment and storage

Also Published As

Publication number Publication date
JP5126447B1 (en) 2013-01-23

Similar Documents

Publication Publication Date Title
JP5126447B1 (en) Application program execution method
JP5190800B2 (en) Program execution control system, execution control method, and computer program for execution control
CN100578522C (en) Electronic device, update method for same and integrated circuit
US8381307B2 (en) Method for protecting a converted applet (CAP) file including encrypting the CAP file
US8417964B2 (en) Software module management device and program
US8392724B2 (en) Information terminal, security device, data protection method, and data protection program
EP1710724A2 (en) Application program verification system, application program verification method and computer program
CN106778103A (en) Reinforcement means, system and decryption method that a kind of Android application program anti-reversing is cracked
CN101872404B (en) Method for protecting Java software program
CN111143869B (en) Application package processing method and device, electronic equipment and storage medium
JP2002140126A (en) System for distributing program, distributor for encrypted program, system for collecting program trouble information, and method of distributing program
CN112861191B (en) Application program monitoring method and device
CN101228531A (en) Execution device
JP2008146479A (en) Software component, software component management method and software component management system
WO2013161974A1 (en) Method for distributing and executing application program capable of detecting falsification
KR20170067003A (en) Method and System for Protecting application program in trusted execution environment
JP5056995B1 (en) Application program distribution execution method that can detect falsification
JP2007233426A (en) Application execution device
JP4664055B2 (en) Program dividing device, program executing device, program dividing method, and program executing method
Gallery et al. Trusted computing: Security and applications
JP5182445B1 (en) Application program falsification detection method
JP5781678B1 (en) Electronic data utilization system, portable terminal device, and method in electronic data utilization system
CN111159712B (en) Detection method, device and storage medium
Bahaa-Eldin et al. A comprehensive software copy protection and digital rights management platform
JP7331714B2 (en) Information processing device, information processing method and program

Legal Events

Date Code Title Description
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

R150 Certificate of patent or registration of utility model

Ref document number: 5126447

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

Year of fee payment: 3