Cross-language shell enhancement method and device, electronic equipment and storage medium

By using a cross-language shell enhancement method, a protective shell is added to the target application and ELF format program. By using white-box cryptography algorithms and the JNI framework to transmit keys, the security problem of the protective shell in a multi-language environment is solved, and effective protection of ELF format programs is achieved.

CN116628645BActive Publication Date: 2026-11-24BEIJING NOVEL SUPER DIGITAL TV TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310644052.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-01
Publication Date
2026-11-24
Estimated Expiration
2043-06-01

AI Technical Summary

Technical Problem

Existing technologies are insufficient to effectively prevent apps from being reverse engineered, especially in multilingual environments where the security of protective shells is inadequate, making it easy for keys to be tracked and obtained, and ELF format programs to be analyzed separately.

Method used

A cross-language shell enhancement method is adopted to add a protective shell to the target application and the ELF format program. The key is stored using a white-box cryptographic algorithm. The key-related variables are transferred between the Java environment and the ELF format program through the JNI framework. The decryption and data restoration are performed before the ELF format program runs to prevent key leakage and separate program analysis.

Benefits of technology

It improves the data confidentiality of the protective shell, prevents ELF format programs from being analyzed separately, ensures key security, and enhances the protection against reverse engineering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116628645B_ABST
    Figure CN116628645B_ABST
Patent Text Reader

Abstract

This invention discloses a cross-language shell enhancement method, apparatus, electronic device, and storage medium. The method includes: adding a protective shell to an ELF format program required for the normal operation of a target application, wherein the target application and the ELF format program are implemented in different languages; the protective shell stores a white-box cryptographic algorithm, and the target application stores a white-box cryptographic box; after the target application starts, the white-box cryptographic box is initialized to obtain key-related variables, and the key-related variables are transmitted to the ELF format program; the protective shell decrypts the encrypted data of the ELF format program based on the key-related variables and the white-box cryptographic algorithm. This invention effectively improves the confidentiality of data protected by the shell and effectively prevents the shelled ELF format program from being analyzed independently.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and more particularly to the field of information processing security, specifically to a cross-language shell enhancement method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the increasing frequency of account password theft and customer account information theft incidents, protecting mobile applications from reverse engineering has become a top priority. App protection refers to using various code-hardening techniques such as Java, Kotlin, and C / C++ to obfuscate critical logic code and prevent reverse engineering. Summary of the Invention

[0003] This invention provides a cross-language shell enhancement method, apparatus, electronic device, and storage medium.

[0004] According to one aspect of the present invention, a cross-language shell enhancement method is provided, the method comprising:

[0005] A protective shell is added to the ELF format program required for the normal operation of the target application, wherein the target application and the ELF format program are implemented in different languages, the protective shell stores a white-box cryptographic algorithm, and the target application stores a white-box cryptographic box;

[0006] After the target application starts, the white-box password box is initialized, key-related variables are obtained, and the key-related variables are transmitted to the ELF format program;

[0007] The protective shell decrypts the encrypted data of the ELF format program based on the key-related variables and the white-box cryptographic algorithm.

[0008] According to another aspect of the present invention, a cross-language shell enhancement device is provided, the device comprising:

[0009] The packer module is used to add a protective shell to the ELF format program required for the normal operation of the target application. The target application and the ELF format program are implemented in different languages. The protective shell stores a white-box cryptographic algorithm, and the target application stores a white-box cryptographic box.

[0010] An initialization and transmission module is used to initialize the white-box cryptographic box after the target application starts, obtain key-related variables, and transmit the key-related variables to the ELF format program;

[0011] The decryption module is used by the protective shell to decrypt the encrypted data of the ELF format program based on the key-related variables and the white-box cryptographic algorithm.

[0012] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0013] At least one processor; and

[0014] A memory communicatively connected to the at least one processor; wherein,

[0015] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the cross-language shell enhancement method described in the embodiments of the present invention.

