Vehicle-mounted secret key storage method and device and in-vehicle infotainment system

By importing the key into the first directory of the vehicle computer system and saving it to the TEE module, the security and experiential problems of the on-board chip key storage solution are solved, the secure storage and rapid recovery of the key is realized, and the vehicle computer system is improved security and backup and recovery convenience.

CN119030707APending Publication Date: 2024-11-26HUIZHOU DESAY SV AUTOMOTIVE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411038399.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

The existing automotive chip key storage solutions have problems with poor security and poor experience. The key KEY is stored in plain text and cannot be re-imported, resulting in major security risks and user experience impacts when keys are leaked and lost.

Method used

Import the target key into the first directory of the vehicle computer system and save it to the TEE module, delete the key in the first directory, and extract it from the TEE module to the second directory through the key acquisition interface. If the extraction is successful, create a tag. Otherwise, the key is restored by the certificate file to perform the backup recovery program to achieve secure storage and rapid recovery of the key.

Benefits of technology

It improves the security of the vehicle system and backup and recovery convenience, ensures that the key can be quickly recovered when lost, and enhances the security and storage reliability of the key.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119030707A_ABST
    Figure CN119030707A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to a vehicle-mounted secret key storage method and device and a vehicle-mounted infotainment system, after a target secret key is imported into a first directory, the target secret key is transferred to a TEE module to be safely stored, when the target secret key needs to be called, the target secret key is extracted to a second target from the TEE module through a secret key obtaining interface, and after the target secret key is extracted for the first time, the target secret key is stored in the second target; and encrypting and storing the target key into the backup partition through key backup. When the target key of the TEE module is lost, the target key can be obtained again through the backup recovery program. Secure storage of the target key and rapid recovery through the backup key when the key is lost are realized; and the safety and the backup recovery convenience of the in-vehicle infotainment system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of automotive electronic technology, and in particular to a vehicle-mounted key storage method, device and vehicle-mounted system. Background Art

[0002] In the automotive electronics industry, the "new four trends" of automobiles (electrification, networking, intelligence, and sharing) are driving cars to become more and more intelligent - higher end-side computing power, stronger connectivity, and richer cockpit functions. With the digitalization of automotive central control products, the "new four trends" of automobiles are raising the demand for information interaction to a new level and also raising the safety requirements of automobiles to a higher level. In order to ensure security, the key KEY is an important parameter for identity authentication and data encryption, which ensures the secure storage of the key KEY and is the basis for ensuring security. The key KEY storage solution currently implemented in mainstream automotive chips has the following problems: First of all, the KEY currently downloaded from the customer's backend service area is directly injected into the storage area of ​​the vehicle's central control during production. There is no access management to this area, and the current KEY is stored in plain text; the key KEY is a highly confidential asset. Once leaked, hackers can use these keys to "legally" access the customer's backend, resulting in the loss of confidential data of the customer's backend and information leakage, posing a major security risk.

[0003] Secondly, for this type of KEY that is imported once at the factory, there is no way to re-import the KEY after production. Therefore, once the stored KEY is lost due to the characteristics of the disk itself, the KEY function will be unusable, affecting the user experience. Summary of the invention

[0004] In view of the above problems, an example of the present invention provides a vehicle-mounted key storage method, device and vehicle-mounted system, which are used to solve the problems of poor security and poor experience of the key KEY storage solution implemented by the vehicle-mounted chip in the prior art.

[0005] According to one aspect of an example of the present invention, a vehicle-mounted key storage method is provided, the method comprising: Import the target key into the first directory of the vehicle system; Save the target key to the TEE module, and delete the target key of the first directory; According to the key request information, the target key is extracted from the TEE module to the second directory through the key acquisition interface, and if the extraction is successful, a first mark is created in the first target, otherwise, a backup and recovery program is executed according to the certificate file to restore the target key; The certificate file is obtained by backing up the target key of the second directory.

[0006] In some optional embodiments, the saving the target key to the TEE module and deleting the target key of the first directory specifically includes: Read the first directory, determine whether the target directory exists in the first directory, and if so, execute the following steps, otherwise, do not process; Call libkeystorage save() interface to save the target key into the key storage, and return the saved return value; Call the TEE interface, save the target key to the TEE module, and delete the target key in the first directory; A second mark is created in the first directory according to the saved return value.

