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

Program obfuscation apparatus, program obfuscation method, and program Download PDF

Info

Publication number
JP5149061B2
JP5149061B2 JP2008114872A JP2008114872A JP5149061B2 JP 5149061 B2 JP5149061 B2 JP 5149061B2 JP 2008114872 A JP2008114872 A JP 2008114872A JP 2008114872 A JP2008114872 A JP 2008114872A JP 5149061 B2 JP5149061 B2 JP 5149061B2
Authority
JP
Japan
Prior art keywords
program
variables
encoding
calculated
instruction
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.)
Active
Application number
JP2008114872A
Other languages
Japanese (ja)
Other versions
JP2009265949A (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 JP2008114872A priority Critical patent/JP5149061B2/en
Publication of JP2009265949A publication Critical patent/JP2009265949A/en
Application granted granted Critical
Publication of JP5149061B2 publication Critical patent/JP5149061B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、乱数を用いた変数の符号化によるプログラム難読化装置、プログラム難読化方法およびプログラムに関する。   The present invention relates to a program obfuscation apparatus, a program obfuscation method, and a program by encoding variables using random numbers.

ソフトウェアには、価値のあるアルゴリズムおよびコンテンツの暗号鍵など、利用者に対して秘密にすべき情報が含まれる場合がある。一方では、ソフトウェアを解析するための技術(RE:Reverse Engineering)が数多く開発されている。このため、これらの技術によりソフトウェアが解析されると、不正者が秘密情報を入手するという脅威が考えられる。この脅威に対し、ソフトウェアの仕様を保ったまま、ソフトウェアの解析を困難にする難読化という技術がある。   Software may contain information that should be kept secret to the user, such as valuable algorithms and content encryption keys. On the other hand, many techniques (RE: Reverse Engineering) for analyzing software have been developed. For this reason, when software is analyzed by these techniques, there is a threat that an unauthorized person obtains confidential information. For this threat, there is a technique called obfuscation that makes it difficult to analyze software while keeping the software specifications.

上記の難読化の技術としては、プログラム中の変数を演算装置によって線形変換して符号化を施す符号化方法、すなわち、符号化を施すn個(但し、nは正整数)の変数を任意に選択し、m×nの行列(但し、mは、m≧nの正整数)およびm次元の任意のベクトルを生成し、生成した行列およびベクトルを変換鍵としてn個の変数を線形変換して同時にm個の整数に符号化する方法が開示されている(例えば、特許文献1参照。)。   As the obfuscation technique, an encoding method in which variables in a program are linearly converted by an arithmetic unit and encoded, that is, n variables (where n is a positive integer) to be encoded arbitrarily Select an m × n matrix (where m is a positive integer of m ≧ n) and an arbitrary vector of m dimensions, and linearly transform n variables using the generated matrix and vector as a conversion key. A method of encoding m integers at the same time is disclosed (for example, see Patent Document 1).

プログラムから符号化の対象となる変数をn個(nは2以上の正の整数)選択し、選択したn個の変数と任意の定数との排他的論理和からなる符号化関数により、n個の独立した符号化関数を含むm個(mは正の整数であり、m≧n)の符号化式を定義する。n個の独立な符号化関数からなる符号化式をn個の変数について演算し、n個の変数に対応した符号化されたn個の変数を求め、この符号化されたn個の変数を用いて、符号化前のn個の変数を表し、次いで、符号化された変数に初期値を与え、連続する代入命令のマージを実行する方法が開示されている(例えば、特許文献2参照。)。
特開2006−079347号公報 特開2007−079916号公報
Select n variables (n is a positive integer of 2 or more) to be encoded from the program, and use the encoding function consisting of exclusive OR of the selected n variables and an arbitrary constant. Define m (m is a positive integer, m ≧ n) encoding expressions including the following independent encoding functions. An encoding expression composed of n independent encoding functions is calculated for n variables, n encoded variables corresponding to the n variables are obtained, and the n encoded variables are calculated. A method is disclosed in which n variables before encoding are used, initial values are given to the encoded variables, and merging of consecutive assignment instructions is executed (see, for example, Patent Document 2). ).
JP 2006-079347 A JP 2007-079916 A

しかしながら、上記の方式では、プログラムに含まれる変数を符号化することにより、データ・ロジックの双方の解析を難しくできるが、同一の入力に対し、符号化された変数の値は同一となるため、十分な安全性を実現できないという問題がある。   However, in the above method, it is possible to make analysis of both data and logic difficult by encoding variables included in the program, but because the values of the encoded variables are the same for the same input, There is a problem that sufficient safety cannot be realized.

そこで、本発明は、上述の課題に鑑みてなされたものであり、十分な安全性を実現するプログラム難読化装置、プログラム難読化方法およびプログラムを提供することを目的とする。   Therefore, the present invention has been made in view of the above-described problems, and an object thereof is to provide a program obfuscation apparatus, a program obfuscation method, and a program that realize sufficient safety.