[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the cross-language shell enhancement method described in the embodiments of the present invention.

[0017] The technical solution of this invention can effectively improve the confidentiality of data by the protective shell and effectively prevent the ELF format program with the protective shell from being analyzed separately.

[0018] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1a This is a flowchart illustrating a cross-language shell enhancement method according to Embodiment 1 of the present invention;

[0021] Figure 1b This is a logical process diagram of the cross-language shell enhancement method provided in Embodiment 1 of the present invention;

[0022] Figure 2 This is a flowchart illustrating a cross-language shell enhancement method according to Embodiment 2 of the present invention;

[0023] Figure 3 This is a schematic diagram of the structure of a cross-language shell enhancement device according to Embodiment 3 of the present invention;

[0024] Figure 4 This is a schematic diagram of the structure of an electronic device that implements the cross-language shell enhancement method of this invention. Detailed Implementation

[0025] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0026] Example 1

[0027] Figure 1a The flowchart below provides a cross-language shell enhancement method according to Embodiment 1 of the present invention. This embodiment is applicable to security systems using ELF file structures, typically for scenarios involving the protection of dynamic libraries with shells. This method can be executed by a cross-language shell enhancement device, which can be implemented in hardware and / or software and can be configured in an electronic device.

[0028] like Figure 1a As shown, this cross-language shell enhancement method includes:

[0029] S101. Add a protective shell to the ELF format program required for the target application to run normally.

[0030] In this embodiment, the target application and the ELF format program are implemented in different languages. For example, the target application is an application implemented in Java that can run on a target operating system, where the target operating system can be any operating system with a Java runtime environment. The ELF format program can be a dynamic library program, where a dynamic library, also known as a dynamic link library, is a library containing code and data that can be used by multiple programs simultaneously. Dynamic link libraries provide a method for a process to call functions that are not part of its executable code. The executable code of the function resides in a SO or DLL, which contains one or more functions that have been compiled, linked, and stored separately from the processes that use them. An SO or DLL is a library containing code and data that can be used by multiple programs simultaneously. In this embodiment, the dynamic library serving as the ELF format program can be implemented in C.

[0031] In this embodiment, adding a protective shell to an ELF format program involves injecting a piece of code into the program. This code takes control of the program during runtime and then returns control to the original code. It's important to note that when adding the protective shell, a white-box encryption algorithm is used to encrypt the code instructions of the ELF format program, and the data of the ELF format program is compressed. Therefore, when the protective shell takes control of the program, it mainly decrypts the encrypted code instructions and restores them to memory, while simultaneously decompressing and restoring the program's data to memory. This ensures that the program can run normally in memory after gaining control. The specific implementation process can be found in steps S102-S103. It should be noted that the core code of the ELF format program is located in the compressed and encrypted sections, making it impossible to directly analyze using a decompiler or extract using decompression algorithms. This effectively protects the ELF format program.

[0032] In this embodiment, considering the risks of placing the decryption key in the ELF format program—namely, the ease with which the decryption key can be tracked and obtained, and the ability to analyze the ELF format program independently of the target application—the decryption key is stored in the target application, rather than within the ELF format program. In an optional implementation, the target application includes a white-box cryptographic box containing the decryption key. This solves the problem of the protective shell's inability to securely store the decryption key. To ensure that the protective shell can decrypt normally after gaining control of the ELF format program, a white-box cryptographic algorithm is stored within the protective shell.

[0033] S102. After the target application starts, initialize the white-box password box, obtain key-related variables, and transmit the key-related variables to the ELF format program.

[0034] In this embodiment, after the target application starts, the white-box cryptographic box is initialized to obtain key-related variables, which are the decryption keys. The purpose of initializing the white-box cryptographic box is to convert the key in the Java environment into a key that can be recognized and used by the ELF format program's protective shell. To ensure that the ELF format program's protective shell can correctly decrypt and restore its encrypted code, the key-related variables need to be passed from the Java environment to the ELF format program. In an optional implementation, since the target operating system used to run the Java application provides a JNI framework, the key-related variables can be transmitted to the ELF format program through the JNI framework provided by the target operating system. That is, the JNI framework is used as a data transmission intermediary.