[0007] In some optional embodiments, the target key is stored in the TEE module based on SFS secure storage and / or RPMB secure storage.

[0008] In some optional embodiments, extracting the target key from the TEE module to the second directory through the key acquisition interface according to the key request information specifically includes: Send request information to the TEE module through the libkeystorage get() interface; The TEE module extracts the target key to the second directory of the key storage through the TEE interface.

[0009] In some optional embodiments, the application of the vehicle system obtains the target key, specifically including: Receive application request information, extract the target key from the TEE module to the second directory through the key acquisition interface, and perform reference counting on the target key; When the reference count results in 0, the target key is released to the application.

[0010] In some optional embodiments, the certificate file is created by backing up the target key of the second directory, including: Determine whether the vehicle system has a certificate file. If not, do not process it. Otherwise, perform the following steps; For the target key of the second directory, call the keystore interface to encrypt the target key by using the public key, generate a backup key, and save the backup key to the backup partition; If the backup key is successfully saved to the backup partition, a certificate file is created.

[0011] In some optional embodiments, executing the backup recovery program according to the certificate file to recover the target key specifically includes: When the vehicle system satisfies the requirement that the certificate file exists and the first mark does not exist, the backup and recovery procedure is executed to restore the target key; otherwise, the backup and recovery procedure is not executed.

[0012] In some optional embodiments, executing the backup recovery program to recover the target key specifically includes: Obtaining a backup key of the backup partition, decrypting the backup key using a private key pre-stored in the vehicle system, generating a target key, and saving the target key in the first directory; Call libkeystorage save() interface to save the target key into the key storage; Call the TEE interface, save the target key to the TEE module, and delete the target key in the first directory.

[0013] According to another aspect of an embodiment of the present invention, a vehicle-mounted key storage device is provided, the device comprising: A key import module, used to import the target key into the first directory of the vehicle system; A TEE transfer module, used to save the target key to the TEE module and delete the target key in the first directory after the vehicle system is started; A key reading module is used to extract the target key from the TEE module to the second directory through the key acquisition interface. If the extraction is successful, a first mark is created at the first target; otherwise, a backup and recovery program is executed according to the certificate file to restore the target key, wherein the certificate file is obtained by backing up and creating the target key of the second directory.

[0014] According to another aspect of an embodiment of the present invention, there is provided a vehicle system, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the operation of the vehicle-mounted key storage method as described above.

[0015] The present invention provides a vehicle-mounted key storage method, device and vehicle-mounted system, and its beneficial effects are: after the target key is imported into the first directory, the present invention transfers the target key to the TEE module for safe storage, and when the target key needs to be called, the target key is extracted from the TEE module to the second target through the key acquisition interface, and after the target key is extracted for the first time, the target key is encrypted and stored in the backup partition through the key backup. When the target key of the TEE module is lost, the target key can be retrieved through the backup recovery program. The secure storage of the target key and the rapid recovery through the backup key when the key is lost are realized; the security of the vehicle-mounted system and the convenience of backup and recovery are improved.

[0016] The above description is only an overview of the technical solution of the example of the present invention. In order to more clearly understand the technical means of the embodiment of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the example of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present invention. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings. In the accompanying drawings: Figure 1 A flow chart showing a first embodiment of a vehicle key storage method according to the present invention; Figure 2 A schematic diagram of a process of saving a target key to a TEE module and deleting the target key of the first directory is shown; Figure 3 A schematic diagram showing the process of obtaining a certificate file by backing up and creating a target key in the second directory; Figure 4 A schematic diagram of the process of executing the backup and recovery program to restore the target key is shown; Figure 5 A schematic structural diagram of an embodiment of a vehicle-mounted key storage device of the present invention is shown; Figure 6 A structural schematic diagram of an embodiment of a vehicle system of the present invention is shown. DETAILED DESCRIPTION

[0018] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.

[0019] Embodiment 1: Figure 1The flowchart of the first embodiment of the vehicle key storage method of the present invention is shown, and the method is executed by the vehicle system. The vehicle system includes a REE module and a TEE module, wherein the REE module is the environment in which the current application runs, and the TEE module is a secure and trusted computing environment. The method includes: 110, import the target key into the first directory of the vehicle system; In step 110, the manufacturing host computer imports the target key uniformly into the first directory of the vehicle system, wherein the first directory may be a memory or register of the vehicle hardware abstraction layer. The target key may be imported into the vehicle systems of the same batch in batches.

