WO2017000648A1 - 一种被加固软件的认证方法及装置 - Google Patents

一种被加固软件的认证方法及装置 Download PDF

Info

Publication number
WO2017000648A1
WO2017000648A1 PCT/CN2016/080384 CN2016080384W WO2017000648A1 WO 2017000648 A1 WO2017000648 A1 WO 2017000648A1 CN 2016080384 W CN2016080384 W CN 2016080384W WO 2017000648 A1 WO2017000648 A1 WO 2017000648A1
Authority
WO
WIPO (PCT)
Prior art keywords
software
hardened
result
data
server
Prior art date
Application number
PCT/CN2016/080384
Other languages
English (en)
French (fr)
Inventor
王蔚
董振江
李晖
张文
张亚腾
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Priority to US15/740,836 priority Critical patent/US20180204004A1/en
Priority to EP16817012.4A priority patent/EP3316160A4/en
Publication of WO2017000648A1 publication Critical patent/WO2017000648A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/121Restricting unauthorised execution of programs
    • G06F21/125Restricting unauthorised execution of programs by manipulating the program code, e.g. source code, compiled code, interpreted code, machine code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/14Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/03Indexing scheme relating to G06F21/50, monitoring users, programs or devices to maintain the integrity of platforms
    • G06F2221/033Test or assess software