本発明は、上述の課題を解決するために、以下の事項を提案している。   The present invention proposes the following items in order to solve the above-described problems.

)本発明は、符号化の対象となるn個(n;正の整数)の変数x_1、x_2、・・・、x_nを選択する第1の選択手段と、符号化後の変数の個数m(m;m≧nの正の整数)を選択する第2の選択手段と、m行n列のブール行列Aおよびm次元の行列b=[b_1、b_2、・・・、b_m]^T(T;ベクトルの転置)を任意に生成する行列生成手段と、所定の演算式を演算して、各行を取り出して、符号化式y_j=f_j(x_1、x_2、・・・、x_n)を算出する第1の算出手段と、該算出した符号化式をx_nの連立方程式として、復号式x_i=g_i(y_1、y_2、・・・、y_m)を算出する第2の算出手段と、プログラムにおいて、代入命令を、第1の算出手段で算出した符号化式で置換する第1の置換手段と、プログラムにおいて、右辺にある変数を、第2の算出手段で算出した各復号式で置換する第2の置換手段と、プログラムにおいて、変数x_1、x_2、・・・、x_nの宣言を削除する削除手段と、プログラムにおいて、符号化された変数y_1、y_2、・・・、y_mおよび乱数を格納する変数r_1、r_2、・・・、r_nの宣言を追加する宣言追加手段と、プログラムにおいて、各変数に乱数を設定するための命令を追加する命令追加手段と、を備えたことを特徴とするプログラム難読化装置を提案している。
( 1 ) The present invention relates to a first selection means for selecting n (n: positive integer) variables x_1, x_2,..., X_n to be encoded, and the number of variables after encoding. a second selecting means for selecting m (m; a positive integer of m ≧ n), a Boolean matrix A of m rows and n columns, and an m-dimensional matrix b = [b_1, b_2,..., b_m] ^ T (T: matrix transposing means for arbitrarily generating (T; vector transposition) and a predetermined arithmetic expression, and each row is extracted to calculate an encoding expression y_j = f_j (x_1, x_2,..., X_n) In the program, a first calculating unit that calculates the decoding equation x_i = g_i (y_1, y_2,..., Y_m) using the calculated encoding equation as a simultaneous equation of x_n, A first replacement that replaces the assignment instruction with each encoding expression calculated by the first calculation means Deletes the declaration of the variables x_1, x_2,..., X_n in the program, the second replacement means for replacing the variable on the right side in the program with each decryption formula calculated by the second calculation means, and the program. In the program, declaration adding means for adding declarations of the encoded variables y_1, y_2,..., Y_m and variables r_1, r_2,. There has been proposed a program obfuscation device comprising an instruction adding means for adding an instruction for setting a random number to each variable.

この発明によれば、第1の選択手段は、符号化の対象となるn個(n;正の整数)の変数x_1、x_2、・・・、x_nを選択する。第2の選択手段は、符号化後の変数の個数m(m;m≧nの正の整数)を選択する。行列生成手段は、m行n列のブール行列Aおよびm次元の行列b=[b_1、b_2、・・・、b_m]^T(T;ベクトルの転置)を任意に生成する。第1の算出手段は、所定の演算式を演算して、各行を取り出して、符号化式y_j=f_j(x_1、x_2、・・・、x_n)を算出する。第2の算出手段は、算出した符号化式をx_nの連立方程式として、復号式x_i=g_i(y_1、y_2、・・・、y_m)を算出する。第1の置換手段は、プログラムにおいて、代入命令を、第1の算出手段で算出した符号化式で置換する。第2の置換手段は、プログラムにおいて、右辺にある変数を、第2の算出手段で算出した各復号式で置換する。削除手段は、プログラムにおいて、変数x_1、x_2、・・・、x_nの宣言を削除する。宣言追加手段は、プログラムにおいて、符号化された変数y_1、y_2、・・・、y_mおよび乱数を格納する変数r_1、r_2、・・・、r_nの宣言を追加する。命令追加手段は、プログラムにおいて、各変数に乱数を設定するための命令を追加する。したがって、変数の値そのものにマスクを施すため、機密性が高いデータを処理するプログラムの保護をさらに高めることができる。
According to the present invention, the first selection means selects n (n: positive integer) variables x_1, x_2,..., X_n to be encoded. The second selection means selects the number m of variables after encoding (m; a positive integer such that m ≧ n). The matrix generation means arbitrarily generates a Boolean matrix A of m rows and n columns and an m-dimensional matrix b = [b_1, b_2,..., B_m] ^ T (T; vector transposition). The first calculation means calculates a predetermined arithmetic expression, extracts each row, and calculates an encoding expression y_j = f_j (x_1, x_2,..., X_n). The second calculating means calculates a decoding expression x_i = g_i (y_1, y_2,..., Y_m) using the calculated encoding expression as simultaneous equations of x_n. The first replacement means replaces the substitution instruction in the program with each encoding expression calculated by the first calculation means. The second replacement means replaces the variable on the right side in the program with each decoding formula calculated by the second calculation means. The deleting means deletes declarations of variables x_1, x_2,..., X_n in the program. The declaration adding means adds declarations of the encoded variables y_1, y_2,..., Y_m and variables r_1, r_2,. The instruction adding means adds an instruction for setting a random number to each variable in the program. Therefore, since the variable value itself is masked, it is possible to further enhance protection of a program that processes highly confidential data.

)本発明は、第1の選択手段、第2の選択手段、行列生成手段、第1の算出手段、第2の算出手段、第1の置換手段、第2の置換手段、削除手段、宣言追加手段、および命令追加手段を備えるプログラム難読化装置におけるプログラムの難読化方法であって、前記第1の選択手段が、符号化の対象となるn個(n;正の整数)の変数x_1、x_2、・・・、x_nを選択する第1のステップと、前記第2の選択手段が、符号化後の変数の個数m(m;m≧nの正の整数)を選択する第2のステップと、前記行列生成手段が、m行n列のブール行列Aおよびm次元の行列b=[b_1、b_2、・・・、b_m]^T(T;ベクトルの転置)を任意に生成する第3のステップと、前記第1の算出手段が、所定の演算式を演算して、各行を取り出して、符号化式y_j=f_j(x_1、x_2、・・・、x_n)を算出する第4のステップと、前記第2の算出手段が、該算出した符号化式をx_nの連立方程式として、復号式x_i=g_i(y_1、y_2、・・・、y_m)を算出する第5のステップと、前記第1の置換手段が、プログラムにおいて、代入命令を、算出した符号化式で置換する第6のステップと、前記第2の置換手段が、プログラムにおいて、右辺にある変数を、算出した各復号式で置換する第7のステップと、前記削除手段が、プログラムにおいて、変数x_1、x_2、・・・、x_nの宣言を削除する第8のステップと、前記宣言追加手段が、プログラムにおいて、符号化された変数y_1、y_2、・・・、y_mおよび乱数を格納する変数r_1、r_2、・・・、r_nの宣言を追加する第9のステップと、前記命令追加手段が、プログラムにおいて、各変数に乱数を設定するための命令を追加する第10のステップと、を備えたことを特徴とするプログラムの難読化方法を提案している。
( 2 ) The present invention provides a first selection unit, a second selection unit, a matrix generation unit, a first calculation unit, a second calculation unit, a first substitution unit, a second substitution unit, a deletion unit, A program obfuscation method in a program obfuscation apparatus comprising a declaration adding unit and an instruction adding unit, wherein the first selection unit includes n (n: positive integer) variables x_1 to be encoded. , X_2,..., X_n, and the second selecting means selects the number m of variables after encoding (m; a positive integer satisfying m ≧ n). And a matrix generation means for arbitrarily generating an m-by-n Boolean matrix A and an m-dimensional matrix b = [b_1, b_2,..., B_m] ^ T (T; vector transposition). 3 and steps of the first calculating means, calculates a predetermined arithmetic expression, each row Ri out, coding type y_j = f_j (x_1, x_2, ···, x_n) a fourth step of calculating the said second calculating means, the coding type of the calculated as simultaneous equations x_n The fifth step of calculating the decoding formula x_i = g_i (y_1, y_2,..., Y_m) and the first replacement means replace the substitution instruction in the program with each of the calculated encoding formulas. A sixth step, a seventh step in which the second replacement means replaces a variable on the right side in the program with each of the calculated decoding equations , and a deletion means in the program uses variables x_1, x_2, ..., the eighth step of deleting the declaration of x_n, and the declaration adding means, in the program, the encoded variable y_1, y_2, ..., y_m and the variable r_ that stores the random number Comprising 1, r_2, · · ·, a ninth step of adding a declaration of r_n, the instruction adding means, in the program, a tenth step of adding an instruction to set a random number to each variable, the We propose a program obfuscation method characterized by this.

