Data processing method and device, terminal and storage medium

By verifying the consistency of the public keys of the first trusted application and the second trusted application and granting access rights, the risk of malicious applications forging identities to access data is solved and data security is improved.

CN118734347APending Publication Date: 2024-10-01GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310332319.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-29
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

In the existing technology, malicious applications can easily forge the application identification of trusted applications, leading to the risk of data leakage of trusted applications and reducing the security of stored data.

Method used

By obtaining the public keys of the first trusted application and the second trusted application, verifying their authenticity, and granting access to the target secure storage area only when the public keys are consistent, access by malicious applications is avoided.

Benefits of technology

It effectively prevents malicious applications from accessing the target secure storage area, improves data security, and ensures the authenticity and credibility of the data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118734347A_ABST
    Figure CN118734347A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device, a terminal and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: in response to a data access request of a first trusted application program, based on an application identifier and an application name of the first trusted application program carried by the data access request, determining a target secure storage area requested to be accessed by the data access request; a first public key is obtained, the first public key is an application signature public key of the first trusted application program, and the application signature public key is used for verifying the authenticity of the trusted application program; the first public key is verified based on a second public key, under the condition that the first public key is consistent with the second public key, the access permission of the target secure storage area is granted to the first trusted application program, and the second public key is an application signature public key stored in the target secure storage area in an associated mode; the second public key is an application signature public key of the second trusted application program. According to the method, the security of the data in the secure storage area can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device, terminal and storage medium. Background Art

[0002] With the development of computer technology, more and more applications are installed on terminals. Applications can store data in the storage space of the terminal. Other applications can also access the data stored in the storage space of the above applications. Therefore, for some applications with high requirements for data security, such as payment applications and password management applications, how to ensure the security of data stored by the above applications is a technical problem that needs to be solved.

[0003] In the related art, terminals usually provide two execution environments: Trusted Execution Environment (TEE) and Rich Execution Environment (REE). The rich execution environment is used to run the main operating system, such as Android and Linux. The trusted execution environment is used to run TEE systems with a higher security level. Applications installed in a trusted execution environment are trusted applications. The terminal can install the above applications in the trusted execution environment. The terminal allocates an independent secure storage area for the trusted application in the storage space based on the application identifier of the trusted application. The trusted application can access the data in the secure storage area through the application identifier. Other trusted applications cannot access the secure storage area, which improves the security of the stored data.

[0004] However, using the above method, a malicious application can easily forge the application identifier of a trusted application and access the secure storage area of ​​the trusted application through the forged application identifier, resulting in the risk of leakage of data stored in the trusted application, thereby reducing the security of the stored data. Summary of the invention

[0005] The embodiments of the present application provide a data processing method, device, terminal and storage medium, which can prevent malicious applications from maliciously accessing a target secure storage area, thereby improving data security. The technical solution is as follows:

[0006] According to one aspect of an embodiment of the present application, a data processing method is provided, the method comprising:

[0007] In response to a data access request of a first trusted application, determining a target secure storage area requested to be accessed by the data access request based on an application identifier and an application name of the first trusted application carried in the data access request, wherein the first trusted application is an application running in a trusted execution environment, and the target secure storage area is used to store data of a second trusted application in the trusted execution environment;

[0008] Obtaining a first public key, where the first public key is the public key of the first trusted application and the public key is used to verify the authenticity of the trusted application;

[0009] The first public key is verified based on the second public key. When the first public key is consistent with the second public key, the first trusted application is granted access to the target secure storage area. The second public key is the public key associated with the target secure storage area, and the second public key is the public key of the second trusted application.

[0010] According to another aspect of an embodiment of the present application, a data processing device is provided, the device comprising:

[0011] a determination module, configured to, in response to a data access request of a first trusted application, determine a target secure storage area requested to be accessed by the data access request based on an application identifier and an application name of the first trusted application carried in the data access request, wherein the first trusted application is an application running in a trusted execution environment, and the target secure storage area is used to store data of a second trusted application in the trusted execution environment;

[0012] A first acquisition module, used to acquire a first public key, where the first public key is the public key of the first trusted application, and the public key is used to verify the authenticity of the trusted application;

[0013] A verification module is used to verify the first public key based on a second public key, and when the first public key is consistent with the second public key, grant the first trusted application access to the target secure storage area, the second public key is the public key associated with the target secure storage area, and the second public key is the public key of the second trusted application.

[0014] According to another aspect of an embodiment of the present application, a terminal is provided, comprising a processor and a memory; the memory stores at least one program code, and the at least one program code is used to be executed by the processor to implement the data processing method as described in the above aspects.

[0015] According to another aspect of an embodiment of the present application, a chip is provided, which includes a programmable logic circuit and / or program instructions. When the chip runs on a terminal, it is used to implement the data processing method described in the above aspects.

[0016] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein the storage medium stores at least one program code, and the at least one program code is used to be executed by a processor to implement the data processing method as described in the above aspects.

[0017] According to another aspect of an embodiment of the present application, a computer program product is provided. The computer program product stores at least one program code, and the at least one program code is used to be executed by a processor to implement the data processing method described in the above aspect.

