JP2008102576A - Program analysis method and program - Google Patents

Program analysis method and program Download PDF

Info

Publication number
JP2008102576A
JP2008102576A JP2006282307A JP2006282307A JP2008102576A JP 2008102576 A JP2008102576 A JP 2008102576A JP 2006282307 A JP2006282307 A JP 2006282307A JP 2006282307 A JP2006282307 A JP 2006282307A JP 2008102576 A JP2008102576 A JP 2008102576A
Authority
JP
Japan
Prior art keywords
conditional statement
program
variables
value
false
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
JP2006282307A
Other languages
Japanese (ja)
Other versions
JP4917861B2 (en
Inventor
Kazuhide Fukushima
和英 福島
Shinsaku Kiyomoto
晋作 清本
Toshiaki Tanaka
俊昭 田中
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 JP2006282307A priority Critical patent/JP4917861B2/en
Publication of JP2008102576A publication Critical patent/JP2008102576A/en
Application granted granted Critical
Publication of JP4917861B2 publication Critical patent/JP4917861B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a program analysis method and a program allowing accurate detection also on a conditional sentence including a plurality of variables or a plurality of expressions, included in the program. <P>SOLUTION: When the conditional sentence including the plurality of variables is given in the program, a maximum coefficient or a maximum method in use is selected, and its value is made p. The values of the respective variables of the plurality of variables used in the conditional sentence are set to values from 0 to p-1, and whether the conditional sentence in modp is always true or false is determined on all the set values. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、抽象解釈を用いたプログラム解析方法およびプログラムに関する。   The present invention relates to a program analysis method and program using abstract interpretation.

一般に、プログラムには、利用者に対して秘密にすべきアルゴリズムを含む場合がある。こうした秘密にすべきアルゴリズムを利用者による解析から守るためには、何らかの対策を講じる必要がある。   Generally, a program may include an algorithm that should be kept secret from the user. In order to protect these secret algorithms from analysis by the user, it is necessary to take some measures.

その対応策の一つとして、プログラムの機能を保ちつつ、解析を困難にする難読化と呼ばれる手法があり、プログラム内の制御構造を複雑にしたり、プログラム内にダミーコードを挿入したりする方法が知られている。こうしたプログラムの難読化を実現するためには、opaque predicateと呼ばれる、常に真あるいは偽と判定される条件文を用いることが必要である。   As one of the countermeasures, there is a technique called obfuscation that keeps the function of the program and makes analysis difficult, and there are methods to complicate the control structure in the program and insert dummy code in the program. Are known. In order to realize such obfuscation of a program, it is necessary to use a conditional statement called “opaque predicate” that is always determined to be true or false.

具体的には、常に真と判定される条件分岐ブロックの中に、命令文を移動したり、常に偽と判定される条件分岐ブロックの中に、ダミーコードを挿入する等の処理を施すことによってプログラムの解析を困難にすることができる。   Specifically, by moving the statement to a conditional branch block that is always determined to be true, or by performing processing such as inserting a dummy code into a conditional branch block that is always determined to be false. Analysis of the program can be made difficult.

一方で、上記のように難読化されたプログラムに対して、抽象解釈を用いて、プログラム中のopaque predicateを検出する方法が提案されている(例えば、非特許文献1参照。)。
Mila Dalla Preda and Roberto Giacobazzi、“Opaque Predicates Detention by Abstract Interpretation、”Proc.of EAAI 2006.
On the other hand, there has been proposed a method of detecting opaque predicates in a program using abstract interpretation for the program obfuscated as described above (see, for example, Non-Patent Document 1).
Mila Dalla Preda and Roberto Giacobazzi, “Opaque Predictates Detection by Abstract Interpretation,” Proc. of EAAI 2006.

しかしながら、上記の従来の方法では、ある与えられた関数f(x)がすべての整数xに対して、nで割り切れるかどうかのみに対する判定方法が示されているのみである。すなわち、上記の従来の方法においては、1つの変数のみが含まれる単一の式から構成されるopaque predicateのみをその対象としている。そのため、複数の変数を含む条件文、例えば、「すべての整数x、yに対して、7x2−y2≠1」や「すべての整数に対して、2|x2+x+y」等の条件文を検出することができないという問題があった。 However, the above-described conventional method only shows a determination method for determining whether a given function f (x) is divisible by n for all integers x. That is, in the above-described conventional method, only the opaque predicate composed of a single expression including only one variable is targeted. Therefore, a conditional statement including a plurality of variables, for example, a conditional statement such as “7x 2 −y 2 ≠ 1 for all integers x and y” or “2 | x 2 + x + y for all integers”. There was a problem that could not be detected.

そこで、本発明は、上述の課題に鑑みてなされたものであり、プログラム中に含まれる複数の変数あるいは複数の式からなる条件文についても、これらを的確に検出することができるプログラム解析方法およびプログラムを提供することを目的とする。   Therefore, the present invention has been made in view of the above problems, and a program analysis method capable of accurately detecting a plurality of variables or conditional statements including a plurality of expressions included in a program, and The purpose is to provide a program.

本発明は、上記の課題を解決するために以下の事項を提案している。
(1)本発明は、抽象解釈を用いて、複数の変数あるいは複数の式からなり、常に真または偽と判定される条件文をプログラム内から検出するプログラム解析方法を提案している。
The present invention proposes the following items in order to solve the above problems.
(1) The present invention proposes a program analysis method for detecting from a program a conditional statement consisting of a plurality of variables or a plurality of expressions and always determined to be true or false using abstract interpretation.

この発明によれば、抽象解釈を用いることにより、プログラム内にある単一の変数からなる条件文のみならず、複数の変数あるいは複数の式からなる条件文についてもこれらを的確に検出することができる。   According to the present invention, by using abstract interpretation, not only a conditional statement consisting of a single variable in a program but also a conditional statement consisting of a plurality of variables or a plurality of expressions can be accurately detected. it can.

(2)本発明は、プログラム内に、複数の変数を含む条件文が与えられているときに、用いられている最大の係数あるいは最大の法を選択して、その値をpとする第1のステップ(例えば、図1のステップS101に相当)と、条件文に用いられている複数の変数に対して、それぞれの変数の値を0からp−1の値に設定する第2のステップ(例えば、図1のステップS102に相当)と、設定したすべての値について、mod_pにおける条件文が常に真もしくは偽となるか否かを判断する第3のステップ(例えば、図1のステップS103からステップS106に相当)と、を備えたことを特徴とするプログラム解析方法を提案している。   (2) In the present invention, when a conditional statement including a plurality of variables is given in a program, the maximum coefficient or the maximum method used is selected and the value is set to p. Step (for example, corresponding to step S101 in FIG. 1) and a second step of setting the value of each variable from 0 to p−1 for a plurality of variables used in the conditional statement ( For example, the third step (e.g., from step S103 in FIG. 1 to step S102 in FIG. 1) and the third step for determining whether the conditional statement in mod_p is always true or false for all the set values. Equivalent to S106) is proposed.

この発明によれば、プログラム内に、複数の変数を含む条件文が与えられているときに、用いられている最大の係数あるいは最大の法を選択して、その値をpとし、条件文に用いられている複数の変数に対して、それぞれの変数の値を0からp−1の値に設定して、設定したすべての値について、mod_pにおける条件文が常に真もしくは偽となるか否かを判断する。   According to the present invention, when a conditional statement including a plurality of variables is given in the program, the largest coefficient or the largest method used is selected, and the value is set to p, and the conditional statement Whether or not the conditional statement in mod_p is always true or false with respect to all the set values by setting the value of each variable from 0 to p-1 for a plurality of used variables Judging.

したがって、複数の変数を含む条件文がプログラム内に存在する場合であっても、この条件文を的確に検出することができる。   Therefore, even when a conditional statement including a plurality of variables exists in the program, the conditional statement can be accurately detected.

(3)本発明は、プログラム内に、複数の式からなる条件文が与えられているときに、用いられているすべての法の最小公倍数をpと設定する第1のステップ(例えば、図4のステップS401に相当)と、条件文に用いられている複数の変数に対して、それぞれの変数の値を0からp−1の値に設定する第2のステップ(例えば、図4のステップS402に相当)と、設定したすべての値について、mod_pにおける条件文が常に真もしくは偽となるか否かを判断する第3のステップ(例えば、図4のステップS403からステップS406に相当)と、を備えたことを特徴とするプログラム解析方法を提案している。   (3) In the present invention, when conditional statements comprising a plurality of expressions are given in the program, the first step (for example, FIG. And a second step (for example, step S402 in FIG. 4) for setting the value of each variable to a value from 0 to p−1 for a plurality of variables used in the conditional statement. And a third step (for example, corresponding to step S403 to step S406 in FIG. 4) for determining whether the conditional statement in mod_p is always true or false for all the set values. We propose a program analysis method characterized by having it.

この発明によれば、プログラム内に、複数の式からなる条件文が与えられているときに、用いられているすべての法の最小公倍数をpと設定し、条件文に用いられている複数の変数に対して、それぞれの変数の値を0からp−1の値に設定して、設定したすべての値について、mod_pにおける条件文が常に真もしくは偽となるか否かを判断する。   According to this invention, when a conditional statement consisting of a plurality of expressions is given in the program, the least common multiple of all the moduli used is set as p, and a plurality of the conditional statements used in the conditional statement are set. For each variable, the value of each variable is set to a value from 0 to p−1, and it is determined whether or not the conditional statement in mod_p is always true or false for all the set values.

したがって、複数の式からなる条件文がプログラム内に存在する場合であっても、この条件文を的確に検出することができる。   Therefore, even when a conditional statement consisting of a plurality of expressions exists in the program, the conditional statement can be accurately detected.

(4)本発明は、プログラム内に、複数の変数を含む条件文が与えられているときに、用いられている最大の係数あるいは最大の法を選択して、その値をpとする第1のステップ(例えば、図1のステップS101に相当)と、条件文に用いられている複数の変数に対して、それぞれの変数の値を0からp−1の値に設定する第2のステップ(例えば、図1のステップS102に相当)と、設定したすべての値について、mod_pにおける条件文が常に真もしくは偽となるか否かを判断する第3のステップ(例えば、図1のステップS103からステップS106に相当)と、をコンピュータに実行させるためのプログラムを提案している。   (4) In the present invention, when a conditional statement including a plurality of variables is given in the program, the maximum coefficient or the maximum method used is selected, and the value is set to p. Step (for example, corresponding to step S101 in FIG. 1), and a second step of setting each variable value from 0 to p−1 for a plurality of variables used in the conditional statement ( For example, the third step (e.g., from step S103 in FIG. 1 to step S102 in FIG. 1) and the third step for determining whether the conditional statement in mod_p is always true or false for all the set values. (Corresponding to S106) is proposed.

この発明によれば、プログラム内に、複数の変数を含む条件文が与えられているときに、コンピュータにより、用いられている最大の係数あるいは最大の法を選択して、その値をpとし、条件文に用いられている複数の変数に対して、それぞれの変数の値を0からp−1の値に設定して、設定したすべての値について、mod_pにおける条件文が常に真もしくは偽となるか否かを判断する。   According to the present invention, when a conditional statement including a plurality of variables is given in the program, the computer selects the maximum coefficient or maximum method used, and sets the value to p, For a plurality of variables used in a conditional statement, the value of each variable is set to a value from 0 to p−1, and the conditional statement in mod_p is always true or false for all the set values. Determine whether or not.

したがって、複数の変数を含む条件文がプログラム内に存在する場合であっても、この条件文を的確に検出することができる。   Therefore, even when a conditional statement including a plurality of variables exists in the program, the conditional statement can be accurately detected.

(5)本発明は、プログラム内に、複数の式からなる条件文が与えられているときに、用いられているすべての法の最小公倍数をpと設定する第1のステップ(例えば、図4のステップS401に相当)と、条件文に用いられている複数の変数に対して、それぞれの変数の値を0からp−1の値に設定する第2のステップ(例えば、図4のステップS402に相当)と、設定したすべての値について、mod_ppにおける条件文が常に真もしくは偽となるか否かを判断する第3のステップ(例えば、図4のステップS403からステップS406に相当)と、をコンピュータに実行させるためのプログラムを提案している。   (5) In the present invention, when a conditional statement consisting of a plurality of expressions is given in the program, the first step of setting the least common multiple of all the used modulo as p (for example, FIG. 4). And a second step (for example, step S402 in FIG. 4) for setting the value of each variable to a value from 0 to p−1 for a plurality of variables used in the conditional statement. And a third step (for example, corresponding to step S403 to step S406 in FIG. 4) for determining whether or not the conditional statement in mod_pp is always true or false for all the set values. Proposes a program to be executed by a computer.

この発明によれば、プログラム内に、複数の式からなる条件文が与えられているときに、コンピュータにより、用いられているすべての法の最小公倍数をpと設定し、条件文に用いられている複数の変数に対して、それぞれの変数の値を0からp−1の値に設定して、設定したすべての値について、mod_pにおける条件文が常に真もしくは偽となるか否かを判断する。   According to the present invention, when a conditional statement consisting of a plurality of expressions is given in the program, the computer sets the least common multiple of all the used modulo as p and is used in the conditional statement. For each of a plurality of variables, the value of each variable is set to a value from 0 to p−1, and it is determined whether or not the conditional statement in mod_p is always true or false for all the set values. .

したがって、複数の式からなる条件文がプログラム内に存在する場合であっても、この条件文を的確に検出することができる。   Therefore, even when a conditional statement consisting of a plurality of expressions exists in the program, the conditional statement can be accurately detected.

本発明によれば、プログラム内にある単一の変数からなる条件文のみならず、複数の変数あるいは複数の式からなる条件文についてもこれらを的確に検出することができるという効果がある。   According to the present invention, there is an effect that not only a conditional statement consisting of a single variable in a program but also a conditional statement consisting of a plurality of variables or a plurality of expressions can be accurately detected.

また、上記のような条件文を自動的に検出することにより、プログラム解析の観点から、冗長な条件分岐やダミーコードを除去することができるため、プログラムの解析がより容易になるという効果がある。   In addition, by automatically detecting the conditional statements as described above, it is possible to remove redundant conditional branches and dummy code from the viewpoint of program analysis. .

さらに、上記のような条件文を自動的に検出することにより、プログラムの保護の観点から、脆弱な条件文を検出して、これをより強固な条件文に置き換えることにより、プログラムの保護強化を図ることができるという効果がある。   Furthermore, by automatically detecting conditional statements such as those mentioned above, from the viewpoint of program protection, it is possible to detect weak conditional statements and replace them with stronger conditional statements to enhance program protection. There is an effect that it can be planned.

以下、本発明の実施形態について、図面を用いて、詳細に説明する。
なお、本実施形態における構成要素は適宜、既存の構成要素等との置き換えが可能であり、また、他の既存の構成要素との組合せを含む様々なバリエーションが可能である。したがって、本実施形態の記載をもって、特許請求の範囲に記載された発明の内容を限定するものではない。
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の実施形態>
図1を用いて、本実施形態の処理について説明する。
なお、本実施形態は、プログラム中に存在する複数の変数を含む条件文を検出するプログラムの解析方法を示したものである。
<First Embodiment>
The processing of this embodiment will be described with reference to FIG.
This embodiment shows a program analysis method for detecting a conditional statement including a plurality of variables existing in a program.

<処理フロー>
本実施形態の処理は、図1に示すように、まず、条件文に用いられている最大の係数もしくは最大の法を選択し、この値をpとする(ステップS101)。次に、条件文に用いられている複数の変数に対して、それぞれの変数の値を0からp−1に設定する(ステップS102)
<Processing flow>
In the process of the present embodiment, as shown in FIG. 1, first, the maximum coefficient or the maximum method used in the conditional statement is selected, and this value is set to p (step S101). Next, for a plurality of variables used in the conditional statement, the value of each variable is set from 0 to p−1 (step S102).

さらに、設定した値に対して、mod_pにおける条件文の真偽を確認する(ステップS103)。そして、p回の試行において、条件文が常に真または偽になるかを判定し(ステップS104)、条件文が常に真または偽になると判定した場合には、この条件文がopaque predicateであると判断する(ステップS105)。一方で、条件文が常に真または偽にならないと判定した場合には、この条件文がopaque predicateでないと判断する(ステップS106)。 Furthermore, the authenticity of the conditional statement in mod_p is confirmed for the set value (step S103). Then, the p n trials, to determine whether the conditional statement is always true or false (step S104), and if the conditional statement is always determined to be true or false, the conditional statement is a Opaque predicate (Step S105). On the other hand, if it is determined that the conditional statement is not always true or false, it is determined that the conditional statement is not opaque predicate (step S106).

したがって、本実施形態によれば、上記の処理を実行することにより、複数の変数を含む条件文がプログラム内に存在する場合であっても、この条件文がopaque predicateであるか否かを的確に検出することができる。   Therefore, according to the present embodiment, even if a conditional statement including a plurality of variables exists in the program by executing the above processing, it is accurately determined whether or not this conditional statement is opaque predicate. Can be detected.

次に、具体的な事例を用いた判定方法について説明する。
<実施例1>
本実施例では、複数の変数を含む条件文「すべての整数x、yに対して、ax2−by2≠c」について、その判定方法を図2を用いて説明する。
Next, a determination method using specific examples will be described.
<Example 1>
In this embodiment, a determination method for a conditional statement “ax 2 −by 2 ≠ c for all integers x and y” including a plurality of variables will be described with reference to FIG.

まず、aとbが、a>bなる関係にあるかどうかを判断する(ステップS201)。ここで、a>bである場合(ステップS201の「Yes」)には、y=0、1、2、・・・a−1において、−by2=c%aがすべてyに対して成立するか否かを判定する(ステップS202)。なお、ここで、「c%a」とは、cをaで割ったときの剰余である。 First, it is determined whether a and b have a relationship of a> b (step S201). Here, if a> b (“Yes” in step S201), in y = 0, 1, 2,..., A−1, −by 2 = c% a is all established for y. It is determined whether or not to perform (step S202). Here, “c% a” is a remainder when c is divided by a.

そして、y=0、1、2、・・・a−1において、−by2=c%aがすべてyに対して成立する場合には、この条件文がopaque predicateであると判断する(ステップS203)。一方、y=0、1、2、・・・a−1において、−by2=c%aがすべてyに対して成立しない場合には、この条件文がopaque predicateでないと判断する(ステップS204)。 Then, in y = 0, 1, 2,..., A−1, if all of −by 2 = c% a holds for y, it is determined that this conditional statement is an opaque predicate (step S203). On the other hand, when y = 0, 1, 2,..., A−1 and all of −by 2 = c% a is not satisfied with respect to y, it is determined that the conditional statement is not “opaque predicate” (step S204). ).

また、aとbが、a≦bの関係にある場合(ステップS201の「No」)には、x=0、1、2、・・・b−1において、ax2=c%bがすべてxに対して成立するか否かを判定する(ステップS205)。なお、ここで、「c%b」とは、cをbで割ったときの剰余である。 When a and b are in a relationship of a ≦ b (“No” in step S201), all of ax 2 = c% b in x = 0, 1, 2 ,. It is determined whether x is satisfied or not (step S205). Here, “c% b” is a remainder when c is divided by b.

そして、x=0、1、2、・・・b−1において、ax2=c%bがすべてxに対して成立する場合には、この条件文がopaque predicateであると判断する(ステップS207)。一方、x=0、1、2、・・・b−1において、ax2=c%bがすべてxに対して成立しない場合には、この条件文がopaque predicateでないと判断する(ステップS306)。 When x = 0, 1, 2,..., B−1 and all of ax 2 = c% b hold for x, it is determined that this conditional statement is “opaque predicate” (step S207). ). On the other hand, when x = 0, 1, 2,..., B-1 and all of ax 2 = c% b are not satisfied with respect to x, it is determined that this conditional statement is not opaque predicate (step S306). .

以上のように、上記のタイプの条件文の場合には、max{a、b}回の試行により、条件文がopaque predicateであるか否かを判定することができる。例えば、条件文「7x2−y2≠1」がopaque predicateであるかどうかを判定する際には、上記のa>bなる関係であることから、−y2≠1がy=0、1、2、3、4、5、6に対して成立するか否かを判定する。なお、本例では、すべてのyに対して、−y2≠1が成立するため、この条件文は、opaque predicateであると判断することができる。 As described above, in the case of the above-mentioned type of conditional statement, it is possible to determine whether the conditional statement is “opaque predicate” by max {a, b} trials. For example, when determining whether or not the conditional statement “7x 2 −y 2 ≠ 1” is “opaque predicate”, −y 2 ≠ 1 is y = 0, 2, 3, 4, 5, 6 is determined. In this example, since −y 2 ≠ 1 holds for all y, it can be determined that this conditional statement is “opaque predicate”.

<実施例2>
本実施例では、複数の変数を含む条件文「p|f(x1、x2、・・・、xn)」について、その判定方法を図3を用いて説明する。
<Example 2>
In this embodiment, a determination method for a conditional statement “p | f (x1, x2,..., Xn)” including a plurality of variables will be described with reference to FIG.

まず、条件文に用いられている変数(x1、x2、・・・、xn)に対して、それぞれの変数の値に、0からp−1の値を独立に設定したとき、すなわち、p回の試行を行ったときに、条件文が常に真または偽になるか否かを判定する(ステップS301)。 First, with respect to the variables (x1, x2,..., Xn) used in the conditional statement, when values of 0 to p−1 are independently set as the values of the respective variables, that is, pn It is determined whether the conditional statement is always true or false when the number of trials is made (step S301).

そして、p回の試行において、条件文「p|f(x1、x2、・・・、xn)」が、常に真もしくは偽である場合(ステップS301の「Yes」)には、この条件文がopaque predicateであると判断する(ステップS302)。一方で、p回の試行において、条件文「p|f(x1、x2、・・・、xn)」が、常に真もしくは偽でない場合(ステップS301の「No」)には、この条件文がopaque predicateでないと判断する(ステップS303)。 If the conditional statement “p | f (x1, x2,..., Xn)” is always true or false in the pn trials (“Yes” in step S301), the conditional statement Is an opaque predicate (step S302). On the other hand, if the conditional statement “p | f (x1, x2,..., Xn)” is not always true or false in “ n ” trials (“No” in step S301), the conditional statement Is not opaque predicate (step S303).

以上のように、上記のタイプの条件文の場合には、p回の試行を実行することにより、条件文がopaque predicateであるか否かを判定することができる。例えば、条件文「2|x2+x+4y」がopaque predicateであるかどうかを判定する際には、(x、y)=(0、0)、(0、1)、(1、0)、(1、1)について、条件文「2|x2+x+4y」が成立するか否かを判断する。 As described above, in the case of the above-mentioned type of conditional statement, it is possible to determine whether or not the conditional statement is opaque predicate by executing pn trials. For example, when determining whether the conditional statement “2 | x 2 + x + 4y” is “opaque predicate”, (x, y) = (0, 0), (0, 1), (1, 0), ( For 1, 1), it is determined whether the conditional statement “2 | x 2 + x + 4y” is satisfied.

<第2の実施形態>
図4を用いて、本実施形態の処理について説明する。
なお、本実施形態は、プログラム中に存在する複数の式を含む条件文を検出するプログラムの解析方法を示したものである。
<Second Embodiment>
The process of this embodiment is demonstrated using FIG.
This embodiment shows a program analysis method for detecting a conditional statement including a plurality of expressions existing in a program.

<処理フロー>
本実施形態の処理は、図4に示すように、まず、条件文に用いられているすべての法の最小公倍数をpとする(ステップS401)。次に、条件文に用いられている複数の変数に対して、それぞれの変数の値を0からp−1に設定する(ステップS402)。
<Processing flow>
In the process of the present embodiment, as shown in FIG. 4, first, the least common multiple of all the moduli used in the conditional statement is set to p (step S401). Next, the value of each variable is set from 0 to p−1 for a plurality of variables used in the conditional statement (step S402).

さらに、設定した値に対して、modpにおける条件文の真偽を確認する(ステップS403)。そして、p回の試行において、条件文が常に真または偽であるか否かを判定し(ステップS404)、条件文が常に真または偽である場合(ステップS404の「Yes」)には、この条件文がopaque predicateであると判断する(ステップS405)。一方で、条件文が常に真または偽にならないと判定した場合には、この条件文がopaque predicateでないと判断する(ステップS406)。 Furthermore, the authenticity of the conditional statement in modp is confirmed for the set value (step S403). Then, the p n trials, the always conditional statement determines whether true or false (step S404), if the conditional statement is always true or false (Step S404 "Yes"), It is determined that the conditional statement is “opaque predicate” (step S405). On the other hand, if it is determined that the conditional statement is not always true or false, it is determined that the conditional statement is not opaque predicate (step S406).

したがって、本実施形態によれば、上記の処理を実行することにより、複数の式を含む条件文がプログラム内に存在する場合であっても、この条件文がopaque predicateであるか否かを的確に検出することができる。   Therefore, according to this embodiment, even if a conditional statement including a plurality of expressions exists in the program by executing the above processing, it is accurately determined whether or not this conditional statement is an opaque predicate. Can be detected.

なお、上記の処理をコンピュータ読み取り可能な記録媒体に記録し、この記録媒体に記録されたプログラムをコンピュータに読み込ませ、実行することによって本発明のプログラム解析方法を自動的に実現することができる。ここでいうコンピュータシステムとは、OSや周辺装置等のハードウェアを含む。   The program analysis method of the present invention can be automatically realized by recording the above processing on a computer-readable recording medium, causing the computer 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(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 embodiment of the present invention has been described in detail with reference to the drawings. However, the specific configuration is not limited to this embodiment, and includes a design and the like within a scope not departing from the gist of the present invention.

本発明の第1の実施形態に係る処理フローである。It is a processing flow concerning the 1st embodiment of the present invention. 本発明の実施例1に係る処理フローである。It is a processing flow concerning Example 1 of the present invention. 本発明の実施例2に係る処理フローである。It is a processing flow concerning Example 2 of the present invention. 本発明の第2の実施形態に係る処理フローである。It is a processing flow which concerns on the 2nd Embodiment of this invention.

Claims (5)

抽象解釈を用いて、複数の変数あるいは複数の式からなり、常に真または偽と判定される条件文をプログラム内から検出するプログラム解析方法。   A program analysis method that uses an abstract interpretation to detect a conditional statement consisting of a plurality of variables or a plurality of expressions and always determined to be true or false from the program. プログラム内に、複数の変数を含む条件文が与えられているときに、
用いられている最大の係数あるいは最大の法を選択して、その値をpとする第1のステップと、
条件文に用いられている複数の変数に対して、それぞれの変数の値を0からp−1の値に設定する第2のステップと、
設定したすべての値について、mod_pにおける条件文が常に真もしくは偽となるか否かを判断する第3のステップと、
を備えたことを特徴とするプログラム解析方法。
When a conditional statement containing multiple variables is given in the program,
Selecting the largest coefficient or the largest method used and setting its value to p;
A second step of setting a value of each variable from 0 to p−1 for a plurality of variables used in the conditional statement;
A third step for determining whether the conditional statement in mod_p is always true or false for all set values;
A program analysis method comprising:
プログラム内に、複数の式からなる条件文が与えられているときに、
用いられているすべての法の最小公倍数をpと設定する第1のステップと、
条件文に用いられている複数の変数に対して、それぞれの変数の値を0からp−1の値に設定する第2のステップと、
設定したすべての値について、mod_pにおける条件文が常に真もしくは偽となるか否かを判断する第3のステップと、
を備えたことを特徴とするプログラム解析方法。
When a conditional statement consisting of multiple expressions is given in the program,
A first step of setting the least common multiple of all moduli used as p;
A second step of setting a value of each variable from 0 to p−1 for a plurality of variables used in the conditional statement;
A third step for determining whether the conditional statement in mod_p is always true or false for all set values;
A program analysis method comprising:
プログラム内に、複数の変数を含む条件文が与えられているときに、
用いられている最大の係数あるいは最大の法を選択して、その値をpとする第1のステップと、
条件文に用いられている複数の変数に対して、それぞれの変数の値を0からp−1の値に設定する第2のステップと、
設定したすべての値について、mod_pにおける条件文が常に真もしくは偽となるか否かを判断する第3のステップと、
をコンピュータに実行させるためのプログラム。
When a conditional statement containing multiple variables is given in the program,
Selecting a maximum coefficient or maximum method used and setting its value to p;
A second step of setting a value of each variable from 0 to p-1 for a plurality of variables used in the conditional statement;
A third step for determining whether the conditional statement in mod_p is always true or false for all set values;
A program that causes a computer to execute.
プログラム内に、複数の式からなる条件文が与えられているときに、
用いられているすべての法の最小公倍数をpと設定する第1のステップと、
条件文に用いられている複数の変数に対して、それぞれの変数の値を0からp−1の値に設定する第2のステップと、
設定したすべての値について、mod_pにおける条件文が常に真もしくは偽となるか否かを判断する第3のステップと、
をコンピュータに実行させるためのプログラム。
When a conditional statement consisting of multiple expressions is given in the program,
A first step of setting the least common multiple of all moduli used as p;
A second step of setting a value of each variable from 0 to p−1 for a plurality of variables used in the conditional statement;
A third step for determining whether the conditional statement in mod_p is always true or false for all set values;
A program that causes a computer to execute.
JP2006282307A 2006-10-17 2006-10-17 Program analysis method and program Expired - Fee Related JP4917861B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006282307A JP4917861B2 (en) 2006-10-17 2006-10-17 Program analysis method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006282307A JP4917861B2 (en) 2006-10-17 2006-10-17 Program analysis method and program

Publications (2)

Publication Number Publication Date
JP2008102576A true JP2008102576A (en) 2008-05-01
JP4917861B2 JP4917861B2 (en) 2012-04-18

Family

ID=39436885

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006282307A Expired - Fee Related JP4917861B2 (en) 2006-10-17 2006-10-17 Program analysis method and program

Country Status (1)

Country Link
JP (1) JP4917861B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010072958A (en) * 2008-09-18 2010-04-02 Fuji Xerox Co Ltd Program obfuscation apparatus and obfuscation program

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
BR112017015309B1 (en) 2015-01-19 2021-08-17 Ebara Corporation DIFFUSER FOR A PUMP AND ULTRASOUND WELDING METHOD FOR MANUFACTURING THE SAME

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08272623A (en) * 1995-04-03 1996-10-18 Toshiba Corp Device and method for program analysis
JP2002514333A (en) * 1997-06-09 2002-05-14 インタートラスト テクノロジーズ コーポレイション Confusing technology to enhance software security
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
JP2006235688A (en) * 2005-02-22 2006-09-07 Kddi Corp Program obfuscation device and method and program thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08272623A (en) * 1995-04-03 1996-10-18 Toshiba Corp Device and method for program analysis
JP2002514333A (en) * 1997-06-09 2002-05-14 インタートラスト テクノロジーズ コーポレイション Confusing technology to enhance software security
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
JP2006235688A (en) * 2005-02-22 2006-09-07 Kddi Corp Program obfuscation device and method and program thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010072958A (en) * 2008-09-18 2010-04-02 Fuji Xerox Co Ltd Program obfuscation apparatus and obfuscation program

Also Published As

Publication number Publication date
JP4917861B2 (en) 2012-04-18

Similar Documents

Publication Publication Date Title
Yarom et al. Recovering OpenSSL ECDSA nonces using the FLUSH+ RELOAD cache side-channel attack
CN107040362B (en) Modular multiplication apparatus and method
CN101261666B (en) A method for realizing software copyright protection based on encrypted executable program file
JPWO2007126049A1 (en) Program obfuscation system, program obfuscation apparatus, and program obfuscation method
EP3287891B1 (en) Protection of a modular calculation
CN109462477B (en) White box encryption method based on Internet of things embedded equipment
Rebeiro et al. Timing channels in cryptography: a micro-architectural perspective
Tuveri et al. Side-channel analysis of SM2: A late-stage featurization case study
CN104463020B (en) The method of memory data integrity protection
US8553878B2 (en) Data transformation system using cyclic groups
JP4917861B2 (en) Program analysis method and program
US10572635B2 (en) Automatic correction of cryptographic application program interfaces
Gaspoz et al. Threshold implementations in software: Micro-architectural leakages in algorithms
EP2674892B1 (en) A method, a device and a computer program support for execution of encrypted computer code
JP5102536B2 (en) Stream cipher encryption apparatus, decryption apparatus, encryption method, decryption method, and program
CN104636276A (en) Method for protecting confidentiality and integrity of data in memory
JP6996561B2 (en) Systems, modifiers, methods and programs
Tillich et al. Implementation and evaluation of an SCA-resistant embedded processor
WO2016125205A1 (en) Cryptographic block identification device, cryptographic block identification method, and cryptographic block identification program
KR101625018B1 (en) Data encryption apparatus and method, computing device and communication device employing the same
Pereida Garcia Side-Channel Analysis and Cryptography Engineering: Getting OpenSSL Closer to Constant-Time
JP2013152382A (en) Storage device, preservation method of data, and program
JP5951260B2 (en) Logical operation device, logical operation method, and program
JP6012355B2 (en) Control device, control system, data storage method and program
He Highly secure cryptographic computations against side-channel attacks

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090708

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20111011

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20111025

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20111220

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

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

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

Free format text: PAYMENT UNTIL: 20150203

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