JP2018088574A - Method for protecting program image - Google Patents

Method for protecting program image Download PDF

Info

Publication number
JP2018088574A
JP2018088574A JP2016229871A JP2016229871A JP2018088574A JP 2018088574 A JP2018088574 A JP 2018088574A JP 2016229871 A JP2016229871 A JP 2016229871A JP 2016229871 A JP2016229871 A JP 2016229871A JP 2018088574 A JP2018088574 A JP 2018088574A
Authority
JP
Japan
Prior art keywords
program image
hash value
data
current
value
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
JP2016229871A
Other languages
Japanese (ja)
Other versions
JP6674368B2 (en
Inventor
渡辺 大
Masaru Watanabe
大 渡辺
高橋 健太
Kenta Takahashi
健太 高橋
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2016229871A priority Critical patent/JP6674368B2/en
Publication of JP2018088574A publication Critical patent/JP2018088574A/en
Application granted granted Critical
Publication of JP6674368B2 publication Critical patent/JP6674368B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

PROBLEM TO BE SOLVED: To prevent alteration of a program including updatable parameters.SOLUTION: A first storage, where writing by a user is prohibited, stores at least one reference hash value, and a second storage, where writing by a user is permitted, stores a current program image. The method acquires update data, generates a new program image by inputting the current program image and the update data, executes generation of at least one value of a predetermined length, executes comparison of at least one current hash value calculated by inputting the at least one value the new program image, and the at least one reference hash value, and overwrites the current program image in the second storage with the data coupling the value of the predetermined length, used for calculation of the current hash value matching the reference hash value, and the new program image.SELECTED DRAWING: Figure 9

Description

本発明は、機器にインストールされたプログラムの不正な改ざんを妨げるための技術に関する。   The present invention relates to a technique for preventing unauthorized alteration of a program installed in a device.

モバイル端末の普及とWebサービスの高度化に伴い、サービスの種類も多様化している。特に近年では、モバイル決済のように、従来ATMや窓口、専用端末を経由していた支払や送金に関するサービスをモバイル端末上で実行するサービスが流行の兆しを見せている。このようなサービスを利用する際には、専用のプログラム(アプリ)をインストールし、そのアプリを介してサービスを利用するのが一般的である。   With the spread of mobile terminals and the advancement of Web services, the types of services are diversifying. In particular, in recent years, services such as mobile payments, where services related to payment and remittance that have conventionally been routed through ATMs, windows, and dedicated terminals, are running on mobile terminals. When using such a service, it is common to install a dedicated program (application) and use the service via the application.

また、サービスの利用に際してユーザ認証(もしくは端末認証)を行う必要があるが、このとき、ユーザ(もしくは端末)のみが持つ秘密情報を用いる。このような処理は、SIMチップ上の領域内で行われることが望ましいが、上記のように、アプリ上で秘密情報を取り扱うケースがほとんどである。これは、サービス用アプリをインストールするためには、SIMチップの記憶容量や処理能力が低いことが理由である。   Also, user authentication (or terminal authentication) needs to be performed when using the service. At this time, secret information possessed only by the user (or terminal) is used. Such processing is desirably performed within the area on the SIM chip, but as described above, in most cases, confidential information is handled on the application. This is because the storage capacity and processing capacity of the SIM chip are low in order to install the service application.

一方で、モバイル端末のセキュリティという観点では、端末の10%程度がマルウェアに感染しているという現実があり、金融サービスに特化したマルウェアの存在も確認されている。したがって、上記のアプリは、ユーザ認証や通信路暗号化で必要となる秘密情報(秘密鍵や生体情報)を保護する必要がある。   On the other hand, from the viewpoint of security of mobile terminals, there is a reality that about 10% of terminals are infected with malware, and the existence of malware specialized for financial services has also been confirmed. Therefore, the application needs to protect secret information (secret key and biometric information) required for user authentication and communication path encryption.

特許文献1は、アプリの改ざんを検出するために、アプリのハッシュ値をアプリと同時に保存しておき、プログラムの実行時にアプリのハッシュ値を計算し、保存しているハッシュ値と一致している場合のみアプリを実行している。ところが、マルウェアがアプリを改ざんできる場合には、同様に保存されているハッシュ値の改ざんも容易になってしまう。   In Patent Document 1, in order to detect falsification of an application, the hash value of the application is stored at the same time as the application, the hash value of the application is calculated when the program is executed, and matches the stored hash value. Only if you are running the app. However, if the malware can tamper with the application, it is also easy to tamper with the stored hash value.

上記のような課題に対する対策として、秘密情報をそのまま保持せず、読み取りを困難にする難読化技術が知られている。そこで、アプリと鍵のセットを難読化することで、秘密情報の漏えいリスクを軽減することができると考えられる。難読化については、既に多くの方式が検討されている。   As a countermeasure against the above problems, an obfuscation technique is known that makes it difficult to read without retaining confidential information as it is. Therefore, it is considered that the risk of leaking confidential information can be reduced by obfuscating the application and key set. Many methods have already been examined for obfuscation.

特開2010−102579号公報JP 2010-102579 A

アプリと鍵のセットを難読化したアプリイメージは、鍵更新のたびに書き換えられる。このように、更新可能パラメータを含むプログラムは、一般ユーザ権限での書き込みが禁止されているシステム領域に格納することが難しい。そこで、プログラムのハッシュ値のみを、マルウェアのようなユーザプログラムが書き込みできないシステム領域に格納する方法が考えられる。しかし、一般ユーザ権限では、パラメータ更新後のプログラムのハッシュ値を、システム領域に書き込むことができない。   The app image that obfuscates the app and key set is rewritten each time the key is updated. As described above, it is difficult to store a program including an updatable parameter in a system area where writing with a general user authority is prohibited. Therefore, a method of storing only the hash value of the program in a system area where a user program such as malware cannot write can be considered. However, with the general user authority, the hash value of the program after the parameter update cannot be written in the system area.

そこで、一般ユーザ権限での書き込みが許可されたユーザ領域に格納された更新可能パラメータを含むプログラムの改ざんを妨げる技術が望まれる。   Therefore, a technique for preventing falsification of a program including an updatable parameter stored in a user area where writing with general user authority is permitted is desired.

一例は、更新可能パラメータを含むプログラムイメージを格納している計算機が、前記プログラムイメージを保護する方法であって、前記計算機は、プロセッサと、ユーザによる書き込みが禁止されている第1記憶領域と、ユーザによる書き込みが許可されている第2記憶領域と、を含み、前記第1記憶領域は、少なくとも一つの基準ハッシュ値を格納し、前記第2記憶領域は、現在プログラムイメージを格納し、前記現在プログラムイメージは、更新可能パラメータと、前記更新可能パラメータの更新データ及び前記現在プログラムイメージとから新しいプログラムイメージを生成するプログラム生成機能部と、を含み、前記方法は、前記プロセッサが、前記更新可能パラメータの更新データを取得し、前記プロセッサが、前記プログラム生成機能部を呼び出して、前記現在プログラムイメージと前記更新データとを入力して新しいプログラムイメージを生成し、前記プロセッサが、所定長の少なくとも一つの値の生成を実行し、前記プロセッサが、前記少なくとも一つの値及び前記新しいプログラムイメージを入力として計算された少なくとも一つの現在ハッシュ値と、前記少なくとも一つの基準ハッシュ値と、の比較を実行し、前記プロセッサが、前記少なくとも一つの基準ハッシュ値における基準ハッシュ値と一致する現在ハッシュ値が見つかるまで、前記少なくとも一つの値の生成と、前記比較と、を繰り返し、前記プロセッサが、前記一致する現在ハッシュ値の計算に使用された前記所定長の値と、前記新しいプログラムイメージとを結合したデータで、前記第2記憶領域における前記現在プログラムイメージを上書きする。   An example is a method in which a computer storing a program image including updatable parameters protects the program image, the computer including a processor, a first storage area that is prohibited from being written by a user, A second storage area that is allowed to be written by a user, wherein the first storage area stores at least one reference hash value, the second storage area stores a current program image, and the current storage area The program image includes an updatable parameter, a program generation function unit that generates a new program image from the update data of the updatable parameter and the current program image, and the method includes: Update data, and the processor A generation function unit, generating the new program image by inputting the current program image and the update data, the processor executing generation of at least one value of a predetermined length, and the processor Performing a comparison between at least one current hash value calculated with one value and the new program image as input, and the at least one reference hash value, wherein the processor has a reference in the at least one reference hash value; Until the current hash value that matches the hash value is found, the generation of the at least one value and the comparison are repeated, and the processor uses the predetermined length value used to calculate the matching current hash value , The second memory with data combined with the new program image The in-frequency current to override the program image.

本発明の一態様によれば、更新可能パラメータを含むプログラムの改ざんを妨げることができる。   According to one embodiment of the present invention, falsification of a program including an updatable parameter can be prevented.

実施例1におけるシステム構成を表す図である。1 is a diagram illustrating a system configuration in Embodiment 1. FIG. 実施例1における鍵初期化および更新プロトコルを表すシーケンス図である。FIG. 6 is a sequence diagram illustrating a key initialization and update protocol in the first embodiment. 実施例1における機器構成を表す概略図である。1 is a schematic diagram illustrating a device configuration in Embodiment 1. FIG. 図3の記憶装置に保存されたデータに対するアクセス権限を示すイメージ図である。It is an image figure which shows the access authority with respect to the data preserve | saved at the memory | storage device of FIG. 実施例1におけるアプリのダウンロードから端末への格納までの処理を表すフロー図である。It is a flowchart showing the process from the download of the application in Example 1 to the storing to a terminal. 実施例1におけるアプリの実行を行う際に必要な機能の構成図である。It is a block diagram of a function required when performing the application in Example 1. FIG. 実施例1におけるアプリの実行プロセスを表すフロー図である。FIG. 10 is a flowchart illustrating an application execution process according to the first embodiment. 実施例1における鍵更新を行う場合に必要な機能構成を表す図である。FIG. 3 is a diagram illustrating a functional configuration necessary when performing key update in the first embodiment. 実施例1における鍵更新処理を表すフロー図である。FIG. 6 is a flowchart illustrating a key update process in the first embodiment. 実施例2における鍵更新処理を表すフロー図である。FIG. 10 is a flowchart illustrating a key update process in the second embodiment. 実施例3におけるメッセージ認証子アルゴリズムの構成例その1を表す図である。It is a figure showing the structural example 1 of the message authenticator algorithm in Example 3. FIG. 実施例3におけるメッセージ認証子アルゴリズムの構成例その2を表す図である。It is a figure showing the structural example 2 of the message authenticator algorithm in Example 3. FIG.

以下、添付図面を参照して本発明の実施形態を説明する。本実施形態は本発明を実現するための一例に過ぎず、本発明の技術的範囲を限定するものではないことに注意すべきである。各図において共通の構成については同一の参照符号が付されている。   Embodiments of the present invention will be described below with reference to the accompanying drawings. It should be noted that this embodiment is merely an example for realizing the present invention, and does not limit the technical scope of the present invention. In each figure, the same reference numerals are given to common configurations.

本開示の装置は、アプリケーションプログラム(以下単にアプリとも呼ぶ)のインストール時に、アプリイメージのハッシュ値を、(マルウェアが書き換えできない)システム領域に保存する。アプリの実行時に、その時点でのアプリイメージのハッシュ値と保存されているハッシュ値を比較することで、アプリの改ざんを検出する。   The apparatus of the present disclosure stores a hash value of an application image in a system area (which cannot be rewritten by malware) when an application program (hereinafter simply referred to as an application) is installed. When the application is executed, alteration of the application is detected by comparing the hash value of the application image at that time with the stored hash value.

さらに、装置は、アプリイメージの更新時には、更新されたアプリイメージのハッシュ値と、システム領域に格納されているハッシュ値が一致するように、更新されたアプリイメージに数値を結合する。装置は、二つのハッシュ値の衝突を見つけるために、結合する数値の更新とハッシュ値計算を繰り返す。   Furthermore, when updating the application image, the apparatus combines a numerical value with the updated application image so that the hash value of the updated application image matches the hash value stored in the system area. In order to find a collision between two hash values, the device repeatedly updates the combined numerical value and calculates the hash value.

マルウェアが、検出されることなくアプリイメージの改ざんを行うためには、改ざんしたアプリのハッシュ値が、保存されているハッシュ値と一致する必要がある。マルウェアは、正規のアプリに比べて利用可能な計算リソースが小さいため、二つのハッシュ値の衝突を見つけるまでに多大な時間を要する。これにより、マルウェアによるアプリイメージの改ざんを効果的に妨げることができる。   In order for the malware to tamper with the app image without being detected, the hash value of the tampered app must match the stored hash value. Malware requires less time to find a collision between two hash values because it has less computational resources available than a legitimate app. Thereby, the alteration of the application image by malware can be effectively prevented.

図1は本実施例のシステム構成を示す。本システムは、ユーザ101が持つユーザ端末102、アプリの配信を行うアプリ配信サーバ103、アプリを介してユーザにサービスを提供するサービスプロバイダ104を含む。ここでは、サービスプロバイダ104は、1又は複数のサーバを示す。サービスプロバイダ104は、サービスの利用に必要となるアプリの配信をアプリ配信サーバ103に委託する。   FIG. 1 shows the system configuration of this embodiment. This system includes a user terminal 102 possessed by a user 101, an application distribution server 103 that distributes an application, and a service provider 104 that provides a service to the user via the application. Here, the service provider 104 indicates one or a plurality of servers. The service provider 104 entrusts the application distribution server 103 to distribute an application necessary for using the service.

ユーザは、サービスプロバイダ104が提供するサービスを利用する際に、所有するユーザ端末102からアプリ配信サーバ103にアクセスし、アプリをダウンロードする。その後、インストールしたアプリを介して、サービスを利用する。   When using a service provided by the service provider 104, the user accesses the application distribution server 103 from the user terminal 102 owned by the user and downloads the application. Then, use the service through the installed application.

通常、アプリ配信サーバ103からのアプリのダウンロードは、通信途上での改ざん等を防止するため、暗号通信を利用する。この通信は一時的なものであり、アプリ配信サーバ103は、端末102の認証を行わないことが多い。   Normally, the application download from the application distribution server 103 uses encrypted communication in order to prevent tampering during the communication. This communication is temporary, and the application distribution server 103 often does not authenticate the terminal 102.

一方、サービスプロバイダ104は、サービスの提供時に、ユーザ端末102の所有者が正当なサービス利用者であることを確認する。ユーザ端末102は、何らかの秘密情報を所持していることを証明し、正当なサービス利用者であることをサービスプロバイダ104に示す。   On the other hand, the service provider 104 confirms that the owner of the user terminal 102 is a valid service user when providing the service. The user terminal 102 proves that it has some secret information and indicates to the service provider 104 that it is a legitimate service user.

ユーザ端末102は、正規のユーザ端末であることをサービスプロバイダ104に証明するための、パスワード、秘密鍵、もしくは一時的に取り込まれたユーザ生体情報などの秘密情報105を格納している。ユーザ端末102は、秘密情報105を保護するための難読化に用いられる難読化用パラメータ106も保持する。難読化は、難読化用パラメータ106を使用してアプリを符号化し、解析を困難にする。難読化及び難読化用パラメータ106の詳細は後述する。   The user terminal 102 stores secret information 105 such as a password, a secret key, or temporarily captured user biometric information for proving to the service provider 104 that the user terminal 102 is a legitimate user terminal. The user terminal 102 also holds an obfuscation parameter 106 used for obfuscation for protecting the secret information 105. Obfuscation encodes an app using obfuscation parameters 106, making analysis difficult. Details of the obfuscation and obfuscation parameter 106 will be described later.

図2は、本実施例の鍵初期化及び鍵更新のプロトコルを示すシーケンス図である。以下、図2を参照してプロトコルを説明する。サービスプロバイダ104は、アプリに対して固定のパラメータを用いて難読化処理を施し、アプリと難読化機能とを組み合わせる(201)。   FIG. 2 is a sequence diagram illustrating a key initialization and key update protocol according to this embodiment. Hereinafter, the protocol will be described with reference to FIG. The service provider 104 performs obfuscation processing on the application using fixed parameters, and combines the application and the obfuscation function (201).

難読化されたアプリは、難読化のために符号化されたアプリと、難読化(アプリの符号化/復号)ためのプログラム(の少なくとも一部)を含んで構成される。なお、以下の記載において、特に言及のない場合、「機能」はプログラム(プログラムモジュール)示す。難読化は、アプリを保護するために符号化する。また、以下に説明する例において、難読化用パラメータは、難読化用秘密鍵とする。難読化は、鍵を使用する暗号化と異なる符号化を使用することができる。   The obfuscated application includes an application encoded for obfuscation and a program (at least a part thereof) for obfuscation (encoding / decoding of the application). In the following description, “function” indicates a program (program module) unless otherwise specified. Obfuscation is coded to protect the app. In the example described below, the obfuscation parameter is an obfuscation secret key. Obfuscation may use a different encoding than the encryption that uses the key.

次に、サービスプロバイダ104は、アプリ配信サーバ103に対してアプリ登録要求を送信し、難読化したアプリを、アプリ配信サーバ103に登録する(202)。なお、サービスプロバイダ104は、アプリを、難読化することなく、アプリ配信サーバ103に登録してもよい。   Next, the service provider 104 transmits an application registration request to the application distribution server 103, and registers the obfuscated application in the application distribution server 103 (202). Note that the service provider 104 may register the application in the application distribution server 103 without obfuscating the application.

次に、以下のように、難読化されたアプリが、アプリ配信サーバ103からユーザ端末102にダウンロードされる。まず、ユーザ端末102はアプリ配信サーバ103に対してアプリダウンロード要求を送信する(203)。さらに、アプリ配信サーバ103は、アプリダウンロード要求を受信すると、ユーザ端末102に、登録されている難読化されたアプリを送信する(204)。   Next, the obfuscated application is downloaded from the application distribution server 103 to the user terminal 102 as described below. First, the user terminal 102 transmits an application download request to the application distribution server 103 (203). Furthermore, when receiving the application download request, the application distribution server 103 transmits the obfuscated application registered to the user terminal 102 (204).

次に、ユーザ端末102は、ダウンロードされたアプリのためのパラメータを初期化する。特に、ユーザ端末102は、端末固有情報、システムログ、通信ログなどの初期化用パラメータを入力として難読化用秘密鍵106を生成し、難読化処理を施す(205)。   Next, the user terminal 102 initializes parameters for the downloaded application. In particular, the user terminal 102 receives the initialization parameters such as the terminal specific information, the system log, and the communication log, generates the obfuscated secret key 106, and performs the obfuscation process (205).

本例において、難読化用秘密鍵106は、アプリを暗号化/復号するための鍵である。ユーザ端末102は、ダウンロードされたアプリを上記固定のパラメータを使用して復号し、さらに、生成した難読化用秘密鍵106を使用してアプリを暗号化する。ユーザ端末102は、暗号化されたアプリと難読化機能とを含む、難読化されたアプリのイメージデータを生成し、記憶装置に格納する。固定のパラメータは、例えば、ユーザ端末102に予め設定されている、又は、アプリ配信サーバ103から送信される。   In this example, the obfuscation secret key 106 is a key for encrypting / decrypting the application. The user terminal 102 decrypts the downloaded application using the fixed parameter, and further encrypts the application using the generated obfuscation secret key 106. The user terminal 102 generates image data of the obfuscated application including the encrypted application and the obfuscation function, and stores the image data in the storage device. The fixed parameter is preset in the user terminal 102 or transmitted from the application distribution server 103, for example.

次に、以下のように、ユーザ登録が実行される。まず、ユーザ101は、アプリをインストールしたユーザ端末102を介して、サービスプロバイダ104にユーザ登録を行う(206)。ユーザ端末102とサービスプロバイダ104とは、通信路を保護するための鍵を共有する(207)。さらに、ユーザ端末102は、共有した鍵データ及び/又は他のデータを用いて、難読化用秘密鍵106を更新する(208)。   Next, user registration is performed as follows. First, the user 101 performs user registration with the service provider 104 via the user terminal 102 in which the application is installed (206). The user terminal 102 and the service provider 104 share a key for protecting the communication path (207). Further, the user terminal 102 updates the obfuscated secret key 106 using the shared key data and / or other data (208).

ユーザ登録の後、ユーザ101は、ユーザ端末102を介してサービスプロバイダ104と暗号通信を行い、サービスを利用する(209)。   After the user registration, the user 101 performs cryptographic communication with the service provider 104 via the user terminal 102 and uses the service (209).

以下のようにサービス利用のための鍵及び難読化のための鍵が更新される。まず、ユーザ端末102は、サービスプロバイダ104と通信を行い、通信路保護(サービス利用)のための秘密鍵を更新する(210)。さらに、ユーザ端末102は、更新した鍵データ及び/又は他のデータを用いて、難読化用秘密鍵106を更新する(211)。   The key for using the service and the key for obfuscation are updated as follows. First, the user terminal 102 communicates with the service provider 104 to update a secret key for communication path protection (service use) (210). Further, the user terminal 102 updates the obfuscated secret key 106 using the updated key data and / or other data (211).

ユーザ端末102は、更新した難読化用秘密鍵106を使用して、アプリに対して難読化処理を実行する。具体的には、ユーザ端末102は、更新した難読化用秘密鍵106を使用してアプリを暗号化し、暗号化されたアプリと難読化機能とを組み合わせて、難読化されたアプリのイメージデータを生成し、記憶装置に格納する。イメージデータは、実行プログラム又はファイルである。   The user terminal 102 uses the updated obfuscation secret key 106 to execute obfuscation processing on the application. Specifically, the user terminal 102 encrypts the application using the updated obfuscation secret key 106, and combines the encrypted application and the obfuscation function to obtain the image data of the obfuscated application. Generate and store in storage. The image data is an execution program or file.

図3は、本実施例に係るシステムのハードウェア構成を表す図である。アプリ配信サーバ103とユーザ端末102は、ネットワーク321を介して通信を行う。アプリ配信サーバ103及びユーザ端末102は、それぞれ、典型的な計算機構成を有することができる。サービスプロバイダ104のサーバも同様に、典型的な計算機構成を有することができる。   FIG. 3 is a diagram illustrating the hardware configuration of the system according to the present embodiment. The application distribution server 103 and the user terminal 102 communicate via the network 321. Each of the application distribution server 103 and the user terminal 102 can have a typical computer configuration. The service provider 104 server may similarly have a typical computer configuration.

アプリ配信サーバ103は、通信装置301、プロセッサであるCPU302、メモリ303、及び記憶装置304を含む。記憶装置304は、難読化されたアプリ305を格納している。アプリは、端末102で実行可能なプログラムである。メモリ303は、CPU302により実行されるプログラム及びプログラムに使用されるデータを格納する。CPU302は、プログラムに従って動作することで、所定の手段として機能する。   The application distribution server 103 includes a communication device 301, a CPU 302 that is a processor, a memory 303, and a storage device 304. The storage device 304 stores the obfuscated application 305. The application is a program that can be executed on the terminal 102. The memory 303 stores a program executed by the CPU 302 and data used for the program. The CPU 302 functions as a predetermined means by operating according to a program.

ユーザ端末102は、通信装置311、プロセッサであるCPU312、メモリ313、記憶装置314を含む。メモリ313は、CPU312により実行されるプログラム及びプログラムに使用されるデータを格納する。CPU312は、プログラムに従って動作することで、所定の機能(プログラムではない)を実現する。以下において、特に言及がない場合、ユーザ端末102による処理は、CPU312により実行される。   The user terminal 102 includes a communication device 311, a CPU 312 that is a processor, a memory 313, and a storage device 314. The memory 313 stores a program executed by the CPU 312 and data used for the program. The CPU 312 realizes a predetermined function (not a program) by operating according to the program. In the following, unless otherwise specified, the processing by the user terminal 102 is executed by the CPU 312.

記憶装置314は、難読化されたアプリである、端末固有のアプリイメージ315及びアプリイメージ315のハッシュ値317を格納している。ユーザ端末102は、アプリ配信サーバ103からダウンロードしたアプリに難読化処理を実行し、難読化されたアプリ315を、記憶装置314に格納する。   The storage device 314 stores a terminal-specific application image 315 that is an obfuscated application and a hash value 317 of the application image 315. The user terminal 102 executes obfuscation processing on the application downloaded from the application distribution server 103, and stores the obfuscated application 315 in the storage device 314.

難読化処理は、初期化用パラメータ316を使用して、難読化用秘密鍵(難読化用パラメータ)106を生成する。初期化用パラメータ316は、上述のように、例えば、端末固有情報、及び/又はシステムログ、通信ログである。ハッシュ値317は、アプリイメージ315から所定のハッシュ関数により計算される。   In the obfuscation process, the obfuscation secret key (obfuscation parameter) 106 is generated using the initialization parameter 316. As described above, the initialization parameter 316 is, for example, terminal-specific information, and / or a system log and a communication log. The hash value 317 is calculated from the application image 315 by a predetermined hash function.

図4は、記憶装置314に格納されているデータに対するアクセス権限を示す概念図である。記憶装置314の記憶領域は2つの記憶領域を含んで構成されている。1つは、一般ユーザ(又はユーザプログラム)が、データの読み取りおよびプログラムの実行が可能な第1記憶領域401(システム領域)である。もう1つは、一般ユーザがデータの読み取り、書き込み、プログラムの実行について権限を持つ第2記憶領域402(ユーザ領域)である。一般権限のユーザによるデータの書き込み(更新)は、第1記憶領域401において禁止されており、第2記憶領域402において許可されている。   FIG. 4 is a conceptual diagram showing access authority for data stored in the storage device 314. The storage area of the storage device 314 includes two storage areas. One is a first storage area 401 (system area) where a general user (or user program) can read data and execute a program. The other is a second storage area 402 (user area) in which general users have authority to read, write, and execute programs. Data writing (updating) by a user with general authority is prohibited in the first storage area 401 and allowed in the second storage area 402.

端末固有のアプリイメージ315は、第2記憶領域402格納される。また、端末固有のアプリイメージ315のハッシュ値317と、難読化されたアプリ305に含まれるブートローダ411及びハッシュ関数412とは、第1記憶領域401に格納される。ハッシュ関数412は、予め、ユーザ端末102にインストールされていてもよい。第1記憶領域401に格納されるデータ又はプログラムは、難読化用秘密鍵の更新によって書き換えられることが無い。一方、第2記憶領域402に格納されるデータ又はプログラムは、難読化用秘密鍵の更新によって更新され得るデータである。   A terminal-specific application image 315 is stored in the second storage area 402. In addition, the hash value 317 of the application image 315 unique to the terminal and the boot loader 411 and the hash function 412 included in the obfuscated application 305 are stored in the first storage area 401. The hash function 412 may be installed in the user terminal 102 in advance. Data or a program stored in the first storage area 401 is not rewritten by updating the obfuscated secret key. On the other hand, the data or program stored in the second storage area 402 is data that can be updated by updating the obfuscation secret key.

図5は、ユーザ端末102へアプリのダウンロード及び格納の処理を表すフローチャートである。まず、ユーザ端末102とアプリ配信サーバ103とは、暗号通信を確立する(501)。通信方式としては、例えばTLS(Transport Layer Security)を用いればよい。次に、ユーザ端末102は、アプリ配信サーバ103にアプリダウンロード要求を送信する(502)。   FIG. 5 is a flowchart showing processing for downloading and storing an application in the user terminal 102. First, the user terminal 102 and the application distribution server 103 establish encrypted communication (501). As a communication method, for example, TLS (Transport Layer Security) may be used. Next, the user terminal 102 transmits an application download request to the application distribution server 103 (502).

アプリ配信サーバ103は、ユーザ端末102のアプリダウンロード要求に対して、対象の難読化されたアプリ305を端末102に送信する(503)。ユーザ端末102は、アプリ305のインストーラを実行する(S504)。アプリ305は、ブートローダ411及びハッシュ関数412を含む。   In response to the application download request from the user terminal 102, the application distribution server 103 transmits the target obfuscated application 305 to the terminal 102 (503). The user terminal 102 executes the installer of the application 305 (S504). The application 305 includes a boot loader 411 and a hash function 412.

ユーザ端末102は、MACアドレスやCPU番号、OSのバージョン情報などのユーザ端末102の固有の値や、現在の日時情報、システムログなどを初期化用パラメータ316として、端末固有のアプリイメージ315を作成する(505)。ユーザ端末102は、さらに、生成したアプリイメージ315のハッシュ値317を、ハッシュ関数412を使用して計算する。   The user terminal 102 creates a terminal-specific application image 315 using the initialization value 316 using the unique value of the user terminal 102 such as the MAC address, CPU number, OS version information, current date / time information, and system log. (505). The user terminal 102 further calculates the hash value 317 of the generated application image 315 using the hash function 412.

ユーザ端末102は、生成したアプリイメージ315を第2記憶領域402に格納する(506)。ユーザ端末102は、生成したハッシュ値317、ブートローダ411及びハッシュ関数412を、第1記憶領域401に格納する。   The user terminal 102 stores the generated application image 315 in the second storage area 402 (506). The user terminal 102 stores the generated hash value 317, boot loader 411, and hash function 412 in the first storage area 401.

アプリイメージ315の安全性は、保存されているハッシュ値317の長さに依存する。ハッシュ値317が長すぎると、正当なプログラムが、ハッシュ値が一致する数値を見つける後述の処理に、許容できない時間を要する。一方、ハッシュ値317が短すぎると、マルウェアが簡単にアプリイメージ315を改ざんすることが可能になる。   The security of the application image 315 depends on the length of the stored hash value 317. If the hash value 317 is too long, a legitimate program takes an unacceptable time for the processing described later to find a numerical value that matches the hash value. On the other hand, if the hash value 317 is too short, the malware can easily tamper with the application image 315.

そこで、ユーザ端末102(の所定のプログラム)は、インストール時に、ユーザ端末の102ベンチマークテストを行ってもよい。ベンチマークテストは、たとえば、特定長さのハッシュ値の算出のために、ハッシュ関数412を所定回数実行するための時間を計測する。ベンチマークの結果と、予め定められたセキュリティレベルに基づき、ユーザ端末102は、保存するハッシュ値317の長さを決定する。たとえば、測定時間が閾値未満の最も長いハッシュ値の長さが選択される。   Therefore, the user terminal 102 (predetermined program) may perform a user terminal 102 benchmark test at the time of installation. In the benchmark test, for example, a time for executing the hash function 412 a predetermined number of times is calculated in order to calculate a hash value having a specific length. Based on the benchmark result and a predetermined security level, the user terminal 102 determines the length of the hash value 317 to be stored. For example, the length of the longest hash value whose measurement time is less than the threshold is selected.

アプリイメージ315の生成において、ユーザ端末102は、初期化用パラメータ316を使用して、難読化用秘密鍵106を生成する。ユーザ端末102は、難読化されたアプリ305における暗号化されたアプリを復号化し、さらに、難読化用秘密鍵106によりアプリを暗号化する。ユーザ端末102は、暗号化されたアプリと難読化のための機能とを含むアプリイメージ315を生成する。例えば、ユーザ端末102のインストーラが上記処理を実行する。   In generating the application image 315, the user terminal 102 generates the obfuscated secret key 106 using the initialization parameter 316. The user terminal 102 decrypts the encrypted application in the obfuscated application 305 and further encrypts the application using the obfuscated secret key 106. The user terminal 102 generates an application image 315 including an encrypted application and a function for obfuscation. For example, the installer of the user terminal 102 executes the above process.

なお、インストーラは、初期化用パラメータ316をSHA−256などのハッシュ関数に入力し、その出力を乱数生成器のシードとして用い、得られた乱数を用いてdllのメモリ配置のランダム化を実行してもよい。インストーラは、得られた乱数を秘密鍵として、アプリを暗号化してもよい。結果として得られたアプリイメージ315の実体は、端末ごとに異なるため、マルウェアによる攻撃感染リスクを軽減することができる。   The installer inputs the initialization parameter 316 to a hash function such as SHA-256, uses the output as a seed for the random number generator, and executes randomization of the memory location of the dll using the obtained random number. May be. The installer may encrypt the application using the obtained random number as a secret key. Since the entity of the application image 315 obtained as a result is different for each terminal, the risk of attack by malware can be reduced.

また、インストーラは、初期化用パラメータとして、暗号通信における秘密鍵から導出される値を使用してもよい。例えば、DH(Diffie−Hellman)鍵共有を使用している場合、DH exponentは端末のみが知っている秘密情報であるため、通信相手のサーバも初期化されたアプリを推定することはできない。   The installer may use a value derived from a secret key in encrypted communication as the initialization parameter. For example, when DH (Diffie-Hellman) key sharing is used, since the DH component is secret information known only to the terminal, the communication partner server cannot estimate the initialized application.

次に、図6、図7を用いて、本実施例における、アプリの実行プロセスについて説明する。図6は、本実施例における、アプリを実行するための機能構成例を示す図である。ユーザ端末102は、アプリの実行時に起動されるブートローダ411、ハッシュ関数412、アプリイメージのハッシュ値317、及びアプリイメージ315を含む。   Next, an application execution process in this embodiment will be described with reference to FIGS. FIG. 6 is a diagram illustrating a functional configuration example for executing an application in the present embodiment. The user terminal 102 includes a boot loader 411 that is activated when an application is executed, a hash function 412, an application image hash value 317, and an application image 315.

ブートローダ411は、処理対象データ601を受け取ると、アプリイメージ315を実行し、処理結果602を出力する(処理シーケンス詳細は後述する)。ブートローダ411は、実行時にシステム情報、時刻情報621を用いる。システム情報、時刻情報621は、例えば、第1記憶領域401に格納されている。   Upon receiving the processing target data 601, the boot loader 411 executes the application image 315 and outputs a processing result 602 (details of the processing sequence will be described later). The boot loader 411 uses system information and time information 621 at the time of execution. The system information and time information 621 are stored in the first storage area 401, for example.

アプリイメージ315は、難読化されたアプリデータ611及び含み難読化用秘密鍵616の有効期限614を含む。難読化されたアプリデータ611は、難読化された、本来のアプリ機能615と難読化用秘密鍵616、そしてデコーダ617を含んで構成される。   The application image 315 includes obfuscated application data 611 and an expiration date 614 of the obfuscated secret key 616. The obfuscated application data 611 includes an obfuscated original application function 615, an obfuscated secret key 616, and a decoder 617.

図7は、アプリの実行処理を示すフロー図である。ブートローダ411は、システム情報、時刻情報621を取得する(701)。ブートローダ411は、難読化用秘密鍵616の有効期限614とシステム情報、時刻情報621とを比較し、難読化用秘密鍵616が有効であるか確認する(702)。難読化用秘密鍵616が失効している場合には(702:No)、ブートローダ411は、サービスプロバイダ104に対して難読化用秘密鍵の更新要求を送信し(703)、処理を終了する。   FIG. 7 is a flowchart showing application execution processing. The boot loader 411 acquires system information and time information 621 (701). The boot loader 411 compares the expiration date 614 of the obfuscated secret key 616 with the system information and the time information 621 to confirm whether the obfuscated secret key 616 is valid (702). When the obfuscation secret key 616 has expired (702: No), the boot loader 411 transmits an obfuscation secret key update request to the service provider 104 (703), and ends the processing.

難読化用秘密鍵616が有効である場合には(702:Yes)、ブートローダ411は、ハッシュ関数412を用いて、アプリイメージ315のハッシュ値を計算する(704)。   If the obfuscated secret key 616 is valid (702: Yes), the boot loader 411 calculates the hash value of the application image 315 using the hash function 412 (704).

ブートローダ411は、計算したハッシュ値が、第1記憶領域401に保存されているハッシュ値317と一致しているか確認する(705)。二つのハッシュ値が一致していない場合には(705:No)、ブートローダ411は、アプリイメージ315が改ざんされていると判定し、ユーザに通知し(706)、処理を終了する。   The boot loader 411 checks whether the calculated hash value matches the hash value 317 stored in the first storage area 401 (705). If the two hash values do not match (705: No), the boot loader 411 determines that the application image 315 has been tampered with, notifies the user (706), and ends the process.

二つのハッシュ値が一致している場合には(705:Yes)、ブートローダ411は、デコーダ617を実行し、デコーダ617は、アプリ本来の機能615と難読化用秘密鍵616をデコードする(707)。デコードされたアプリ本来の機能615は、処理対象データ601を処理し、処理結果602を出力する(708)。   If the two hash values match (705: Yes), the boot loader 411 executes the decoder 617, and the decoder 617 decodes the original function 615 of the application and the obfuscated secret key 616 (707). . The decoded original function 615 of the application processes the processing target data 601 and outputs a processing result 602 (708).

このように、アプリイメージのハッシュ値を計算して、マルウェアによる書き込みが禁止されている記憶領域に保存されているハッシュ値と比較することで、マルウェアによるアプリイメージの改ざんを妨げることができる。アプリを起動して、システムの時刻情報と、難読化用秘密鍵の有効期限とを比較し、有効期限が切れていないことを確認してから、暗号通信を行うことで、古いアプリイメージと差し替える攻撃を妨げることができる。   In this way, by calculating the hash value of the application image and comparing it with the hash value stored in the storage area where writing by malware is prohibited, it is possible to prevent alteration of the application image by malware. Start the app, compare the system time information with the expiration date of the obfuscated secret key, confirm that the expiration date has not expired, and replace the old app image by performing encrypted communication Can prevent attacks.

次に、図8、図9を用いて、本実施例における、アプリの鍵更新について説明する。図8は、本実施例において鍵更新を行う機能構成例を示す図である。ユーザ端末102は、乱数生成機能811、ハッシュ関数412、アプリのブートローダ411を含む。   Next, with reference to FIGS. 8 and 9, an application key update in the present embodiment will be described. FIG. 8 is a diagram illustrating a functional configuration example for performing key update in the present embodiment. The user terminal 102 includes a random number generation function 811, a hash function 412, and an application boot loader 411.

アプリイメージ315は記憶装置314の第2記憶領域402に格納され、ハッシュ値317は、第1記憶領域401に格納されている。アプリイメージ315は、難読化されたアプリデータ611の他に、更新用データチェック機能812及びアプリイメージ生成機能813の機能を含み、難読化用秘密鍵616の有効期限821をデータとして保持している。   The application image 315 is stored in the second storage area 402 of the storage device 314, and the hash value 317 is stored in the first storage area 401. The application image 315 includes an update data check function 812 and an application image generation function 813 in addition to the obfuscated application data 611, and holds the expiration date 821 of the obfuscated secret key 616 as data. .

乱数822は、乱数生成機能811が生成するデータである。ネットワーク321を介して受信する暗号通信・認証機能の更新用データ801は、更新用鍵データ823と、更新用鍵データ823の有効期限2(824)と、を含む。   The random number 822 is data generated by the random number generation function 811. The update data 801 of the encryption communication / authentication function received via the network 321 includes update key data 823 and expiration date 2 (824) of the update key data 823.

図9は、本実施例において鍵更新処理を示すフロー図である。ユーザ端末102は、ネットワーク321を介して更新用データ801を受信する(901)。ブートローダ411は、更新用データチェック機能812を用いて、受信した更新用鍵データ823及び難読化用秘密鍵の有効期限2(824)が改ざんされていないことをチェックする(902)。   FIG. 9 is a flowchart showing key update processing in this embodiment. The user terminal 102 receives the update data 801 via the network 321 (901). The boot loader 411 uses the update data check function 812 to check that the received update key data 823 and the obfuscation private key expiration date 2 (824) have not been tampered with (902).

更新用データチェック機能812は、たとえば、暗号通信で用いるMAC(Message Authentication Code)機能を使用する。改ざんが検出された場合には(902:不正)、ブートローダ411は、受信失敗をサービスプロバイダ104に通知し(903)、更新を中断する。   The update data check function 812 uses, for example, a MAC (Message Authentication Code) function used in encrypted communication. When tampering is detected (902: unauthorized), the boot loader 411 notifies the service provider 104 of reception failure (903) and interrupts the update.

改ざんが検出されない場合には(902:正当)、ブートローダ411は、古いアプリイメージ315と更新用データ801とを、アプリイメージ生成機能813に入力し、新しいアプリイメージ831を生成する(904)。ブートローダ411は、乱数生成機能811を用いて、乱数822を生成する(905)。   When tampering is not detected (902: valid), the boot loader 411 inputs the old application image 315 and the update data 801 to the application image generation function 813 and generates a new application image 831 (904). The boot loader 411 generates a random number 822 using the random number generation function 811 (905).

乱数822は、所定の長さを有する。ブートローダ411は、生成した乱数822と、ステップ904で生成した新しいアプリイメージ831とを、ハッシュ関数631に入力し、ハッシュ値を計算する(906)。たとえば、ハッシュ関数412は、結合された乱数822とアプリイメージ831とから、ハッシュ値を計算する。ハッシュ関数412は、乱数822からハッシュ値を計算し、さらに、結合されたハッシュ値とアプリイメージ831とから、ハッシュ値を計算してもよい。   The random number 822 has a predetermined length. The boot loader 411 inputs the generated random number 822 and the new application image 831 generated in step 904 to the hash function 631, and calculates a hash value (906). For example, the hash function 412 calculates a hash value from the combined random number 822 and the application image 831. The hash function 412 may calculate a hash value from the random number 822, and may further calculate a hash value from the combined hash value and the application image 831.

一例において、乱数822とアプリイメージ831の結合は、アプリイメージ831の前に乱数822置く。これにより、マルウェアが、外部にアプリイメージのハッシュ値を送信し、外部のリソースを使用して異なる乱数に対応するハッシュ値を計算する攻撃を、防ぐことができる。   In one example, the random number 822 and the application image 831 are combined by placing the random number 822 before the application image 831. Accordingly, it is possible to prevent an attack in which malware transmits a hash value of an application image to the outside and calculates a hash value corresponding to a different random number using an external resource.

生成したハッシュ値が、第1記憶領域401に格納されているハッシュ値317と一致しない場合には(907:No)、ブートローダ411は、ステップ4に戻る。ブートローダ411は、第2記憶領域402において、古いアプリイメージ315を、乱数822と新しいアプリイメージ831を結合したデータ(格納される新しいアプリイメージ)で上書きする(908)。ブートローダ411は、鍵更新の成功をサービスプロバイダ104に通知する(909)。   If the generated hash value does not match the hash value 317 stored in the first storage area 401 (907: No), the boot loader 411 returns to Step 4. In the second storage area 402, the boot loader 411 overwrites the old application image 315 with data (the stored new application image) obtained by combining the random number 822 and the new application image 831 (908). The boot loader 411 notifies the service provider 104 of the successful key update (909).

上述のように、ブートローダ411は、乱数を更新されたアプリイメージに結合することで、アプリイメージのハッシュ値と保存されているハッシュ値とを一致させる。乱数を使用することで、改ざんに対するセキュリティを高めることができる。ブートローダ411は、乱数とは異なる種類の数値を使用してもよい。たとえば、ブートローダ411は、所定長さの値を出力する所定の関数や、所定数のインクリメントを示すカウンタを使用してもよい。これらは、たとえば、第1記憶領域401に格納される。   As described above, the boot loader 411 matches the hash value of the application image with the stored hash value by combining the random number with the updated application image. By using random numbers, security against tampering can be increased. The boot loader 411 may use a numerical value of a type different from the random number. For example, the boot loader 411 may use a predetermined function that outputs a value of a predetermined length or a counter that indicates a predetermined number of increments. These are stored in the first storage area 401, for example.

なお、第1記憶領域401に格納されているブートローダ411、乱数生成機能811、ハッシュ関数412、ハッシュ値317は、アプリが正式の手続きを経て特権を獲得した場合(アプリのアップデートなど)、更新されてもよい。   Note that the boot loader 411, the random number generation function 811, the hash function 412, and the hash value 317 stored in the first storage area 401 are updated when the application acquires a privilege through a formal procedure (application update or the like). May be.

マルウェアが本実施例のシステムにおいてアプリイメージの改ざんを試みる場合、多量のハッシュ関数による計算を行う必要がある。そこで、一例において、ユーザ端末102(の特定のプログラム)は、CPUモニタを利用し、1つの難読化用秘密鍵を使い続ける期間において、総CPU利用時間が所定の値を超えるプログラムを監視する。これにより、マルウェアを検知することができる。   When the malware tries to tamper with the application image in the system of this embodiment, it is necessary to perform a calculation with a large amount of hash functions. Therefore, in one example, the user terminal 102 (specific program thereof) uses a CPU monitor to monitor a program in which the total CPU usage time exceeds a predetermined value during a period in which one obfuscated secret key is continuously used. Thereby, malware can be detected.

ブートローダ411は、更新用データ801の改ざん検知の際に、新しい難読化用秘密鍵の有効期限2(824)をシステムの時刻情報(現在の日時を示す)と比較して、新しい難読化用秘密鍵の有効性をチェックしてもよい。これにより、古い更新データを用いてプログラムの更新を実行させようとする攻撃を防止することができる。   When detecting the falsification of the update data 801, the boot loader 411 compares the new obfuscation secret key expiration date 2 (824) with the system time information (indicating the current date and time) to determine a new obfuscation secret. The validity of the key may be checked. As a result, it is possible to prevent an attack that attempts to update the program using the old update data.

上記例は、ハッシュ値を使用して、更新可能パラメータとして秘密鍵を含む難読化されたアプリイメージの改ざんを妨げる。本実施例及び以下に説明する他の実施例は、秘密鍵を含む難読化されたアプリイメージと異なる、更新可能パラメータを含むプログラムに適用することができる。   The above example uses a hash value to prevent tampering with an obfuscated app image that includes a private key as an updatable parameter. The present embodiment and other embodiments described below can be applied to a program including an updatable parameter different from an obfuscated application image including a secret key.

実施例1は、アプリイメージのインストールにおいて、単一のハッシュ値を生成、格納する。これに代えて、実施例2は、インストール時に、複数のハッシュ値を生成、格納する。これにより、アプリイメージの更新時のハッシュ値の計算回数を削減する、又はハッシュ値を長くして安全性を改善することができる。   In the first embodiment, a single hash value is generated and stored when an application image is installed. Instead, the second embodiment generates and stores a plurality of hash values at the time of installation. As a result, the number of calculations of the hash value at the time of updating the application image can be reduced, or the hash value can be lengthened to improve safety.

アプリイメージのインストーラは、図5のステップ505において、アプリイメージのハッシュ値を計算するのではなく、乱数をk(kは2以上の整数)個生成し、それぞれの乱数とアプリイメージを入力としてハッシュ関数を計算し、乱数とハッシュ値のペアのリストを第1記憶領域401に保存する。異なる乱数のハッシュ値が同じ値である場合には、インストーラは、一つのペアのみをリストに残す。なお、リストにおいて乱数は省略されてもよい。実施例1と同様に、乱数と異なる種類の数値が使用されてもよい。   In step 505 of FIG. 5, the application image installer does not calculate the hash value of the application image, but generates k random numbers (k is an integer of 2 or more), and hashes each random number and application image as input. The function is calculated, and a list of random number / hash value pairs is stored in the first storage area 401. If the hash values of different random numbers are the same value, the installer leaves only one pair in the list. Note that random numbers may be omitted from the list. As in the first embodiment, a numerical value different from the random number may be used.

インストーラは、リストから選択した一つのエントリの乱数とアプリイメージとを結合して、第2記憶領域402に格納する。インストーラは、現在のハッシュ値の識別子(たとえばリスト内番号)を、たとえば、第2記憶領域402に格納する。   The installer combines the random number of one entry selected from the list and the application image, and stores them in the second storage area 402. The installer stores the identifier (for example, the number in the list) of the current hash value in the second storage area 402, for example.

ブートローダ411は、アプリ実行時、第2記憶領域402に格納されているアプリイメージ135のハッシュ値を計算し、計算したハッシュ値と、第1記憶領域401におけるリストの現在のハッシュ値とを比較して、アプリイメージの改ざんをチェックする。   When executing the application, the boot loader 411 calculates a hash value of the application image 135 stored in the second storage area 402, and compares the calculated hash value with the current hash value of the list in the first storage area 401. Check if the app image has been tampered with.

図10は、実施例2におけるアプリの更新のフローを示すフロー図である。実施例2の更新フローは、実施例1の図9に示す更新フローに準じているが、本更新フローは、図9に示す更新フローのステップ905、906、907の処理が異なる。以下においては、実施例1との相違点を主に説明する。   FIG. 10 is a flowchart illustrating an application update flow according to the second embodiment. The update flow of the second embodiment conforms to the update flow shown in FIG. 9 of the first embodiment, but this update flow is different in the processing of steps 905, 906, and 907 of the update flow shown in FIG. In the following, differences from the first embodiment will be mainly described.

ステップ1004において(実施例1ステップ904に対応)、ブートローダ411は、古いアプリイメージ315と更新用データ801とをアプリイメージ生成機能813に入力し、新しいアプリイメージ831を生成する。   In step 1004 (corresponding to step 904 in the first embodiment), the boot loader 411 inputs the old application image 315 and the update data 801 to the application image generation function 813 and generates a new application image 831.

ステップ1005において、ブートローダ411は乱数生成機能811を用いて、乱数をm(mは1以上の整数)個生成する。ステップ1006において、ブートローダ411は、生成したm個の乱数822それぞれと、ステップ1004で生成した新しいアプリイメージ831とをハッシュ関数412に入力し、m個のハッシュ値を計算する。   In step 1005, the boot loader 411 uses the random number generation function 811 to generate m random numbers (m is an integer equal to or greater than 1). In step 1006, the boot loader 411 inputs each of the m random numbers 822 generated and the new application image 831 generated in step 1004 to the hash function 412, and calculates m hash values.

ステップ1007において、ブートローダ411は、ステップ1006で生成したm個のハッシュ値と、保存されているk個のハッシュ値を1つのリストに纏め、ハッシュ値をキーとして昇順又は降順でソートする。このリストのエントリは、ハッシュ値の他に、乱数の値、及び新しく生成された値かどうかを示すフラグを含む。   In step 1007, the boot loader 411 collects the m hash values generated in step 1006 and the stored k hash values in one list, and sorts them in ascending or descending order using the hash values as keys. In addition to the hash value, the entry of this list includes a random number value and a flag indicating whether the value is a newly generated value.

ステップ1008において、ブートローダ411は、ステップ1007でソートしたリストから、同じハッシュ値を有するエントリを探す。見つからない場合には(1008:No)、ブートローダ411は、ステップ1005に戻る。また、見つかった場合であっても、いずれも新しく生成されたハッシュ値である場合には、ブートローダ411は、ステップ1005に戻る。   In step 1008, the boot loader 411 searches for an entry having the same hash value from the list sorted in step 1007. If not found (1008: No), the boot loader 411 returns to Step 1005. In addition, even when found, if both are newly generated hash values, the boot loader 411 returns to Step 1005.

保存されている一つのハッシュ値と一致する新たに生成したハッシュ値が見つかると(1008:Yes)、ステップ1009において、ブートローダ411は、古いアプリイメージ315を、見つけたハッシュ値に対応する乱数822と新しいアプリイメージ831とを結合したデータで、上書きする。   When a newly generated hash value that matches one stored hash value is found (1008: Yes), in step 1009, the boot loader 411 replaces the old application image 315 with a random number 822 corresponding to the found hash value. Overwrite with new combined application image 831 data.

本実施例は、保存された複数のハッシュ値と更新したアプリイメージの1以上のハッシュ値とを比較することで、効率的に更新したアプリイメージに結合する乱数を決定することができ、ハッシュ値の計算回数を低減する又は同一計算量でハッシュ値を長くすることができる。更新したアプリイメージの複数のハッシュ値と保存された複数のハッシュ値を比較することで、より効率的に更新したアプリイメージに結合する乱数を決定することができる。   In this embodiment, by comparing a plurality of stored hash values with one or more hash values of the updated application image, a random number combined with the updated application image can be determined efficiently. The number of calculations can be reduced or the hash value can be lengthened with the same calculation amount. By comparing a plurality of hash values of the updated application image with a plurality of stored hash values, it is possible to determine a random number to be combined with the updated application image more efficiently.

本実施例は、正規のユーザプログラムとマルウェアとで、利用可能なメモリ量に差異があることを利用して、安全性を高めることができる。たとえば、ステップ1007でハッシュ値のリストをソートする際に利用可能なメモリ量が異なるため、マルウェアは正規のユーザプログラムと比べてステップ1005〜1008のループ処理を多くの回数実行することになる。メモリ量に対する制限は攻撃に要する時間に変換されるので、ハッシュ値の長さが実施例1と同じ場合であっても、マルウェアと正規ユーザが衝突を見つけるまでに要する時間の差が大きくなる。   The present embodiment can improve safety by using the fact that there is a difference in the amount of available memory between a regular user program and malware. For example, since the amount of memory that can be used when sorting the list of hash values in step 1007 is different, the malware executes the loop processing of steps 1005 to 1008 many times compared to the regular user program. Since the restriction on the amount of memory is converted into the time required for the attack, even if the length of the hash value is the same as in the first embodiment, the difference in time required for the malware and the authorized user to find a collision becomes large.

なお、一例において、インストール時に保存するハッシュ値のリストは、ソートされていない状態(ソートされた順序と異なる順序)に維持される。ソートされていないことで、(ハッシュ値の長さを固定すれば)更新時のユーザ負荷が増加するが、それ以上にマルウェアが改ざんを成功させるためのコストが増加する。すなわち、相対的にユーザプログラムの計算負荷は軽減される。   In one example, the list of hash values stored at the time of installation is maintained in an unsorted state (an order different from the sorted order). Not being sorted increases the user load at the time of update (if the length of the hash value is fixed), but further increases the cost for the malware to succeed in tampering. That is, the calculation load of the user program is relatively reduced.

マルウェアが本実施例のシステムにおいてアプリイメージの改ざんを試みる場合、大量のハッシュ関数計算を行うと同時に、メモリ上に大量のデータを置いてソートを行う必要がある。メモリを少量しか使わない探索アルゴリズムもあるが、全体の計算コストが増大するというペナルティを受ける。   When the malware tries to tamper with the application image in the system of this embodiment, it is necessary to perform a large amount of hash function calculation and at the same time place a large amount of data on the memory for sorting. Some search algorithms use only a small amount of memory, but suffer from the penalty of increasing the overall computational cost.

一例において、ユーザ端末102(特定のプログラム)は、メモリモニタを利用し、1つの難読化用鍵を使い続ける期間において、メモリの占有量×時間が所定の値を超えるプログラムを監視する。これにより、マルウェアを検知することができる。   In one example, the user terminal 102 (specific program) uses a memory monitor to monitor a program whose memory occupancy × time exceeds a predetermined value during a period in which one obfuscation key is continuously used. Thereby, malware can be detected.

さらに、CPUモニタから得られる情報と合わせて、メモリ消費が所定値を超える場合のCPU負荷を計測することで、より適切に改ざんを試みるマルウェアを検出することができる。ウェブブラウザのように、CPUとメモリを大量に消費する一般的な他のアプリが存在するが、これらのアプリは事前にホワイトリストに登録しておくことで、マルウェアの誤検出の可能性を低下させることができる。   Furthermore, by combining the information obtained from the CPU monitor and measuring the CPU load when the memory consumption exceeds a predetermined value, it is possible to detect malware that attempts to tamper more appropriately. There are other common apps that consume a lot of CPU and memory, such as web browsers, but these apps can be whitelisted in advance to reduce the possibility of false detection of malware. Can be made.

次に、マルウェアが外部の攻撃者と通信できる場合を考える。攻撃者はクラウドなど大量の1つの端末が持つ以上の)計算リソースを利用可能である。実施例1、2に説明した方法だけでは、上術のような攻撃者に対して十分な安全性を保証できない場合もあり得る。   Next, consider the case where malware can communicate with an external attacker. An attacker can use more computational resources than a single large number of terminals such as the cloud. Only the methods described in the first and second embodiments may not guarantee sufficient safety against an attacker such as the above.

