# US 8,752,032 B2 · System and method of interlocking to protect software-mediated program and device behaviours

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 8,752,032 B2
- Document ID: US8752032B2
- Status: Granted
- Kind: B2
- Application number: 11/709,654
- Filed: 2007-02-23
- Published: 2008-09-04
- Granted: 2014-06-10
- Earliest claimed: 2007-02-23
- Assignees: Irdeto Canada Corporation
- Applicants: Harold Joseph Johnson; Yuan Xiang Gu; Yongxin Zhou
- Inventors: Harold Joseph Johnson; Yuan Xiang Gu; Yongxin Zhou
- Web page: https://patentgrep.com/patent/US8752032B2

## CPC

- G06F 21/125: {by manipulating the program code, e.g. source code, compiled code, interpreted code, machine code}
- G06F 21/14: against software analysis or reverse engineering, e.g. by obfuscation
- H04L 9/002: {Countermeasures against attacks on cryptographic mechanisms (network architectures or network communication protocols for protection against malicious traffic H04L63/1441)}
- G06F 21/1066: {Hiding content}
- H04L 2209/04: Masking or blinding
- H04L 2209/046: of operations, operands or results of the operations
- H04L 2209/16: Obfuscation or hiding, e.g. involving white box
- H04L 2209/20: Manipulating the length of blocks of bits, e.g. padding or block truncation
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

Methods and devices for thwarting code and control flow based attacks on software. The source code of a subject piece of software is automatically divided into basic blocks of logic. Selected basic blocks are amended so that their outputs are extended. Similarly, other basic blocks are amended such that their inputs are correspondingly extended. The amendments increase or create dependencies between basic blocks such that tampering with one basic block's code causes other basic blocks to malfunction when executed.

## Claims

### Claim 1

A method for thwarting tampering with software, the method comprising a processor executing:
a) receiving source code of said software;
b) converting said source code into an intermediate form defining basic blocks and dominating relationships among said basic blocks, wherein said intermediate form is represented as a control flow graph;
c) selecting a computation of at least one first basic block and a computation of at least one second basic block, where said at least one second basic block is dominated by said at least one first basic block;
d) encoding said computation of said at least one first basic block and said computation of said at least one second basic block using data encodings with an obfuscated function;
e) setting coefficients of said data encodings in said at least one second basic block to be dependent on outputs from said at least one first basic block, wherein tampering with said at least one first basic block causes computations in the at least one second basic block to malfunction due to incorrect data encodings; and
(f) randomly selecting from automatically generated mixed- Boolean-arithmetic (MBA) identities and performing substitutions according to the selected MBA identities in said data encodings in said at least one first basic block and said at least one second basic block, wherein said MBA identities are generated by means of a generator based on at least one of converting bitwise expressions to linear MBA identities and deriving MBA identities from linearly-dependent truth tables.

### Claim 2 (depends on 1)

The method according to claim 1 wherein setting coefficients of said data encodings in said at least one second basic block to be dependent on outputs from said at least one first basic block includes extending outputs from said at least one first basic block.

### Claim 3 (depends on 2)

The method according to claim 2 wherein said outputs from said at least one first basic block are modified by extra information.

### Claim 4 (depends on 3)

The method according to claim 3 wherein said extra information is required by said encoded computation of said at least one second basic block to function properly.

### Claim 5 (depends on 3)

The method according to claim 3 wherein said extra information is derived from a regular functioning of said at least one first basic block.

### Claim 6 (depends on 1)

The method according to claim 1 wherein setting coefficients of said data encodings in said at least one second basic block to be dependent on outputs from said at least one first basic block includes extending inputs to said at least one second basic block.

### Claim 7 (depends on 1)

The method according to claim 1 wherein said encoded computation of said at least one first basic block must be executed prior to said encoded computation of said at least one second basic block for said software to function properly.

### Claim 8 (depends on 1)

The method according to claim 1 wherein said method is reapplied to said source code such that said data encodings in said at least one second basic block is dependent on results of more than one of at least two first basic blocks.

### Claim 9 (depends on 1)

The method according to claim 1 wherein a proper functioning of said encoded computation of said at least one second basic block is required for said software to function properly.

### Claim 10 (depends on 9)

The method according to claim 9 wherein said encoded computation of said at least one second basic block functions properly only when said encoded computation of said at least one first basic block functions properly.

### Claim 11 (depends on 1)

The method according to claim 1 wherein said data encodings in said at least one first basic block and said at least one second basic block result in at least one modified first basic block and at least one modified second basic block resembling code originally present in said at least one first basic block and in said at least one second basic block.

### Claim 12 (depends on 1)

The method according to claim 1 wherein at least one computation in said source code is replaced by encoded computations which use encoded inputs and which produce encoded outputs.

### Claim 13 (depends on 1)

The method according to claim 1 wherein said software accesses at least some memory as cells and said source code is modified to refer to cell reference numbers with transformed cell numbers.

### Claim 14 (depends on 1)

The method according to claim 1 wherein control flow for said source code is further modified to use an indexed control flow scheme using at least one master table containing required data values for said indexed control flow scheme, said at least one master table and at least one entry in said table being encoded.

### Claim 15 (depends on 1)

The method according to claim 1 wherein arrays in said source code are restructured using at least one of:
merging multiple arrays into a single array;
splitting single arrays into multiple arrays; and
changing a number of dimensions of an array;
wherein array element addresses are scrambled in restructured arrays.

### Claim 16 (depends on 1)

The method according to claim 1 wherein at least one array in said source code is modified such that indices of said array are encoded using permutation polynomials, said indices being selected over modular rings.

### Claim 17 (depends on 1)

The method according to claim 1:
wherein values are hidden in computer code by replacing a value to be hidden with a plurality of mixed Boolean-arithmetic operations, said plurality of mixed Boolean-arithmetic operations involving other values and constants; and
said value to be hidden being accessed by executing said plurality of mixed Boolean-arithmetic operations.

### Claim 18 (depends on 17)

The method according to claim 17 wherein at least one of said other values and constants is replaced by other mixed Boolean-arithmetic operations.

### Claim 19 (depends on 17)

The method according to claim 17 wherein said value to be hidden is divided into segments, each segment being replaced by a corresponding at least one mixed Boolean-arithmetic operation.

### Claim 20 (depends on 17)

The method according to claim 17 wherein said other values and constants are dynamic values and constants, said dynamic constants and values being represented in said plurality of mixed Boolean-arithmetic operations by variables.

### Claim 21 (depends on 1)

The method according to claim 1 wherein the data encodings in (d) are quadratic, cubic, or quartic permutation polynomials in which coefficients of nonlinear portions of the polynomials have zero squares.
