JP2004185064A - Device and method for making program difficult to read - Google Patents

Device and method for making program difficult to read Download PDF

Info

Publication number
JP2004185064A
JP2004185064A JP2002347826A JP2002347826A JP2004185064A JP 2004185064 A JP2004185064 A JP 2004185064A JP 2002347826 A JP2002347826 A JP 2002347826A JP 2002347826 A JP2002347826 A JP 2002347826A JP 2004185064 A JP2004185064 A JP 2004185064A
Authority
JP
Japan
Prior art keywords
program
obfuscation
input
converted
function
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.)
Pending
Application number
JP2002347826A
Other languages
Japanese (ja)
Inventor
Tomoyoshi Ito
智祥 伊藤
Takao Yamaguchi
孝雄 山口
Junichi Sato
潤一 佐藤
Ichiro Takei
一朗 武井
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2002347826A priority Critical patent/JP2004185064A/en
Publication of JP2004185064A publication Critical patent/JP2004185064A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To make a program which does not have restriction in generation of a conversion rule difficult to read without increasing a size of the program itself after a processing for making the program difficult to read. <P>SOLUTION: A program input part 101 reads the program. A difficult reading processing part 102 detects a repetitive control sentence included in the program. The difficult reading processing part 102 converts a content of the program so that an order of values inputted to index variables of the repetitive control sentence is changed, and it is outputted from a program output part 103. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、プログラムの難読化装置及び難読化方法に関する。
【0002】
【従来の技術】
プログラムには暗号化されたデータを復号するための復号化鍵や、その復号アルゴリズム自体など、ユーザに対して秘密にすべき情報(以下、「秘密情報」という)が含まれる場合がある。このような秘密情報は、秘密に管理されて初めて本来の機能を発揮するものであり、これがユーザに把握されてしまうのは好ましくない。
【0003】
しかしながら、プログラムは、通常、デバッガなどにより容易に動作解析が可能である。このため、プログラムに秘密情報が含まれている場合には、プログラムを解析することによって容易に秘密情報が盗み出されるという事態が生じ得る。
【0004】
たとえば、プログラムが自分自身のライセンス認証を行う場合においては、秘密情報としての認証ルーチンが解析され、この認証ルーチンを無効にするようにプログラムを改竄される場合がある。これにより、ライセンスを保有しない不正なユーザに当該プログラムが使用されてしまうという事態が生じる。
【0005】
したがって、プログラムに秘密情報を含む場合には、秘密情報の盗用や、プログラムの不正な改竄を防ぐにように何らかの形でプログラムを保護する必要がある。
【0006】
従来のプログラムを保護する技術の一つとして、プログラムの難読化がある。難読化とは、プログラムの仕様を変更せずにプログラムの解析を困難にすること、言い換えると、プログラムの仕様を理解することを困難にする技術である。
【0007】
プログラムの難読化方法として、例えば、ループを含むプログラムを、その仕様を変更せずに複雑にする方法が提案されている(例えば、非特許文献1参照)。より具体的には、ループ部分の制御構造を複雑化する方法及びループ部分の処理の順序を複雑化する方法が提案されている。
【0008】
【非特許文献1】
門田他、信学会論文誌, vol.J80−D−I, No.7, pp.644−652, July 1997“ループを含むプログラムを難読化する方法の提案”
【0009】
【発明が解決しようとする課題】
しかしながら、上述したようなプログラムを難読化する方法においては、制御構造を複雑化する方法ではプログラムのループ部分を複製して2つ以上に増やす処理が必要となり、難読化処理後のプログラム自体のサイズが大きくなってしまうという課題を有し、また、処理の順序を複雑化する方法では難読化処理を施した前後でそのプログラムの仕様の一致を確認することが容易でなく、難読化のための変換規則を多数作成することが困難であるという課題を有する。
【0010】
本発明は、かかる事情に鑑みて為されたものであり、難読化処理後のプログラム自体のサイズを大きくすることなく、変換規則の作成に制限のないプログラムの難読化装置及び難読化方法を提供することを目的とする。
【0011】
【課題を解決するための手段】
本発明は、プログラムに含まれる繰り返し制御文を検出し、当該繰り返し制御文のインデックス変数に入力される値の順番を変更するようにプログラムの内容を変換するようにしたものである。
【0012】
これにより、繰り返し制御文に含まれるインデックス変数に入力される値の順番を変更するようにしたので、変換前に比べてプログラムの解析を困難にすることができると共に、プログラムのループ部分を複製して2つ以上に増やす処理や難読化処理を施した前後でそのプログラムの仕様の一致を確認する処理を必要とせず、難読化処理後のプログラム自体のサイズを大きくすることなく、変換規則の作成に制限なくプログラムの難読化を実現することができる。
【0013】
【発明の実施の形態】
本発明の第1の態様に係るプログラムの難読化装置は、プログラムを読み込む入力手段と、前記プログラムに含まれる繰り返し制御文を検出すると当該繰り返し制御文のインデックス変数に入力される値の順番を変更するように前記プログラムの内容を変換する難読化手段と、前記難読化手段により変換したプログラムを出力する出力手段と、を具備する構成を採る。
【0014】
この構成によれば、繰り返し制御文に含まれるインデックス変数に入力される値の順番を変更するようにしたので、変換前に比べてプログラムの解析を困難にすることができる。
【0015】
特に、第1の態様に係る変換方式を用いてプログラムの内容を変換した場合には、インデックス変数に入力される値の順番が変更されるだけなので、プログラムのループ部分を複製して2つ以上に増やす処理や難読化処理を施した前後でそのプログラムの仕様の一致を確認する処理を必要とせず、難読化処理後のプログラム自体のサイズを大きくすることなく、変換規則の作成に制限なくプログラムの難読化を実現することができる。
【0016】
本発明の第2の態様は、第1の態様に係るプログラムの難読化装置において、前記難読化手段は、検出した前記繰り返し文のインデックス変数に入力される値を関数により生成し、前記インデックス変数を参照する部分を配列に変更し、当該配列に前記関数の逆関数により生成される値を入力するようにプログラムの内容を変換する構成を採る。
【0017】
この構成によれば、第1の態様に係る変換方式に加えて、検出した前記繰り返し文のインデックス変数に入力される値を関数により生成し、前記インデックス変数を参照する部分を配列に変更し、当該配列に前記関数の逆関数により生成される値を入力するようにプログラムの内容を変換するので、複数の変換方式でプログラムの内容を変換することができる。
【0018】
また、第2の態様に係る変換方式を用いてプログラムの内容を変換した場合には、解析者は、複数の工程を経なければプログラムの解析を行うことができない。このため、変換前のプログラムと比べて解析を困難にすることができる。
【0019】
特に、第2の態様に係る変換方式を用いてプログラムの内容を変換した場合には、インデックス変数に入力される値の規則性を排除し、インデックス変数に入力される値を複雑に変化させるようにしている。インデックス変数に入力される値を複雑に変化させるだけなので、プログラムのループ部分を複製して2つ以上に増やす処理や難読化処理を施した前後でそのプログラムの仕様の一致を確認する処理を必要としない。この結果、難読化処理後のプログラム自体のサイズを大きくすることなく、変換規則の作成に制限なくプログラムの難読化を実現することができる。
【0020】
本発明の第3の態様は、第2の態様に係るプログラムの難読化装置において、前記難読化手段は、プログラムの内容を変換する際、第1の態様に係る変換方式と第2の態様に係る変換方式をランダムに選択して変換する構成を採る。
【0021】
この構成によれば、第1の態様に係る変換方式と第2の態様に係る変換方式を用いてランダムにプログラムの内容が変換される。このため、プログラムを解析しようとする場合には、複数の変換方式を解明しなければ、プログラムの解析を行うことができない。この結果、プログラムの解析をより困難にすることができる。
【0022】
本発明の第4の態様に係るプログラムの難読化装置は、プログラムを読み込む入力手段と、前記プログラムに含まれる繰り返し制御文を検出すると当該繰り返し文のインデックス変数に入力される値を関数により生成し、前記インデックス変数を参照する部分を配列に変更し、当該配列に前記関数の逆関数により生成される値を入力するようにプログラムの内容を変換する難読化手段と、前記難読化手段により変換したプログラムを出力する出力手段と、を具備する構成を採る。
【0023】
この構成によれば、繰り返し制御文に含まれるインデックス変数に入力される値を複雑に変化させるようにしたので、変換前に比べてプログラムの解析を困難にすることができる。
【0024】
特に、第4の態様に係る変換方式を用いてプログラムの内容を変換した場合には、インデックス変数に入力される値を複雑に変化させるだけなので、プログラムのループ部分を複製して2つ以上に増やす処理や難読化処理を施した前後でそのプログラムの仕様の一致を確認する処理を必要としない。この結果、難読化処理後のプログラム自体のサイズを大きくすることなく、変換規則の作成に制限なくプログラムの難読化を実現することができる。
【0025】
本発明の第5の態様に係るプログラムの難読化方法は、プログラムを読み込むステップと、前記プログラムに含まれる繰り返し制御文を検出するステップと、当該繰り返し制御文のインデックス変数に入力される値の順番を変更するように前記プログラムの内容を変換するステップと、前記変換されたプログラムを出力するステップと、を具備するものである。
【0026】
本発明の第6の態様は、第5の態様に係るプログラムの難読化方法において、前記プログラムの内容を変換する際、検出した前記繰り返し文のインデックス変数に入力される値を関数により生成し、前記インデックス変数を参照する部分を配列に変更し、当該配列に前記関数の逆関数により生成される値を入力するようにプログラムの内容を変換するものである。
【0027】
本発明の第7の態様は、第6の態様に係るプログラムの難読化方法において、前記プログラムの内容を変換する際、第5の態様に係る変換方式と第6の態様に係る変換方式をランダムに選択して変換するものである。
【0028】
本発明の第8の態様に係るプログラムの難読化方法は、プログラムを読み込むステップと、前記プログラムに含まれる繰り返し制御文を検出するステップと、当該繰り返し文のインデックス変数に入力される値を関数により生成し、前記インデックス変数を参照する部分を配列に変更し、当該配列に前記関数の逆関数により生成される値を入力するようにプログラムの内容を変換するステップと、前記変換されたプログラムを出力するステップと、を具備するものである。
【0029】
本発明の第9の態様は、コンピュータを、プログラムを読み込む入力手段と、前記プログラムに含まれる繰り返し制御文を検出すると当該繰り返し制御文のインデックス変数に入力される値の順番を変更するように前記プログラムの内容を変換する難読化手段と、前記難読化手段により変換したプログラムを出力する出力手段として機能させるためのプログラムを記録したコンピュータ読み取り可能な記録媒体である。
【0030】
本発明の第10の態様は、コンピュータを、プログラムを読み込む入力手段と、前記プログラムに含まれる繰り返し制御文を検出すると当該繰り返し制御文のインデックス変数に入力される値の順番を変更するように前記プログラムの内容を変換する難読化手段と、前記難読化手段により変換したプログラムを出力する出力手段として機能させるためのプログラムである。
【0031】
以下、本発明の一実施の形態に係る難読化装置及び難読化方法について、図を用いて説明する。
【0032】
本発明の一実施の形態に係るプログラムの難読化装置及び難読化方法は、プログラムに含まれる繰り返し制御文におけるインデックス変数の値の規則性がプログラムの解析を容易にしている点に着目し、インデックス変数に入力される値の順番を変更させ、あるいは、複雑に変化させるようにプログラムを改変するものである。
【0033】
図1は、本発明の一実施の形態に係るプログラムの難読化装置100の構成を示すブロック図である。
【0034】
本難読化装置100は、例えば、CD−ROM等の記録媒体に記録するプログラムを難読化する場合に用いられる。本難読化装置100におけるプログラムに対する難読化は、例えば、記録媒体に記録されたプログラムを読み出して難読化を行った後に再び記録媒体に書き込むことが考えられる。しかし、これに限定されず、完成したプログラムに対して難読化を行った後にこの難読化したプログラムを複製して記録媒体に記録する等、様々な態様でプログラムを難読化することが可能である。本実施の形態においては、記録媒体に記録されたプログラムを読み出して難読化を行った後に再び記録媒体に書き込む場合について説明する。
【0035】
図1に示す難読化装置100において、プログラム入力部101は、難読化を行う対象となるプログラムを入力する部分である。具体的にはCD−ROM等の記録媒体に記録されたプログラムを読み込む部分である。
【0036】
難読化処理部102は、入力されたプログラムの難読化を行う部分である。難読化を行う際、難読化処理部102は、本難読化装置100の操作者により予め設定されたプログラムの変換規則パターンやこの変換規則パターンに適用する各種パラメータを用いて難読化を行う。
【0037】
プログラム出力部103は、難読化が行われたプログラムを出力する部分である。具体的には、CD−ROM等の記録媒体に難読化が行われたプログラムを記録する部分である。
【0038】
パラメータ設定部104は、本難読化装置100の操作者が上述の変換規則パターン等を設定する部分である。操作者により設定された各種パラメータ等は、パラメータ設定部104に保存され、難読化処理部102により参照される。
【0039】
図2は、パラメータ設定部104に保存される変換規則パターンの一例を示す図である。図2においては、3つの変換規則パターンが保存された場合について示している。なお、図2においては、C言語で記述されたプログラムについて開示しているが、これに限定されず、JAVA(登録商標)等により記述された、繰り返し制御文を含むプログラムについても適用することが可能である。
【0040】
各変換規則パターンは、同図に示すように、“番号201:[(変換適用パターン)]202−>[(変換適用後パターン)]203:(適用条件)204”で構成される。
【0041】
ここで、番号201は、変換規則パターンを一意に決定するための識別子である。以下、番号201が「01」の変換規則パターンを変換規則パターン01と呼ぶものとする。番号201が「02」や「03」の変換規則パターンも同様とする。
【0042】
変換適用パターン202は、各変換規則パターンを適用可能なfor文を検出するためのパターンである。なお、変換適用パターン202において、”#”が先頭に付与された変数は、変換対象のプログラム中で使われる変数が、変換適用パターン202と一致していなくてもよいことを表すワイルドカードである。また、”FUNCTION()”は、for文中の全ての命令を現すワイルドカードである。
【0043】
変換適用後パターン203は、変換適用パターン202によりマッチングしたfor文をどのように変換するかを示すものである。なお、先頭に”#”が付与された変数は、変換適用パターン202によりマッチングしたワイルドカード部分に対応する変数を適用することを示す。変換適用後パターン203において、”$”が先頭に付与された変数には、操作者により設定されたパラメータが入力される。
【0044】
適用条件204は、上記変換規則パターンを適用する条件を示すものである。適用条件204が記述されていない場合には、変換適用パターン202が一致する全てのプログラムに適用可能であることを示す。一方、適用条件204が記述されている場合には、変換適用パターン202が一致するプログラムのうち、適用条件204にマッチする場合にのみ当該変換規則パターンを適用することを示す。
【0045】
例えば、図2に示す変換規則パターン01では、for文中で出力、分岐が発生しないことが条件であることを”NON_OUTPUT”という表現で示している。なお、変換規則パターン02及び03では、適用条件204がないため、変換適用パターン202が一致する全てのプログラムに適用可能であることを示している。
【0046】
以下、図2に示した変換規則パターンを具体的に説明する。
【0047】
変換規則パターン01は、プログラムに含まれるfor文が、
for(#i=0;#i<#VAL;#i++)
にマッチングする場合に、そのプログラムを難読化するものである。すなわち、図2に示す変換適用パターン202Aとマッチングする場合に難読化を行う。
【0048】
変換規則パターン01により難読化されるプログラムを具体的に説明する。以下のプログラムAは、変換規則パターン01により難読化されるプログラムの一例を示している。

Figure 2004185064
【0049】
このプログラムAは、0以上10未満の整数の和を出力するプログラムである。このプログラムAにおいては、iが0,1,2,・・・9と規則的に変化するため、インデックス変数に1から10の値が1回ずつ入力されることが一見して判定でき、プログラムの解析が容易となってしまう。
【0050】
本難読化装置100では、このようなプログラムAを検出すると、変換規則パターン01を適用することで難読化を行う。プログラムBは、変換規則パターン01により難読化した場合のプログラムの一例を示している。
Figure 2004185064
【0051】
このプログラムBにおいては、インデックス変数に入力される値は、7→4→1→8→5→2→9→6→3→0となる。このように変換規則パターン01では、for文中でインデックス変数のとる値の順番を入れ替えてもその仕様に影響を与えない場合、for文を、
Figure 2004185064
と変換する。
【0052】
ここで、Cinitは適当な初期値を表し、f(Cinit)はCinitに関数f(i)をN回適用することを表す。なお、この場合において、f(i)の満たすべき性質は、f(i)に0〜N−1までの数が1回ずつ表れるということである。プログラムBにおいては、f(i)=(i+b)%Nであり、Cinit=b(上述の例ではb=7)としている。
【0053】
なお、プログラムBのfor文中では、インデックス変数に入力される値の順番がプログラムAとは異なるが、for文中には出力がないため、プログラムの仕様に影響を与えることはない。
【0054】
このように変換規則パターン01によりプログラムAをプログラムBに変換した場合、iに1以上10未満の整数が1回ずつ現れることは、一見して判定しにくく、プログラムAと比べて解析が困難になるという効果を得ることができる。
【0055】
特に、変換規則パターン01では、プログラムに含まれる繰り返し制御文を検出し、当該繰り返し制御文のインデックス変数に入力される値の順番を変更するようにしている。より具体的には、インデックス変数に入力される値の規則性を排除し、不規則的にインデックス変数に入力される値を変化させるようにしている。インデックス変数に入力される値を変化させるだけなので、プログラムのループ部分を複製して2つ以上に増やす処理や難読化処理を施した前後でそのプログラムの仕様の一致を確認する処理を必要としない。この結果、難読化処理後のプログラム自体のサイズを大きくすることなく、変換規則の作成に制限なくプログラムの難読化を実現することができる。
【0056】
また、変換規則パターン02は、プログラムに含まれるfor文が、
for(I=0;I<N;I++){FUNCTION(I);}・・・(プログラムC)
にマッチングする場合に、そのプログラムを難読化するものである。すなわち、図2に示す変換適用パターン202Bとマッチングする場合に難読化を行う。
【0057】
このプログラムCは、for文の一般的な形式である。プログラムCにおいて、FUNCTION(I)の引数Iは規則的に変化する。プログラムAの例でも見たように、インデックス変数の変化が規則的な場合、プログラムの解析が容易になってしまう。
【0058】
変換規則パターン02による難読化は、以下の変換方式に基づいている。本難読化装置100においては、プログラムCを、
Figure 2004185064
と変換することで、プログラムCの仕様を変化させずに、インデックス変数を複雑化する。
【0059】
ここで、f−1(i)は、f(i)の逆関数を表している。この変換は、f−1(f(i))=iとなる性質を利用したものであり、予めp[i]にf−1(i)を代入することで、p[idx]=p[f(i)]=f−1(f(i))=iが出現するようにするものである。変換規則パターン02では、f(i)=2*i+1とした場合の一例を示している。しかし、これに限定されず、逆関数を有するいかなる関数も適用することができる。
【0060】
変換規則パターン02を適用した場合、プログラムCは、プログラムDに変換される。プログラムDは、変換規則パターン02により難読化した場合のプログラムの例を示す。
Figure 2004185064
【0061】
プログラムDにおいては、p[I]のとる値は、−0.5→0→0.5→1→1.5→2→2.5→3→・・・となり、idxのとる値は、1→3→5→7…となる。したがって、FUNCTION(p[idx])に引数として渡される値は、0→1→2→3→・・・となり、難読化前とインデックス変数に入力される値の順番が変化しておらず、仕様を変更していないことが分かる。
【0062】
このように変換規則パターン02によりプログラムCをプログラムDに変換した場合、プログラムの解析者は、まず、p[I]に対してどのような値が入力されるかを調べ、かつ、idxがどのように変化するかを調べ、その結果からFUNCTION()の引数として、どのような値が与えられるかを調べるという手順をふまなければプログラムの解析ができない。このため、難読化前のプログラムCと比べて解析が困難になるという効果を得ることができる。
【0063】
特に、変換規則パターン02では、インデックス変数に入力される値の規則性を排除し、インデックス変数に入力される値を複雑に変化させるようにしている。インデックス変数に入力される値を複雑に変化させるだけなので、プログラムのループ部分を複製して2つ以上に増やす処理や難読化処理を施した前後でそのプログラムの仕様の一致を確認する処理を必要としない。この結果、難読化処理後のプログラム自体のサイズを大きくすることなく、変換規則の作成に制限なくプログラムの難読化を実現することができる。
【0064】
さらに、変換規則パターン03は、変換規則パターン02と同様に、プログラムに含まれるfor文が、
for(I=0;I<N;I++){FUNCTION(I);}・・・(プログラムC)
にマッチングする場合に、そのプログラムを難読化するものである。すなわち、図2に示す変換適用パターン202Cとマッチングする場合に難読化を行う。
【0065】
変換規則パターン03による難読化は、以下の変換方式に基づいている。本難読化装置100においては、プログラムCを、
Figure 2004185064
と変換することで、プログラムCの仕様を変化させずに、インデックス変数を複雑化する。
【0066】
ここで、F(N)は、f(idx)を漸化式とみなしたときの一般式である。変換規則パターン03では、f(n)=a*n+b(a=2、b=1)とした場合の一例を示している。しかし、これに限定されず、一般式を導出可能であり、その一般式が逆関数を有するいかなる漸化式も適用することができる。
【0067】
このf(n)=a*n+bについて具体的に検討すると、
F(n)=(1−a)/(1−a)*b
(n!=0のとき)
−1(n)=1/log(a)*log(1−(1−a)/b*n)
(n=0のとき)
−1(n)=0
となり、プログラムは、以下のプログラムEに変換される。
Figure 2004185064
【0068】
ここで、上述のプログラムをa=2,b=1で計算すると、p[I]のとる値は、0→1→1.5850→2→2.3219→2.5850→2.8074→3→3.1699→3.3219→…となり、idxのとる値は、0→1→3→7→…となる。したがって、p[idx]のとる値は、1→2→3→…→N−1となり、変換前のプログラムと同じ順番で、同じ値がFUNCTION()関数の引数として渡されることが分かる。
【0069】
このように変換規則パターン03によりプログラムCをプログラムEに変換した場合、プログラムの解析者は、まず、p[I]に対してどのような値が入力されるかを調べ、かつ、idxがどのように変化するかを調べ、その結果からFUNCTION()の引数として、どのような値が与えられるかを調べるという手順をふまなければプログラムの解析ができない。このため、難読化前のプログラムCと比べて解析が困難になるという効果を得ることができる。
【0070】
特に、変換規則パターン03では、インデックス変数に入力される値の規則性を排除し、インデックス変数に入力される値を複雑に変化させるようにしている。インデックス変数に入力される値を複雑に変化させるだけなので、プログラムのループ部分を複製して2つ以上に増やす処理や難読化処理を施した前後でそのプログラムの仕様の一致を確認する処理を必要としない。この結果、難読化処理後のプログラム自体のサイズを大きくすることなく、変換規則の作成に制限なくプログラムの難読化を実現することができる。
【0071】
次に、このような変換規則パターンを用いた難読化処理部102の動作について説明する。図3は、本実施の形態に係る難読化装置100における難読化処理部102の動作を説明するためのフロー図である。
【0072】
プログラム入力部101から難読化を行う対象となるプログラムを受け取ると、難読化処理部102は、そのプログラム中の変換適用パターンに一致する箇所を検索する(ST301)。すなわち、入力されたプログラムに含まれるfor文が変換適用パターン202と一致する箇所を検索する。
【0073】
変換適用パターンが一致する箇所を検索した後、難読化処理部102は、当該変換規則パターンを適用できるかを判断する。具体的には、適用条件204が一致するものがあるかを判断することで、当該変換規則パターンを適用できるかを判断する(ST302)。
【0074】
変換規則パターンを適用できる場合、すなわち、適用条件204が一致するものがある場合には、当該変換規則パターンに応じてプログラムの変換を行う(ST303)。
【0075】
なお、適用可能な変換規則パターンが複数存在する場合には、適用可能な変換規則パターンのいずれか1つをランダムに選択して変換する。
【0076】
このように複数の変換規則パターンのいずれか1つをランダムに選択してプログラムの内容が変換される。このため、プログラムを解析しようとする場合には、複数の変換規則パターンを解明しなければ、プログラムの解析を行うことができない。この結果、プログラムの解析をより困難にすることができる。
【0077】
当該箇所のプログラムを変換した後、難読化処理部102は、対象となるプログラム全体を変換したかを判断する(ST304)。ここで、プログラム全体を変換していない場合には処理をST301に戻し、ST301〜ST304の処理を繰り返す。一方、プログラム全体を変換し終えた場合には、プログラムの難読化処理を終了する。
【0078】
このように本実施の形態の難読化装置100によれば、プログラムの仕様を変化することなく、プログラムに含まれるfor文のインデックス変数の変化が複雑になるようプログラムを変換する。これにより、インデックス変数の変化が容易に理解されるのを防止することができるので、プログラムの解析を困難にすることができるという効果を有する。
【0079】
特に、本実施の形態の難読化装置100によれば、インデックス変数に入力される値の規則性を排除し、インデックス変数に入力される値の順番を変更、あるいは、インデックス変数に入力される値を複雑に変化させる。このため、プログラムのループ部分を複製して2つ以上に増やす処理や難読化処理を施した前後でそのプログラムの仕様の一致を確認する処理を必要としないので、難読化処理後のプログラム自体のサイズを大きくすることなく、変換規則の作成に制限のないプログラムの難読化装置及び難読化方法を提供することができる。
【0080】
なお、本実施の形態では、繰り返し制御文としてfor文を例にして説明している。しかし、繰り返し制御文としては、これに限定されず、while文などにも適用することができる。
【0081】
【発明の効果】
以上説明したように本発明によれば、難読化処理後のプログラム自体のサイズを大きくすることなく、変換規則の作成に制限のないプログラムの難読化装置及び難読化方法を提供することが可能となる。
【図面の簡単な説明】
【図1】本発明の一実施の形態に係るプログラムの難読化装置の構成を示すブロック図
【図2】上記実施の形態に係る難読化装置におけるパラメータ設定部に保存される変換規則パターンの一例を示す図
【図3】上記実施の形態に係る難読化装置における難読化処理部の動作を説明するためのフロー図
【符号の説明】
101 プログラム入力部
102 難読化処理部
103 プログラム出力部
104 パラメータ設定部[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a program obfuscation apparatus and an obfuscation method.
[0002]
[Prior art]
The program may include information to be kept secret from the user (hereinafter, referred to as “secret information”), such as a decryption key for decrypting the encrypted data and the decryption algorithm itself. Such confidential information exhibits its original function only when managed confidentially, and it is not preferable that the confidential information is recognized by the user.
[0003]
However, the operation of a program can usually be easily analyzed by a debugger or the like. For this reason, when secret information is included in the program, a situation may occur in which the secret information is easily stolen by analyzing the program.
[0004]
For example, when a program performs its own license authentication, an authentication routine as confidential information may be analyzed and the program may be tampered with to invalidate the authentication routine. As a result, a situation arises in which the program is used by an unauthorized user who does not have a license.
[0005]
Therefore, when secret information is included in a program, it is necessary to protect the program in some way to prevent plagiarism of the secret information and unauthorized alteration of the program.
[0006]
One of the conventional techniques for protecting a program is program obfuscation. Obfuscation is a technique that makes it difficult to analyze a program without changing the program specifications, in other words, it is difficult to understand the program specifications.
[0007]
As a program obfuscation method, for example, a method of complicating a program including a loop without changing its specification has been proposed (for example, see Non-Patent Document 1). More specifically, a method for complicating the control structure of the loop portion and a method for complicating the order of processing of the loop portion have been proposed.
[0008]
[Non-patent document 1]
Kadota et al., IEICE Transactions, vol. J80-DI, No. 7, pp. 644-652, July 1997 "A Proposal of a Method for Obfuscating Programs Containing Loops"
[0009]
[Problems to be solved by the invention]
However, in the method of obfuscating a program as described above, the method of complicating the control structure requires a process of duplicating a loop portion of the program and increasing the number of loops to two or more, and the size of the program itself after the obfuscation process is performed. In addition, the method of complicating the order of processing makes it difficult to confirm that the program specifications match before and after performing the obfuscation processing. There is a problem that it is difficult to create many conversion rules.
[0010]
The present invention has been made in view of such circumstances, and provides a program obfuscation apparatus and an obfuscation method for a program that does not limit the creation of conversion rules without increasing the size of the program itself after obfuscation processing. The purpose is to do.
[0011]
[Means for Solving the Problems]
The present invention detects a repetition control statement included in a program and converts the contents of the program so as to change the order of values input to index variables of the repetition control statement.
[0012]
As a result, the order of the values input to the index variables included in the repetition control statement is changed, so that it is possible to make the analysis of the program more difficult than before conversion and to copy the loop part of the program. Creation of conversion rules without increasing the size of the program itself to two or more, or checking the matching of the program specifications before and after the obfuscation processing is performed, and without increasing the size of the program itself after the obfuscation processing Obfuscation of a program can be realized without limitation.
[0013]
BEST MODE FOR CARRYING OUT THE INVENTION
The program obfuscation device according to the first aspect of the present invention includes an input unit that reads a program, and changes an order of values input to an index variable of the repetition control statement when detecting a repetition control statement included in the program. And an output means for outputting the program converted by the obfuscation means.
[0014]
According to this configuration, the order of the values input to the index variables included in the repetition control statement is changed, so that it is possible to make the analysis of the program more difficult than before conversion.
[0015]
In particular, when the contents of the program are converted using the conversion method according to the first embodiment, the order of the values input to the index variables is merely changed, so that the loop portion of the program is duplicated and two or more No need to increase the number of processes or to check the matching of the program specifications before and after the obfuscation process, without increasing the size of the program itself after the obfuscation process, and without restrictions on creating conversion rules Obfuscation can be realized.
[0016]
According to a second aspect of the present invention, in the program obfuscation device according to the first aspect, the obfuscation unit generates a value input to an index variable of the detected repetition sentence by a function, Is changed to an array, and the contents of the program are converted so that a value generated by an inverse function of the function is input to the array.
[0017]
According to this configuration, in addition to the conversion method according to the first aspect, a value input to the detected index variable of the repetition sentence is generated by a function, and a portion that refers to the index variable is changed to an array. Since the contents of the program are converted so that the value generated by the inverse function of the function is input to the array, the contents of the program can be converted by a plurality of conversion methods.
[0018]
Further, when the contents of the program are converted using the conversion method according to the second aspect, the analyst cannot analyze the program without going through a plurality of steps. For this reason, the analysis can be made more difficult than in the program before the conversion.
[0019]
In particular, when the content of the program is converted using the conversion method according to the second aspect, the regularity of the value input to the index variable is eliminated, and the value input to the index variable is changed in a complicated manner. I have to. Since it only changes the value input to the index variable in a complicated manner, it is necessary to duplicate the loop part of the program and increase it to two or more, or to confirm the conformity of the program specifications before and after performing the obfuscation processing And not. As a result, the obfuscation of the program can be realized without increasing the size of the program itself after the obfuscation processing and without limitation in creating the conversion rules.
[0020]
According to a third aspect of the present invention, in the program obfuscation device according to the second aspect, the obfuscation unit is configured to convert the content of the program into the conversion method according to the first aspect and the second aspect. A configuration in which the conversion method is selected at random and converted is adopted.
[0021]
According to this configuration, the contents of the program are randomly converted using the conversion method according to the first aspect and the conversion method according to the second aspect. For this reason, when trying to analyze a program, the program cannot be analyzed unless a plurality of conversion methods are clarified. As a result, analysis of the program can be made more difficult.
[0022]
According to a fourth aspect of the present invention, there is provided a program obfuscation device configured to: input means for reading a program; and generate a value input to an index variable of the repetition statement by a function when detecting a repetition control statement included in the program. The obfuscation means for changing the part referring to the index variable to an array, and converting the contents of the program so as to input the value generated by the inverse function of the function into the array, and the obfuscation means Output means for outputting a program.
[0023]
According to this configuration, since the value input to the index variable included in the repetition control statement is changed in a complicated manner, it is possible to make program analysis more difficult than before conversion.
[0024]
In particular, when the content of the program is converted using the conversion method according to the fourth aspect, the value input to the index variable is simply changed in a complicated manner. There is no need to perform a process of confirming the matching of the program specifications before and after the increase process or the obfuscation process is performed. As a result, the obfuscation of the program can be realized without increasing the size of the program itself after the obfuscation processing and without limitation in creating the conversion rules.
[0025]
A program obfuscation method according to a fifth aspect of the present invention includes the steps of: reading a program; detecting a repetition control statement included in the program; and an order of values input to an index variable of the repetition control statement. Converting the contents of the program so as to change the program, and outputting the converted program.
[0026]
According to a sixth aspect of the present invention, in the program obfuscation method according to the fifth aspect, when converting the content of the program, a value input to the detected index variable of the repeated statement is generated by a function, A part that refers to the index variable is changed to an array, and the contents of the program are converted so that a value generated by an inverse function of the function is input to the array.
[0027]
According to a seventh aspect of the present invention, in the program obfuscation method according to the sixth aspect, when converting the content of the program, the conversion method according to the fifth aspect and the conversion method according to the sixth aspect are randomly selected. To convert.
[0028]
According to an eighth aspect of the present invention, there is provided a program obfuscation method, comprising: a step of reading a program; a step of detecting a repetition control statement included in the program; Generating and changing a portion that refers to the index variable to an array, and converting the contents of the program so that a value generated by an inverse function of the function is input to the array; and outputting the converted program. And the step of performing.
[0029]
A ninth aspect of the present invention is directed to the ninth aspect, wherein the computer is configured to: input means for reading a program, and change an order of values input to an index variable of the repetition control statement when detecting a repetition control statement included in the program. An obfuscation unit for converting the contents of the program and a computer-readable recording medium on which a program for functioning as an output unit for outputting the program converted by the obfuscation unit is recorded.
[0030]
A tenth aspect of the present invention is a computer program, comprising: input means for reading a program; and, when detecting a repetition control statement included in the program, changing a sequence of values input to an index variable of the repetition control statement. An obfuscation unit for converting the contents of the program and a program for functioning as an output unit for outputting the program converted by the obfuscation unit.
[0031]
Hereinafter, an obfuscation apparatus and an obfuscation method according to an embodiment of the present invention will be described with reference to the drawings.
[0032]
A program obfuscation apparatus and an obfuscation method according to an embodiment of the present invention focus on the fact that the regularity of the value of an index variable in a repetition control statement included in the program facilitates analysis of the program. The program is modified so that the order of the values input to the variables is changed, or is changed in a complicated manner.
[0033]
FIG. 1 is a block diagram showing a configuration of a program obfuscation apparatus 100 according to one embodiment of the present invention.
[0034]
The obfuscation apparatus 100 is used, for example, when obfuscating a program recorded on a recording medium such as a CD-ROM. The obfuscation of the program in the obfuscation apparatus 100 may be, for example, reading a program recorded on a recording medium, obfuscating the program, and then writing the program again on the recording medium. However, the present invention is not limited to this, and it is possible to obfuscate the program in various modes, for example, after obfuscating the completed program, copying the obfuscated program and recording it on a recording medium. . In the present embodiment, a case will be described in which a program recorded on a recording medium is read out, obfuscated, and then rewritten on the recording medium.
[0035]
In the obfuscation apparatus 100 shown in FIG. 1, the program input unit 101 is a part for inputting a program to be obfuscated. Specifically, it is a portion for reading a program recorded on a recording medium such as a CD-ROM.
[0036]
The obfuscation processing unit 102 is a part that obfuscates an input program. When performing the obfuscation, the obfuscation processing unit 102 performs obfuscation using a conversion rule pattern of a program preset by an operator of the obfuscation apparatus 100 and various parameters applied to the conversion rule pattern.
[0037]
The program output unit 103 is a unit that outputs the obfuscated program. Specifically, it is a part for recording the obfuscated program on a recording medium such as a CD-ROM.
[0038]
The parameter setting unit 104 is a part where the operator of the obfuscation apparatus 100 sets the above-described conversion rule pattern and the like. Various parameters and the like set by the operator are stored in the parameter setting unit 104 and are referred to by the obfuscation processing unit 102.
[0039]
FIG. 2 is a diagram illustrating an example of the conversion rule pattern stored in the parameter setting unit 104. FIG. 2 shows a case where three conversion rule patterns are stored. Although FIG. 2 discloses a program described in C language, the present invention is not limited to this, and may be applied to a program described in JAVA (registered trademark) or the like and containing a repetition control statement. It is possible.
[0040]
As shown in the figure, each conversion rule pattern is composed of “No. 201: [(conversion application pattern)] 202 → [(conversion application pattern)] 203: (application condition) 204”.
[0041]
Here, the number 201 is an identifier for uniquely determining the conversion rule pattern. Hereinafter, the conversion rule pattern whose number 201 is “01” is referred to as a conversion rule pattern 01. The same applies to the conversion rule pattern with the number 201 of “02” or “03”.
[0042]
The conversion application pattern 202 is a pattern for detecting a for sentence to which each conversion rule pattern can be applied. In the conversion application pattern 202, a variable prefixed with “#” is a wildcard indicating that the variable used in the conversion target program does not need to match the conversion application pattern 202. . “FUNCTION ()” is a wild card representing all instructions in the for statement.
[0043]
The post-conversion application pattern 203 indicates how to convert a for sentence matched by the conversion application pattern 202. A variable prefixed with “#” indicates that a variable corresponding to a wildcard portion matched by the conversion application pattern 202 is applied. In the post-conversion application pattern 203, parameters set by the operator are input to variables prefixed with “$”.
[0044]
The application condition 204 indicates a condition for applying the conversion rule pattern. When the application condition 204 is not described, it indicates that the conversion application pattern 202 is applicable to all the matching programs. On the other hand, when the application condition 204 is described, it indicates that the conversion rule pattern is applied only when the conversion application pattern 202 matches the application condition 204 among the programs that match.
[0045]
For example, in the conversion rule pattern 01 shown in FIG. 2, the expression "NON_OUTPUT" indicates that the condition is that no output or branch occurs in the for statement. Note that the conversion rule patterns 02 and 03 do not have the application condition 204, and thus indicate that the conversion application pattern 202 can be applied to all programs that match.
[0046]
Hereinafter, the conversion rule pattern shown in FIG. 2 will be specifically described.
[0047]
The conversion rule pattern 01 is such that the for statement included in the program is
for (# i = 0; #i <#VAL;# i ++)
If it matches, then the program is obfuscated. That is, obfuscation is performed when matching with the conversion application pattern 202A shown in FIG.
[0048]
A program obfuscated by the conversion rule pattern 01 will be specifically described. The following program A is an example of a program obfuscated by the conversion rule pattern 01.
Figure 2004185064
[0049]
This program A is a program that outputs a sum of integers from 0 to less than 10. In this program A, since i regularly changes to 0, 1, 2,..., 9, it can be determined at a glance that values 1 to 10 are input to the index variable once. Analysis becomes easy.
[0050]
Upon detecting such a program A, the obfuscation apparatus 100 performs obfuscation by applying the conversion rule pattern 01. Program B shows an example of a program when obfuscation is performed by the conversion rule pattern 01.
Figure 2004185064
[0051]
In this program B, the values input to the index variables are 7 → 4 → 1 → 8 → 5 → 2 → 9 → 6 → 3 → 0. As described above, in the conversion rule pattern 01, when the specification of the index variable is not affected even if the order of the values taken by the index variables in the for statement is changed,
Figure 2004185064
And convert.
[0052]
Where C init Represents a suitable initial value, and f N (C init ) Is C init Means that the function f (i) is applied N times. In this case, the property to be satisfied by f (i) is that the number from 0 to N-1 appears once in f (i). In program B, f (i) = (i + b)% N and C init = B (b = 7 in the above example).
[0053]
In the for statement of the program B, the order of the values input to the index variables is different from that of the program A, but since there is no output in the for statement, the specification of the program is not affected.
[0054]
When the program A is converted into the program B according to the conversion rule pattern 01, it is difficult to judge at a glance that an integer of 1 or more and less than 10 appears in i at a glance, and it is difficult to analyze as compared with the program A. Can be obtained.
[0055]
In particular, in the conversion rule pattern 01, a repetition control statement included in the program is detected, and the order of the values input to the index variables of the repetition control statement is changed. More specifically, the regularity of the value input to the index variable is eliminated, and the value input to the index variable is changed irregularly. Since only the value input to the index variable is changed, there is no need to duplicate the loop part of the program and increase it to two or more, or to check the specifications of the program before and after the obfuscation processing is performed. . As a result, the obfuscation of the program can be realized without increasing the size of the program itself after the obfuscation processing and without limitation in creating the conversion rules.
[0056]
Further, the conversion rule pattern 02 is such that the for statement included in the program is
for (I = 0; I <N; I ++) {FUNCTION (I);} (program C)
If it matches, then the program is obfuscated. That is, obfuscation is performed when matching with the conversion application pattern 202B shown in FIG.
[0057]
The program C has a general form of a for statement. In the program C, the argument I of FUNCTION (I) changes regularly. As seen from the example of the program A, when the change of the index variable is regular, the analysis of the program becomes easy.
[0058]
Obfuscation by the conversion rule pattern 02 is based on the following conversion method. In the obfuscator 100, the program C
Figure 2004185064
By doing so, the index variable is complicated without changing the specification of the program C.
[0059]
Where f -1 (I) represents the inverse function of f (i). This transformation is f -1 (F (i)) = i is used, and p [i] -1 By substituting (i), p [idx] = p [f (i)] = f -1 (F (i)) = i appears. The conversion rule pattern 02 shows an example where f (i) = 2 * i + 1. However, the present invention is not limited to this, and any function having an inverse function can be applied.
[0060]
When the conversion rule pattern 02 is applied, the program C is converted into the program D. The program D shows an example of a program when obfuscation is performed by the conversion rule pattern 02.
Figure 2004185064
[0061]
In program D, the value of p [I] is −0.5 → 0 → 0.5 → 1 → 1.5 → 2 → 2.5 → 3 →..., And the value of idx is 1 → 3 → 5 → 7 ... Therefore, the values passed as arguments to FUNCTION (p [idx]) are 0 → 1 → 2 → 3 →..., And the order of the values input to the index variables before obfuscation has not changed. You can see that the specifications have not been changed.
[0062]
When the program C is converted into the program D by the conversion rule pattern 02 in this way, the program analyzer first checks what value is input to p [I] and determines which idx is Program analysis cannot be performed unless a procedure of examining how the values are changed and examining what value is given as an argument of FUNCTION () based on the result is not taken. For this reason, the effect that analysis becomes difficult compared with the program C before obfuscation can be obtained.
[0063]
In particular, in the conversion rule pattern 02, the regularity of the value input to the index variable is eliminated, and the value input to the index variable is changed in a complicated manner. Since it only changes the value input to the index variable in a complicated manner, it is necessary to duplicate the loop part of the program and increase it to two or more, or to confirm the conformity of the program specifications before and after performing the obfuscation processing And not. As a result, the obfuscation of the program can be realized without increasing the size of the program itself after the obfuscation processing and without limitation in creating the conversion rules.
[0064]
Furthermore, the conversion rule pattern 03 is, like the conversion rule pattern 02, a for statement included in the program:
for (I = 0; I <N; I ++) {FUNCTION (I);} (program C)
If it matches, then the program is obfuscated. That is, obfuscation is performed when matching with the conversion application pattern 202C shown in FIG.
[0065]
Obfuscation by the conversion rule pattern 03 is based on the following conversion method. In the obfuscator 100, the program C
Figure 2004185064
By doing so, the index variable is complicated without changing the specification of the program C.
[0066]
Here, F (N) is a general formula when f (idx) is regarded as a recurrence formula. The conversion rule pattern 03 shows an example where f (n) = a * n + b (a = 2, b = 1). However, the present invention is not limited to this, and any recurrence formula in which a general formula can be derived and whose general formula has an inverse function can be applied.
[0067]
When this f (n) = a * n + b is specifically considered,
F (n) = (1-a n ) / (1-a) * b
(When n! = 0)
F -1 (N) = 1 / log (a) * log (1- (1-a) / b * n)
(When n = 0)
F -1 (N) = 0
And the program is converted into the following program E.
Figure 2004185064
[0068]
Here, when the above program is calculated with a = 2 and b = 1, the value of p [I] is 0 → 1 → 1.5850 → 2 → 2.3219 → 2.5850 → 2.8074 → 3 → 3.1699 → 3.3219 →..., And the value of idx is 0 → 1 → 3 → 7 →. Therefore, the value taken by p [idx] is 1 → 2 → 3 →... → N−1, indicating that the same value is passed as an argument of the FUNCTION () function in the same order as in the program before conversion.
[0069]
When the program C is converted into the program E by the conversion rule pattern 03 in this manner, the program analyzer first checks what value is input to p [I] and determines which idx is Program analysis cannot be performed unless a procedure of examining how the values are changed and examining what value is given as an argument of FUNCTION () based on the result is not taken. For this reason, the effect that analysis becomes difficult compared with the program C before obfuscation can be obtained.
[0070]
In particular, in the conversion rule pattern 03, the regularity of the value input to the index variable is eliminated, and the value input to the index variable is changed in a complicated manner. Since it only changes the value input to the index variable in a complicated manner, it is necessary to duplicate the loop part of the program and increase it to two or more, or to confirm the conformity of the program specifications before and after performing the obfuscation processing And not. As a result, the obfuscation of the program can be realized without increasing the size of the program itself after the obfuscation processing and without limitation in creating the conversion rules.
[0071]
Next, the operation of the obfuscation processing unit 102 using such a conversion rule pattern will be described. FIG. 3 is a flowchart illustrating the operation of the obfuscation processing unit 102 in the obfuscation apparatus 100 according to the present embodiment.
[0072]
Upon receiving the program to be obfuscated from the program input unit 101, the obfuscation processing unit 102 searches for a location in the program that matches the conversion application pattern (ST301). That is, a search is made for a portion where the for sentence included in the input program matches the conversion application pattern 202.
[0073]
After searching for a part where the conversion application pattern matches, the obfuscation processing unit 102 determines whether the conversion rule pattern can be applied. Specifically, it is determined whether or not there is a match with the application condition 204 to determine whether the conversion rule pattern can be applied (ST302).
[0074]
If the conversion rule pattern can be applied, that is, if there is one that matches the application condition 204, the program is converted according to the conversion rule pattern (ST303).
[0075]
When there are a plurality of applicable conversion rule patterns, one of the applicable conversion rule patterns is selected at random and converted.
[0076]
As described above, any one of the plurality of conversion rule patterns is selected at random and the contents of the program are converted. Therefore, when trying to analyze a program, the program cannot be analyzed unless a plurality of conversion rule patterns are clarified. As a result, analysis of the program can be made more difficult.
[0077]
After converting the program at the relevant location, the obfuscation processing unit 102 determines whether the entire target program has been converted (ST304). If the entire program has not been converted, the process returns to ST301, and the processes of ST301 to ST304 are repeated. On the other hand, when the conversion of the entire program is completed, the obfuscation processing of the program is terminated.
[0078]
As described above, according to the obfuscation apparatus 100 of the present embodiment, the program is converted such that the change of the index variable of the for statement included in the program is complicated without changing the specification of the program. Thereby, it is possible to prevent the change of the index variable from being easily understood, and it is possible to make the analysis of the program difficult.
[0079]
In particular, according to the obfuscation apparatus 100 of the present embodiment, the regularity of the value input to the index variable is eliminated, the order of the value input to the index variable is changed, or the value input to the index variable is changed. Change in a complicated way. For this reason, it is not necessary to duplicate the loop portion of the program to increase it to two or more, or to confirm the matching of the program specifications before and after performing the obfuscation process. It is possible to provide an obfuscation apparatus and an obfuscation method for a program that do not limit the creation of conversion rules without increasing the size.
[0080]
In the present embodiment, the for statement is described as an example of the repetition control statement. However, the repetition control statement is not limited to this, and can be applied to a while statement and the like.
[0081]
【The invention's effect】
As described above, according to the present invention, it is possible to provide an obfuscation apparatus and an obfuscation method for a program that do not limit the creation of conversion rules without increasing the size of the program itself after the obfuscation processing. Become.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a program obfuscation apparatus according to an embodiment of the present invention.
FIG. 2 is a diagram showing an example of a conversion rule pattern stored in a parameter setting unit in the obfuscator according to the embodiment.
FIG. 3 is a flowchart for explaining the operation of an obfuscation processing unit in the obfuscation apparatus according to the embodiment;
[Explanation of symbols]
101 Program input section
102 Obfuscation processing unit
103 Program output section
104 Parameter setting section

Claims (10)

プログラムを読み込む入力手段と、前記プログラムに含まれる繰り返し制御文を検出すると当該繰り返し制御文のインデックス変数に入力される値の順番を変更するように前記プログラムの内容を変換する難読化手段と、前記難読化手段により変換したプログラムを出力する出力手段と、を具備することを特徴とするプログラムの難読化装置。Input means for reading a program, obfuscation means for converting the contents of the program so as to change the order of values input to the index variables of the repetition control statement when detecting a repetition control statement included in the program, Output means for outputting a program converted by the obfuscation means. An obfuscation apparatus for a program, comprising: 前記難読化手段は、検出した前記繰り返し文のインデックス変数に入力される値を関数により生成し、前記インデックス変数を参照する部分を配列に変更し、当該配列に前記関数の逆関数により生成される値を入力するようにプログラムの内容を変換することを特徴とする請求項1記載のプログラムの難読化装置。The obfuscation unit generates a value input to an index variable of the detected repetition sentence by a function, changes a portion referring to the index variable into an array, and generates the array by an inverse function of the function. The program obfuscation apparatus according to claim 1, wherein the contents of the program are converted so as to input a value. 前記難読化手段は、プログラムの内容を変換する際、請求項1記載の変換方式と請求項2記載の変換方式をランダムに選択して変換することを特徴とする請求項2記載のプログラムの難読化装置。3. The obfuscation of a program according to claim 2, wherein the obfuscation unit randomly selects the conversion method according to claim 1 and the conversion method according to claim 2 when converting the contents of the program. Device. プログラムを読み込む入力手段と、前記プログラムに含まれる繰り返し制御文を検出すると当該繰り返し文のインデックス変数に入力される値を関数により生成し、前記インデックス変数を参照する部分を配列に変更し、当該配列に前記関数の逆関数により生成される値を入力するようにプログラムの内容を変換する難読化手段と、前記難読化手段により変換したプログラムを出力する出力手段と、を具備することを特徴とするプログラムの難読化装置。An input unit for reading a program, and when a repetition control statement included in the program is detected, a value to be input to an index variable of the repetition statement is generated by a function, a part that refers to the index variable is changed to an array, And an output unit that outputs the program converted by the obfuscation unit. The obfuscation unit converts the content of the program so as to input a value generated by the inverse function of the function. Program obfuscator. プログラムを読み込むステップと、前記プログラムに含まれる繰り返し制御文を検出するステップと、当該繰り返し制御文のインデックス変数に入力される値の順番を変更するように前記プログラムの内容を変換するステップと、前記変換されたプログラムを出力するステップと、を具備することを特徴とするプログラムの難読化方法。Reading a program, detecting a repetition control statement included in the program, converting the contents of the program so as to change the order of values input to the index variables of the repetition control statement, Outputting the converted program. A program obfuscation method, comprising the steps of: 前記プログラムの内容を変換する際、検出した前記繰り返し文のインデックス変数に入力される値を関数により生成し、前記インデックス変数を参照する部分を配列に変更し、当該配列に前記関数の逆関数により生成される値を入力するようにプログラムの内容を変換することを特徴とする請求項5記載のプログラムの難読化方法。When converting the contents of the program, a value to be input to the index variable of the detected repetition statement is generated by a function, a part referring to the index variable is changed to an array, and the array is converted to an array by an inverse function of the function. 6. The program obfuscation method according to claim 5, wherein the contents of the program are converted so that the generated value is input. 前記プログラムの内容を変換する際、請求項5記載の変換方式と請求項6記載の変換方式をランダムに選択して変換することを特徴とする請求項6記載のプログラムの難読化方法。7. The program obfuscation method according to claim 6, wherein when converting the contents of the program, the conversion method according to claim 5 and the conversion method according to claim 6 are selected and converted at random. プログラムを読み込むステップと、前記プログラムに含まれる繰り返し制御文を検出するステップと、当該繰り返し文のインデックス変数に入力される値を関数により生成し、前記インデックス変数を参照する部分を配列に変更し、当該配列に前記関数の逆関数により生成される値を入力するようにプログラムの内容を変換するステップと、前記変換されたプログラムを出力するステップと、を具備することを特徴とするプログラムの難読化方法。Reading a program, detecting a repetition control statement included in the program, generating a value to be input to an index variable of the repetition statement by a function, changing a portion referring to the index variable into an array, Obfuscating a program, comprising: converting the contents of a program so as to input a value generated by an inverse function of the function into the array; and outputting the converted program. Method. コンピュータを、プログラムを読み込む入力手段と、前記プログラムに含まれる繰り返し制御文を検出すると当該繰り返し制御文のインデックス変数に入力される値の順番を変更するように前記プログラムの内容を変換する難読化手段と、前記難読化手段により変換したプログラムを出力する出力手段として機能させるためのプログラムを記録したコンピュータ読み取り可能な記録媒体。Computer, input means for reading a program, and obfuscation means for converting the contents of the program so as to change the order of values input to index variables of the repetition control statement when detecting a repetition control statement included in the program And a computer-readable recording medium on which a program for functioning as an output unit for outputting the program converted by the obfuscation unit is recorded. コンピュータを、プログラムを読み込む入力手段と、前記プログラムに含まれる繰り返し制御文を検出すると当該繰り返し制御文のインデックス変数に入力される値の順番を変更するように前記プログラムの内容を変換する難読化手段と、前記難読化手段により変換したプログラムを出力する出力手段として機能させるためのプログラム。Computer, input means for reading a program, and obfuscation means for converting the contents of the program so as to change the order of values input to index variables of the repetition control statement when detecting a repetition control statement included in the program And a program for functioning as output means for outputting the program converted by the obfuscation means.
JP2002347826A 2002-11-29 2002-11-29 Device and method for making program difficult to read Pending JP2004185064A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002347826A JP2004185064A (en) 2002-11-29 2002-11-29 Device and method for making program difficult to read

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002347826A JP2004185064A (en) 2002-11-29 2002-11-29 Device and method for making program difficult to read

Publications (1)

Publication Number Publication Date
JP2004185064A true JP2004185064A (en) 2004-07-02

Family

ID=32750896

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002347826A Pending JP2004185064A (en) 2002-11-29 2002-11-29 Device and method for making program difficult to read

Country Status (1)

Country Link
JP (1) JP2004185064A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007091558A1 (en) * 2006-02-06 2007-08-16 Matsushita Electric Industrial Co., Ltd. Program obfuscator
JP2008077400A (en) * 2006-09-21 2008-04-03 Kddi Corp Program-obfuscating method and program
JP2008090668A (en) * 2006-10-03 2008-04-17 Kddi Corp Program obfuscation method and program
JP2009110113A (en) * 2007-10-26 2009-05-21 Mitsubishi Electric Corp Program converter, program, and program conversion method
JP2010072958A (en) * 2008-09-18 2010-04-02 Fuji Xerox Co Ltd Program obfuscation apparatus and obfuscation program
JP2010191847A (en) * 2009-02-20 2010-09-02 Fuji Xerox Co Ltd Program obfuscating program and program obfuscating device
US7930743B2 (en) 2006-09-01 2011-04-19 Fuji Xerox Co., Ltd. Information processing system, information processing method, information processing program, computer readable medium and computer data signal
KR101157996B1 (en) 2010-07-12 2012-06-25 엔에이치엔(주) Method, system and computer readable recording medium for desultory change to protect source code of javascript
JP2014109641A (en) * 2012-11-30 2014-06-12 Kddi Corp Program conversion device and program
WO2014098239A1 (en) * 2012-12-21 2014-06-26 日本電信電話株式会社 Monitoring device and monitoring method
JPWO2020170316A1 (en) * 2019-02-18 2021-12-02 学校法人玉川学園 Information processing equipment

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007091558A1 (en) * 2006-02-06 2007-08-16 Matsushita Electric Industrial Co., Ltd. Program obfuscator
EP2420950A1 (en) 2006-09-01 2012-02-22 Fuji Xerox Co., Ltd. Information processing system, information processing method, information processing program, computer readable medium and computer data signal
EP2420949A1 (en) 2006-09-01 2012-02-22 Fuji Xerox Co., Ltd. Information processing system, information processing method, information processing program, computer readable medium and computer data signal
US7930743B2 (en) 2006-09-01 2011-04-19 Fuji Xerox Co., Ltd. Information processing system, information processing method, information processing program, computer readable medium and computer data signal
JP2008077400A (en) * 2006-09-21 2008-04-03 Kddi Corp Program-obfuscating method and program
JP2008090668A (en) * 2006-10-03 2008-04-17 Kddi Corp Program obfuscation method and program
JP2009110113A (en) * 2007-10-26 2009-05-21 Mitsubishi Electric Corp Program converter, program, and program conversion method
JP2010072958A (en) * 2008-09-18 2010-04-02 Fuji Xerox Co Ltd Program obfuscation apparatus and obfuscation program
JP2010191847A (en) * 2009-02-20 2010-09-02 Fuji Xerox Co Ltd Program obfuscating program and program obfuscating device
US8327452B2 (en) 2009-02-20 2012-12-04 Fuji Xerox Co., Ltd. Program obfuscation apparatus, program obfuscation method and computer readable medium
KR101157996B1 (en) 2010-07-12 2012-06-25 엔에이치엔(주) Method, system and computer readable recording medium for desultory change to protect source code of javascript
JP2014109641A (en) * 2012-11-30 2014-06-12 Kddi Corp Program conversion device and program
WO2014098239A1 (en) * 2012-12-21 2014-06-26 日本電信電話株式会社 Monitoring device and monitoring method
JP6005761B2 (en) * 2012-12-21 2016-10-12 日本電信電話株式会社 Monitoring device and monitoring method
US9600665B2 (en) 2012-12-21 2017-03-21 Nippon Telegraph And Telephone Corporation Monitoring device and monitoring method
CN104871173B (en) * 2012-12-21 2018-01-16 日本电信电话株式会社 Monitoring arrangement and monitoring method
JPWO2020170316A1 (en) * 2019-02-18 2021-12-02 学校法人玉川学園 Information processing equipment
JP7072958B2 (en) 2019-02-18 2022-05-23 学校法人玉川学園 Information processing equipment

Similar Documents

Publication Publication Date Title
US7054443B1 (en) System and method for protecting digital goods using random and automatic code obfuscation
EP1546892B1 (en) Protecting mobile code against malicious hosts cross references to related applications
US7447912B2 (en) Protecting digital goods using oblivious checking
Cousot et al. An abstract interpretation-based framework for software watermarking
US7254586B2 (en) Secure and opaque type library providing secure data protection of variables
US7549147B2 (en) Security framework for protecting rights in computer software
US7421586B2 (en) Protecting mobile code against malicious hosts
JP2004364070A (en) System for managing electronic document by utilizing maskable signature technology
Chang et al. A blind dynamic fingerprinting technique for sequential circuit intellectual property protection
KR20070057938A (en) Source code protection
JP2004185064A (en) Device and method for making program difficult to read
CN107430650A (en) Computer program is protected to resist reverse-engineering
Demsky Cross-application data provenance and policy enforcement
JP2000122861A (en) Illegal alteration prevention system for data or the like and enciphering device used with the system
US10331896B2 (en) Method of protecting secret data when used in a cryptographic algorithm
Patel et al. Comparative analysis of formal model checking tools for security protocol verification
JP2886969B2 (en) Program conversion method
Ertaul et al. JHide-A tool kit for code obfuscation.
CN109543433B (en) Software development kit encryption method, device, computer and storage medium
Mambo et al. Fingerprints for copyright software protection
US6931634B2 (en) Encrypted compiler
CN116964575A (en) Code deployment
Groß et al. Protecting JavaScript apps from code analysis
JP3970856B2 (en) Program obfuscation device, program distribution system, computer program
KR20090032701A (en) Method and storage medium for protecting software with hardware id