[0020] 120, save the target key to the TEE module and delete the target key of the first directory; in step 120, save the target key to the TEE module and delete the target key of the first directory, specifically including: reading the first directory, determining whether the target directory exists in the first directory, if so, executing the following steps, otherwise no processing; calling the libkeystorage save() interface to save the target key to the key storage device and return the saved return value; calling the TEE interface to save the target key to the TEE module and delete the target key of the first directory; creating a second tag in the first directory according to the saved return value.

[0021] 130. According to the key request information, the target key is extracted from the TEE module to the second directory through the key acquisition interface. If the extraction is successful, a first mark is created at the first target. Otherwise, the backup and recovery program is executed according to the certificate file to restore the target key. In step 130, the target key is extracted from the TEE module to the second directory through the key acquisition interface, specifically including: receiving information from the libkeystorage get() interface; extracting the target key to the second directory of the key storage through the TEE interface.

[0022] The certificate file is created by backing up the target key of the second directory. Specifically, it includes: judging whether the certificate file exists in the vehicle system, if not, do not process it, otherwise execute the following steps; for the target key of the second directory, call the keystore interface to encrypt the target key through the public key, generate a backup key, and save the backup key to the backup partition; if the backup key is successfully saved to the backup partition, create a certificate file.

[0023] In this embodiment, after the target key is imported into the first directory, the present invention transfers the target key to the TEE module for safe storage. When the target key needs to be called, the target key is extracted from the TEE module to the second target through the key acquisition interface, and after the target key is extracted for the first time, the target key is encrypted and stored in the backup partition through key backup. When the target key of the TEE module is lost, the target key can be retrieved through the backup recovery program. The secure storage of the target key and the rapid recovery through the backup key when the key is lost are realized; the security of the vehicle system and the convenience of backup and recovery are improved.

[0024] In some optional embodiments, see Figure 2 , save the target key to the TEE module and delete the target key in the first directory, including: 210, read the first directory and determine whether there is a target directory in the first directory. If so, execute the following steps, otherwise do not process; in step 210, when the vehicle system is started, read the target key of the first directory. If the target key exists, execute step 220.

[0025] 220, calling the libkeystorage save() interface to save the target key into the key storage device, and returning the saved return value; in step 220, the target key is read from the first directory into the key storage device for temporary storage through the libkeystorage save() interface, and the saved return value is returned after successful storage.

[0026] 230, call the TEE interface, save the target key to the TEE module, and delete the target key of the first directory; in step 230, through the TEE interface, store the target key in the TEE module for secure storage; and delete the target key of the first directory to improve the security of key protection.

[0027] 240. Create a second tag in the first directory according to the saved return value. In step 240, by creating a second tag in the first directory, it is confirmed that the target key is saved in the TEE module.

[0028] In the above embodiments, the target key is stored in the TEE module based on SFS secure storage and / or RPMB secure storage.

[0029] In some optional embodiments, the extracting the target key from the TEE module to the second directory through the key acquisition interface specifically includes: receiving information from the libkeystorage get() interface; extracting the target key to the second directory of the key storage through the TEE interface. In an embodiment, specifically, the application of the vehicle system obtains the target key, specifically including: receiving application request information, extracting the target key from the TEE module to the second directory through the key acquisition interface, and performing reference counting on the target key; when the result of the reference count is 0, releasing the target key to the application.

[0030] In some optional embodiments, see Figure 3 The certificate file is created by backing up the target key of the second directory, and includes: 310, determine whether the vehicle system has a certificate file, if not, do not process it, otherwise execute the following steps; 320, for the target key of the second directory, call the keystore interface to encrypt the target key by using the public key, generate a backup key, and save the backup key to the backup partition; 330. If the backup key is successfully saved to the backup partition, create a certificate file.

[0031] In this embodiment, the target key can be stored in the backup partition when it is first stored in the second directory. When the target key is stored in the backup, step 330 is automatically executed to create a certificate file, wherein a release certificate is created by importpersist.flag(), and the release certificate is the certificate file. When the backup partition is cleared or the certificate file is lost, steps 320 and 330 are re-executed to back up the target key again. The backup partition can be a key storage device or other storage device, and the storage directory of the backup partition is / persist.