[0018] An embodiment of the present application provides a data processing solution. When a terminal receives a data access request from a first trusted application to a target secure storage area, the terminal can obtain the public key of the first trusted application and the public key of the second trusted application, that is, the first public key and the second public key. Since public keys cannot be forged, when the first public key and the second public key are consistent, it indicates that the first trusted application and the second trusted application are the same application, which is trustworthy and not disguised by a malicious application. Therefore, the terminal grants access rights to the target secure storage area to the first trusted application, thereby preventing malicious applications from maliciously accessing the target secure storage area and improving data security. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0020] Figure 1 It is a schematic diagram of an implementation environment provided by an embodiment of the present application;

[0021] Figure 2 is a flow chart of a data processing method provided in an embodiment of the present application;

[0022] Figure 3 is a flow chart of another data processing method provided in an embodiment of the present application;

[0023] Figure 4 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;

[0024] Figure 5is a structural schematic diagram of another data processing device provided in an embodiment of the present application;

[0025] Figure 6 It is a structural block diagram of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0027] In this article, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of the associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0028] It should be noted that the information (including but not limited to wireless audio device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the trusted applications and the program codes of the trusted applications involved in this application are all obtained with full authorization.

[0029] Figure 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application. Figure 1 , the implementation environment includes a terminal 101 and a server 102.

[0030] Optionally, the terminal 101 can be a mobile phone, a desktop computer, a laptop computer, a tablet computer, a smart watch and other types of terminals. The terminal 101 provides two execution environments: a trusted execution environment (TEE) and a rich execution environment (REE). The rich execution environment is used to run the main operating system of the terminal 101, such as Android, iOS, and Linux operating systems. The trusted execution environment is a secure environment isolated from the main operating system of the terminal 101. The trusted execution environment is used to run a TEE system with a higher security level.

[0031] The application installed and run by the terminal 101 in the trusted execution environment is a trusted application (TA). The terminal 101 can allocate an independent secure storage area for the trusted application through the TEE system. Optionally, when the trusted application requests access to the secure storage area, the trusted application can send a data access request to the terminal through the server 102. When the terminal 101 receives a data access request from the trusted application to the target secure storage area, the terminal 101 verifies the trusted application through the TEE system, and grants access rights to the trusted application only when the verification passes. The trusted application is associated with the server 102, and the server 102 provides background services.

[0032] Optionally, the server 102 is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. In some embodiments, the server 102 undertakes the main computing work, and the terminal 101 undertakes the secondary computing work; or, the server 102 undertakes the secondary computing work, and the terminal 101 undertakes the main computing work; or, the server 102 and the terminal 101 use a distributed computing architecture for collaborative computing.

[0033] Figure 2 is a flow chart of a data processing method provided in an embodiment of the present application. The method is executed by a terminal, see Figure 2 , the method comprising:

[0034] 201. In response to a data access request from a first trusted application, the terminal determines a target secure storage area requested to be accessed by the data access request based on an application identifier and an application name of the first trusted application carried in the data access request, wherein the first trusted application is an application running in a trusted execution environment, and the target secure storage area is used to store data of a second trusted application in the trusted execution environment.

[0035] In an embodiment of the present application, the terminal includes a trusted execution environment (TEE) and a rich execution environment (REE). The rich execution environment is used to run the main operating system of the terminal, such as operating systems such as Android, iOS, and Linux. The trusted execution environment is a secure environment in the terminal that is isolated from the main operating system. The trusted execution environment is used to run TEE systems with a higher security level. Applications installed and run in a trusted execution environment are trusted applications (TA). Due to the high security level of the trusted execution environment, the terminal can install applications with higher data security requirements in the trusted execution environment. For example, payment applications, password management applications, and digital rights management applications.

[0036] In some embodiments, the terminal can allocate an independent secure storage area for a trusted application in a trusted execution environment through a TEE system. Taking any trusted application as an example, the process of allocating a secure storage area for the trusted application by the terminal is described below. When the trusted application first requests to store data in the underlying secure storage partition, or when the terminal installs the trusted application in the trusted execution environment, the terminal allocates an independent secure storage area for the trusted application in the underlying secure storage partition, such as the RPMB (Replay Protected Memory Bloc) partition, according to the application identifier and application name of the trusted application. The trusted application can access the secure storage area allocated to it by the terminal. For example, write data to the secure storage area, or read data in the secure storage area. The trusted application cannot access the secure storage area of ​​other trusted applications. Accordingly, other trusted applications in the trusted execution environment can only access the secure storage area allocated to them by the terminal, thereby ensuring that the data stored in the secure storage area will not be read by other trusted applications, thereby improving the security of the data. In some embodiments, after the terminal allocates a secure storage area for the trusted application, the terminal can establish an association relationship between the secure storage area and the public key of the trusted application. Since the public key cannot be forged, when a trusted application requests access to the secure storage area, the terminal can determine whether to grant access rights to the trusted application by verifying whether the public key of the trusted application is consistent with the public key associated with the secure storage area.

[0037] In an embodiment of the present application, when a first trusted application requests access to a target secure storage area, the first trusted application sends a data access request to a terminal. When the terminal receives the data access request, the terminal obtains the application identifier and application name of the first trusted application carried in the data access request. Then, the terminal can determine the target secure storage area that the first trusted application requests access to through the application identifier and application name.

[0038] It should be noted that the application identifier and application name can be easily forged. If a malicious application is installed in the trusted execution environment of the terminal with a forged application identifier and application name, the malicious application can send a data access request to the terminal with the forged application identifier and application name. Accordingly, the terminal determines that the malicious application requests to access the target secure storage area through the forged application identifier and application name of the malicious application. Therefore, the terminal needs to verify the first trusted application to prevent the malicious application from maliciously accessing the target secure storage area.

[0039] 202. The terminal obtains a first public key, where the first public key is a public key of a first trusted application, and the public key is used to verify the authenticity of the trusted application.

[0040] In the embodiment of the present application, after the terminal determines that the first trusted application requests to access the target secure storage area, the terminal obtains the public key published by the first trusted application and uses the public key as the first public key. Since the public key cannot be forged, the terminal can determine the authenticity of the first trusted application by verifying the first public key. The following step 203 describes the process of the terminal verifying the first public key.

[0041] 203. The terminal verifies the first public key based on the second public key, and grants access rights to the target secure storage area to the first trusted application if the first public key is consistent with the second public key, the second public key is the public key associated with the target secure storage area, and the second public key is the public key of the second trusted application.

[0042] In the embodiment of the present application, the target secure storage area requested to be accessed by the first trusted application is the secure storage area corresponding to the second trusted application. As the terminal establishes an association relationship between the target secure storage area and the public key of the second trusted application in the process of allocating the target secure storage area for the second trusted application, the terminal obtains the public key associated with the target secure storage area and uses the public key as the second public key. The terminal verifies the first public key by the second public key. Since the public key cannot be forged, when the first public key is consistent with the second public key, the first trusted application is the second trusted application. The terminal grants the first trusted application permission to access the target secure storage area. When the first public key is inconsistent with the second public key, the first trusted application is another trusted application or a malicious application. The first trusted application cannot access the target secure storage area. Therefore, the terminal rejects the first trusted application's request for data access to the target secure storage area. By granting access rights to the trusted application only when the public key of the trusted application is consistent with the public key associated with the target secure storage area, it can be ensured that the data in the target secure storage area will not be maliciously read, thereby ensuring the security of the data.

[0043] An embodiment of the present application provides a data processing method, when a terminal receives a data access request from a first trusted application to a target secure storage area, the terminal can obtain the public key of the first trusted application and the public key of the second trusted application, that is, the first public key and the second public key. Since public keys cannot be forged, when the first public key and the second public key are consistent, it indicates that the first trusted application and the second trusted application are the same application, are trustworthy, and are not disguised by malicious applications. Therefore, the terminal grants access rights to the target secure storage area to the first trusted application, thereby preventing malicious applications from maliciously accessing the target secure storage area and improving data security.

[0044] Figure 3 is a flow chart of a data processing method provided in an embodiment of the present application. The method is executed by a terminal, see Figure 3 , the method comprising:

[0045] 301. In response to a secure storage area creation request of any trusted application, the terminal obtains an application identifier and an application name of the trusted application.

[0046] In an embodiment of the present application, the terminal includes a trusted execution environment (TEE) and a rich execution environment (REE). The rich execution environment is used to run the main operating system of the terminal, such as operating systems such as Android, iOS and Linux. The trusted execution environment is a secure environment isolated from the main operating system in the terminal. The trusted execution environment is used to run a TEE system with a higher security level. The application installed and run in the trusted execution environment is a trusted application (TA). The trusted execution environment provides an underlying secure storage partition, such as an RPMB (Replay Protected Memory Bloc) partition. The RPMB partition is used to store data with high security requirements to prevent illegal reading and illegal tampering. For example, biometric payment data in payment applications, passwords recorded in password management applications, and application keys and other data. The terminal can allocate independent secure storage areas for trusted applications in the underlying secure storage partition. Accordingly, trusted applications can access the secure storage area allocated to them by the terminal, and cannot access the secure storage areas of other trusted applications.

[0047] When the terminal installs a trusted application in a trusted execution environment through the TEE system, or when the trusted application requests to store data in the underlying secure storage partition for the first time, the trusted application sends a storage area creation request to the terminal. The storage area creation request is used to request the terminal to allocate an independent secure storage area for the trusted application in the RPMB partition or other underlying secure storage partitions to store the data of the trusted application. When the terminal receives the secure storage area creation request from the trusted application, the terminal obtains the application identifier and application name of the trusted application carried in the secure storage area creation request. Among them, the application identifier and application name can be set by the developer of the application. The application identifier can be the serial number of the application or the ID (Identity Document) of the application, which is not limited in this embodiment of the present application.

[0048] 302. The terminal generates a zone identifier for the trusted application based on the application identifier and the application name of the trusted application.

[0049] In an embodiment of the present application, the terminal processes the application identifier and application name of the trusted application through a derivation function, and is able to generate a sequence corresponding to the above application identifier and application name. The terminal uses the sequence as the region identifier of the trusted application. The region identifier is used to indicate the secure storage area allocated by the terminal for the trusted application. Among them, the derivation function can be HMAC (Hash-based Message Authentication Code) or HKDF (HMAC-based Key Derivation Function), which is not limited in the embodiment of the present application.

[0050] For example, the terminal reads through the TEE system<ta_id,ta_name> . Wherein, ta_id is the application identifier of the trusted application, and ta_name is the application name of the trusted application. Then, the terminal generates a zone identifier for the trusted application through the following formula (1).

[0051] ta_sanid = derive_func(ta_id, ta_name) (1)

[0052] Wherein, ta_sanid is the area identifier of the trusted application. ta_id and ta_name are the application identifier and application name of the trusted application respectively. derive_func is the derived function.

[0053] In some embodiments, the terminal is able to establish an association relationship between the public key of the trusted application and the regional identifier of the trusted application. The terminal obtains the public key disclosed by the trusted application. Based on the public key, the terminal verifies the first digital signature of the trusted application. The first digital signature is obtained by encrypting the program code of the trusted application with the first private key. The first private key is the private key corresponding to the public key of the trusted application. The first private key is used to encrypt the data of the trusted application. When the first digital signature passes the verification, it indicates that the program code of the trusted application has not been tampered with and the trusted application is a genuine trusted application. The terminal establishes an association relationship between the public key of the trusted application and the regional identifier.

[0054] In some embodiments, the developer of the trusted application encrypts the program code of the trusted application through the first private key. For example, the developer processes the program code of the trusted application through a Hash function to obtain a Hash value. The Hash value is a string of fixed-length data. Then, the developer encrypts the Hash value through the first private key (ta_signer_private_key) to obtain a first digital signature (ta_sig). Since the first private key is the private key corresponding to the public key (ta_signer_public_key) of the trusted application, the terminal can decrypt the first digital signature encrypted by the first private key through the public key of the trusted application to obtain a first Hash value. The terminal can also process the program code of the trusted application through the same Hash function to obtain a second Hash value. The terminal can determine whether the program code of the trusted application has been tampered with by comparing whether the first Hash value and the second Hash value are consistent. When the two Hash values ​​are consistent, it indicates that the program code of the trusted application has not been tampered with. When the two Hash values ​​are inconsistent, it indicates that the program code of the trusted application has been tampered with. It should be noted that the developer can also use the first private key and other signature functions to encrypt the program code of the trusted application, and the embodiments of the present application do not limit this.

[0055] For example, the developer encrypts the program code of the trusted application program using the following formula (2) to obtain a first digital signature. The terminal verifies the first digital signature using the following formula (3).

[0056] ta_sig = sign(ta_signer_private_key,ta_code) (2)

[0057] ta_sig_verify_result=sig_verify(ta_signer_public_key, ta_code, ta_sig)(3)

[0058] Wherein, ta_signer_private_key is the first private key. ta_signer_public_key is the public key of the trusted application. ta_code is the program code of the trusted application. ta_sig is the first digital signature. sign is the signature function used for encryption. sig_verify is the verification function corresponding to the signature function. ta_sig_verify_result is the verification result of the first digital signature.

[0059] When the first data signature passes the verification, the terminal establishes an association relationship between the public key of the trusted application and the regional identifier.<ta_sanid,ta_signer_public_key> Indicates the above relationship.

[0060] 303. The terminal establishes an association relationship between the area identifier and any idle secure storage area.

[0061] In an embodiment of the present application, the terminal determines any free secure storage area in the underlying secure storage partition. The free secure storage area refers to a secure storage area that has not been allocated to a trusted application by the terminal. The terminal can use the area identifier as an identifier of the secure storage area by establishing an association between the area identifier and the secure storage area. The secure storage area is allocated to the trusted application. The trusted application can access the secure storage area, store data in the secure storage area, and read data.

[0062] In some embodiments, the terminal may also establish an association relationship between the public key of the trusted application and the area identifier after establishing the above association relationship. The embodiment of the present application does not limit the timing of the terminal establishing the association relationship between the public key of the trusted application and the area identifier. Among them, the association relationship between the public key of the trusted application and the area identifier is used to indicate that the secure storage area is associated with the public key of the trusted application.

[0063] The above steps 301-303 are the process of the terminal allocating a secure storage area for any trusted application. The following steps 304-307 take the first trusted application requesting access to the target secure storage area, where the target secure storage area is the secure storage area allocated by the terminal for the second trusted application, as an example to illustrate the process of the terminal verifying the first trusted application.

[0064] 304. In response to the data access request of the first trusted application, the terminal determines the target secure storage area requested to be accessed by the data access request based on the application identifier and application name of the first trusted application carried in the data access request, the first trusted application is an application running in a trusted execution environment, and the target secure storage area is used to store data of a second trusted application in the trusted execution environment.

[0065] In an embodiment of the present application, when the first trusted application requests access to the target secure storage area, the first trusted application sends a data access request to the terminal. When the terminal receives the data access request, the terminal obtains the application identifier and application name of the first trusted application carried in the data access request. The terminal can determine the target secure storage area that the first trusted application requests access through the application identifier and application name.

[0066] In some embodiments, in response to a data access request from a first trusted application, the terminal obtains an application identifier and an application name of the first trusted application carried in the data access request. The terminal generates a region identifier based on the application identifier and the application name. The terminal processes the application identifier and the application name of the first trusted application through a derivation function to generate a sequence corresponding to the above application identifier and the application name, and uses the sequence as the region identifier of the first trusted application. After the terminal generates the region identifier, it determines that the secure storage area indicated by the region identifier is the target secure storage area requested to be accessed by the first trusted application in multiple secure storage areas of the underlying secure storage partition. For example, the terminal processes the application identifier and the application name of the first trusted application through the derivation function derive_func shown in the above formula (1) to obtain the region identifier of the first trusted application.

[0067] 305. The terminal obtains a first public key, where the first public key is a public key of a first trusted application, and the public key is used to verify the authenticity of the trusted application.

[0068] In the embodiment of the present application, the terminal obtains the public key disclosed by the first trusted application, and the terminal uses the public key as the first public key. Since the public key cannot be forged, and the application and the public key of the application have a one-to-one correspondence. Since the public key cannot be forged, the terminal can determine the authenticity of the first trusted application by verifying the first public key.

[0069] 306. The terminal obtains a second public key, where the second public key is a public key associated with the target secure storage area and is a public key of a second trusted application.

[0070] In the embodiment of the present application, since the target secure storage area is associated with the public key of the second trusted application, the terminal obtains the public key associated with the target secure storage area and uses the public key as the second public key, which is also the public key of the second trusted application.

[0071] In some embodiments, the terminal obtains the area identifier of the target secure storage area. The terminal obtains the public key associated with the area identifier as the second public key. For example, the terminal obtains the public key associated with the area identifier of the target secure storage area (ta_sanid) in<ta_sanid,ta_signer_public_key> In the association relationship shown, the public key (ta_signer_public_key) associated with the area identifier (ta_sanid) is obtained as the second public key.

[0072] In some embodiments, since the target secure storage area is the secure storage area corresponding to the second trusted application, the second trusted application can store the public key of the second trusted application in the target secure storage area. Accordingly, the terminal can obtain the public key stored in the target secure storage area as the second public key.

[0073] 307. The terminal verifies the first public key based on the second public key, and grants access rights to the target secure storage area to the first trusted application if the first public key is consistent with the second public key.

[0074] In an embodiment of the present application, the terminal verifies the first public key through the second public key. When the first public key is consistent with the second public key, the first trusted application is the second trusted application, and the terminal grants the first trusted application permission to access the target secure storage area. When the first public key is inconsistent with the second public key, the first trusted application is another trusted application or a malicious application. The first trusted application cannot access the target secure storage area. Therefore, the terminal rejects the first trusted application's request to access data in the target secure storage area. By granting access rights to the trusted application only when the public key of the trusted application is consistent with the public key associated with the target secure storage area, it can be ensured that the data in the target secure storage area will not be read maliciously, thereby ensuring the security of the data.

[0075] In some embodiments, the terminal can update the public key associated with the target secure storage area when the public key of the second trusted application is updated. In response to the update of the public key of the second trusted application, the terminal obtains the key digital signature of the second trusted application. Among them, the key digital signature is obtained by encrypting the third public key with the first private key. The first private key corresponds to the second public key. The first private key and the second public key are the keys before the second trusted application is updated. The third public key is the public key after the second trusted application is updated. Therefore, when the developer of the second application updates the public key of the second trusted application, the updated public key (the third public key) is encrypted with the old private key (the first private key) to obtain the key digital signature. Correspondingly, after the terminal obtains the key digital signature, the key digital signature is verified using the old public key (the second public key). When the key digital signature passes the verification, it indicates that the third public key is a legitimate new public key that has been authenticated by the old public key signature. Therefore, the terminal updates the public key associated with the target secure storage area from the second public key to the third public key.

[0076] In order to more clearly explain the process of the terminal updating the public key associated with the target secure storage area and verifying the program code of the second trusted application through the new public key, the above process is described in more detail through steps (1)-(5). Among them, the old key pair of the second trusted application is<old_ta_signer_private_key,old_ta_signer_public_key> The updated key pair of the second trusted application is<new_ta_signer_private_key,new_ta_signer_public_key> .

[0077] In the above two key pairs, old_ta_signer_private_key is the old private key of the second trusted application, that is, the first private key. old_ta_signer_public_key is the old public key of the second trusted application, that is, the second public key. new_ta_signer_public_key is the new public key of the second trusted application, that is, the third public key. new_ta_signer_private_key is the new private key of the second trusted application.

[0078] (1) The developer of the second trusted application encrypts the program code of the second trusted application using the following formula (4) to obtain the digital signature of the second trusted application.

[0079] ta_sig1 = sign(new_ta_signer_private_key,ta_code1) (4)

[0080] Among them, ta_code1 can be the program code of the second trusted application, and ta_code1 can also be the program code for updating the second trusted application. new_ta_signer_private_key is the new private key of the second trusted application. ta_sig1 is the digital signature of the second trusted application. sign is the signature function used for encryption. Among them, the signature function can be ECDSA (Elliptic Curve Digital Signature Algorithm) or RSASSA-PSS (RSASSA-Probabilistic Signature Scheme, a probabilistic signature algorithm based on RSASSA), which is not limited in the embodiments of the present application.

[0081] In some embodiments, the developer processes the program code of the second trusted application through a hash function to obtain a hash value. The hash value is a string of fixed-length data. Then, the developer encrypts the hash value through a new private key (new_ta_signer_private_key) to obtain a digital signature (ta_sig1) of the second trusted application.

[0082] (2) The developer of the second trusted application encrypts the updated third public key of the second trusted application using the first private key using the following formula (5) to obtain a key digital signature.

[0083] ta_key_sig=sign(old_ta_signer_private_key, new_ta_signer_public_key)(5)

[0084] Wherein, ta_key_sig is the key digital signature, sign is the signature function, old_ta_signer_private_key is the first private key, and new_ta_signer_public_key is the encrypted third public key.

[0085] (3) The terminal uses the TEE system<ta_sanid,old_ta_signer_public_key> The old_ta_signer_public_key associated with the area identifier ta_sanid of the second trusted application in the association relationship shown, that is, the second public key, verifies the key digital signature ta_key_sig. If the key digital signature passes the verification, it indicates that the third public key is a legal new public key that has been authenticated by the old public key signature. The terminal updates the public key associated with the target secure storage area from the second public key to the third public key. That is,<ta_sanid,old_ta_signer_public_key> Updated to<ta_sanid,new_ta_signer_public_key> , which realizes replacing the old public key with the new public key in the association relationship.

[0086] For example, the terminal verifies the key digital signature ta_key_sig through the following formula (6).

[0087] ta_key_sig_verify_result=sig_verify(old_ta_signer_public_key,

[0088] new_ta_signer_public_key,ta_key__sig)(6)

[0089] Among them, ta_key_sig_verify_result is the verification result of the key digital signature. sig_verify is the verification function corresponding to the signature function. The remaining parameters are consistent with the above formula and will not be repeated here.

[0090] In some embodiments, the terminal can decrypt the key digital signature through the old public key of the second trusted application to obtain a first hash value. The terminal processes the third public key of the second trusted application through the same hash function to obtain a second hash value. The terminal can determine whether the third public key has been tampered with by comparing whether the first hash value and the second hash value are consistent. When the two hash values ​​are consistent, it indicates that the third public key has not been tampered with. The third public key is a legal new public key that has been legally authenticated by the old public key. When the two hash values ​​are inconsistent, it indicates that the third public key has been tampered with.

[0091] (4) When the terminal determines that the third public key is a legitimate new public key, the terminal verifies the digital signature of the second trusted application using the third public key to determine whether the program code has been tampered with. For example, the terminal verifies the program code of the second trusted application using the following formula (7).

[0092] ta_sig_verify_result1=sig_verify(new_ta_signer_public_key,ta_code1,ta_sig1)(7)

[0093] Among them, ta_sig_verify_result1 is the verification result. sig_verify is the verification function corresponding to the signature function. new_ta_signer_public_key is the third public key. The remaining parameters are consistent with the above formula (4) and will not be repeated here.

[0094] In some embodiments, when ta_code1 is a program code for updating a second trusted application and the digital signature passes verification, the terminal grants the second trusted application permission to execute ta_code1 to upgrade the second trusted application.

[0095] (5) After the terminal updates the public key associated with the target secure storage area from the second public key to the third public key, the terminal verifies the public key of the application requesting access to the target storage area based on the third public key. If the public key of the application is consistent with the third public key, the terminal grants the application access to the target secure storage area.

[0096] An embodiment of the present application provides a data processing method, when a terminal receives a data access request from a first trusted application to a target secure storage area, the terminal can obtain the public key of the first trusted application and the public key of the second trusted application, that is, the first public key and the second public key. Since public keys cannot be forged, when the first public key and the second public key are consistent, it indicates that the first trusted application and the second trusted application are the same application, are trustworthy, and are not disguised by malicious applications. Therefore, the terminal grants access rights to the target secure storage area to the first trusted application, thereby preventing malicious applications from maliciously accessing the target secure storage area and improving data security.

[0097] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.

[0098] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0099] Figure 4 is a structural diagram of a data processing device provided in an embodiment of the present application. Figure 4 The device includes: a determination module 401, a first acquisition module 402 and a verification module 403.

