JP4675642B2 - Program obfuscation apparatus, method and program - Google Patents

Program obfuscation apparatus, method and program Download PDF

Info

Publication number
JP4675642B2
JP4675642B2 JP2005045259A JP2005045259A JP4675642B2 JP 4675642 B2 JP4675642 B2 JP 4675642B2 JP 2005045259 A JP2005045259 A JP 2005045259A JP 2005045259 A JP2005045259 A JP 2005045259A JP 4675642 B2 JP4675642 B2 JP 4675642B2
Authority
JP
Japan
Prior art keywords
obfuscation
program
obfuscated
instructions
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2005045259A
Other languages
Japanese (ja)
Other versions
JP2006235688A (en
Inventor
晋作 清本
俊昭 田中
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.)
KDDI Corp
Original Assignee
KDDI Corp
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 KDDI Corp filed Critical KDDI Corp
Priority to JP2005045259A priority Critical patent/JP4675642B2/en
Publication of JP2006235688A publication Critical patent/JP2006235688A/en
Application granted granted Critical
Publication of JP4675642B2 publication Critical patent/JP4675642B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、プログラムを第三者が理解しにくいように効率的に改変することのできるプログラム難読化装置およびその方法ならびにプログラムに関する。   The present invention relates to a program obfuscation apparatus, a method thereof, and a program that can efficiently modify a program so that it is difficult for a third party to understand.

近年、コンピュータを利用した様々なサービスが提供されるようになった。このとき、サービス提供者は、ユーザに対してサービスを利用するためのプログラムを提供する。このようなプログラムには、例えば、暗号化鍵等を用い何らかの秘密情報を隠蔽する処理が施される。そのような場合、プログラムに対して攻撃者が理解しにくいように改変する必要があり、この技術を難読化と呼ぶ。   In recent years, various services using computers have been provided. At this time, the service provider provides the user with a program for using the service. Such a program is subjected to, for example, a process of concealing some secret information using an encryption key or the like. In such a case, it is necessary to modify the program so that it is difficult for an attacker to understand. This technique is called obfuscation.

難読化は、プログラムの解析を困難にする用途でも使用される。例えば、プログラムが機密データや機密アルゴリズムを持つ場合、安全な構成で問題解析を困難にするように、ソースコードに対し、プログラムの仕様を変更しないように、関数へのポインタ変数を新たに複数導入し、また、関数ポインタの変数のいずれかに関数のアドレスを代入する命令文を複数挿入し、プログラムにおける関数の呼び出しを関数ポインタ変数の値に応じて呼び出すように変換する難読化方法が知られている(例えば、特許文献1参照)。
特開2003−337629号公報
Obfuscation is also used for applications that make program analysis difficult. For example, if a program has confidential data or a confidential algorithm, multiple pointer variables to functions are introduced so that the specification of the program is not changed in the source code so that problem analysis is difficult with a secure configuration. Also, an obfuscation method is known that inserts multiple statements that assign the function address to one of the function pointer variables, and converts the function call in the program to be called according to the value of the function pointer variable. (For example, refer to Patent Document 1).
JP 2003-337629 A

しかしながら、上記した従来技術によれば、難読化手法を適用するに際して、安全性とファイルサイズの増加に対して効率的に難読化処理を施すことができず、結果的に冗長な難読化処理になってしまう。また、ファイルサイズの増加に対して十分に安全性を確保できないなどの問題があった。   However, according to the above-described prior art, when applying the obfuscation technique, the obfuscation process cannot be efficiently performed for the increase in safety and the file size, resulting in redundant obfuscation process. turn into. In addition, there has been a problem that sufficient safety cannot be secured against an increase in file size.

本発明は、上記事情に基づいてなされたものであり、新規な評価方法を用いて安全性を遂次計算することで効率的な難読化を実現するプログラム難読化装置およびその方法ならびにプログラムを提供することを目的とする。   The present invention has been made based on the above circumstances, and provides a program obfuscation apparatus, a method thereof, and a program for realizing efficient obfuscation by successively calculating safety using a novel evaluation method The purpose is to do.

上記した課題を解決するために、本発明の一態様であるプログラム難読化装置は、難読化前のプログラムとユーザによって定義される安全性評価のための要求条件を、入力装置を介して取り込むデータ入力取込み部と、演算装置を用い、前記取り込まれた難読化前のプログラムに関し、あらかじめ用意された複数の難読化手法のそれぞれを実行して難読化された複数のプログラムを生成出力する難読化処理部と、前記難読化手法のそれぞれを実行する毎、前記難読化後のプログラムと前記取り込まれた難読化前のプログラムとの命令単位での差分を評価し、前記要求条件を満たしたときに前記難読化処理部による難読化処理の実行を終了させ、前記難読化後のプログラムを出力する難読化判定出力部と、を具備し、前記難読化判定出力部は、前記難読化前後のプログラムを構成する命令のうち、同一である命令数を前記難読化後のプログラムにおける全体の命令数で除算した値を整数1から減算して得られる値に基づき前記差分の評価を行うことを特徴とする。 In order to solve the above-described problem , a program obfuscation apparatus according to one aspect of the present invention includes a program that takes in a program before obfuscation and a requirement condition for safety evaluation defined by a user via an input device. An obfuscation process for generating and outputting a plurality of obfuscated programs by executing each of a plurality of obfuscation techniques prepared in advance with respect to the captured program before obfuscation using an input capturing unit and an arithmetic device Each time the obfuscation method is executed, the difference in the instruction unit between the obfuscated program and the captured pre-obfuscated program is evaluated, and when the required condition is satisfied It terminates execution obfuscation process by obfuscation processor, and obfuscation decision output unit for outputting the program after the obfuscation, and ingredients Bei, said obfuscation decision output unit, Evaluation of the difference based on a value obtained by subtracting from the integer 1 the value obtained by dividing the number of identical instructions among the instructions constituting the program before and after the obfuscation by the total number of instructions in the program after obfuscation It is characterized by performing .