[0035] S103. The protective shell decrypts the encrypted data of the ELF format program based on the key-related variables and the white-box cryptographic algorithm.

[0036] In this embodiment, after the ELF format program gains control, it invokes the white-box cryptographic algorithm within the protective shell and obtains key-related variables through the JNI interface provided by the JNI framework. Then, based on the key-related variables and the white-box cryptographic algorithm, it decrypts the encrypted data (i.e., the program's code instructions) of the ELF format program and restores it to memory. Further, after decryption and restoration, the compressed data of the ELF format program is decompressed and restored to memory. Afterward, the protective shell returns control of the ELF format program to its original code, allowing the ELF format program to run normally.

[0037] Furthermore, for a detailed description of the logical flow of the present invention, please refer to [link to relevant documentation]. Figure 1b This demonstrates the logical process of a cross-language shell enhancement method. The target application is a Java application, and the ELF format program is a dynamic library (native library). The shell of the dynamic library stores the white-box cryptographic algorithm, while the Java application stores a white-box cryptographic box containing the decryption key. The operating system provides the JNI framework. In the specific implementation, after the Java program starts, it first initializes the white-box cryptographic box, and then passes the key-related variables obtained during initialization to the JNI framework. After the shell of the dynamic library gains execution privileges, it calls the white-box cryptographic algorithm, retrieves the key-related variables through the interface provided by the JNI framework, decrypts and restores the encrypted code of the dynamic library, decompresses the compressed data, and finally returns control to the main program of the dynamic library.

[0038] This embodiment effectively improves the security of the shell in the following ways: First, adding a protective shell to the ELF format program prevents it from being directly statically analyzed by disassemblers; second, the cross-language method of storing the key and decryption algorithm separately protects the association between the target application and the ELF format program, preventing the ELF format program from being analyzed independently; finally, the encryption algorithm key is stored in a white-box cryptographic box in the Java environment, so the key cannot be obtained by analyzing only the ELF format program, thus solving the problem that the protective shell of the ELF format program cannot securely protect the key.

[0039] Example 2

[0040] Figure 2 This is a flowchart of a cross-language shell enhancement method provided in Embodiment 2 of the present invention. This embodiment adds a process for protecting and decrypting function names in the import and export tables; see [link to documentation]. Figure 2 The method includes the following steps:

[0041] S201. Add a protective shell to the ELF format program required for the target application to run normally.

[0042] The target application and the ELF format program are implemented in different languages. The protective shell contains a white-box cryptographic algorithm, and the target application contains a white-box cryptographic box carrying the decryption key. The target application is a set-top box program, and the ELF format program is a dynamic library program.

[0043] S202. Based on the white-box encryption algorithm, the function names in the import table and export table of the ELF format program are encrypted and obfuscated, so that the function names in the import table and export table are transformed into meaningless strings.

[0044] In this embodiment, to further protect the ELF format program, when adding a protective shell to the ELF format program, a white-box encryption algorithm can be used to encrypt and obfuscate the function names in the import and export tables of the ELF format program, transforming the function names in the import and export tables into meaningless strings. For example, the output function `printf()` in the import table, after encryption and obfuscation, becomes the meaningless string "465358475a44464d4". It should be noted that transforming the function names in the import and export tables into meaningless strings protects the function names, ensuring that even if unauthorized personnel obtain the import and export tables, they cannot determine the specific functions based on the meaningless strings, thus achieving protection for the import and export tables.

[0045] S203. After the target application starts, initialize the white-box password box, obtain key-related variables, and transmit the key-related variables to the ELF format program.

[0046] In this embodiment, after the target application starts, the white-box cryptographic box is initialized to obtain key-related variables, which are the decryption keys. The purpose of initializing the white-box cryptographic box is to convert the key in the Java environment into a key that can be recognized and used by the ELF format program's protective shell. To ensure that the ELF format program's protective shell can correctly decrypt and restore its encrypted code, the key-related variables need to be passed from the Java environment to the ELF format program. In an optional implementation, since the target operating system used to run the Java application provides a JNI framework, the key-related variables can be transmitted to the ELF format program through the JNI framework provided by the target operating system. That is, the JNI framework is used as a data transmission intermediary.

[0047] S204. The protective shell decrypts the encrypted data of the ELF format program based on the key-related variables and the white-box cryptographic algorithm.

[0048] In this embodiment, after the ELF format program gains control, it invokes the white-box cryptographic algorithm within the protective shell and obtains key-related variables through the JNI interface provided by the JNI framework. Then, based on the key-related variables and the white-box cryptographic algorithm, it decrypts the encrypted data (i.e., the program's code instructions) of the ELF format program and restores it to memory. Further, after decryption and restoration, the compressed data of the ELF format program is decompressed and restored to memory. Afterward, the protective shell returns control of the ELF format program to its original code, allowing the ELF format program to run normally.

[0049] In this embodiment, since the function names in the import table and export table are encrypted and obfuscated, the function names in the import table and export table need to be restored during the initialization stage before the ELF format program runs normally. The specific restoration process can be found in S205-S207.

[0050] S205. During the initialization of the ELF format program, the string deobfuscation function is called to deobfuscate the meaningless string.

[0051] S206. Based on the white-box cryptography algorithm and the key-related variables, the meaningless string after deobfuscation is decrypted to obtain the original function name corresponding to the meaningless string.

[0052] S207. Replace the meaningless strings in the import and export tables with the original function names.

[0053] In this embodiment, encrypting and obfuscating the function names in the import and export tables can prevent the function names from being maliciously analyzed and used by unauthorized personnel; moreover, restoring meaningless strings to specific function names during ELF format program initialization can ensure the normal operation of the ELF format program.

[0054] Example 3

[0055] Figure 3 This is a schematic diagram of a cross-language shell enhancement device provided in Embodiment 3 of the present invention. This embodiment is applicable to security systems using ELF file structures, typically suitable for scenarios involving shell protection of dynamic libraries. Figure 3 As shown, the device includes:

[0056] The packer module 301 is used to add a protective shell to the ELF format program required for the normal operation of the target application, wherein the target application and the ELF format program are implemented in different languages, the protective shell stores a white-box cryptographic algorithm, and the target application stores a white-box cryptographic box.

[0057] The initialization and transmission module 302 is used to initialize the white-box cryptographic box after the target application starts, obtain key-related variables, and transmit the key-related variables to the ELF format program;

[0058] The decryption module 303 is used by the protective shell to decrypt the encrypted data of the ELF format program based on the key-related variables and the white-box cryptographic algorithm.

[0059] The technical solution of this invention can effectively improve the confidentiality of data by the protective shell and effectively prevent the ELF format program with the protective shell from being analyzed separately.

[0060] Based on the above embodiments, optionally, the target application is an application implemented in Java that can run on the target operating system;

[0061] Accordingly, the initialization and transmission module includes:

[0062] The transmission unit is used to transmit the key-related variables to the ELF format program through the JNI framework provided by the target operating system.

[0063] Optionally, based on the above embodiments, the shell module is further used for:

[0064] The code instructions of the ELF format program are encrypted based on a white-box encryption algorithm, and the data of the ELF format program is compressed.

[0065] Based on a white-box encryption algorithm, the function names in the import and export tables of the ELF format program are encrypted and obfuscated, transforming the function names in the import and export tables into meaningless strings.

[0066] Optionally, based on the above embodiments, the method further includes:

[0067] During ELF format program initialization, a string deobfuscation function is called to deobfuscate the meaningless string;

[0068] Based on the white-box cryptography algorithm and the key-related variables, the meaningless string after deobfuscation is decrypted to obtain the original function name corresponding to the meaningless string;

[0069] Replace the meaningless strings in the import and export tables with the original function names.

[0070] Based on the above embodiments, optionally, the target application is a set-top box application; the ELF format application is a dynamic library application.

[0071] The cross-language shell enhancement device provided in this embodiment of the invention can execute the cross-language shell enhancement method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method execution.

[0072] Example 4

[0073] Figure 4 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0074] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0075] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0076] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as performing cross-language shell enhancement methods.