[0032] In addition, the target key can be backed up by reading the target key of the first directory when the target key is just imported into the first directory, calling the keystore interface to encrypt the target key with the public key, generating a backup key, and saving the backup key to the backup partition; and when the backup key is successfully saved to the backup partition, creating a certificate file. This solution is also within the protection scope of this application.

[0033] In the above scheme, the target key is encrypted by the public key, that is, the target key is encrypted by the public key, wherein the public key can be the key of the vehicle system's own encryption system, stored in the vehicle chip. In one example, the public key can be stored in the register of the 8155 chip.

[0034] In some optional embodiments, a backup recovery program is executed according to the certificate file to restore the target key, specifically including: when the certificate file exists in the vehicle system and the first mark does not exist, the backup recovery program is executed to restore the target key; otherwise, the backup recovery program is not executed.

[0035] See also Figure 4 , executing the backup and recovery procedure to restore the target key specifically includes: 410, obtaining a backup key of the backup partition, decrypting the backup key by using a private key pre-stored in the vehicle system, generating a target key, and saving the target key in a first directory; 420, calling libkeystorage save() interface to save the target key into the key storage; 430, calling the TEE interface, saving the target key to the TEE module, and deleting the target key in the first directory.

[0036] In this embodiment, the backup key of the backup partition can be obtained through the save key() acquisition function, and after obtaining the backup key, the backup key is decrypted by the private key pre-stored in the vehicle system. The target key is stored in the first directory after decryption, and then the target key is saved in the key storage by calling the libkeystorage save() interface; the TEE interface is called to save the target key in the TEE module, and the target key in the first directory is deleted. The backup and recovery of the target key is completed.

[0037] Embodiment 2: Figure 5 FIG. 2 shows a schematic diagram of the structure of an embodiment of a vehicle-mounted key storage device of the present invention. Figure 3 As shown, the vehicle-mounted key storage device 500 specifically includes: The key import module 510 is used to execute step 110. The key import module is also used to uniformly import the target key into the first directory of the vehicle system through the manufacturing host computer, wherein the first directory can be a memory or register of the vehicle hardware abstraction layer. The target key can be imported into the vehicle system of the same batch in batches.

[0038] The TEE transfer module 520 is used to execute step 120; the TEE transfer module is also specifically used to read the first directory, determine whether the target directory exists in the first directory, and if so, execute the following steps, otherwise no processing is performed; call the libkeystorage save() interface to save the target key to the key storage, and return the saved return value; call the TEE interface to save the target key to the TEE module, and delete the target key of the first directory; create a second tag in the first directory according to the saved return value.

[0039] The key reading module 530 is used to execute step 130. The key reading module 530 is also used to extract the target key from the TEE module to the second directory through the key acquisition interface, specifically including: receiving information from the libkeystorageget() interface; extracting the target key to the second directory of the key storage through the TEE interface. The certificate file is created by backing up the target key in the second directory.

[0040] After the target key is imported into the first directory, the present invention transfers the target key to the TEE module for safe storage. When the target key needs to be called, the target key is extracted from the TEE module to the second target through the key acquisition interface, and after the target key is extracted for the first time, the target key is encrypted and stored in the backup partition through the key backup. When the target key of the TEE module is lost, the target key can be retrieved through the backup recovery program. The target key can be securely stored and quickly restored through the backup key when the key is lost, thereby improving the security of the vehicle system and the convenience of backup and recovery.

[0041] Embodiment 3: Figure 6 The schematic diagram of the structure of the embodiment of the vehicle system of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the vehicle system.

[0042] like Figure 6 As shown, the vehicle system may include: a processor, a communication interface, a memory, and a communication bus.

[0043] The processor 610, the communication interface 640, and the memory 620 communicate with each other via the communication bus 630. The communication interface is used to communicate with other devices such as a client or other server network elements. The processor is used to execute the program 650, which can specifically execute the relevant steps in the above-mentioned embodiment of the vehicle-mounted key storage method.

[0044] Specifically, the program may include program code including computer executable instructions.

[0045] The processor may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the vehicle system may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0046] Memory is used to store programs. The memory may include high-speed RAM memory and may also include non-volatile memory, such as at least one disk storage.