つまり、マルウェアが外部の攻撃者に、アプリイメージとハッシュ値の対を送付することで、外部の攻撃者は潤沢な計算リソースを使って、付与すべき乱数を見つけることができるかもしれない。このような攻撃者に対するより効果的な対策方針として、「マルウェアが大量のデータ送受信を行えば、それを検出できる(incompressibility)」という性質に基づく技術が知られている。   In other words, the malware may send a pair of app image and hash value to an external attacker, and the external attacker may be able to find a random number to be granted using abundant computational resources. As a more effective countermeasure against such an attacker, a technique based on the property that “if a malware transmits and receives a large amount of data, it can be detected (incompressibility)” is known.

実施例1、2は、ハッシュ関数を使った構成について説明した。しかし、通常のハッシュ関数は秘密情報を持たないため、原理的にincompressibilityを満たさない。ブロック暗号と、一般的なMAC(Message Authentication Code)の構成法であるCMACを組み合わせた場合、この構成もincompressibilityを満たさない。   In the first and second embodiments, the configuration using the hash function has been described. However, since a normal hash function does not have secret information, in principle, incompressibility is not satisfied. When a block cipher and a CMAC, which is a general MAC (Message Authentication Code) configuration method, are combined, this configuration also does not satisfy incompatibility.

本実施例は、図11を参照して、データの特徴値を検出するために秘密情報を利用するメッセージ認証子を用いた構成について説明する。本実施例は、鍵付きハッシュ関数(Keyed Hashing for Message Authentication Code)を使用して、ハッシュ値を計算する。   In the present embodiment, a configuration using a message authenticator that uses secret information to detect a feature value of data will be described with reference to FIG. In the present embodiment, a hash value is calculated using a keyed hashing for Message Authentication Code.