この発明によれば、符号化の対象となるn個(n;正の整数)の変数x_1、x_2、・・・、x_nを選択し、符号化後の変数の個数m(m;m≧nの正の整数)を選択する。次に、m行n列のブール行列Aおよびm次元の行列b=[b_1、b_2、・・・、b_m]^T(T;ベクトルの転置)を任意に生成し、所定の演算式を演算して、各行を取り出して、符号化式y_j=f_j(x_1、x_2、・・・、x_n)を算出する。さらに、算出した符号化式をx_nの連立方程式として、復号式x_i=g_i(y_1、y_2、・・・、y_m)を算出し、プログラムにおいて、代入命令を、符号化式で置換するとともに、右辺にある変数を、各復号式で置換する。そして、プログラムにおいて、変数x_1、x_2、・・・、x_nの宣言を削除し、符号化された変数y_1、y_2、・・・、y_mおよび乱数を格納する変数r_1、r_2、・・・、r_nの宣言を追加し、プログラムにおいて、各変数に乱数を設定するための命令を追加する。したがって、変数の値そのものにマスクを施すため、機密性が高いデータを処理するプログラムの保護をさらに高めることができる。
According to the present invention, n (n: positive integer) variables x_1, x_2,..., X_n to be encoded are selected, and the number m (m; m ≧ n) of variables after encoding is selected. Positive integer). Next, an m-by-n Boolean matrix A and an m-dimensional matrix b = [b_1, b_2,..., B_m] ^ T (T: vector transposition) are arbitrarily generated, and a predetermined arithmetic expression is calculated. Then, each row is taken out and the encoding formula y_j = f_j (x_1, x_2,..., X_n) is calculated. Further, the decoding equation x_i = g_i (y_1, y_2,..., Y_m) is calculated by using the calculated encoding equation as a simultaneous equation of x_n, and the substitution instruction is replaced with each encoding equation in the program. The variable on the right side is replaced with each decryption expression . Then, in the program, the declarations of the variables x_1, x_2, ..., x_n are deleted, and the variables r_1, r_2, ..., r_n for storing the encoded variables y_1, y_2, ..., y_m and random numbers are stored. And add a command to set a random number to each variable in the program. Therefore, since the variable value itself is masked, it is possible to further enhance protection of a program that processes highly confidential data.

)本発明は、符号化の対象となるn個(n;正の整数)の変数x_1、x_2、・・・、x_nを選択する第1のステップと、符号化後の変数の個数m(m;m≧nの正の整数)を選択する第2のステップと、m行n列のブール行列Aおよびm次元の行列b=[b_1、b_2、・・・、b_m]^T(T;ベクトルの転置)を任意に生成する第3のステップと、所定の演算式を演算して、各行を取り出して、符号化式y_j=f_j(x_1、x_2、・・・、x_n)を算出する第4のステップと、該算出した符号化式をx_nの連立方程式として、復号式x_i=g_i(y_1、y_2、・・・、y_m)を算出する第5のステップと、プログラムにおいて、代入命令を、算出した符号化式で置換する第6のステップと、プログラムにおいて、右辺にある変数を、算出した各復号式で置換する第7のステップと、プログラムにおいて、変数x_1、x_2、・・・、x_nの宣言を削除する第8のステップと、プログラムにおいて、符号化された変数y_1、y_2、・・・、y_mおよび乱数を格納する変数r_1、r_2、・・・、r_nの宣言を追加する第9のステップと、プログラムにおいて、各変数に乱数を設定するための命令を追加する第10のステップと、をコンピュータに実行させるためのプログラムを提案している。
( 3 ) The present invention includes a first step of selecting n (n: positive integer) variables x_1, x_2,..., X_n to be encoded, and the number m of variables after encoding. A second step of selecting (m; a positive integer of m ≧ n), an m-by-n Boolean matrix A and an m-dimensional matrix b = [b_1, b_2,..., B_m] ^ T (T A third step for arbitrarily generating a vector transposition) and a predetermined arithmetic expression to calculate each row and calculate an encoding expression y_j = f_j (x_1, x_2,..., X_n) A fourth step, a fifth step of calculating a decoding equation x_i = g_i (y_1, y_2,..., Y_m) using the calculated encoding equation as a simultaneous equation of x_n, and an assignment instruction in the program A sixth step of replacing with each calculated encoding expression, and a program In the program, the seventh step of replacing the variable on the right side with the calculated decryption formulas , the eighth step of deleting the declaration of the variables x_1, x_2, ..., x_n in the program, 9th step of adding declarations of encoded variables y_1, y_2,..., Y_m and variables r_1, r_2,..., R_n for storing random numbers, and setting a random number for each variable in the program A program for causing a computer to execute a tenth step of adding an instruction for a computer is proposed.