[0100] A determination module 401 is used to determine, in response to a data access request of a first trusted application, a target secure storage area requested to be accessed by the data access request based on an application identifier and an application name of the first trusted application carried in the data access request, wherein the first trusted application is an application running in a trusted execution environment, and the target secure storage area is used to store data of a second trusted application in the trusted execution environment;

[0101] A first acquisition module 402, configured to acquire a first public key, where the first public key is a public key of a first trusted application, and the public key is used to verify the authenticity of the trusted application;

[0102] The verification module 403 is used to verify the first public key based on the second public key, and when the first public key is consistent with the second public key, grant the first trusted application access to the target secure storage area, the second public key is the public key associated with the target secure storage area, and the second public key is the public key of the second trusted application.

[0103] In some embodiments, the determination module 401 is used to respond to a data access request of a first trusted application, obtain an application identifier and an application name of the first trusted application carried in the data access request; generate an area identifier based on the application identifier and the application name; and determine a target secure storage area indicated by the area identifier.

[0104] In some embodiments, Figure 5 is a schematic diagram of the structure of another data processing device provided in an embodiment of the present application, see Figure 5 , the device further comprises:

[0105] A second acquisition module 404 is used to acquire an area identifier of a target secure storage area;

[0106] The third acquisition module 405 is configured to acquire the public key associated with the area identifier as a second public key.