図11において、ブロック暗号1101を、ブロック長2nビットのブロック暗号のincompressibilityを満たすプログラムとする。ユーザ端末102(CPU312)は、入力データ(ここではアプリイメージ315)に適切なパディングを施し、データ長をnビットの倍数とし、nビットのデータブロックM[1]、M[2]、...、M[k]に分割する。   In FIG. 11, the block cipher 1101 is a program that satisfies the incompressibility of a block cipher having a block length of 2n bits. The user terminal 102 (CPU 312) performs appropriate padding on the input data (here, the application image 315), sets the data length to a multiple of n bits, and sets n-bit data blocks M [1], M [2],. . . , M [k].

あらかじめ定められたnビットの定数C1102と最初のデータブロックM[1]1103を結合する。ユーザ端末102は、結合したデータをブロック暗号1101に入力し、出力の下位nビットを廃棄する。   A predetermined n-bit constant C1102 and the first data block M [1] 1103 are combined. The user terminal 102 inputs the combined data to the block cipher 1101 and discards the lower n bits of the output.

ユーザ端末102は、出力の上位nビットと次のデータブロックM[2]1103を結合して、ブロック暗号1101に入力する。ユーザ端末102は、以下、ブロック暗号1101の出力の上位nビットと次のデータブロック1103を結合したデータをブロック暗号1101に入力することを繰り返す。ユーザ端末102は、最後のブロック暗号1101の出力の上位nビットをMAC値T(ハッシュ値)1104として出力する。   The user terminal 102 combines the upper n bits of the output with the next data block M [2] 1103 and inputs the combined data to the block cipher 1101. Hereinafter, the user terminal 102 repeatedly inputs data obtained by combining the upper n bits of the output of the block cipher 1101 and the next data block 1103 to the block cipher 1101. The user terminal 102 outputs the upper n bits of the output of the last block cipher 1101 as the MAC value T (hash value) 1104.