[0077] In some embodiments, the cross-language shell enhancement method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the cross-language shell enhancement method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the cross-language shell enhancement method by any other suitable means (e.g., by means of firmware).

[0078] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0079] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0080] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0081] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0082] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0083] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0084] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0085] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A cross-language shell enhancement method, characterized in that, include: A protective shell is added to the ELF format program required for the normal operation of the target application, wherein the target application and the ELF format program are implemented in different languages. The protective shell stores a white-box cryptographic algorithm, and the target application stores a white-box cryptographic box with a decryption key. The white-box cryptographic box is used to store the decryption key in the target application environment. After the target application starts, the white-box password box is initialized, and key-related variables are obtained by converting the decryption key in the white-box password box and being recognized and used by the ELF format program protection shell. The key-related variables are then transmitted to the ELF format program. The protective shell decrypts the encrypted data of the ELF format program based on the key-related variables and the white-box cryptographic algorithm.

2. The method according to claim 1, characterized in that, The target application is an application implemented in Java that can run on the target operating system; Accordingly, transmitting the key-related variables to the ELF format program includes: The key-related variables are transmitted to the ELF format program through the JNI framework provided by the target operating system.

3. The method according to claim 1, characterized in that, Add a protective shell to the ELF format program required for the target application to function properly, including: The code instructions of the ELF format program are encrypted based on a white-box encryption algorithm, and the data of the ELF format program is compressed. Based on a white-box encryption algorithm, the function names in the import and export tables of the ELF format program are encrypted and obfuscated, transforming the function names in the import and export tables into meaningless strings.