[0107] In some embodiments, the apparatus further comprises:

[0108] The fourth acquisition module 406 is configured to acquire the public key stored in the target secure storage area as the second public key.

[0109] In some embodiments, the apparatus further comprises:

[0110] A fifth acquisition module 407, configured to acquire an application identifier and an application name of the second trusted application in response to a secure storage area creation request of the second trusted application;

[0111] A region identifier generating module 408, configured to generate a region identifier for a second trusted application based on an application identifier and an application name of the second trusted application;

[0112] The area allocation module 409 is used to establish an association relationship between an area identifier and any free secure storage area.

[0113] In some embodiments, the area identifier generation module 408 is used to obtain the public key of the second trusted application; based on the public key, the first digital signature of the second trusted application is verified, the first digital signature is obtained by encrypting the program code of the second trusted application with the first private key, the first private key is the private key corresponding to the public key of the second trusted application, and the first private key is used to encrypt the data of the second trusted application; when the first digital signature passes the verification, an association relationship between the public key of the second trusted application and the area identifier is established.

[0114] In some embodiments, the apparatus further comprises:

[0115] A sixth acquisition module 410 is used to acquire a key digital signature of the second trusted application in response to an update of the public key of the second trusted application, where the key digital signature is obtained by encrypting a third public key with a first private key, where the first private key is a private key corresponding to the second public key, and the third public key is an updated public key of the second trusted application;

[0116] A digital signature verification module 411, used to verify the key digital signature based on the second public key;

[0117] The updating module 412 is configured to update the public key associated with the target secure storage area from the second public key to a third public key when the key digital signature passes the verification.

[0118] An embodiment of the present application provides a data processing device, when a terminal receives a data access request from a first trusted application to a target secure storage area, the terminal can obtain the public key of the first trusted application and the public key of the second trusted application, that is, the first public key and the second public key. Since public keys cannot be forged, when the first public key and the second public key are consistent, it indicates that the first trusted application and the second trusted application are the same application, are trustworthy, and are not disguised by malicious applications. Therefore, the terminal grants access rights to the target secure storage area to the first trusted application, thereby preventing malicious applications from maliciously accessing the target secure storage area and improving data security.

[0119] It should be noted that the data processing device provided in the above embodiment, when implementing its functions, only uses the division of the above functional modules as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the terminal is divided into different functional modules to complete all or part of the functions described above. In addition, the data processing device provided in the above embodiment and the data processing method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0120] An embodiment of the present application provides a terminal, which includes a processor and a memory; the memory stores at least one program code, and the at least one program code is used to be executed by the processor to implement the data processing method provided by the above-mentioned various method embodiments.

[0121] Figure 6 6 is a block diagram of a terminal provided in an embodiment of the present application. In some embodiments, the terminal 600 is a terminal such as a smart phone, a tablet computer, a wearable device, etc. that can access a wireless local area network as a wireless station. The terminal 600 in the present application includes at least one or more of the following components: a processor 610, a memory 620, and at least two wireless links 630.