攻撃者がMAC値の計算を行うには、ブロック暗号の秘密鍵が必要である。しかし、ユーザ端末102内にあるブロック暗号のプログラム1101は、incompressibilityを満たすので、秘密鍵を完全に取り出すことができない。したがって、攻撃者は、マルウェアを介してアプリイメージ315のハッシュ値317や暗号処理の中間状態を入手したとしても、(これまでに計算されたことがある)特定の入力に対してのみMAC値を計算可能である。したがって、攻撃者は、計算リソースを費やしてもMAC値の衝突を見つけることができない。   In order for an attacker to calculate a MAC value, a secret key for block cipher is required. However, since the block cipher program 1101 in the user terminal 102 satisfies incompressibility, the secret key cannot be completely extracted. Therefore, even if the attacker obtains the hash value 317 of the application image 315 or the intermediate state of the cryptographic process via malware, the attacker only applies the MAC value to a specific input (which has been calculated so far). It can be calculated. Thus, an attacker cannot find a MAC value collision even if he spends computational resources.

本実施例で説明したMAC値計算アルゴリズムで、実施例1のハッシュ関数412を代替することにより、外部の計算リソースを利用するマルウェアに対してもより効果的に改ざんを妨げることができる。   By substituting the hash function 412 of the first embodiment with the MAC value calculation algorithm described in the present embodiment, it is possible to more effectively prevent tampering with malware using external calculation resources.