この発明によれば、符号化の対象となるn個(n;正の整数)の変数x_1、x_2、・・・、x_nを選択し、符号化後の変数の個数m(m;m≧nの正の整数)を選択する。次に、m行n列のブール行列Aおよびm次元の行列b=[b_1、b_2、・・・、b_m]^T(T;ベクトルの転置)を任意に生成し、所定の演算式を演算して、各行を取り出して、符号化式y_j=f_j(x_1、x_2、・・・、x_n)を算出する。さらに、算出した符号化式をx_nの連立方程式として、復号式x_i=g_i(y_1、y_2、・・・、y_m)を算出し、プログラムにおいて、代入命令を、符号化式で置換するとともに、右辺にある変数を、各復号式で置換する。そして、プログラムにおいて、変数x_1、x_2、・・・、x_nの宣言を削除し、符号化された変数y_1、y_2、・・・、y_mおよび乱数を格納する変数r_1、r_2、・・・、r_nの宣言を追加し、プログラムにおいて、各変数に乱数を設定するための命令を追加する。したがって、変数の値そのものにマスクを施すため、機密性が高いデータを処理するプログラムの保護をさらに高めることができる。
According to the present invention, n (n: positive integer) variables x_1, x_2,..., X_n to be encoded are selected, and the number m (m; m ≧ n) of variables after encoding is selected. Positive integer). Next, an m-by-n Boolean matrix A and an m-dimensional matrix b = [b_1, b_2,..., B_m] ^ T (T: vector transposition) are arbitrarily generated, and a predetermined arithmetic expression is calculated. Then, each row is taken out and the encoding formula y_j = f_j (x_1, x_2,..., X_n) is calculated. Further, the decoding equation x_i = g_i (y_1, y_2,..., Y_m) is calculated by using the calculated encoding equation as a simultaneous equation of x_n, and the substitution instruction is replaced with each encoding equation in the program. The variable on the right side is replaced with each decryption expression . Then, in the program, the declarations of the variables x_1, x_2, ..., x_n are deleted, and the variables r_1, r_2, ..., r_n for storing the encoded variables y_1, y_2, ..., y_m and random numbers are stored. And add a command to set a random number to each variable in the program. Therefore, since the variable value itself is masked, it is possible to further enhance protection of a program that processes highly confidential data.

本発明によれば、プログラムに含まれる変数にマスクを行う制御変数を導入し、その変数を符号化の対象とするため、機密性が高いデータを処理するプログラムの保護に適しているという効果がある。   According to the present invention, since a control variable for masking a variable included in a program is introduced and the variable is a target of encoding, the effect of being suitable for protection of a program that processes highly confidential data is obtained. is there.

以下、本発明の実施形態について、図面を用いて、詳細に説明する。
なお、本実施形態における構成要素は適宜、既存の構成要素等との置き換えが可能であり、また、他の既存の構成要素との組合せを含む様々なバリエーションが可能である。したがって、本実施形態の記載をもって、特許請求の範囲に記載された発明の内容を限定するものではない。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
Note that the constituent elements in the present embodiment can be appropriately replaced with existing constituent elements and the like, and various variations including combinations with other existing constituent elements are possible. Therefore, the description of the present embodiment does not limit the contents of the invention described in the claims.

以下、図1および図2を用いて、本発明の実施形態について説明する。   Hereinafter, embodiments of the present invention will be described with reference to FIGS. 1 and 2.

<プログラム難読化装置の構成>
図1を用いて、プログラム難読化装置の構成について説明する。
図1に示すように、本実施形態に係るプログラム難読化装置は、選択部1と、行列生成部2と、算出部3と、置換部4と、宣言削除部5と、宣言追加部6と、命令追加部7と、制御部8とから構成されている。
<Configuration of program obfuscation device>
The configuration of the program obfuscation device will be described with reference to FIG.
As shown in FIG. 1, the program obfuscation apparatus according to the present embodiment includes a selection unit 1, a matrix generation unit 2, a calculation unit 3, a replacement unit 4, a declaration deletion unit 5, and a declaration addition unit 6. The command adding unit 7 and the control unit 8 are included.

選択部1は、符号化の対象となるn個(n;正の整数)の変数x_1、x_2、・・・、x_nを選択するとともに、符号化後の変数の個数m(m;m≧nの正の整数)を選択する。ここで、符号化された変数(符号化変数)は、y_1、y_2、・・・、y_mとなる。   The selection unit 1 selects n (n: positive integer) variables x_1, x_2,..., X_n to be encoded, and the number m (m; m ≧ n) of the encoded variables. Positive integer). Here, the encoded variables (encoded variables) are y_1, y_2,..., Y_m.

