Code Obfuscation via Selective IL Encryption
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Applications that convert code to intermediate language (IL) are vulnerable to decompiling, making them susceptible to forgery and manipulation, as IL code can be easily exposed and modified during transmission and execution.
Innovation Solution
A method that selects and encrypts critical classes and methods within an application's IL code, adding decryption information to a secure module, allowing for decryption at runtime, thereby preventing forgery by protecting the code from decompiling.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If code is converted to intermediate language (IL) for execution, then execution flexibility and portability are improved, but code security and anti-decompiling capability deteriorate
Solution Approach 1:
The patent applies preliminary action by encrypting the IL code before it is stored or transmitted. The encryption process converts the intermediate language code into an encrypted form that cannot be easily decompiled or manipulated. The decryption occurs automatically at runtime, allowing the code to execute properly while maintaining security throughout storage and transmission phases.
Solution Approach 2:
The patent introduces an intermediary decryption mechanism that acts as a mediator between the encrypted IL code and the execution environment. The decryption process, triggered at runtime, serves as an intermediary step that transforms the encrypted code back into executable form only when needed, preventing direct access to the original IL code structure while maintaining execution flexibility.
2Reliability
If all IL code is encrypted to prevent decompiling, then code security is improved, but execution speed and runtime performance deteriorate
Solution Approach 1:
The patent applies segmentation by dividing the IL code into multiple segments or blocks that are encrypted separately. Instead of encrypting the entire codebase as a single unit, the code is partitioned into manageable segments that can be decrypted and executed efficiently. This segmented approach reduces the overall decryption overhead and allows for selective decryption of only the necessary code segments at runtime.
Solution Approach 2:
The patent implements partial action by encrypting only the critical or sensitive portions of the IL code rather than the entire codebase. The encryption is applied selectively to specific methods, classes, or code blocks that require protection, while less critical code remains in its original form. This partial encryption approach maintains code security for important functions while minimizing the performance impact on overall execution speed.
3Ease of operation
If decryption information is stored in the application package, then runtime decryption capability is improved, but vulnerability to information extraction deteriorates
Solution Approach 1:
The patent applies the nested doll principle by embedding the decryption information within the structure of the application package itself. The decryption keys or information are nested within encrypted containers or protected sections of the package, requiring multiple layers of authentication or decryption to access. This nested structure allows the decryption information to be readily available for legitimate runtime decryption while making it difficult for attackers to extract or misuse the information.
Data Source
AI summary
Provided is a method and system for code obfuscation of an application. A method configured as a computer may include receiving an application program package that includes an intermediate language (IL) code generated by compiling code for an application including a plurality of classes and a plurality of methods as a dex file over a network, selecting a protection target class or a protection target method from among the plurality of classes and the plurality of methods, encrypting the selected protection target class or the selected protection target method by retrieving and encrypting an IL code corresponding to the selected protection target class or the selected protection target method from the dex file, and adding decryption information for decrypting the encrypted protection target class or the encrypted protection target method to a secure module that is further included in the application program package.