なお、最後のブロックの処理において、上位nビットに対して、あらかじめ定められた(ゼロではない)定数を加算してもよい。これにより、length extension attackを防止することができる。加算の代わりに減算や排他的論理和など全単射となる他の演算を用いてもよい。   In the process of the last block, a predetermined constant (not zero) may be added to the upper n bits. Thereby, length extension attack can be prevented. Instead of addition, other operations that are bijective, such as subtraction or exclusive OR, may be used.

図12に示すように、ブロック暗号の処理の出力の半分を廃棄する代わりに、次のデータブロックと排他的論理和を計算してもよい。具体的には、ユーザ端末102、ユーザ端末102(CPU312)は、入力データに適切なパディングを施し、データ長をnビット(nは自然数)の倍数とし、nビットのデータブロックM[1]、M[2]、...、M[k]に分割する。   As shown in FIG. 12, instead of discarding half of the output of the block cipher process, an exclusive OR with the next data block may be calculated. Specifically, the user terminal 102 and the user terminal 102 (CPU 312) perform appropriate padding on the input data, the data length is a multiple of n bits (n is a natural number), and an n-bit data block M [1], M [2],. . . , M [k].

ユーザ端末102は、あらかじめ定められたnビットの定数C1と、nビットの定数C2と最初のデータブロックM[1]の排他的論理和と、を結合し、ブロック暗号に入力する。ユーザ端末102は、ブロック番号の出力の下位nビットと次のデータブロックとの排他的論理和を計算する。ユーザ端末102は、ブロック暗号の上位nビットと排他的論理和とを結合して、ブロック暗号に入力する。ユーザ端末102は、上位nビットと、下位nビットと次のデータブロックの排他的論理和を結合したデータのブロック暗号の計算を繰り返し、最後に、下位nビットをMAC値(ハッシュ値)として出力する。   The user terminal 102 combines a predetermined n-bit constant C1, the n-bit constant C2 and the exclusive OR of the first data block M [1], and inputs them to the block cipher. The user terminal 102 calculates the exclusive OR of the lower n bits of the block number output and the next data block. The user terminal 102 combines the upper n bits of the block cipher and the exclusive OR, and inputs them to the block cipher. The user terminal 102 repeatedly calculates the block cipher of the data obtained by combining the upper n bits, the lower n bits and the exclusive OR of the next data block, and finally outputs the lower n bits as a MAC value (hash value). To do.