Definitions

  • This application relates to, but is not limited to, the field of Internet security technology.
  • the service after the service provides the data to the application, the service cannot access and protect the data provided to the application. Even if the application makes a security prompt when accessing data according to the request of the service, but the user cannot effectively distinguish the source of the service request, and therefore cannot guarantee the correct handling of the security prompt, and cannot be effective when the malicious application requests the service. protection of. In order to avoid the spread of the installation package that is not reinforced, it is necessary to authenticate the application software generated according to the installation package.
  • the embodiment of the invention provides an authentication method and device for the hardened software, which can effectively distinguish the source of the service request, and can effectively protect the malicious application when the service is requested, thereby greatly improving the protection of the hardened software. Strength, effectively preventing attackers from attacking and ensuring that the hardened software can run normally.
  • An embodiment of the present invention provides a method for authenticating a software to be applied to a mobile terminal, where the authentication method includes:
  • the key data sent by the server is obtained, where the key data includes: the hidden data in the plaintext software code of the hardened software and the hidden data. Entry address
  • the authentication method further includes:
  • the calculating the integrity check value of the shell program of the hardened software, processing the integrity check value of the shell program, and sending the processed processing result to the server including:
  • the key data sent by the server is obtained, including:
  • the replacing the corresponding data hidden by the plaintext software code of the hardened software stored in the memory according to the hidden data and the entry address, and then loading the plaintext software code including:
  • the hidden data is replaced with corresponding data hidden by the plaintext software code of the hardened software stored in the memory, and then the plaintext software code is loaded.
  • an authentication method of the hardened software is further applied to a server, where the authentication method includes:
  • the key data is encrypted, and the encrypted data generated by the encryption is sent to the hardened software, where the key data includes: the plaintext software code of the hardened software is hidden The data and the entry address corresponding to the hidden data.
  • the verifying the integrity check value of the shell program of the hardened software according to the processing result sent by the hardening software including:
  • the key data is encrypted, Sending the encrypted data generated by the encryption to the hardened software, including:
  • the entry address corresponding to the hidden data included in the key data is calculated according to a third algorithm, and a third calculation result is obtained;
  • the calculating, by using the second random number and the entry address in the plaintext software code of the hardened software, according to a third algorithm includes:
  • the embodiment of the present invention optionally provides an authentication device for the hardened software, which is applied to the mobile terminal, and the authentication device includes:
  • Obtaining a module configured to acquire key data sent by the server after the server verifies the shell program of the hardened software, where the key data includes: the hidden data in the plaintext software code of the hardened software and the The entry address corresponding to the hidden data;
  • a replacement module configured to replace the corresponding data hidden by the plaintext software code of the hardened software stored in the memory according to the hidden data and the entry address, and then load the plaintext software code.
  • the authentication device further includes:
  • a processing module configured to calculate an integrity check value of the shell program of the hardened software, process the integrity check value of the shell program, and send the processed processing result to the server, where The server verifies the processing result, and if the verification result is the verification pass, the server encrypts the key data to generate the encrypted data.
  • the processing module includes:
  • a sending unit configured to send the request information of the hardened software to a server, where the server randomly generates a first random number according to the request information of the hardened software
  • a first calculating unit configured to calculate an integrity check value of the shell program of the hardened software according to the first algorithm
  • a first cascading unit configured to acquire the first random number, perform a first cascading process on the first random number and the integrity check value of the shell program, to obtain a first cascading result
  • a second calculating unit configured to calculate the first cascading result according to the second algorithm, to obtain a first calculating result
  • the second cascading unit is configured to perform a second cascading process on the first calculation result and the second random number randomly generated by the reinforced software to obtain a processing result, and send the processing result to the server, by The server verifies the processing result, and if the verification result is verification pass, the server encrypts the key data to generate encrypted data.
  • the obtaining module includes:
  • Decrypting unit configured to perform decryption operation on the encrypted data sent by the server after the server verifies the shell program of the hardened software
  • the first obtaining unit is configured to acquire key data sent by the server included in the decrypted data after the decryption operation is completed.
  • the replacement module includes:
  • a positioning unit configured to locate a position of the corresponding data hidden by the plaintext software code of the hardened software in the plaintext software code of the hardened software according to the entry address
  • a replacement unit configured to replace the hidden data with corresponding data hidden by the plaintext software code of the hardened software stored in the memory, and then load the plaintext software code.
  • an authentication device of the hardened software is further applied to a server, where the authentication device includes:
  • the verification module is configured to obtain the processing result sent by the hardening software, and verify the integrity check value of the shell program of the hardened software;
  • the encryption module is configured to: if the verification result is the verification pass, encrypt the key data, and send the encrypted data generated by the encryption to the hardened software, where the key data includes: the plaintext software of the hardened software The hidden data in the code and the entry address corresponding to the hidden data.
  • the verification module includes:
  • a generating unit configured to acquire request information of the hardened software, randomly generate a first random number according to the request information, and send the first random number to the hardened software
  • the third cascading unit is configured to acquire the ID information of the hardened software according to the request information of the hardened software, and obtain the integrity of the shell program of the hardened software according to the ID information of the hardened software. And performing a first concatenation process on the first random number and the integrity check value of the shell program to obtain a second concatenation result;
  • a third calculating unit configured to calculate the second cascading result according to the second algorithm, to obtain a second calculating result
  • An identification unit configured to acquire a processing result sent by the hardened software, and identify, according to the processing result, a first calculation result and a second random number;
  • the verification unit is configured to verify the first calculation result and the second calculation result. If the first calculation result is the same as the second calculation result, the verification result is verification pass.
  • the adding module includes:
  • a second acquiring unit configured to acquire the second random number that is obtained according to the second cascading result
  • a fourth calculating unit configured to calculate, according to a third algorithm, an entry address corresponding to the hidden data included in the key data, and obtain a third calculation result
  • the encryption unit is configured to perform encryption processing on the third calculation result, and send the encrypted data generated by the encryption to the hardened software.
  • the fourth calculating unit when performing calculation according to the third algorithm, includes:
  • the method for authenticating the hardened software provided in the embodiment of the present invention can obtain the key data provided by the server after the server verifies the shell program of the hardened software, and is based on the plaintext software code of the hardened software in the key data.
  • the entry address corresponding to the hidden data can determine the position of the corresponding data hidden by the plaintext software code of the hardened software stored in the plaintext software code, and then replace the hidden data in the plaintext software code included in the key data.
  • the corresponding data hidden in the plaintext software code of the hardened software stored in the memory ensures that the hardened software runs normally.
  • verifying the shell program of the hardened software the shell program is effectively prevented from being tampered with, and the integrity of the shell program is ensured.
  • the authentication method provided by the embodiment of the present invention It can effectively distinguish the source of the service request, and can effectively protect the malicious application when it provides the service, greatly improving the protection strength of the hardened software, effectively preventing the attacker from attacking, and ensuring that the hardened software can run normally. .
  • 1A is a flowchart showing an authentication method of a hardened software in an embodiment of the present invention
  • FIG. 1B is a flowchart showing an authentication method of the hardened software in the embodiment of the present invention.
  • FIG. 2 is a flow chart showing the processing of the integrity check value of the shell program in the embodiment of the present invention.
  • FIG. 3 is a flow chart showing the acquisition of key data in an embodiment of the present invention.
  • FIG. 4 is a flow chart showing the corresponding data hidden by the plaintext software code in the embodiment of the present invention.
  • FIG. 5 is a flowchart showing a method for authenticating a hardened software according to an embodiment of the present invention
  • FIG. 6 is a flow chart showing the integrity check value of the verification shell program in the embodiment of the present invention.
  • Figure 7 is a flow chart showing the encryption of key data in the embodiment of the present invention.
  • 8A is a block diagram showing the structure of an authentication device for the hardened software in the embodiment of the present invention.
  • 8B is a block diagram showing the structure of an authentication device for the hardened software in the embodiment of the present invention.
  • FIG. 9 is a block diagram showing the structure of a processing module in an embodiment of the present invention.
  • FIG. 10 is a structural block diagram of an acquisition module in an embodiment of the present invention.
  • Figure 11 is a block diagram showing the structure of a replacement module in the embodiment of the present invention.
  • Figure 12 is a block diagram showing the structure of an authentication device for the hardened software in the embodiment of the present invention.
  • Figure 13 is a block diagram showing the structure of a verification module in an embodiment of the present invention.
  • Figure 14 is a block diagram showing the structure of an encryption module in the embodiment of the present invention.
  • the embodiment of the present invention provides a method for authenticating a hardened software, which is applied to a mobile terminal.
  • the authentication method 100 includes steps S103 and S105:
  • Step S103 After the server verifies the shell program of the hardened software, the key data sent by the server is obtained, where the key data includes: the hidden data in the plaintext software code of the hardened software and the entry address corresponding to the hidden data;
  • Step S105 Replace the corresponding data hidden by the plaintext software code of the hardened software stored in the memory according to the hidden data and the entry address, and then load the plaintext software code.
  • the authentication method of the hardened software provided by the embodiment of the present invention can obtain key data provided by the server, and can determine the in-memory storage according to the entry address corresponding to the hidden data in the plaintext software code of the hardened software in the key data. The location of the corresponding data hidden by the plaintext software code of the hardened software in the plaintext software code, and then hidden by the hidden data in the plaintext software code included in the key data to replace the plaintext software code of the hardened software stored in the memory. Corresponding data. Therefore, in the authentication method of the hardened software provided by the embodiment of the present invention, the hardened software needs to obtain the hidden key data from the server, which can effectively combat the attacker's attack, and has good performance on the hardened software. Protection, and after obtaining hidden key data, it can also ensure that the hardened software runs normally.
  • the authentication method 100 further includes:
  • Step S101 Calculate the integrity check value of the shell program of the hardened software, process the integrity check value of the shell program, send the processed processing result to the server, and verify the processing result by the server. If the verification result is verified, the server encrypts the key data to generate encrypted data.
  • the integrity check value of the shell program of the hardened software can be verified first, and the key data sent by the server can be obtained only after the verification is passed.
  • the integrity check value of the shell program of the hardened software is verified by the server, which can effectively prevent the shell program from being tampered with and ensure its integrity.
  • the server adopts a two-way challenge response mode based on the symmetric system, that is, the two-way cooperation between the hardened software installed on the mobile terminal and the server avoids the tradition.
  • the channel attack implements two-way entity authentication, which increases the protection strength of the shell program of the hardened software.
  • the integrity check value of the shell program of the hardened software is calculated, and the integrity check value of the shell program is processed, and the processed process is processed.
  • the result is sent to the server, and the processing result is verified by the server. If the verification result is the verification pass, the encrypted data is generated by the server for the key data encryption process (step S101), including:
  • Step S1011 Send the request information of the hardened software to the server, and the server randomly generates the first random number according to the request information of the hardened software;
  • Step S1013, calculating, according to the first algorithm, an integrity check value of the shell program of the hardened software
  • Step S1015 Obtain a first random number, perform a first concatenation process on the first random number and the integrity check value of the shell program, and obtain a first concatenation result;
  • Step S1017 Perform calculation on the first cascading result according to the second algorithm, and obtain a first calculation result
  • Step S1019 Perform a second cascade processing on the first calculation result and the second random number randomly generated by the reinforcement software to obtain a processing result, and send the processing result to the server, where the server verifies the processing result, and if the verification result is After the verification is passed, the server encrypts the key data to generate encrypted data.
  • the integrity check value of the shell program of the hardened software when the integrity check value of the shell program of the hardened software is verified, the integrity check value of the shell program may be processed first, thereby effectively preventing the The integrity check value of the shell program is sent to the server to be modified or destroyed by the attacker. Therefore, the integrity check value of the shell program of the hardened software is well protected.
  • step S103 after the server verifies the shell program of the hardened software, the key data sent by the server is acquired (step S103), including:
  • Step S1031 After the server verifies the shell program of the hardened software, decrypt the encrypted data sent by the server;
  • Step S1033 After the decryption operation is completed, the key data sent by the server included in the decrypted data is acquired.
  • Step S105 the corresponding data hidden by the plaintext software code of the hardened software stored in the memory is replaced according to the hidden data and the entry address, and then the plaintext software code is loaded ( Step S105), comprising:
  • Step S1051 Locating the location of the corresponding data hidden by the plaintext software code of the hardened software in the plaintext software code of the hardened software according to the entry address;
  • Step S1053 Replace the hidden data with the corresponding data hidden by the plaintext software code of the hardened software stored in the memory, and then load the plaintext software code.
  • the authentication method of the reinforced software provided by the embodiment of the present invention can not only ensure the normal operation of the reinforced software, but also has a good protection effect on the reinforced software, and can effectively combat the attacker's attack.
  • the integrity check value, the first random number, and the second random number are all expressed in hexadecimal. It is of course understood that, in the embodiment of the present invention, the integrity is complete.
  • the manner in which the parity check value, the first random number, and the second random number are expressed is not limited.
  • the authentication method 500 includes:
  • Step S501 Acquire the processing result sent by the reinforcement software, and verify the integrity check value of the shell program of the hardened software
  • Step S503 If the verification result is the verification pass, the key data is encrypted, and the encrypted data generated by the encryption is sent to the hardened software, where the key data includes: the hidden data in the plaintext software code of the hardened software is hidden. The entry address corresponding to the data.
  • the integrity check value of the shell program of the hardened software is first verified to ensure the integrity of the shell program, and the shell program is effectively prevented from being tampered, only after the verification is passed.
  • the key data is encrypted, thus ensuring the security in the process of sending critical data, which can effectively prevent the server from sending critical data to be obtained by the attacker, and has a good protection effect on the key data.
  • the integrity check value of the shell program of the hardened software is verified according to the processing result sent by the hardening software (step S501), including:
  • Step S5011 Acquire request information of the hardened software, randomly generate a first random number according to the request information, and send the first random number to the hardened software;
  • step S5013 the ID (identification) information of the hardened software is obtained according to the request information of the hardened software, and the integrity check value of the shell program of the hardened software is obtained according to the ID information of the hardened software, and the first random number and the shell are obtained.
  • the integrity check value of the program is subjected to the first cascading process to obtain the second cascading result;
  • Step S5015 Perform calculation on the second cascade result according to the second algorithm, to obtain a second calculation result
  • Step S5017 Acquire a processing result sent by the reinforcement software, and identify, according to the processing result, the first calculation result and the second random number.
  • Step S5019 Verify the first calculation result and the second calculation result. If the first calculation result is the same as the second calculation result, the verification result is verification pass.
  • the server Since the hardened software has processed the integrity check value of its shell program, the server needs to perform the same processing on the integrity check value of the shell program of the hardened software obtained, and the hardened software.
  • the calculated first calculation result is compared with the second calculation result calculated by the server. If the first result is different from the second result, it proves that the shell program of the hardened software is tampered with and is attacked by the attacker; if the first calculation result As with the second calculation result, the shell program of the hardened software is not destroyed.
  • the authentication method provided by the embodiment of the present invention can effectively prevent the shell program from being tampered with, and ensure the integrity thereof well, and realize the verification of the integrity of the shell program through the two-way cooperation between the hardened software and the server, and can avoid the traditional The channel attack implements two-way entity authentication.
  • the integrity check value, the first random number, and the second random number are all expressed in hexadecimal. Of course, in the embodiment of the present invention, the integrity check value and the first random number are used. And the manner in which the second random number is expressed is not limited.
  • step S503 if the verification result is the verification, the key data is encrypted, and the encrypted data generated by the encryption is sent to the hardened software (step S503), including:
  • Step S5031 Acquire a second random number that is identified according to the second concatenation result
  • Step S5033 The second random number and the entry address corresponding to the hidden data included in the key data are calculated according to the third algorithm, and a third calculation result is obtained;
  • Step S5035 Perform encryption processing on the third calculation result, and send the encrypted data generated by the encryption to the hardened software.
  • the second random number and the entry address in the plaintext software code of the hardened software are calculated according to the third algorithm, including: a plaintext software code for the second random number and the hardened software
  • the entry address in the XOR is logically ORed.
  • the protection degree of the key data is improved, the security in the process of transmitting the key data is ensured, and the server can effectively prevent the server from sending the key data to be acquired by the attacker, and the key data is Played a very good role in protection.
  • the embodiment of the present invention further provides an authentication device for the hardened software, which is applied to the mobile terminal.
  • the authentication device 800 includes:
  • the obtaining module 803 is configured to obtain key data sent by the server after the server verifies the shell program of the hardened software, and the key data includes: the hidden data in the plaintext software code of the hardened software and the entry address corresponding to the hidden data. ;
  • the replacement module 805 is configured to replace the corresponding data hidden by the plaintext software code of the hardened software stored in the memory according to the hidden data and the entry address, and then load the plaintext software code.
  • the authentication apparatus 800 further includes:
  • the processing module 801 is configured to calculate an integrity check value of the shell program of the hardened software, The integrity check value of the shell program is processed, and the processed processing result is sent to the server, and the server verifies the processing result. If the verification result is verified, the server encrypts the key data to generate encrypted data.
  • the processing module 801 includes:
  • the sending unit 8011 is configured to send the request information of the hardened software to the server, and the server randomly generates the first random number according to the request information of the hardened software;
  • the first calculating unit 8013 is configured to calculate, according to the first algorithm, an integrity check value of the shell program of the hardened software
  • the first cascading unit 8015 is configured to obtain a first random number, perform a first cascading process on the first random number and the integrity check value of the shell program, to obtain a first cascading result;
  • the second calculating unit 8017 is configured to calculate the first cascading result according to the second algorithm, to obtain the first calculation result;
  • the second cascading unit 8019 is configured to perform a second cascading process on the first calculation result and the second random number randomly generated by the reinforced software to obtain a processing result, and send the processing result to the server, where the processing result is performed by the server. Verification, if the verification result is verified, the server encrypts the key data to generate encrypted data.
  • the obtaining module 803 includes:
  • the decrypting unit 8031 is configured to perform decryption operation on the encrypted data sent by the server after the server verifies the shell program of the hardened software;
  • the first obtaining unit 8033 is configured to acquire key data sent by the server included in the decrypted data after the decryption operation is completed.
  • the replacement module 805 includes:
  • the locating unit 8051 is configured to locate the position of the corresponding data hidden by the plaintext software code of the hardened software in the plaintext software code of the hardened software according to the entry address;
  • the replacing unit 8053 is configured to replace the hidden data with the corresponding data hidden by the plaintext software code of the hardened software stored in the memory, and then load the plaintext software code.
  • the authentication device of the hardened software provided by the embodiment of the present invention can obtain key data provided by the server, and can determine the in-memory storage according to the entry address corresponding to the hidden data in the plaintext software code of the hardened software in the key data.
  • Hidden by the plaintext software code of the hardened software The corresponding data is located in the plaintext software code, and then the corresponding data hidden by the plaintext software code of the hardened software stored in the memory is replaced with the hidden data in the plaintext software code included in the key data. Therefore, the hardened software needs to obtain the hidden key data from the server, which can effectively resist the attacker's attack, has a good protection effect on the hardened software, and can ensure the hidden key data.
  • the reinforced software runs normally.
  • an authentication device of the hardened software is further applied to the server.
  • the authentication device 1200 includes:
  • the verification module 1201 is configured to obtain the processing result sent by the hardening software, and verify the integrity check value of the shell program of the hardened software;
  • the encryption module 1203 is configured to: if the verification result is the verification pass, encrypt the key data, and send the encrypted data generated by the encryption to the hardened software, where the key data includes: the hidden data in the plaintext software code of the hardened software and The entry address corresponding to the hidden data.
  • the verification module 1201 includes:
  • the generating unit 12011 is configured to obtain the request information of the hardened software, randomly generate the first random number according to the request information, and send the first random number to the hardened software;
  • the third cascading unit 12013 is configured to acquire the ID information of the hardened software according to the request information of the hardened software, and obtain the integrity check value of the shell program of the hardened software according to the ID information of the hardened software, and the first random Performing a first cascade processing on the integrity check value of the shell program to obtain a second cascade result;
  • the third calculating unit 12015 is configured to calculate the second cascading result according to the second algorithm, to obtain a second calculating result;
  • the identification unit 12017 is configured to acquire the processing result sent by the reinforcement software, and identify the first calculation result and the second random number according to the processing result;
  • the verification unit 12019 is configured to verify the first calculation result and the second calculation result. If the first calculation result is the same as the second calculation result, the verification result is verification pass.
  • the adding module 1203 includes:
  • the second obtaining unit 12031 is configured to acquire a second random number that is identified according to the second cascading result
  • the fourth calculating unit 12033 is configured to calculate, according to a third algorithm, an entry address corresponding to the hidden data included in the key data, and obtain a third calculation result;
  • the encryption unit 12035 is configured to perform encryption processing on the third calculation result, and send the encrypted data generated by the encryption to the hardened software.
  • the fourth calculating unit 12033 when performing calculation according to the third algorithm, includes:
  • the authentication device provided by the embodiment of the present invention firstly verifies the integrity check value of the shell program of the hardened software to ensure the integrity of the shell program, effectively prevents the shell program from being tampered with, and then, after the verification is passed, Send critical data to the hardened software.
  • key data Before sending critical data, key data needs to be encrypted. This ensures the security in the process of sending critical data. It can effectively prevent the server from sending critical data to be attacked by the attacker.
  • the data is very protective.
  • the embodiment of the invention further provides a computer readable storage medium storing computer executable instructions for performing the above method.
  • all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
  • the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
  • the device/function module/functional unit in the above embodiment When the device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
  • the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the solution of the embodiment of the present invention can effectively distinguish the source of the service request, and can effectively protect the malicious application when requesting the service, greatly improving the protection strength of the hardened software, and effectively preventing the attacker from attacking. To ensure that the hardened software can run normally.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Technology Law (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Storage Device Security (AREA)

Abstract

一种被加固软件的认证方法及装置,该方法包括:在服务器对被加固软件的壳程序验证通过之后,获取服务器发送的关键数据,关键数据包括:被加固软件的明文软件代码中被隐藏的数据和被隐藏数据对应的入口地址;根据被隐藏的数据和入口地址,替换内存中存储的被加固软件的明文软件代码所隐藏的对应数据,然后加载明文软件代码。

Description

一种被加固软件的认证方法及装置 技术领域
本申请涉及但不限于互联网安全技术领域。
背景技术
相关技术里,在安卓(Android)系统中,为了安全的需要,我们会对应用软件安装包做相应的加固处理,并且相应的希望市场上流通的都是经过加固处理的安装包。但是相关技术中安卓软件市场种类繁多,对同一软件安装包的发布也会有很多自定义的版本。
对安卓系统的服务而言,当作为应用的服务而运行时,会启动一个新的进程或者利用应用现有进程,创建一个服务对象。当其他应用调用到此服务时由此服务对象的代码完成具体的业务逻辑。
然而按照相关技术中安卓系统的服务提供方式,服务将数据提供给应用之后,服务无法对提供给应用的数据进行存取保护。即使根据服务的请求,应用在存取数据时进行安全提示,但对用户而言,也不能有效分清服务请求的来源,因此不能保证正确处理安全提示,在恶意应用请求提供服务时,无法进行有效的保护。为避免未经加固处理的安装包在市面上的安装传播,需要对根据安装包生成的应用软件进行认证。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
本发明实施例提供了一种被加固软件的认证方法及装置,既能够有效分清服务请求的来源,又能够在恶意应用请求提供服务时,进行有效的保护,大大提高了对被加固软件的保护强度,有效地防止攻击者的攻击,保证被加固软件可以正常运行。
本发明实施例采用如下技术方案:
本发明实施例提供了一种被加固软件的认证方法,应用于移动终端,所述认证方法包括:
在服务器对被加固软件的壳程序验证通过之后,获取所述服务器发送的关键数据,所述关键数据包括:所述被加固软件的明文软件代码中被隐藏的数据和所述被隐藏数据对应的入口地址;
根据所述被隐藏的数据和所述入口地址,替换内存中存储的所述被加固软件的明文软件代码所隐藏的对应数据,然后加载所述明文软件代码。
可选地,在服务器对被加固软件的壳程序验证通过之前,所述认证方法还包括:
计算得到被加固软件的壳程序的完整性校验值,并对所述壳程序的完整性校验值进行处理,将处理后的处理结果发送给所述服务器,由所述服务器对所述处理结果进行验证,若验证结果为验证通过,则由所述服务器对关键数据加密处理生成加密数据。
可选地,所述计算得到被加固软件的壳程序的完整性校验值,并对所述壳程序的完整性校验值进行处理,将处理后的处理结果发送给所述服务器,包括:
将所述被加固软件的请求信息发送给服务器,并接收所述服务器根据所述被加固软件的请求信息随机生成的第一随机数;
根据第一算法计算得到被加固软件的壳程序的完整性校验值;
将所述第一随机数与所述壳程序的完整性校验值进行第一级联处理,获取第一级联结果;
根据第二算法对所述第一级联结果进行计算,获取第一计算结果;
将所述第一计算结果与所述被加固软件随机生成的第二随机数进行第二级联处理,得到处理结果,并将处理结果发送给所述服务器。
可选地,所述在服务器对被加固软件的壳程序验证通过之后,获取所述服务器发送的关键数据,包括:
在服务器对被加固软件的壳程序验证通过之后,对所述服务器发送的加密数据进行解密运算;
所述解密运算完成后,获取解密数据中包含的所述服务器发送的关键数 据。
可选地,所述根据所述被隐藏的数据和所述入口地址,替换内存中存储的所述被加固软件的明文软件代码所隐藏的对应数据,然后加载所述明文软件代码,包括:
根据所述入口地址,定位所述被加固软件的明文软件代码所隐藏的对应数据在所述被加固软件的明文软件代码中的位置;
将所述被隐藏的数据替换内存中存储的所述被加固软件的明文软件代码所隐藏的对应数据,然后加载所述明文软件代码。
依据本发明实施例的另一方面,还提供了一种被加固软件的认证方法,应用于服务器,所述认证方法包括:
获取被加固软件发送的处理结果,对所述被加固软件的壳程序的完整性校验值进行验证;
若所述验证结果为验证通过,则对关键数据进行加密处理,并将加密生成的加密数据发送给所述被加固软件,所述关键数据包括:所述被加固软件的明文软件代码中被隐藏的数据和所述被隐藏数据对应的入口地址。
可选地,所述根据被加固软件发送的处理结果,对所述被加固软件的壳程序的完整性校验值进行验证,包括:
获取被加固软件的请求信息,根据所述请求信息随机生成第一随机数,并将所述第一随机数发送给所述被加固软件;
根据所述被加固软件的请求信息获取所述被加固软件的ID信息,并根据所述被加固软件的ID信息获取所述被加固软件的壳程序的完整性校验值,将所述第一随机数与所述壳程序的完整性校验值进行第一级联处理,获取第二级联结果;
根据第二算法对所述第二级联结果进行计算,得到第二计算结果;
获取所述被加固软件发送的处理结果,根据所述处理结果识别获取第一计算结果和第二随机数;
对所述第一计算结果与所述第二计算结果进行验证,若所述第一计算结果与所述第二计算结果相同,则验证结果为验证通过。
可选地,所述若所述验证结果为验证通过,则对关键数据进行加密处理, 将加密生成的加密数据发送给所述被加固软件,包括:
获取根据所述第二级联结果识别得到的所述第二随机数;
所述第二随机数与关键数据中包括的所述被隐藏数据对应的入口地址根据第三算法进行计算,并得到第三计算结果;
对所述第三计算结果进行加密处理,将加密后生成的加密数据发送给所述被加固软件。
可选地,所述将所述第二随机数与所述被加固软件的明文软件代码中的入口地址根据第三算法进行计算,包括:
对所述第二随机数与所述被加固软件的明文软件代码中的入口地址进行异或的逻辑运算。
本发明实施例可选地提供了一种被加固软件的认证装置,应用于移动终端,所述认证装置包括:
获取模块,设置为在服务器对被加固软件的壳程序验证通过之后,获取所述服务器发送的关键数据,所述关键数据包括:所述被加固软件的明文软件代码中被隐藏的数据和所述被隐藏数据对应的入口地址;
替换模块,设置为根据所述被隐藏的数据和所述入口地址,替换内存中存储的所述被加固软件的明文软件代码所隐藏的对应数据,然后加载所述明文软件代码。
可选地,所述认证装置还包括:
处理模块,设置为计算得到被加固软件的壳程序的完整性校验值,并对所述壳程序的完整性校验值进行处理,将处理后的处理结果发送给所述服务器,由所述服务器对所述处理结果进行验证,若验证结果为验证通过,则由所述服务器对关键数据加密处理生成加密数据。
可选地,所述处理模块包括:
发送单元,设置为将所述被加固软件的请求信息发送给服务器,由所述服务器根据所述被加固软件的请求信息随机生成第一随机数;
第一计算单元,设置为根据第一算法计算得到被加固软件的壳程序的完整性校验值;
第一级联单元,设置为获取所述第一随机数,将所述第一随机数与所述壳程序的完整性校验值进行第一级联处理,获取第一级联结果;
第二计算单元,设置为根据第二算法对所述第一级联结果进行计算,获取第一计算结果;
第二级联单元,设置为将所述第一计算结果与所述被加固软件随机生成的第二随机数进行第二级联处理,得到处理结果,并将处理结果发送给所述服务器,由所述服务器对所述处理结果进行验证,若验证结果为验证通过,则由所述服务器对关键数据加密处理生成加密数据。
可选地,所述获取模块包括:
解密单元,设置为在服务器对被加固软件的壳程序验证通过之后,对所述服务器发送的加密数据进行解密运算;
第一获取单元,设置为所述解密运算完成后,获取解密数据中包含的所述服务器发送的关键数据。
可选地,所述替换模块包括:
定位单元,设置为根据所述入口地址,定位所述被加固软件的明文软件代码所隐藏的对应数据在所述被加固软件的明文软件代码中的位置;
替换单元,设置为将所述被隐藏的数据替换内存中存储的所述被加固软件的明文软件代码所隐藏的对应数据,然后加载所述明文软件代码。
依据本发明实施例的另一方面,还提供了一种被加固软件的认证装置,应用于服务器,所述认证装置包括:
验证模块,设置为获取被加固软件发送的处理结果,对所述被加固软件的壳程序的完整性校验值进行验证;
加密模块,设置为若所述验证结果为验证通过,则对关键数据进行加密处理,将加密生成的加密数据发送给所述被加固软件,所述关键数据包括:所述被加固软件的明文软件代码中被隐藏的数据和所述被隐藏数据对应的入口地址。
可选地,所述验证模块包括:
生成单元,设置为获取被加固软件的请求信息,根据所述请求信息随机生成第一随机数,并将所述第一随机数发送给所述被加固软件;
第三级联单元,设置为根据所述被加固软件的请求信息获取所述被加固软件的ID信息,并根据所述被加固软件的ID信息获取所述被加固软件的壳程序的完整性校验值,将所述第一随机数与所述壳程序的完整性校验值进行第一级联处理,获取第二级联结果;
第三计算单元,设置为根据第二算法对所述第二级联结果进行计算,得到第二计算结果;
识别单元,设置为获取所述被加固软件发送的处理结果,根据所述处理结果识别获取第一计算结果和第二随机数;
验证单元,设置为对所述第一计算结果与所述第二计算结果进行验证,若所述第一计算结果与所述第二计算结果相同,则验证结果为验证通过。
可选地,所述添加模块包括:
第二获取单元,设置为获取根据所述第二级联结果识别得到的所述第二随机数;
第四计算单元,设置为所述第二随机数与关键数据中包括的所述被隐藏数据对应的入口地址根据第三算法进行计算,并得到第三计算结果;
加密单元,设置为对所述第三计算结果进行加密处理,将加密后生成的加密数据发送给所述被加固软件。
可选地,所述第四计算单元在根据所述第三算法进行计算时,包括:
对所述第二随机数与所述被加固软件的明文软件代码中的入口地址进行异或的逻辑运算。
本发明实施例的有益效果是:
本发明实施例中提供的被加固软件的认证方法,在服务器对被加固软件的壳程序验证通过之后,可获取服务器提供的关键数据,并根据关键数据中的被加固软件的明文软件代码中被隐藏的数据对应的入口地址,能够确定内存中存储的被加固软件的明文软件代码所隐藏的对应数据在明文软件代码中的位置,然后用关键数据中包括的明文软件代码中被隐藏的数据替换内存中存储的被加固软件的明文软件代码所隐藏的对应数据,保证了该被加固软件正常运行。另外,通过对被加固软件的壳程序进行验证,有效地防止壳程序被篡改,保证了壳程序的完整性。所以,通过本发明实施例提供的认证方法 既能够有效分清服务请求的来源,又能够在恶意应用请求提供服务时,进行有效的保护,大大提高了对被加固软件的保护强度,有效地防止攻击者的攻击,保证被加固软件可以正常运行。
在阅读并理解了附图和详细描述后,可以明白其他方面。
附图概述
图1A表示本发明实施例中被加固软件的认证方法的流程图;
图1B表示本发明实施例中被加固软件的认证方法的流程图;
图2表示本发明实施例中对壳程序的完整性校验值进行处理的流程图;
图3表示本发明实施例中获取关键数据的流程图;
图4表示本发明实施例中替换明文软件代码所隐藏的对应数据的流程图;
图5表示本发明实施例中被加固软件的认证方法的流程图;
图6表示本发明实施例中验证壳程序的完整性校验值的流程图;
图7表示本发明实施例中加密关键数据的流程图;
图8A表示本发明实施例中被加固软件的认证装置的结构框图;
图8B表示本发明实施例中被加固软件的认证装置的结构框图;
图9表示本发明实施例中处理模块的结构框图;
图10表示本发明实施例中获取模块的结构框图;
图11表示本发明实施例中替换模块的结构框图;
图12表示本发明实施例中被加固软件的认证装置的结构框图;
图13表示本发明实施例中验证模块的结构框图;以及
图14表示本发明实施例中加密模块的结构框图。
本发明的较佳实施方式
下面结合附图对本发明实施例进行描述。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的各种方式可以相互组合。
实施例一
本发明实施例提供了一种被加固软件的认证方法,应用于移动终端,如图1A所示,该认证方法100包括步骤S103和S105:
步骤S103、在服务器对被加固软件的壳程序验证通过之后,获取服务器发送的关键数据,关键数据包括:被加固软件的明文软件代码中被隐藏的数据和被隐藏数据对应的入口地址;
步骤S105、根据被隐藏的数据和入口地址,替换内存中存储的被加固软件的明文软件代码所隐藏的对应数据,然后加载明文软件代码。
通过本发明实施例提供的被加固软件的认证方法,可获取服务器提供的关键数据,并根据关键数据中的被加固软件的明文软件代码中被隐藏的数据对应的入口地址,能够确定内存中存储的被加固软件的明文软件代码所隐藏的对应数据在明文软件代码中的位置,然后用关键数据中包括的明文软件代码中被隐藏的数据替换内存中存储的被加固软件的明文软件代码所隐藏的对应数据。因此,在本发明实施例提供的被加固软件的认证方法中,被加固软件需要从服务器上获取自身隐藏的关键数据,可以有效地对抗了攻击者的攻击,对该被加固软件有很好的保护作用,而且在获取隐藏的关键数据后,还可以保证该被加固软件正常运行。
可选地,如图1B所示,在本发明实施例中,该认证方法100还包括:
步骤S101、计算得到被加固软件的壳程序的完整性校验值,并对壳程序的完整性校验值进行处理,将处理后的处理结果发送给服务器,由服务器对处理结果进行验证,若验证结果为验证通过,则由服务器对关键数据加密处理生成加密数据。
因此,在本发明实施例中,在获取关键数据前,首先可以对被加固软件的壳程序的完整性校验值进行验证,只有当验证通过后,才能获取服务器发送的关键数据。另外,通过服务器对被加固软件的壳程序的完整性校验值进行验证,能够有效防止壳程序被篡改,很好地保证其完整性。而且服务器在对被加固软件的壳程序的完整性校验值进行验证过程中,采用基于对称体制的双向挑战应答方式,即由安装于移动终端的被加固软件与服务器双向配合实现,避免了传统的信道攻击,实现了双向实体认证,增加了对被加固软件的壳程序的保护强度。
可选地,如图2所示,在本发明实施例中,计算得到被加固软件的壳程序的完整性校验值,并对壳程序的完整性校验值进行处理,将处理后的处理结果发送给服务器,由服务器对处理结果进行验证,若验证结果为验证通过,则由服务器对关键数据加密处理生成加密数据(步骤S101)包括:
步骤S1011、将被加固软件的请求信息发送给服务器,由服务器根据被加固软件的请求信息随机生成第一随机数;
步骤S1013、根据第一算法计算得到被加固软件的壳程序的完整性校验值;
步骤S1015、获取第一随机数,将第一随机数与壳程序的完整性校验值进行第一级联处理,获取第一级联结果;
步骤S1017、根据第二算法对第一级联结果进行计算,获取第一计算结果;
步骤S1019、将第一计算结果与被加固软件随机生成的第二随机数进行第二级联处理,得到处理结果,并将处理结果发送给服务器,由服务器对处理结果进行验证,若验证结果为验证通过,则由服务器对关键数据加密处理生成加密数据。
可选地,在本发明实施例中,在对被加固软件的壳程序的完整性校验值进行校验时,首先可以对其壳程序的完整性校验值进行处理,有效地防止了在将壳程序的完整性校验值发送给服务器的过程中遭受到被攻击者修改或者破坏,因此,对被加固软件的壳程序的完整性校验值起到了很好的保护作用。
可选地,如图3所示,在本发明实施例中,在服务器对被加固软件的壳程序验证通过之后,获取服务器发送的关键数据(步骤S103),包括:
步骤S1031、在服务器对被加固软件的壳程序验证通过之后,对服务器发送的加密数据进行解密运算;
步骤S1033、解密运算完成后,获取解密数据中包含的服务器发送的关键数据。
通过对关键数据进行加密处理,能够有效防止服务器发送关键数据的过程中,关键数据被攻击者获取,对关键数据起到了很好的保护作用。因此,被加固软件在获取加密数据后,需要对其进行解密以获取服务器发送的关键 数据。
可选地,如图4所示,在本发明实施例中,根据被隐藏的数据和入口地址,替换内存中存储的被加固软件的明文软件代码所隐藏的对应数据,然后加载明文软件代码(步骤S105),包括:
步骤S1051、根据入口地址,定位被加固软件的明文软件代码所隐藏的对应数据在被加固软件的明文软件代码中的位置;
步骤S1053、将被隐藏的数据替换内存中存储的被加固软件的明文软件代码所隐藏的对应数据,然后加载明文软件代码。
因此,在获取服务器提供的关键数据后,根据关键数据中的被加固软件的明文软件代码中被隐藏的数据对应的入口地址,能够确定内存中存储的被加固软件的明文软件代码所隐藏的对应数据在明文软件代码中的位置,并用关键数据中包括的明文软件代码中被隐藏的数据替换内存中存储的被加固软件的明文软件代码所隐藏的对应数据。因此,本发明实施例提供的被加固软件的认证方法不仅可以保证该被加固软件正常运行,而且对该被加固软件有很好的保护作用,能够有效地对抗了攻击者的攻击。
可选地,在本发明实施例中,上述完整性校验值、第一随机数以及第二随机数均采用十六进制表示,当然可以理解的是,在本发明实施例中,对完整性校验值、第一随机数以及第二随机数的表述方式并不进行限定。
实施例二
依据本发明的另一方面,还提供了一种被加固软件的认证方法,应用于服务器,如图5所示,该认证方法500包括:
步骤S501、获取被加固软件发送的处理结果,对被加固软件的壳程序的完整性校验值进行验证;
步骤S503、若验证结果为验证通过,则对关键数据进行加密处理,并将加密生成的加密数据发送给被加固软件,关键数据包括:被加固软件的明文软件代码中被隐藏的数据和被隐藏数据对应的入口地址。
其中,在本发明实施例中,首先要对被加固软件的壳程序的完整性校验值进行验证,以保证其壳程序的完整性,有效地防止壳程序被篡改,只有当验证通过后,才能向被加固软件发送关键数据,在发送关键数据前,需要对 关键数据进行加密处理,因此保证了在发送关键数据过程中的安全性,能够有效防止服务器发送关键数据被攻击者获取,对关键数据起到了很好的保护作用。
可选地,如图6所示,在本发明实施例中,根据被加固软件发送的处理结果,对被加固软件的壳程序的完整性校验值进行验证(步骤S501),包括:
步骤S5011、获取被加固软件的请求信息,根据请求信息随机生成第一随机数,并将第一随机数发送给被加固软件;
步骤S5013、根据被加固软件的请求信息获取被加固软件的ID(标识)信息,并根据被加固软件的ID信息获取被加固软件的壳程序的完整性校验值,将第一随机数与壳程序的完整性校验值进行第一级联处理,获取第二级联结果;
步骤S5015、根据第二算法对第二级联结果进行计算,得到第二计算结果;
步骤S5017、获取被加固软件发送的处理结果,根据处理结果识别获取第一计算结果和第二随机数;
步骤S5019、对第一计算结果与第二计算结果进行验证,若第一计算结果与第二计算结果相同,则验证结果为验证通过。
由于被加固软件对其壳程序的完整性校验值进行了相应的处理,因此,服务器需要对其获取的被加固软件的壳程序的完整性校验值进行同样的处理,并对被加固软件计算的第一计算结果与服务器计算的第二计算结果进行对比,若第一结果与第二结果不同,则证明被加固软件的壳程序被篡改,遭到攻击者的攻击;若第一计算结果与第二计算结果相同,则被加固软件的壳程序没有被破坏。
所以,本发明实施例提供的认证方法能够有效防止壳程序被篡改,很好地保证其完整性,并通过被加固软件与服务器的双向配合,实现了对壳程序完整性的验证,能够避免传统的信道攻击,实现了双向实体认证。其中,上述完整性校验值、第一随机数以及第二随机数均采用十六进制表示,当然可以理解的是,在本发明实施例中,对完整性校验值、第一随机数以及第二随机数的表述方式并不进行限定。
可选地,如图7所示,在本发明实施例中,若验证结果为验证通过,则对关键数据进行加密处理,将加密生成的加密数据发送给被加固软件(步骤S503),包括:
步骤S5031、获取根据第二级联结果识别得到的第二随机数;
步骤S5033、第二随机数与关键数据中包括的被隐藏数据对应的入口地址根据第三算法进行计算,并得到第三计算结果;
步骤S5035、对第三计算结果进行加密处理,将加密后生成的加密数据发送给被加固软件。
可选地,在本发明实施例中,将第二随机数与被加固软件的明文软件代码中的入口地址根据第三算法进行计算,包括:对第二随机数与被加固软件的明文软件代码中的入口地址进行异或的逻辑运算。
其中,在本发明实施例中,经过上述加密处理,提高了对关键数据的保护程度,保证了在发送关键数据过程中的安全性,能够有效防止服务器发送关键数据被攻击者获取,对关键数据起到了很好的保护作用。
由上述可知,本发明实施例提供的认证方法中的流程不能被逾越,只要在认证过程中出现错误,则不能继续后续流程,因此既能够有效分清服务请求的来源,又能够在恶意应用请求提供服务时,进行有效的保护,大大提高了对被加固软件的保护强度,有效地防止攻击者的攻击,保证被加固软件可以正常运行。
实施例三
本发明实施例还提供了一种被加固软件的认证装置,应用于移动终端,如图8A所示,该认证装置800包括:
获取模块803,设置为在服务器对被加固软件的壳程序验证通过之后,获取服务器发送的关键数据,关键数据包括:被加固软件的明文软件代码中被隐藏的数据和被隐藏数据对应的入口地址;
替换模块805,设置为根据被隐藏的数据和入口地址,替换内存中存储的被加固软件的明文软件代码所隐藏的对应数据,然后加载明文软件代码。
可选地,如图8B所示,在本发明实施例中,该认证装置800还包括:
处理模块801,设置为计算得到被加固软件的壳程序的完整性校验值, 并对壳程序的完整性校验值进行处理,将处理后的处理结果发送给服务器,由服务器对处理结果进行验证,若验证结果为验证通过,则由服务器对关键数据加密处理生成加密数据。
可选地,如图9所示,在本发明实施例中,处理模块801包括:
发送单元8011,设置为将被加固软件的请求信息发送给服务器,由服务器根据被加固软件的请求信息随机生成第一随机数;
第一计算单元8013,设置为根据第一算法计算得到被加固软件的壳程序的完整性校验值;
第一级联单元8015,设置为获取第一随机数,将第一随机数与壳程序的完整性校验值进行第一级联处理,获取第一级联结果;
第二计算单元8017,设置为根据第二算法对第一级联结果进行计算,获取第一计算结果;
第二级联单元8019,设置为将第一计算结果与被加固软件随机生成的第二随机数进行第二级联处理,得到处理结果,并将处理结果发送给服务器,由服务器对处理结果进行验证,若验证结果为验证通过,则由服务器对关键数据加密处理生成加密数据。
可选地,如图10所示,在本发明实施例中,获取模块803包括:
解密单元8031,设置为在服务器对被加固软件的壳程序验证通过之后,对服务器发送的加密数据进行解密运算;
第一获取单元8033,设置为解密运算完成后,获取解密数据中包含的服务器发送的关键数据。
可选地,如图11所示,在本发明实施例中,替换模块805包括:
定位单元8051,设置为根据入口地址,定位被加固软件的明文软件代码所隐藏的对应数据在被加固软件的明文软件代码中的位置;
替换单元8053,设置为将被隐藏的数据替换内存中存储的被加固软件的明文软件代码所隐藏的对应数据,然后加载明文软件代码。
通过本发明实施例提供的被加固软件的认证装置,可获取服务器提供的关键数据,并根据关键数据中的被加固软件的明文软件代码中被隐藏的数据对应的入口地址,能够确定内存中存储的被加固软件的明文软件代码所隐藏 的对应数据在明文软件代码中的位置,然后用关键数据中包括的明文软件代码中被隐藏的数据替换内存中存储的被加固软件的明文软件代码所隐藏的对应数据。因此,被加固软件需要从服务器上获取自身隐藏的关键数据,可以有效地对抗了攻击者的攻击,对该被加固软件有很好的保护作用,而且在获取隐藏的关键数据后,还可以保证该被加固软件正常运行。
实施例四
依据本发明实施例的另一方面,还提供了一种被加固软件的认证装置,应用于服务器,如图12所示,该认证装置1200包括:
验证模块1201,设置为获取被加固软件发送的处理结果,对被加固软件的壳程序的完整性校验值进行验证;
加密模块1203,设置为若验证结果为验证通过,则对关键数据进行加密处理,将加密生成的加密数据发送给被加固软件,关键数据包括:被加固软件的明文软件代码中被隐藏的数据和被隐藏数据对应的入口地址。
可选地,如图13所示,在本发明实施例中,验证模块1201包括:
生成单元12011,设置为获取被加固软件的请求信息,根据请求信息随机生成第一随机数,并将第一随机数发送给被加固软件;
第三级联单元12013,设置为根据被加固软件的请求信息获取被加固软件的ID信息,并根据被加固软件的ID信息获取被加固软件的壳程序的完整性校验值,将第一随机数与壳程序的完整性校验值进行第一级联处理,获取第二级联结果;
第三计算单元12015,设置为根据第二算法对第二级联结果进行计算,得到第二计算结果;
识别单元12017,设置为获取被加固软件发送的处理结果,根据处理结果识别获取第一计算结果和第二随机数;
验证单元12019,设置为对第一计算结果与第二计算结果进行验证,若第一计算结果与第二计算结果相同,则验证结果为验证通过。
可选地,如图14所示,在本发明实施例中,添加模块1203包括:
第二获取单元12031,设置为获取根据第二级联结果识别得到的第二随机数;
第四计算单元12033,设置为第二随机数与关键数据中包括的被隐藏数据对应的入口地址根据第三算法进行计算,并得到第三计算结果;
加密单元12035,设置为对第三计算结果进行加密处理,将加密后生成的加密数据发送给被加固软件。
其中,第四计算单元12033在根据第三算法进行计算时,包括:
对第二随机数与被加固软件的明文软件代码中的入口地址进行异或的逻辑运算。
本发明实施例提供的认证装置首先要对被加固软件的壳程序的完整性校验值进行验证,以保证其壳程序的完整性,有效地防止壳程序被篡改,然后在当验证通过后,向被加固软件发送关键数据,其中在发送关键数据前,需要对关键数据进行加密处理,因此保证了在发送关键数据过程中的安全性,能够有效防止服务器发送关键数据被攻击者获取,对关键数据起到了很好的保护作用。
本发明实施例还提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行上述方法。
以上所述的是本发明实施例的可选实施方式,应当指出对于本技术领域的普通人员来说,在不脱离本发明实施例所述的原理前提下还可以作出改进和润饰,这些改进和润饰也在本发明实施例的保护范围内。
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。
上述实施例中的装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。
上述实施例中的装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。
工业实用性
通过本发明实施例的方案,既能够有效分清服务请求的来源,又能够在恶意应用请求提供服务时,进行有效的保护,大大提高了对被加固软件的保护强度,有效地防止攻击者的攻击,保证被加固软件可以正常运行。

Claims (18)

  1. 一种被加固软件的认证方法,应用于移动终端,所述认证方法包括:
    在服务器对被加固软件的壳程序验证通过之后,获取所述服务器发送的关键数据,所述关键数据包括:所述被加固软件的明文软件代码中被隐藏的数据和所述被隐藏数据对应的入口地址;
    根据所述被隐藏的数据和所述入口地址,替换内存中存储的所述被加固软件的明文软件代码所隐藏的对应数据,然后加载所述明文软件代码。
  2. 如权利要求1所述的认证方法,其中,在服务器对被加固软件的壳程序验证通过之前还包括:
    计算得到被加固软件的壳程序的完整性校验值,并对所述壳程序的完整性校验值进行处理,将处理后的处理结果发送给所述服务器,由所述服务器对所述处理结果进行验证,若验证结果为验证通过,则由所述服务器对关键数据加密处理生成加密数据。
  3. 如权利要求2所述的认证方法,其中,所述计算得到被加固软件的壳程序的完整性校验值,并对所述壳程序的完整性校验值进行处理,将处理后的处理结果发送给所述服务器,包括:
    将所述被加固软件的请求信息发送给服务器,并接收所述服务器根据所述被加固软件的请求信息随机生成的第一随机数;
    根据第一算法计算得到被加固软件的壳程序的完整性校验值;
    将所述第一随机数与所述壳程序的完整性校验值进行第一级联处理,获取第一级联结果;
    根据第二算法对所述第一级联结果进行计算,获取第一计算结果;
    将所述第一计算结果与所述被加固软件随机生成的第二随机数进行第二级联处理,得到处理结果,并将处理结果发送给所述服务器。
  4. 如权利要求3所述的认证方法,其中,所述在服务器对被加固软件的壳程序验证通过之后,获取所述服务器发送的关键数据,包括:
    在服务器对被加固软件的壳程序验证通过之后,对所述服务器发送的加密数据进行解密运算;
    所述解密运算完成后,获取解密数据中包含的所述服务器发送的关键数据。
  5. 如权利要求1所述的认证方法,其中,所述根据所述被隐藏的数据和所述入口地址,替换内存中存储的所述被加固软件的明文软件代码所隐藏的对应数据,然后加载所述明文软件代码,包括:
    根据所述入口地址,定位所述被加固软件的明文软件代码所隐藏的对应数据在所述被加固软件的明文软件代码中的位置;
    将所述被隐藏的数据替换内存中存储的所述被加固软件的明文软件代码所隐藏的对应数据,然后加载所述明文软件代码。
  6. 一种被加固软件的认证方法,应用于服务器,所述认证方法包括:
    获取被加固软件发送的处理结果,对所述被加固软件的壳程序的完整性校验值进行验证;
    若所述验证结果为验证通过,则对关键数据进行加密处理,并将加密生成的加密数据发送给所述被加固软件,所述关键数据包括:所述被加固软件的明文软件代码中被隐藏的数据和所述被隐藏数据对应的入口地址。
  7. 如权利要求6所述的认证方法,其中,所述根据被加固软件发送的处理结果,对所述被加固软件的壳程序的完整性校验值进行验证,包括:
    获取被加固软件的请求信息,根据所述请求信息随机生成第一随机数,并将所述第一随机数发送给所述被加固软件;
    根据所述被加固软件的请求信息获取所述被加固软件的标识ID信息,并根据所述被加固软件的ID信息获取所述被加固软件的壳程序的完整性校验值,将所述第一随机数与所述壳程序的完整性校验值进行第一级联处理,获取第二级联结果;
    根据第二算法对所述第二级联结果进行计算,得到第二计算结果;
    获取所述被加固软件发送的处理结果,根据所述处理结果识别获取第一计算结果和第二随机数;
    对所述第一计算结果与所述第二计算结果进行验证,若所述第一计算结果与所述第二计算结果相同,则验证结果为验证通过。
  8. 如权利要求7所述的认证方法,其中,所述若所述验证结果为验证通 过,则对关键数据进行加密处理,将加密生成的加密数据发送给所述被加固软件,包括:
    获取根据所述第二级联结果识别得到的所述第二随机数;
    所述第二随机数与关键数据中包括的所述被隐藏数据对应的入口地址根据第三算法进行计算,并得到第三计算结果;
    对所述第三计算结果进行加密处理,将加密后生成的加密数据发送给所述被加固软件。
  9. 如权利要求8所述的认证方法,其中,所述将所述第二随机数与所述被加固软件的明文软件代码中的入口地址根据第三算法进行计算包括:
    对所述第二随机数与所述被加固软件的明文软件代码中的入口地址进行异或的逻辑运算。
  10. 一种被加固软件的认证装置,应用于移动终端,所述认证装置包括:
    获取模块,设置为在服务器对被加固软件的壳程序验证通过之后,获取所述服务器发送的关键数据,所述关键数据包括:所述被加固软件的明文软件代码中被隐藏的数据和所述被隐藏数据对应的入口地址;
    替换模块,设置为根据所述被隐藏的数据和所述入口地址,替换内存中存储的所述被加固软件的明文软件代码所隐藏的对应数据,然后加载所述明文软件代码。
  11. 如权利要求10所述的认证装置,还包括:
    处理模块,设置为计算得到被加固软件的壳程序的完整性校验值,并对所述壳程序的完整性校验值进行处理,将处理后的处理结果发送给所述服务器,由所述服务器对所述处理结果进行验证,若验证结果为验证通过,则由所述服务器对关键数据加密处理生成加密数据。
  12. 如权利要求11所述的认证装置,其中,所述处理模块包括:
    发送单元,设置为将所述被加固软件的请求信息发送给服务器,由所述服务器根据所述被加固软件的请求信息随机生成第一随机数;
    第一计算单元,设置为根据第一算法计算得到被加固软件的壳程序的完整性校验值;
    第一级联单元,设置为获取所述第一随机数,将所述第一随机数与所述 壳程序的完整性校验值进行第一级联处理,获取第一级联结果;
    第二计算单元,设置为根据第二算法对所述第一级联结果进行计算,获取第一计算结果;
    第二级联单元,设置为将所述第一计算结果与所述被加固软件随机生成的第二随机数进行第二级联处理,得到处理结果,并将处理结果发送给所述服务器,由所述服务器对所述处理结果进行验证,若验证结果为验证通过,则由所述服务器对关键数据加密处理生成加密数据。
  13. 如权利要求12所述的认证装置,其中,所述获取模块包括:
    解密单元,设置为在服务器对被加固软件的壳程序验证通过之后,对所述服务器发送的加密数据进行解密运算;
    第一获取单元,设置为所述解密运算完成后,获取解密数据中包含的所述服务器发送的关键数据。
  14. 如权利要求10所述的认证装置,其中,所述替换模块包括:
    定位单元,设置为根据所述入口地址,定位所述被加固软件的明文软件代码所隐藏的对应数据在所述被加固软件的明文软件代码中的位置;
    替换单元,设置为将所述被隐藏的数据替换内存中存储的所述被加固软件的明文软件代码所隐藏的对应数据,然后加载所述明文软件代码。
  15. 一种被加固软件的认证装置,应用于服务器,所述认证装置包括:
    验证模块,设置为获取被加固软件发送的处理结果,对所述被加固软件的壳程序的完整性校验值进行验证;
    加密模块,设置为若所述验证结果为验证通过,则对关键数据进行加密处理,将加密生成的加密数据发送给所述被加固软件,所述关键数据包括:所述被加固软件的明文软件代码中被隐藏的数据和所述被隐藏数据对应的入口地址。
  16. 如权利要求15所述的认证装置,其中,所述验证模块包括:
    生成单元,设置为获取被加固软件的请求信息,根据所述请求信息随机生成第一随机数,并将所述第一随机数发送给所述被加固软件;
    第三级联单元,设置为根据所述被加固软件的请求信息获取所述被加固软件的ID信息,并根据所述被加固软件的ID信息获取所述被加固软件的壳 程序的完整性校验值,将所述第一随机数与所述壳程序的完整性校验值进行第一级联处理,获取第二级联结果;
    第三计算单元,设置为根据第二算法对所述第二级联结果进行计算,得到第二计算结果;
    识别单元,设置为获取所述被加固软件发送的处理结果,根据所述处理结果识别获取第一计算结果和第二随机数;
    验证单元,设置为对所述第一计算结果与所述第二计算结果进行验证,若所述第一计算结果与所述第二计算结果相同,则验证结果为验证通过。
  17. 如权利要求16所述的认证装置,其中,所述添加模块包括:
    第二获取单元,设置为获取根据所述第二级联结果识别得到的所述第二随机数;
    第四计算单元,设置为所述第二随机数与关键数据中包括的所述被隐藏数据对应的入口地址根据第三算法进行计算,并得到第三计算结果;
    加密单元,设置为对所述第三计算结果进行加密处理,将加密后生成的加密数据发送给所述被加固软件。
  18. 如权利要求17所述的认证装置,其中,所述第四计算单元在根据所述第三算法进行计算包括:
    对所述第二随机数与所述被加固软件的明文软件代码中的入口地址进行异或的逻辑运算。
PCT/CN2016/080384 2015-06-29 2016-04-27 一种被加固软件的认证方法及装置 WO2017000648A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US15/740,836 US20180204004A1 (en) 2015-06-29 2016-04-27 Authentication method and apparatus for reinforced software
EP16817012.4A EP3316160A4 (en) 2015-06-29 2016-04-27 AUTHENTICATION METHOD AND APPARATUS FOR REINFORCED SOFTWARE

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510366915.9 2015-06-29
CN201510366915.9A CN106295257A (zh) 2015-06-29 2015-06-29 一种被加固软件的认证方法及装置

Publications (1)

Publication Number Publication Date
WO2017000648A1 true WO2017000648A1 (zh) 2017-01-05

Family

ID=57607589

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/080384 WO2017000648A1 (zh) 2015-06-29 2016-04-27 一种被加固软件的认证方法及装置

Country Status (4)

Country Link
US (1) US20180204004A1 (zh)
EP (1) EP3316160A4 (zh)
CN (1) CN106295257A (zh)
WO (1) WO2017000648A1 (zh)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107135408B (zh) * 2017-03-31 2020-06-12 武汉斗鱼网络科技有限公司 一种视频流地址的鉴权方法及装置
US10740186B2 (en) * 2017-05-15 2020-08-11 The Boeing Company High data integrity processing system
CN107292134A (zh) * 2017-05-27 2017-10-24 北京思特奇信息技术股份有限公司 一种防止Android应用被反编译的应用加固方法及系统
CN107423586B (zh) * 2017-07-31 2018-11-20 北京深思数盾科技股份有限公司 软件保护方法和软件保护装置
CN109255247B (zh) * 2018-08-14 2020-08-14 阿里巴巴集团控股有限公司 多方安全计算方法及装置、电子设备
CN109960509A (zh) * 2019-03-06 2019-07-02 江苏通付盾信息安全技术有限公司 应用加固的方法、装置、计算设备及计算机存储介质
CN110826030B (zh) * 2019-11-08 2023-09-15 湖南长城医疗科技有限公司 一种自助软件和相关模块授权使用方法
CN111695093A (zh) * 2020-05-29 2020-09-22 平安科技(深圳)有限公司 基于iOS应用的加固方法、电子装置及存储介质
CN112559981B (zh) * 2020-12-11 2021-09-17 北京深思数盾科技股份有限公司 一种软件保护方法及装置
CN114662087B (zh) * 2022-05-20 2022-09-02 广州万协通信息技术有限公司 一种多端验证的安全芯片固件更新方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103049702A (zh) * 2013-01-05 2013-04-17 浪潮电子信息产业股份有限公司 一种基于服务器层的安全加固策略
CN103281187A (zh) * 2013-05-17 2013-09-04 北京网秦天下科技有限公司 安全认证方法、设备和系统
US20140259004A1 (en) * 2013-03-07 2014-09-11 Go Daddy Operating Company, LLC System for trusted application deployment
CN104392181A (zh) * 2014-11-18 2015-03-04 北京奇虎科技有限公司 So文件的保护方法、装置及安卓安装包的加固方法和系统

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002001333A2 (en) * 2000-06-27 2002-01-03 Microsoft Corporation System and method for providing an individualized secure repository
EP1243998B1 (en) * 2001-03-21 2017-04-19 Excalibur IP, LLC A technique for license management and online software license enforcement
CN101506817B (zh) * 2006-08-21 2010-11-10 耶德托公司 控制数字内容的分发
CN100470566C (zh) * 2006-09-08 2009-03-18 盛大计算机(上海)有限公司 服务器端程序保护方法
WO2015192637A1 (zh) * 2014-06-17 2015-12-23 北京奇虎科技有限公司 软件安装包的加固保护方法和装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103049702A (zh) * 2013-01-05 2013-04-17 浪潮电子信息产业股份有限公司 一种基于服务器层的安全加固策略
US20140259004A1 (en) * 2013-03-07 2014-09-11 Go Daddy Operating Company, LLC System for trusted application deployment
CN103281187A (zh) * 2013-05-17 2013-09-04 北京网秦天下科技有限公司 安全认证方法、设备和系统
CN104392181A (zh) * 2014-11-18 2015-03-04 北京奇虎科技有限公司 So文件的保护方法、装置及安卓安装包的加固方法和系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3316160A4 *

Also Published As

Publication number Publication date
EP3316160A1 (en) 2018-05-02
CN106295257A (zh) 2017-01-04
US20180204004A1 (en) 2018-07-19
EP3316160A4 (en) 2019-02-27

Similar Documents

Publication Publication Date Title
WO2017000648A1 (zh) 一种被加固软件的认证方法及装置
US10284372B2 (en) Method and system for secure management of computer applications
TWI557589B (zh) 用於產品驗證和啟動的安全軟體產品識別器
US9489520B2 (en) Decryption and encryption of application data
JP5703391B2 (ja) 耐タンパー性ブート処理のためのシステム及び方法
US8725649B2 (en) System and method to protect computer software from unauthorized use
EP2988238B1 (en) Optimized integrity verification procedures
TWI567580B (zh) 用於防止惡意軟體執行的方法與系統
EP2711859B1 (en) Secured computing system with asynchronous authentication
US9288054B2 (en) Method and apparatus for authenticating and managing application using trusted platform module
JP2017518661A (ja) ハードウェアベースのスタック制御情報の保護
TWI631462B (zh) 確保機板上匯流排交易安全的計算系統和計算設備實現的方法以及非暫時性的電腦可讀取媒體
JP2010517448A (ja) セキュアファイル暗号化
CN110245466B (zh) 软件完整性保护和验证方法、系统、设备及存储介质
US8499357B1 (en) Signing a library file to verify a callback function
US8756433B2 (en) Associating policy with unencrypted digital content
US20230017231A1 (en) Securely executing software based on cryptographically verified instructions
US20230113906A1 (en) An apparatus and method of controlling access to data stored in a non-trusted memory
US20150113281A1 (en) Multiple application platform owner keys in a secure object computer system
US20210334410A1 (en) Updating a security policy
KR101839699B1 (ko) 인증정보가 노출되지 않는 안전한 보안 usb 시스템 및 방법
KR101611104B1 (ko) 인터넷 인증 및 2차 생성 파일 암호화를 이용한 소프트웨어 부정 사용 방지 방법
CN118228210A (zh) 软件的安全认证方法、设备及存储介质
CN115935384A (zh) 数据保护方法、系统、电子设备及计算机可读存储装置
CN114201761A (zh) 在可信计算系统中增强度量代理安全性

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16817012

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 15740836

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2016817012

Country of ref document: EP