Mobile terminal application security reinforcement method and system
Optimizing mobile application reinforcement through edge computing and Serverless container mode, combined with deep learning and blockchain technology, solves the problems of low resource utilization and reverse engineering in existing technologies, and achieves efficient and safe mobile application reinforcement.
Patent Information
- Application Number
- CN202410709020.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-09-17
AI Technical Summary
Existing mobile application hardening methods have low resource utilization when unpacking and recompiling, and are difficult to cope with dynamic changes in demand. Shell code generation and obfuscation strategies are simple, and it is difficult to effectively resist reverse engineering and cracking. They lack a dynamic instruction set protection mechanism, resulting in The reinforcement effect is not ideal.
Use edge computing nodes to handle the upload process, unpack and recompile through the Serverless container mode, use deep learning algorithms to optimize shell code generation and obfuscation strategies, generate dynamic instruction sets, and execute key codes in the virtual machine environment, combined with blockchain Technology records and verifies the hardening process.
It improves hardening efficiency and security, enhances resistance to reverse engineering and code injection attacks, reduces long-term operating costs, and ensures the non-tamperability and transparency of the signature and hardening process.
Smart Images

Figure CN118656808A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to a method and system for strengthening the security of mobile terminal applications. Background Art
[0002] With the rapid development of mobile Internet, mobile terminal devices such as smart phones and tablet computers have become the main tools for people's daily life and work. Mobile applications (App for short) are widely used in various mobile terminal devices, covering social networks, e-commerce, financial services, online education and other fields. However, the popularity of mobile applications has also brought a large number of security issues, such as data leakage, malicious code implantation, unauthorized access and user privacy infringement. The existing reinforcement methods also have the following problems: when unpacking and recompiling applications, the existing technology usually adopts a static resource allocation method, which has low resource utilization and is difficult to cope with dynamically changing needs; the shell code generation and obfuscation strategies in the existing methods are relatively simple, which is difficult to effectively resist reverse engineering and cracking, resulting in unsatisfactory reinforcement effects; when protecting the key code of the application, the existing reinforcement method lacks a dynamic instruction set protection mechanism and is easily identified and cracked by reverse engineering tools. Summary of the invention
[0003] To solve the above problems, the present invention provides a mobile application security reinforcement method and system, which can effectively resist reverse engineering and code injection attacks by improving reinforcement efficiency, shell code generation and obfuscation strategy, and protection of key codes, thereby improving the overall security of mobile applications and ensuring the security of user data and privacy.
[0004] To achieve the above object, the technical solution adopted by the present invention is:
[0005] On the one hand, a method for strengthening the security of a mobile application includes the following steps:
[0006] S1: Upload the application to be reinforced to the reinforcement platform, select the encryption method, and configure the key and signature file according to the selected encryption method. The upload process is processed by the edge computing node;
[0007] S2: Add the application to be reinforced to the reinforcement queue, unpack and recompile the application through the reinforcement script, and generate a binary file to be processed. The unpacking and recompilation process is performed in the Serverless container mode;
[0008] S3: creating a shell project, using a deep learning algorithm to optimize the generation and obfuscation strategy of the shell code, obfuscating and encrypting the binary file, and generating and matching a new first dynamic instruction set;
[0009] S4: compile the key code of the application to be reinforced into an intermediate binary file. When executing the key code, it is executed only in the secure operating environment of the virtual machine. By modifying the method body of the key method, the original instruction is encapsulated using the virtual machine, and the instruction is forwarded when the function instruction is executed. During the forwarding process, the method name and parameters are dynamically obfuscated to generate a second dynamic instruction set.
[0010] S5: Integrate and package the first dynamic instruction set and the second dynamic instruction set, sign the generated application package according to the configured signature file, output the result package, and use blockchain technology to record and verify the signature file and the reinforcement process.
[0011] Furthermore, the step S4 specifically includes the following steps:
[0012] S41: statically analyzing the key methods in the application to be reinforced, identifying and extracting key code snippets, replacing instructions in the original method body with virtual machine call instructions, and generating a new method body; the new method body includes virtual machine call instructions, control flow management code, and dynamic instruction forwarding;
[0013] S42: Encapsulate the original instructions of the key method into an intermediate language instruction set executable by the virtual machine;
[0014] S43: When executing the key code, encapsulate the original instruction through the virtual machine instruction set, and forward the instruction when the instruction is executed;
[0015] S44: During the instruction forwarding process, the method name and parameters are obfuscated in real time using dynamic obfuscation technology to generate a second dynamic instruction set;
[0016] S45: Use machine learning algorithms to monitor the execution environment of virtual machines in real time to detect and defend against dynamic debugging behaviors.
[0017] Furthermore, the dynamic obfuscation technology specifically includes the following steps:
[0018] Randomize method names to generate unique names each time they are called;
[0019] When calling a method, the parameters are encrypted using a symmetric encryption algorithm and then decrypted in the virtual machine before being passed to the original method.
[0020] Dynamically rearrange the instruction sequence before and after the instruction is executed, so that the instruction execution order is different from the source code, and the difficulty of reverse engineering is increased by changing the code execution path;
[0021] The instructions are obfuscated in combination with runtime data, the obfuscation strategy is dynamically adjusted according to real-time data, and a second dynamic instruction set different from the original code is generated.
[0022] Furthermore, the machine learning algorithm includes one or more of a Gaussian mixture model, an isolation forest algorithm, a support vector machine, and a policy gradient algorithm.
[0023] Furthermore, in step S3, the deep learning algorithm adopts a graph neural network algorithm, which includes the following steps:
[0024] Analyze the source code of the application to be hardened, extract the code structure, control flow graph and data flow graph, and represent them as graph structure data;
[0025] Based on the graph structure data, construct an input graph of the graph neural network, wherein nodes represent code basic blocks or methods, and edges represent control flow or data flow relationships between basic blocks;
[0026] The constructed input graph is used to train the graph neural network model. The model learns the structural features and execution paths of the code and generates obfuscation and encryption strategies for optimizing the shell code.
[0027] Generate and optimize shell code using the trained graph neural network model, including operations such as obfuscating code logic, inserting pseudocode, and adjusting control flow;
[0028] Based on the optimized shell code, a new first dynamic instruction set is generated.
[0029] Furthermore, the formula of the graph neural network algorithm is as follows:
[0030]
[0031] in, Represents the final feature vector of node i after k layers of propagation; Indicates the characteristic state of neighbor node j at the k-1 layer that has a direct control flow or data flow relationship with node i; represents the set of neighbor nodes of node i, which represents other code blocks that have control flow or data flow relationship with the current code block; W (k) represents the weight matrix of the kth layer, represents the parameters of the model at the kth layer; σ represents the activation function; c ij Represents the normalized coefficient between node i and node j.
[0032] Furthermore, the Serverless container mode is specifically based on the containerized deployment of the serverless architecture, and uses function-as-a-service technology to automatically handle unpacking and recompilation tasks, including a reinforced task scheduler and a reinforced task executor.
[0033] On the other hand, a mobile terminal application security reinforcement system includes a reinforcement platform, a reinforcement queue management module, a shell project generation module, a virtual machine execution module and a recording module; the reinforcement queue management module, the shell project generation module, the virtual machine execution module and the recording module are communicatively connected;
[0034] The reinforcement platform is used to receive the application to be reinforced, encrypt it through the communication protocol transparent reinforcement technology, configure the key and signature files, and use the edge computing node to process the upload and reinforcement tasks;
[0035] The reinforcement queue management module is used to unpack and recompile applications in the Serverless container mode, generate binary files to be processed, and manage the reinforcement queue;
[0036] The shell engineering generation module is used to use a deep learning algorithm to optimize the generation and obfuscation strategy of the shell code, obfuscate and encrypt the binary file, and generate and match a new first dynamic instruction set;
[0037] The virtual machine execution module is used to compile the key code into an intermediate binary file, execute it in the secure operating environment of the virtual machine, and generate a second dynamic instruction set by encapsulating and forwarding instructions through the virtual machine;
[0038] The recording module is used to integrate and package dynamic instruction sets, sign application packages, and use blockchain technology to record and verify the reinforcement process.
[0039] The beneficial effects of the present invention are:
[0040] The present invention utilizes edge computing nodes to process the upload process, effectively reducing the load on the reinforcement platform and improving the overall processing efficiency. Through the communication protocol transparent reinforcement technology and the configuration of keys and signature files, the data security of the application during the upload and reinforcement process is ensured. Unpacking and recompiling in the Serverless container mode reduces the static occupation of resources and improves the flexibility and efficiency of the reinforcement process. Based on the Serverless container mode, it can be elastically scaled in real time with user usage. Without reserving a large amount of computing resources, it can ensure that each user request is immediately executed by an independent container at any concurrent scale, reducing the long-term operating cost of the reinforcement operation process by 90%. For encryption methods, users can customize code obfuscation rules, encryption algorithms, and keys to complete the security reinforcement of mobile applications.
[0041] The deep learning algorithm is used to optimize the generation and obfuscation strategy of the shell code, ensuring the advanced obfuscation and encryption of the shell project, increasing the difficulty of cracking. By generating and matching the new first and second dynamic instruction sets, the key code of the application is effectively protected to prevent reverse engineering and code injection attacks. The key code is executed in the secure operating environment of the virtual machine, and the security of the key code is further improved through instruction forwarding and dynamic obfuscation processing. The signature file and the reinforcement process are recorded and verified throughout the process in combination with blockchain technology, ensuring the immutability and transparency of the signature and reinforcement process, and improving the credibility and security of the entire reinforcement process. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 It is a flow chart of a method for strengthening the security of mobile terminal applications according to the present invention.
[0043] Figure 2 It is a module schematic diagram of a mobile terminal application security reinforcement system of the present invention. DETAILED DESCRIPTION
[0044] See also Figure 1-2 As shown, the present invention relates to a method and system for strengthening the security of mobile terminal applications.
[0045] Example 1
[0046] A method for strengthening the security of mobile applications includes the following steps:
[0047] S1: Upload the application to be reinforced to the reinforcement platform, select the encryption method, and configure the key and signature file according to the selected encryption method. The upload process is processed by the edge computing node;
[0048] Specifically, the application installation package to be reinforced (such as APK file) is uploaded to the platform through the upload function of the platform. During the upload process, the platform provides a variety of encryption methods to choose from (such as AES, RSA, etc.). Select an encryption method that suits the security requirements of its application. According to the selected encryption method, the corresponding encryption key and signature file need to be configured. These keys and files need to be uploaded to the platform for use in the subsequent reinforcement process. The uploaded application data is processed at the edge computing node to improve the upload speed and processing efficiency. Edge computing nodes can be distributed all over the world, close to users, to improve data transmission efficiency.
[0049] In one embodiment, the hardening platform uses a communication protocol transparent hardening technology, which is a technology for encrypting the communication content between the client and the server, and includes two parts: the client SDK and the encrypted communication gateway SDK:
[0050] 1. The client SDK is implemented based on system hooks and transparent protocols, and is suitable for any platform based on the Linux operating system, as well as the Unix-based iOS platform, with good adaptability.
[0051] 2. The server SDK is implemented based on Java and uses a non-intrusive Java Agent. It works at the TCP / IP transport layer, automatically encrypts the TCP / IP protocol or the QUIC protocol, and supports all communication scenarios based on the TCP and QUIC protocols. It has the following two application modes:
[0052] a. It can be integrated with Spring Cloud Gateway and used as an independent encrypted communication gateway independent of the microservices of the application.
[0053] b. It can be integrated by any Spring Boot-based application to encrypt sensitive information communication services.
[0054] S2: Add the application to be reinforced to the reinforcement queue, unpack and recompile the application through the reinforcement script, generate a binary file to be processed, and the unpacking and recompilation process is performed in the Serverless container mode; the Serverless container mode is specifically based on the containerized deployment of the serverless architecture, and uses function as a service technology to automatically handle unpacking and recompilation tasks, including a reinforcement task scheduler and a reinforcement task executor.
[0055] It should be noted that the Serverless container mode is a mode for deploying and reinforcing the main program. It is used to implement multi-tenant and multi-user concurrent scheduling when providing SAAS services to the outside world. This mode has the following two parts:
[0056] 1. Reinforcement Task Scheduler: The reinforcement task scheduler is a microservice used to schedule executors to perform reinforcement tasks. Its workflow is as follows:
[0057] a. When the scheduler starts, the task listener thread is started to automatically listen to the tasks in the task queue. The task queue is implemented in Redis List format.
[0058] b. When a new task is received from the queue, the scheduler automatically calls the Kubernetes API, creates a hardened task executor container, and passes the task parameters to the executor container in the form of container environment variables.
[0059] c. Check the task execution status every second and update the execution progress for the front-end application to retrieve.
[0060] d. When it is detected that the executor has returned the execution result, the result is written into the cache for the front-end application to retrieve.
[0061] 2. Reinforcement task executor: It has a built-in reinforcement main program and is scheduled by the reinforcement task scheduling service. Each application reinforcement task runs in an independent container, and each container has 4 cores and 8GB of memory.
[0062] The main program of application hardening is a computing-intensive application. If computing resources are reserved during peak hours, the cost will be very high. Serverless uses a use-and-destroy method to reduce peak costs and fill valleys. During actual testing, the average service cost per customer was reduced by more than 90%, which also makes the product more competitive in price.
[0063] It should be noted that the edge computing mode is a lightweight private version of the Serverless container mode. It also has a hardened task scheduler and a hardened task executor. The executor is exactly the same as the executor in the Serverless container mode, but the scheduler and scheduling method are slightly different:
[0064] 1. When the scheduler starts, it automatically completes the following tasks:
[0065] a. Automatically register with the MQTT server in the cloud and listen to the node configuration topic.
[0066] b. If a node configuration update instruction is received, the local configuration is updated immediately, and a localized hardening key is generated based on the node configuration and user configuration.
[0067] c. If no node configuration update instruction is received, load the hardening key in the local database.
[0068] 2. When the scheduler is running, it automatically monitors the node task topic in the MQTT server. When it receives a task sent by the server, it performs the following actions:
[0069] a. Check the current CPU and memory load and handle them according to the actual situation:
[0070] i. If there are enough free resources to start an executor container, the executor container is started immediately to start executing the task.
[0071] ii. If there are insufficient free resources to start an executor container, the task is temporarily stored in the waiting queue and the executor is started again when there are sufficient free resources.
[0072] b. Collect actuator status and logs in real time and transmit them back to the server via the MQTT protocol.
[0073] In the edge computing mode, container environment variables are also used to pass task parameters between the scheduler and the executor without introducing third-party middleware.
[0074] S3: creating a shell project, using a deep learning algorithm to optimize the generation and obfuscation strategy of the shell code, obfuscating and encrypting the binary file, and generating and matching a new first dynamic instruction set;
[0075] The deep learning algorithm adopts a graph neural network algorithm, which includes the following steps:
[0076] Analyze the source code of the application to be hardened, extract the code structure, control flow graph and data flow graph, and represent them as graph structure data;
[0077] It should be noted that the control flow graph (CFG) extracts the control flow graph of each function or method, indicating the execution path between the basic blocks of the code; the data flow graph (DFG) generates a data flow graph to indicate the definition and usage relationship of variables in the code.
[0078] Based on the graph structure data, construct an input graph of the graph neural network, wherein nodes represent code basic blocks or methods, and edges represent control flow or data flow relationships between basic blocks;
[0079] It should be noted that in the input graph of the graph neural network, each node represents a basic block or method of the code, including the instructions, opcodes, variables and other information of the basic block; the edge represents the control flow (such as jumps, branches) or data flow (such as variable transfer, data dependency) relationship between basic blocks. Graph construction: Based on the extracted control flow graph and data flow graph, the input graph of the graph neural network is constructed; the adjacency matrix is used to represent the relationship between nodes, and each node contains an initial feature vector, which represents the attributes of the basic block.
[0080] The constructed input graph is used to train the graph neural network model. The model learns the structural features and execution paths of the code and generates obfuscation and encryption strategies for optimizing the shell code.
[0081] Generate and optimize shell code using the trained graph neural network model, including operations such as obfuscating code logic, inserting pseudocode, and adjusting control flow;
[0082] It should be noted that code obfuscation: using the obfuscation strategy generated by the trained graph neural network model to obfuscate the binary file. The obfuscation strategy includes operations such as renaming variables, reconstructing control flow, and inserting useless code (pseudocode).
[0083] Insert pseudocode: Insert pseudocode segments based on model suggestions to increase code complexity and difficulty of reverse engineering.
[0084] Control flow adjustment: Adjust the control flow by inserting jump instructions and branch instructions to generate more complex and difficult to analyze control flow structures.
[0085] Shell code generation: Generate optimized shell code, including obfuscated logic and inserted pseudocode, to ensure the correctness and security of the code during execution.
[0086] Based on the optimized shell code, a new first dynamic instruction set is generated.
[0087] Furthermore, the formula of the graph neural network algorithm is as follows:
[0088]
[0089] in, Represents the final feature vector of node i after k layers of propagation; Indicates the characteristic state of neighbor node j at the k-1 layer that has a direct control flow or data flow relationship with node i; represents the set of neighbor nodes of node i, which represents other code blocks that have control flow or data flow relationship with the current code block; W (k) represents the weight matrix of the kth layer, represents the parameters of the model at the kth layer; σ represents the activation function; c ij Represents the normalized coefficient between node i and node j.
[0090] S4: compile the key code of the application to be reinforced into an intermediate binary file. When executing the key code, it is executed only in the secure operating environment of the virtual machine. By modifying the method body of the key method, the original instruction is encapsulated using the virtual machine, and the instruction is forwarded when the function instruction is executed. During the forwarding process, the method name and parameters are dynamically obfuscated to generate a second dynamic instruction set.
[0091] Wherein, the step S4 specifically includes the following steps:
[0092] S41: statically analyzing the key methods in the application to be reinforced, identifying and extracting key code snippets, replacing instructions in the original method body with virtual machine call instructions, and generating a new method body; the new method body includes virtual machine call instructions, control flow management code, and dynamic instruction forwarding;
[0093] S42: Encapsulating the original instructions of the key method into an intermediate language instruction set executable by the virtual machine, wherein the intermediate language instruction set is dynamically parsed and executed by the virtual machine when the application is running. During the encapsulation process, the virtual machine performs secondary obfuscation and encryption processing on the intermediate language instruction set;
[0094] S43: When executing the key code, encapsulate the original instruction through the virtual machine instruction set, and forward the instruction when the instruction is executed;
[0095] S44: During the instruction forwarding process, the method name and parameters are obfuscated in real time using dynamic obfuscation technology to generate a second dynamic instruction set;
[0096] Specifically, the dynamic obfuscation technology includes the following steps:
[0097] Randomize method names to generate unique names each time they are called;
[0098] When calling a method, the parameters are encrypted using a symmetric encryption algorithm and then decrypted in the virtual machine before being passed to the original method.
[0099] Dynamically rearrange the instruction sequence before and after the instruction is executed, so that the instruction execution order is different from the source code, and the difficulty of reverse engineering is increased by changing the code execution path;
[0100] The instructions are obfuscated in combination with runtime data, the obfuscation strategy is dynamically adjusted according to real-time data, and a second dynamic instruction set different from the original code is generated.
[0101] S45: Use a machine learning algorithm to monitor the execution environment of the virtual machine in real time, detect and defend against dynamic debugging behavior; the machine learning algorithm includes one or more of a Gaussian mixture model, an isolation forest algorithm, a support vector machine, and a policy gradient algorithm.
[0102] It should be noted that the Gaussian mixture model (GMM) is used to monitor the execution environment of the virtual machine and detect abnormal behaviors.
[0103] Isolation Forest Algorithm: Identify and isolate suspicious dynamic debugging behaviors through the Isolation Forest Algorithm.
[0104] Support Vector Machine (SVM): SVM model is used to classify and detect potential security threats.
[0105] Policy gradient algorithm: Use the policy gradient algorithm to optimize the virtual machine's defense strategy and improve the detection and defense capabilities of dynamic debugging behavior.
[0106] S5: Integrate and package the first dynamic instruction set and the second dynamic instruction set, sign the generated application package according to the configured signature file, output the result package, and use blockchain technology to record and verify the signature file and the reinforcement process.
[0107] It should be noted that the reinforcement platform integrates blockchain technology, and records important operations in the reinforcement process on the blockchain, including the hash value of the application package, signature file, reinforcement time and other information. The distributed ledger technology of the blockchain ensures that all records are verified and saved by multiple nodes to prevent data tampering. Any modification and reinforcement operation will be recorded on the blockchain, and users can view the reinforcement records at any time to ensure the transparency of the process. Users can verify the integrity of the application package and the authenticity of the reinforcement process through the blockchain. By querying the records on the blockchain, the consistency of the signature file and the application package can be confirmed. The blockchain uses a consensus algorithm (such as PoW or PoS) to ensure the reliability and consistency of the records. Each record will be verified by multiple nodes, and the record will be written to the blockchain only after reaching a consensus through the consensus algorithm. Multiple independent nodes participate in the consensus process to ensure that no single node can tamper with the record, thereby ensuring the security and authenticity of the data.
[0108] Example 2
[0109] A mobile terminal application security reinforcement system, comprising a reinforcement platform, a reinforcement queue management module, a shell project generation module, a virtual machine execution module and a recording module; the reinforcement queue management module, the shell project generation module, the virtual machine execution module and the recording module are communicatively connected;
[0110] The reinforcement platform is used to receive the application to be reinforced, encrypt it through the communication protocol transparent reinforcement technology, configure the key and signature files, and use the edge computing node to process the upload and reinforcement tasks;
[0111] The reinforcement queue management module is used to unpack and recompile applications in the Serverless container mode, generate binary files to be processed, and manage the reinforcement queue;
[0112] The shell engineering generation module is used to use a deep learning algorithm to optimize the generation and obfuscation strategy of the shell code, obfuscate and encrypt the binary file, and generate and match a new first dynamic instruction set;
[0113] The virtual machine execution module is used to compile the key code into an intermediate binary file, execute it in the secure operating environment of the virtual machine, and generate a second dynamic instruction set by encapsulating and forwarding instructions through the virtual machine;
[0114] The recording module is used to integrate and package dynamic instruction sets, sign application packages, and use blockchain technology to record and verify the reinforcement process.
[0115] In summary, this application can effectively reduce the delay of data transmission and significantly improve the upload speed and processing efficiency by processing the upload process through the edge computing node. The communication protocol transparent reinforcement technology ensures the security of data transmission by encrypting the communication content between the client and the server. It is applicable to a wide range of platforms and communication protocols, and improves the adaptability and security of the system. The serverless container mode adopts the method of starting and destroying resources on demand, which greatly reduces the waste of computing resources, significantly reduces the average service cost per customer, and provides more competitive prices. The shell code generation and obfuscation strategy are optimized by deep learning algorithms, which further improves the complexity of code obfuscation and the difficulty of reverse engineering, and improves the security of the application. The virtual machine execution module is used to compile the key code into an intermediate binary file, and the method name and parameters are obfuscated in real time through dynamic obfuscation technology, which increases the difficulty of reverse engineering and protects sensitive code during instruction execution. The execution environment of the virtual machine is monitored in real time through machine learning algorithms (such as Gaussian mixture model, isolation forest algorithm, support vector machine, etc.), which can detect and defend potential security threats and dynamic debugging behaviors in a timely manner, and improve the security defense capability of the system. Integrate blockchain technology to record and verify important operations in the reinforcement process, ensure the immutability of data through distributed ledger technology, and allow users to view and verify reinforcement records at any time, enhancing the transparency and credibility of the reinforcement process.
[0116] The above implementation modes are merely descriptions of the preferred implementation modes of the present invention, and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary engineering and technical personnel in the field shall fall within the protection scope determined by the claims of the present invention.
Claims
1. A method for strengthening the security of mobile terminal applications, characterized in that: The following steps are involved: S1: Upload the application to be reinforced to the reinforcement platform, select the encryption method, and configure the key and signature file according to the selected encryption method. The upload process is processed by the edge computing node; S2: Add the application to be reinforced to the reinforcement queue, unpack and recompile the application through the reinforcement script, and generate a binary file to be processed. The unpacking and recompilation process is performed in the Serverless container mode; S3: creating a shell project, using a deep learning algorithm to optimize the generation and obfuscation strategy of the shell code, obfuscating and encrypting the binary file, and generating and matching a new first dynamic instruction set; S4: compile the key code of the application to be reinforced into an intermediate binary file. When executing the key code, it is executed only in the secure operating environment of the virtual machine. By modifying the method body of the key method, the original instruction is encapsulated using the virtual machine, and the instruction is forwarded when the function instruction is executed. During the forwarding process, the method name and parameters are dynamically obfuscated to generate a second dynamic instruction set. S5: Integrate and package the first dynamic instruction set and the second dynamic instruction set, sign the generated application package according to the configured signature file, output the result package, and use blockchain technology to record and verify the signature file and the reinforcement process.
2. A method for strengthening mobile terminal application security according to claim 1, characterized in that: The step S4 specifically comprises the following steps: S41: statically analyzing the key methods in the application to be reinforced, identifying and extracting key code snippets, replacing instructions in the original method body with virtual machine call instructions, and generating a new method body; the new method body includes virtual machine call instructions, control flow management code, and dynamic instruction forwarding; S42: Encapsulate the original instructions of the key method into an intermediate language instruction set executable by the virtual machine; S43: When executing the key code, encapsulate the original instruction through the virtual machine instruction set, and forward the instruction when the instruction is executed; S44: During the instruction forwarding process, the method name and parameters are obfuscated in real time using dynamic obfuscation technology to generate a second dynamic instruction set; S45: Use machine learning algorithms to monitor the execution environment of virtual machines in real time to detect and defend against dynamic debugging behaviors.
3. A method for strengthening the security of mobile terminal applications according to claim 2, characterized in that: The dynamic obfuscation technology specifically includes the following steps: Randomize method names to generate unique names each time they are called; When calling a method, the parameters are encrypted using a symmetric encryption algorithm and then decrypted in the virtual machine before being passed to the original method. Dynamically rearrange the instruction sequence before and after the instruction is executed, so that the instruction execution order is different from the source code, and the difficulty of reverse engineering is increased by changing the code execution path; The instructions are obfuscated in combination with runtime data, the obfuscation strategy is dynamically adjusted according to real-time data, and a second dynamic instruction set different from the original code is generated.
4. A method for strengthening the security of mobile terminal applications according to claim 2, characterized in that: The machine learning algorithm includes one or more of a Gaussian mixture model, an isolation forest algorithm, a support vector machine, and a policy gradient algorithm.
5. A method for strengthening mobile terminal application security according to claim 1, characterized in that: In step S3, the deep learning algorithm adopts a graph neural network algorithm, which includes the following steps: Analyze the source code of the application to be hardened, extract the code structure, control flow graph and data flow graph, and represent them as graph structure data; Based on the graph structure data, construct an input graph of the graph neural network, wherein nodes represent code basic blocks or methods, and edges represent control flow or data flow relationships between basic blocks; The constructed input graph is used to train the graph neural network model. The model learns the structural features and execution paths of the code and generates obfuscation and encryption strategies for optimizing the shell code. Generate and optimize shell code using the trained graph neural network model, including operations such as obfuscating code logic, inserting pseudocode, and adjusting control flow; Based on the optimized shell code, a new first dynamic instruction set is generated.
6. A method for strengthening mobile terminal application security according to claim 5, characterized in that: The formula of the graph neural network algorithm is as follows: in, Represents the final feature vector of node i after k layers of propagation; Indicates the characteristic state of neighbor node j at the k-1 layer that has a direct control flow or data flow relationship with node i; represents the set of neighbor nodes of node i, which represents other code blocks that have control flow or data flow relationship with the current code block; W (k) represents the weight matrix of the kth layer, represents the parameters of the model at the kth layer; σ represents the activation function; c ij Represents the normalized coefficient between node i and node j.
7. A method for strengthening mobile terminal application security according to claim 1, characterized in that: The Serverless container mode is specifically based on the containerized deployment of the serverless architecture, and uses function-as-a-service technology to automatically handle unpacking and recompilation tasks, including a hardened task scheduler and a hardened task executor.
8. A mobile application security reinforcement system, characterized in that: The system is applied to a mobile application security reinforcement method as described in any one of claims 1 to 7, comprising a reinforcement platform, a reinforcement queue management module, a shell project generation module, a virtual machine execution module and a recording module; the reinforcement queue management module, the shell project generation module, the virtual machine execution module and the recording module are communicatively connected; The reinforcement platform is used to receive the application to be reinforced, encrypt it through the communication protocol transparent reinforcement technology, configure the key and signature files, and use the edge computing node to process the upload and reinforcement tasks; The reinforcement queue management module is used to unpack and recompile applications in the Serverless container mode, generate binary files to be processed, and manage the reinforcement queue; The shell engineering generation module is used to use a deep learning algorithm to optimize the generation and obfuscation strategy of the shell code, obfuscate and encrypt the binary file, and generate and match a new first dynamic instruction set; The virtual machine execution module is used to compile the key code into an intermediate binary file, execute it in the secure operating environment of the virtual machine, and generate a second dynamic instruction set by encapsulating and forwarding instructions through the virtual machine; The recording module is used to integrate and package dynamic instruction sets, sign application packages, and use blockchain technology to record and verify the reinforcement process.