なお、本発明は上記した実施例に限定されるものではなく、様々な変形例が含まれる。例えば、上記した実施例は本発明を分かりやすく説明するために詳細に説明したものであり、必ずしも説明したすべての構成を備えるものに限定されるものではない。また、ある実施例の構成の一部を他の実施例の構成に置き換えることが可能であり、また、ある実施例の構成に他の実施例の構成を加えることも可能である。また、各実施例の構成の一部について、他の構成の追加・削除・置換をすることが可能である。   In addition, this invention is not limited to an above-described Example, Various modifications are included. For example, the above-described embodiments have been described in detail for easy understanding of the present invention, and are not necessarily limited to those having all the configurations described. Further, a part of the configuration of one embodiment can be replaced with the configuration of another embodiment, and the configuration of another embodiment can be added to the configuration of one embodiment. Further, it is possible to add, delete, and replace other configurations for a part of the configuration of each embodiment.

また、上記の各構成・機能・処理部等は、それらの一部又は全部を、例えば集積回路で設計する等によりハードウェアで実現してもよい。また、上記の各構成、機能等は、プロセッサがそれぞれの機能を実現するプログラムを解釈し、実行することによりソフトウェアで実現してもよい。各機能を実現するプログラム、テーブル、ファイル等の情報は、メモリや、ハードディスク、SSD(Solid State Drive)等の記録装置、または、ICカード、SDカード等の記録媒体に置くことができる。また、制御線や情報線は説明上必要と考えられるものを示しており、製品上必ずしもすべての制御線や情報線を示しているとは限らない。実際には殆どすべての構成が相互に接続されていると考えてもよい。   Each of the above-described configurations, functions, processing units, and the like may be realized by hardware by designing a part or all of them, for example, by an integrated circuit. Each of the above-described configurations, functions, and the like may be realized by software by interpreting and executing a program that realizes each function by the processor. Information such as programs, tables, and files for realizing each function can be stored in a memory, a hard disk, a recording device such as an SSD (Solid State Drive), or a recording medium such as an IC card or an SD card. In addition, the control lines and information lines are those that are considered necessary for the explanation, and not all the control lines and information lines on the product are necessarily shown. In practice, it may be considered that almost all the components are connected to each other.