また、上記プログラム難読化装置において、前記難読化処理部は、同じ難読化手法を数回実行して前記難読化判定出力部により生成される前記値の上昇の程度を評価し、前記複数の難読化手法のうち最適な難読化手法を選択して前記難読化処理を実行することを特徴とする。 Furthermore, in this program obfuscating apparatus, the obfuscation processor is the same obfuscation catheter method executed several times to assess the degree of increase of the value generated by the obfuscation decision output unit, said plurality of The most obfuscation method is selected from the obfuscation methods and the obfuscation process is executed.

また、本発明において、前記難読化判定出力部は、前記データ入力取込み部を介して更に取り込まれるファイルサイズに従ってその上限値との比較を行い、該ファイルサイズが該上限値以下である場合には、前記難読化処理を終了させることを特徴とする。   In the present invention, the obfuscation determination output unit compares the upper limit value according to the file size further fetched through the data input fetch unit, and when the file size is equal to or smaller than the upper limit value. The obfuscation process is terminated.

上記した課題を解決するために、本発明の他の態様であるプログラム難読化方法は、プログラムを第三者が理解しにくいように改変する、入出力装置と演算装置を備えたプログラム難読化装置に用いられるプログラム難読化方法であって、難読化前のプログラムとユーザによって定義される安全性評価のための要求条件とを、前記入力装置を介して取り込むデータ入力取込みステップと、前記演算装置を用い、前記取り込まれた難読化前のプログラムに関し、あらかじめ用意された複数の難読化手法のそれぞれを実行し、難読化された複数のプログラムを生成出力する難読化ステップと、前記難読化手法のそれぞれを実行する毎、前記難読化後のプログラムと前記取り込まれた難読化前のプログラムとの命令単位での差分を評価し、前記要求条件を満たしたときに前記難読化ステップによる難読化処理を終了させ、前記難読化後のプログラムを出力する難読化判定出力ステップと、を有し、前記難読化判定出力ステップは、前記難読化前後のプログラムを構成する命令のうち、同一である命令数を前記難読化後のプログラムにおける全体の命令数で除算した値を整数1から減算して得られる値に基づき前記差分の評価を行うことを特徴とする。
また、上記プログラム難読化方法において、前記難読化ステップは、同じ難読化手法を数回実行して前記難読化判定出力ステップにより生成される前記値の上昇の程度を評価し、前記複数の難読化手法のうち最適な難読化手法を選択して前記難読化処理を実行してもよい。
In order to solve the above-described problems, a program obfuscation method according to another aspect of the present invention is a program obfuscation apparatus including an input / output device and an arithmetic unit, which modifies a program so that it is difficult for a third party to understand. A program obfuscation method used in the above-described data input capturing step for capturing a program before obfuscation and a requirement condition for safety evaluation defined by a user via the input device, and the computing device using relates the captured before obfuscation program, and obfuscation step of running each of the plurality of obfuscated catheter technique prepared in advance, generates and outputs a plurality of programs obfuscated, the obfuscated catheter method Each time, the difference in the instruction unit between the obfuscated program and the captured pre-obfuscated program is evaluated, and the request Matter was terminated flame読化process by pre-Symbol obfuscation step when filled, have a, and obfuscation determination output step of outputting the program after the obfuscation, the obfuscation determination outputting step, the obfuscation The difference is evaluated based on a value obtained by subtracting from the integer 1 the value obtained by dividing the number of identical instructions by the total number of instructions in the program after obfuscation among the instructions constituting the program before and after conversion. It is characterized by that.
Further, in the program obfuscation method, the obfuscation step executes the same obfuscation method several times to evaluate the degree of increase in the value generated by the obfuscation determination output step, and the plurality of obfuscations The obfuscation process may be executed by selecting an optimal obfuscation technique among the techniques.

上記した課題を解決するために、本発明の他の態様は、プログラムを第三者が理解しにくいように改変するプログラム難読化装置のコンピュータに、難読化前のプログラムとユーザによって定義される安全性評価のための要求条件とを取り込むデータ入力取込み処理と、前記取り込まれた難読化前のプログラムに関し、あらかじめ用意された複数の難読化手法のそれぞれを実行し、難読化された複数のプログラムを生成出力する難読化処理と、前記難読化手法のそれぞれを実行する毎、前記難読化後のプログラムと前記取り込まれた難読化前のプログラムとの命令単位での差分を評価し、前記要求条件を満たしたときに前記難読化処理を終了させ、前記難読化後のプログラムを出力する難読化判定出力処理と、を実行させるプログラムであって、前記難読化判定出力処理は、前記難読化前後のプログラムを構成する命令のうち、同一である命令数を前記難読化後のプログラムにおける全体の命令数で除算した値を整数1から減算して得られる値に基づき前記差分の評価を行うことを特徴とする。 In order to solve the problem described above, another aspect of the present invention, the computer program obfuscation apparatus for modifying the program to a third party is hard to understand, safety defined by obfuscation previous program and user a data input capture process to capture the requirements for sexual evaluation, the relates obfuscated program before taken to execute each of the plurality of obfuscated catheter technique prepared in advance, obfuscated plurality of programs and obfuscation process of generating output, said each execution of the respective obfuscation catheter method, to evaluate the difference between the instruction unit of a program and the captured before obfuscation program after the obfuscation, the request terminates the obfuscation process when the condition is met, met the program is executed and obfuscation determination output process, the outputs of the program after the obfuscation The obfuscation determination output process subtracts, from the integer 1, a value obtained by dividing the same number of instructions constituting the program before and after the obfuscation by the total number of instructions in the obfuscated program. The difference is evaluated based on the obtained value.