行列生成部2は、m行n列のブール行列Aおよびm次元の行列b=[b_1、b_2、・・・、b_m]^T(T;ベクトルの転置)を任意に生成する。ただし、ブール行列Aは、rank(A)=nを満たすものとする。   The matrix generation unit 2 arbitrarily generates an m-by-n Boolean matrix A and an m-dimensional matrix b = [b_1, b_2,..., B_m] ^ T (T: vector transposition). However, the Boolean matrix A satisfies rank (A) = n.

算出部3は、数1にしめす演算式を演算して、各行を取り出して、符号化式y_j=f_j(x_1、x_2、・・・、x_n)を算出する。この各符号化式には、乱数を格納する変数r_1、r_2、・・・、r_nが含まれる。これにより、高い機密性を得ることができる。   The calculation unit 3 calculates the arithmetic expression shown in Equation 1, extracts each row, and calculates the encoding expression y_j = f_j (x_1, x_2,..., X_n). Each encoding formula includes variables r_1, r_2,..., R_n for storing random numbers. Thereby, high confidentiality can be obtained.

また、算出部3は、上記で算出した符号化式をx_nの連立方程式として、復号式x_i=g_i(y_1、 y_2、・・・、y_m)を算出する。この各復号式にも、乱数を格納する変数r_1、r_2、・・・、r_nが含まれる。これにより、高い機密性を得ることができる。   In addition, the calculation unit 3 calculates a decoding expression x_i = g_i (y_1, y_2,..., Y_m) using the encoding expression calculated above as a simultaneous equation of x_n. Each decryption formula also includes variables r_1, r_2,..., R_n for storing random numbers. Thereby, high confidentiality can be obtained.

置換部4は、プログラムにおいて、左辺にある変数を、算出部3で算出した符号化式で置換する。具体的には、代入命令 x_i=e (eは、定数もしくは関数)を、以下の命令列に置き換える。
y_1=f_1(x_1、x_2、・・・、x_n)|x_i=e
y_2=f_2(x_1、x_2、・・・、x_n)|x_i=e



y_m=f_m(x_1、x_2、・・・、x_n)|x_i=e
ただし、f_j(x_1、x_2、・・・、x_n)|x_i=eは、符号化式f_jにおいて、x_iをeに置換した式である。
The replacement unit 4 replaces the variable on the left side with the coding formula calculated by the calculation unit 3 in the program. Specifically, the assignment instruction x_i = e (e is a constant or a function) is replaced with the following instruction sequence.
y_1 = f_1 (x_1, x_2,..., x_n) | x_i = e
y_2 = f_2 (x_1, x_2,..., x_n) | x_i = e



y_m = f_m (x_1, x_2,..., x_n) | x_i = e
However, f_j (x_1, x_2, ..., x_n) | x_i = e is an expression in which x_i is replaced with e in the encoding expression f_j.

また、置換部4は、右辺にある変数を、算出部3で算出した各復号式で置換する。具体的には、参照されている変数x_iを復号式g_i(y_1、y_2、・・・、y_m)で置き換える。 The replacement unit 4 replaces the variable on the right side with each decoding formula calculated by the calculation unit 3. Specifically, the referenced variable x_i is replaced with a decoding formula g_i (y_1, y_2,..., Y_m).

宣言削除部5は、プログラムにおいて、変数x_1、x_2、・・・、x_nの宣言を削除する。宣言追加部6は、プログラムにおいて、符号化された変数y_1、 y_2、・・・、y_mおよび乱数を格納する変数r_1、r_2、・・・、r_nの宣言を追加する。命令追加部7は、プログラムにおいて、各変数に乱数を設定するための命令を追加する。   The declaration deletion unit 5 deletes declarations of variables x_1, x_2,..., X_n in the program. The declaration adding unit 6 adds declarations of encoded variables y_1, y_2,..., Y_m and variables r_1, r_2,. The instruction adding unit 7 adds an instruction for setting a random number to each variable in the program.

制御部8は、図示しない記憶手段に格納された制御プログラムに応じて、装置全体を制御する。   The control unit 8 controls the entire apparatus according to a control program stored in a storage unit (not shown).

<プログラム難読化装置の処理>
次に、図2を用いて、プログラム難読化装置の処理について説明する。
<Processing of program obfuscation device>
Next, processing of the program obfuscation apparatus will be described with reference to FIG.

まず、符号化の対象となるn個(nは正の整数)の変数を選択する(ステップS101)。ここで選択した変数をx_1、x_2、・・・、x_nとする。   First, n variables (n is a positive integer) to be encoded are selected (step S101). The variables selected here are x_1, x_2,..., X_n.

次に、符号化後の変数の個数m(mはn以上の正の整数)を選択する(ステップS102)。ここで、符号化された変数(符号化変数)は、y_1、y_2、・・・、y_mとなる。   Next, the number m of encoded variables (m is a positive integer greater than or equal to n) is selected (step S102). Here, the encoded variables (encoded variables) are y_1, y_2,..., Y_m.

m行n列のブール行列A、および、m次元の行列b=[b_1、b_2、・・・、b_m]^T(Tはベクトルの転置を意味する)を任意に生成する(ステップS103)。ただし、ブール行列Aは、rank(A)=nを満たすものとする。   An m-by-n Boolean matrix A and an m-dimensional matrix b = [b_1, b_2,..., b_m] ^ T (T means transposition of a vector) are arbitrarily generated (step S103). However, the Boolean matrix A satisfies rank (A) = n.