101 ユーザ、102 ユーザ端末、103 アプリ配信サーバ、104 サービスプロバイダ、105 秘密情報、301 通信装置、302 CPU、303 メモリ、304 記憶装置、305 難読化されたアプリ、311 通信装置、312 CPU、313 メモリ、314 記憶装置、315 アプリイメージ、316 初期化用パラメータ、317 ハッシュ値、401 第1記憶領域、402 第2記憶領域、411 ブートローダ、412 ハッシュ関数、601 処理対象データ、602 処理結果、614 難読化用秘密鍵616の有効期限、611 難読化されたアプリデータ、615 本来のアプリ機能、617 デコーダ、801 暗号通信・認証機能の更新用鍵データ、812 更新用データチェック機能、821 難読化用秘密鍵616の有効期限、824 更新用鍵データ823の有効期限2、1101 ブロック暗号、1103 データブロック、1104 MAC値T 101 user, 102 user terminal, 103 application distribution server, 104 service provider, 105 secret information, 301 communication device, 302 CPU, 303 memory, 304 storage device, 305 obfuscated application, 311 communication device, 312 CPU, 313 memory 314 storage device, 315 application image, 316 initialization parameter, 317 hash value, 401 first storage area, 402 second storage area, 411 boot loader, 412 hash function, 601 processing target data, 602 processing result, 614 obfuscation Expiration date of private key 616, 611 obfuscated application data, 615 original application function, 617 decoder, 801 key data for update of encryption communication / authentication function, 812 update data check function, 821 for obfuscation Expiration Mitsukagi 616, 824 of the update key data 823 expiration 2,1101 block cipher, 1103 data blocks, 1104 MAC value T

Claims (11)