本発明によれば、難読化処理部が、データ入力取込み部を介して難読化前のプログラムを取込み、あらかじめ複数用意された難読化手法に従って難読化処理を実行し、難読化判定出力部が、難読化処理を1回実行する毎に安全性評価を行い、ユーザが定義した安全性評価のための要求条件を達成していれば難読化処理を終了し、達成していなければ再度難読化処理を実行する。また、ユーザが、ファイルサイズの上限を定義した場合には、その上限内で安全性の評価値が最大となるように難読化手法を再帰的に実行する。そして、安全性を達成し、かつファイルサイズが上限以下であれば処理を終了する。この場合の安全性評価は、難読化前のプログラムに対する命令単位での差分として評価される。
このことにより、効率的に難読化前のプログラムが難読化処理されて改変されるためにプログラムの保護が可能であり、また、ファイルサイズが増加しても安全なシステムの構築が可能になる。
According to the present invention, the obfuscation processing unit takes in the program before obfuscation via the data input capturing unit, executes obfuscation processing according to a plurality of obfuscation methods prepared in advance, and the obfuscation determination output unit Each time the obfuscation process is executed, a safety evaluation is performed. If the user-defined requirements for safety evaluation are achieved, the obfuscation process is terminated. If not, the obfuscation process is performed again. Execute. Further, when the user defines an upper limit of the file size, the obfuscation technique is recursively executed so that the safety evaluation value becomes the maximum within the upper limit. If the safety is achieved and the file size is less than or equal to the upper limit, the process is terminated. The safety evaluation in this case is evaluated as a difference in units of instructions with respect to the program before obfuscation.
As a result, the program before obfuscation is efficiently obfuscated and modified, so that the program can be protected, and a safe system can be constructed even if the file size increases.

図1は、本発明の実施形態に係るプログラム難読化装置を機能展開して示したブロック図である。
図1に示されるように、本発明のプログラム難読化装置は、中央制御部1と、データ入力取込み部2と、難読化処理部3と、P値評価部4と、Q値評価部5と、難読化判定出力部6とで構成される。
FIG. 1 is a block diagram showing the program development obfuscation apparatus according to the embodiment of the present invention.
As shown in FIG. 1, the program obfuscation apparatus of the present invention includes a central control unit 1, a data input capturing unit 2, an obfuscation processing unit 3, a P value evaluation unit 4, and a Q value evaluation unit 5. And the obfuscation determination output unit 6.

データ入力取込み部2は、難読化前のプログラムと、ユーザによって定義される安全性評価およびファイルサイズに関する要求条件を、図示せぬ入力装置を介して取り込む機能を持つ。要求条件としては他に処理時間等も考えられる。また、難読化処理部3は、図示せぬ演算装置を用い、データ入力取込み部2によって取り込まれた難読化前のプログラムに関し、あらかじめ用意された複数の難読化手法(難読化アルゴリズム)のそれぞれを実行して複数の難読化されたプログラムを生成出力する機能を持つ。
また、難読化判定出力部6は、難読化アルゴリズムのそれぞれを実行する毎、難読化後のプログラムと取り込まれた難読化前のプログラムとを命令単位での差分で評価し、データ入力取込み部2によって取り込まれた要求条件を満たしたときに難読化処理部3による難読化処理の実行を終了させる機能を持つ。難読化判定出力部6はまた、データ入力取込み部2を介して更に取り込まれるファイルサイズに従ってその上限値との比較を行い、ファイルサイズが上限値以下である場合には、難読化処理部3による難読化処理を終了させ、難読化後のプログラムを出力する。
The data input fetching unit 2 has a function of fetching a program before obfuscation, and requirements for safety evaluation and file size defined by the user via an input device (not shown). Other requirements may include processing time. In addition, the obfuscation processing unit 3 uses an arithmetic device (not shown) and relates each of a plurality of obfuscation techniques (obfuscation algorithms) prepared in advance with respect to the program before obfuscation captured by the data input capturing unit 2. Has the ability to generate and output multiple obfuscated programs when executed.
Further, each time the obfuscation algorithm is executed, the obfuscation determination output unit 6 evaluates the obfuscated program and the captured pre-obfuscated program by the difference in units of instructions, and the data input capturing unit 2 Has the function of ending the execution of the obfuscation process by the obfuscation processing unit 3 when the request condition fetched by is satisfied. The obfuscation determination output unit 6 also performs comparison with the upper limit value according to the file size further captured via the data input capture unit 2, and if the file size is less than or equal to the upper limit value, the obfuscation processing unit 3 End the obfuscation process and output the obfuscated program.

一方、P値評価部4は、難読化前後のプログラムを構成する命令のうち、同一である命令数を難読化後の全体の命令数で除算した値を整数1から減算して得られる値の大小に基づき差分の評価を行い、また、Q値評価部5は、難読化処理部3が同じ難読化処理手順を数回実行してP値評価部4により生成されるP値の上昇の程度を評価し、難読化処理部3が、複数の難読化アルゴリズムのうち最適な難読化アルゴリズムを選択して難読化処理を実行する。
なお、中央制御部1は、本発明のプログラム難読化装置の制御中枢となり、上記したデータ入力取込み部2、難読化処理部3、P値評価部4、Q値評価部5、難読化判定出力部6間のシーケンス制御を行う。
On the other hand, the P value evaluation unit 4 subtracts from the integer 1 the value obtained by dividing the number of identical instructions by the total number of instructions after obfuscation among the instructions constituting the program before and after obfuscation. The Q value evaluation unit 5 performs the evaluation of the difference based on the magnitude, and the degree of increase of the P value generated by the P value evaluation unit 4 when the obfuscation processing unit 3 executes the same obfuscation processing procedure several times. Then, the obfuscation processing unit 3 selects an optimum obfuscation algorithm from the plurality of obfuscation algorithms and executes the obfuscation process.
The central control unit 1 serves as a control center of the program obfuscation apparatus of the present invention, and includes the data input capturing unit 2, the obfuscation processing unit 3, the P value evaluation unit 4, the Q value evaluation unit 5, and the obfuscation determination output. Sequence control between the units 6 is performed.