次に、下記の数2の式の各行を取り出す(ステップS104)。この結果、符号化式y_j=f_j(x_1、x_2、・・・、x_n)が得られる。各符号化式には、乱数を格納する変数r_1、r_2、・・・、r_nが含まれる。   Next, each row of the following formula 2 is extracted (step S104). As a result, the encoding formula y_j = f_j (x_1, x_2,..., X_n) is obtained. Each encoding expression includes variables r_1, r_2,..., R_n for storing random numbers.

上記ステップS104で得られた符号化式を、x_nに対する連立方程式だとみなし、解く(ステップS105)。この結果、復号式x_i=g_i(y_1、 y_2、・・・、y_m)が得られる。なお、この各復号式にも、乱数を格納する変数r_1、r_2、・・・、r_nが含まれる。   The encoding equation obtained in step S104 is regarded as a simultaneous equation for x_n and is solved (step S105). As a result, the decoding formula x_i = g_i (y_1, y_2,..., Y_m) is obtained. Each decryption formula also includes variables r_1, r_2,..., R_n for storing random numbers.

そして、プログラム中において、左辺に現れる変数を、符号化変数で置き換える(ステップS106)。具体的には、代入命令 x_i=e (eは、定数もしくは関数)を、以下の命令列に置き換える。
y_1=f_1(x_1、x_2、・・・、x_n)|x_i=e
y_2=f_2(x_1、x_2、・・・、x_n)|x_i=e



y_m=f_m(x_1、x_2、・・・、x_n)|x_i=e
ただし、f_j(x_1、x_2、・・・、x_n)|x_i=eは、符号化式f_jにおいて、x_iをeに置換した式である。
Then, the variable appearing on the left side in the program is replaced with the encoding variable (step S106). Specifically, the assignment instruction x_i = e (e is a constant or a function) is replaced with the following instruction sequence.
y_1 = f_1 (x_1, x_2,..., x_n) | x_i = e
y_2 = f_2 (x_1, x_2,..., x_n) | x_i = e



y_m = f_m (x_1, x_2,..., x_n) | x_i = e
However, f_j (x_1, x_2, ..., x_n) | x_i = e is an expression in which x_i is replaced with e in the encoding expression f_j.

さらに、プログラム中において、右辺に現れる変数を、符号化変数で置き換える(ステップS107)。具体的には、参照されている変数x_iを復号式g_i(y_1、y_2、・・・、y_m)で置き換える。   Further, the variable appearing on the right side in the program is replaced with the encoding variable (step S107). Specifically, the referenced variable x_i is replaced with a decoding formula g_i (y_1, y_2,..., Y_m).

そして、プログラムにおいて、変数x_1、x_2、・・・、x_nの宣言を削除し(ステップS108)、また、変数y_1、y_2、・・・、y_mおよび変数r_1、r_2、・・・、r_nの宣言を追加する(ステップS109)。最後に、各変数に乱数を設定するための命令を追加する(ステップS110)。   Then, in the program, the declarations of the variables x_1, x_2,..., X_n are deleted (step S108), and the variables y_1, y_2,. Is added (step S109). Finally, an instruction for setting a random number to each variable is added (step S110).

したがって、本実施形態によれば、変数の値そのものにマスクを施すため、機密性が高いデータを処理するプログラムの保護をさらに高めることができる。   Therefore, according to the present embodiment, since the variable value itself is masked, it is possible to further enhance the protection of the program that processes highly confidential data.

なお、プログラム難読化装置の処理をコンピュータ読み取り可能な記録媒体に記録し、この記録媒体に記録されたプログラムをプログラム難読化装置に読み込ませ、実行することによって本発明のプログラム難読化装置を実現することができる。ここでいうコンピュータシステムとは、OSや周辺装置等のハードウェアを含む。   Note that the program obfuscation apparatus of the present invention is realized by recording the processing of the program obfuscation apparatus on a computer-readable recording medium, causing the program obfuscation apparatus to read and execute the program recorded on the recording medium. be able to. The computer system here includes an OS and hardware such as peripheral devices.

また、「コンピュータシステム」は、WWW(World Wide Web)システムを利用している場合であれば、ホームページ提供環境(あるいは表示環境)も含むものとする。また、上記プログラムは、このプログラムを記憶装置等に格納したコンピュータシステムから、伝送媒体を介して、あるいは、伝送媒体中の伝送波により他のコンピュータシステムに伝送されても良い。ここで、プログラムを伝送する「伝送媒体」は、インターネット等のネットワーク(通信網)や電話回線等の通信回線(通信線)のように情報を伝送する機能を有する媒体のことをいう。   Further, the “computer system” includes a homepage providing environment (or display environment) if a WWW (World Wide Web) 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 a block diagram of the program obfuscation apparatus which concerns on this embodiment. 本実施形態に係るプログラム難読化装置の処理フローである。It is a processing flow of the program obfuscation apparatus which concerns on this embodiment.

符号の説明Explanation of symbols

1・・・選択部
2・・・行列生成部
3・・・算出部
4・・・置換部
5・・・宣言削除部
6・・・宣言追加部
7・・・命令追加部
8・・・制御部
DESCRIPTION OF SYMBOLS 1 ... Selection part 2 ... Matrix generation part 3 ... Calculation part 4 ... Replacement part 5 ... Declaration deletion part 6 ... Declaration addition part 7 ... Instruction addition part 8 ... Control unit

Claims (3)