更新可能パラメータを含むプログラムイメージを格納している計算機が、前記プログラムイメージを保護する方法であって、
前記計算機は、
プロセッサと、
ユーザによる書き込みが禁止されている第1記憶領域と、
ユーザによる書き込みが許可されている第2記憶領域と、を含み、
前記第1記憶領域は、少なくとも一つの基準ハッシュ値を格納し、
前記第2記憶領域は、現在プログラムイメージを格納し、
前記現在プログラムイメージは、更新可能パラメータと、前記更新可能パラメータの更新データ及び前記現在プログラムイメージとから新しいプログラムイメージを生成するプログラム生成機能部と、を含み、
前記方法は、
前記プロセッサが、前記更新可能パラメータの更新データを取得し、
前記プロセッサが、前記プログラム生成機能部を呼び出して、前記現在プログラムイメージと前記更新データとを入力して新しいプログラムイメージを生成し、
前記プロセッサが、所定長の少なくとも一つの値の生成を実行し、
前記プロセッサが、前記少なくとも一つの値及び前記新しいプログラムイメージを入力として計算された少なくとも一つの現在ハッシュ値と、前記少なくとも一つの基準ハッシュ値と、の比較を実行し、
前記プロセッサが、前記少なくとも一つの基準ハッシュ値における基準ハッシュ値と一致する現在ハッシュ値が見つかるまで、前記少なくとも一つの値の生成と、前記比較と、を繰り返し、
前記プロセッサが、前記一致する現在ハッシュ値の計算に使用された前記所定長の値と、前記新しいプログラムイメージとを結合したデータで、前記第2記憶領域における前記現在プログラムイメージを上書きする、方法。
A computer storing a program image containing updatable parameters is a method for protecting the program image,
The calculator is
A processor;
A first storage area in which writing by a user is prohibited;
A second storage area that is allowed to be written by the user,
The first storage area stores at least one reference hash value;
The second storage area stores a current program image,
The current program image includes an updatable parameter, a program generation function unit that generates a new program image from update data of the updatable parameter and the current program image,
The method
The processor obtains update data of the updatable parameter;
The processor calls the program generation function unit, inputs the current program image and the update data, generates a new program image,
The processor performs generation of at least one value of a predetermined length;
The processor performs a comparison of the at least one current hash value calculated with the at least one value and the new program image as input and the at least one reference hash value;
The processor repeats the generation of the at least one value and the comparison until a current hash value is found that matches a reference hash value in the at least one reference hash value;
The method, wherein the processor overwrites the current program image in the second storage area with data obtained by combining the new program image with the predetermined length value used to calculate the matching current hash value.
請求項1に記載の方法であって、
前記所定長の値は乱数である、方法。
The method of claim 1, comprising:
The method wherein the predetermined length value is a random number.
請求項1又は2に記載の方法であって、
前記現在プログラムイメージは、前記更新データの正当性をチェックするチェック機能部をさらに含み、
前記方法は、
前記プロセッサが、前記更新可能パラメータの前記更新データを取得すると、前記チェック機能部を呼び出して、前記更新データの正当性をチェックし、
前記更新データが正当である場合に、前記プロセッサが、前記新しいプログラムイメージを生成する、ことをさらに含む方法。
The method according to claim 1 or 2, wherein
The current program image further includes a check function unit that checks the validity of the update data,
The method
When the processor obtains the update data of the updatable parameter, it calls the check function unit to check the validity of the update data,
The method further comprising: if the update data is valid, the processor generates the new program image.
請求項1、2又は3に記載の方法であって、
前記現在プログラムイメージは、前記更新可能パラメータの現在の値の有効期限を示すデータを含み、
前記方法は、
前記プロセッサが、現在日時が前記有効期限を過ぎている場合に前記現在プログラムイメージの実行を停止する、ことをさらに含む方法。
The method according to claim 1, 2 or 3,
The current program image includes data indicating an expiration date of a current value of the updatable parameter;
The method
The method further comprising: stopping the execution of the current program image if a current date and time has passed the expiration date.
請求項1に記載の方法であって、
前記第1記憶領域は、複数の基準ハッシュ値を格納する、方法。
The method of claim 1, comprising:
The method in which the first storage area stores a plurality of reference hash values.
請求項1に記載の方法であって、
前記第1記憶領域は、複数の基準ハッシュ値を格納し、
前記方法は、
前記プロセッサが、前記所定長の複数の値を生成し、
前記プロセッサが、前記複数の値及び前記新しいプログラムイメージを入力として計算された複数の現在ハッシュ値と、前記複数の基準ハッシュ値と、の比較を実行する、方法。
The method of claim 1, comprising:
The first storage area stores a plurality of reference hash values,
The method
The processor generates a plurality of values of the predetermined length;
The method, wherein the processor performs a comparison of a plurality of current hash values calculated with the plurality of values and the new program image as input and the plurality of reference hash values.
請求項5又は6に記載の方法であって、
前記複数の基準ハッシュ値は、前記第1記憶領域において、ソートされた順序と異なる順序でリスト化されている、方法。
The method according to claim 5 or 6, comprising:
The plurality of reference hash values are listed in an order different from the sorted order in the first storage area.
請求項1から7のいずれか一項に記載の方法であって、
前記方法は、
前記プロセッサが、前記プロセッサと前記計算機のメモリの使用状況を監視し、
前記プロセッサが、前記プロセッサの負荷及び前記メモリの消費が閾値を超えるプログラムをマルウェアと判定する、方法。
A method according to any one of claims 1 to 7, comprising
The method
The processor monitors memory usage of the processor and the computer;
A method in which the processor determines that a program whose load on the processor and consumption of the memory exceed a threshold is malware.
請求項1から8のいずれか一項に記載の方法であって、
前記基準ハッシュ値及び現在ハッシュ値は、鍵付きハッシュ関数により計算され、
前記鍵付きハッシュ関数は、
入力データにパディングを施してデータ長がnビットの倍数の初期データを生成し、前記初期データをnビットのブロックに分割し、
nビット定数と最初のブロックを結合して、結合データを生成し、
前記結合データをブロック暗号に入力し、前記ブロック暗号の出力の下位nビットを廃棄し、上位nビットを取得し、
前記上位nビットと次のブロックとを結合して、次の結合データを生成し、
前記次の結合データを前記ブロック暗号に入力し、前記ブロック暗号の出力の下位nビットを廃棄し、上位nビットを取得し、
前記次の結合データの生成と、前記次の結合データを入力とする前記ブロック暗号の出力の上位nビットの取得を繰り返す、ことを含む、方法。
A method according to any one of claims 1 to 8, comprising
The reference hash value and the current hash value are calculated by a keyed hash function,
The keyed hash function is
Padding the input data to generate initial data whose data length is a multiple of n bits, dividing the initial data into blocks of n bits;
Combine the n-bit constant and the first block to generate combined data,
Input the combined data to the block cipher, discard the lower n bits of the output of the block cipher, and obtain the upper n bits;
Combining the upper n bits with the next block to generate the next combined data;
Inputting the next combined data into the block cipher, discarding the lower n bits of the output of the block cipher, and obtaining the upper n bits;
Repeating the generation of the next combined data and obtaining the upper n bits of the output of the block cipher with the next combined data as input.
請求項1から8のいずれか一項に記載の方法であって、
前記基準ハッシュ値及び現在ハッシュ値は、鍵付きハッシュ関数により計算され、
前記鍵付きハッシュ関数は、
入力データにパディングを施してデータ長がnビットの倍数の初期データを生成し、前記初期データをnビットのブロックに分割し、
nビット第1定数と、nビット第2定数と最初のブロックとの排他的論理和を結合して、結合データを生成し、
前記結合データをブロック暗号に入力し、前記ブロック暗号の出力を取得し、
前記出力の上位nビットと、次のブロックと前記出力の下位nビットとの排他的論理和と、を結合して、次の結合データを生成し、
前記次の結合データを前記ブロック暗号に入力し、前記ブロック暗号の次の出力を取得し、
前記次の結合データの生成と、前記次の結合データを入力とする前記ブロック暗号の前記次の出力の取得を繰り返す、ことを含む、方法。
A method according to any one of claims 1 to 8, comprising
The reference hash value and the current hash value are calculated by a keyed hash function,
The keyed hash function is
Padding the input data to generate initial data whose data length is a multiple of n bits, dividing the initial data into blocks of n bits;
combining the exclusive OR of the n-bit first constant, the n-bit second constant, and the first block to generate combined data;
Input the combined data into a block cipher, obtain an output of the block cipher,
Combining the upper n bits of the output with the exclusive OR of the next block and the lower n bits of the output to generate the next combined data;
Inputting the next combined data into the block cipher and obtaining the next output of the block cipher;
Repeating the generation of the next combined data and the acquisition of the next output of the block cipher with the next combined data as input.
更新可能なパラメータを含むプログラムイメージを保護する装置であって、
プロセッサと、
ユーザによる書き込みが禁止されている第1記憶領域と、
ユーザによる書き込みが許可されている第2記憶領域と、を含み、
前記第1記憶領域は、少なくとも一つの基準ハッシュ値を格納し、
前記第2記憶領域は、現在プログラムイメージを格納し、
前記現在プログラムイメージは、更新可能パラメータと、前記更新可能パラメータの更新データ及び前記現在プログラムイメージとから新しいプログラムイメージを生成するプログラム生成機能部と、を含み、
前記プロセッサは、
前記更新可能パラメータの更新データを取得し、
前記プログラム生成機能部を呼び出して、前記現在プログラムイメージと前記更新データとを入力して新しいプログラムイメージを生成し、
所定長の少なくとも一つの値の生成を実行し、
前記少なくとも一つの値及び前記新しいプログラムイメージを入力として計算された少なくとも一つの現在ハッシュ値と、前記少なくとも一つの基準ハッシュ値と、の比較を実行し、
前記少なくとも一つの基準ハッシュ値における基準ハッシュ値と一致する現在ハッシュ値が見つかるまで、前記少なくとも一つの値の生成と、前記比較と、を繰り返し、
前記一致する現在ハッシュ値の計算に使用された前記所定長の値と、前記新しいプログラムイメージとを結合したデータで、前記第2記憶領域における前記現在プログラムイメージを上書きする、装置。
A device for protecting a program image containing updatable parameters,
A processor;
A first storage area in which writing by a user is prohibited;
A second storage area that is allowed to be written by the user,
The first storage area stores at least one reference hash value;
The second storage area stores a current program image,
The current program image includes an updatable parameter, a program generation function unit that generates a new program image from update data of the updatable parameter and the current program image,
The processor is
Obtaining update data of the updatable parameter;
Call the program generation function unit, input the current program image and the update data to generate a new program image,
Perform generation of at least one value of a predetermined length;
Performing a comparison between at least one current hash value calculated with the at least one value and the new program image as input, and the at least one reference hash value;
Repeating the generation of the at least one value and the comparison until a current hash value matching a reference hash value in the at least one reference hash value is found;
An apparatus for overwriting the current program image in the second storage area with data obtained by combining the new program image with the predetermined length value used to calculate the matching current hash value.
JP2016229871A 2016-11-28 2016-11-28 How to protect program images Expired - Fee Related JP6674368B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016229871A JP6674368B2 (en) 2016-11-28 2016-11-28 How to protect program images

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016229871A JP6674368B2 (en) 2016-11-28 2016-11-28 How to protect program images

Publications (2)

Publication Number Publication Date
JP2018088574A true JP2018088574A (en) 2018-06-07
JP6674368B2 JP6674368B2 (en) 2020-04-01

Family

ID=62494475

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016229871A Expired - Fee Related JP6674368B2 (en) 2016-11-28 2016-11-28 How to protect program images

Country Status (1)

Country Link
JP (1) JP6674368B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008234220A (en) * 2007-03-19 2008-10-02 Ricoh Co Ltd Information processor, software starting method, and image processor
JP2010050760A (en) * 2008-08-22 2010-03-04 Hitachi Ltd Content protection apparatus, and content utilization apparatus
JP2010152877A (en) * 2008-11-26 2010-07-08 Panasonic Corp Software update system, management device, recording medium and integrated circuit

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008234220A (en) * 2007-03-19 2008-10-02 Ricoh Co Ltd Information processor, software starting method, and image processor
JP2010050760A (en) * 2008-08-22 2010-03-04 Hitachi Ltd Content protection apparatus, and content utilization apparatus
JP2010152877A (en) * 2008-11-26 2010-07-08 Panasonic Corp Software update system, management device, recording medium and integrated circuit

Also Published As

Publication number Publication date
JP6674368B2 (en) 2020-04-01

Similar Documents

Publication Publication Date Title
KR102217501B1 (en) Mobile device with trusted execution environment
CN112074836B (en) Apparatus and method for protecting data through trusted execution environment
KR100996784B1 (en) Saving and retrieving data based on public key encryption
KR101067399B1 (en) Saving and retrieving data based on symmetric key encryption
Brengel et al. Identifying key leakage of bitcoin users
EP3270318B1 (en) Dynamic security module terminal device and method for operating same
US20240031129A1 (en) Data encryption method, data decryption method, terminal, and storage medium
CN111614467B (en) System backdoor defense method and device, computer equipment and storage medium
JP2019057167A (en) Computer program, device and determining method
CN109302442B (en) Data storage proving method and related equipment
Feng et al. Secure code updates for smart embedded devices based on PUFs
CN109784072B (en) Security file management method and system
WO2020209714A1 (en) Integrated circuit device for iot applications
Sarhan et al. Secure android-based mobile banking scheme
CN106971105B (en) IOS-based application program defense method against false face attack
Qin et al. RIPTE: runtime integrity protection based on trusted execution for IoT device
Gupta et al. Security and Cryptography
JP6674368B2 (en) How to protect program images
CN116956298A (en) Application running environment detection method and device
KR101906484B1 (en) Method for application security and system for executing the method
JP6779702B2 (en) How to protect your program
Román et al. Sealed storage for low-cost IoT devices: An approach using SRAM PUFs and post-quantum cryptography
KR102534012B1 (en) System and method for authenticating security level of content provider
Sagar et al. Survey on Various Cloud Security Approaches
US20240205249A1 (en) Protection of cloud storage devices from anomalous encryption operations

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190301

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200131

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20200212

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200306

R150 Certificate of patent or registration of utility model

Ref document number: 6674368

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees