Key management method based on system-on-chip and system-on-chip
By using the root key of the second processor core to decrypt the encrypted session key in the on-chip system, the problem that key management in the vehicle's internal electronic controller relies on third-party hardware modules is solved, and the efficiency and efficiency of the session key are achieved. Security management reduces the risk of key leakage.
Patent Information
- Application Number
- CN202410806589.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-09-03
AI Technical Summary
Existing technology In vehicle internal electronic controllers, key management and key protection need to rely on third-party hardware modules or security architectures, resulting in low development efficiency and increased additional costs, and cannot effectively protect the confidentiality and integrity of session keys. .
By using the root key of the second processor core to decrypt the encrypted session key transmitted by the first processor core in the system-on-chip, the encryption and decryption operations of the data to be protected are ensured and the dependence on third-party hardware modules or security architectures is avoided. , Reduce the risk of session key leakage.
It ensures the confidentiality and integrity of session keys without relying on third-party hardware modules or security architectures, reduces the risk of key leaks, and improves the efficiency and security of key management.
Smart Images

Figure CN118590291A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of information security technology, and in particular to a key management method based on a system on chip and a system on chip. Background Art
[0002] With the development of vehicle intelligence and vehicle networking technologies, the number of electronic control units (ECUs) inside vehicles has also increased exponentially. Therefore, how to ensure the communication security of the system on chip (SOC) in each ECU is very important and is also a research topic that needs to be solved urgently by technicians in this field.
[0003] Among them, no matter what kind of secure communication method is adopted, it is inseparable from the safe use of keys. Therefore, how to securely protect and manage keys is becoming increasingly important. Summary of the invention
[0004] Usually, an external hardware security module (HSM), an external security chip, or the Trustzone security architecture is used to achieve secure management and use of keys. However, these three methods require reliance on third-party materials or require changes to the chip architecture, which not only has a significant impact on development efficiency, but also increases external procurement costs and change costs.
[0005] In order to solve the above technical problems, the present disclosure provides a key management method and system on chip based on a system on chip, which can solve the problem of relying on third-party materials or changing the chip architecture to achieve key security management.
[0006] A first aspect embodiment of the present disclosure provides a key management method based on a system on chip, including: a first processor core in the system on chip determines data to be protected and a first encryption session key corresponding to the data to be protected, and sends the first encryption session key to a second processor core in the system on chip; the second processor core decrypts the first encryption session key based on a root key to obtain a first decryption session key, and sends the first decryption session key to the first processor core; the first processor core encrypts and decrypts the data to be protected based on the first decryption session key.
[0007] A second aspect embodiment of the present disclosure provides a system on chip, including: a first processor core, used to determine data to be protected and a first encryption session key corresponding to the data to be protected, and send the first encryption session key to a second processor core in the system on chip; the second processor core, used to decrypt the first encryption session key based on a root key, obtain a first decryption session key, and send the first decryption session key to the first processor core; the first processor core is also used to encrypt and decrypt the data to be protected based on the first decryption session key.
[0008] A third aspect embodiment of the present disclosure provides a computer-readable storage medium, which stores a computer program, and the computer program is used to execute the key management method based on the on-chip system provided by the first aspect embodiment.
[0009] The fourth aspect embodiment of the present disclosure provides an electronic device, which includes: a processor; a memory for storing processor executable instructions; a processor, configured to read executable instructions from the memory and execute the instructions to implement the on-chip system-based key management method provided in the first aspect embodiment above.
[0010] A fifth aspect embodiment of the present disclosure provides a computer program product. When instructions in the computer program product are executed by a processor, the on-chip system-based key management method provided by the first aspect embodiment is executed.
[0011] Based on the on-chip system-based key management method provided by the present invention, when there is a data confidentiality requirement in the first processor core, the session key corresponding to the data confidentiality requirement is encrypted and decrypted using a root key to which only the second processor core has access permission. In this way, the confidentiality and integrity of the session key can be guaranteed without relying on a third-party hardware module or security architecture, thereby reducing the risk of leakage of the session key. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 is a structural diagram of a system on chip provided by an exemplary embodiment of the present disclosure.
[0013] Figure 2 It is a flowchart of a key management method based on a system on chip provided by an exemplary embodiment of the present disclosure.
[0014] Figure 3 It is a flowchart of a key usage method included in a key management method provided by an exemplary embodiment of the present disclosure.
[0015] Figure 4 It is a flowchart of a key management method based on a system on chip provided by another exemplary embodiment of the present disclosure.
[0016] Figure 5 It is a flowchart of a communication key generation method included in a key management method provided by an exemplary embodiment of the present disclosure.
[0017] Figure 6 It is a flowchart of a key management method based on a system on chip provided by another exemplary embodiment of the present disclosure.
[0018] Figure 7 It is a flowchart of a key acquisition method included in a key management method provided by an exemplary embodiment of the present disclosure.
[0019] Figure 8 It is a flowchart of a key management method based on a system on chip provided by another exemplary embodiment of the present disclosure.
[0020] Fig. 9 It is a flowchart of a key management method based on a system on chip provided by another exemplary embodiment of the present disclosure.
[0021] Fig.10 It is a flowchart of a root key generation method included in a key management method provided by another exemplary embodiment of the present disclosure.
[0022] Fig.11 It is a flowchart of a key management method based on a system on chip provided by another exemplary embodiment of the present disclosure.
[0023] Fig.12 is a structural diagram of a system on chip provided by another exemplary embodiment of the present disclosure.
[0024] Fig.13 is a structural diagram of a system on chip provided by yet another exemplary embodiment of the present disclosure.
[0025] Fig.14 is a structural diagram of a system on chip provided by yet another exemplary embodiment of the present disclosure.
[0026] Fig.15 is a structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] To explain the present disclosure, example embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. It should be understood that the present disclosure is not limited to the example embodiments.
[0028] It should be noted that the relative arrangement of components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
[0029] Application Overview
[0030] Currently, there are roughly three solutions for in-vehicle ECU key management and key protection:
[0031] The first method is to achieve key storage and security protection through a hardware security module (HSM). This solution imports the key into the HSM through the HSM external interface for secure storage, thereby preventing the key from being leaked. When in use, the data to be encrypted can also be imported into the HSM, so that encryption and decryption operations can be performed in the HSM and the corresponding results can be returned.
[0032] The second method is to achieve key storage and security protection by connecting an additional security chip to the SOC. This solution requires importing the key into the security chip through the external interface of the security chip, thereby achieving secure storage and encryption and decryption operations of the key.
[0033] The third method is to use the Trustzone architecture in the SOC and the Trusted Execution Environment (TEE) to implement key storage and security protection. This solution requires importing the key into the TEE through the TEE interface to implement secure storage and encryption and decryption of the key.
[0034] All three solutions above require the use of additional security modules or security architectures to achieve secure storage of keys. If the above security mechanisms are not considered at the beginning of SOC chip design, the keys cannot be effectively protected.
[0035] Therefore, in order to solve the above problems, the embodiments of the present disclosure provide a key management method based on a system on chip. When there is a data confidentiality requirement in the first processor core, the method uses the root key to which the second processor core has access rights to encrypt and decrypt the session key corresponding to the data confidentiality requirement. In this way, the confidentiality and integrity of the session key can be guaranteed without relying on third-party hardware modules or security architectures, thereby reducing the risk of leakage of the session key.
[0036] Exemplary Systems
[0037] Figure 1A system on chip is provided for an embodiment of the present disclosure. The system on chip 10 includes a first processor core 11, a second processor core 12 and an intra-chip communication bus 13. The first processor core 11 is used to implement data encryption and decryption, such as using a hardware encryption engine to encrypt and decrypt data, thereby realizing the business needs of secure communication. The second processor core 12 is used for key generation management and to implement full life cycle security protection of keys, such as generating root keys, generating session keys, encrypting and decrypting session keys, etc. The intra-chip communication bus 13 is used to implement communication between the first processor core 11 and the second processor core 12.
[0038] In some embodiments, the performance of the first processor core 11 may be better than that of the second processor core. The first processor core 11 is generally used for high-performance characteristics and can efficiently handle multi-threading and multi-tasking. The second processor core 12 generally has the characteristics of low latency and real-time control. For example, the first processor core 11 includes but is not limited to the A core in a multi-core SOC, and the second processor core 12 includes but is not limited to the R core and M core in a multi-core SOC. Of course, those skilled in the art can select and set the specific implementation types of the first processor core and the second processor core according to actual usage requirements, and the embodiments of the present disclosure do not limit this.
[0039] like Figure 1 As shown, the first processor core 11 in the system on chip 10 determines the data to be protected and the first encryption session key corresponding to the data to be protected, and sends the first encryption session key to the second processor core 12 in the system on chip 10 through the intra-chip communication bus 13. The second processor core 12 decrypts the first encryption session key based on the root key to obtain the first decryption session key, and sends the first decryption session key to the first processor core 11 through the intra-chip communication bus 13. The first processor core 11 encrypts and decrypts the data to be protected based on the first decryption session key. It can be seen that when the first processor core 11 has a data confidentiality requirement, the root key to which the second processor core 12 has access rights is used to encrypt and decrypt the session key corresponding to the data confidentiality requirement, so that the confidentiality and integrity of the session key can be guaranteed without relying on a third-party hardware module or security architecture, thereby reducing the risk of leakage of the session key.
[0040] Exemplary Methods
[0041] Figure 2 The flowchart of a key management method based on a system on chip is provided as a flowchart of an exemplary embodiment of the present disclosure. The management method of this embodiment can be applied to electronic devices, such as Figure 2 As shown, the method includes steps S201 to S203.
[0042] Step S201: A first processor core in a system on chip determines data to be protected and a first encryption session key corresponding to the data to be protected, and sends the first encryption session key to a second processor core in the system on chip.
[0043] Exemplarily, in the case where multiple encryption session keys are stored in the first processor core, when there is a data confidentiality requirement for a business application on the first processor core, the first processor core determines the data to be protected corresponding to the data confidentiality requirement, and determines the corresponding first encryption session key based on the data to be protected, and then filters out the first encryption session key from the multiple locally stored encryption session keys and sends it to the second processor core in the on-chip system.
[0044] For example, if the data to be protected corresponding to the data confidentiality requirement of the target business application is a certain braking data, the first processor core determines that the encryption session key corresponding to the braking data is the encryption session key identified as 1, and then sends the encryption session key identified as 1 to the second processor core; at this time, the encryption session key identified as 1 is the first encryption session key. For another example, if the data to be protected corresponding to the data confidentiality requirement of the target business application is a certain specific location data, the first processor core determines that the encryption session key corresponding to the location data is the encryption session key identified as 6, and then sends the encryption session key identified as 6 to the second processor core; at this time, the encryption session key identified as 6 is the first encryption session key. Among them, the first processor core stores n session keys identified from 1 to n, where n is a natural number greater than 1, and the value of n is related to the actual application.
[0045] It should be noted that, since the first encrypted session key is encrypted by a root key and the first processor core cannot obtain the root key, the first processor core needs to send the first encrypted key to the second processor core for decryption.
[0046] Step S202: The second processor core decrypts the first encrypted session key based on the root key to obtain a first decrypted session key, and sends the first decrypted session key to the first processor core.
[0047] Exemplarily, a plurality of encrypted session keys are stored in the first processor core, but the first processor core does not have access to the root key and cannot decrypt the encrypted session key. Therefore, the first processor core needs to send the first encrypted session key to the second processor core, so that the second processor core can use the root key to decrypt the first encrypted session key and send the first decrypted session key obtained after decryption to the first processor core. The second processor core has access control authority to the root key.
[0048] Step S203: The first processor core encrypts and decrypts the data to be protected based on the first decryption session key.
[0049] Exemplarily, after the first processor core obtains the first decryption session key, the business application on the first processor core can use the first decryption session key to encrypt and decrypt the protected data corresponding to the data confidentiality requirement. Furthermore, if the first decryption session key is used up, the first processor core will directly release the memory corresponding to the first decryption session key, and will not save the first decryption session key, so as to reduce the memory space usage while improving the security of the session key.
[0050] The key management method based on the system on chip provided in the embodiment of the present application encrypts and decrypts the session key corresponding to the data confidentiality requirement by using the root key to which the second processor core has access rights when the first processor core has data confidentiality requirements. In this way, the confidentiality and integrity of the session key can be guaranteed without relying on third-party hardware modules or security architectures, thereby reducing the risk of leakage of the session key.
[0051] like Figure 3 As shown, the first processor core is A core and the second processor core is R core. In the encryption and decryption or secure communication stage using the first encryption session key, the key management method of the embodiment of the present disclosure includes a key use method, which includes:
[0052] Step S31: Core A reads a first encrypted session key and its corresponding identifier in a Non-Volatile Memory (NVM).
[0053] Exemplarily, when the stored encrypted session key is to be read, the A core first performs access control through its access control module: if it is a legitimate application, the application is allowed to read the first encrypted session key and key ID (Identifier) in the NVM.
[0054] Step S32: Core A sends the first encrypted session key and the identifier corresponding to the first encrypted session key to core R through a secure communication mechanism.
[0055] Step S33: After receiving the first encrypted session key, the R core uses the root key to decrypt the first encrypted session key to obtain a first decrypted session key.
[0056] Step S34: The R core sends the first decryption session key to the A core through a secure channel.
[0057] Step S35 , core A calls the encryption and decryption engine of the hardware based on the first decryption session key to perform encryption and decryption or secure communication on the protected data.
[0058] Exemplarily, core A uses the first decryption session key to encrypt and decrypt session messages or service data.
[0059] Step S36: Delete the first decryption session key after use.
[0060] Exemplarily, after using the first decryption session key, core A directly releases its corresponding memory without saving the first decryption session key.
[0061] It can be seen that during the whole process, the first decryption session key will not appear in the external storage medium, but will only be temporarily used in the A core application, and its corresponding memory will be released immediately after use, thereby improving the security of the session key.
[0062] like Figure 4 As shown in the above Figure 2 Based on the illustrated embodiment, step S202 may include steps S2021 to S2024.
[0063] Step S2021: The second processor core decrypts the first encrypted session key based on the root key to obtain a first decrypted session key.
[0064] Exemplarily, the first processor core may use the root key to decrypt the first encrypted session key to obtain a first decrypted session key, wherein the first decrypted session key is a plaintext session key. Only the second processor core has access rights to the root key, and the first processor core does not have access rights to the root key.
[0065] Step S2022: The second processor core determines a communication key.
[0066] Exemplarily, in order to ensure the communication security between the first processor core and the second processor core, the scheme in the embodiment of the present disclosure includes the establishment of secure communication, and this process can ensure the security of communication between the first processor core and the second processor core. The first processor core uses the challenge response code and the asymmetric algorithm mechanism to determine the communication key, and then ensures the communication security between the first processor core and the second processor core based on the communication key, prevents attackers from obtaining the plaintext session key from the communication, and ensures the confidentiality and integrity of the communication data.
[0067] Step S2023: The second processor core encrypts the first decryption session key based on the communication key to obtain a second encryption session key.
[0068] Exemplarily, the first decryption session key is a plaintext session key, and then the second processor core encrypts the first decryption key based on the communication key to obtain a second encrypted session key.
[0069] Step S2024: The second processor core sends a second encrypted session key to the first processor core.
[0070] Exemplarily, the second processor core sends a second encrypted session key to the first processor core via an on-chip communication bus, so that the first processor core can decrypt the second encrypted session key using the communication key after receiving it, thereby using the decrypted plaintext session key to encrypt and decrypt data or information.
[0071] The key management method based on the system on chip provided in the embodiment of the present application encrypts the decrypted plaintext session key by using the communication key, and then sends the encrypted plaintext session key to the first processor core, thereby ensuring the security of communication between the first processor core and the second processor core, preventing attackers from obtaining the plaintext session key from the communication, and ensuring the confidentiality and integrity of the communication data.
[0072] In some embodiments, the method further includes: the first processor core authenticates the second processor core to obtain an authentication result of the second processor core; in response to the authentication result being that the second processor core has passed authentication, the first processor core generates a communication key and sends the communication key to the second processor core.
[0073] Exemplarily, before establishing communication security between the first processor core and the second processor core, the first processor core needs to verify the identity of the second processor core. Only when the identity verification of the second processor core is successful, the first processor core sends the generated communication key to the second processor core.
[0074] It should be noted that the specific implementation method of the above identity authentication is not limited in the embodiments of the present disclosure. For example, identity authentication can be performed based on a digital signature. For another example, identity authentication can be performed based on a challenge response code.
[0075] In some embodiments, the first processor core authenticates the second processor core to obtain an authentication result of the second processor core, including: the first processor core generates a challenge response code, and sends the challenge response code encrypted by a public key to the second processor core; the first processor core hashes the generated challenge response code to obtain a first hash value; the second processor core hashes the challenge response code decrypted by a private key to obtain a second hash value, and sends the second hash value encrypted by the private key to the first processor core; the first processor core determines the authentication result of the second processor core based on the first hash value and the second hash value decrypted by the public key.
[0076] Exemplarily, the first processor core generates an 8-byte challenge response code and encrypts it with a public key; wherein the public key is preset in the secure communication module of the first processor core. Then, the first processor core triggers the secure communication process and sends the encrypted challenge response code to the second processor core. The second processor core receives the encrypted challenge response code, reads the private key preset in the E-fuse (one-time programmable memory), and decrypts it with the private key to obtain the original challenge response code. The second processor core calculates the hash value of the challenge response code through the hash algorithm to obtain a second hash value, and encrypts the second hash value with the private key, and returns the encrypted second hash value to the first processor core. The first processor core decrypts the encrypted second hash value with the public key to obtain the second hash value. Then, the first processor core also calculates the hash value of the generated challenge response code locally through the hash algorithm to obtain the first hash value. Finally, the first processor core compares the first hash value with the second hash value; if the first hash value and the second hash value are the same, the first processor core generates a 16-byte random number, and encrypts the 16-byte random number with the public key to obtain an encrypted result. The first processor core sends the encryption result to the second processor core, so that the second processor core can decrypt it with the private key to obtain a plaintext random number and save it as a communication key.
[0077] like Figure 5 As shown, the first processor core is A core and the second processor core is R core. The key management method in the embodiment of the present disclosure includes a communication key generation method, and the communication key can be generated in the following manner to establish a secure channel between A core and R core:
[0078] Step S51, core A generates a first random number and encrypts it with a public key to obtain a first encryption result.
[0079] Exemplarily, the A core generates a first random number of 8 bytes and uses the random number as the challenge response code. The A core encrypts the challenge response code with a public key to obtain a first encryption result; wherein the public key can be preset in the A core security communication module.
[0080] Step S52: Core A triggers the establishment of secure communication and sends the first encryption result to core R.
[0081] Step S53: The R core uses the corresponding private key to decrypt the first encryption result to obtain a first random number in plain text.
[0082] Exemplarily, the public and private keys are pre-negotiated between the A core and the R core, and the public and private keys are used for challenge response or communication establishment.
[0083] In some examples, after receiving the first encryption result, the R core reads the private key preset in the E-fuse and decrypts it with the private key to obtain the original challenge response code.
[0084] Step S54, the R core calculates the MAC (Message Authentication Code) value of the first random number, and encrypts the calculated MAC value using the private key to obtain the MAC value signed by the private key.
[0085] Step S55, the R core returns the MAC value signed by the private key.
[0086] Step S56: Core A uses the public key to verify the MAC value signed by the private key, and compares it with the MAC value generated locally using the first random number.
[0087] Step S57: If the comparison is successful, core A regenerates a second random number and encrypts it with the public key to obtain a second encryption result.
[0088] Exemplarily, when the MAC value after the private key signature is verified with the public key and is correct, if the verified MAC value is the same as the locally generated MAC value, the A core regenerates a 16-byte random number.
[0089] Step S58: Core A sends the second encryption result to core R.
[0090] Step S59, the R core uses the private key to decrypt the second encryption result, obtains a second random number in plain text and saves it as a communication key.
[0091] Exemplarily, the communication key is randomly generated during the communication establishment process to ensure the security of data transmission between different cores. In some examples, each time there is a need to use the session key, the communication key needs to be randomly regenerated, that is, the communication key is constantly changing.
[0092] Then, the communication key can be used for secure communication between the A core and the R core. The MAC value is the message authentication code, which is a hash function value with a key. The key makes the MAC value have an additional authentication function compared to the hash value.
[0093] In this way, through the methods in the above steps S51 to S59, a secure communication mechanism between different cores within the same chip can be implemented; a secure communication channel is determined through a challenge response mechanism and an asymmetric algorithm, thereby ensuring the authenticity, integrity and confidentiality of data during the communication process.
[0094] like Figure 6 As shown in the above Figure 2 Based on the illustrated embodiment, the method further includes steps S21a to S23a.
[0095] Step S21a: The first processor core sends a session key trigger request to the second processor core.
[0096] Exemplarily, when the vehicle is in the production line stage, the first processor core may send a session key trigger request to the second processor core, so that the second processor core generates a corresponding session key or imports a corresponding session key. Accordingly, the session key trigger request includes but is not limited to: a session key generation request and a session key import request. For example, during the vehicle production stage, the first processor core will perform a session key requirement analysis, and if it is analyzed that a certain type of data will have confidentiality requirements during the subsequent vehicle use stage, the first processor core will send a session key generation request for this type of data to the second processor core, so that the second processor core can generate a corresponding session key based on the session key generation request.
[0097] In some examples, a vehicle includes multiple ECUs, each of which has a system on chip. If a first system on chip or an external cloud sends a session key to a first processor core of a second system on chip, the first processor core sends a session key import request to a second processor core of the same system on chip, so that the second processor core can import the session key carried in the request.
[0098] Step S22a: The second processor core determines a third session key based on the session key trigger request.
[0099] Exemplarily, when the session key triggering request includes a session key generation request, the second processor core generates a corresponding third session key based on the parameters in the generation request. For example, if the session key triggering request is a session key generation request for brake type data, the second processor core generates a session key corresponding to the brake type data and uses it as the third session key.
[0100] In some examples, when the session key triggering request includes a session key import request, the second processor core receives the session key carried in the import request and determines it as the third session key.
[0101] Step S23a: The second processor core encrypts the third session key based on the root key to obtain a third encrypted session key, and sends the third encrypted session key to the first processor core, so that the first processor core stores the third encrypted session key.
[0102] Exemplarily, whether it is a generated third session key or an imported third session key, the second processor core needs to encrypt the third session key based on the root key to obtain a third encrypted session key. After the encryption is completed, the second processor core will send the third encrypted session key to the first processor core, so that the first processor core can store the third encrypted session key in a non-volatile memory for preservation. Furthermore, during the vehicle use phase after the vehicle leaves the factory, the first processor core can select the session key to be used from multiple third encrypted session keys to encrypt and decrypt confidential data or confidential information.
[0103] The key management method based on the system on chip provided in the embodiment of the present application generates or imports multiple third encrypted session keys through the second processor core, and sends the multiple third encrypted session keys to the first processor core for storage. In this way, the entire second processor core can be used as a security core, so that the second processor core does not directly encrypt and decrypt business data, and is only responsible for the generation, import and encryption and decryption of session keys. The resources of the second processor core are less occupied and the security of the session keys is also higher.
[0104] In some examples, the first processor core first triggers the second processor core to generate or import a session key through a secure communication mechanism. The second processor core encrypts the generated or imported session key using the root key through an internal key encryption and decryption module, and returns the encrypted session key and key ID to the first processor core. After receiving the session key and key ID, the first processor core manages the session key and key ID through its key management module and saves them in a non-volatile memory (NVM). At the same time, an access control mechanism is used to control access to the first processor core key management module and the encrypted key, and only authorized applications can access and process the corresponding session key.
[0105] like Figure 7 As shown, the first processor core is an A core and the second processor core is an R core. In the session key generation and import stage, the key management method of the embodiment of the present disclosure includes a key acquisition method, which is applied to the R core and includes the following steps:
[0106] Step S71: receiving a key generation or import request.
[0107] Step S72: Generate a third session key through a random number generation module.
[0108] Step S73: Use the root key to encrypt the third session key to obtain a third encrypted session key.
[0109] Step S74: Return the third encrypted session key and key ID to the first processor core.
[0110] Exemplarily, after the R core returns the third encrypted session key and key ID to the A core, the A core stores the third encrypted session key and key ID in the NVM, and configures through the access control module that only fixed applications can access the third encrypted session key and key ID.
[0111] like Figure 8 As shown in the above Figure 2 Based on the illustrated embodiment, step S201 may include steps S2011 to S2013.
[0112] Step S2011: The first processor core in the system on chip determines the to-be-protected data corresponding to the target application and the access rights corresponding to the target application.
[0113] Exemplarily, there are multiple applications on the first processor core, and when a target application among the multiple applications has a data confidentiality requirement, a session key access control request is sent to the key management module of the first processor core. After receiving the request, the key management module of the first processor core determines whether the target application has access control authority to the multiple third encrypted session keys stored in the NVM.
[0114] Step S2012: In response to the target application having permission to access the third encrypted session key, the first processor core determines the first encrypted session key corresponding to the data to be protected from the third encrypted session key.
[0115] Exemplarily, when the key management module of the first processor core determines that the target application has access control authority for the third encrypted session key, the first processor core determines the data to be protected corresponding to the target application, and selects the first encrypted session key corresponding to the data to be protected from the multiple third encrypted session keys stored in the NVM. That is, the first encrypted session key is a specific session key among the multiple third encrypted session keys, and the specific session key refers to the session key corresponding to the data to be protected.
[0116] Step S2013: The first processor core sends a first encrypted session key to the second processor core in the system on chip.
[0117] Exemplarily, after the first processor core determines the first encrypted session key corresponding to the data to be protected from multiple third encrypted session keys, the first processor core sends the first encrypted session key to the second processor core, so that the second processor core can decrypt the first encrypted session key using the root key.
[0118] The key management method based on the system on chip provided in the embodiment of the present application verifies the permissions of the target application with data confidentiality requirements through the first processor, and determines the first encrypted session key to be used by the target application from multiple third encrypted session keys when the target application has access rights. In this way, an access control mechanism can be used to ensure the confidentiality and integrity of the session key, thereby reducing the risk of leakage of the session key.
[0119] In some embodiments, the second processor core determines the third session key based on the session key trigger request, including: in response to the session key trigger request being a session key generation request, the second processor core generates the third session key; in response to the session key trigger request being a session key import request, the second processor core determines the third session key based on the session key carried in the session key import request.
[0120] It should be noted that the step of the second processor core determining the third session key based on the session key carried in the session key import request usually occurs in the production line environment, and the vehicle production line environment is safe by default. At the same time, the import device needs to be securely verified before importing, and the secure communication between the first processor core and the second processor core has been established before importing.
[0121] like Fig. 9 As shown in the above Figure 2 Based on the illustrated embodiment, the method further includes steps S21b to S22b.
[0122] Step S21b: The second processor core reads a chip identifier corresponding to the system on chip from the one-time programmable memory.
[0123] For example, an electrically programmable read-only memory (E-fuse) is an electrically programmable read-only memory used to store fixed information, which is characterized in that once programmed, it cannot be erased or modified, similar to the function of a traditional read-only memory (ROM). Furthermore, the chip ID corresponding to the system on chip can be stored in the one-time programmable memory, so that the second processor core can use the chip ID to generate a root key.
[0124] In some examples, the second processor core may be an R core or an M core, which is not limited in the embodiments of the present disclosure.
[0125] Step S22b: The second processor core generates and stores a root key based on the chip identification.
[0126] Exemplarily, after the second processor core is powered on during the initialization phase, the unique ID of the system on chip is read from the one-time programmable memory, and a root key is derived through a derivation algorithm. After the root key is generated, it is saved in the random access memory (RAM) of the second processor core. Since the RAM is located in the second processor core and there is a physical isolation between the first processor core and the second processor core, the first processor core cannot access the root key and does not have access rights to the root key. At the same time, since the identifiers of different systems on chip are inconsistent, the root key is one-core-one-secret and cannot be known or tampered with by the outside (except the second processor core).
[0127] According to the key management method based on the system on chip provided in the embodiment of the present application, only the second processor core can read the chip identification of the system on chip, and the root key generated by the second processor core using the chip identification cannot be accessed by the first processor core. In this way, it is possible to protect the root key only through software changes and configurations without relying on external hardware security modules and security chips. At the same time, the root key is only stored in the RAM of the second processor core and the root key is unique to each core and cannot be obtained or tampered with, thereby ensuring the security of the root key. At the same time, the root key management method has relatively low performance requirements on the core inside the chip, thereby having high feasibility.
[0128] like Fig.10 As shown, the first processor core is A core and the second processor core is R core. In the initialization stage, the key management method of the embodiment of the present disclosure includes a root key generation method, and the root key generation method includes the following steps:
[0129] Step S101: The R core completes system power-on.
[0130] Step S102: The R core reads the chip ID in the E-fuse.
[0131] Step S103, E-fuse returns the chip ID to the R core.
[0132] Step S104: The R core uses the chip ID to derive a root key through a derivation algorithm.
[0133] Exemplarily, the key derivation algorithms in the embodiments of the present disclosure include, but are not limited to: HKDF algorithm, PBKDF2 algorithm, Bcrypt algorithm, Scrypt algorithm, and Argon2 algorithm.
[0134] Step S105: Save the root key in the RAM of the R core.
[0135] For example, the E-fuse configuration can only be read by the R core, and the A core cannot read the E-fuse. In addition, since the A core and the R core are physically isolated, the A core cannot obtain the root key. In this way, it can be ensured that the root key cannot be known and tampered by other cores except the R core.
[0136] like Fig.11 As shown, the first processor core is A core and the second processor core is R core. The key management method based on the system on chip of the embodiment of the present disclosure includes the following steps:
[0137] Step S111, initialization, generation of root key.
[0138] Step S112: A core and R core establish secure communication.
[0139] Step S113: Core A triggers the generation or import of a session key.
[0140] Step S114: The R core randomly generates or imports a session key.
[0141] Step S115: The R core uses the root key to encrypt the session key.
[0142] Step S116: The R core returns the encrypted session key and key ID to the A core.
[0143] Step S117, core A saves the encrypted session key and key ID.
[0144] Step S118, core A sends the encrypted session key and key ID to core R.
[0145] Step S119: The R core uses the root key to decrypt the encrypted session key.
[0146] Step S120: The R core returns the decrypted session key to the A core.
[0147] Step S121: Core A uses the decrypted session key to perform encryption and decryption.
[0148] Step S122: Core A releases the memory space corresponding to the session key after use.
[0149] The above steps S113 to S117 are the session key generation or importing stage, which usually occurs during the vehicle production process. The above steps S118 to S122 are the session key usage stage, which usually occurs during the vehicle usage process.
[0150] It can be seen that the key management scheme in the embodiment of the present disclosure mainly includes:
[0151] (1) Implement data encryption and decryption in core A. For example, a hardware encryption engine can be used to encrypt and decrypt big data, thereby meeting business requirements for secure communication and secure storage.
[0152] (2) Implement root key generation, session key encryption and decryption, and key security generation management in the R core to achieve full lifecycle security protection of keys. Since only session keys, root keys, and other keys are processed, the resource usage is lower and the requirements for the R core are lower.
[0153] For example, the system on chip in the embodiment of the present disclosure may include a SOC corresponding to the intelligent driving domain controller, a SOC corresponding to the gateway controller, a SOC corresponding to the in-vehicle infotainment system (IVI) controller, a SOC corresponding to the cockpit controller, a SOC corresponding to the intelligent vehicle terminal (Telematics-BOX, T-Box) controller, etc. In addition, one of the cores in the above multi-core SOC chip can be selected to be used as a safety core (second processor core).
[0154] Exemplary Systems
[0155] Fig.12 A system on a chip is provided in an embodiment of the present disclosure, such as Fig.12 As shown, the system on chip 1200 includes at least a first processor core 1201 and a second processor core 1202 .
[0156] The first processor core 1201 is used to determine the data to be protected and the first encryption session key corresponding to the data to be protected, and send the first encryption session key to the second processor core 1202 in the system on chip 1200 .
[0157] The second processor core 1202 is configured to decrypt the first encrypted session key based on the root key to obtain a first decrypted session key, and send the first decrypted session key to the first processor core 1201 .
[0158] The first processor core 1201 is further configured to encrypt and decrypt the data to be protected based on the first decryption session key.
[0159] In some embodiments, Fig.13 As shown, the system on chip 1200 further includes a one-time programmable memory 1203 .
[0160] A one-time programmable memory 1203, used to store a chip identifier corresponding to the system on chip 1200;
[0161] The second processor core 1202 is further configured to read the chip identification in the one-time programmable memory 1203 and generate a root key based on the chip identification.
[0162] In some embodiments, the second processor core 1202 is used to determine a communication key; encrypt the first decryption session key based on the communication key to obtain a second encryption session key; and send the second encryption session key to the first processor core 1201 .
[0163] In some embodiments, the first processor core 1201 is used to authenticate the second processor core 1202 and obtain an authentication result of the second processor core 1202; in response to the authentication result that the second processor core 1202 has passed the authentication, a communication key is generated and the communication key is sent to the second processor core 1202.
[0164] In some embodiments, the first processor core 1201 is used to generate a challenge response code and send the challenge response code encrypted by a public key to the second processor core 1202; and perform hash processing on the generated challenge response code to obtain a first hash value.
[0165] The second processor core 1202 is configured to perform hash processing on the challenge response code decrypted by the private key to obtain a second hash value, and send the second hash value encrypted by the private key to the first processor core 1201 .
[0166] The first processor core 1201 is further configured to determine an identity authentication result of the second processor core 1202 based on the first hash value and the second hash value decrypted by the public key.
[0167] In some embodiments, the first processor core 1201 is configured to send a session key trigger request to the second processor core 1202 .
[0168] The second processor core 1202 is used to determine the third session key based on the session key trigger request; encrypt the third session key based on the root key to obtain the third encrypted session key, and send the third encrypted session key to the first processor core 1201, so that the first processor core 1201 stores the third encrypted session key.
[0169] In some embodiments, the first processor core 1201 in the system on chip 1200 is used to determine the data to be protected corresponding to the target application and the access rights corresponding to the target application; in response to the target application having the right to access the third encrypted session key, the first encrypted session key corresponding to the data to be protected is determined from the third encrypted session key.
[0170] In some embodiments, the second processor core 1202 is used to generate a third session key in response to the session key trigger request being a session key generation request; and to determine the third session key based on the session key carried in the session key import request in response to the session key trigger request being a session key import request.
[0171] The beneficial technical effects corresponding to the above-mentioned exemplary embodiment of the system on chip 1200 can be found in the corresponding beneficial technical effects of the above-mentioned exemplary method part, which will not be repeated here.
[0172] Fig.14 A system on a chip is provided in an embodiment of the present disclosure, such as Fig.14 As shown, the system on chip 140 includes at least an A core 141 , an R core 142 , an E-fuse 143 , an NVM 144 and an intra-chip communication bus 145 .
[0173] The A core 141 at least includes an access control module 1411, a data encryption and decryption module 1412, and a secure communication module 1413. Among them, the secure communication module 1413 mainly completes the secure communication and key exchange between the R core 142. The data encryption and decryption module 1412 mainly completes the encryption and decryption of data and the storage of session keys, and stores the received session keys in the NVM 144. The access control module 1411 mainly controls the access to the data encryption and decryption module 1412 and the encrypted session keys. Only authorized applications can access and process the corresponding session keys. Among them, the data encryption and decryption module 1412 of the A core 141 is mainly used to implement the above Figure 3 The method shown in .
[0174] The R core 142 includes at least a key encryption and decryption module 1421, a secure communication module 1422, and a RAM 1423. The secure communication module 1422 mainly completes secure communication and key exchange with the A core. The key encryption and decryption module 1421 mainly completes key generation and key encryption and decryption. The R core 142 can read the chip identifier in the E-fuse 143 and then generate a root key based on the chip identifier, and store the root key in the RAM 1423. The key encryption and decryption module 1421 of the R core 142 is mainly used to implement the above-mentioned Figure 7 The method shown in .
[0175] The secure communication module 1413 of the A core 141 and the secure communication module 1422 of the R core 142 communicate securely via the on-chip communication bus 145. For example, the R core 142 encrypts the generated session key using the root key and sends the encrypted session key to the A core 141 via the on-chip communication bus 145. The secure communication module 1413 of the A core 141 and the secure communication module 1422 of the R core 142 are mainly used to implement the above-mentioned Figure 5 The method shown in .
[0176] The beneficial technical effects corresponding to the above exemplary embodiment of the system on chip 140 can be found in the corresponding beneficial technical effects of the above exemplary method part, which will not be repeated here.
[0177] Exemplary Electronic Devices
[0178] Fig.15 A structural diagram of an electronic device 150 provided in an embodiment of the present disclosure includes at least one processor 151 and a memory 152 .
[0179] The processor 151 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 150 to perform desired functions.
[0180] The memory 152 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 151 may execute one or more computer program instructions to implement the key management method based on the system-on-chip and / or other desired functions of the various embodiments of the present disclosure described above.
[0181] In one example, the electronic device 150 may further include: an input device 153 and an output device 154 , and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0182] The input device 153 may also include, for example, a keyboard, a mouse, etc.
[0183] The output device 154 can output various information to the outside, and may include, for example, a display, a speaker, a printer, a communication network and its connected remote output device, etc.
[0184] Of course, to simplify, Fig.15 Only some of the components related to the present disclosure in the electronic device 150 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device 150 may also include any other appropriate components.
[0185] Exemplary computer program products and computer-readable storage media
[0186] In addition to the above-mentioned methods and devices, embodiments of the present disclosure may also provide a computer program product, including computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the on-chip system-based key management method of various embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section.
[0187] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0188] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the key management method based on the on-chip system of various embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section.
[0189] Computer readable storage media can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium is, for example, but not limited to, a system, device or device including electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0190] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and cannot be considered as necessary for each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, rather than limitation, and the above details do not limit the present disclosure to being implemented by adopting the above specific details.
[0191] Those skilled in the art may make various changes and modifications to the present disclosure without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the present disclosure claims and their equivalents, the present disclosure is also intended to include these modifications and variations.
Claims
1. A key management method based on a system on chip, comprising: The first processor core in the system on chip determines the data to be protected and a first encryption session key corresponding to the data to be protected, and sends the first encryption session key to the second processor core in the system on chip; The second processor core decrypts the first encrypted session key based on the root key to obtain a first decrypted session key, and sends the first decrypted session key to the first processor core; The first processor core encrypts and decrypts the data to be protected based on the first decryption session key.
2. The method according to claim 1, wherein: The second processor core sends the first decryption session key to the first processor core, comprising: The second processor core determines a communication key; The second processor core encrypts the first decryption session key based on the communication key to obtain a second encryption session key; The second processor core sends the second encrypted session key to the first processor core.
3. The method according to claim 2, further comprising: The first processor core performs identity authentication on the second processor core to obtain an identity authentication result of the second processor core; In response to the identity authentication result indicating that the second processor core has passed authentication, the first processor core generates the communication key and sends the communication key to the second processor core.
4. The method according to claim 3, wherein: The first processor core performs identity authentication on the second processor core to obtain an identity authentication result of the second processor core, including: The first processor core generates a challenge response code, and sends the challenge response code encrypted by a public key to the second processor core; The first processor performs hash processing on the generated challenge response code to obtain a first hash value; The second processor core performs hash processing on the challenge response code decrypted by the private key to obtain a second hash value, and sends the second hash value encrypted by the private key to the first processor core; The first processor core determines an identity authentication result of the second processor core based on the first hash value and the second hash value decrypted by using the public key.
5. The method according to any one of claims 1 to 4, further comprising: The first processor core sends a session key trigger request to the second processor core; The second processor core determines a third session key based on the session key trigger request; The second processor core encrypts the third session key based on the root key to obtain a third encrypted session key, and sends the third encrypted session key to the first processor core, so that the first processor core stores the third encrypted session key.
6. The method according to claim 5, wherein: The first processor core in the system on chip determines data to be protected and a first encryption session key corresponding to the data to be protected, including: The first processor core in the system on chip determines the to-be-protected data corresponding to the target application and the access rights corresponding to the target application; In response to the target application having permission to access the third encrypted session key, the first processor core determines a first encrypted session key corresponding to the data to be protected from the third encrypted session key.
7. The method according to claim 5, wherein: The second processor core determines a third session key based on the session key trigger request, including: In response to the session key triggering request being a session key generation request, the second processor core generates the third session key; In response to the session key triggering request being a session key import request, the second processor core determines the third session key based on the session key carried in the session key import request.
8. The method according to any one of claims 1 to 4, further comprising: The second processor core reads a chip identifier corresponding to the system on chip from a one-time programmable memory; The second processor core generates and stores the root key based on the chip identification.
9. A system on chip, comprising: The first processor core is used to determine the data to be protected and a first encryption session key corresponding to the data to be protected, and send the first encryption session key to the second processor core in the system on chip; The second processor core is configured to decrypt the first encrypted session key based on the root key to obtain a first decrypted session key, and send the first decrypted session key to the first processor core; The first processor core is further configured to encrypt and decrypt the data to be protected based on the first decryption session key.
10. The system according to claim 9, further comprising: A one-time programmable memory, used for storing a chip identifier corresponding to the system on chip; The second processor core is further configured to read the chip identification in the one-time programmable memory and generate the root key based on the chip identification.
11. A computer-readable storage medium storing a computer program, wherein the computer program is used to execute the key management method based on a system on a chip according to any one of claims 1 to 8.
12. An electronic device, comprising: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the key management method based on the on-chip system as described in any one of claims 1-8 above.