以下、図2、図3を参照しながら本発明の実施形態に関する動作について説明するが、ここでは、ユーザに有効期限のあるプログラムを提供し、対価を得るようなサービスを想定する。
本サービスの利用手順は以下のようになる。すなわち、まず、ユーザは、プログラム提供サイトにアクセスし、対価の支払いを行うと共にコンテンツのダウンロード要求を行う。一方、プログラム提供サイトは、ユーザからのダウンロード要求に対して、オリジナルプログラムを本発明のプログラム難読化装置に入力し、難読化されたプログラムを得る。また、プログラム提供サイトは、難読化処理が施されたプログラムをユーザに返信する。
このことにより、ユーザは受信した難読化プログラムを利用することができる。なお、受信した難読化プログラムには有効期限をチェックする機能が含まれており、有効期限を過ぎると使用不能になる。
Hereinafter, operations related to the embodiment of the present invention will be described with reference to FIG. 2 and FIG. 3. Here, a service that provides a user with a program having an expiration date and obtains a price is assumed.
The procedure for using this service is as follows. That is, first, the user accesses the program providing site, pays a price, and makes a content download request. On the other hand, in response to a download request from the user, the program providing site inputs the original program to the program obfuscation apparatus of the present invention to obtain an obfuscated program. Further, the program providing site returns a program subjected to the obfuscation process to the user.
As a result, the user can use the received obfuscation program. The received obfuscation program includes a function for checking the expiration date, and becomes unavailable after the expiration date.

図2は、本発明実施形態において用いられる難読化手法(難読化アルゴリズム)の一例をフローチャートで示した図である。
ここでは、難読化処理部3は、まず、乱数を生成し(S21)、生成した乱数をNビット出力のハッシュ関数に入力してNビットの初期値を得ている(S22)。そして、ここで得られたNビットの初期値を、使用する難読化手法の個数分nに分割し(S23)、分割したビット列に対して、2Nビットになるまで別の乱数を結合させ、再びハッシュ関数へ入力して、難読化手法の個数分のNビット乱数を得る(S24)。
FIG. 2 is a flowchart showing an example of the obfuscation technique (obfuscation algorithm) used in the embodiment of the present invention.
Here, the obfuscation processing unit 3 first generates a random number (S21), and inputs the generated random number into an N-bit output hash function to obtain an N-bit initial value (S22). Then, the initial value of N bits obtained here is divided into n by the number of obfuscation methods to be used (S23), another random number is combined with the divided bit string until 2N bits, and again Input to the hash function to obtain N-bit random numbers corresponding to the number of obfuscation methods (S24).

続いて冗長度の導入を行う(S25〜S27)。具体的に、S25では、Nビット乱数を、n×1×mビットに分割し、nビットの変数名の宣言をmで指定される部分に1行追加する(冗長度の導入1)。そして、S26では、Nビット乱数をn×1m×m×pに分割し、nビットの変数名の宣言をmで指定される部分に1行追加する。また、上記の処理で生成した演算を、乱数pを使用してダミー処理を生成し追加する。ダミー処理の生成方法は、後述する処理手順の変更に準ずる(冗長度の導入2)。
次に、Nビット乱数をa×bビットに分割し、事前に作成されているa個のダミーコートサンプルから、値aを用いて選択し、bで指定される位置に挿入する(冗長度の導入3)。
Subsequently, redundancy is introduced (S25 to S27). Specifically, in S25, the N-bit random number is divided into n × 1 × m bits, and an n-bit variable name declaration is added to the portion specified by m (redundancy introduction 1). In S26, the N-bit random number is divided into n × 1m × m × p, and an n-bit variable name declaration is added to the part specified by m. Further, a dummy process is generated and added to the calculation generated in the above process using the random number p. The generation method of the dummy process is in accordance with a change in a processing procedure to be described later (redundancy introduction 2).
Next, the N-bit random number is divided into a × b bits, selected from a dummy code samples prepared in advance using the value a, and inserted at the position specified by b (redundancy level). Introduction 3).

次に処理手順の変更を行う(S28、S29)。具体的には、S28では、Nビット乱数をs×t×u×vに分割し、プログラムで使用されている変数を値sで指定し、tで指定される演算を指定された変数とuを入力とし、その後、逆演算を行う処理をvで指定される場所に追加する(処理手順の変更1)。
次に、S29では、Nビット乱数をe×f×g×h×iに分割し、プログラムで使用されている変数を値eで指定し、fで指定される演算を指定された変数とgを入力としてh回行い、その後逆演算を行う処理をiで指定される場所に追加する(処理手順の変更2)。
Next, the processing procedure is changed (S28, S29). Specifically, in S28, the N-bit random number is divided into s × t × u × v, the variable used in the program is designated by the value s, and the operation designated by t is designated as the designated variable u and Then, a process for performing the inverse operation is added to the location specified by v (change in process procedure 1).
Next, in S29, the N-bit random number is divided into e × f × g × h × i, the variable used in the program is designated by the value e, and the operation designated by f is designated as the designated variable g and Is input h times, and then the process of performing the inverse operation is added to the location specified by i (Processing procedure change 2).

図3は、本発明の実施形態に係るプログラム難読化装置の動作を説明するために引用したフローチャートであり、本発明のプログラムの処理手順をも示している。
フローチャートの説明に先立ち、本発明の実施形態で用いられる安全性評価のための評価式について説明する。P値評価部4が実行する演算は、以下の数1で示される。
FIG. 3 is a flowchart cited for explaining the operation of the program obfuscation apparatus according to the embodiment of the present invention, and also shows the processing procedure of the program of the present invention.
Prior to the description of the flowchart, an evaluation formula for safety evaluation used in the embodiment of the present invention will be described. The calculation executed by the P-value evaluation unit 4 is expressed by the following formula 1.

Figure 0004675642
Figure 0004675642

