# US 12,007,908 B2 · Method and apparatus to dynamically encode data at runtime

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

- Number: US 12,007,908 B2
- Document ID: US12007908B2
- Status: Granted
- Kind: B2
- Application number: 15/841,743
- Filed: 2017-12-14
- Published: 2019-06-20
- Granted: 2024-06-11
- Earliest claimed: 2017-12-14
- Assignees: ARRIS Enterprises LLC
- Applicants: ARRIS Enterprises LLC
- Inventors: Rafie Shamsaasef; Lex Aaron Anderson
- Web page: https://patentgrep.com/patent/US12007908B2

## CPC

- G06F 8/423: {Preprocessors}
- G06F 9/544: {Buffers; Shared memory; Pipes}
- G06F 12/1408: {by using cryptography (for digital transmission H04L9/00)}
- G06F 21/14: against software analysis or reverse engineering, e.g. by obfuscation
- G06F 21/54: by adding security routines or objects to programs
- G06F 21/60: Protecting data
- H04L 9/0631: {Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms}
- G06F 2221/2125: Just-in-time application of countermeasures, e.g., on-the-fly decryption, just-in-time obfuscation or de-obfuscation
- H04L 63/0428: {wherein the data content is protected, e.g. by encrypting or encapsulating the payload}
- H04L 2209/16: Obfuscation or hiding, e.g. involving white box
- 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

A method is provided to dynamically encode data at runtime with a tagged data element in a program associated with an obfuscation algorithm randomly selected during runtime. Instructions for invoking the obfuscation algorithm are generated when a compiler encounters the tagged variable in the source code. At runtime, unencoded data is encoded by the obfuscation algorithm when the unencoded data is copied to the tagged data element; encoded data is re-encoded by the obfuscation algorithm when the encoded data is copied from a differently tagged data element to the tagged data element, wherein the differently tagged data element is associated with a different obfuscation algorithm; and encoded data is decoded by the obfuscation algorithm when the encoded data is copied from the tagged data element to an untagged data element.

## Claims

### Claim 1

A method comprising:
randomly selecting at least one dynamic encoding algorithm at runtime during execution of a program by a processor when the processor performs at least one of encoding, decoding and/or re-encoding a data flow of the program, the selecting at runtime made randomly from a pool of encoding algorithms injected into the program at build-time, where the encoding algorithms in the pool each comprise at least one function for encoding, decoding and/or re-encoding the data flow by altering a data value without altering a data type associated with said data value;
wherein the selected at least one dynamic encoding algorithm is associated with at least one tagged data element in the program for encoding, decoding or re-encoding data stored in the tagged data element; and
wherein:
unencoded data is encoded by the selected at least one dynamic encoding algorithm when the unencoded data is copied to the tagged data element;
encoded data is re-encoded by the selected at least one dynamic encoding algorithm when the encoded data is copied from a differently tagged data element to the tagged data element; or
encoded data is decoded by the selected at least one dynamic encoding algorithm when the encoded data is copied from the tagged data element to an untagged data element.

### Claim 2 (depends on 1)

The method of claim 1, wherein the encoding algorithms in the pool are injected into the program at randomly selected locations.

### Claim 3 (depends on 1)

The method of claim 1, wherein the encoding algorithms in the pool are randomly selected from a library of obfuscation algorithms.

### Claim 4 (depends on 1)

The method of claim 1, wherein the differently tagged data element is associated with a different encoding algorithm.

### Claim 5

An apparatus comprising:
a processor for executing a program;
wherein at least one dynamic encoding algorithm is randomly selected at runtime during execution of the program when the processor performs at least one of encoding, decoding and/or re-encoding a data flow of the program, the selection at runtime made randomly from a pool of encoding algorithms injected into the program at build-time, where the encoding algorithms in the pool each comprise at least one function for encoding, decoding and/or re-encoding the data-flows by altering a data value without altering a data type associated with said data value;
wherein the selected at least one dynamic encoding algorithm is associated with at least one tagged data element in the program for encoding, decoding or re-encoding data stored in the tagged data element; and wherein:
unencoded data is encoded by the selected at least one dynamic encoding algorithm when the unencoded data is copied to the tagged data element;
encoded data is re-encoded by the selected at least one dynamic encoding algorithm when the encoded data is copied from a differently tagged data element to the tagged data element; or
encoded data is decoded by the selected at least one dynamic encoding algorithm when the encoded data is copied from the tagged data element to an untagged data element.

### Claim 6 (depends on 5)

The apparatus of claim 5, wherein the encoding algorithms in the pool are injected into the program at randomly selected locations.

### Claim 7 (depends on 5)

The apparatus of claim 5, wherein the encoding algorithms in the pool are randomly selected from a library of obfuscation algorithms.

### Claim 8 (depends on 5)

The apparatus of claim 5, wherein the differently tagged data element is associated with a different encoding algorithm.

### Claim 9

A method implemented by a processor and comprising:
tagging at least one data element when editing source code of a program while performing at least one of encoding, decoding and/or re-encoding a data flow of the program;
wherein the tagged data element is associated with a dynamic encoding algorithm randomly selected at runtime during execution of the program from a pool of encoding algorithms injected into the program at build-time, where the encoding algorithms each comprise at least one function for encoding, decoding or re-encoding data stored in the tagged data element by altering a data value without altering a data type associated with said data value; and wherein:
unencoded data is encoded by the dynamic encoding algorithm when the unencoded data is copied to the tagged data element;
encoded data is re-encoded by the dynamic encoding algorithm when the encoded data is copied from a differently tagged data element to the tagged data element; or
encoded data is decoded by the dynamic encoding algorithm when the encoded data is copied from the tagged data element to an untagged data element.

### Claim 10 (depends on 9)

The method of claim 9, wherein the data element is tagged in the source code of the program.

### Claim 11 (depends on 9)

The method of claim 9, wherein instructions for invoking the encoding algorithm associated with the tagged data element are generated when a compiler encounters the tagged data element in the source code.

### Claim 12 (depends on 9)

The method of claim 9, wherein the data element is tagged with an encoding identifier.

### Claim 13

An apparatus comprising:
a processor for editing source code of a program and tagging at least one data element when performing at least one of encoding, decoding and/or re-encoding a data flow of the program, wherein the tagged data element is associated with a dynamic encoding algorithm randomly selected at runtime during execution of the program from a pool of encoding algorithms injected into the program at build-time, for encoding, where the encoding algorithms in the pool each comprise at least one function for decoding or re-encoding data stored in the tagged data element by altering a data value without altering a data type associated with said data value; and
wherein:
unencoded data is encoded by the encoding algorithm when the unencoded data is copied to the tagged data element;
encoded data is re-encoded by the encoding algorithm when the encoded data is copied from a differently tagged data element to the tagged data element; or
encoded data is decoded by the encoding algorithm when the encoded data is copied from the tagged data element to an untagged data element.

### Claim 14 (depends on 13)

The apparatus of claim 13, wherein the data element is tagged in the source code of the program.

### Claim 15 (depends on 13)

The apparatus of claim 13, wherein instructions for invoking the encoding algorithm associated with the tagged data element are generated when a compiler encounters the tagged data element in the source code.

### Claim 16 (depends on 13)

The apparatus of claim 13, wherein the data element is tagged with an encoding identifier.