符号化の対象となるn個(n;正の整数)の変数x_1、x_2、・・・、x_nを選択する第1の選択手段と、
符号化後の変数の個数m(m;m≧nの正の整数)を選択する第2の選択手段と、
m行n列のブール行列Aおよびm次元の行列b=[b_1、b_2、・・・、b_m]^T(T;ベクトルの転置)を任意に生成する行列生成手段と、
数1を演算して、各行を取り出して、符号化式y_j=f_j(x_1、x_2、・・・、x_n)を算出する第1の算出手段と、
該算出した符号化式をx_nの連立方程式として、復号式x_i=g_i(y_1、y_2、・・・、y_m)を算出する第2の算出手段と、
プログラムにおいて、代入命令を、第1の算出手段で算出した符号化式で置換する第1の置換手段と、
プログラムにおいて、右辺にある変数を、第2の算出手段で算出した各復号式で置換する第2の置換手段と、
プログラムにおいて、変数x_1、x_2、・・・、x_nの宣言を削除する削除手段と、
プログラムにおいて、符号化された変数y_1、y_2、・・・、y_mおよび乱数を格納する変数r_1、r_2、・・・、r_nの宣言を追加する宣言追加手段と、
プログラムにおいて、各変数に乱数を設定するための命令を追加する命令追加手段と、
を備えたことを特徴とするプログラム難読化装置。
First selection means for selecting n (n: positive integer) variables x_1, x_2,..., X_n to be encoded;
Second selection means for selecting the number m of variables after encoding (m; a positive integer of m ≧ n);
matrix generating means for arbitrarily generating a Boolean matrix A of m rows and n columns and an m-dimensional matrix b = [b_1, b_2,..., b_m] ^ T (T; vector transposition);
A first calculating unit that calculates Formula 1 and extracts each row to calculate an encoding expression y_j = f_j (x_1, x_2,..., X_n);
Second calculating means for calculating a decoding expression x_i = g_i (y_1, y_2,..., Y_m) using the calculated encoding expression as simultaneous equations of x_n;
In the program, a first replacement unit that replaces an assignment instruction with each encoding expression calculated by the first calculation unit;
In the program, second replacement means for replacing the variable on the right side with each decoding formula calculated by the second calculation means;
In the program, deletion means for deleting declarations of variables x_1, x_2, ..., x_n;
Declaration adding means for adding declarations of encoded variables y_1, y_2,..., Y_m and variables r_1, r_2,.
In the program, an instruction adding means for adding an instruction for setting a random number to each variable;
A program obfuscation device comprising:
第1の選択手段、第2の選択手段、行列生成手段、第1の算出手段、第2の算出手段、第1の置換手段、第2の置換手段、削除手段、宣言追加手段、および命令追加手段を備えるプログラム難読化装置におけるプログラムの難読化方法であって、
前記第1の選択手段が、符号化の対象となるn個(n;正の整数)の変数x_1、x_2、・・・、x_nを選択する第1のステップと、
前記第2の選択手段が、符号化後の変数の個数m(m;m≧nの正の整数)を選択する第2のステップと、
前記行列生成手段が、m行n列のブール行列Aおよびm次元の行列b=[b_1、b_2、・・・、b_m]^T(T;ベクトルの転置)を任意に生成する第3のステップと、
前記第1の算出手段が、数2を演算して、各行を取り出して、符号化式y_j=f_j(x_1、x_2、・・・、x_n)を算出する第4のステップと、
前記第2の算出手段が、該算出した符号化式をx_nの連立方程式として、復号式x_i=g_i(y_1、y_2、・・・、y_m)を算出する第5のステップと、
前記第1の置換手段が、プログラムにおいて、代入命令を、算出した符号化式で置換する第6のステップと、
前記第2の置換手段が、プログラムにおいて、右辺にある変数を、算出した各復号式で置換する第7のステップと、
前記削除手段が、プログラムにおいて、変数x_1、x_2、・・・、x_nの宣言を削除する第8のステップと、
前記宣言追加手段が、プログラムにおいて、符号化された変数y_1、y_2、・・・、y_mおよび乱数を格納する変数r_1、r_2、・・・、r_nの宣言を追加する第9のステップと、
前記命令追加手段が、プログラムにおいて、各変数に乱数を設定するための命令を追加する第10のステップと、
を備えたことを特徴とするプログラムの難読化方法。
First selection means, second selection means, matrix generation means, first calculation means, second calculation means, first replacement means, second replacement means, deletion means, declaration addition means, and instruction addition A program obfuscation method in a program obfuscation apparatus comprising means,
A first step in which the first selecting means selects n (n; positive integer) variables x_1, x_2,..., X_n to be encoded;
A second step in which the second selection means selects the number m of variables after encoding (m; a positive integer of m ≧ n);
A third step in which the matrix generation means arbitrarily generates an m-by-n Boolean matrix A and an m-dimensional matrix b = [b_1, b_2,..., B_m] ^ T (T; vector transposition); When,
A fourth step in which the first calculation means calculates Formula 2 to extract each row and calculate an encoding expression y_j = f_j (x_1, x_2,..., X_n);
A fifth step in which the second calculating means calculates a decoding equation x_i = g_i (y_1, y_2,..., Y_m) using the calculated encoding equation as a simultaneous equation of x_n;
A first step in which the first replacement means replaces the substitution instruction with each calculated encoding expression in the program;
A second step in which the second replacement means replaces the variable on the right side with each calculated decoding formula in the program;
An eighth step in which the deleting means deletes declarations of variables x_1, x_2, ..., x_n in the program;
A ninth step of adding declarations of encoded variables y_1, y_2, ..., y_m and variables r_1, r_2, ..., r_n for storing random numbers in the program;
A tenth step in which the instruction adding means adds an instruction for setting a random number to each variable in the program;
A program obfuscation method characterized by comprising:
符号化の対象となるn個(n;正の整数)の変数x_1、x_2、・・・、x_nを選択する第1のステップと、
符号化後の変数の個数m(m;m≧nの正の整数)を選択する第2のステップと、
m行n列のブール行列Aおよびm次元の行列b=[b_1、b_2、・・・、b_m]^T(T;ベクトルの転置)を任意に生成する第3のステップと、
数3を演算して、各行を取り出して、符号化式y_j=f_j(x_1、x_2、・・・、x_n)を算出する第4のステップと、
該算出した符号化式をx_nの連立方程式として、復号式x_i=g_i(y_1、y_2、・・・、y_m)を算出する第5のステップと、
プログラムにおいて、代入命令を、算出した符号化式で置換する第6のステップと、
プログラムにおいて、右辺にある変数を、算出した各復号式で置換する第7のステップと、
プログラムにおいて、変数x_1、x_2、・・・、x_nの宣言を削除する第8のステップと、
プログラムにおいて、符号化された変数y_1、y_2、・・・、y_mおよび乱数を格納する変数r_1、r_2、・・・、r_nの宣言を追加する第9のステップと、
プログラムにおいて、各変数に乱数を設定するための命令を追加する第10のステップと、
をコンピュータに実行させるためのプログラム。