ここで、Tは難読化後のプログラム全体の命令数、αは元コードと難読化後のコードにおいて同一である命令数である。また、命令単位以外にも、バイト単位でも同様の評価を行ってもよい。また、プログラムごとに最適な難読化方式は異なるため、Q値評価部5は、以下の数2を実行して評価し、複数用意された難読化アルゴリズムを決定しても良い。   Here, T is the number of instructions in the entire program after obfuscation, and α is the number of instructions that is the same in the original code and the code after obfuscation. In addition to the instruction unit, the same evaluation may be performed in byte units. Further, since the optimum obfuscation method is different for each program, the Q value evaluation unit 5 may perform evaluation by performing the following Equation 2 to determine a plurality of obfuscation algorithms prepared.

Figure 0004675642
Figure 0004675642

ここで、α’は、あるプログラムAを同一回数難読化処理を実行したプログラムA’,A’’において、同一である命令の個数である。すなわち、同じ難読化を何回も実行した場合に、どの程度P値が上昇するかを評価している。また、ここでも、命令単位以外に、バイト単位でも同様の評価を行っている。なお、Q値は、複数の難読化プログラム(A’’’,A’’’...)を利用して、その平均をとっても良い。   Here, α ′ is the number of instructions that are the same in programs A ′ and A ″ obtained by executing obfuscation processing for a certain program A the same number of times. That is, it is evaluated how much the P value increases when the same obfuscation is performed many times. Also here, the same evaluation is performed in units of bytes in addition to units of instructions. The Q value may be averaged by using a plurality of obfuscation programs (A ″ ″, A ″ ″...).

以下、図3に示すフローチャートを参照しながら図1の本発明の実施形態に係るプログラム難読化装置の動作について詳細に説明する。
ユーザは、まず、本発明のプログラム難読化装置に対し、図示せぬ入力装置を用いて難読化したいプログラム(被難読化プログラム)、および、達成したい安全性レベル(P値)及び、ファイルサイズなどの要求条件を入力する。
プログラム難読化装置は、データ入力取込み部2を介して被難読化プログラムと要求条件を取込み(S31)、中央制御部1によるコントロールの下、難読化処理部3へ供給する。難読化処理部3は、事前評価作業として、それぞれの難読化手法で難読化プログラムを複数作成し、Q値評価部5により得られるQ値を評価して最適な難読化アルゴリズムを求める(S32)。
Hereinafter, the operation of the program obfuscation apparatus according to the embodiment of the present invention shown in FIG. 1 will be described in detail with reference to the flowchart shown in FIG.
First, the user first obfuscates the program obfuscation apparatus of the present invention using an unillustrated input device (obfuscated program), the safety level (P value) to be achieved, the file size, etc. Enter the required conditions.
The program obfuscation apparatus fetches the obfuscated program and the required conditions via the data input fetch unit 2 (S31), and supplies them to the obfuscation processing unit 3 under the control of the central control unit 1. The obfuscation processing unit 3 creates a plurality of obfuscation programs using the respective obfuscation methods as a pre-evaluation operation, and evaluates the Q value obtained by the Q value evaluation unit 5 to obtain an optimal obfuscation algorithm (S32). .

具体的に、難読化処理部3は、最初、適当な難読化アルゴリズムを選択し、図2に示すフローチャートに従い図示せぬ演算装置を用いてその難読化アルゴリズムを実行する。ここで、Q値評価部5は、難読化前後のプログラムを用いてQ値を算出して安全性を達成しているか否かを評価する。ここでの評価式は上記した数2に従う。
続いて、難読化判定出力部6は、P値評価部4を介して上記した数1に従うP値を計算して安全性についての評価を行い(S34)、要求条件(P値)に従う安全性を達成していれば、続いてファイルサイズについて、これが適切であるか否かの要求条件の評価を行う(S35)。ここで、適切でなければ難読化処理部3による同じ難読化手法を用いた難読化処理(S32)、もしくは別の難読化手法に従う難読化処理(S33)へ戻る。
なお、S32の処理へ戻る場合は、難読化後のプログラムに対してQ値を評価することで、次に実行すべき難読化アルゴリズムを再決定する。
Specifically, the obfuscation processing unit 3 first selects an appropriate obfuscation algorithm and executes the obfuscation algorithm using an arithmetic device (not shown) according to the flowchart shown in FIG. Here, the Q value evaluation unit 5 calculates whether or not the safety is achieved by calculating the Q value using the programs before and after the obfuscation. The evaluation formula here follows the above-mentioned formula 2.
Subsequently, the obfuscation determination output unit 6 calculates the P value according to the above equation 1 via the P value evaluation unit 4 and evaluates the safety (S34), and the safety according to the requirement (P value). If it has been achieved, the requirement condition as to whether or not the file size is appropriate is subsequently evaluated (S35). Here, if not appropriate, the process returns to the obfuscation process (S32) using the same obfuscation technique by the obfuscation processing unit 3 or the obfuscation process (S33) according to another obfuscation technique.
When returning to the processing of S32, the obfuscation algorithm to be executed next is determined again by evaluating the Q value for the obfuscated program.

次に、S35において、ファイルサイズが適切であれば、難読化判定出力部6は、難読化されたプログラムを出力する。適切でなければS32もしくはS33の処理に戻る。S32の処理へ戻る場合は、難読化後のプログラムに対してQ値を評価することで、次に実行すべき難読化アルゴリズムを再決定する。   Next, in S35, if the file size is appropriate, the obfuscation determination output unit 6 outputs the obfuscated program. If not appropriate, the process returns to S32 or S33. When returning to the processing of S32, the obfuscation algorithm to be executed next is re-determined by evaluating the Q value for the obfuscated program.

