Method, apparatus and system on chip for data processing
By integrating a Security Element (SE) into the system chip and providing a Trusted Execution Environment (TEE), the problem of insufficient user data security protection in existing technologies is solved, enabling high-security data storage and verification, and enhancing the user experience.
Patent Information
- Application Number
- CN201980007190.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-08
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2039-11-08
AI Technical Summary
Existing mobile phone security storage solutions fail to effectively protect users' personal data, such as personal identification numbers, biometric templates, and device certificates, and lack the highest level of security protection measures.
It employs a Secure Element (SE) integrated into the system chip, providing a Trusted Execution Environment (TEE). It obtains security service requests through APIs and stores data in memories with different security levels, including shared memory and dedicated secure memory. It supports security services such as biometric authentication, password verification, and key management, and divides the data into multiple sub-regions to store data for different security services.
It improves the data protection security level of mobile phones and other devices, enhances the user experience, prevents hardware attacks and data leaks, and achieves a high level of security for data storage and verification.
Smart Images

Figure CN113168477B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data processing, and more particularly, to a data processing method, device and system chip. BACKGROUND
[0002] As a kind of most widely used electronic equipment, mobile phone plays an increasingly important role in mobile e-commerce with the wide application of Internet and the continuous improvement of mobile phone performance. Mobile phone will realize bank card, bus card, key, identity card and other functions in the future. To realize these functions, mobile phone chip needs to provide a hardware-level security solution.
[0003] In existing mobile phone secure storage, secure element (SE) is provided in the form of chip by external or internal secure element (SE), and SE chip is integrated into mobile phone product board. The highest security level SE chip realizes the protection of application data such as finance, bus card and key. However, for the security of various application data in the process of using mobile phone and other electronic devices by users, such as personal identification number (pin), biometric template protection, file system key, device certificate (public and private key pair) and other data, there is no higher security level protection scheme. With the increasing demand of users and manufacturers for the security of personal data in mobile phone and other electronic devices, a secure storage implementation process is needed to protect the personal data stored in mobile phone with the highest security level chip. SUMMARY
[0004] The present application provides a data processing method, device and system chip, which can implement secure service in secure element, store data of different secure services, and improve security level and user experience.
[0005] In a first aspect, a data processing device is provided, comprising: at least one processor configured to provide a trusted execution environment (TEE) and obtain a first secure service request through an application programming interface (API) of the TEE, the first secure service request being used to request a first secure service; and a secure element configured to: obtain the first secure service request from the at least one processor; perform the first secure service to obtain secure data in response to the first secure service request; and store first secure data to a first memory outside the data processing device when the secure data comprises the first secure data, and store second secure data to a second memory outside the data processing device when the secure data comprises the second secure data, wherein the first secure data comprises recoverable data, the second secure data comprises non-recoverable data, and the first memory and the second memory are different memories.
[0006] With reference to the first aspect, in some implementations of the first aspect, the first security service includes at least one of a biometric authentication password service, a password verification service, a key management and calculation service, a root of trust service, an anti-rollback service, or a high-security storage service.
[0007] By means of the above data processing apparatus, an architecture and a flow design for supporting a mobile phone system security service by an SE integrated into a system on chip (SOC) (referred to as inSE) are first proposed, so that a high-security-level chip security system is applied to data protection of a mobile phone and the like. Specifically, the SE is integrated to support a biometric authentication password service, a password matching and verification service, a key management and calculation service, a file encryption service, a root of trust service, a high-security storage service, an anti-rollback service, and the like, so that the security service can be implemented in the SE, certificates are saved, and data of different security services are stored, thereby improving the security level and user experience.
[0008] The above technical solution can integrate a biometric authentication function in the SE, support security verification of a mobile phone and the like, and improve the security of device use.
[0009] With reference to the first aspect and the above implementations, in some implementations of the first aspect, the second memory includes a plurality of regions, and when the second security data is stored to the second memory outside the data processing apparatus, the SE is configured to store the second security data to a region corresponding to the first security service in the plurality of regions.
[0010] Among different security services, a plurality of possible data region management modes of a security flash are provided, a plurality of sub-regions are divided, and data of different security services are stored. For example, for an anti-rollback service, anti-rollback data is stored, critical keys and device certificates are saved, high-security data is saved, and data of a third-party application is saved. By means of the SE combined with a chip of a security level, the security level and user experience are improved.
[0011] With reference to the first aspect and the above implementations, in some implementations of the first aspect, the first security service includes an anti-rollback service, the security data includes the second security data, the second security data includes an identifier and a count value of the anti-rollback service, the count value is used to determine a number of hardware attacks, a region corresponding to the anti-rollback service in the plurality of regions further includes a first sub-region and a second sub-region, and the SE is specifically configured to: determine the identifier and the count value of the anti-rollback service; store the identifier of the anti-rollback service to the first sub-region, and store the count value to the second sub-region.
[0012] For the rollback protection service, the value of the rollback protection is stored in the secure flash. In the rollback protection data area of the secure flash, each application has a different application identification (4 bytes or 8 bytes), and each application has a 4-byte counter value (monotonic counter), i.e., 4 bytes of counter space.
[0013] When an application calls the rollback protection service API of the TEE 20, the input application identification (e.g., application ID) is used to search the application identification in the rollback protection data area of the secure flash. If the application identification exists, the corresponding counter value is increased by 1, and the value is returned to the application; if the application identification does not exist, a new application identification is added, the application identification field is set to the ID of the application, and the counter is 1. Thus, the application has a secure counter against hardware attacks, preventing attacks.
[0014] With reference to the first aspect and the above implementation manners, in some implementation manners of the first aspect, the first security service includes a biometric authentication password service, the security data includes the first security data and the second security data, the first security data includes ciphertext, and the second security data includes a first key and a message authentication code (MAC) value; and the secure element is specifically configured to: obtain biometric information of a first user; encrypt the biometric information by using the first key to obtain the ciphertext; determine the MAC value according to the biometric information; and store the ciphertext to the first memory, and store the first key and the MAC value to a region corresponding to the biometric authentication password service in the plurality of regions.
[0015] With reference to the first aspect and the above implementation manners, in some implementation manners of the first aspect, the first security service includes a high-security storage service, the security data includes second security data, the second security data includes identification information of a data segment of the high-security storage service, length information of the data segment, and content of the data segment, the region corresponding to the high-security storage service in the plurality of regions further includes a first sub-region, a second sub-region, and a third sub-region, and the secure element is specifically configured to: determine the identification information, the length information, and the content of the data segment; store the identification information to the first sub-region, store the length information to the second sub-region, and store the content to the third sub-region.
[0016] For the high-security storage service, the data of the high-security storage service is stored in the secure flash, which can prevent the data from being rewritten or leaked after being attacked, and prevent the data from being erased. The high-security storage data area in the secure flash can include N sub-areas, each sub-area including identification information (4 bytes) of each data segment, data length information (2 bytes), and an effective data storage area. When an application obtains its own data, the identification information and length information of the data segment are input, and the high-security data service transmits the effective data to the TA of the TEE for transmission to the application, thereby preventing hardware attacks.
[0017] In combination with the first aspect and the above implementation manners, in some implementation manners of the first aspect, the first memory is a shared memory of the secure element and the at least one processor, and the second memory is a dedicated secure memory of the secure element.
[0018] The method for writing and reading data provided in the application first proposes an architecture and process design for supporting a mobile phone system security service by integrating an SE into a SOC, so that a high-security level chip security system is applied to data protection of mobile phones and other devices. Specifically, the secure element SE is integrated to support functions such as a biometric authentication password service, a password matching and verification service, a key management and calculation service, a file encryption service, a root of trust service, a high-security storage service, and a rollback prevention service, so that the security services can be implemented in the SE, the certificates are saved, and the TEE TA is called.
[0019] In addition, in different security services, a plurality of possible data area management modes of the secure flash are provided, a plurality of sub-areas are divided, and the sub-areas are used to store data of different security services. For example, for the rollback prevention service, rollback prevention data (4 bytes for each application) is stored; key and device certificates are saved, high-security data is saved, and data of third-party applications is saved. By combining the SE with the chip of the security level, the security level and user experience are improved.
[0020] In a second aspect, a data processing apparatus is provided, comprising: at least one processor configured to provide a trusted execution environment (TEE) and obtain, via an application programming interface (API) of the TEE, a first security service request for requesting a first security service; and a secure element configured to: obtain the first security service request from the at least one processor, obtain first security data from a first memory outside the data processing apparatus when the first security service requires the first security data, obtain second security data from a second memory outside the data processing apparatus when the first security service requires the second security data, and execute the first security service, wherein the first security data comprises recoverable data, the second security data comprises non-recoverable data, and the first memory and the second memory are different memories.
[0021] With reference to the second aspect, in some implementations of the second aspect, the first security service comprises at least one of a biometric authentication password service, a password verification service, a key management and computation service, a trusted root service, a rollback prevention service, or a high-security storage service.
[0022] With reference to the second aspect and the above implementations, in some implementations of the second aspect, the second memory comprises a plurality of regions, and when obtaining the second security data from the second memory outside the data processing apparatus, the secure element is specifically configured to obtain the second security data from a region of the plurality of regions corresponding to the first security service.
[0023] With reference to the second aspect and the above implementations, in some implementations of the second aspect, the first security service comprises a rollback prevention service, the security data comprises the second security data, the second security data comprises an identification of the rollback prevention service and a count value, the count value is used to determine a number of times of hardware attacks, a region of the plurality of regions corresponding to the rollback prevention service further comprises a first sub-region and a second sub-region, and the secure element is specifically configured to: obtain the identification of the rollback prevention service from the first sub-region, and obtain the count value from the second sub-region.
[0024] With reference to the second aspect and the foregoing implementation manners, in some implementations of the second aspect, the first security service includes a biometric authentication password service, the security data includes the first security data and the second security data, the first security data includes cipher text, and the second security data includes a first key and a message authentication code (MAC) value; and the secure element is specifically configured to: obtain the cipher text from the first memory and obtain the first key and the MAC value from the second memory; decrypt the cipher text according to the first key to obtain biometric information of a first user; verify the integrity of the biometric information according to the MAC value to obtain a verification result; when the verification result is that the biometric information is complete, determine whether a to-be-verified user is the first user according to the biometric information and biometric information input by the to-be-verified user; when the to-be-verified user is the first user, the biometric authentication verification is passed; or when the to-be-verified user is not the first user, the biometric authentication verification is failed.
[0025] With reference to the second aspect and the foregoing implementation manners, in some implementations of the second aspect, the first security service includes a high-security storage service, the security data includes the second security data, the second security data includes identification information of a data segment of the high-security storage service, length information of the data segment, and content of the data segment, the region corresponding to the high-security storage service in the plurality of regions further includes a first sub-region, a second sub-region, and a third sub-region, and the secure element is specifically configured to: obtain the identification information from the first sub-region, obtain the length information from the second sub-region, and obtain the content of the data segment from the third sub-region.
[0026] With reference to the second aspect and the foregoing implementation manners, in some implementations of the second aspect, the first memory is a shared memory of the secure element and the at least one processor, and the second memory is a dedicated secure memory of the secure element.
[0027] In a third aspect, a method for data processing is provided, including: obtaining a first security service request, the first security service request being used to request a first security service; in response to the first security service request, performing the first security service to obtain security data; when the security data includes first security data, storing the first security data to a first memory, and when the security data includes second security data, storing the second security data to a second memory, wherein the first security data includes recoverable data, the second security data includes unrecoverable data, and the first memory and the second memory are different memories.
[0028] With reference to the third aspect, in some implementations of the third aspect, the first security service includes at least one of a biometric authentication password service, a password verification service, a key management and calculation service, a trusted root service, an anti-rollback service, or a high-security storage service.
[0029] With reference to the third aspect and the foregoing implementation manners, in some embodiments of the third aspect, the second memory comprises a plurality of regions, and the storing the second security data into the second memory comprises: storing the second security data into a region corresponding to the first security service in the plurality of regions.
[0030] With reference to the third aspect and the foregoing implementation manners, in some embodiments of the third aspect, the first security service comprises an anti-rollback service, the security data comprises the second security data, the second security data comprises an identifier of the anti-rollback service and a count value, the count value is used to determine a number of times of hardware attacks, a region corresponding to the anti-rollback service in the plurality of regions further comprises a first sub-region and a second sub-region, and the storing the second security data into the second memory comprises: storing the identifier of the anti-rollback service into the first sub-region, and storing the count value into the second sub-region.
[0031] With reference to the third aspect and the foregoing implementation manners, in some embodiments of the third aspect, the first security service comprises a biometric password service, the security data comprises the first security data and the second security data, the first security data comprises ciphertext, and the second security data comprises a first key and a message authentication code (MAC) value; the executing the first security service to obtain the security data comprises: obtaining biometric information of a first user; encrypting the biometric information using the first key to obtain the ciphertext; determining the MAC value according to the biometric information; and the storing the first security data into the first memory and the storing the second security data into the second memory comprises: storing the ciphertext into the first memory, and storing the first key and the MAC value into a region corresponding to the biometric password service in the plurality of regions.
[0032] With reference to the third aspect and the foregoing implementation manners, in some embodiments of the third aspect, the first security service comprises a high-security storage service, the security data comprises the second security data, the second security data comprises identifier information of a data segment of the high-security storage service, length information of the data segment, and content of the data segment, each region corresponding to the high-security storage service in the plurality of regions further comprises a first sub-region, a second sub-region, and a third sub-region, the executing the first security service to obtain the security data comprises: determining the identifier information, the length information, and the content of the data segment; and the storing the second security data into the second memory comprises: storing the identifier information into the first sub-region, storing the length information into the second sub-region, and storing the content into the third sub-region.
[0033] With reference to the third aspect and the above implementation, in some implementations of the third aspect, the first memory is a shared memory of the secure element and the at least one processor, and the second memory is a dedicated secure memory of the secure element.
[0034] In a fourth aspect, a method of data processing is provided, including: obtaining a first security service request, the first security service request being used to request a first security service; obtaining first security data from a first memory when security data required by the first security service includes the first security data; obtaining second security data from a second memory when the security data required by the first security service includes the second security data; and executing the first security service, wherein the first security data includes recoverable data, the second security data includes non-recoverable data, and the first memory and the second memory are different memories.
[0035] With reference to the fourth aspect, in some implementations of the fourth aspect, the first security service includes at least one of a biometric authentication password service, a password verification service, a key management and calculation service, a trusted root service, an anti-rollback service, or a high-security storage service.
[0036] With reference to the fourth aspect and the above implementation, in some implementations of the fourth aspect, the second memory includes a plurality of regions, and the obtaining the second security data from the second memory includes: obtaining the second security data from a region of the plurality of regions corresponding to the first security service.
[0037] With reference to the fourth aspect and the above implementation, in some implementations of the fourth aspect, the first security service includes an anti-rollback service, the security data includes the second security data, the second security data includes an identification of the anti-rollback service and a count value, the count value is used to determine a number of hardware attacks, a region of the plurality of regions corresponding to the anti-rollback service further includes a first sub-region and a second sub-region, and the obtaining the second security data from the second memory includes: obtaining the identification of the anti-rollback service from the first sub-region, and obtaining the count value from the second sub-region.
[0038] With reference to the fourth aspect and the foregoing implementation manners, in some implementations of the fourth aspect, the first security service includes a biometric authentication password service, the security data includes the first security data and the second security data, the first security data includes ciphertext, and the second security data includes a first key and a message authentication code (MAC) value; performing the first security service includes decrypting the ciphertext according to the first key to obtain biometric feature information of the first user, verifying integrity of the biometric feature information according to the MAC value to obtain a verification result, determining whether the to-be-verified user is the first user according to the biometric feature information and biometric feature information input by the to-be-verified user when the verification result is that the biometric feature information is complete, and determining that biometric authentication verification is passed when the to-be-verified user is the first user, or determining that biometric authentication verification is failed when the to-be-verified user is not the first user.
[0039] With reference to the fourth aspect and the foregoing implementation manners, in some implementations of the fourth aspect, the first security service includes a high-security storage service, the security data includes the second security data, and the second security data includes identification information of a data segment of the high-security storage service, length information of the data segment, and content of the data segment. The region corresponding to the high-security storage service in the plurality of regions further includes a first sub-region, a second sub-region, and a third sub-region. The obtaining of the second security data from the second memory includes obtaining the identification information from the first sub-region, obtaining the length information from the second sub-region, and obtaining the content of the data segment from the third sub-region.
[0040] With reference to the fourth aspect and the foregoing implementation manners, in some implementations of the fourth aspect, the first memory is a shared memory of the security element and the at least one processor, and the second memory is a dedicated secure memory of the security element.
[0041] A fifth aspect provides a security element, including: an obtaining module configured to obtain a first security service request, the first security service request being used to request a first security service; a processing module configured to perform the first security service to obtain security data in response to the first security service request; and a storing module configured to store first security data to a first memory when the security data includes the first security data, and store second security data to a second memory when the security data includes the second security data, wherein the first security data includes recoverable data, the second security data includes unrecoverable data, and the first memory and the second memory are different memories.
[0042] With reference to the fifth aspect, in some implementations of the fifth aspect, the first security service includes at least one of a biometric authentication password service, a password verification service, a key management and calculation service, a trusted root service, an anti-rollback service, or a high-security storage service.
[0043] With reference to the fifth aspect and the foregoing implementation manners, in some implementations of the fifth aspect, the second memory includes a plurality of regions, and the processing module is specifically configured to: store the second security data into a region corresponding to the first security service in the plurality of regions.
[0044] With reference to the fifth aspect and the foregoing implementation manners, in some implementations of the fifth aspect, the first security service includes an anti-rollback service, the security data includes the second security data, the second security data includes an identifier of the anti-rollback service and a count value, the count value is used to determine a number of times of hardware attacks, and a region corresponding to the anti-rollback service in the plurality of regions further includes a first sub-region and a second sub-region. The processing module is specifically configured to: store the identifier of the anti-rollback service into the first sub-region, and store the count value into the second sub-region.
[0045] With reference to the fifth aspect and the foregoing implementation manners, in some implementations of the fifth aspect, the first security service includes a biometric password service, the security data includes the first security data and the second security data, the first security data includes ciphertext, and the second security data includes a first key and a message authentication code (MAC) value. The processing module is configured to: obtain biometric information of a first user; encrypt the biometric information by using the first key to obtain the ciphertext; determine the MAC value according to the biometric information; and store the ciphertext into the first memory, and store the first key and the MAC value into a region corresponding to the biometric password service in the plurality of regions.
[0046] With reference to the fifth aspect and the foregoing implementation manners, in some implementations of the fifth aspect, the first security service includes a high-security storage service, the security data includes the second security data, the second security data includes identifier information of a data segment of the high-security storage service, length information of the data segment, and content of the data segment, and each region corresponding to the high-security storage service in the plurality of regions further includes a first sub-region, a second sub-region, and a third sub-region. The processing module is configured to: determine the identifier information, the length information, and the content of the data segment; store the identifier information into the first sub-region, store the length information into the second sub-region, and store the content into the third sub-region.
[0047] With reference to the fifth aspect and the foregoing implementation manners, in some implementations of the fifth aspect, the first memory is a shared memory of the security element and the at least one processor, and the second memory is a dedicated security memory of the security element.
[0048] In a sixth aspect, a secure element is provided, comprising: an obtaining module configured to obtain a first secure service request, the first secure service request configured to request a first secure service; when security data required by the first secure service comprises first security data, the obtaining module is configured to obtain the first security data from a first memory; when the security data required by the first secure service comprises second security data, the obtaining module is configured to obtain the second security data from a second memory; and a processing module configured to execute the first secure service, wherein the first security data comprises recoverable data, the second security data comprises non-recoverable data, and the first memory and the second memory are different memories.
[0049] With reference to the sixth aspect, in some implementations of the sixth aspect, the first secure service comprises at least one of a biometric authentication password service, a password verification service, a key management and calculation service, a trusted root service, an anti-rollback service, or a high-security storage service.
[0050] With reference to the sixth aspect and the above implementations, in some implementations of the sixth aspect, the second memory comprises a plurality of regions, and the obtaining module is specifically configured to obtain the second security data from a region corresponding to the first secure service in the plurality of regions.
[0051] With reference to the sixth aspect and the above implementations, in some implementations of the sixth aspect, the first secure service comprises an anti-rollback service, the security data comprises the second security data, the second security data comprises an identification of the anti-rollback service and a count value, the count value is configured to determine a number of hardware attacks, a region corresponding to the anti-rollback service in the plurality of regions further comprises a first sub-region and a second sub-region, and the obtaining module is specifically configured to obtain the identification of the anti-rollback service from the first sub-region and obtain the count value from the second sub-region.
[0052] With reference to the sixth aspect and the above implementations, in some implementations of the sixth aspect, the first secure service comprises a biometric authentication password service, the security data comprises the first security data and the second security data, the first security data comprises ciphertext, and the second security data comprises a first key and a message authentication code (MAC) value; and the processing module is specifically configured to: decrypt the ciphertext according to the first key to obtain biometric feature information of a first user; verify integrity of the biometric feature information according to the MAC value to obtain a verification result; when the verification result is that the biometric feature information is complete, determine whether a to-be-verified user is the first user according to the biometric feature information and biometric feature information input by the to-be-verified user; when the to-be-verified user is the first user, biometric authentication verification is passed; or when the to-be-verified user is not the first user, biometric authentication verification is failed.
[0053] With reference to the sixth aspect and the above implementation manners, in some implementations of the sixth aspect, the first security service includes a high-security storage service, the security data includes second security data, the second security data includes identification information of a data segment of the high-security storage service, length information of the data segment, and content of the data segment, and the region corresponding to the high-security storage service in the plurality of regions further includes a first sub-region, a second sub-region, and a third sub-region. The obtaining module is specifically configured to obtain the identification information from the first sub-region, obtain the length information from the second sub-region, and obtain the content of the data segment from the third sub-region.
[0054] With reference to the sixth aspect and the above implementation manners, in some implementations of the sixth aspect, the first memory is a shared memory of the secure element and the at least one processor, and the second memory is a dedicated security memory of the secure element.
[0055] In a seventh aspect, a data processing apparatus is provided, which includes a trusted execution environment (TEE) module and a secure runtime environment module of a secure element (SE). The TEE module communicates with the secure runtime environment module through an application programming interface (API). The TEE module is capable of obtaining a first security service request, sending the first security service request to the secure runtime environment module through the API, and requesting a first security service. The secure runtime environment module executes the method for data processing in the third aspect, any possible implementation of the third aspect, and the fourth aspect, and any possible implementation of the fourth aspect.
[0056] In an eighth aspect, a secure element is provided, which includes a processor and an interface. The interface is coupled to the processor. The processor is configured to implement the functions involved in the above aspects, such as performing at least one of a biometric authentication password service, a password verification service, a key management and calculation service, a trusted root service, an anti-rollback service, or a high-security storage service, or performing other data processing procedures.
[0057] In a possible design, the secure element further includes a memory. The memory is configured to store necessary program instructions and data. When the program instructions and data are executed, the secure element is capable of executing the method for data processing in the third aspect, any possible implementation of the third aspect, and the fourth aspect, and any possible implementation of the fourth aspect.
[0058] In a ninth aspect, a system chip is provided, which includes the data processing apparatus in the first aspect, any possible implementation of the first aspect, the second aspect, and any possible implementation of the second aspect.
[0059] In a tenth aspect, a data processing apparatus is provided, the data processing apparatus comprising the data processing apparatus as in the first aspect, any one of the possible implementation manners of the first aspect, and the second aspect, any one of the possible implementation manners of the second aspect, the data processing apparatus comprising at least one processor and a secure element; a first memory and a second memory, the first memory and the second memory being different memories.
[0060] In a possible design, the first memory is a shared memory of the secure element and the at least one processor, and the second memory is a dedicated secure memory of the secure element.
[0061] In an eleventh aspect, an apparatus is provided, comprising: at least one processor, a plurality of programs, a secure element, a first memory and a second memory, wherein the first memory and the second memory are different memories other than the secure element, and the plurality of programs comprise instructions that, when executed by the apparatus, cause the apparatus to perform the method in the first aspect, any one of the possible implementation manners of the first aspect, and the second aspect, any one of the possible implementation manners of the second aspect.
[0062] In a twelfth aspect, an apparatus is provided, which can be a terminal device, or a chip disposed in a terminal device. The apparatus comprises: a processor coupled with a memory, and is configured to execute instructions in the memory to implement the method of data processing in the third aspect, any one of the possible implementation manners of the third aspect, and the fourth aspect, any one of the possible implementation manners of the fourth aspect. Optionally, the apparatus further comprises the memory. Optionally, the apparatus further comprises an interface, and the processor is coupled with the interface.
[0063] In a thirteenth aspect, a computer program product is provided, the computer program product comprising: computer program code that, when executed on a computing device or a secure element, causes the computing device or the secure element to perform the method of data processing in the third aspect, any one of the possible implementation manners of the third aspect, and the fourth aspect, any one of the possible implementation manners of the fourth aspect.
[0064] In a fourteenth aspect, a computer readable storage medium is provided, the computer readable medium storing program code or computer instructions, when the program code or computer instructions are executed on a computing device or a secure element, causing the computing device or the secure element to perform the method of data processing in the third aspect, any one of the possible implementation manners of the third aspect, and the fourth aspect, any one of the possible implementation manners of the fourth aspect.
[0065] In a fifteenth aspect, a system chip is provided, which includes a processor for supporting a terminal device to implement functions involved in the above aspects, such as writing data, encryption, decryption, reading data, or other processing of data and / or information involved in the above methods. In a possible design, the system chip further includes a memory, and the memory is configured to store program instructions and data necessary for the terminal device. The system chip can be composed of a chip, or include a chip and other discrete devices. BRIEF DESCRIPTION OF DRAWINGS
[0066] Figure 1 FIG. 1 is a schematic diagram of a possible chip design architecture.
[0067] Figure 2 FIG. 2 is a schematic diagram of a system architecture of an electronic device.
[0068] Figure 3 FIG. 3 is a schematic diagram of a system architecture provided by the present application.
[0069] Figure 4 FIG. 4 is a schematic diagram of a method for processing data provided by an embodiment of the present application.
[0070] Figure 5 FIG. 5 is a schematic diagram of a data storage process provided by an embodiment of the present application.
[0071] Figure 6 FIG. 6 is a schematic diagram of data processing of a password verification service process provided by an embodiment of the present application.
[0072] Figure 7 FIG. 7 is a schematic diagram of data processing of a biometric authentication password service process provided by an embodiment of the present application.
[0073] Figure 8 FIG. 8 is a schematic diagram of division of a rollback prevention data area provided by an embodiment of the present application.
[0074] Figure 9 FIG. 9 is a schematic diagram of division of a high-security storage data area provided by an embodiment of the present application.
[0075] Figure 10 FIG. 10 is a schematic diagram of another method for processing data provided by an embodiment of the present application.
[0076] Figure 11 FIG. 11 is a schematic diagram of a composition of a secure element SE 40 provided by an embodiment of the present application.
[0077] Figure 12 FIG. 12 is a schematic diagram of a composition of a secure element 40 provided by an embodiment of the present application.
[0078] Figure 13 FIG. 13 is a schematic diagram of a composition of a data processing apparatus provided by an embodiment of the present application.
[0079] Figure 14 is another example of a data processing apparatus provided by an embodiment of the present application.
[0080] Figure 15 is an example of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0081] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
[0082] In the description of the embodiments of the present application, the terms "first", "second" are used only for the purpose of description, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features with "first", "second" can explicitly or implicitly include one or more of the features. In the description of the embodiments, unless otherwise specified, the meaning of "multiple" is two or more.
[0083] In addition, in the description of the embodiments of the present application, the terms "component", "module", "system" and the like are used to represent terminal device related entities, hardware, combinations of hardware and software, software, or software in execution. It should be understood that the division of the methods, cases, categories and embodiments in the embodiments of the present application is only for the convenience of description, and should not constitute a special limitation. The features in various methods, categories, cases and embodiments can be combined without contradiction.
[0084] It should also be understood that in various embodiments of the present application, the size of the sequence number of each process does not mean the order of execution, and the execution order of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0085] It should also be noted that "and / or" describes the association relationship between the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. The character " / " generally represents an "or" relationship between the associated objects before and after it. "At least one" means one or more; "at least one of A and B" is similar to "A and / or B", which describes the association relationship between the associated objects, which means that there can be three relationships, for example, at least one of A and B, which can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone.
[0086] The method for data processing provided in the embodiments of the present application can be applied to a terminal device. The terminal device can also be referred to as a user equipment (UE), an electronic device, an access terminal, a user unit, a user station, a mobile station, a mobile station, a remote station, a remote terminal, a mobile device, a user terminal, a terminal, a wireless communication device, a user agent or a user apparatus. The terminal device in the embodiments of the present application can be a mobile phone, a tablet computer, a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical treatment, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home and the like. The embodiments of the present application do not limit the application scenarios. The terminal device and the chip that can be arranged in the terminal device in the present application are collectively referred to as a terminal device.
[0087] In addition, in the embodiments of the present application, the terminal device can also be a terminal device in an Internet of Things (IoT) system. The IoT is an important part of the future information technology development, and its main technical feature is to connect objects through communication technology and network, so as to realize the intelligent network of man-machine interconnection and object-object interconnection.
[0088] The embodiments of the present application will take the most widely used smart phone in life as an example for detailed description. In addition to the demand for continuous improvement of the performance of the camera, audio, video and smart phone of the user using the smart phone, the demand for mobile payment, mobile finance and other mobile phone security related to the smart phone is also increasing. In addition, the smart phone as a car key, bank card and other security applications carrying property also gradually have demand. The mobile phone in the future may collect all bank cards, bus cards, keys and identity cards, etc. To realize these functions, in addition to the support of various corresponding software development, the mobile phone chip needs to provide hardware level security.
[0089] Figure 1 is a possible chip design architecture schematic diagram. As shown in Figure 1The chip system 100 shown in the figure has a secure element (SE) 105 built into a main chip 103 including an application processor (AP), so the main chip can be referred to as an AP. In Figure 1 The main chip AP 103 can also be referred to as a system on chip (SOC). The chip system 100 can include the following components.
[0090] (1) Power management unit (PMU) chip 101
[0091] It should be understood that a power management unit can be included in the chip system 100, which can integrate all power management functions of the chip system 100 to power multiple chips within the chip system 100. The PMU chip 101 is the main component of the power management unit to implement functions such as chip system 100 reset, control of phase-locked loops and frequency dividers within the chip system 100, pin signal identification and decoding of one or more chips within the chip system 100, sleep mode control within the chip system 100, and module power management within the chip system 100. The power management unit can be logically connected to a processor such as the CPU 104 within the chip system 100, so that the processor can implement functions such as charge management, discharge management, and power consumption management through the power management unit.
[0092] Figure 1 The general-purpose input / output (GPIO) interface connection between the PMU chip 101 and the SE 105 in the above can implement a secure key function. Generally, the power key 102 of an electronic device is connected to the PMU chip 101, and when the power key is pressed, the PMU chip 101 receives an interrupt message, which is sent to the SE 105 through the GPIO interface, indicating that a hardware key has been triggered.
[0093] (2) Main chip 103
[0094] The main chip 103, i.e., the system chip SOC mentioned above, is a kind of integrated circuit chip. The logic core of the main chip 103 includes a central processing unit (CPU) 105, a clock circuit, a timer, an interrupt controller, a serial / parallel interface, other peripheral devices, an input / output (I / O) port, and a bonding logic for various IP cores, etc. The memory core includes various volatile memories, non-volatile memories (NVM), and Cache memories, etc. The main chip 103 can also include an analog core, which includes an analog to digital converter (ADC), a digital to analog converter (DAC), a phase locked loop (PLL), and some analog circuits used in high-speed circuits.
[0095] (3) Central processing unit 104
[0096] The CPU 104 is the control center of the SOC 103, i.e., the control center of the terminal device. The CPU 104 connects each part of the terminal device through various interfaces and lines, executes software programs and / or modules stored in the memory and calls data stored in the memory, performs various functions and processes data of the terminal device, and thus monitors the terminal device as a whole.
[0097] Optionally, the processor, such as the CPU 104, can include one or more processing units. Preferably, the processor can integrate an application processor and a modem processor. The application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor.
[0098] The CPU 104 can selectively include an arithmetic unit and a controller, which are core components of the system chip 103, and are used to obtain instructions and process data. Specifically, the CPU 104 can be used to control the execution order of instructions, operation control, time control, and arithmetic and logical operations on data, or other information processing, etc.
[0099] (4) Memory device 107
[0100] The memory device can include an embedded Multi Media Card (eMMC), a universal flash storage (UFS), a Double Data Rate (DDR) synchronous dynamic random access memory, etc. Specifically, the eMMC or UFS includes a memory array, a replay protected memory block (RPMB), where the RPMB is a special partition of the eMMC, and mainly stores some core sensitive data.
[0101] The memory device 107 can also include software programs and modules that are used to operate the terminal device, and the processor, such as the CPU 104, executes various functions and data processing of the terminal device by running the software programs and modules stored in the memory device. The memory device also includes a program storage area and a data storage area, such as a read-only memory (ROM), a random access memory (RAM), etc. in the chip system 100. The program storage area can store an operating system, at least one application program required for a function (such as a sound playing function, an image playing function, etc.), etc.; and the data storage area can store data created according to the use of the terminal device (such as audio data, a phone book, etc.), etc. In addition, the memory device can also include a high-speed random access memory, and can also include a non-volatile memory (NVM), such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
[0102] (5) Secure flash chip 109
[0103] The secure flash chip 109 is a secure storage chip with an initial key binding relationship with the SE 105, which can realize secure storage of data, but the storage space is generally small, such as tens of KB to hundreds of KB. Optionally, in the chip system 100, a dedicated secure flash chip can be used, or an independent SE chip can also assume the function of the secure flash chip, or the secure flash can be integrated inside the SE 105. Among them, the logic cost of the dedicated secure flash chip is lower than that of the independent SE chip.
[0104] (6) Other input devices
[0105] The other input devices can be used to receive input digital or character information, and generate key signal inputs related to the user settings and function control of the terminal device.
[0106] In addition to the various modules listed above, the chip system 100 can also include other shown or not shown units or modules, such as encryption / decryption logic circuitry, etc. For example, the system chip can include radio frequency (RF) circuitry for receiving and transmitting signals during information transmission or communication. Generally, the RF circuitry includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF circuitry can also communicate with other devices such as network devices through wireless communication, which can use any communication standard or protocol, including but not limited to wireless local area networks (WLAN), global system of mobile communication (GSM) system, code division multiple access (CDMA) system, wideband code division multiple access (WCDMA) system, general packet radio service (GPRS), long term evolution (LTE) system, LTE frequency division duplex (FDD) system, LTE time division duplex (TDD), universal mobile telecommunication system (UMTS), worldwide interoperability for microwave access (WiMAX) communication system, future 5th generation (5G) system or new radio (NR), etc.
[0107] For another example, the chip system 100 can also include a near filed communication (NFC) controller, which can be a chip that combines the functions of an inductive reader, an inductive card and a point-to-point on a single chip basis, and can identify and exchange data with compatible devices within a short distance. The NFC chip has the ability to communicate with each other and has computing power, and can also include encryption logic circuitry, encryption / decryption modules, etc.
[0108] For example, the chip system 100 may also include a multimedia card (MMC) controller, a double data rate controller (DDRC), etc., which integrate the storage unit and the controller on the system chip 103, and will not be described in detail here.
[0109] In the chip system 100, SE 105 is a security element built into the electronic device, which enhances the security level of the electronic device. For example, SE 105 can be a security module integrated into the main chip SOC 103 of a mobile phone. SE 105 internally includes a CPU 106, memory devices, interface devices, etc. This system chip 103, in which SE 105 is built into the SOC 103 of the terminal device, can be called an inSE system, which enhances the security level of the mobile phone. Specifically, for example, during password storage, SE 105 can manage or distribute key factors to provide security protection for the user's private data or information. During data backup, SE 105 can create a security domain. Data in the security domain can be encrypted before being uploaded to the application layer for backup, increasing the security of the data during the backup process. During mobile payments, the SE 105 can rely on a trusted service manager (TSM) platform, which can be used by a mobile network operator or financial institution. This platform can provide users with a way to remotely issue various industry smart cards and manage partnerships. Specifically, the SE 105 can receive management from the TSM and discover and download various card applications such as bank cards, access cards, public transport cards, membership cards, and coupons through electronic devices. Users can then make payments anytime, anywhere by swiping their mobile phones and enjoy secure and convenient mobile payment services.
[0110] It should be understood that in the inSE system architecture, the central processing unit (CPU) 104 of the SOC 103 controls the SE 105, specifically including controlling the SE 105's on / off state, power consumption, and operating status. Furthermore, the CPU 104, as the core of the system chip 103, can control other components of the system chip 103; this embodiment is not limited to this. The security element SE 105 is typically provided embedded within the SOC 103, can run smart card applications, and can prevent external malicious parsing attacks, protecting data security.
[0111] like Figure 1 As shown, the SE 105 can have a complete CPU, ROM, RAM, etc. The internal structure of the SE 105 is briefly described below. Figure 1As shown, SE 105, as an element, also includes most of the elements or structures similar to SOC 103 described above. For example, SOC 103 can include the following components.
[0112] (1) Central processing unit (CPU) 106
[0113] Various interfaces and lines are used to connect the various parts within or outside the system chip, and various functions and data processing operations are performed by running or executing software programs and / or modules stored in the memory and calling data stored in the memory. Optionally, CPU 106 can include one or more processing units.
[0114] CPU 106, which can optionally include an arithmetic unit and a controller, is the core component of SE 105 and is used to obtain instructions and process data. Specifically, it can be used to control the order of instruction execution, operation control, time control, and arithmetic and logical operations on data, or to process other information.
[0115] In the chip system 100, the CPU 106 of the security element SE can be communicatively connected to the CPU 104 of the system chip SOC 103, and the central processing unit CPU 104 of the system chip SOC 103 can control the security element SE 105, including controlling the opening, closing, power consumption or working state of the SE 105, etc.
[0116] (2) Memory device
[0117] The memory device can be used to store data, software programs and modules, and the CPU 106 can execute the software programs and modules stored in the memory device to perform various functions and data processing. The memory device also includes a program storage area and a data storage area, such as the ROM, RAM, etc. shown in SE 105. In addition, SE 105 also includes an one-time programmable (OTP) memory.
[0118] (3) General purpose input / output (GPIO) interface
[0119] The GPIO interface can be used for input, output or other special functions. The GPIO interface can be connected to one or more registers, and a high or low voltage can be output by writing to a certain register. The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect other components of the device, such as a processor, a wireless communication module, an audio module, a sensor module, etc. The GPIO interface can also be configured as an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a universal asynchronous receiver / transmitter (UART) interface, or a mobile industry processor interface (MIPI), etc., which will not be described here.
[0120] (4) Crypto IP encapsulation (CIPE)
[0121] CIPE uses encrypted IP packets. CIPE packets are given target header information and encrypted using the default CIPE encryption mechanism.
[0122] (5) True random number generator (TRNG)
[0123] A random number generator is a device that generates random numbers through a physical process rather than a computer program.
[0124] According to the above introduction, the SE 105 can have a CPU, RAM, ROM, OTP, and a cryptographic algorithm engine (Crypto IP). In addition, the SE 105 interfaces with external devices through a GPIO interface and an inter-integrated circuit (I2C) or serial peripheral interface (SPI). The SE 105 and the main CPU 104 communicate through a shared RAM. The OTP stores the keys of the SE, such as the HUK and other keys.
[0125] The above briefly introduces the composition of the inSE chip system 100 and the communication between the parts. The inSE chip system security solution can integrate the SE 105 into the main chip 103, and can better prevent attacks from the physical layer, with higher security.
[0126] Figure 2 This is a schematic diagram of an electronic device's system architecture. Taking a mobile phone as an example, the system architecture of a mobile phone can be divided into several layers, each with a clear role and division of labor, and the layers communicate with each other through software interfaces. Figure 2 As shown, the mobile phone's system architecture 200 may include the Android system layer 10, a trusted execution environment (TEE) 20, a chip SOC 30, an SE 40 and a secure operating environment 70 for the SE, sensors 50, storage devices 80, etc. Below is a brief introduction to the components, modules, and concepts involved in this system architecture.
[0127] 1. Android system layer 10
[0128] Android system layer 10 provides a rich execution environment (REE) for electronic devices, which is the runtime environment and various services provided for the various applications on the electronic device, such as... Figure 2 As shown, Android system layer 10 can provide electronic devices with screen lock services, file encryption services, and the ability to run third-party applications.
[0129] For the current Hardware Abstraction Layer (HAL), Android can be considered to have defined the HAL layer structure framework, accessing hardware through several interfaces, thereby unifying the calling method. For example... Figure 2 The password verification service, key management and computation service (keymaster HAL), screen lock service, third-party applications, and other security services listed are all accessed by Android system layer 10 through several interfaces, thus unifying the calling method. It should be understood that Android system layer 10 can provide application-layer encryption protection for electronic devices, but its security level is relatively low.
[0130] In some embodiments, the Android system layer 10 can be divided into four layers from top to bottom, which are application layer, application framework layer, Android runtime and system library, and kernel layer. The application layer can include a series of application packages, such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, and short message, etc. The application framework layer provides application programming interface (API) and programming framework for the application of the application layer, and in addition, the application framework layer can include some predefined functions. The system library can include a plurality of functional modules, and the Android runtime is responsible for the scheduling and management of the Android system. The kernel layer is the layer between hardware and software, and the kernel layer at least contains display driver, camera driver, audio driver, and sensor driver, which will not be described here.
[0131] 2. Trusted Execution Environment TEE 20
[0132] TEE is a concept proposed by global platform (GP). The TEE is a running environment coexisting with the Android system layer or rich operating system (rich OS) on the device, and provides security services for the Android system layer or rich OS. The TEE has its own execution space, and has a higher security level than the Android system layer or rich OS.
[0133] The TEE is a framework running in an electronic device, which provides security between the Android system layer and SOC. For example, for some small payments, enterprise virtual private network (VPN), etc., the required security protection strength is not high, and it cannot be directly placed in the Android system layer to prevent being attacked due to the openness of the Android system layer. Therefore, for such applications, the TEE can be used to provide security protection.
[0134] In addition, the TEE provides a secure execution environment for trusted application (TA), and also protects the confidentiality, integrity and access permission of the resources and data of the TA. In the TEE, each TA is independent of each other, and cannot access each other without authorization.
[0135] As Figure 2As shown in FIG. 1, the TEE 20 can provide application programming interfaces (APIs) for various services of the electronic device, and the various applications of the Android system layer 10 can cause the operating system to execute the commands of the applications by calling the APIs of the TEE 20. For example, the TEE 20 can provide key management and calculation service APIs, gatekeeper APIs, biometric authentication service APIs, anti-rollback service APIs, and root of trust APIs, and can also include services such as high-bandwidth digital content protection (HDCP), digital rights management (DRM), and a microkernel system provided for the electronic device, which are not limited in the present application.
[0136] The gatekeeper mainly provides a pin check function for a user personal identification number (pin), and provides a check function for an input pin code to check whether the password at the time of registration is correct. If correct, the electronic device is allowed to boot up, and the keymaster service and other services are enabled. In addition, the gatekeeper service can implement the keymaster in the TEE as a key storage service for various applications of Android, and provide key generation, storage, and encryption and decryption functions to ensure that the key does not appear in the Android memory, but in the TEE. If the gatekeeper fails to check the pin code, other security services will not be opened, and if the keymaster service is not enabled, the key will not be generated, and no user data of the entire mobile phone can be decrypted.
[0137] The biometric authentication service is to identify the personal identity by using the physiological characteristics and behavior characteristics inherent in the human body, such as physiological characteristics of fingerprint information or facial feature information, or user behavior characteristics such as sliding, voice, or gait. The biometric authentication module of the TEE can also encrypt and store the fingerprint information, facial feature information, and user behavior characteristic information used to identify the personal identity.
[0138] In the specific process of HDCP operation, both the sending end and the receiving end store a set of available keys, and the keys are stored secretly, and both the sending end and the receiving end perform encryption and decryption operations according to the keys. DRM is used for multimedia protection, such as encrypted movies, music, audio and video, streaming files. The TEE can provide encryption protection for HDCP / DRM.
[0139] 3、SOC 30
[0140] The system chip SOC 30 includes the SE 40, a UFS storage controller, an ARM trustzone, and the like. The UFS storage controller is a form of the memory device 80 of the electronic device, which can be referred to the related description in Figure 1 , and will not be described herein.
[0141] As shown in Figure 2 , the SOC 30 can include an Advanced RISC Machine (ARM) processor and an ARM trustzone. It should be understood that the ARM processor can correspond to the CPU 104 of the SOC 30 described in Figure 1 , and the running environment provided by the ARM can be referred to as an ARM trustzone, which corresponds to the TEE and is used to run a plurality of programs. It should also be understood that the SOC 30 can also include other modules or components that are not shown, such as the constituent modules or components of the system chip 103 described in Figure 1 , which will not be described herein.
[0142] It should also be understood that the built-in security element (refer to the SE 105 described in Figure 1 ) in the SOC 30 is referred to as the SE 40, which can provide a secure running environment 70, also referred to as the "SE software running environment", which is used to run a plurality of programs to implement various functions of the SE. The secure running environment can provide a secure operating system (operating system, OS) for providing an application access interface, scheduling and loading individual applications or functions, which will not be described herein. In addition, the secure running environment can also provide a board support package (board support package, BSP) to support the running of the OS, which is used to load the operating system and schedule the instructions issued by the operating system to the hardware, which will not be described herein.
[0143] 4、Sensor 50, memory device 80 and other peripheral components
[0144] In addition, for example Figure 2As shown, the system architecture 200 also includes various peripheral components such as sensors 50 and storage devices 80, including fingerprint sensors and cameras. The fingerprint sensor is used to collect fingerprints. Electronic devices can utilize the fingerprint characteristics collected by the fingerprint sensor to achieve fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc. The camera is used to capture still images or videos. An object generates an optical image through the lens and projects it onto a photosensitive element. The photosensitive element converts the light signal into an electrical signal, which is then transmitted to an image signal processor (ISP) to be converted into a digital image signal. The ISP outputs the digital image signal to a DSP for processing, and the DSP converts the digital image signal into a standard image signal. The ISP and DSP can be built into a System-on-a-Chip (SoC). The sensor 50 may also include pressure sensors, gyroscopes, accelerometers, distance sensors, proximity sensors, temperature sensors, ambient light sensors, bone conduction sensors, etc., which are not limited in this application. The storage device 80 can correspond to... Figure 1 The storage devices 107 described herein, such as eMMC or UFS memory, will not be elaborated upon here.
[0145] The above describes the components related to the 200 chip architecture and the implementation environment for improving security levels in electronic devices. In the current 200 chip architecture, services such as PIN code verification, biometric authentication, and data protection in electronic devices are based on the ARM trusted area provided by the processor. The corresponding software can be implemented in the TEE 20. It should be understood that the ARM trusted area and TEE, despite years of development, still lack sufficient hardware security to reach the level of security protection offered by secure chips. Software vulnerabilities also exist, and it is difficult to prove that a high level of security has been achieved. The current level is only EAL2+, meeting the internationally accepted common criteria (CC) certification level, while financial-grade security chips can achieve EAL5+ and EAL6+ security certification levels. Therefore, improving the security level of system security services, such as achieving a high level of security, is a pressing issue that needs to be addressed during the use of electronic devices.
[0146] Figure 3 This is a schematic diagram of an example system architecture provided in this application, such as... Figure 3 As shown, the system architecture 300 may include an Android system layer 10, a trusted execution environment (TEE) 20, a SOC 30, an SE 40, a secure operating environment 70 for the SE, storage devices 80, sensors 50, and a secure flash chip 60, etc. Among these, the Android system layer 10, TEE 20, the secure operating environment 70 for the SE, storage devices 80, sensors 50, etc., can be referenced... Figure 2The detailed description of the corresponding related introduction will not be repeated here. In addition, the SOC 30 of the system architecture 300 provided by the present application includes a built-in secure element SE 40, which is coupled with the central processor of the SOC 30 and is controlled by the central processor. The secure operating environment 70 of the SE 40 can provide a plurality of security services of the present application by running programs.
[0147] It should be understood that Figure 3 The "high-security storage service", "biometric authentication password service", "trusted root service", "anti-rollback service", "key management and calculation service" and "password verification service" provided in the secure operating environment 70 of the SE listed in the above can correspond to different program codes or functional modules. By running the program code or functional module in the secure operating environment 70 of the SE, the corresponding security service is realized, and the present application does not limit this.
[0148] In addition, the system architecture 300 further includes a dedicated secure memory (secure flash) 60. Optionally, in the present application, a dedicated secure flash chip can be used, or a separate SE chip can also assume the function of the secure flash chip, or the secure flash can be integrated into the SE 105. The present application does not limit this.
[0149] In the present application, the UFS memory is referred to as the first memory, and the secure flash 60 is referred to as the second memory.
[0150] It should be understood that the first memory and the second memory are different memories outside the system chip SOC 30. Optionally, the first memory can be understood as a shared memory of the SE 40 and the central processor, and the second memory is a dedicated memory of the secure element SE 40.
[0151] Specifically, the first memory can be a memory commonly used by the mobile phone. For example, the size of the current mobile phone memory is generally 64GB, 132GB, etc., and there is a relatively large storage space. The first memory involved in the embodiments of the present application is 4MB or 16MB space in 64GB or 132GB. The capacity of such first memory has basically no cost impact on the current relatively large mobile phone intrinsic storage. Even if in the future, the capacity of the first memory needs to be increased due to the growth of user demand, it will not affect the cost of the mobile phone. The second memory is a special secure memory, which can realize safe storage of data, but the storage space is generally very small, about several tens of KB to several hundred KB. Specifically, it can be a special secure storage secure flash authenticated externally. One possible case is that the secure flash is placed inside the SE 40 and belongs to the security authentication range, or the secure flash belongs to the device outside the SE 40.
[0152] In the data processing process provided by the present application, the system architecture can include part or all of the components and modules described above, which are not limited by the present application. In the present application, at least one of the biological authentication password service, the password verification service, the key management and calculation service, the trusted root service, the anti-rollback service and the high-security storage service will be implemented in the SE 40 included in the system chip SOC 30, and in combination with the memory devices such as secure flash and UFS memory, a data processing method is provided to improve the security level of the system security service. The following will be described in detail in combination with the system architecture 300 and the related drawings.
[0153] Figure 4 The method 400 shown in FIG. 4 is a schematic diagram of a data processing method provided by the embodiments of the present application. The method 400 shows the specific process of data storage, which is applied to the system architecture 300 described above, including the Android system layer 10, the TEE 20, the SOC 30, the SE 40, the memory device 80 and the secure flash 60, the peripheral components such as the sensor 50. The method 400 includes the following contents. S410, the secure element obtains a first security service request from the application programming interface API of the TEE. Specifically, according to the system architecture 300 introduced in the foregoing Figure 3 As can be known from the system architecture 300 introduced in the foregoing, the SOC 30 can provide the trusted execution environment TEE 20, and obtain the first security service request through the API interface of the TEE 20.
[0154] Optionally, the first security service includes at least one of a biometric authentication password service, a password verification service, a key management and calculation service, a trusted root service, an anti-rollback service, or a high-security storage service. In the present application, the above-mentioned security services can be referred to as "multiple security services", in other words, the first security service can refer to any one or more of the multiple security services. Accordingly, the first security service request is used to request any one or more of the biometric authentication password service, the password verification service, the key management and calculation service, the trusted root service, the anti-rollback service, and the high-security storage service.
[0155] It should be understood that the SOC 30 acquires the first security service request, which can be received by the user's operation, and executes the first security service in response to the user's operation. For example, the first security service request can be generated by the system according to the user's operation. For example, for the biometric authentication password service, when the user needs to unlock the phone, in the case of lighting or not lighting the smart terminal screen, when the user inputs the fingerprint verification information, the face feature information or other biometric verification information, the Android system layer 10 calls the interface corresponding to the biometric authentication password service (such as the password verification service HAL) according to the biometric authentication operation initiated by the user, so that the Android system layer 10 transmits the user's operation to the SOC 30. The SOC 30 determines the biometric authentication password service currently started according to the user's fingerprint information obtained by the fingerprint sensor, thereby generating an instruction to start the biometric authentication password service, and transmitting the biometric authentication password service instruction to the SE 40 through the biometric authentication API of the TEE 20. The SE 40 further calls the biometric authentication API of the TEE 20, thereby generating a biometric authentication password service request to start the biometric authentication password service.
[0156] S420, the security element acquires the first security service request, and executes the first security service to obtain security data in response to the first security service request. S430, the security element determines that when the security data includes first security data, the first security data is stored to the first storage outside the data processing device, and when the security data includes second security data, the second security data is stored to the second storage outside the data processing device, wherein the first security data includes recoverable data, and the second security data includes non-recoverable data.
[0157] It should be understood that when the SE 40 acquires the first security service request, i.e., determines the first security service to be currently executed, further data to be stored in the process of executing the service is determined according to the first security service. The data can only include one type of data, such as the first security data or the second security data; or the data can include both the first security data and the second security data. The data to be stored is determined by the type of the service, so the SE 40 determines which type of data the service corresponds to according to the service request.
[0158] For example, when the first security service request is used to request the execution of the biometric authentication password service, the SE 40 determines that the first security data is the biometric template information (such as fingerprint verification information, face feature information, or other biometric verification information) input by the user, and the second security data is the key for encrypting the biometric template and the information for integrity checking of the biometric template. When the first security service request is used to request the execution of the high-security storage service, the SE 40 determines that only the first security data is currently included, which can be high-security level data required by the user to save to the SE 40.
[0159] It should be understood that in the related introduction of Figure 3 In the embodiments of the present application, the first memory can be a general memory of the mobile phone, and the second memory is a special secure memory. In the embodiments of the present application, the UFS memory is taken as the first memory, and the secure flash 60 is taken as the second memory as an example to introduce the implementation process of the security service, which is not limited in the present application.
[0160] Figure 5 is a schematic diagram of a data storage process provided by the embodiments of the present application, as shown in Figure 5 The SE 40 can control the data storage process of different security services. Specifically, the SE 40 can control the UFS storage controller and the secure flash 60, wherein the chip-level independent storage area RPMB is a special partition of the eMMC, which is used to store some core sensitive data. For example, the storage area RPMB of the UFS memory device can be used to store recoverable data, and the secure flash 60 can be used to store non-recoverable data related to the security services of the present application.
[0161] It should be understood that the "recoverable data" here can be data that is not afraid of being attacked or erased, or renewable data. For example, the storage area RPMB of the UFS storage device can include an SE system data area, a registered biometric template data area, etc. Among them, the SE system data area can be used to store chip system data, such as SE code, etc., which can be the same for each mobile phone and can be recovered even if it is erased; the registered biometric template data area can be used to store the user's registered biometric template, such as fingerprint information, face information, etc., which is not limited in the present application.
[0162] For example, when the storage area RPMB of the UFS storage device stores the user's registered preset fingerprint information, even if the preset fingerprint information is attacked or erased, the user can still re-register and save new fingerprint information, or the user can match through other ways such as digital password, face feature information verification, etc., which will not affect the use safety of the device, so such data is renewable data.
[0163] It should also be understood that the "non-recoverable data" here can be data that cannot be attacked or erased, or non-renewable data, which in the present application can be data related to multiple security services. For example, the secure flash 60 can include an anti-rollback data area (64KB), a key storage area (32KB), an application data area (64KB), a high-security data storage area (64KB), etc. Specifically, the anti-rollback data area (64KB) is used to store anti-rollback data, the key storage area (32KB) is used to store private keys, certificates, etc., the application data area (64KB) is used to store root keys unique to each device, etc., and the high-security data storage area (64KB) is used to store user anti-theft identification information, account balance information, etc. If such non-recoverable data is attacked or erased, it can cause the device to become a development board, or user data to be leaked, affecting the use safety of the device.
[0164] The above introduces the types of data stored by the first memory and the second memory, and the following introduces the data storage and use process for the multiple security services involved in the present application. Figure 5 The types of data stored by the first memory and the second memory are introduced above, and the following introduces the data storage and use process for the multiple security services involved in the present application.
[0165] 1. Password verification service or key management and calculation service
[0166] Figure 6 is a data processing schematic diagram of the password verification service process provided by the embodiments of the present application, as shown in Figure 6 The SE 40 can provide a password verification service, and the main logic of the password verification service is the management and calculation of application keys (keys) and the password authentication process.
[0167] With the file encryption storage process of the device as an example, the file encryption service is started by the user's setting operation, and the file encryption password (for example, a digital password) set by the user is transmitted by the gatekeeper of the Android system layer 10 to the SE 40, the SE 40 encrypts the file encryption password set by the user by the first key, configures the ciphertext of the file encryption password set by the user to the UFS storage controller, and thus stores the ciphertext in the external UFS storage through the UFS controller, and stores the first key for encrypting the file encryption password set by the user to the secure flash 60. In addition, the SE 40 can calculate a hash-based message authentication code (HMAC) value, referred to as a first HMAC value, according to the encryption password set by the user. During the storage of the first key, the calculated first HMAC value is also stored in the secure flash 60.
[0168] Correspondingly, in the password verification process of the file decryption process, the digital password input by the user starts the file decryption service. The SE 40 calculates a second HMAC value according to the digital password currently input by the user, and the SE 40 obtains the previously registered and stored first HMAC value from the secure flash 60, and compares whether the first HMAC value and the second HMAC value are the same. It should be understood that the HMAC value can be used for integrity verification, for example, when the password verification service module of the SE 40 determines that the first HMAC value and the second HMAC value are the same, it is determined that the ciphertext of the file encryption password set by the user stored in the external UFS storage is complete.
[0169] When the password verification service module of the SE 40 determines that the first HMAC value and the second HMAC value are the same, the SE 40 obtains the previously stored first key from the secure flash 60, and configures the first key to the UFS storage controller, so that the ciphertext of the encrypted file encryption password set by the user stored in the external UFS storage can be obtained through the UFS controller. Because the UFS controller has the correct first key, it can decrypt the data read from the UFS storage, so as to know the file encryption password (for example, a digital password) set by the user.
[0170] When the password authentication is passed, the SE 40 can output the file encryption password (for example, a digital password) set by the related user to the password verification API of the TEE, and call the application of the Android system layer through the password verification API, and further decrypt the file and the like. The above technical solution can support the file encryption, password matching and verification functions of the SE, support the system security service of the mobile phone and the like, and improve the security level.
[0171] 2. Biometric authentication password service
[0172] Figure 7 is a data processing schematic diagram of a biometric authentication password service process provided by an embodiment of the present application, as shown in Figure 7 The SE 40 can provide a biometric authentication password service.
[0173] Taking the lock screen and unlock process of a device as an example, the lock screen service is started by a user's setting operation, the lock screen password (for example, the fingerprint information and face information entered by the user during registration are taken as the lock screen password) is passed to the SE 40 by the gatekeeper service module of the Android system layer 10, the lock screen password entered by the user during registration is encrypted by the SE 40 through the second key, the ciphertext of the encrypted lock screen password entered by the user during registration is configured into the UFS storage controller, and thus the encrypted lock screen password is stored in the external UFS storage through the UFS controller, and the second key of the encrypted lock screen password is stored in the secure flash 60. In addition, the SE 40 can calculate a first HMAC value according to the lock screen password entered by the user during registration, and the calculated first HMAC value is also stored in the secure flash 60 during the storage process of the first key.
[0174] Correspondingly, in the unlock verification process, the unlock service is started by the user's current input of the unlock password (for example, the fingerprint information and face information are taken as the unlock password). Taking the fingerprint unlocking as an example, when the user contacts the fingerprint sensor to input the fingerprint information, the biometric authentication TA of the TEE 20 extracts the features of the currently collected fingerprint, and the extracted fingerprint information is sent to the SE 40. The SE 40 calculates a second HMAC value according to the current input of the fingerprint information by the user, and the SE 40 obtains the previously registered and stored first HMAC value from the secure flash 60, and compares whether the first HMAC value and the second HMAC value are the same. It should be understood that the HMAC value can be used for integrity verification or the lock screen password has not been tampered with, etc., for example, when the password verification service module of the SE 40 determines that the first HMAC value and the second HMAC value are the same, it is determined that the ciphertext of the lock screen password entered by the user during registration and stored in the external UFS storage is complete.
[0175] When the biometric template matching module of the SE 40 determines that the first HMAC value and the second HMAC value are the same, the SE 40 obtains the previously stored second key from the secure flash 60, and obtains the ciphertext of the lock screen password entered by the user during registration and previously stored from the external UFS storage through the UFS controller. The SE 40 decrypts the ciphertext of the lock screen password entered by the user during registration into the internal RAM according to the second key. The SE 40 further compares and matches the current input of the fingerprint information and the fingerprint information in the decrypted lock screen password entered by the user during registration, and if the matching is successful, the device is unlocked.
[0176] For example, when the user inputs the fingerprint information and registers it as a lock screen password, the process of unlocking by the user can specifically include the following steps: S701, after the user starts the unlocking service, the sensor 50 (for example, a fingerprint collection sensor) acquires the fingerprint information of the user; S702, the biometric authentication TA of the TEE 20 performs feature extraction on the currently collected fingerprint, and transmits the acquired fingerprint information of the current input of the user to the SE 40 via an API; S703, the biometric template matching module of the SE 40 acquires the fingerprint information input by the user; S704, the SE 40 acquires the encrypted second key of the lock screen password registered at that time and the corresponding first HMAC value from the secure flash 60; S705, the SE 40 acquires the stored ciphertext data of the registered lock screen password from the external UFS memory through the UFS controller; S706, the SE 40 calculates the second HMAC value according to the fingerprint information input by the user at the current time, and at the same time, the SE 40 acquires the previously registered and stored first HMAC value from the secure flash 60, and compares whether the first HMAC value and the second HMAC value are the same. When the biometric template matching module of the SE 40 determines that the first HMAC value and the second HMAC value are the same, the SE 40 acquires the previously stored second key from the secure flash 60, and acquires the ciphertext of the lock screen password input by the user at the time of registration from the external UFS memory through the UFS controller. The SE 40 decrypts the ciphertext of the lock screen password input by the user at the time of registration into the internal RAM according to the second key. The SE 40 further compares and matches the fingerprint information input at the current time and the fingerprint information in the decrypted lock screen password input by the user at the time of registration. When the SE 40 determines that the matching is successful, the device is unlocked.
[0177] It should be understood that the biometric template ciphertext can be saved in the RPMB of the UFS memory, but the second key for encrypting the biometric template is stored in the secure flash 60. In the decryption process, the SE 40 decrypts the biometric template ciphertext at the time of registration into the internal RAM of the SE 40. When the system is locked and hibernated, the UFS storage controller is powered off, and if the second key is stored in the UFS memory, the loss of the second key will occur. The present embodiment can avoid the loss from occurring.
[0178] It should also be understood that when a user unlocks the device with their fingerprint or face, the biometric authentication TA in TEE 20 extracts features from the captured image, and the extracted features are sent to SE 40. SE 40 matches and verifies the extracted features against the template used during user registration. If the verification passes, it returns a successful verification result to Android system layer 10, which is then invoked by the lock screen application in the Android system layer to successfully unlock the system. It should also be understood that the use of "first key" and "second key" in this application is merely a descriptive distinction. In the aforementioned description of the password verification service or key management and calculation service, the first key is used to encrypt the file encryption password set by the user. In the description of the biometric authentication password service, the second key is used to encrypt the lock screen password entered by the user during registration. The first key and the second key can be the same or different. For example, for each security service, a key for different services can be calculated based on the key management and calculation service provided by SE 40. The calculation methods can be the same or different, and this application does not limit this.
[0179] The above technical solutions can integrate biometric authentication functions into SE, supporting security verification and unlocking services for mobile phones and other devices, thereby improving the security of device use.
[0180] 3. Root of Trust service
[0181] In this application, the root of trust service can be provided by the SE (Software Provider), such as by pre-installing device certificates and keys. In the future, it can establish a secure channel with the corresponding cloud service, thereby ensuring reliable communication between the trusted root server and the cloud server, and guaranteeing the privacy, integrity, and non-repudiation of messages. Specifically, the certificates and private keys of the original equipment manufacturer (OEM) or cloud operator are pre-installed in the production process. For example, the secure boot function in the root of trust service can provide integrity protection, ensuring that the device boots in a secure state. It can also protect confidentiality and prevent cloning through strong encryption technology. During communication through a secure channel with the cloud server, based on the pre-installed certificates and private keys, the system can implement various security functions, such as protecting and controlling the use of stored encryption keys, accelerating encryption to improve the performance of secure operations, or restricting access by authorized entities. The pre-installed certificates and private keys can be stored in the SE to ensure their security.
[0182] 4. Rollback prevention service
[0183] SE can also provide rollback protection services for applications. For example, for the rollback protection service, the rollback value is stored in secure flash 60. It should be understood that, in this application, according to Figure 5As introduced above, the secure flash 60 as the second memory is divided into multiple regions, each of which corresponds to a different security service type. When the SE 40 stores the second security data to the second memory outside the data processing device, the second security data corresponding to each security service type is stored to the region corresponding to the security service.
[0184] For the rollback prevention service, the rollback prevention data region (64 KB) in the secure flash 60 can be further divided as shown in Figure 5 Figure 8 Figure 8 is a schematic diagram of the division of the rollback prevention data region provided by an embodiment of the present application. As shown in Figure 8
[0185] Optionally, the region for the rollback prevention service further includes a first sub-region and a second sub-region; and when the rollback prevention service is executed, the SE 40 determines that the second security data includes an identification of the rollback prevention service and a count value, the count value being used to determine the number of hardware attacks, stores the identification of the rollback prevention service to the first sub-region, and stores the count value to the second sub-region.
[0186] For example, each application has a different application identification (4 bytes or 8 bytes), and each application has a 4-byte counter value (monotonic counter). As shown in Figure 8
[0187] For example, the application mode of the anti-rollback service is introduced by taking the user fingerprint registration process as an example. For the fingerprint registration corresponding to the first ID, the security counter of the first ID is called to record the number of times of user fingerprint registration. The user registers the first fingerprint as the unlocking fingerprint for the first time, and re-enters the second fingerprint as the unlocking fingerprint for the second time. The security counter value of the first ID is incremented by 1. In this way, each time the user re-registers and enters a fingerprint, the security counter value of the first ID is incremented by 1 based on the previous counter value. The anti-rollback service in this process can ensure that the counter value records the number of times of user re-registration and entry of the fingerprint, and ensures that the first fingerprint and the second fingerprint cannot be used for unlocking when the counter value is 3, and ensures that the current unlocking fingerprint is the third fingerprint corresponding to the counter value 3.
[0188] It should be understood that the counter value of the counter is monotonically increasing and cannot be tampered with or reset, and therefore the counter can be understood as a secure counter applied to multiple applications, preventing attacks and preventing the application from being rolled back or data rollback during use. It should also be understood that the anti-rollback service can correspond to multiple different applications, and the anti-rollback service of the SE 40 can be called in combination with different scenarios of the device during use to ensure normal and secure use of the application.
[0189] 5. High-security storage service
[0190] For the high-security storage service, the data of the high-security storage service is stored in the secure flash, which can prevent attacks or data erasure. In this application, according to the introduction of Figure 5 , the secure flash 60 as the second memory is divided into multiple regions, and the regions in the multiple regions include regions corresponding to the high-security storage service.
[0191] For the high-security storage service, the high-security data area (64 KB) in the secure flash 60 in Figure 5 may be further divided as shown in Figure 9 . Figure 9 is a schematic diagram of the division of the high-security storage data area provided by an embodiment of the present application. One management mode of the high-security storage data area is as shown in Figure 9As shown, the high-security storage service area further includes a first sub-area, a second sub-area and a third sub-area, and when the high-security storage service is executed, the SE 40 can determine that the second security data includes identification information of a data segment of the high-security storage service, length information of the data segment of the high-security storage service, and content of the data segment of the high-security storage service; store the identification information of the data segment of the high-security storage service to the first sub-area, store the length information of the data segment of the high-security storage service to the second sub-area, and store the content of the data segment of the high-security storage service to the third sub-area. Optionally, the first sub-area can include 4 bytes of identification information for storing each data segment, the second sub-area can include 2 bytes of data length information for storing, and the third sub-area can be used for storing valid data storage area. When an application obtains its own data, the identification information and length information of the data segment are input, and the high-security data service transmits the valid data to the TA of the TEE and then to the application, thereby preventing hardware attacks. For example, the process of storing the anti-theft identification of a mobile phone is introduced to illustrate the process of the high-security storage service. For the anti-theft application, the ID of the anti-theft identification, the length of the anti-theft identification, and the anti-theft identification data are stored in the aforementioned sub-area, for example, "0X55a", wherein "0X" is the ID of the anti-theft identification, the length is 55, and the anti-theft identification is "a". When the user's mobile phone is lost, the anti-theft identification is transmitted to the server of the mobile phone equipment manufacturer, so that the mobile phone is in an unusable state. When the mobile phone is found, the data in the high-security data storage area is modified, for example, from "0X55a" to "0X550", which means that the mobile phone ends the stolen or lost state and can be used normally. Alternatively, for example, the user's XX bank balance, bus card balance and other information are also stored in the high-security data storage area, which ensures that the data cannot be obtained or tampered with, thereby improving the security level.
[0192] It should be understood that the above introduces the data area management mode of the high-security storage service and the anti-rollback service as an example and not as a limitation, and there are other possible data area management modes, and the present application does not limit the management mode of the data area of different services.
[0193] In summary, the above introduces the data processing process of different security services, and the storage process corresponding to the data, and the data reading in the different security service processes to execute the security service process. Figure 10is another example of a method for processing data provided by the embodiments of the present application. The method 1000 shows the specific process of data acquisition, which is applied to the system architecture 300 described above, including the Android system layer 10, the TEE 20, the SOC 30, the SE 40, the secure operating environment 70 of the SE, the storage device 80 and the secure flash 60, the sensor 50 and other peripheral components. The method 1000 includes the following.
[0194] S1010, the secure element acquires a first security service request, and the first security service request is used to request a first security service. It should be understood that the first security service can include at least one of a biometric authentication password service, a password verification service, a key management and calculation service, a trusted root service, an anti-rollback service, and a high-security storage service. In the present application, it can be referred to as "multiple security services", in other words, the first security service can refer to at least one service in the multiple security services. Accordingly, the first security service request is used to request at least one service of the biometric authentication password service, the key management and calculation service, the trusted root service, the anti-rollback service, and the high-security storage service.
[0195] S1020, when the security data required by the first security service includes first security data, the secure element acquires the first security data from the first memory; when the security data required by the first security service includes second security data, the secure element acquires the second security data from the second memory. It should be understood that the first security data includes the recoverable data of the chip system, and the second security data includes the non-recoverable data related to the first security service.
[0196] S1030, the secure element executes the first security service according to the security data. Wherein, the first memory and the second memory are different memories outside the secure element. Optionally, the first memory can be a general memory of the mobile phone, and the second memory is a special secure memory.
[0197] In the introduction of Figures 4 to 9 , the processes of data storage and data acquisition and execution of different security services have been introduced respectively for different security services, which will not be repeated here Figure 10 the process of data acquisition and execution of different security services.
[0198] It should be understood that the multiple security services introduced above have no strict boundary division, and can be combined with each other for the use of a certain application by a user, and can also exist independently in a certain function of an application. The present application does not limit this. For example, for the user to use the fingerprint unlocking process, the SE 40 can execute the biometric authentication password service, the key management and calculation service, etc.; for the user to store the mobile phone anti-theft identification process, the SE 40 can execute the high-security storage service.
[0199] The above Figures 2 to 10 The method provided by the embodiments of the present application is described in detail from two aspects of data storage and data acquisition and execution of security services. Through the above method for writing and reading data provided by the present application, the architecture and process design of supporting the security services of a mobile phone system by integrating an SE into a SOC are first proposed, so that a high-security-level chip security system is applied to data protection of a mobile phone and other devices. Specifically, the SE is integrated to support functions such as a biometric authentication password service, a password verification service, a password matching and verification service, a file encryption service, a root of trust service, a high-security storage service, and an anti-rollback service, so that the security services can be implemented in the SE, certificates are saved, and the TEE TA is called. In addition, in different security services, a plurality of possible data area management modes of a secure flash are provided, a plurality of sub-areas are divided, and the sub-areas are used to store data of different security services. For example, for the anti-rollback service, anti-rollback data (4 bytes per application) are stored; critical keys and device certificates are saved; high-security data is saved; and data of a third-party application is saved. Through the SE combined with a security-level chip, the security level and user experience are improved.
[0200] Figure 11 is a schematic diagram of an example of a security element SE 40 provided by the embodiments of the present application, and the security element SE 40 can run a secure execution environment 70. As Figure 11 indicated, the security element can correspond to the SE 40 in Figure 3 , Figure 5 , Figure 6 , and Figure 7 . As Figure 11 indicated, the security element can include an acquisition module 1110 configured to acquire a first security service request, the first security service request being used to request a first security service; and a processing module 1120 configured to execute the first security service to obtain security data in response to the first security service request. When the security data includes first security data, the processing module 1120 is configured to store the first security data to a first memory, and when the security data includes second security data, the processing module 1120 is configured to store the second security data to a second memory, wherein the first security data includes recoverable data, the second security data includes non-recoverable data, and the first memory and the second memory are different memories.
[0201] It should be understood that the acquisition module 1110 and the processing module 1120 can be implemented in software, hardware, or a combination of software and hardware. When the two modules are implemented in software, the two modules can run on the CPU 106 of Figure 1 .
[0202] In a possible implementation, the first security service includes at least one of a biometric authentication password service, a password verification service, a key management and calculation service, a trusted root service, an anti-rollback service, or a high-security storage service. In a possible implementation, the second memory includes a plurality of areas, and the processing module 1120 is specifically configured to: store the second security data into an area corresponding to the first security service in the plurality of areas. In a possible implementation, the first security service includes an anti-rollback service, the security data includes the second security data, the second security data includes an identifier of the anti-rollback service and a count value, the count value is used to determine a number of times of hardware attacks, and the area corresponding to the anti-rollback service in the plurality of areas further includes a first sub-area and a second sub-area. The processing module 1120 is specifically configured to: store the identifier of the anti-rollback service into the first sub-area, and store the count value into the second sub-area.
[0203] In a possible implementation, the first security service includes a biometric authentication password service, the security data includes the first security data and the second security data, the first security data includes ciphertext, and the second security data includes a first key and a message authentication code (MAC) value. The processing module 1120 is configured to: obtain biometric information of a first user; encrypt the biometric information by using the first key to obtain the ciphertext; determine the MAC value according to the biometric information; and store the ciphertext into the first memory, and store the first key and the MAC value into an area corresponding to the biometric authentication password service in the plurality of areas.
[0204] In a possible implementation, the first security service includes a high-security storage service, the security data includes the second security data, the second security data includes identifier information of a data segment of the high-security storage service, length information of the data segment, and content of the data segment, and each area corresponding to the high-security storage service in the plurality of areas further includes a first sub-area, a second sub-area, and a third sub-area. The processing module 1120 is configured to: determine the identifier information, the length information, and the content of the data segment; store the identifier information into the first sub-area, store the length information into the second sub-area, and store the content into the third sub-area.
[0205] The above introduces functions or operations that can be performed by the secure element 40 in the data storage process. Specifically, the secure element 40 can perform the methods and steps introduced in the above Figure 4 . Accordingly, in the data acquisition and security service execution process, the secure element 40 can also perform the methods and steps introduced in the above Figure 10The method and the steps introduced in the foregoing embodiments can be implemented by using a computer directly or by using an instruction set. In this way, the instructions and the steps of the embodiments of the present application can be included in a storage medium, such as a computer disk, a compact disc, a compact disc-read-only memory (CD-ROM), a universal serial bus (USB) disk, a memory card, a read-only memory (ROM), a programmable read-only memory (PROM) or a hard disk drive (HDD), or an optical disk, or an electronic program guide (EPG). Therefore, the storage medium does not form part of the present application, but the computer storage medium including the program code constitutes the present application.
[0206] The processing module 1120 is configured to perform the first security service. In this case, the first security data includes recoverable data, and the second security data includes non-recoverable data. The first memory and the second memory are different memories. In one possible implementation, the first security service includes an anti-rollback service, and the security data includes the second security data. The second security data includes an identifier of the anti-rollback service and a count value used to determine a number of times of hardware attacks. The region corresponding to the anti-rollback service in the plurality of regions further includes a first sub-region and a second sub-region. The acquisition module 1110 is specifically configured to acquire the identifier of the anti-rollback service from the first sub-region, and acquire the count value from the second sub-region.
[0207] In one possible implementation, the first security service includes a biometric authentication password service, and the security data includes the first security data and the second security data. The first security data includes ciphertext, and the second security data includes a first key and a message authentication code (MAC) value. The processing module 1120 is specifically configured to decrypt the ciphertext according to the first key to obtain biometric information of a first user, verify integrity of the biometric information according to the MAC value to obtain a verification result, determine whether a to-be-verified user is the first user according to the biometric information and biometric information input by the to-be-verified user when the verification result is that the biometric information is complete, and perform biometric authentication verification when the to-be-verified user is the first user, or perform biometric authentication verification when the to-be-verified user is not the first user.
[0208] In one possible implementation, the first security service includes a high-security storage service, and the security data includes the second security data. The second security data includes identifier information of a data segment of the high-security storage service, length information of the data segment, and content of the data segment. The region corresponding to the high-security storage service in the plurality of regions further includes a first sub-region, a second sub-region, and a third sub-region. The acquisition module 1110 is specifically configured to acquire the identifier information from the first sub-region, acquire the length information from the second sub-region, and acquire the content of the data segment from the third sub-region.
[0209] It should be noted that all relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.
[0210] Figure 12 This is a schematic diagram illustrating the composition of a safety element 40 provided in an embodiment of this application, as shown below. Figure 12 As shown, this safety element can correspond to Figure 3 , Figure 5 , Figure 6 and Figure 7 SE 40 in, or corresponding to Figure 11 The security element 40 is described above. For example, the security element 40 may include a processor 1210 and an interface 1220. The interface 1220 is coupled to the processor 1210, which is used to implement the above-described security element 40. Figure 3 , Figure 5 , Figure 6 , Figure 7 or Figure 11 The functions of SE 40 include, for example, performing at least one of the following services: biometric authentication cryptography service, password verification service, key management and computation service, root of trust service, rollback prevention service, or high-security storage service, or performing other data processing procedures. For example, processor 1210 may correspond to... Figure 1 The CPU 106. Interface 1220 is used for communication between the secure element 40 and external systems, and may include, for example... Figure 1 The communication interface between the processor 1210 and the PMU chip 101, the secure flash chip 109, or the CPU 104. For example, the processor 1210 communicates with the CPU 104 through this interface 1220.
[0211] In one possible implementation, the security element 40 may further include a memory 1230. The memory 1230 is used to store necessary program instructions and data. In this application, the processor 1210, interface 1220, and memory 1230 cooperate with each other to execute computer instructions, causing the security element 40 to perform the data processing method provided in the embodiments of this application. For example, the memory 1230 may include... Figure 1 The RAM or ROM in it will not be discussed in detail here.
[0212] Figure 13 This is a schematic diagram of the composition of an example data processing device provided in an embodiment of this application, as shown below. Figure 13As shown, the data processing apparatus 1300 comprises a trusted execution environment (TEE) module 1310 and a secure operating environment module 1320 of a secure element (SE), the TEE module 1310 communicates with the secure operating environment module 1320 through an application programming interface (API), the TEE module 1310 is capable of obtaining a first security service request, sending the first security service request to the secure operating environment module 1320 through the API, the first security service request is used to request a first security service; the secure operating environment module 1320 executes the first security service in response to the first security service request.
[0213] It should be understood that the TEE module 1310 can correspond to the TEE 20 in Figure 3 , the secure operating environment module 1320 can correspond to the secure environment 70 in Figure 3 , which is not specifically expanded here.
[0214] Figure 14 is a constituent schematic diagram of another example of a data processing apparatus provided by an embodiment of the present application, as shown in Figure 14 , the data processing apparatus 1400 comprises at least one processor 1410, a secure element 40, a first memory 1430 and a second memory 1440, wherein the first memory 1430 and the second memory 1440 are different memories other than the secure element 40. In a possible implementation, the first memory is a shared memory of the secure element and the at least one processor, and the second memory is a dedicated secure flash of the secure element.
[0215] In the present application, the processor 1410 is used to provide a trusted execution environment (TEE), the at least one processor 1410, the secure element 40, the first memory 1430 and the second memory 1440 cooperate with each other to implement at least one of the following services: the biometric authentication password service, the password verification service, the key management and calculation service, the trusted root service, the anti-rollback service or the high-security storage service introduced in Figure 3 , Figure 5 , Figure 6 , Figure 7 or Figure 11 , or execute other data processing processes. Figure 14 The specific functions of each component in Figure 1 or other drawings corresponding to the description of the embodiments, for example, the CPU 104, the SE 105, the processor 107 and the secure flash chip 109 in Figure 1 respectively, which is not described here.
[0216] Figure 15 is a constituent schematic diagram of an electronic device provided by an embodiment of the present application, as shown in Figure 15 , the electronic device 1500 can be a deviceFigure 11 or Figure 12 electronic device comprising the secure element 40 described in the foregoing Figure 13 or Figure 14 data processing apparatus described in the foregoing. For example, the electronic device 1500 can comprise an Android system layer 10, a TEE 20 and a SE 40, and the Android system layer 10, the TEE 20 and the SE 40 cooperate with each other to execute computer instructions to cause the electronic device to perform the method of data processing provided by the embodiments of the present application. For details, reference can be made to the foregoing description, such as the corresponding description in Figure 3 .
[0217] It can be understood that, in order to implement the above functions, the electronic device comprises corresponding hardware and / or software modules for executing each function. The algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is implemented in hardware or computer software driven hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered beyond the scope of the present application.
[0218] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, apparatus and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be described here.
[0219] The functions described in the foregoing embodiments, if realized in the form of software modules or functional units and sold or used as independent products, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the parts that make contributions to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device or a computing processor, such as the secure element described above, to execute all or part of the steps of the method described in the embodiments of the present application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk and various media that can store program codes.
[0220] The above merely provides the specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of the changes or replacements within the technical range disclosed by the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A data processing apparatus, characterized by, The method comprises: obtaining, by at least one processor, a first security service request through an application programming interface (API) of a trusted execution environment (TEE), the first security service request being used to request a first security service, the first security service comprising at least one of a biometric authentication password service, a password verification service, a key management and calculation service, a trusted root service, an anti-rollback service, or a high-security storage service; obtaining, by a secure element, the first security service request from the at least one processor; in response to the first security service request, performing the first security service to obtain security data; when the security data comprises first security data, storing the first security data to a first memory outside the data processing apparatus, and when the security data comprises second security data, storing the second security data to a second memory outside the data processing apparatus, wherein the first security data comprises recoverable data, the second security data comprises non-recoverable data, the first memory and the second memory are different memories, the first memory is a shared memory of the secure element and the at least one processor, and the second memory is a dedicated secure memory of the secure element. The second memory comprises a plurality of regions, and 2. The data processing apparatus according to claim 1, characterized by when storing the second security data to the second memory outside the data processing apparatus, the secure element is configured to store the second security data to a region corresponding to the first security service in the plurality of regions. The first security service comprises an anti-rollback service, the security data comprises the second security data, the second security data comprises an identification of the anti-rollback service and a count value, the count value is used to determine a number of hardware attacks, and the region corresponding to the anti-rollback service in the plurality of regions further comprises a first sub-region and a second sub-region; and 3. The data processing apparatus according to claim 2, characterized in that, The secure element is specifically configured to: determine the identification of the anti-rollback service and the count value; store the identification of the anti-rollback service to the first sub-region and store the count value to the second sub-region. The first security service comprises a biometric authentication password service, the security data comprises the first security data and the second security data, the first security data comprises ciphertext, and the second security data comprises a first key and a message authentication code (MAC) value; 4. The data processing apparatus according to claim 2, characterized by The secure element is specifically configured to: obtain biometric information of a first user; encrypt the biometric information using the first key to obtain the ciphertext; determine the MAC value according to the biometric information; store the ciphertext to the first memory, and store the first key and the MAC value to a region corresponding to the biometric authentication password service in the plurality of regions. 5. The data processing apparatus according to claim 2, characterized by The first security service includes a high-security storage service, the security data includes the second security data, the second security data includes identification information of a data segment of the high-security storage service, length information of the data segment, and content of the data segment, a region corresponding to the high-security storage service in the plurality of regions further includes a first sub-region, a second sub-region, and a third sub-region, and The security element is specifically used for: determining the identification information, the length information, and the content of the data segment; storing the identification information to the first sub-region, storing the length information to the second sub-region, and storing the content to the third sub-region.
6. A data processing apparatus, characterized by, comprise: at least one processor configured to provide a trusted execution environment (TEE) and acquire a first security service request through an application programming interface (API) of the TEE, the first security service request being used to request a first security service, the first security service including at least one of a biometric authentication password service, a password verification service, a key management and calculation service, a trusted root service, an anti-rollback service, or a high-security storage service; a security element configured to: acquire the first security service request from the at least one processor, when security data required by the first security service includes first security data, acquire the first security data from a first memory outside the data processing apparatus; when the security data required by the first security service includes second security data, acquire the second security data from a second memory outside the data processing apparatus; execute the first security service, wherein the first security data includes recoverable data, the second security data includes non-recoverable data, the first memory and the second memory are different memories, the first memory is a shared memory of the security element and the at least one processor, and the second memory is a dedicated security memory of the security element.
7. The data processing apparatus according to claim 6, characterized in that, The second memory includes a plurality of regions, and when the second security data is acquired from the second memory outside the data processing apparatus, the security element is configured to acquire the second security data from a region corresponding to the first security service in the plurality of regions.
8. The data processing apparatus according to claim 7, characterized in that, When the first security service includes an anti-rollback service, the security data includes the second security data, the second security data includes an identification of the anti-rollback service and a count value, the count value is used to determine a number of hardware attacks, and a region corresponding to the anti-rollback service in the plurality of regions further includes a first sub-region and a second sub-region; and The security element is specifically used for: acquiring the identification of the anti-rollback service from the first sub-region and acquiring the count value from the second sub-region.
9. The data processing apparatus according to claim 7, characterized by When the first security service includes a biometric authentication password service, the security data includes the first security data and the second security data, the first security data includes ciphertext, and the second security data includes a first key and a message authentication code (MAC) value; The security element is specifically used for: acquiring the ciphertext from the first memory and acquiring the first key and the MAC value from the second memory. decrypt the ciphertext according to the first key to obtain the biometric information of the first user; verify the integrity of the biometric information according to the MAC value to obtain a verification result; when the verification result is that the biometric information is complete, determine whether the to-be-verified user is the first user according to the biometric information and biometric information input by the to-be-verified user; when the to-be-verified user is the first user, the biometric authentication passes; or when the to-be-verified user is not the first user, the biometric authentication fails.
10. The data processing apparatus according to claim 7, characterized by, The first security service includes a high-security storage service, the security data includes the second security data, the second security data includes identification information of a data segment of the high-security storage service, length information of the data segment, and content of the data segment, a region corresponding to the high-security storage service in the plurality of regions further includes a first sub-region, a second sub-region, and a third sub-region, and The security element is specifically configured to: obtain the identification information from the first sub-region, obtain the length information from the second sub-region, and obtain the content of the data segment from the third sub-region.
11. A data processing device, characterized by The data processing device includes the data processing apparatus, a first memory, and a second memory.
12. A method of data processing, characterized by, includes: obtaining a first security service request, the first security service request being used to request a first security service, the first security service including at least one of a biometric authentication password service, a password verification service, a key management and calculation service, a trusted root service, an anti-rollback service, or a high-security storage service; in response to the first security service request, performing the first security service to obtain security data; when the security data includes first security data, storing the first security data to a first memory, when the security data includes second security data, storing the second security data to a second memory, wherein the first security data includes recoverable data, the second security data includes non-recoverable data, the first memory and the second memory are different memories, the first memory is a shared memory of a security element and at least one processor, and the second memory is a dedicated security memory of the security element.
13. The method of claim 12, wherein, The second memory includes a plurality of regions, and storing the second security data to the second memory includes: storing the second security data to a region corresponding to the first security service in the plurality of regions.
14. The method of claim 13, wherein, The first security service includes an anti-rollback service, the security data includes the second security data, the second security data includes an identification of the anti-rollback service and a count value, the count value is used to determine the number of hardware attacks, a region corresponding to the anti-rollback service in the plurality of regions further includes a first sub-region and a second sub-region, and storing the second security data to the second memory includes: storing the identification of the anti-rollback service to the first sub-region and storing the count value to the second sub-region.
15. The method of claim 13, wherein, The first security service includes a biometric authentication password service, the security data includes the first security data and the second security data, the first security data includes ciphertext, and the second security data includes a first key and a message authentication code (MAC) value; The execution of the first security service to obtain security data includes: obtaining biometric information of a first user; encrypting the biometric information using the first key to obtain the ciphertext; determining the MAC value according to the biometric information; and The storage of the first security data to a first memory and the storage of the second security data to a second memory include: storing the ciphertext to the first memory, and storing the first key and the MAC value to a region corresponding to the biometric authentication password service in the plurality of regions.
16. The method of claim 13, wherein, The first security service includes a high-security storage service, the security data includes the second security data, the second security data includes identification information of a data segment of the high-security storage service, length information of the data segment, and content of the data segment, and each region corresponding to the high-security storage service in the plurality of regions further includes a first sub-region, a second sub-region, and a third sub-region, The execution of the first security service to obtain security data includes: determining the identification information, the length information, and the content of the data segment; and The storage of the second security data to a second memory includes: storing the identification information to the first sub-region, storing the length information to the second sub-region, and storing the content to the third sub-region.
17. A method of data processing, characterized by, The method includes: obtaining a first security service request, the first security service request being used to request a first security service, the first security service including at least one of a biometric authentication password service, a password verification service, a key management and calculation service, a trusted root service, an anti-rollback service, or a high-security storage service; when the security data required by the first security service includes first security data, obtaining the first security data from a first memory; when the security data required by the first security service includes second security data, obtaining the second security data from a second memory; executing the first security service, wherein the first security data includes recoverable data, the second security data includes non-recoverable data, the first memory and the second memory are different memories, the first memory is a shared memory of a secure element and at least one processor, and the second memory is a dedicated secure memory of the secure element.
18. The method of claim 17, wherein, The second memory includes a plurality of regions, and the obtaining of the second security data from the second memory includes: obtaining the second security data from a region corresponding to the first security service in the plurality of regions.
19. The method of claim 18, wherein, When the first security service comprises a rollback prevention service, the security data comprises the second security data, the second security data comprises an identifier of the rollback prevention service and a count value, the count value is used to determine a number of times of hardware attacks, and a region corresponding to the rollback prevention service in the plurality of regions further comprises a first sub-region and a second sub-region, and the obtaining of the second security data from the second memory comprises: obtaining the identifier of the rollback prevention service from the first sub-region and obtaining the count value from the second sub-region.
20. The method of claim 18, wherein, When the first security service comprises a biometric authentication password service, the security data comprises the first security data and the second security data, the first security data comprises ciphertext, and the second security data comprises a first key and a message authentication code (MAC) value; the execution of the first security service comprises: decrypting the ciphertext according to the first key to obtain biometric information of a first user; verifying integrity of the biometric information according to the MAC value to obtain a verification result; when the verification result is that the biometric information is complete, determining whether a to-be-verified user is the first user according to the biometric information and biometric information input by the to-be-verified user; when the to-be-verified user is the first user, biometric authentication verification is passed; or when the to-be-verified user is not the first user, biometric authentication verification is failed.
21. The method of claim 18, wherein, When the first security service comprises a high-security storage service, the security data comprises the second security data, the second security data comprises identifier information of a data segment of the high-security storage service, length information of the data segment, and content of the data segment, and a region corresponding to the high-security storage service in the plurality of regions further comprises a first sub-region, a second sub-region, and a third sub-region, the obtaining of the second security data from the second memory comprises: obtaining the identifier information from the first sub-region, obtaining the length information from the second sub-region, and obtaining the content of the data segment from the third sub-region.
Citation Information
Patent Citations
Mobile payment method, system on chip, and terminal
CN106127483A