[0047] The program can be called by the processor to enable the vehicle system to execute Figure 1 Step 110 to step 130.

[0048] According to another aspect of an embodiment of the present invention, there is provided a vehicle system, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the operations of step 110 to step 130 of the vehicle-mounted key storage method described above. This allows the target key to be retrieved through the backup recovery program when the target key of the TEE module is lost. This allows the target key to be securely stored and quickly restored through the backup key when the key is lost, thereby improving the security of the vehicle system and the convenience of backup and recovery.

[0049] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system or other device. In addition, the embodiments of the present invention are not directed to any particular programming language.

[0050] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. Similarly, in order to simplify the present invention and help understand one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. Wherein, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, wherein each claim itself is a separate embodiment of the present invention.

[0051] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and further may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive.

[0052] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.

Claims

1. A vehicle-mounted key storage method, characterized in that: The method comprises: Import the target key into the first directory of the vehicle system; Save the target key to the TEE module, and delete the target key of the first directory; According to the key request information, the target key is extracted from the TEE module to the second directory through the key acquisition interface, and if the extraction is successful, a first mark is created in the first target, otherwise, a backup and recovery program is executed according to the certificate file to restore the target key; The certificate file is obtained by backing up the target key of the second directory.

2. The vehicle-mounted key storage method according to claim 1, characterized in that: The step of saving the target key to the TEE module and deleting the target key of the first directory specifically includes: Read the first directory, determine whether the target directory exists in the first directory, and if so, execute the following steps, otherwise, do not process; Call libkeystorage save() interface to save the target key into the key storage, and return the saved return value; Call the TEE interface, save the target key to the TEE module, and delete the target key in the first directory; A second mark is created in the first directory according to the saved return value.

3. A vehicle-mounted key storage method according to claim 2, characterized in that: The target key is stored in the TEE module based on SFS secure storage and / or RPMB secure storage.

4. The vehicle-mounted key storage method according to claim 2, characterized in that: The extracting the target key from the TEE module to the second directory through the key acquisition interface according to the key request information specifically includes: Send request information to the TEE module through the libkeystorage get() interface; The TEE module extracts the target key to the second directory of the key storage through the TEE interface.

5. A vehicle-mounted key storage method according to claim 4, characterized in that: The application of the vehicle system obtains the target key, specifically including: Receive key request information from the application, extract the target key from the TEE module to the second directory through the key acquisition interface, and perform reference counting on the target key; When the reference count results in 0, the target key is released to the application.

6. The vehicle-mounted key storage method according to claim 1, characterized in that: The certificate file is created by backing up the target key of the second directory, and includes: Determine whether the vehicle system has a certificate file. If not, do not process it. Otherwise, perform the following steps; For the target key of the second directory, call the keystore interface to encrypt the target key by using the public key, generate a backup key, and save the backup key to the backup partition; If the backup key is successfully saved to the backup partition, a certificate file is created.

7. A vehicle-mounted key storage method according to claim 6, characterized in that: The step of executing the backup and recovery program according to the certificate file to recover the target key specifically includes: When the vehicle system satisfies the requirement that the certificate file exists and the first mark does not exist, the backup and recovery procedure is executed to restore the target key; otherwise, the backup and recovery procedure is not executed.

8. The vehicle-mounted key storage method according to claim 7, characterized in that: The executing of the backup and recovery program to restore the target key specifically includes: Obtaining a backup key of the backup partition, decrypting the backup key using a private key pre-stored in the vehicle system, generating a target key, and saving the target key in the first directory; Call libkeystorage save() interface to save the target key into the key storage; Call the TEE interface, save the target key to the TEE module, and delete the target key in the first directory.

9. A vehicle-mounted key storage device, characterized in that: The device comprises: A key import module, used to import the target key into the first directory of the vehicle system; A TEE transfer module, used to save the target key to the TEE module and delete the target key in the first directory after the vehicle system is started; A key reading module is used to extract the target key from the TEE module to the second directory through the key acquisition interface. If the extraction is successful, a first mark is created at the first target; otherwise, a backup and recovery program is executed according to the certificate file to restore the target key, wherein the certificate file is obtained by backing up and creating the target key of the second directory.

10. A vehicle computer system, characterized in that: include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the operation of the vehicle-mounted key storage method as described in any one of claims 1-8.