以上、説明したように本発明は、プログラム難読化装置が、データ入力取込み部を介して難読化前のプログラムを取込み、難読化処理部3を起動してあらかじめ複数用意された難読化アルゴリズムの一つに従って難読化処理を実行し、難読化判定出力部6が、難読化処理を1回実行する毎に安全性評価を行い、ユーザが定義した安全性評価のための要求条件を達成していれば処理を終了し、達成していなければ再度難読化処理を実行して上記判定を繰り返し、最終的に最適な難読化プログラムを出力するものである。
また、ユーザが、ファイルサイズの上限を定義した場合には、その上限内で安全性の評価値が最大となるように難読化アルゴリズムを再帰的に実行する。そして、安全性を達成し、かつ、ファイルサイズが上限以下であれば上記同様処理を終了する。この場合の安全性評価は、難読化前のプログラムに対する命令単位での差分として評価される。このことにより、効率的に難読化のためのプログラムの改変が実現されるためプログラムの保護が可能であり、また、ファイルサイズが増加しても安全なシステム構築が可能になる。
As described above, according to the present invention, the program obfuscation apparatus fetches a program before obfuscation via the data input fetch unit, activates the obfuscation processing unit 3, and provides a plurality of obfuscation algorithms prepared in advance. The obfuscation process is executed according to the conditions, and the obfuscation determination output unit 6 performs the safety evaluation every time the obfuscation process is executed once, and the requirements for the safety evaluation defined by the user are achieved. If it has not been achieved, the obfuscation process is executed again, the above determination is repeated, and the optimum obfuscation program is finally output.
Further, when the user defines an upper limit of the file size, the obfuscation algorithm is recursively executed so that the safety evaluation value becomes the maximum within the upper limit. If the safety is achieved and the file size is less than or equal to the upper limit, the same process is terminated. The safety evaluation in this case is evaluated as a difference in units of instructions with respect to the program before obfuscation. As a result, the program can be protected for efficient obfuscation, so that the program can be protected, and a safe system can be constructed even if the file size increases.

なお、図1に示す中央制御部1と、データ入力取込み部2と、難読化処理部3と、P値評価部4と、Q値評価部5と、難読化判定出力部6のそれぞれで実行される手順をコンピュータ読み取り可能な記録媒体に記録し、この記録媒体に記録されたプログラムをコンピュータシステムに読み込ませ、実行することによって本発明のプログラム難読化装置を実現することができる。ここでいうコンピュータシステムとは、OSや周辺装置等のハードウェアを含む。   1 is executed by each of the central control unit 1, the data input capturing unit 2, the obfuscation processing unit 3, the P value evaluation unit 4, the Q value evaluation unit 5, and the obfuscation determination output unit 6 shown in FIG. The program obfuscation apparatus of the present invention can be realized by recording the procedure to be recorded on a computer-readable recording medium, causing the computer system to read and execute the program recorded on the recording medium. The computer system here includes an OS and hardware such as peripheral devices.

また、「コンピュータシステム」は、WWWシステムを利用している場合であれば、ホームページ提供環境(あるいは表示環境)も含むものとする。
また、上記プログラムは、このプログラムを記憶装置等に格納したコンピュータシステムから、伝送媒体を介して、あるいは、伝送媒体中の伝送波により他のコンピュータシステムに伝送されてもよい。ここで、プログラムを伝送する「伝送媒体」は、インターネット等のネットワーク(通信網)や電話回線等の通信回線(通信線)のように情報を伝送する機能を有する媒体のことをいう。
また、上記プログラムは、前述した機能の一部を実現するためのものであっても良い。さらに、前述した機能をコンピュータシステムにすでに記録されているプログラムとの組合せで実現できるもの、いわゆる差分ファイル(差分プログラム)であっても良い。
Further, the “computer system” includes a homepage providing environment (or display environment) if a WWW system is used.
The program may be transmitted from a computer system storing the program in a storage device or the like to another computer system via a transmission medium or by a transmission wave in the transmission medium. Here, the “transmission medium” for transmitting the program refers to a medium having a function of transmitting information, such as a network (communication network) such as the Internet or a communication line (communication line) such as a telephone line.
The program may be for realizing a part of the functions described above. Furthermore, what can implement | achieve the function mentioned above in combination with the program already recorded on the computer system, and what is called a difference file (difference program) may be sufficient.

以上、この発明の実施形態につき、図面を参照して詳述してきたが、具体的な構成はこの実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の設計等も含まれる。   The embodiments of the present invention have been described in detail with reference to the drawings. However, the specific configuration is not limited to the embodiments, and includes designs and the like that do not depart from the gist of the present invention.

本発明実施形態にかかわるプログラム難読化装置を機能展開して示したブロック図である。It is the block diagram which expanded and showed the program obfuscation apparatus concerning embodiment of this invention. 本発明実施形態において用いられる難読化手法(難読化アルゴリズム)の一例をフローチャートで示した図である。It is the figure which showed in a flowchart the example of the obfuscation technique (obfuscation algorithm) used in embodiment of this invention. 本発明実施形態にかかわるプログラム難読化装置の動作を説明するために引用したフローチャートである。It is the flowchart quoted in order to demonstrate operation | movement of the program obfuscation apparatus concerning embodiment of this invention.

符号の説明Explanation of symbols

1…中央制御部、2…データ入力取込み部、3…難読化処理部、4…P値評価部、5…Q値評価部、6…難読化判定出力部

DESCRIPTION OF SYMBOLS 1 ... Central control part, 2 ... Data input taking-in part, 3 ... Obfuscation processing part, 4 ... P value evaluation part, 5 ... Q value evaluation part, 6 ... Obfuscation determination output part

Claims (6)

