Application protection method, device, electronic device and storage medium
By encrypting file information in the application and comparing it with pre-stored encrypted information, it determines whether to load the target function, which solves the problem of malicious calling of C++ functions, improves the security and reliability of the system, and is suitable for a variety of operating systems.
Patent Information
- Application Number
- CN202110906940.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-09
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2041-08-09
AI Technical Summary
Existing technology is difficult to effectively prevent malicious calls of C++ functions, especially in non-Linux systems, and the implementation process is complex, affecting system security and reliability.
When the target application calls the target function, it determines whether to load the target function by encrypting the file information and comparing it with the pre-stored encrypted information, and uses the asymmetric encryption method to generate a check code for uniqueness verification to ensure the security and integrity of the file information. sex.
It implements simple and fast program protection to prevent illegal calls and intrusion events, improves the security and reliability of the system, and is suitable for a variety of operating systems.
Smart Images

Figure CN113742659B
Abstract
Description
Background Art
[0002] With the continuous advancement of science and technology, there are many malicious calls to C++ functions by malware, which destroy the source program and cause serious impact on society.
[0003] In the related art, the problem of malicious calls to C++ functions is mainly solved by obtaining the system call entry through assembly instructions, obtaining the system call list pointer through the system call entry, and processing the system call pointer with a fingerprint algorithm. However, the above method can only be applied to Linux systems to solve intrusion events in the kernel state of Linux systems, and has poor applicability and a relatively complicated implementation process. Summary of the invention
[0004] The embodiments of the present application provide an application protection method, device, electronic device and storage medium to simply and efficiently improve program security.
[0005] The first application protection method provided in the embodiment of the present application includes:
[0006] When the target application calls the target function, encrypting the file information corresponding to the target application to obtain the file encryption information;
[0007] Sending the file encryption information to a target function, and comparing the file encryption information with pre-stored encryption information corresponding to the target function through the target function;
[0008] Determine whether to load the target function according to the comparison result.
[0009] In the above implementation, when the target application calls the target function, the file information corresponding to the target application is encrypted, and after the file encryption information is obtained, the file encryption information is sent to the target function, and the file encryption information is compared with the pre-stored encryption information corresponding to the target function through the target function, and whether to load the target function is determined according to the comparison result. The above method can simply and quickly prevent the illegal calling of the program and the occurrence of intrusion events, thereby achieving comprehensive protection of the system and improving the system security and reliability. In addition, the method is not only applicable to Linux systems, but also has higher practicality.
[0010] An optional implementation manner is that determining whether to load the target function according to the comparison result includes:
[0011] If the comparison results are consistent, then loading the target function;
[0012] If the comparison results are inconsistent, loading of the target function is prohibited and the target application is exited.
[0013] In the above implementation, the comparison results are used to determine whether to load the target function. If the comparison results are consistent, the target function is loaded. If the comparison results are inconsistent, loading of the target function is prohibited and the target application is exited. This can simply and efficiently prevent illegal calls of the program, achieve comprehensive protection of the system, and improve system reliability.
[0014] In an optional implementation, the pre-stored encrypted information includes: the program name of the loadable application, and a second verification code corresponding to each application, the second verification code is used to uniquely identify the application and to indicate that the application has not been modified; and comparing the file encryption information with the pre-stored encrypted information through the target function includes:
[0015] Obtaining the program name of the loadable application program from the pre-stored encrypted information corresponding to the target function;
[0016] If it is determined based on the program name that the target application belongs to the loadable application, the first verification code in the file encryption information is compared with the second verification code corresponding to the target application in the pre-stored encryption information.
[0017] In the above implementation, the file encryption information is compared with the pre-stored encryption information through the target function. First, the program name of the loadable application in the pre-stored encryption information corresponding to the target function is obtained. If the target application is determined to be a loadable application based on the program name, the first verification code in the file encryption information is compared with the second verification code corresponding to the target application in the pre-stored encryption information. This can simply and quickly prevent illegal calls of the program and prevent the occurrence of intrusion incidents, thereby achieving comprehensive protection of the system, improving system reliability, and having high practicality.
[0018] An optional implementation is to determine whether the comparison results are consistent by the following method:
[0019] If the first verification code is consistent with the second verification code corresponding to the target application in the pre-stored encrypted information, it is determined that the comparison results are consistent.
[0020] In the above implementation, if the first verification code is consistent with the second verification code corresponding to the target application in the pre-stored encrypted information, it is determined that the comparison result is consistent, which can ensure the normal calling of the program.
[0021] An optional implementation manner is to determine that the comparison results are inconsistent by the following method:
[0022] If the first verification code is inconsistent with the second verification code corresponding to the target application in the pre-stored encrypted information, determining that the comparison result is inconsistent; or
[0023] If it is determined based on the program name that the target application does not belong to the loadable application, then it is determined that the comparison result is inconsistent.
[0024] In the above embodiment, if the first verification code is inconsistent with the second verification code corresponding to the target application in the pre-stored encrypted information, or if it is determined based on the program name that the target application does not belong to a loadable application, then the comparison result is determined to be inconsistent, which can simply and quickly prevent illegal calls of the program and prevent the occurrence of intrusion incidents, thereby achieving comprehensive protection of the system.
[0025] An optional implementation manner is that encrypting the file information corresponding to the target application to obtain the file encryption information includes:
[0026] Encrypting the file information by an asymmetric encryption method to obtain a first verification code corresponding to the target application;
[0027] The program name of the target application and the first verification code are used as the file encryption information.
[0028] In the above implementation, the file information is encrypted by an asymmetric encryption method to obtain the first verification code corresponding to the target application. The program name of the target application and the first verification code are used as file encryption information to ensure the security of the information and effectively prevent illegal calls to the program.
[0029] An application protection device provided in an embodiment of the present application includes:
[0030] The encryption unit is used to encrypt the file information corresponding to the target application when the target application calls the target function, so as to obtain the file encryption information;
[0031] A sending unit, used for sending the file encryption information to a target function, and comparing the file encryption information with pre-stored encryption information corresponding to the target function through the target function;
[0032] A determination unit is used to determine whether to load the target function according to the comparison result.
[0033] Optionally, the determining unit is specifically configured to:
[0034] If the comparison results are consistent, then loading the target function;
[0035] If the comparison results are inconsistent, loading of the target function is prohibited and the target application is exited.
[0036] Optionally, the pre-stored encrypted information includes: program names of loadable applications, and second verification codes corresponding to each application, where the second verification code is used to uniquely identify the application and to indicate that the application has not been modified; and the sending unit is specifically used to:
[0037] Obtaining the program name of the loadable application program from the pre-stored encrypted information corresponding to the target function;
[0038] If it is determined based on the program name that the target application belongs to the loadable application, the first verification code in the file encryption information is compared with the second verification code corresponding to the target application in the pre-stored encryption information.
[0039] Optionally, the determining unit is further configured to determine that the comparison results are consistent in the following manner:
[0040] If the first verification code is consistent with the second verification code corresponding to the target application in the pre-stored encrypted information, it is determined that the comparison results are consistent.
[0041] Optionally, the determining unit is further configured to determine that the comparison result is inconsistent in the following manner:
[0042] If the first verification code is inconsistent with the second verification code corresponding to the target application in the pre-stored encrypted information, determining that the comparison result is inconsistent; or
[0043] If it is determined based on the program name that the target application does not belong to the loadable application, then it is determined that the comparison result is inconsistent.
[0044] Optionally, the encryption unit is specifically used for:
[0045] Encrypting the file information by an asymmetric encryption method to obtain a first verification code corresponding to the target application;
[0046] The program name of the target application and the first verification code are used as the file encryption information.
[0047] An electronic device provided by an embodiment of the present application includes a processor and a memory, wherein the memory stores program code, and when the program code is executed by the processor, the processor performs the above-mentioned steps of application protection.
[0048] An embodiment of the present application provides a computer-readable storage medium, which includes a program code. When the storage medium is run on an electronic device, the program code is used to enable the electronic device to execute the steps of the above-mentioned application protection method.
[0049] Other features and advantages of the present application will be described in the subsequent description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0051] Figure 1 A schematic diagram of an application scenario of an application protection method provided in an embodiment of the present application;
[0052] Figure 2 A flowchart of an application protection method provided in an embodiment of the present application;
[0053] Figure 3 A working block diagram of an application protection method provided in an embodiment of the present application;
[0054] Figure 4 A schematic diagram of a specific process of an application protection method provided in an embodiment of the present application;
[0055] Figure 5 A schematic diagram of an application protection device according to an embodiment of the present application;
[0056] Figure 6 The present invention is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.
[0058] The following is an introduction to some concepts involved in the embodiments of the present application.
[0059] 1. In the embodiments of the present application, the term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0060] 2. The term "application" in the embodiments of the present application refers to a computer program for completing one or more specific tasks, which runs in user mode, can interact with users, and has a visual user interface. Applications are usually divided into two parts: a graphical user interface and an engine. Each application runs in an independent process and has its own independent address space. The application in the embodiments of the present application refers to a computer program, software, applets, etc. that can call C++ functions.
[0061] 3. The term "asymmetric encryption" in the embodiments of the present application is a method of keeping a key confidential. An asymmetric encryption algorithm requires two keys: a public key and a private key. The public key and the private key are a pair. If the public key is used to encrypt data, it can only be decrypted with the corresponding private key. Because encryption and decryption use two different keys, this method is called asymmetric encryption. In the embodiments of the present application, file information is encrypted using an asymmetric encryption method.
[0062] 4. In the embodiments of the present application, the term "check code" is usually the last digit of a group of numbers, which is obtained by some kind of calculation from the previous numbers to verify the correctness of the group of numbers. Any code with a check code is composed of two parts: a main body code and a check code. The main body code is a number representing the coded object, and the check code is a number attached to the main body code to verify the accuracy of the main body code during the input process. Each main body code can only have one check code, and the check code is obtained through a specified mathematical relationship. The check code in the embodiments of the present application is used to compare whether the transmitted file information is consistent with the pre-stored encrypted information, and is obtained by encrypting the file information corresponding to the target application.
[0063] The following is a brief introduction to the design concept of the embodiment of the present application:
[0064] With the continuous advancement of science and technology, there are many malicious calls to C++ functions by malware, which destroy the source program and cause serious impact on society.
[0065] In the related art, in addition to the methods listed in the background art, in order to solve the problem of malicious calling of C++ functions, a hook function can be used to monitor the calling of the loading function, determine whether the loading function is in a malicious dynamic link library or in a whitelist, and then refuse or allow the loading function. However, the above method is complicated to implement, or can only be applied to Linux systems, or requires each called system to set a hook function.
[0066] In view of the above problems, the embodiments of the present application propose an application protection method, device, electronic device and storage medium. In the embodiments of the present application, when the target application calls the target function, the file information corresponding to the target application is encrypted, and after obtaining the file encryption information, the file encryption information is sent to the target function, and the file encryption information is compared with the pre-stored encryption information corresponding to the target function through the target function, and whether to load the target function is determined according to the comparison result. Since the present application determines whether to load the target function by comparing the file encryption information with the pre-stored encryption information, it can simply and quickly prevent the illegal calling of the program and the occurrence of intrusion incidents, thereby achieving comprehensive protection of the system, improving system reliability, and having high practicality.
[0067] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application may be combined with each other if there is no conflict.
[0068] like Figure 1 As shown, it is a schematic diagram of an application scenario of an application protection method provided in an embodiment of the present application. The specific implementation process of the method is as follows: when the target application 10 calls the target function 20, the file information corresponding to the target application 10 is encrypted, the file encryption information is obtained, and the file encryption information is sent to the target function 20. The file encryption information is compared with the pre-stored encryption information corresponding to the target function 20 through the target function 20, and it is determined whether to load the target function 20 based on the comparison result.
[0069] like Figure 2 As shown, the embodiment of the present application provides an application protection method, comprising the following steps:
[0070] S21: When the target application calls the target function, encrypt the file information corresponding to the target application to obtain the file encryption information;
[0071] The target function may be a C++ function. When starting an application and implementing certain functions based on the application, some C++ functions will be called. In order to ensure the security of the system, the identity of the application needs to be verified.
[0072] In an optional implementation, the file information is encrypted by an asymmetric encryption method to obtain a first verification code corresponding to the target application, and the program name of the target application and the first verification code are used as the file encryption information.
[0073] The file information includes the program name, path and other information of the application.
[0074] For example, the asymmetric encryption method can be the MD5 algorithm. After obtaining the file information of the target application, the MD5 algorithm can be used to calculate the MD5 value of the file information, that is, the first verification code. The MD5 values of different file information are different. If anyone makes any changes to the target application, its MD5 value will change. By comparing whether the MD5 value is the same as the MD5 value provided in advance by the target function side, it can be determined whether the target application has been tampered with, and the uniqueness of the target application can be verified to ensure the security and integrity of the program.
[0075] S22: sending the file encryption information to the target function, and comparing the file encryption information with the pre-stored encryption information corresponding to the target function through the target function;
[0076] In an optional implementation, the pre-stored encrypted information is pre-stored on the target function side, and includes the program names of loadable applications, that is, the program names of applications that are allowed to load the target function, and second verification codes corresponding to each application. Each second verification code is used to uniquely identify an application and is used to indicate that the application has not been modified.
[0077] The pre-stored encryption information corresponding to different objective functions may be the same or different.
[0078] For example, the pre-stored encrypted information corresponding to the target function 1 includes the program names of five loadable applications, namely: APP1, APP2, APP3, APP4, APP5, and the verification codes corresponding to each loadable application are: app1, app2, app3, app4, app5.
[0079] For another example, the pre-stored encrypted information corresponding to the target function 2 includes the program names of three loadable applications, namely: APP1, APP3, and APP6, and the verification codes corresponding to each loadable application are: app1, app3, and app6.
[0080] For another example, the pre-stored encrypted information corresponding to the target function 3 includes the program names of four loadable applications, namely: APP7, APP8, APP9, APP0, and the verification codes corresponding to each loadable application are: app7, app8, app9, app0.
[0081] In an embodiment of the present application, when comparing file encryption information with pre-stored encryption information, it is first necessary to obtain the program name of the loadable application in the pre-stored encryption information corresponding to the target function. If the name of the application is consistent with the name of the loadable program, the application is a loadable program, and the first verification code in the file encryption information is continued to be compared with the second verification code corresponding to the target application in the pre-stored encryption information; if the name of the application is inconsistent with the name of the loadable program, then the application is a non-loadable program, and the following comparison is not required, and the program can be exited directly.
[0082] For example, the program name of application A is APP1, and the verification code obtained after encryption based on the MD5 algorithm is app1; the program names of the loadable applications contained in the pre-stored encrypted information corresponding to the target function 1 are: APP1, APP2, APP3, APP4, APP5; the verification codes corresponding to each application are: app1, app2, app3, app4, app5.
[0083] By querying the program name of the loadable application contained in the pre-stored encrypted information, it can be known that the program name of application A belongs to the loadable application. Then, the verification code app1 obtained by encrypting application A is compared with the second verification code of the target application. Through the comparison, it can be known that the first verification code of application A is consistent with its corresponding second verification code, and application A is allowed to load target function 1.
[0084] S23: Determine whether to load the target function according to the comparison result.
[0085] In the embodiment of the present application, the file encryption information is compared with the pre-stored encryption information corresponding to the target function through the target function, and whether to load the target function is determined based on the comparison result. This can simply and quickly prevent illegal calls of the program and the occurrence of intrusion incidents, thereby achieving comprehensive protection of the system and improving system security and reliability. It is not only applicable to Linux systems, but can be applicable to various operating systems and has higher practicality.
[0086] In an optional implementation, whether to load the target function is determined based on the comparison result. If the comparison result is consistent, the target function is loaded; if the comparison result is inconsistent, loading of the target function is prohibited and the target application is exited.
[0087] For example, taking the target function as a C++ function, the file encryption information of the application is compared with the pre-stored encryption information in the C++ function. If the comparison results are consistent, the C++ function is loaded. If the comparison results are inconsistent, loading of the target function is prohibited and the application is exited. This can simply and efficiently prevent illegal calls of the program, achieve comprehensive protection of the system, and improve system reliability.
[0088] In an optional implementation, if the first verification code is consistent with the second verification code corresponding to the target application in the pre-stored encrypted information, it is determined that the comparison result is consistent.
[0089] For example, the program name of application A is APP1, and the program names of the loadable applications contained in the pre-stored encrypted information corresponding to the C++ function are: APP1, APP2, APP3, APP4, APP5, then application A is a loadable application, the first verification code of application A is app1, and the corresponding second verification code in the pre-stored encrypted information is app1. By comparison, it can be seen that the results are consistent, then application A is allowed to be loaded, and the normal calling of the program can be guaranteed.
[0090] In an optional implementation, if the first verification code is inconsistent with the second verification code corresponding to the target application in the pre-stored encrypted information, or if it is determined based on the program name that the target application is not a loadable application, the comparison result is determined to be inconsistent.
[0091] For example, the program name of application B is APP2, and the program names of the loadable applications contained in the pre-stored encrypted information corresponding to the C++ function are: APP1, APP2, APP3, APP4, APP5, then application B is a loadable application, the first verification code of application B is app2, and the corresponding second verification code in the pre-stored encrypted information is app6. By comparison, it can be seen that the first verification code is inconsistent with the second verification code, then application B is not allowed to be loaded; for another example, the program name of application C is APP0, and the program names of the loadable applications contained in the pre-stored encrypted information corresponding to the C++ function are: APP1, APP2, APP3, APP4, APP5. According to the program name, it can be seen that application C is not a loadable application, the comparison result is inconsistent, and the program is exited. This can simply and quickly prevent illegal calls of the program, prevent the occurrence of intrusion incidents, and achieve comprehensive protection of the system.
[0092] like Figure 3 As shown, it is a working block diagram of an application protection method provided by an embodiment of the present application. The working logic is specifically described below by taking the target function as a C++ function as an example:
[0093] When an application calls a C++ function, it encrypts its own program information using an asymmetric encryption method and then passes it to the C++ function. The C++ function compares the passed file encryption information with the pre-stored encryption information. When the passed information is consistent with the pre-stored encryption information, loading is allowed. When the passed information is inconsistent with the pre-stored encryption information, loading is prohibited.
[0094] like Figure 4 As shown, it is a specific flow chart of an application protection method provided in an embodiment of the present application, which includes the following steps:
[0095] S400: Encrypt the file information by an asymmetric encryption method to obtain a first verification code corresponding to the target application;
[0096] S401: Using the program name of the target application and the first verification code as file encryption information;
[0097] S402: Send the file encryption information to the target function;
[0098] S403: Determine whether the target application is a loadable application. If so, execute step S404; if not, execute step S407;
[0099] S404: Compare the first verification code with the second verification code corresponding to the target application in the pre-stored encrypted information;
[0100] S405: Check whether the comparison results are consistent. If so, execute step S406; if not, execute step S407.
[0101] S406: Allow loading.
[0102] S407: Exit the program.
[0103] This application can ensure the security and integrity of the program. Through this method, the call of malicious software can be restricted, thereby achieving comprehensive protection of the system, improving the reliability of the system, and having high use value.
[0104] Based on the same inventive concept, the present application embodiment also provides an application protection device. Figure 5 As shown, it is a schematic diagram of an application protection device 500 according to an embodiment of the present application, and the device includes:
[0105] The encryption unit 501 is used to encrypt the file information corresponding to the target application when the target application calls the target function, so as to obtain the file encryption information;
[0106] A sending unit 502 is used to send the file encryption information to the target function, and compare the file encryption information with the pre-stored encryption information corresponding to the target function through the target function;
[0107] The determination unit 503 is used to determine whether to load the target function according to the comparison result.
[0108] Optionally, the determining unit 503 is specifically configured to:
[0109] If the comparison results are consistent, the target function is loaded;
[0110] If the comparison results are inconsistent, the target function is prohibited from loading and the target application is exited.
[0111] Optionally, the pre-stored encrypted information includes: the program name of the loadable application program, and the second verification code corresponding to each application program, the second verification code is used to uniquely identify the application program and to indicate that the application program has not been modified; the sending unit 502 is specifically used to:
[0112] Obtaining the program name of the loadable application program in the pre-stored encrypted information corresponding to the target function;
[0113] If it is determined based on the program name that the target application is a loadable application, the first verification code in the file encryption information is compared with the second verification code corresponding to the target application in the pre-stored encryption information.
[0114] Optionally, the determining unit 503 is further configured to determine that the comparison results are consistent in the following manner:
[0115] If the first verification code is consistent with the second verification code corresponding to the target application in the pre-stored encrypted information, it is determined that the comparison results are consistent.
[0116] Optionally, the determining unit 503 is further configured to determine that the comparison results are inconsistent in the following manner:
[0117] If the first verification code is inconsistent with the second verification code corresponding to the target application in the pre-stored encrypted information, it is determined that the comparison result is inconsistent; or
[0118] If it is determined based on the program name that the target application does not belong to the loadable application, it is determined that the comparison result is inconsistent.
[0119] Optionally, the encryption unit 501 is specifically used for:
[0120] Encrypt the file information by an asymmetric encryption method to obtain a first verification code corresponding to the target application;
[0121] The program name of the target application and the first verification code are used as file encryption information.
[0122] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing this application, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.
[0123] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.
[0124] Based on the same inventive concept as the above method embodiment, an electronic device is also provided in the embodiment of the present application. In this embodiment, the structure of the electronic device can be as follows: Figure 6 As shown, it includes a memory 601 , a communication module 603 and one or more processors 602 .
[0125] The memory 601 is used to store computer programs executed by the processor 602. The memory 601 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0126] The memory 601 may be a volatile memory, such as a random-access memory (RAM); the memory 601 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or the memory 601 may be any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 601 may be a combination of the above memories.
[0127] The processor 602 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 602 is used to implement the above application protection method when calling the computer program stored in the memory 601.
[0128] The communication module 603 is used to communicate with the terminal and other servers.
[0129] The specific connection medium between the memory 601, the communication module 603 and the processor 602 is not limited in the embodiment of the present application. Figure 6 In the embodiment, the memory 601 and the processor 602 are connected via a bus 604. The bus 604 is connected to the processor 602 via a bus 604. Figure 6 The connections between the other components are only for illustration and are not intended to be limiting. The bus 604 can be divided into an address bus, a data bus, a control bus, etc. For ease of description, Figure 6 The diagram shows that only one thick line is used, but this does not mean that there is only one bus or one type of bus.
[0130] The memory 601 stores a computer storage medium, and the computer storage medium stores computer executable instructions, and the computer executable instructions are used to implement the application protection method of the embodiment of the present application. The processor 602 is used to execute the above-mentioned application protection method, such as Figure 2 shown.
[0131] The application protection device according to the present application may include at least a processor and a memory. The memory stores program code, and when the program code is executed by the processor, the processor executes the steps of the application protection method according to various exemplary embodiments of the present application described in this specification. For example, the processor may execute the following steps: Figure 2 Follow the steps shown in .
[0132] In some possible implementations, various aspects of the application protection method provided in the present application may also be implemented in the form of a program product, which includes program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of the application protection method according to various exemplary embodiments of the present application described above in this specification. For example, the computer device may execute the following steps: Figure 2 Follow the steps shown in .
[0133] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0134] The program product of the application protection of the embodiment of the present application can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a computing device. However, the program product of the present application is not limited to this. In this document, the readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with a command execution system, device or device.
[0135] The readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein the readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with a command execution system, apparatus, or device.
[0136] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0137] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user equipment, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device via any type of network including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0138] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.
[0139] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0140] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0141] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0142] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. An application protection method, It is characterized in that The method includes: When the target application calls the target function, encrypting the file information corresponding to the target application to obtain the file encryption information; Sending the file encryption information to the target function, and comparing the file encryption information with the pre-stored encryption information corresponding to the target function through the target function; the pre-stored encryption information includes: the program name of the loadable application, and the second verification code corresponding to each application, the second verification code is used to uniquely identify the application and is used to indicate that the application has not been modified; Determine whether to load the target function according to the comparison result; The step of encrypting the file information corresponding to the target application to obtain the encrypted file information includes: Encrypt the file information by an asymmetric encryption method to obtain a first verification code corresponding to the target application; use the program name of the target application and the first verification code as the file encryption information; The comparing the file encryption information with the pre-stored encryption information by using the target function includes: Obtaining the program name of the loadable application program from the pre-stored encrypted information corresponding to the target function; If it is determined based on the program name that the target application belongs to the loadable application, the first verification code in the file encryption information is compared with the second verification code corresponding to the target application in the pre-stored encryption information.
2. The method according to claim 1, It is characterized in that The determining whether to load the target function according to the comparison result includes: If the comparison results are consistent, then loading the target function; If the comparison results are inconsistent, loading of the target function is prohibited and the target application is exited.
3. The method according to claim 2, It is characterized in that The consistency of the comparison results was determined by: If the first verification code is consistent with the second verification code corresponding to the target application in the pre-stored encrypted information, it is determined that the comparison results are consistent.
4. The method according to claim 2, It is characterized in that The comparison results are determined to be inconsistent by: If the first verification code is inconsistent with the second verification code corresponding to the target application in the pre-stored encrypted information, determining that the comparison result is inconsistent; or If it is determined based on the program name that the target application does not belong to the loadable application, then it is determined that the comparison result is inconsistent.
5. An application protection device, It is characterized in that The device comprises: The encryption unit is used to encrypt the file information corresponding to the target application when the target application calls the target function, so as to obtain the file encryption information; A sending unit, used to send the file encryption information to a target function, and compare the file encryption information with pre-stored encryption information corresponding to the target function through the target function; the pre-stored encryption information includes: program names of loadable applications, and second verification codes corresponding to each application, the second verification code is used to uniquely identify the application, and is used to indicate that the application has not been modified; A determination unit, used to determine whether to load the target function according to the comparison result; The encryption unit is specifically used for: Encrypt the file information by an asymmetric encryption method to obtain a first verification code corresponding to the target application; use the program name of the target application and the first verification code as the file encryption information; The sending unit is specifically used for: Obtaining the program name of the loadable application program from the pre-stored encrypted information corresponding to the target function; If it is determined based on the program name that the target application belongs to the loadable application, the first verification code in the file encryption information is compared with the second verification code corresponding to the target application in the pre-stored encryption information.
6. The device as claimed in claim 5, It is characterized in that The determining unit is specifically used for: If the comparison results are consistent, then loading the target function; If the comparison results are inconsistent, loading of the target function is prohibited and the target application is exited.
7. An electronic device, It is characterized in that It comprises a processor and a memory, wherein the memory stores program codes, and when the program codes are executed by the processor, the processor executes the steps of any one of the methods in claims 1 to 4.
8. A computer-readable storage medium, It is characterized in that It includes program codes. When the storage medium is run on an electronic device, the program codes are used to enable the electronic device to execute the steps of any one of the methods in claims 1 to 4.
