Counterfeit APP identification method and device
Through the verification of the certificate chain and signature data, the service server can identify whether the APP on the terminal device is a counterfeit APP, solving the problem of APP identification in the prior art, and improving business security and access guarantees for legitimate users.
Patent Information
- Application Number
- CN201980066172.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-03-07
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2039-03-07
Smart Images

Figure CN112805702B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of security technology, and more particularly to a method and device for identifying counterfeit APPs. Background Art
[0002] With the continuous development of technology, various applications (APPs) continue to emerge. Attackers decompile legitimate APPs in third-party app stores and implant malicious code or advertising information in legitimate APPs, thereby tampering with legitimate APPs into counterfeit APPs. Alternatively, bad actors develop counterfeit APPs and upload them to third-party app stores. Since ordinary users do not have the ability to identify counterfeit APPs, they will download and use these counterfeit APPs, posing a security risk to users.
[0003] In order to prevent counterfeit apps from appearing in third-party app stores, currently, the servers of third-party app stores, such as the servers corresponding to the APP store, identify counterfeit apps. During the identification process, the server identifies the APP based on the APP's Android installation package (APK) file, by extracting the feature vector of the APK file or adding monitoring features to the APK file.
[0004] The above method for identifying counterfeit APPs is applicable to the identification of counterfeit APPs by third-party application stores. However, in some scenarios, the business server only provides services for specific APPs and does not want to be accessed by other APPs. For example, the server corresponding to Huawei share APP only provides services for Huawei share APP. If the server of a third-party application store identifies an APP as a legal APP, but the APP is illegal for the business server, then when the APP is downloaded to the terminal device and accesses the business server, it will cause security risks; or, if an APP is a counterfeit APP, but the server of the third-party application store does not identify the APP as a counterfeit APP, then when the APP is downloaded to the terminal device and accesses the business server, it will also cause security risks. Summary of the invention
[0005] The embodiment of the present application provides a method and device for identifying counterfeit APPs. After a user downloads an APP on a terminal device, when the user uses the APP to interact with a service server, the service server identifies the APP as counterfeit, thereby preventing the service server from providing services for the counterfeit APP and ensuring the security of the service server.
[0006] In the first aspect, the embodiment of the present application provides a method for identifying counterfeit APPs, which can be applied to servers or to chips of servers. The method is described below by taking application to a server as an example, and the method includes: the server sends a first random number to a terminal device; the server receives a certificate chain and signature data sent by the terminal device, the certificate in the certificate chain includes a business certificate of the application APP to be identified, the business certificate carries the package name of the APP to be identified and the first signature certificate fingerprint of the APP to be identified, and the signature data is obtained by the terminal device using the private key corresponding to the business certificate to encrypt the first random number; the server determines whether the business certificate is the business certificate of the APP to be identified based on the certificate chain and the signature data; if the business certificate is the business certificate of the APP to be identified, the server determines whether the APP to be identified is a counterfeit APP based on the package name and the first signature certificate fingerprint. With this method, after the APP to be identified on the terminal device is started, before the business interaction with the business server, the certificate chain and signature data are sent to the business server. After the business server verifies that each certificate in the certificate chain is legal and that the business certificate is the business certificate of the APP to be identified, it compares the signature certificate fingerprint corresponding to the package name in the business certificate with the pre-stored signature certificate fingerprint corresponding to the package name to see if they are the same, thereby identifying whether the APP to be identified is a counterfeit APP, preventing the business server from providing services for counterfeit APPs, and improving business security. In addition, if the business server can only provide services to a certain number of users at the same time, this application can prevent illegal users from accessing the business server through counterfeit APPs, and can protect the business of legitimate users.
[0007] In a feasible design, the server determines whether the business certificate is the business certificate of the APP to be identified based on the certificate chain and signature data, including: the server uses the public key of the business certificate to decrypt the signature data to obtain a random number, hereinafter referred to as the second random number, and then the server compares the first random number with the second random number to see if they are the same. If the first random number is the same as the second random number, the server determines that the business certificate is the business certificate of the APP to be identified; if the first random number is different from the second random number, the server determines that the business certificate is not the business certificate of the APP to be identified. This method is used to achieve the purpose of the server determining whether the business certificate is the business certificate of the APP.
[0008] In a feasible design, the certificates in the certificate chain also include the root certificate of the terminal device and the device authentication authority CA certificate. The trusted certificate level on the server is the root certificate. The server determines whether the certificates in the certificate chain are legal, including: first determining whether the root certificate is legal, then determining whether the device certificate is legal, and finally determining whether the business certificate is legal. During the certificate chain legitimacy verification process, the server determines whether the root certificate in the certificate chain exists in the locally stored trusted root certificate set. If the root certificate in the certificate chain is included in the trusted root certificate set, the server considers the root certificate to be trustworthy. Otherwise, the server considers the root certificate in the certificate chain to be untrustworthy. Afterwards, the server uses the public key of the root certificate to decrypt the device CA certificate to obtain a hash value, and uses the hash algorithm carried by the device CA certificate to perform a hash operation on the content of the device CA certificate to obtain another hash value. If the two hash values are the same, the server considers the device CA certificate to be legal. Otherwise, the server considers the device CA certificate to be illegal. Afterwards, the server uses the public key of the device CA certificate to decrypt the business certificate to obtain a hash value, and uses the hash algorithm carried by the business certificate to perform a hash operation on the content of the business certificate to obtain another hash value. If the two hash values are the same, the server considers the business certificate to be legal. In any case, the server considers the business certificate to be illegal. This solution is adopted to achieve the purpose of performing legitimacy verification on the certificates in the certificate chain when the trusted certificate level on the business server is the root certificate.
[0009] In a feasible design, the certificates in the certificate chain also include the device authorization CA certificate of the terminal device, and the trusted certificate level on the server is the device CA certificate. The server determines whether the certificates in the certificate chain are legal, including: the server determines whether the device CA certificate in the certificate chain exists in the pre-deployed trusted CA certificate set; if the device CA certificate in the certificate chain exists in the CA certificate set, the server uses the public key of the device CA certificate to decrypt the business certificate to obtain a hash value, and uses the hash algorithm carried by the business certificate to perform a hash operation on the content of the business certificate to obtain another hash value. If the two hash values are the same, the server considers the business certificate to be legal; anyway, the server considers the business certificate to be illegal. This solution is used to achieve the purpose of verifying the legality of the certificates in the certificate chain when the trusted certificate level on the business server is the device CA certificate.
[0010] In a feasible design, if the business certificate is the business certificate of the APP to be identified, the server determines whether the APP to be identified is a counterfeit APP based on the package name and the first signature certificate fingerprint, including: if the business certificate is the business certificate of the APP to be identified, the server compares the first signature certificate fingerprint corresponding to the package name in the certificate chain with the second signature certificate fingerprint stored when the genuine APP corresponding to the package name is registered on the server; if the first signature certificate fingerprint and the second signature certificate fingerprint are different, the server determines that the APP to be identified is a counterfeit APP. This solution is used to achieve the purpose of the server identifying the counterfeit APP to be identified based on the package name and signature certificate fingerprint.
[0011] In the second aspect, the embodiment of the present application provides a method for identifying a counterfeit application APP, which can be applied to a terminal device or a chip in a terminal device. The method is described below by taking the application to a terminal device as an example, and the method includes: the terminal device sends a request message to the server for the application APP to be identified to establish a link with the server; the terminal receives a verification message sent by the server to verify the APP to be identified, and the verification message includes a first random number; the terminal device sends a certificate chain and signature data to the server, and the signature data is obtained by encrypting the first random number with the private key corresponding to the APP to be identified; the terminal receives the result of the server verifying whether the APP to be identified is a counterfeit APP based on the certificate chain and signature data. With this method, after the APP to be identified on the terminal device is started, before interacting with the business server, the certificate chain and signature data are sent to the business server. After the business server verifies that each certificate in the certificate chain is legal and the business certificate is the business certificate of the APP to be identified, the signature certificate fingerprint corresponding to the package name in the business certificate is compared with the signature certificate fingerprint corresponding to the package name stored in advance to determine whether they are the same, thereby identifying whether the APP to be identified is a counterfeit APP, avoiding the business server from providing services for the counterfeit APP, and improving business security. In addition, if the business server can only provide services to a certain number of users at the same time, this application can prevent illegal users from accessing the business server through counterfeit APPs, and can protect the business of legitimate users.
[0012] In a feasible design, the certificate chain includes the business certificate of the APP to be identified, and the business certificate carries the package name of the APP to be identified and the first signature certificate fingerprint of the APP to be identified; the terminal receives the result of the server verifying whether the APP to be identified is a counterfeit APP based on the certificate chain and the signature data, including: the terminal device receives the server matching the second visa certificate fingerprint corresponding to the package name of the APP when it is registered with the first signature certificate fingerprint to obtain the counterfeit identification result; if the match is successful, the counterfeit result indicates that the APP is not a counterfeit APP, or, if the match fails, the counterfeit identification result indicates that the APP is a counterfeit APP. By adopting this solution, it is possible to identify whether the APP to be identified is a counterfeit APP, avoid the business server from providing services for the counterfeit APP, and improve business security. In addition, if the business server can only provide services to a certain number of users at the same time, this application can prevent illegal users from accessing the business server through counterfeit APPs, and can protect the business of legitimate users.
[0013] In a feasible design, before the terminal device sends the certificate chain and signature data to the server, it also includes: the terminal device uses the device CA certificate to issue a business certificate for the APP to be identified, and the content of the business certificate includes the package name of the APP to be identified and the first signature certificate fingerprint of the APP to be identified. This solution is used to achieve the purpose of the terminal device using the device CA certificate to issue a business certificate for the APP to be identified.
[0014] In a feasible design, the business certificate is generated and managed by the certificate management service of the terminal device, and the certificate management service is located in the framework layer of the system of the terminal device. This solution is adopted to achieve the purpose of setting up the certificate management service on the terminal device.
[0015] In a feasible design, the business certificate also includes the public key of the APP to be identified, and the public key corresponds to the private key used to encrypt the first random number. This solution is used to achieve the purpose of verifying whether the business certificate is the business certificate of the APP to be identified.
[0016] In a feasible design, the operating system of the terminal device includes a rich execution environment REE operating system and a trusted execution environment TEE operating system. The terminal device uses the device CA certificate to issue a business certificate for the APP to be identified, including: the terminal device sends a business certificate application request message to the trusted application TA running on the TEE operating system through the client application CA running on the REE operating system; the terminal device controls TA to use the device CA certificate to issue a business certificate for the APP to be identified. This solution is used to achieve the purpose of the terminal device controlling TA to use the device CA certificate to issue a business certificate for the APP to be identified.
[0017] In a third aspect, an embodiment of the present application provides a server, including:
[0018] A transmitter, configured to send a first random number to a terminal device;
[0019] A receiver, configured to receive a certificate chain and signature data sent by a terminal device, wherein the certificates in the certificate chain include a business certificate of an application program APP to be identified, wherein the business certificate carries a package name of the APP to be identified and a first signature certificate fingerprint of the APP to be identified, and the signature data is obtained by the terminal device encrypting the first random number using a private key corresponding to the business certificate;
[0020] The processor is used to determine whether the business certificate is the business certificate of the APP to be identified based on the certificate chain and the signature data; if the business certificate is the business certificate of the APP to be identified, then determine whether the APP to be identified is a counterfeit APP based on the package name and the first signature certificate fingerprint.
[0021] In a feasible implementation, the processor is used to determine whether the certificate in the certificate chain is legal. If the certificate in the certificate chain is legal, the signature data is decrypted according to the public key carried by the business certificate in the certificate chain to obtain a second random number; whether the first random number is the same as the second random number is determined. If the first random number and the second random number are the same, it is determined that the business certificate is the business certificate of the APP to be identified; if the first random number and the second random number are not the same, it is determined that the business certificate is not the business certificate of the APP to be identified.
[0022] In a feasible implementation, the certificates in the certificate chain also include the root certificate of the terminal device and the device authentication authority CA certificate. The processor is used to determine whether the root certificate in the certificate chain exists in the pre-deployed trusted root certificate set. If the root certificate in the certificate chain exists in the root certificate set, the public key carried by the root certificate is used to decrypt the device CA certificate contained in the certificate chain to obtain a first hash value. According to the hash algorithm carried by the device CA certificate, a hash operation is performed on the device CA certificate to obtain a second hash value. If the first hash value and the second hash value are the same, it is determined that the device CA certificate is a legal certificate. According to the public key carried by the device CA certificate, the business certificate is decrypted to obtain a third hash value. According to the hash algorithm carried by the business certificate, a hash operation is performed on the business certificate to obtain a fourth hash value. If the third hash value and the fourth hash value are the same, it is determined that the business certificate is a legal certificate.
[0023] In a feasible implementation, the certificates in the certificate chain also include the device authorization CA certificate of the terminal device, and the processor is used to determine whether the device CA certificate in the certificate chain exists in a pre-deployed set of trusted CA certificates. If the device CA certificate in the certificate chain exists in the CA certificate set, the public key carried by the trusted device CA certificate is used to decrypt the business certificate to obtain a third hash value. According to the hash algorithm carried by the business certificate, a hash operation is performed on the business certificate to obtain a fourth hash value. If the third hash value and the fourth hash value are the same, it is determined that the business certificate is a legal certificate.
[0024] In a feasible implementation, the processor is used to determine whether the APP to be identified is a counterfeit APP based on the package name and the first signature certificate fingerprint if the business certificate is the business certificate of the APP to be identified, including: if the business certificate is the business certificate of the APP to be identified, determining the second signature certificate fingerprint based on the package name, storing the correspondence between the package name and the second signature certificate fingerprint, determining whether the first signature certificate fingerprint and the second signature certificate fingerprint are the same, and if the first signature certificate fingerprint and the second signature certificate fingerprint are not the same, determining that the APP to be identified is a counterfeit APP.
[0025] In a feasible implementation manner, the server is a business server or an authentication and authorization server.
[0026] In a fourth aspect, an embodiment of the present application provides a terminal device, including:
[0027] A transmitter, used to send a request message to the server for the application to be identified APP to establish a link with the server;
[0028] A receiver, configured to receive a verification message sent by the server to verify the APP to be identified, wherein the verification message includes a first random number;
[0029] The transmitter is further used to send a certificate chain and signature data to the server, where the signature data is obtained by encrypting the first random number with a private key corresponding to the first APP;
[0030] The receiver is further used to receive the result of the server verifying whether the APP to be identified is a counterfeit APP based on the certificate chain and the signature data.
[0031] In a feasible implementation, the certificate chain includes the business certificate of the APP to be identified, the business certificate carries the package name of the APP to be identified and the first signature certificate fingerprint of the APP to be identified, and the receiver is used to receive the counterfeit identification result obtained by the server matching the second signature certificate fingerprint corresponding to the package name of the APP when it is registered with the first signature certificate fingerprint; if the match is successful, the counterfeit result indicates that the APP is not a counterfeit APP, or, if the match fails, the counterfeit identification result indicates that the APP is a counterfeit APP.
[0032] In a feasible implementation, the terminal device also includes: a processor, used to use the device CA certificate to issue the business certificate for the APP to be identified before the transmitter sends the certificate chain and signature data to the server, and the content of the business certificate includes the package name of the APP to be identified and the first signature certificate fingerprint of the APP to be identified.
[0033] In a feasible implementation, the business certificate is generated and managed by a certificate management service of the terminal device, and the certificate management service is located in a framework layer of a system of the terminal device.
[0034] In a feasible implementation, the business certificate also includes a public key of the APP to be identified, and the public key corresponds to a private key used to encrypt the first random number.
[0035] In a feasible implementation, the operating system of the terminal device includes a rich execution environment (REE) operating system and a trusted execution environment (TEE) operating system, and the terminal device further includes: a processor;
[0036] The transmitter is used to send a service certificate application request message to the trusted application TA running on the TEE operating system through the client application CA running on the REE operating system;
[0037] The processor is used to control the TA to use the device CA certificate to issue the business certificate for the APP to be identified.
[0038] In a fifth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a processor, enables the processor computer to execute the method in the above-mentioned first aspect or various possible implementations of the first aspect.
[0039] In a sixth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a processor, enables the processor to execute the method in the above-mentioned second aspect or various possible implementations of the second aspect.
[0040] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, which, when executed on a processor, enables the processor to execute the method in the above-mentioned first aspect or various possible implementations of the first aspect.
[0041] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, which, when executed on a processor, enables the processor to execute the method in the above-mentioned second aspect or various possible implementations of the second aspect.
[0042] In a ninth aspect, an embodiment of the present application provides a chip, wherein the chip system includes a processor and may also include a memory, for implementing the method in the above-mentioned first aspect or various possible implementation methods of the first aspect.
[0043] In the tenth aspect, an embodiment of the present application provides a chip, which chip system includes a processor and may also include a memory, for implementing the method in the above-mentioned second aspect or various possible implementation methods of the second aspect.
[0044] In the eleventh aspect, an embodiment of the present application further provides a counterfeit APP identification system, comprising a server implemented in the third aspect or any possible manner of the third aspect, and a terminal device implemented in the fourth aspect or any possible manner of the fourth aspect.
[0045] The counterfeit APP identification method, server and terminal device provided in the embodiment of the present application, after the APP to be identified on the terminal device is started, before the business interaction with the business server, the certificate chain and signature data are sent to the business server. After the business server verifies that each certificate in the certificate chain is legal and the business certificate is the business certificate of the APP to be identified, it compares the signature certificate fingerprint corresponding to the package name in the business certificate with the signature certificate fingerprint corresponding to the package name stored in advance to see if they are the same, thereby identifying whether the APP to be identified is a counterfeit APP, avoiding the business server from providing services for the counterfeit APP, and improving business security. In addition, if the business server can only provide services to a certain number of users at the same time, this application can prevent illegal users from accessing the business server through counterfeit APPs, and can protect the business of legitimate users. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1A A schematic diagram of a network architecture applicable to a counterfeit APP identification method provided in an embodiment of the present application;
[0047] Figure 1B A schematic diagram of a network architecture applicable to another counterfeit APP identification method provided in an embodiment of the present application;
[0048] Figure 2This is a flow chart of a method for identifying counterfeit APPs provided in an embodiment of the present application;
[0049] Figure 3 A schematic diagram of an architecture applicable to a counterfeit APP identification method provided in an embodiment of the present application;
[0050] Figure 4 is a flow chart of another counterfeit APP identification method provided in an embodiment of the present application;
[0051] Figure 5 This is a flow chart of certificate issuance used in the counterfeit APP identification method provided in the embodiment of the present application;
[0052] Figure 6 It is a schematic diagram of a counterfeit detection passing scenario in the counterfeit APP identification method provided in an embodiment of the present application;
[0053] Figure 7 A schematic diagram of the structure of a server provided in an embodiment of the present application;
[0054] Figure 8 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application;
[0055] Fig. 9 A schematic diagram of the structure of another server provided in an embodiment of the present application;
[0056] Fig.10 A schematic diagram of the structure of another terminal device provided in an embodiment of the present application;
[0057] Fig.11 A schematic diagram of the architecture of an APP identification system according to an embodiment of the present application. DETAILED DESCRIPTION
[0058] At present, in the process of identifying counterfeit APPs, the APPs are identified by extracting the feature vectors of the APK file of the APP or adding monitoring features to the APK file. This identification method is applicable to the application market to detect counterfeit APPs. However, some business servers only provide services for specific APPs. Taking the APP as a Huawei APP, such as Huawei Share, one of the functions of Huawei Share is to share photos. When traveling, users share photos with relatives and friends through Huawei Share. When sharing photos, the user's terminal device needs to connect to the business server through Huawei Share to share photos with relatives and friends through the business server. The business server refers to the server used to provide services for Huawei Share. During the sharing process, since the business server cannot determine whether the Huawei Share on the terminal device is counterfeit, the counterfeit APP illegally uses the business server, that is, the business server is easily attacked by the counterfeit APP.
[0059] In view of this, an embodiment of the present application provides a method for identifying counterfeit APPs. After a user downloads an APP (hereinafter referred to as the APP to be identified) on a terminal device, when the user uses the APP to interact with a business server, the business server will identify the APP as counterfeit, thereby preventing the business server from providing services for the counterfeit APP and improving security.
[0060] In the embodiment of the present application, the terminal device is a device that can provide voice and / or data connectivity to the user, a handheld device with a wireless connection function, or other processing devices connected to a wireless modem. The terminal device can communicate with one or more core networks via a radio access network (RAN). The terminal device can be a mobile terminal device, such as a mobile phone (or "cellular" phone) and a computer with a mobile terminal device, for example, a portable, pocket-sized, handheld, computer-built-in or vehicle-mounted mobile device, which exchanges language and / or data with the wireless access network. For example, a personal communication service (PCS) phone, a cordless phone, a session initiation protocol (SIP) phone, a wireless local loop (WLL) station, a personal digital assistant (PDA), a handheld device with a wireless communication function, a computing device or other processing devices connected to a wireless modem, a vehicle-mounted device, a wearable device, a terminal in a future 5G network or a terminal device in a future evolved public land mobile network (PLMN), etc., and the embodiment of the present application is not limited to this. The terminal device may also be called a system, a subscriber unit, a subscriber station, a mobile station, a mobile station, a remote station, an access point, a remote terminal, an access terminal, a user terminal, a user agent, a user device, or user equipment.
[0061] The server refers to a business server or an authentication and authorization server. A business server refers to an APP that provides services for one or some genuine APPs. An authentication and authorization server is a server that has a list of trusted certificates deployed. When only business servers are deployed in the network architecture, a list of trusted certificates is deployed on the business server. The genuine APP is registered on the business server, and the business server is responsible for verifying the legitimacy of the certificate chain, determining whether the business certificate is the business certificate of the APP, and identifying counterfeit APPs. When both the business server and the authentication and authorization server are deployed in the network architecture, the genuine APP can be registered on the business server, the business server deploys a list of trusted certificates, and regularly obtains the latest list of trusted certificates from the authentication and authorization server. The business server is responsible for verifying the legitimacy of the certificate chain, determining whether the business certificate is the business certificate of the APP, and identifying counterfeit APPs; or, the genuine APP can be registered on the business server, but the business server does not deploy a list of trusted certificates. The authentication and authorization server is responsible for verifying the legitimacy of the certificate chain, determining whether the business certificate is the business certificate of the APP, and identifying counterfeit APPs; or, the genuine APP is registered on the authentication and authorization server, the authentication and authorization server is responsible for verifying the legitimacy of the certificate chain, determining whether the business certificate is the business certificate of the APP, and identifying counterfeit APPs, and the business server only plays a role in transparent transmission and forwarding. For an example, please refer to Figure 1A and Figure 1B .
[0062] Figure 1A This is a schematic diagram of a network architecture applicable to a counterfeit APP identification method provided in an embodiment of the present application. Figure 1A, the scenario includes a terminal device and a business server, a network connection is established between the terminal device and the business server, the business server is a server for one or some genuine APPs, when the genuine APP is released, the R&D personnel need to register the genuine APP on the business server, and save the corresponding relationship between the signature certificate fingerprint and the package name of the genuine APP; at the same time, the business server stores a set of trusted certificates required for the legitimacy verification of the certificate chain, such as a set of trusted root certificates or a set of trusted device certification authority (CA) certificates. If the genuine APP is downloaded and installed on the terminal device, the terminal device can use the functions provided by the business server using the APP. For the user, he does not know whether the APP downloaded and installed on the terminal device is a counterfeit APP. Therefore, in this embodiment, the terminal device downloads and installs the APP, starts the APP, hereinafter referred to as the APP to be identified, and the business server performs counterfeit identification on the APP to be identified based on the certificate chain, the business certificate of the APP to be identified, etc., wherein the business certificate of the APP to be identified carries the package name and signature certificate fingerprint of the APP to be identified. For example, the APP to be identified is Huawei Share, and the user does not know whether the Huawei Share is an authentic Huawei Share or a counterfeit Huawei Share. Therefore, after the user starts Huawei Share, the service server identifies the APP to be identified. If it is identified as an authentic Huawei Share, the APP to be identified uses the functions provided by the service server, such as remotely sharing photos, files and other data with other users. If the service server identifies it as a counterfeit APP, the APP to be identified is denied to use the functions provided by the service server.
[0063] Typically, Figure 1A In the scenario shown, the terminal device, the service server and the genuine APP are from the same manufacturer. However, the embodiment of the present application is not limited. For example, the terminal device and the service server are from the same manufacturer, and the genuine APP is developed by a third party. The service server provides an interface for the genuine APP developed by the third party to access.
[0064] Figure 1B This is a schematic diagram of a network architecture applicable to another counterfeit APP identification method provided in an embodiment of the present application. Figure 1B, this scenario includes terminal devices, business servers and authentication and authorization servers. A network connection is established between the terminal device and the business server, and a network connection is established between the business server and the authentication and authorization server. The business server is a server for one or some genuine APPs. When the genuine APP is released, the R&D personnel store the corresponding relationship between the signature certificate fingerprint and the package name of the genuine APP on the authentication and authorization server. In addition, the authentication and authorization server stores a set of trusted certificates required for the legitimacy verification of the certificate chain, such as a set of trusted root certificates or a set of trusted device authentication and authorization (CA) certificates. When the APP to be identified is downloaded and installed on the terminal device, the APP to be identified is started, and the certificate chain is sent to the business server, the business server sends the received certificate chain to the authentication and authorization server, and the authentication and authorization server performs counterfeit identification on the APP. Alternatively, the authentication and authorization server can also only store a set of trusted certificates. The R&D personnel store the signature certificate fingerprint, package name, and the correspondence between the signature certificate fingerprint and package name of the genuine APP on the business server. After the business server receives the certificate chain and signature data, it sends the certificate chain and signature data to the authentication and authorization server. The authentication and authorization server verifies the legitimacy of the certificate chain and whether the business certificate in the certificate chain is the APP's certificate. Only when the certificates in the certificate chain are all legal and the business certificate is the APP's business certificate, the business server will identify the APP for counterfeiting based on the package name in the business certificate and the first signature certificate fingerprint.
[0065] It should be noted that in the embodiments of the present application, counterfeit APPs are not limited to APPs implanted with malicious code or advertising information and illegal APPs developed by lawless elements. The counterfeit APPs in the embodiments of the present application are relative. For example, the business server only provides services for APP1, and the legitimate APPs downloaded and installed on the terminal device include APP1, APP2 and APP3. Since APP2 and APP3 are not the APPs corresponding to the business server, for the business server, APP2 and APP3 are also counterfeit APPs.
[0066] Figure 1B In the scenario shown, the terminal device, business server and genuine APP can come from the same manufacturer or different manufacturers.
[0067] In an embodiment of the present application, a trusted root, such as a root certificate and / or a device CA certificate, is injected into the terminal device during generation, wherein the device CA certificate is issued by the root certificate. After the terminal device leaves the factory, the terminal device can use the device CA certificate to issue a business certificate for the APP to be identified. The certificates described in the embodiments of the present application, such as a root certificate, a device CA certificate, a business certificate, etc., each certificate has a key pair, which includes a public key and a private key. The public key is carried in the certificate, and the private key is stored in the secure storage partition of the terminal device.
[0068] Below, based on the above Figure 1A Taking the architecture shown as an example, the counterfeit APP identification method described in the embodiment of the present application is described in detail. For example, see Figure 2 , Figure 2 This is a flowchart of a method for identifying counterfeit APPs provided in an embodiment of the present application. This embodiment describes the method for identifying counterfeit APPs described in the present application from the perspective of interaction between a service server and a terminal device. This embodiment includes:
[0069] 101. The terminal sends a request message to the server for the application program APP to be identified to establish a link with the server.
[0070] Exemplarily, an APP is downloaded and installed on a terminal device, and the APP is started, which is hereinafter referred to as the APP to be identified. The terminal device sends a link establishment request to the business server for the APP.
[0071] 102. The server sends a first random number to the terminal device.
[0072] For example, Figure 1A In the example, the business server is a server for a genuine APP. Users expect that the business server can only provide services for genuine APPs, and do not want to be provided with servers by other APPs. When the genuine APP is released, the R&D personnel register the genuine APP on the business server and save the correspondence between the signature certificate fingerprint and the package name of the genuine APP; at the same time, the business server stores a set of trusted certificates required for legitimacy verification of the certificate chain, such as a set of trusted root certificates or a set of trusted device certification authority (CA) certificates. After receiving the request message, the business server initiates an identity challenge to the terminal device and issues a first random number, which can also be called a challenge; accordingly, the terminal device receives the first random number.
[0073] It should be noted that if an authentication and authorization server is deployed, then in step 101 and step 102, the terminal device sends a link establishment request to the service server, and the service server sends the link establishment request to the authentication and authorization server, triggering the authentication and authorization server to send the first random number.
[0074] 103. The terminal device uses the private key corresponding to the business certificate of the APP to be identified to encrypt the first random number to obtain signature data.
[0075] In this step, the terminal device uses the private key corresponding to the business certificate of the APP to be identified to encrypt the first random number. For example, the terminal device uses secure hash algorithm 256 (secure hash algorithm 256, SHA256), secure hash algorithm 384 (secure hash algorithm 384, SHA384) or secure hash algorithm 512 (secure hashalgorithm 512, SHA512) to encrypt the first random number to obtain signature data.
[0076] 104. The terminal device sends the signature data and the certificate chain to the server.
[0077] Among them, the certificate chain carries the business certificate of the APP to be identified, and the business certificate carries the package name of the APP to be identified and the first signature certificate fingerprint of the APP to be identified.
[0078] In this step, the terminal device sends the signature data and the certificate chain to the server; correspondingly, the server receives the signature data and the certificate chain.
[0079] 105. The server determines whether the business certificate is the business certificate of the APP to be identified based on the certificate chain and the signature data.
[0080] Take the server as the above Figure 1A Taking the business server in as an example, this step includes two stages: in the first stage, the business server verifies the certificates in the certificate chain according to the pre-stored trusted certificates to determine whether each certificate in the certificate chain is legal; if the business server determines that each certificate in the certificate chain is legal, it enters the second stage: the business server uses the public key carried by the business certificate in the certificate chain to decrypt the signature data to determine whether the business certificate is the business certificate of the APP to be identified. If the business certificate is the business certificate of the APP to be identified, execute step 106; if the business certificate is not the business certificate of the APP to be identified, execute step 108.
[0081] Exemplarily, in the first stage, taking the root certificate as an example, the certificate chain includes the root certificate, the device CA certificate and the business certificate. Since the certificates are issued one level at a time, for example, the device CA certificate of the terminal device is issued using the root certificate of the terminal device, and the business certificate of the APP to be identified is issued by the terminal device using the device CA certificate. Therefore, when the business server determines whether each certificate in the certificate chain is legal, it first determines whether the root certificate is legal, then determines whether the device certificate is legal, and finally determines whether the business certificate is legal. During the certificate chain legitimacy verification process, the business server determines whether the root certificate in the certificate chain exists in the locally stored trusted root certificate set. If the root certificate in the certificate chain is included in the trusted root certificate set, the business server considers the root certificate to be trustworthy. Otherwise, the business server considers the root certificate in the certificate chain to be untrustworthy. Afterwards, the business server uses the public key of the root certificate to decrypt the device CA certificate to obtain a hash value, and uses the hash algorithm carried by the device CA certificate to perform a hash operation on the content of the device CA certificate to obtain another hash value. If the two hash values are the same, the business server considers the device CA certificate to be legal. Otherwise, the business server considers the device CA certificate to be illegal. Afterwards, the business server uses the public key of the device CA certificate to decrypt the business certificate to obtain a hash value, and uses the hash algorithm carried by the business certificate to perform a hash operation on the content of the business certificate to obtain another hash value. If the two hash values are the same, the business server considers the business certificate to be legal. In any case, the business server considers the business certificate to be illegal.
[0082] In the second stage, when the business server determines whether the business certificate is the business certificate of the APP to be identified, it uses the public key of the business certificate to decrypt the signature data to obtain a random number, hereinafter referred to as the second random number. Then, the business server compares the first random number and the second random number to see if they are the same. If the first random number is the same as the second random number, the business server determines that the business certificate is the business certificate of the APP to be identified; if the first random number is different from the second random number, the business server determines that the business certificate is not the business certificate of the APP to be identified.
[0083] 106. The business server determines whether the APP to be identified is a counterfeit APP to be identified according to the package name and the first signature certificate fingerprint.
[0084] According to the above step 102, it can be known that a genuine APP needs to be registered with the business server before being released, so that the business server stores the corresponding relationship between the package name of the genuine APP and the signature certificate fingerprint. Therefore, in this step, the business server compares the first signature certificate fingerprint corresponding to the package name in the certificate chain with the second signature certificate fingerprint stored when the genuine APP corresponding to the package name is registered on the server, so as to determine whether the APP to be identified is a counterfeit APP. If the APP to be identified is not a counterfeit APP, execute step 107; if the APP to be identified is a counterfeit APP, execute step 108.
[0085] 107. The business server sends an identification result to the terminal device, where the identification result is used to indicate that the APP to be identified is a genuine APP, and performs business interaction with the terminal device.
[0086] 108. The business server sends an identification result to the terminal device, where the identification result is used to indicate that the APP to be identified is a counterfeit APP, and refuses to perform business interaction with the terminal device for the APP.
[0087] It should be noted that in the embodiments of the present application, counterfeit APPs are relative to the business server, and counterfeit APPs include conventional counterfeit APPs and some genuine APPs. For example, there are three APPs: APP1, APP2 and APP3, among which APP1 and APP2 are conventional counterfeit APPs, and conventional counterfeit APPs refer to all APPs other than genuine APPs, including counterfeit APPs that can be detected by the server of the third-party application store and APPs that cannot be detected by the server of the third-party application product but are actually counterfeit APPs; APP3 is a genuine APP, but it is not registered on the business server, so for the business server, APP3 is also a counterfeit APP.
[0088] The counterfeit APP identification method provided in the embodiment of the present application is that after the APP to be identified on the terminal device is started, before the business interaction with the business server, the certificate chain and signature data are sent to the business server. After the business server verifies that each certificate in the certificate chain is legal and the business certificate is the business certificate of the APP to be identified, the signature certificate fingerprint corresponding to the package name in the business certificate is compared with the signature certificate fingerprint corresponding to the package name stored in advance to see if they are the same, thereby identifying whether the APP to be identified is a counterfeit APP, avoiding the business server from providing services for the counterfeit APP, and improving business security. In addition, if the business server can only provide services to a certain number of users at the same time, this application can prevent illegal users from accessing the business server through counterfeit APPs, and can protect the business of legitimate users.
[0089] In the embodiment of the present application, the terminal device can be a terminal device of any operating system, such as a terminal device of Apple operating system, a terminal device of Android operating system, etc. After the APP to be identified is installed on the terminal device of any operating system, the terminal device uses the device CA certificate stored on the terminal device to issue a business certificate for the APP to be identified. Below, taking the terminal device as a terminal device of Android operating system as an example, the above-mentioned counterfeit APP identification method is described in detail.
[0090] Figure 3 This is a schematic diagram of an architecture applicable to a counterfeit APP identification method provided in an embodiment of the present application. Figure 3 In this embodiment, the terminal device is called the terminal side, the business server and the authentication and authorization server are deployed on the cloud side, and the operating system of the terminal device includes a trusted execution environment (TEE) and a rich execution environment (REE). TEE is responsible for processing transactions that require higher security protection, such as key storage, encryption and decryption, fingerprint recognition, etc. REE is a common operating system, such as Android system, iOS system, etc. There is a client application (CA) in REE that provides certificate services for APP, and there is a trusted application (TA) corresponding to CA in TEE. Among them, APP includes but is not limited to the APP to be identified. In the embodiment of the present application, REE and TEE respectively include the application layer, framework layer, kernel layer and hardware layer from top to bottom. The REE of the terminal device can provide certificate management services, which are located in the framework (Android framework) layer of REE, and are used to provide key and certificate management related functions for the APP to be identified. In order to meet the business needs of TEE hardware-protected keys and implement key trusted authentication (key attestation), the certificate management service can at least achieve the following three functions: 1) Before the terminal device leaves the factory, the production line certificate, that is, the root certificate and the device CA certificate, are injected into the terminal device using the certificate management service; 2) Support the generation of business certificates, that is, the terminal device uses the device CA certificate to issue a business certificate for the APP to be identified; 3) Support trusted authentication based on business keys, that is, when the business server initiates an identity challenge, the terminal device uses the certificate management service and uses the private key corresponding to the business certificate to encrypt the first random number sent by the business server to obtain the signature data.
[0091] Regarding the above function 1), during the process of manufacturing terminal devices, the manufacturer pre-sets and stores the root certificate and device CA certificate in the secure storage partition of the terminal device, such as the replay protect memory block (RPMB). The data in the RPMB cannot be modified. Even if the user restores the terminal device to factory settings, the data in the RPMB cannot be deleted.
[0092] Regarding the above function 2), after the APP to be identified is downloaded and installed on the terminal device, when the user clicks to start the APP to be identified, the APP to be identified applies for a business certificate from the CA. The CA obtains the package name of the APP to be identified and the first signature certificate fingerprint of the APP to be identified through the Android system, and then sends a certificate application request to the TA to apply for a business certificate for the APP to be identified. After receiving the application request, the TA uses the device CA certificate to issue a business certificate for the APP to be identified, and records the package name and the first signature certificate fingerprint of the APP to be identified in the business certificate. After the business certificate is generated, it is kept in a secure storage partition of the terminal device, such as a secure file system (SFS). The data in the SFS can be deleted when the APP to be identified is uninstalled or the terminal device is restored to factory values.
[0093] For the above function 3), after the APP to be identified is started, the terminal device initiates a request to establish the APP to be identified to the service server, and the service server initiates an identity authentication challenge, so that the service server performs counterfeit identification on the APP to be identified. For example, see Figure 4 , Figure 4 This is a flowchart of another method for identifying counterfeit APPs provided in an embodiment of the present application. Figure 4 In this embodiment, the APP to be identified and the certificate management service are loaded on the terminal device, the business server deploys a set of trusted root certificates, and the business server periodically obtains the certificate revocation list from the authentication and authorization server to update the locally deployed trusted certificates. This embodiment includes:
[0094] 201. The business server obtains the root certificate of the terminal device.
[0095] In this step, the service server obtains the root certificate of the terminal device offline, or the service server interacts with the authentication and authorization server to obtain the root certificate of the terminal device.
[0096] 202. The business server sends a certificate revocation list request to the authentication authority server.
[0097] 203. The authentication and authorization server sends a response message to the business server, where the response message carries a certificate revocation list.
[0098] In the above steps 202 and 203, the business server periodically sends a certificate revocation list request to the authentication and authorization server to request the latest certificate revocation list (CRL) to update the locally deployed trusted certificate.
[0099] 204. The terminal device sends a link establishment request to the business server for the APP to be identified.
[0100] In this step, when the APP to be identified is started, the terminal device initiates a link establishment request to the service server for the APP to be identified.
[0101] 205. The service server initiates identity authentication to the terminal device, and the identity authentication carries a first random number.
[0102] In this step, the business server sends an identity authentication to the terminal device for the APP to be identified.
[0103] 206. The terminal device sends a certificate application request to the TA through the CA to apply for a business certificate for the APP to be identified.
[0104] 207. The terminal device uses the device CA certificate to issue a business certificate for the APP to be identified.
[0105] In the embodiment of the present application, the device CA certificate is issued using the root certificate, and the service certificate is issued using the device CA certificate. Figure 5 , Figure 5 This is a flow chart of certificate issuance used in the counterfeit APP identification method provided in the embodiment of the present application.
[0106] Please refer to Figure 5 In this embodiment, the root certificate and the device CA certificate are also referred to as the terminal device production line pre-set certificates. These two certificates are injected into the terminal device before the terminal device leaves the factory and will not be deleted because the terminal device is restored to factory values or the APP to be identified is uninstalled. After the terminal device leaves the factory, the user loads the APP to be identified on the terminal device. When the APP to be identified is started, the terminal device uses the device CA certificate to issue a business certificate for the APP to be identified. The following table lists the details of the business certificate.
[0107]
[0108] It should be noted that the above table is only an example, and the content of the service certificate in the embodiment of the present application is not limited to this.
[0109] 208. The terminal device encrypts the first random number using the private key corresponding to the business certificate to obtain signature data.
[0110] 209. The terminal device sends the signature data and certificate chain to the CA through the TA.
[0111] 210. The terminal device sends the signature data and the certificate chain to the service server.
[0112] The certificate chain includes the root certificate, device CA certificate and business certificate.
[0113] 211. The business server determines whether the certificates in the certificate chain are legal. If all the certificates in the certificate chain are legal, execute step 212. If a certificate at a certain level in the certificate chain is illegal, execute step 215.
[0114] Because certificates are issued one level at a time, during the certificate chain verification process, the business server determines in turn whether the root certificate, device CA certificate, and business certificate are legal.
[0115] First, the business server determines whether the root certificate in the certificate chain exists in the pre-deployed trusted root certificate set. If the root certificate in the certificate chain exists in the pre-deployed trusted root certificate set, it means that the root certificate in the certificate chain is a root certificate that the business server can trust and is a legal certificate. If the root certificate in the certificate chain does not exist in the pre-deployed trusted root certificate set, it means that the root certificate in the certificate chain is not a root certificate that the business server can trust and is an illegal certificate.
[0116] Secondly, if the root certificate in the certificate chain exists in the root certificate set, the business server uses the public key of the root certificate to decrypt the device CA certificate contained in the certificate chain to obtain a first hash value, and performs a hash operation on the device CA certificate according to the hash algorithm carried by the device CA certificate to obtain a second hash value. The business server determines whether the first hash value and the second hash value are the same. If the first hash value and the second hash value are the same, it means that the device CA certificate is a legal device CA certificate. If the first hash value and the second hash value are not the same, it means that the device CA certificate is an illegal device CA certificate.
[0117] Finally, if the device CA certificate is a legitimate device CA certificate, the business server decrypts the business certificate according to the public key carried by the device CA certificate to obtain the third hash value, and performs a hash operation on the business certificate according to the hash algorithm carried by the business certificate to obtain the fourth hash value. The business server determines whether the third hash value and the fourth hash value are the same. If the third hash value and the fourth hash value are the same, it means that the business certificate is legitimate. If the third hash value and the fourth hash value are different, it means that the business certificate is illegal.
[0118] It should be noted that the above-mentioned hash operation on the certificate refers to hash operation on one or more attribute information in the certificate.
[0119] 212. The business server determines whether the business certificate is the business certificate of the APP to be identified. If the business certificate is the business certificate of the APP to be identified, execute step 213; if the business certificate is not the business certificate of the APP to be identified, execute step 215.
[0120] If the certificate chain is legal, then in this step, the business server decrypts the signature data according to the public key carried by the business certificate in the certificate chain to obtain a second random number. Then, the business server determines whether the second random number is the same as the first random number sent in step 205. If the first random number and the second random number are the same, the business server determines that the business certificate is the business certificate of the APP to be identified; if the first random number and the second random number are different, the business server determines that the business certificate is not the business certificate of the APP to be identified.
[0121] 213. The business server determines whether the APP to be identified is a counterfeit APP based on the package name and the fingerprint of the first signature certificate. If the APP to be identified is not a counterfeit APP, execute step 214; if the APP to be identified is a counterfeit APP, execute step 215.
[0122] In the embodiment of the present application, each APP has a package name and a signature certificate fingerprint. Taking Android APP as an example, after the R&D personnel develop the APP, when they package and generate the Android installation package (APK), they will sign the apk file. The signature mechanism is used to ensure the legitimacy of the apk file and the uniqueness of the app, so as to facilitate the subsequent app upgrades, etc. When the APP is released, the R&D personnel register on the business server and store the corresponding relationship between the package name and the signature certificate fingerprint on the business server.
[0123] If in step 209, the business server determines that the business certificate is a business certificate issued by the terminal device for the APP to be identified, then in this step, the business server determines the second signature certificate fingerprint according to the package name of the APP to be identified, and determines whether the first signature certificate fingerprint and the second signature certificate fingerprint are the same; if the first signature certificate fingerprint and the second signature certificate fingerprint are not the same, the business server determines that the APP to be identified is a counterfeit APP; if the first signature certificate fingerprint and the second signature certificate fingerprint are the same, the business server determines that the APP to be identified is a genuine APP.
[0124] 214. The business server sends an identification result to the terminal device, where the identification result is used to indicate that the APP to be identified is a genuine APP, and performs business interaction with the terminal device for the APP to be identified.
[0125] 215. The service server sends an identification result to the terminal device, where the identification result is used to indicate that the APP to be identified is a counterfeit APP, and refuses to perform service interaction with the terminal device for the APP to be identified.
[0126] It should be noted that the above Figure 4 In the embodiment, the above-mentioned counterfeit APP identification method is described in detail by taking the example of deploying a trusted root certificate set on the business server and the certificates in the certificate chain including the root certificate, the device CA certificate and the business certificate. However, the embodiment of the present application is not limited. In other feasible implementation methods, the device CA certificate can also be deployed on the business server. At this time, the certificates in the certificate chain only include the device CA certificate and the business certificate.
[0127] Below, we take the example of a business server providing data forwarding services to users and the genuine APP corresponding to the business server sharing data with other users through the business server to explain the above counterfeit APP identification method in detail. Figure 6 .
[0128] Figure 6 1 is a schematic diagram of a counterfeit detection scenario in a counterfeit APP identification method provided in an embodiment of the present application. This embodiment includes:
[0129] 301. Register the genuine APP on the business server.
[0130] In this step, when the genuine APP is released, the R&D personnel register the genuine APP on the business server, and the business server stores the package name, signature certificate fingerprint, and the corresponding relationship between the package name and signature certificate fingerprint of the genuine APP. For example, the package name of the genuine APP is com.xxx.app1, and the signature certificate fingerprint is 111111. Among them, the package name is located in a file in the installation package, such as the androidManifest.xml file; the signature certificate fingerprint is stored in the signature certificate of the installation package. Although most APPs will delete the installation package after being installed on the terminal device, the terminal device can obtain the package name and signature certificate from the REE operating system before the APP is uninstalled.
[0131] 302. Install the APP to be identified on the terminal device.
[0132] The package name of the APP to be identified is the same as that of the genuine APP, but the terminal device does not know whether the APP to be identified is a genuine APP or a counterfeit APP. When the APP to be identified is a genuine APP, the terminal device determines that the signature certificate fingerprint of the APP to be identified is 111111; when the APP to be identified is a counterfeit APP, the developer cannot obtain the signature certificate fingerprint of the genuine APP, so the signature certificate fingerprint of the APP to be identified is different from the signature certificate fingerprint of the genuine APP, for example, 222222.
[0133] 303. The terminal device uses the device CA certificate to issue a business certificate for the APP to be identified.
[0134] The business certificate includes the package name of the APP to be identified and the fingerprint of the first signature certificate.
[0135] 304. The terminal device initiates a link establishment request to the business server for the APP to be identified.
[0136] 305. The service server sends a first random number to the terminal device.
[0137] 306. The terminal device sends the signature data and the certificate chain to the service server.
[0138] In this step, the terminal device uses the private key of the service certificate to encrypt the first random number, obtains the signature data, and then sends the certificate chain and the signature data to the service server.
[0139] 307. The business server verifies whether the certificates in the certificate chain are legal. If the certificate chain is legal, it determines whether the business certificate is the business certificate of the APP. If the business certificate is the business certificate of the APP to be identified, it determines whether the APP is a counterfeit APP.
[0140] In this step, the business server first verifies whether each certificate in the certificate chain is legal through the certificate chain, and whether the business certificate is the business certificate of the APP itself. If each business certificate in the certificate chain is legal, and the business certificate is the business certificate of the APP itself, the business server obtains the package name and the first signature certificate fingerprint of the APP to be identified from the business certificate, determines the second signature certificate fingerprint according to the package name, and finally verifies whether the first signature certificate fingerprint is the same as the second signature certificate fingerprint pre-stored on the business server. If they are the same, it is determined that the APP to be identified is a genuine APP. If they are not the same, the APP to be identified is considered to be a counterfeit APP. For example, if in this step, the second signature certificate fingerprint is 111111, and the first signature certificate fingerprint is the same as the first signature certificate fingerprint obtained by the terminal device from the installation package of the APP to be identified, the business server considers the APP to be identified to be a genuine APP. For another example, if in this step, the second signature certificate fingerprint is 222222, and the first signature certificate fingerprint is not the same as the first signature certificate fingerprint obtained by the terminal device from the installation package of the APP to be identified, the business server considers the APP to be identified to be a counterfeit APP.
[0141] Figure 7 A schematic diagram of the structure of a server provided in an embodiment of the present application. The server 100 may include:
[0142] A transmitter 11, configured to send a first random number to a terminal device;
[0143] The receiver 12 is used to receive the certificate chain and signature data sent by the terminal device, where the certificates in the certificate chain include the business certificate of the application APP to be identified, the business certificate carries the package name of the APP to be identified and the first signature certificate fingerprint of the APP to be identified, and the signature data is obtained by the terminal device encrypting the first random number using the private key corresponding to the business certificate;
[0144] Processor 13 is used to determine whether the business certificate is the business certificate of the APP to be identified based on the certificate chain and the signature data; if the business certificate is the business certificate of the APP to be identified, then determine whether the APP to be identified is a counterfeit APP based on the package name and the first signature certificate fingerprint.
[0145] In a feasible implementation, the processor 13 is used to determine whether the certificate in the certificate chain is legal. If the certificate in the certificate chain is legal, the signature data is decrypted according to the public key carried by the business certificate in the certificate chain to obtain a second random number; whether the first random number is the same as the second random number is determined. If the first random number and the second random number are the same, it is determined that the business certificate is the business certificate of the APP to be identified; if the first random number and the second random number are not the same, it is determined that the business certificate is not the business certificate of the APP to be identified.
[0146] In a feasible implementation, the certificates in the certificate chain also include the root certificate of the terminal device and the device authentication authority CA certificate. The processor 13 is used to determine whether the root certificate in the certificate chain exists in the pre-deployed trusted root certificate set. If the root certificate in the certificate chain exists in the root certificate set, the public key carried by the root certificate is used to decrypt the device CA certificate contained in the certificate chain to obtain a first hash value. According to the hash algorithm carried by the device CA certificate, a hash operation is performed on the device CA certificate to obtain a second hash value. If the first hash value and the second hash value are the same, it is determined that the device CA certificate is a legal certificate. According to the public key carried by the device CA certificate, the business certificate is decrypted to obtain a third hash value. According to the hash algorithm carried by the business certificate, a hash operation is performed on the business certificate to obtain a fourth hash value. If the third hash value and the fourth hash value are the same, it is determined that the business certificate is a legal certificate.
[0147] In a feasible implementation, the certificates in the certificate chain also include the device authorization CA certificate of the terminal device, and the processor 13 is used to determine whether the device CA certificate in the certificate chain exists in the pre-deployed trusted CA certificate set. If the device CA certificate in the certificate chain exists in the CA certificate set, the public key carried by the trusted device CA certificate is used to decrypt the business certificate to obtain a third hash value. According to the hash algorithm carried by the business certificate, the business certificate is hashed to obtain a fourth hash value. If the third hash value and the fourth hash value are the same, it is determined that the business certificate is a legal certificate.
[0148] In a feasible implementation, the processor 13 is used to determine whether the APP to be identified is a counterfeit APP based on the package name and the first signature certificate fingerprint if the business certificate is the business certificate of the APP to be identified, including: if the business certificate is the business certificate of the APP to be identified, determining the second signature certificate fingerprint based on the package name, storing the correspondence between the package name and the second signature certificate fingerprint, determining whether the first signature certificate fingerprint and the second signature certificate fingerprint are the same, and if the first signature certificate fingerprint and the second signature certificate fingerprint are not the same, determining that the APP to be identified is a counterfeit APP.
[0149] In a feasible implementation manner, the server is a business server or an authentication and authorization server.
[0150] The implementation principle and technical effects of the server provided in the embodiment of the present application can be found in the above-mentioned method embodiment, which will not be repeated here.
[0151] Figure 8 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. The terminal device 200 may include:
[0152] The transmitter 21 is used to send a request message for the application to be identified APP to establish a link with the server;
[0153] A receiver 22, configured to receive a verification message sent by the server to verify the APP to be identified, wherein the verification message includes a first random number;
[0154] The transmitter 21 is further used to send a certificate chain and signature data to the server, where the signature data is obtained by encrypting the first random number with a private key corresponding to the APP to be identified;
[0155] The receiver 22 is further configured to receive a result of the server verifying whether the APP to be identified is a counterfeit APP based on the certificate chain and the signature data.
[0156] In a feasible implementation, the certificate chain includes the business certificate of the APP to be identified, and the business certificate carries the package name of the APP to be identified and the first signature certificate fingerprint of the APP to be identified. The receiver 22 is used to receive the counterfeit identification result obtained by the server matching the second signature certificate fingerprint corresponding to the package name of the APP when it is registered with the first signature certificate fingerprint; if the match is successful, the counterfeit result indicates that the APP is not a counterfeit APP, or if the match fails, the counterfeit identification result indicates that the APP is a counterfeit APP.
[0157] Please refer to Figure 8 In a feasible implementation, the terminal device 200 also includes: a processor 23, which is used to use the device CA certificate to issue the business certificate for the APP to be identified before the transmitter 21 sends the certificate chain and signature data to the server, and the content of the business certificate includes the package name of the APP to be identified and the first signature certificate fingerprint of the APP to be identified.
[0158] In a feasible implementation, the business certificate is generated and managed by a certificate management service of the terminal device, and the certificate management service is located in a framework layer of a system of the terminal device.
[0159] In a feasible implementation, the business certificate also includes a public key of the APP to be identified, and the public key corresponds to a private key used to encrypt the first random number.
[0160] In a feasible implementation, the operating system of the terminal device includes a rich execution environment REE operating system and a trusted execution environment TEE operating system, and the transmitter 21 is used to send a business certificate application request message to a trusted application TA running on the TEE operating system through a client application CA running on the REE operating system;
[0161] The processor 23 is used to control the TA to use the device CA certificate to issue the service certificate for the APP to be identified.
[0162] Fig. 9 A schematic diagram of another server structure provided in an embodiment of the present application. The server 300 may include: a processor 31, a transceiver 32 and a memory 33; the transceiver 32 is used to send and receive data; the memory 33 is used to store instructions; the processor 31 is used to indicate the instructions in the memory 33, so that the server executes the counterfeit APP identification method applied to the server as above.
[0163] Fig.10A schematic diagram of the structure of another terminal device provided in an embodiment of the present application. The terminal device 400 may include: a processor 41, a transceiver 42 and a memory 43; the transceiver 42 is used to send and receive data; the memory 43 is used to store instructions; the processor 41 is used to indicate the instructions in the memory 43, so that the terminal device executes the counterfeit APP identification method applied to the terminal device as above.
[0164] Fig.11 This is a schematic diagram of the architecture of an APP identification system provided in an embodiment of the present application. Fig. 9 The counterfeit APP identification system 1000 provided in this embodiment includes: Figure 7 The server 100, and at least one Figure 8 The terminal device 200.
[0165] In addition, based on the above-mentioned counterfeit APP identification method, the embodiment of the present application also provides:
[0166] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the counterfeit APP identification method applied to a server as described above is executed.
[0167] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the counterfeit APP identification method applied to a terminal device as described above is executed.
[0168] A chip stores a computer program on the chip, and when the computer program is executed by a processor, the counterfeit APP identification method applied to a server as described above is executed.
[0169] A chip stores a computer program on the chip, and when the computer program is executed by a processor, the counterfeit APP identification method applied to a terminal device as described above is executed.
[0170] In the embodiments provided by the present application above, the method provided by the embodiment of the present application is mainly introduced from the perspective of the interaction between the terminal device and the server. It is understandable that in order to realize the various functions in the method provided by the embodiment of the present application above, the terminal device and the server include hardware structures and / or software modules corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0171] The embodiment of the present application can divide the functional modules of the terminal device and the server according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0172] The term "plurality" in this article refers to two or more than two. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the previous and next associated objects are in an "or" relationship; in a formula, the character " / " indicates that the previous and next associated objects are in a "division" relationship.
[0173] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
[0174] It can be understood that in the embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0175] It is understood that in the embodiments of the present application, the memory may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or a volatile memory (volatile memory), such as a random-access memory (RAM). The memory is 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 in the embodiments of the present application may also be a circuit or any other device that can implement a storage function, for storing program instructions and / or data.
[0176] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0177] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0178] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0179] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0180] In the method provided in the embodiment of the present application, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a server, a terminal or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, an SSD), etc.
[0181] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for identifying counterfeit APPs, characterized in that: include: The server sends a first random number to the terminal device; The server receives a certificate chain and signature data sent by a terminal device, where the certificates in the certificate chain include a business certificate of the APP to be identified, the business certificate carries the package name of the APP to be identified and the first signature certificate fingerprint of the APP to be identified, and the signature data is obtained by the terminal device encrypting the first random number using a private key corresponding to the business certificate; The server determines, according to the certificate chain and the signature data, whether the business certificate is the business certificate of the APP to be identified; If the business certificate is the business certificate of the APP to be identified, the server determines whether the APP to be identified is a counterfeit APP according to the package name and the fingerprint of the first signature certificate.
2. The method according to claim 1, characterized in that The server determines, according to the certificate chain and the signature data, whether the business certificate is the business certificate of the APP to be identified, including: The server determines whether the certificates in the certificate chain are legal; If the certificate in the certificate chain is legal, the server decrypts the signature data according to the public key carried by the business certificate in the certificate chain to obtain a second random number; The server determines whether the first random number is the same as the second random number; If the first random number is the same as the second random number, the server determines that the business certificate is the business certificate of the APP to be identified; If the first random number is different from the second random number, the server determines that the business certificate is not the business certificate of the APP to be identified.
3. The method according to claim 1 or 2, characterized in that: The certificates in the certificate chain also include the root certificate of the terminal device and the device authentication authority CA certificate. The server determines whether the certificates in the certificate chain are legal, including: The server determines whether the root certificate in the certificate chain exists in a pre-deployed set of trusted root certificates; If the root certificate in the certificate chain exists in the root certificate set, the server uses the public key carried by the root certificate to decrypt the device authentication authority CA certificate included in the certificate chain to obtain a first hash value; The server performs a hash operation on the device authentication authority CA certificate according to the hash algorithm carried by the device authentication authority CA certificate to obtain a second hash value; If the first hash value is the same as the second hash value, the server determines that the device authentication authority CA certificate is a legal certificate, and decrypts the business certificate according to the public key carried by the device authentication authority CA certificate to obtain a third hash value; The server performs a hash operation on the business certificate according to the hash algorithm carried by the business certificate to obtain a fourth hash value; If the third hash value and the fourth hash value are the same, the server determines that the business certificate is a legal certificate.
4. The method according to claim 1 or 2, characterized in that: The certificates in the certificate chain also include a device authorization CA certificate of the terminal device, and the server determines whether the certificates in the certificate chain are legal, including: The server determines whether the device CA certificate in the certificate chain exists in a pre-deployed set of trusted CA certificates; If the CA certificate set includes the device CA certificate in the certificate chain, the server uses the public key carried by the device CA certificate to decrypt the service certificate to obtain a third hash value; The server performs a hash operation on the business certificate according to the hash algorithm carried by the business certificate to obtain a fourth hash value; If the third hash value and the fourth hash value are the same, the server determines that the business certificate is a legal certificate.
5. The method according to any one of claims 1 to 2, characterized in that: If the business certificate is the business certificate of the APP to be identified, the server determines whether the APP to be identified is a counterfeit APP according to the package name and the fingerprint of the first signature certificate, including: If the business certificate is the business certificate of the APP to be identified, the server determines the second signature certificate fingerprint according to the package name, and the server stores the corresponding relationship between the package name and the second signature certificate fingerprint; The server determines whether the first signature certificate fingerprint and the second signature certificate fingerprint are the same; If the first signing certificate fingerprint is different from the second signing certificate fingerprint, the server determines that the APP to be identified is a counterfeit APP.
6. A method for identifying counterfeit APPs, characterized in that: The method comprises: The terminal device sends a request message to the server for the APP to be identified to establish a link with the server; The terminal receives a verification message sent by the server to verify the APP to be identified, wherein the verification message includes a first random number; The terminal device sends a certificate chain and signature data to the server, where the signature data is obtained by encrypting the first random number with a private key corresponding to the APP to be identified; The terminal receives a result of the server verifying whether the APP to be identified is a counterfeit APP according to the certificate chain and the signature data.
7. The method according to claim 6, characterized in that The certificate chain includes the business certificate of the APP to be identified, and the business certificate carries the package name of the APP to be identified and the first signature certificate fingerprint of the APP to be identified; The terminal receives the result of the server verifying whether the APP to be identified is a counterfeit APP according to the certificate chain and the signature data, including: The terminal device receives a counterfeit identification result obtained by matching the second visa certificate fingerprint corresponding to the package name of the APP registered by the server with the first signature certificate fingerprint; If the match is successful, the counterfeit identification result indicates that the APP is not a counterfeit APP, or if the match fails, the counterfeit identification result indicates that the APP is a counterfeit APP.
8. The method according to claim 7, characterized in that Before the terminal device sends the certificate chain and the signature data to the server, the method further includes: The terminal device uses the device CA certificate to issue the business certificate for the APP to be identified, and the content of the business certificate includes the package name of the APP to be identified and the first signature certificate fingerprint of the APP to be identified.
9. The method according to claim 8, characterized in that The business certificate is generated and managed by a certificate management service of the terminal device, and the certificate management service is located in the framework layer of the system of the terminal device.
10. The method according to claim 9, characterized in that The business certificate also includes a public key of the APP to be identified, and the public key corresponds to a private key used to encrypt the first random number.
11. The method according to any one of claims 9 to 10, characterized in that: The operating system of the terminal device includes a rich execution environment (REE) operating system and a trusted execution environment (TEE) operating system. The terminal device issues the business certificate for the APP to be identified using the device CA certificate, including: The terminal device sends a service certificate application request message to the trusted application TA running on the TEE operating system through the client application CA running on the REE operating system; The terminal device controls the TA to use the device CA certificate to issue the business certificate for the APP to be identified.
12. A server, characterized in that: include: processors, transceivers, and memory; The transceiver is used to send and receive data; The memory is used to store instructions; The processor is used to instruct the instruction in the memory so that the server executes the counterfeit APP identification method as described in any one of claims 1 to 5.
13. A terminal device, characterized in that: include: processors, transceivers, and memory; The transceiver is used to send and receive data; The memory is used to store instructions; The processor is used to instruct the instruction in the memory so that the terminal device executes the counterfeit APP identification method as described in any one of claims 6 to 11.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the counterfeit APP identification method according to any one of claims 1 to 5 is executed.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the counterfeit APP identification method according to any one of claims 6 to 11 is executed.
16. A chip, characterized in that: A computer program is stored on the chip, and when the computer program is executed by the processor, the counterfeit APP identification method according to any one of claims 1 to 5 is executed.
17. A chip, characterized in that: A computer program is stored on the chip, and when the computer program is executed by the processor, the counterfeit APP identification method according to any one of claims 6 to 11 is executed.
18. A counterfeit APP identification system, characterized in that: It comprises the server as claimed in claim 12 and the terminal device as claimed in claim 13.