難読化前のプログラムとユーザによって定義される安全性評価のための要求条件を、入力装置を介して取り込むデータ入力取込み部と、
演算装置を用い、前記取り込まれた難読化前のプログラムに関し、あらかじめ用意された複数の難読化手法のそれぞれを実行して難読化された複数のプログラムを生成出力する難読化処理部と、
前記難読化手法のそれぞれを実行する毎、前記難読化後のプログラムと前記取り込まれた難読化前のプログラムとの命令単位での差分を評価し、前記要求条件を満たしたときに前記難読化処理部による難読化処理の実行を終了させ、前記難読化後のプログラムを出力する難読化判定出力部と、
を具備し、
前記難読化判定出力部は、
前記難読化前後のプログラムを構成する命令のうち、同一である命令数を前記難読化後のプログラムにおける全体の命令数で除算した値を整数1から減算して得られる値に基づき前記差分の評価を行うことを特徴とするプログラム難読化装置。
A data input capturing unit that captures, via an input device, a pre-obfuscation program and a user-defined safety evaluation requirement;
Using an arithmetic device, an obfuscation processing unit that generates and outputs a plurality of obfuscated programs by executing each of a plurality of obfuscation techniques prepared in advance with respect to the captured program before obfuscation,
Each time the obfuscation method is executed, the difference in the instruction unit between the obfuscated program and the captured pre-obfuscated program is evaluated, and the obfuscation processing is performed when the required condition is satisfied. An obfuscation determination output unit that ends the obfuscation process by the unit and outputs the obfuscated program;
Was immediately Bei,
The obfuscation determination output unit
Of the instructions constituting the program before and after obfuscation, the difference is evaluated based on a value obtained by subtracting from the integer 1 a value obtained by dividing the same number of instructions by the total number of instructions in the obfuscated program. program obfuscation apparatus and performs.
前記難読化処理部は、
同じ難読化手法を数回実行して前記難読化判定出力部により生成される前記値の上昇の程度を評価し、前記複数の難読化手法のうち最適な難読化手法を選択して前記難読化処理を実行することを特徴とする請求項に記載のプログラム難読化装置。
The obfuscation processing unit
The same obfuscation catheter method executed several times to assess the degree of increase of the value generated by the obfuscation decision output unit, the select the best obfuscation of the plurality of obfuscation techniques obfuscate The program obfuscation apparatus according to claim 1 , wherein the program obfuscation process is executed.
(旧請求項4)
前記難読化判定出力部は、
前記データ入力取込み部を介して更に取り込まれるファイルサイズに従ってその上限値との比較を行い、該ファイルサイズが該上限値以下である場合には、前記難読化処理を終了させることを特徴とする請求項1又は請求項2に記載のプログラム難読化装置。
(Old claim 4)
The obfuscation determination output unit
A comparison with the upper limit value is performed in accordance with a file size further fetched via the data input fetch unit, and the obfuscation process is terminated if the file size is equal to or smaller than the upper limit value. The program obfuscation apparatus according to claim 1 or 2 .
プログラムを第三者が理解しにくいように改変する、入出力装置と演算装置を備えたプログラム難読化装置に用いられるプログラム難読化方法であって、
難読化前のプログラムとユーザによって定義される安全性評価のための要求条件とを、前記入力装置を介して取り込むデータ入力取込みステップと、
前記演算装置を用い、前記取り込まれた難読化前のプログラムに関し、あらかじめ用意された複数の難読化手法のそれぞれを実行し、難読化された複数のプログラムを生成出力する難読化ステップと、
前記難読化手法のそれぞれを実行する毎、前記難読化後のプログラムと前記取り込まれた難読化前のプログラムとの命令単位での差分を評価し、前記要求条件を満たしたときに前記難読化ステップによる難読化処理を終了させ、前記難読化後のプログラムを出力する難読化判定出力ステップと、
を有し、
前記難読化判定出力ステップは、
前記難読化前後のプログラムを構成する命令のうち、同一である命令数を前記難読化後のプログラムにおける全体の命令数で除算した値を整数1から減算して得られる値に基づき前記差分の評価を行うことを特徴とするプログラム難読化方法。
A program obfuscation method used in a program obfuscation device including an input / output device and an arithmetic device, which modifies a program so that it is difficult for a third party to understand.
A data input capturing step for capturing a program before obfuscation and a requirement for safety evaluation defined by a user via the input device;
Using the computing device, a said captured before obfuscation program, and obfuscation step of running each of the plurality of obfuscated catheter technique prepared in advance, it generates and outputs a plurality of programs obfuscated,
Wherein each execution of the respective obfuscation catheter method, before Symbol obfuscated when evaluated differences in instruction units of said captured obfuscated program before the program after the obfuscation, satisfying the requirements reduction to terminate the flame読化processing in step, and obfuscation determination output step of outputting the program after the obfuscation,
I have a,
The obfuscation determination output step includes:
Of the instructions constituting the program before and after obfuscation, the difference is evaluated based on a value obtained by subtracting from the integer 1 a value obtained by dividing the same number of instructions by the total number of instructions in the obfuscated program. A program obfuscation method characterized by:
前記難読化ステップは、  The obfuscation step comprises:
同じ難読化手法を数回実行して前記難読化判定出力ステップにより生成される前記値の上昇の程度を評価し、前記複数の難読化手法のうち最適な難読化手法を選択して前記難読化処理を実行することを特徴とする請求項4に記載のプログラム難読化方法。  The same obfuscation technique is executed several times to evaluate the degree of increase in the value generated by the obfuscation determination output step, and the most obfuscation technique is selected from the plurality of obfuscation techniques. The program obfuscation method according to claim 4, wherein processing is executed.
プログラムを第三者が理解しにくいように改変するプログラム難読化装置のコンピュータに、
難読化前のプログラムとユーザによって定義される安全性評価のための要求条件とを取り込むデータ入力取込み処理と、
前記取り込まれた難読化前のプログラムに関し、あらかじめ用意された複数の難読化手法のそれぞれを実行し、難読化された複数のプログラムを生成出力する難読化処理と、
前記難読化手法のそれぞれを実行する毎、前記難読化後のプログラムと前記取り込まれた難読化前のプログラムとの命令単位での差分を評価し、前記要求条件を満たしたときに前記難読化処理を終了させ、前記難読化後のプログラムを出力する難読化判定出力処理と、
を実行させるプログラムであって、
前記難読化判定出力処理は、
前記難読化前後のプログラムを構成する命令のうち、同一である命令数を前記難読化後のプログラムにおける全体の命令数で除算した値を整数1から減算して得られる値に基づき前記差分の評価を行うことを特徴とするプログラム。
To the computer of the program obfuscation device that modifies the program so that it is difficult for a third party to understand ,
A data input capture process that captures the program before obfuscation and the requirements for safety assessment defined by the user;
Relates the captured before obfuscation program, running each of the plurality of obfuscated catheter technique prepared in advance, and obfuscation process for generating and outputting a plurality of programs obfuscated,
Each execution of each of the obfuscation catheter method, the obfuscation when evaluated differences in instruction units of a program and the captured before obfuscation program after the obfuscation, satisfying the requirements An obfuscation determination output process for terminating the process and outputting the obfuscated program;
The a program to be executed,
The obfuscation determination output process includes:
Of the instructions constituting the program before and after obfuscation, the difference is evaluated based on a value obtained by subtracting from the integer 1 a value obtained by dividing the same number of instructions by the total number of instructions in the obfuscated program. The program characterized by performing.
JP2005045259A 2005-02-22 2005-02-22 Program obfuscation apparatus, method and program Expired - Fee Related JP4675642B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005045259A JP4675642B2 (en) 2005-02-22 2005-02-22 Program obfuscation apparatus, method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005045259A JP4675642B2 (en) 2005-02-22 2005-02-22 Program obfuscation apparatus, method and program

