DEX File Method-Level Encryption for Faster, Safer App Execution

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

DEX files in Android operating systems are vulnerable to hacking and reverse engineering, leading to slow execution times due to encryption and the need for full decryption, which exposes the entire DEX file to memory dumps.

Innovation Solution

Compile DEX files into machine language and encrypt each method separately, decrypting only the necessary methods during execution, and distribute them in memory to prevent exposure and optimize loading times.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the entire DEX file is encrypted to protect from reverse engineering, then security is improved, but the time required to compile and execute the app increases significantly

Engineering Contradiction:
ImprovesecurityVSAvoidcompilation time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent divides the DEX file into individual method-level units, encrypting only the necessary methods rather than the entire file. This segmentation allows the system to maintain security through encryption while reducing compilation time by processing only encrypted portions rather than decrypting and compiling the whole DEX file.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs preliminary compilation of the DEX file into machine language before encryption, creating a pre-compiled encrypted version. This preliminary action eliminates the need for full decryption and re-compilation at runtime, significantly reducing execution time while maintaining security through the encrypted pre-compiled state.

Inventive Principle:
Principle #10Preliminary action

2Speed

If the entire DEX file is decrypted and loaded into memory for execution, then execution speed is improved, but the risk of memory dumps exposing the entire code increases

Engineering Contradiction:
Improveexecution speedVSAvoidcode exposure risk
Core Design Contradiction:
SpeedVSObject-affected harmful factors

Solution Approach 1:

The patent segments the DEX file into individual methods, decrypting and loading only the specific methods needed for execution into memory. This segmentation ensures that even if a memory dump occurs, only the currently executing methods are exposed rather than the entire codebase, maintaining execution speed while reducing the attack surface.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent extracts only the necessary method portions from the encrypted DEX file and decrypts them on-demand for execution. This extraction approach allows the system to load minimal code into memory for execution while keeping the rest of the encrypted code protected, preventing comprehensive code exposure through memory dumps.

Inventive Principle:
Principle #2Taking out (Extraction)

3Speed

If DEX files are compiled into machine language in advance (AOT compilation), then execution speed is improved, but the ability to protect against reverse engineering is reduced

Engineering Contradiction:
Improveexecution speedVSAvoidreverse engineering protection
Core Design Contradiction:
SpeedVSReliability

Solution Approach 1:

The patent performs preliminary AOT compilation of the DEX file into machine language before encryption, creating optimized machine code that executes quickly. This preliminary compilation maintains execution speed benefits while the subsequent encryption of the compiled output provides protection against reverse engineering, as the optimized machine code remains encrypted and inaccessible to attackers.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent creates an encrypted copy of the machine language DEX file that preserves the optimized execution characteristics of AOT compilation while adding security through encryption. This encrypted copy can be executed efficiently by the virtual machine while protecting the underlying machine code from reverse engineering, effectively copying the performance benefits without exposing the code structure.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS20250225265A1Device and method for providing security for DEX file protection and device and method for executing security
Publication Date: 2025.07.10 INKA ENTWORKS INC
  • US20250225265A1 patent drawing
  • US20250225265A1 patent drawing
  • US20250225265A1 patent drawing

AI summary

The present invention relates to a device and method for providing security, and a device and method for executing security that can protect DEX files from hacking and reduce the time required to execute an app. Specifically, the security providing method for protecting a DEX file of the invention, comprises the steps of; extracting a DEX file from an app received from a program developing device; compiling said extracted DEX file into a machine language DEX file; protecting said compiled machine language DEX file; generating a replacement DEX file capable of executing said protected machine language DEX file; and packaging said protected machine language DEX file, said generated replacement DEX file, and associated ELF files into an app.