DEX Code Segmentation and Encryption for Mobile App Protection
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Mobile APK files are vulnerable to tampering and reverse engineering due to their ability to be unpacked and modified, allowing for potential malware injection and data exposure.
Innovation Solution
The original DEX program code is split into encrypted segments, stored in separate files, and loaded into non-contiguous memory blocks, where it is decrypted and parsed for execution, using a stub DEX file and DEX shield library to prevent static analysis and reverse engineering.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If the original DEX program code is kept as a single file for easy loading and execution, then the ease of operation is improved, but the security against reverse engineering and tampering deteriorates
Solution Approach 1:
The original DEX program code is divided into multiple encrypted segments stored in separate files. Each segment is independently encrypted and can be loaded separately, maintaining ease of operation while enhancing security through distribution and encryption of the code base.
Solution Approach 2:
The code transitions from a single plaintext file to multiple encrypted segments with different encryption parameters. The encryption state and segmented structure change the parameters of code storage, making reverse engineering difficult while preserving executable functionality through controlled decryption.
2Object-affected harmful factors
If the DEX program code is encrypted and split into segments, then the security against reverse engineering is improved, but the device complexity increases
Solution Approach 1:
A DEX shield library acts as an intermediary component that handles the complex tasks of segment loading, decryption, and reassembly. This mediator absorbs the complexity of security operations, allowing the main application to remain relatively simple while still benefiting from enhanced security protections.
3Object-affected harmful factors
If the encrypted segments are stored in separate files, then the security against tampering is improved, but the loss of time for loading and processing increases
Solution Approach 1:
The DEX shield library performs preliminary actions by pre-loading and caching encrypted segments in memory during initialization. This preliminary preparation reduces the time penalty for subsequent code execution, as the segments are already positioned and ready for decryption when needed during runtime.
Data Source
AI summary
Original program code of an app of a mobile operating system is protected by splitting the original program code into several program code segments and encrypting the program code segments. The encrypted program code segments are received in separate files in a mobile computing device, where the encrypted program code segments are loaded in memory of the mobile computing device. The encrypted program code segments are decrypted, and the resulting decrypted program code segments are stored in non-contiguous blocks of memory. The decrypted program code segments are parsed for loading and execution in the mobile computing device, such as by a Dalvik process virtual machine of an ANDROID operating system of the mobile computing device.