[0122] In some embodiments, the processor 610 includes one or more processing cores. The processor 610 uses various interfaces and lines to connect various parts of the entire terminal 600, and executes various functions and processes data of the terminal 600 by running or executing program codes stored in the memory 620, and calling data stored in the memory 620. In some embodiments, the processor 610 is implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 610 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a neural network processor (NPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the NPU is used to implement artificial intelligence (AI) functions; and the modem is used to process wireless communications. It is understandable that the above-mentioned modem may not be integrated into the processor 610, but may be implemented by a separate chip.

[0123] In some embodiments, the processor 610 is used to control the working conditions of at least two wireless links 630. Accordingly, the processor 610 is a processor integrated with a wireless fidelity (Wireless Fidelity, Wi-Fi) chip. The Wi-Fi chip is a chip with dual Wi-Fi processing capabilities. For example, the Wi-Fi chip is a dual-band dual concurrent (Dual Band Dual Concurrent, DBDC) chip, or a dual-band synchronous (Dual Band Simultaneous, DBS) chip, etc.

[0124] In some embodiments, the memory 620 includes a random access memory (RAM), and in some embodiments, the memory 620 includes a read-only memory (ROM). In some embodiments, the memory 620 includes a non-transitory computer-readable storage medium. The memory 620 can be used to store program codes. The memory 620 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc.; the data storage area may store data created according to the use of the terminal 600 (such as audio data, a phone book), etc.

[0125] In some embodiments, the memory 620 stores reception schemes for receiving beacon frames of different wireless links 630, as well as identifiers of access nodes connected to different wireless links 630, identifiers of wireless links 630, and the like.

[0126] The at least two wireless links 630 are used to connect different access points (APs) to receive downlink data sent by the APs, wherein the different access points are access points in the same router or access points in different routers.

[0127] In some embodiments, the terminal 600 also includes a display screen. The display screen is a display component for displaying a user interface. In some embodiments, the display screen is a display screen with a touch function, through which the user can use any suitable object such as a finger or a touch pen to perform touch operations on the display screen. In some embodiments, the display screen is usually arranged on the front panel of the terminal 600. In some embodiments, the display screen is designed to be a full screen, a curved screen, a special-shaped screen, a double-sided screen or a folding screen. In some embodiments, the display screen is also designed to be a combination of a full screen and a curved screen, a combination of a special-shaped screen and a curved screen, etc., which is not limited in this embodiment.

[0128] In addition, those skilled in the art will appreciate that the structure of the terminal 600 shown in the above drawings does not limit the terminal 600, and the terminal 600 includes more or fewer components than shown in the drawings, or combines certain components, or arranges components differently. For example, the terminal 600 also includes components such as a microphone, a speaker, an input unit, a sensor, an audio circuit, a module, a power supply, and a Bluetooth module, which will not be described in detail here.

[0129] The present application also provides a computer-readable storage medium, which stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the data processing method shown in the above embodiments.

[0130] The present application also provides a chip, which includes a programmable logic circuit and / or program instructions. When the chip runs on a terminal, it is used to implement the data processing methods shown in the above embodiments.

[0131] The present application also provides a computer program product, which stores at least one program code, and the at least one program code is used to be executed by a processor to implement the data processing method shown in the above embodiments.

[0132] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0133] Those skilled in the art can understand that all or part of the steps in the data processing method of the above embodiment can be completed by hardware, or by a program to instruct the relevant hardware to complete, and the program can be stored in a computer-readable storage medium, and the above-mentioned storage medium can be a read-only memory, a disk or an optical disk, etc. The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A data processing method, characterized in that: The method comprises: In response to a data access request of a first trusted application, determining a target secure storage area requested to be accessed by the data access request based on an application identifier and an application name of the first trusted application carried in the data access request, wherein the first trusted application is an application running in a trusted execution environment, and the target secure storage area is used to store data of a second trusted application in the trusted execution environment; Obtaining a first public key, where the first public key is the public key of the first trusted application and the public key is used to verify the authenticity of the trusted application; The first public key is verified based on the second public key. When the first public key is consistent with the second public key, the first trusted application is granted access to the target secure storage area. The second public key is the public key associated with the target secure storage area, and the second public key is the public key of the second trusted application.