A first step of selecting n (n; positive integer) variables x_1, x_2,..., X_n to be encoded;
A second step of selecting the number m of variables after encoding (m; a positive integer with m ≧ n);
a third step of arbitrarily generating an m-by-n Boolean matrix A and an m-dimensional matrix b = [b_1, b_2,..., b_m] ^ T (T; vector transposition);
A fourth step of calculating Formula 3 to extract each row and calculate an encoding expression y_j = f_j (x_1, x_2,..., X_n);
A fifth step of calculating a decoding expression x_i = g_i (y_1, y_2,..., Y_m) using the calculated encoding expression as simultaneous equations of x_n;
A sixth step of replacing an assignment instruction with each calculated encoding expression in the program;
In the program, a seventh step of replacing the variable on the right side with each calculated decoding formula ;
An eighth step of deleting declarations of variables x_1, x_2, ..., x_n in the program;
A ninth step of adding declarations of encoded variables y_1, y_2,..., Y_m and variables r_1, r_2,.
A tenth step of adding an instruction for setting a random number to each variable in the program;
A program that causes a computer to execute.

JP2008114872A 2008-04-25 2008-04-25 Program obfuscation apparatus, program obfuscation method, and program Active JP5149061B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008114872A JP5149061B2 (en) 2008-04-25 2008-04-25 Program obfuscation apparatus, program obfuscation method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008114872A JP5149061B2 (en) 2008-04-25 2008-04-25 Program obfuscation apparatus, program obfuscation method, and program

Publications (2)

Publication Number Publication Date
JP2009265949A JP2009265949A (en) 2009-11-12
JP5149061B2 true JP5149061B2 (en) 2013-02-20

Family

ID=41391724

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008114872A Active JP5149061B2 (en) 2008-04-25 2008-04-25 Program obfuscation apparatus, program obfuscation method, and program

Country Status (1)

Country Link
JP (1) JP5149061B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5922562B2 (en) * 2012-11-30 2016-05-24 Kddi株式会社 Program conversion apparatus and program
JP6203028B2 (en) * 2013-12-13 2017-09-27 Kddi株式会社 Pseudorandom number generation apparatus and method, and program obfuscation apparatus and method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7254586B2 (en) * 2002-06-28 2007-08-07 Microsoft Corporation Secure and opaque type library providing secure data protection of variables
GB2405958A (en) * 2003-08-20 2005-03-16 Macrovision Europ Ltd Code obfuscation and controlling a processor by emulation

Also Published As

Publication number Publication date
JP2009265949A (en) 2009-11-12

Similar Documents

Publication Publication Date Title
Wu et al. AEA-NCS: An audio encryption algorithm based on a nested chaotic system
EP2924677B1 (en) Splitting s-boxes in a white-box implementation to resist attacks
CN110235409A (en) Use the protected RSA signature of homomorphic cryptography or the method for decryption
CN106570815A (en) Image encryption method based on double-chaos system and blocking
CN105024803A (en) Behavioral fingerprint in a white-box implementation
Coron et al. Faster evaluation of sboxes via common shares
Sasdrich et al. White-Box Cryptography in the Gray Box: –A Hardware Implementation and its Side Channels–
Wang et al. Color image encryption algorithm based on Fisher-Yates scrambling and DNA subsequence operation
KR20180110550A (en) Method and apparatus for white-box cryptography for protecting against side channel analysis
Elkamchouchi et al. New encryption algorithm for secure image transmission through open network
JP5149061B2 (en) Program obfuscation apparatus, program obfuscation method, and program
Ahmad et al. Securing multimedia colour imagery using multiple high dimensional chaos-based hybrid keys
Gu et al. White-box cryptography: practical protection on hostile hosts
JP4667800B2 (en) Encoding method and program thereof
JP4675642B2 (en) Program obfuscation apparatus, method and program
Gao et al. New image encryption algorithm based on hyperchaotic 3D-IHAL and a hybrid cryptosystem
KR101440680B1 (en) Homomorphic Encryption and Decryption Method using Chinese Remainder Theorem and apparatus using the same
JP5149062B2 (en) Program obfuscation apparatus, program obfuscation method, and program
JP4917860B2 (en) Program obfuscation method and program
JP5627444B2 (en) Software obfuscation device, software obfuscation method and program
JP2007079916A (en) Encoding method and its program
Singh et al. CrAlSim: A Cryptography Algorithm Simulator
JP5378055B2 (en) Program obfuscation apparatus, program obfuscation method, and program
JP4837506B2 (en) Program obfuscation method and program
Sumathi et al. Performance comparison of data security algorithms

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110228

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121002

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20121003

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121105

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20121129

R150 Certificate of patent or registration of utility model

Ref document number: 5149061

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20151207

Year of fee payment: 3