4. The method according to claim 3, characterized in that, The method further includes: During ELF format program initialization, a string deobfuscation function is called to deobfuscate the meaningless string; Based on the white-box cryptography algorithm and the key-related variables, the meaningless string after deobfuscation is decrypted to obtain the original function name corresponding to the meaningless string; Replace the meaningless strings in the import and export tables with the original function names.

5. The method according to any one of claims 1-4, characterized in that, The target application is a set-top box program; the ELF format program is a dynamic library program.

6. A cross-language shell enhancement device, characterized in that, include: The packer module is used to add a protective shell to the ELF format program required for the normal operation of the target application. The target application and the ELF format program are implemented in different languages. The protective shell stores a white-box cryptographic algorithm, and the target application stores a white-box cryptographic box with a decryption key. The white-box cryptographic box is used to store the decryption key in the target application environment. An initialization and transmission module is used to initialize the white-box password box after the target application starts, obtain key-related variables converted from the decryption key in the white-box password box and recognizable by the ELF format program shell, and transmit the key-related variables to the ELF format program. The decryption module is used by the protective shell to decrypt the encrypted data of the ELF format program based on the key-related variables and the white-box cryptographic algorithm.

7. The apparatus according to claim 6, characterized in that, The target application is an application implemented in Java that can run on the target operating system; Accordingly, the initialization and transmission module includes: The transmission unit is used to transmit the key-related variables to the ELF format program through the JNI framework provided by the target operating system.

8. The apparatus according to claim 6, characterized in that, The shell module is also used for: The code instructions of the ELF format program are encrypted based on a white-box encryption algorithm, and the data of the ELF format program is compressed. Based on a white-box encryption algorithm, the function names in the import and export tables of the ELF format program are encrypted and obfuscated, transforming the function names in the import and export tables into meaningless strings.

9. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that are used to cause a processor to execute the method of any one of claims 1-5.

Citation Information

Patent Citations

  • Android application strengthening method based on dynamic execution of dex and so files

    CN106203006A

  • Android application reinforcement method based on the process confusion technology

    CN106650341A