2. The method according to claim 1, characterized in that The step of responding to a data access request from a first trusted application and determining a target secure storage area requested to be accessed by the data access request based on an application identifier and an application name of the first trusted application carried in the data access request includes: In response to the data access request of the first trusted application, obtaining an application identifier and an application name of the first trusted application carried in the data access request; Generate a region identifier according to the application identifier and the application name; The target secure storage area indicated by the area identifier is determined.

3. The method according to claim 1, characterized in that: The method further comprises: Obtaining an area identifier of the target secure storage area; A public key associated with the area identifier is obtained as a second public key.

4. The method according to claim 1, characterized in that: The method further comprises: The public key stored in the target secure storage area is acquired as the second public key.

5. The method according to claim 1, characterized in that The method further comprises: In response to the secure storage area creation request of the second trusted application, obtaining an application identifier and an application name of the second trusted application; generating a zone identifier for the second trusted application based on the application identifier and the application name of the second trusted application; An association relationship is established between the area identifier and any idle secure storage area.

6. The method according to claim 5, characterized in that The method further comprises: Obtaining a public key of the second trusted application; Based on the public key, verifying a first digital signature of the second trusted application, where the first digital signature is obtained by encrypting a program code of the second trusted application using a first private key, where the first private key is a private key corresponding to the public key of the second trusted application, and the first private key is used to encrypt data of the second trusted application; When the first digital signature passes the verification, an association relationship between the public key of the second trusted application and the area identifier is established.

