[go: up one dir, main page]

CN114780920B - Method, system and storage medium for constructing opaque predicates without size constraints - Google Patents

Method, system and storage medium for constructing opaque predicates without size constraints Download PDF

Info

Publication number
CN114780920B
CN114780920B CN202210386385.4A CN202210386385A CN114780920B CN 114780920 B CN114780920 B CN 114780920B CN 202210386385 A CN202210386385 A CN 202210386385A CN 114780920 B CN114780920 B CN 114780920B
Authority
CN
China
Prior art keywords
integer
par
constructing
function
predicate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210386385.4A
Other languages
Chinese (zh)
Other versions
CN114780920A (en
Inventor
乐德广
王雨芳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Changshu Institute of Technology
Original Assignee
Changshu Institute of Technology
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 Changshu Institute of Technology filed Critical Changshu Institute of Technology
Priority to CN202210386385.4A priority Critical patent/CN114780920B/en
Publication of CN114780920A publication Critical patent/CN114780920A/en
Application granted granted Critical
Publication of CN114780920B publication Critical patent/CN114780920B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/14Protecting executable software against software analysis or reverse engineering, e.g. by obfuscation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/43Checking; Contextual analysis
    • G06F8/433Dependency analysis; Data or control flow analysis
    • G06F8/434Pointers; Aliasing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

本发明公开了一种无尺寸约束的不透明谓词构建方法、系统及存储介质,包括:(1)构建一个整型数组,其数组元素初始值为:从0开始,步长为1的递增正整数,数组个数不少于2;(2)从待保护函数中读取整型参数;(3)构建一个与所述待保护函数的参数和所述数组有关的整型变量;(4)构建所述整型变量与所述函数的参数的不等表达式,该条件不等表达式为一恒假不透明谓词。基于该方法构造的不透明谓词可以令攻击者错误地将不透明谓词识别为普通谓词,从而错误的执行程序的虚假分支。此外,对混淆后程序的强度、弹性及执行代价进行测试分析,实验结果表明使用本发明方法构建的不透明谓词具有高强度、高弹性且执行代价较小。

The present invention discloses a method, system and storage medium for constructing an opaque predicate without size constraints, including: (1) constructing an integer array, the initial value of the array element of which is: an increasing positive integer starting from 0 and with a step length of 1, and the number of arrays is not less than 2; (2) reading an integer parameter from a function to be protected; (3) constructing an integer variable related to the parameter of the function to be protected and the array; (4) constructing an inequality expression between the integer variable and the parameter of the function, and the conditional inequality expression is a constant false opaque predicate. The opaque predicate constructed based on this method can cause an attacker to mistakenly identify the opaque predicate as an ordinary predicate, thereby mistakenly executing a false branch of the program. In addition, the strength, elasticity and execution cost of the obfuscated program are tested and analyzed, and the experimental results show that the opaque predicate constructed using the method of the present invention has high strength, high elasticity and low execution cost.

Description

Size constraint-free opaque predicate construction method, system and storage medium
Technical Field
The invention relates to the field of information security, in particular to a size-constraint-free opaque predicate construction method, a size-constraint-free opaque predicate construction system and a storage medium.
Background
Opaque predicates are special expressions whose values are known before confusion but are difficult to derive by reverse analysis. Opaque predicates are commonly used in boolean expressions, which include logically true, logically false, and kefir or false forms. The existing scheme generally adopts methods such as mathematical theorem, chaos theory and encryption to construct opaque predicates. For example, opaque predicates are constructed by using the states of congruence equation group solutions, and predicate outputs are judged by adopting Chinese remainder theorem, and internal logic of the predicates can be hidden through complex mathematical transformation, so that the predicate has better static reverse analysis resistance, but the predicate value is fixed in the running process. The chaotic opaque predicates based on En_Logistic mapping have extremely high confidentiality and uncertainty of predicate results. The hyperchaotic opaque predicate construction method based on the two-dimensional hyperchaotic mapping construction converts the predicate solving problem into the solving hyperchaotic problem so as to greatly increase the difficulty of condition judgment. The construction of the N-state opaque predicates through the two-dimensional chaotic mapping has higher security and control flow circulation complexity, but has the problem of lower construction efficiency. And constructing an opaque expression by adopting the two-dimensional tent chaotic mapping, and replacing constants in opaque predicates by using the expression, so that predicate cracking difficulty is increased, and execution cost is low.
Disclosure of Invention
1. Object of the invention
The invention provides a size constraint-free opaque predicate construction method and a size constraint-free opaque predicate construction system, which aim to solve the problems that the existing opaque predicates are generally simpler and have reverse detection, and resist detection attack on the opaque predicates.
2. The invention adopts the technical proposal that
The invention provides an opaque predicate construction method without size constraint, which comprises the following steps:
(1) Constructing an integer array, wherein the initial value of array elements is as follows: starting from 0, the step length is an increasing positive integer of 1, and the number of the arrays is not less than 2;
(2) Reading integer parameters from the function to be protected;
(3) Constructing an integer variable related to the parameter of the function to be protected and the array;
(4) An unequal expression of the integer variable and the parameter of the function is constructed, and the conditional unequal expression is a logically false opaque predicate.
Furthermore, the integer array a [ ], i.e., int a [ ], has the array element initial values of: starting from 0, the step size is an increasing positive integer of 1, M >1, M is a positive integer greater than 1, i.e., int a [ ] = {0,1,2, …, i, i+1, … M-1}.
Further, the integer parameter par is read from the function to be protected, i.e. from the function to be protected func (int par, …).
Further, the construction of the integer variable is specifically: an integer variable s=f (par, a [ ]) is constructed in relation to the parameter par and the array a [ ] of the function func (int par, …) to be protected, wherein f (par, a [ ]) =a [ a [ par% (M-1) +1] ].
Still further, the conditional unequal expression: s-! =par% (M-1) +1.
The invention provides an opaque predicate construction method system without size constraint, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the steps of the method when executing the computer program.
The present invention proposes a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method steps.
3. The invention has the beneficial effects that
The invention provides an opaque predicate concept without size constraint, and simultaneously provides an opaque predicate construction method to increase the difficulty of reverse attack. Opaque predicates constructed based on this method can cause an attacker to erroneously identify the opaque predicate as a normal predicate, thereby erroneously executing false branches of a program. In addition, the intensity, the elasticity and the execution cost of the program after confusion are subjected to test analysis, and experimental results show that the opaque predicates constructed by the method have high intensity, high elasticity and lower execution cost.
Drawings
FIG. 1 is a flow chart of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made more apparent and fully by reference to the accompanying drawings, in which embodiments of the invention are shown, and in which it is evident that the embodiments shown are only some, but not all embodiments of the invention. All other embodiments, which can be made by a person skilled in the art without any inventive effort, are intended to be within the scope of the present invention.
Examples of the present invention will be described in further detail below with reference to the accompanying drawings.
Example 1
The method not only can realize the execution logic relation of the confusing program, but also greatly improves the control flow intensity of the program, and effectively resists the reverse analysis of the program.
The method comprises the following steps: the function func (int par, …) to be protected is input, and the opaque predicate op is output. As in fig. 1, step 101, a function func (int par, …) with an integer parameter par is selected. Step 102, an integer array a [ ] of length M is constructed, where M >1, and each array element is assigned a [ ] = {0,1,2, …, M-1}. Step 103, constructing integer variable s, and assigning a [ a [ par% (M-1) +1] ], namely, s=a [ a [ par% (M-1) +1] ]. Step 104, constructing opaque predicates op based on variable s and parameter par, i.e. s-! =par% (M-1) +1. The steps of the method of constructing opaque predicates are as follows.
Method 1 opaque predicate construction method
Input: func (int par …)
And (3) outputting: opaque predicate op
Step 1, obtaining integer parameters par in a function func (int par, …) to be protected;
Step 2, constructing an integer array, and giving an initial value: int a [ ] = {0,1,2, …, M-1}, where M >1;
Step 3, constructing integer variables, and assigning: int s=a [ a [ par% (M-1) +1] ];
Step 4, constructing opaque predicates op: s-! =par% (M-1) +1.
An example is given below that shows the construction of opaque predicates using the present invention to achieve code protection on the basis of unaliased code, as specifically shown below.
Before confusion
After confusion
As can be seen from the above example, the main function main (int x) of the program receives a form parameter x. First, the explicitly input variable x is an integer variable. Then, the process is carried out, defining arrays using integer patterns inta [ ] = {0,1,2,3,4,5,6,7,8,9}. Next, the variable ints=a [ a [ x%9+1] ] is defined. Finally, construct opaque predicate s-! =x% 9+1, and inserts a false control flow y=x+2; . In the above obfuscated procedure, the conditions built based on opaque predicates are never possible to meet, but the attacker is working on s-! When solving for the row =x% 9+1, an erroneous solution will be obtained and the error will be s-! =x% 9+1 is considered as a normal predicate, thus executing a false control flow y=x+2; the reverse analysis result is wrong, so the method can obtain good program protection effect.
The foregoing is only a preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions easily contemplated by those skilled in the art within the scope of the present invention should be included in the scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims (7)

1. The opaque predicate construction method without size constraint is applied to obfuscating program logic and resisting program reverse analysis, and is characterized in that:
(1) Constructing an integer array, wherein the initial value of array elements is as follows: starting from 0, the step length is an increasing positive integer of 1, and the number of the arrays is not less than 2;
(2) Reading integer parameters from the function to be protected;
(3) Constructing an integer variable related to the parameter of the function to be protected and the array;
(4) A conditional unequal expression of the integer variable and parameters of the function is constructed, the conditional unequal expression being a logically false opaque predicate.
2. The size-constraint-free opaque predicate construction method of claim 1, wherein: the integer array a [ ], namely int a [ ], the initial value of the array element is: starting from 0, the step size is an increasing positive integer of 1, M >1, M is a positive integer greater than 1, i.e., int a [ ] = {0,1,2, …, i, i+1, … M-1}.
3. The size-constraint-free opaque predicate construction method of claim 2, wherein: the integer parameter par is read from the function to be protected, i.e. from the function to be protected func (int par, …).
4. A size constraint-free opaque predicate construction method according to claim 3, wherein constructing the integer variable is specifically: an integer variable s=f (par, a [ ]) is constructed in relation to the parameter par and the array a [ ] of the function func (int par, …) to be protected, wherein f (par, a [ ]) =a [ a [ par% (M-1) +1] ].
5. The size-constraint-free opaque predicate construction method according to claim 4, wherein the conditional unequal expression: s-! =par% (M-1) +1.
6. An opaque predicate construction method system without size constraint, comprising a memory and a processor, the memory storing a computer program, characterized in that; the processor, when executing the computer program, implements the method steps of any of claims 1-5.
7. A computer-readable storage medium having stored thereon a computer program, characterized by: the computer program implementing the method steps of any of claims 1-5 when executed by a processor.
CN202210386385.4A 2022-04-13 2022-04-13 Method, system and storage medium for constructing opaque predicates without size constraints Active CN114780920B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210386385.4A CN114780920B (en) 2022-04-13 2022-04-13 Method, system and storage medium for constructing opaque predicates without size constraints

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210386385.4A CN114780920B (en) 2022-04-13 2022-04-13 Method, system and storage medium for constructing opaque predicates without size constraints

Publications (2)

Publication Number Publication Date
CN114780920A CN114780920A (en) 2022-07-22
CN114780920B true CN114780920B (en) 2024-11-15

Family

ID=82429413

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210386385.4A Active CN114780920B (en) 2022-04-13 2022-04-13 Method, system and storage medium for constructing opaque predicates without size constraints

Country Status (1)

Country Link
CN (1) CN114780920B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106650339A (en) * 2016-10-13 2017-05-10 国网江苏省电力公司电力科学研究院 Control flow complication-based Java code obfuscation method
CN107437005A (en) * 2017-07-18 2017-12-05 广东工业大学 A kind of Code obfuscation method and device based on the opaque predicate of chaos

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE602005018736D1 (en) * 2004-12-22 2010-02-25 Ericsson Telefon Ab L M Watermarking a computer program code using equivalent mathematical expressions
US9098621B2 (en) * 2011-02-28 2015-08-04 Microsoft Technology Licensing, Llc Modeling software behavior using learned predicates
IL224743A0 (en) * 2013-02-14 2013-06-27 Harel Cain Automatic computer program obfuscation system
US20160379131A1 (en) * 2015-06-26 2016-12-29 Nxp B.V. Fuzzy opaque predicates
EP3944106A1 (en) * 2020-07-24 2022-01-26 Nagravision SA Obfuscating method of protecting code

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106650339A (en) * 2016-10-13 2017-05-10 国网江苏省电力公司电力科学研究院 Control flow complication-based Java code obfuscation method
CN107437005A (en) * 2017-07-18 2017-12-05 广东工业大学 A kind of Code obfuscation method and device based on the opaque predicate of chaos

Also Published As

Publication number Publication date
CN114780920A (en) 2022-07-22

Similar Documents

Publication Publication Date Title
Wu et al. Pc-fairness: A unified framework for measuring causality-based fairness
Long et al. Towards measuring membership privacy
Yu et al. Incremental SAT-based reverse engineering of camouflaged logic circuits
Chistikov et al. Approximate counting in SMT and value estimation for probabilistic programs
Ellis et al. Sampling for bayesian program learning
Chistikov et al. Approximate counting in SMT and value estimation for probabilistic programs
Madras et al. Structure of random 312‐avoiding permutations
de Haan et al. Fixed-parameter tractable reductions to SAT
Lou et al. Ownership verification of DNN architectures via hardware cache side channels
Di Pierro et al. Measuring the confinement of probabilistic systems
Haanpää et al. Hard satisfiable clause sets for benchmarking equivalence reasoning techniques
Floreani et al. Intertwining and duality for consistent Markov processes
CN114780920B (en) Method, system and storage medium for constructing opaque predicates without size constraints
Nofal et al. SQL injection attacks detection and prevention based on neuro—fuzzy technique
Suzuki et al. Multiple-valued debiasing for physically unclonable functions and its application to fuzzy extractors
Bofill et al. A write-based solver for SAT modulo the theory of arrays
Kozik A finite set of functions with an EXPTIME-complete composition problem
Rayner et al. Smooth tests of goodness of fit
CN117436040B (en) Code obfuscation method, system and storage medium based on opaque predicate
Naidenova DIAGARA: An incremental algorithm for inferring implicative rules from examples
Azizi-Sultan Pseudo-Propositional Logic.
Dunaev Complexity of a special deobfuscation problem
Oshman et al. A new approach to bounded model checking for branching time logics
Nofal et al. SQL Injection Attacks Detection and Prevention Based on Neuro—Fuzzy
Prestwich et al. Partial symmetry breaking by local search in the group

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant