Program Code Obfuscation via Dynamic Masking and Table Segmentation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for protecting program code information from unauthorized access at runtime are inadequate, as they often decrypt or unpack the code, making it vulnerable to memory-based attacks.
Innovation Solution
A method for computer-aided obfuscation of program code using a dynamic mask, where each computing step accesses a first table and converts its values into second table values, with additional steps to convert back to original values, distributing the demasking process across the program code, and utilizing update steps and random number generators to enhance security.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If information is encrypted using an encryption function or code is packaged by a code packer, then information is protected against unauthorized access, but the information is decrypted or unpacked at runtime making it available in plain text in program memory
Solution Approach 1:
The patent segments the protection mechanism by dividing the table values into multiple components stored in different data structures (first table, second table, third table). Each table stores transformed versions of the original data, and no single table contains the complete unprotected information. This segmentation prevents attackers from retrieving plain text information from memory at any single point.
Solution Approach 2:
The patent applies parameter changes by transforming the original table values through multiple mathematical operations including modular arithmetic, bitwise operations, and scrambling functions. The transformation parameters (such as mask values, shift amounts, and scramble values) are dynamically changed during execution, ensuring that even if memory is accessed, the stored values remain transformed and unusable without the corresponding decryption logic.
2Reliability
If a dynamic mask is used to convert first table values into second table values, then information is disguised making it difficult to reconstruct original values, but the program code complexity increases
Solution Approach 1:
The patent introduces intermediary transformation functions and mask values that mediate between the original data and its protected representation. These intermediaries (such as the scrambling function, mask generation logic, and transformation routines) add complexity to the code but provide a structured and systematic approach to protection that can be implemented as reusable components rather than ad-hoc obfuscation.
Solution Approach 2:
The patent performs preliminary actions by pre-computing and storing transformation parameters, mask values, and scrambled data in the program code before execution. The transformation logic is embedded in the compiled code, so that during runtime, the system only needs to execute predetermined transformation sequences rather than performing complex computations from scratch, thereby managing code complexity through advance preparation.
3Reliability
If additional computing steps are implemented to convert second table values back into first table values, then the same results as non-obfuscated code are delivered, but the number of computing steps increases
Solution Approach 1:
The patent employs periodic action through the use of loop unrolling and predetermined transformation sequences. The transformation and inverse transformation operations are structured as periodic sequences of instructions that are optimized for efficient execution. By pre-determining the sequence of operations and using loop unrolling techniques, the patent reduces the overhead of dynamic computation while maintaining correctness.
Solution Approach 2:
The patent uses copying by creating multiple representations of the data in different transformed states (first table, second table, third table) and maintaining corresponding transformation logic for each. This allows the system to work with copied and transformed versions of the data throughout execution, ensuring correctness through systematic transformation while enabling optimization of the transformation routines themselves for efficient execution.
Data Source
AI summary
Provided is a method for computer-aided obfuscation of program code, wherein a plurality of calculation steps is implemented in the program code, wherein predetermined calculation steps of the plurality of calculation steps are retrieved in a predetermined order with the execution of the program code, and at least some of the predetermined calculation steps are predefined calculation steps in which a respective first table that is stored in the program code and includes of a plurality of digital first tabular values is accessed in order to read a first tabular value required for the respective predefined calculation step from the first table. As part of the obfuscation of the program code, a dynamic mask formed by a plurality of digital mask values is used, wherein, for any predefined calculation step, another mask value is used to replace the first tabular value from the first table with a second tabular value.