7. The method according to claim 1, characterized in that The method further comprises: In response to the public key of the second trusted application being updated, obtaining a key digital signature of the second trusted application, the key digital signature being obtained by encrypting a third public key with a first private key, the first private key being a private key corresponding to the second public key, and the third public key being an updated public key of the second trusted application; Verifying the key digital signature based on the second public key; When the key digital signature passes the verification, the public key associated with the target secure storage area is updated from the second public key to the third public key.

8. A data processing device, characterized in that: The device comprises: a determination module, configured to, in response to a data access request of a first trusted application, determine a target secure storage area requested to be accessed by the data access request based on an application identifier and an application name of the first trusted application carried in the data access request, wherein the first trusted application is an application running in a trusted execution environment, and the target secure storage area is used to store data of a second trusted application in the trusted execution environment; A first acquisition module, used to acquire a first public key, where the first public key is the public key of the first trusted application, and the public key is used to verify the authenticity of the trusted application; A verification module is used to verify the first public key based on a second public key, and when the first public key is consistent with the second public key, grant the first trusted application access to the target secure storage area, the second public key is the public key associated with the target secure storage area, and the second public key is the public key of the second trusted application.

9. A terminal, characterized in that: The terminal includes a processor and a memory; the memory stores at least one program code, and the at least one program code is used to be executed by the processor to implement the data processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The storage medium stores at least one program code, and the at least one program code is used to be executed by a processor to implement the data processing method according to any one of claims 1 to 7.

11. A chip, characterized in that: The chip includes a programmable logic circuit and / or program instructions, and when the chip runs on a terminal, it is used to implement the data processing method according to any one of claims 1 to 7.

12. A computer program product, comprising a computer program, characterized in that The computer program product stores at least one program code, and the at least one program code is used to be executed by a processor to implement the data processing method according to any one of claims 1 to 7.