Publications (2)

Publication Number Publication Date
JP2006235688A JP2006235688A (en) 2006-09-07
JP4675642B2 true JP4675642B2 (en) 2011-04-27

Family

ID=37043306

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005045259A Expired - Fee Related JP4675642B2 (en) 2005-02-22 2005-02-22 Program obfuscation apparatus, method and program

Country Status (1)

Country Link
JP (1) JP4675642B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4917861B2 (en) * 2006-10-17 2012-04-18 Kddi株式会社 Program analysis method and program
JP5133973B2 (en) * 2007-01-18 2013-01-30 パナソニック株式会社 Obfuscation support device, obfuscation support method, program, and integrated circuit
JP5277825B2 (en) * 2008-09-18 2013-08-28 富士ゼロックス株式会社 Program obfuscation device and obfuscation program
JP5378055B2 (en) * 2009-04-30 2013-12-25 Kddi株式会社 Program obfuscation apparatus, program obfuscation method, and program

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002514333A (en) * 1997-06-09 2002-05-14 インタートラスト テクノロジーズ コーポレイション Confusing technology to enhance software security
JP2002236522A (en) * 2000-12-05 2002-08-23 Kenta Hori Method for preventing illegal use of software, program, and storage medium
JP2003337629A (en) * 2002-05-18 2003-11-28 Mitsuko Miyaji Program obfuscation method and device
JP2004348710A (en) * 2003-05-20 2004-12-09 Samsung Electronics Co Ltd Tamper-resisting technique of program using unique number, upgrading method of obfuscated program, and system for these methods
JP2005266887A (en) * 2004-03-16 2005-09-29 Kddi Corp Program encryption apparatus, program distribution system and computer program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002514333A (en) * 1997-06-09 2002-05-14 インタートラスト テクノロジーズ コーポレイション Confusing technology to enhance software security
JP2002236522A (en) * 2000-12-05 2002-08-23 Kenta Hori Method for preventing illegal use of software, program, and storage medium
JP2003337629A (en) * 2002-05-18 2003-11-28 Mitsuko Miyaji Program obfuscation method and device
JP2004348710A (en) * 2003-05-20 2004-12-09 Samsung Electronics Co Ltd Tamper-resisting technique of program using unique number, upgrading method of obfuscated program, and system for these methods
JP2005266887A (en) * 2004-03-16 2005-09-29 Kddi Corp Program encryption apparatus, program distribution system and computer program

Also Published As

Publication number Publication date
JP2006235688A (en) 2006-09-07

Similar Documents

Publication Publication Date Title
JP6257754B2 (en) Data protection
US9215219B1 (en) Method for protecting data used in cloud computing with homomorphic encryption
US20170116410A1 (en) Software protection
JP5861018B1 (en) Computing device configured by table network
CN110210211B (en) Data protection method and computing equipment
JP2021515314A (en) Compilation device and method
US10867017B2 (en) Apparatus and method of providing security and apparatus and method of executing security for common intermediate language
JP2021507310A (en) White box calculation of keyed message authentication code
JP4675642B2 (en) Program obfuscation apparatus, method and program
CN112231740B (en) Data encryption method, data decryption method, data encryption device, computer device, and medium
JP5992651B2 (en) ENCRYPTION METHOD, PROGRAM, AND SYSTEM
JP4667800B2 (en) Encoding method and program thereof
CN109343971B (en) Browser data transmission method and device based on cache technology
JP3970856B2 (en) Program obfuscation device, program distribution system, computer program
KR101440680B1 (en) Homomorphic Encryption and Decryption Method using Chinese Remainder Theorem and apparatus using the same
JP2007183931A (en) Secure device, information processing terminal, server, and authentication method
CN109657480A (en) A kind of document handling method, equipment and computer readable storage medium
JP5149061B2 (en) Program obfuscation apparatus, program obfuscation method, and program
CN113282892A (en) Code obfuscation method, apparatus, computer device and storage medium
CN113347270A (en) Method and device for preventing horizontal unauthorized network transmission file
KR101219191B1 (en) Apparatus for protecting key information in volatile memory and method thereof
CN113965366B (en) Method, system and computer equipment for defending reverse proxy phishing attack
Mood et al. PAL: A pseudo assembly language for optimizing secure function evaluation in mobile devices
JP6212377B2 (en) Arithmetic device, arithmetic method and computer program
CN113886892B (en) Application program data acquisition method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070905

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20071012

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20071012

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20101108

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20101116

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20101220

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20101221

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

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110126

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

Free format text: PAYMENT UNTIL: 20140204

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees