File protection method and system

By performing multi-layer digital signature and cyclic redundancy verification on OTA upgrade files, the security and authenticity of OTA upgrade files are solved, ensuring the security and user experience of the vehicle system upgrade.

CN120337310BActive Publication Date: 2025-08-26CHENGDU CELIS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510831977.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-20
Publication Date
2025-08-26
Estimated Expiration
2045-06-20

AI Technical Summary

Technical Problem

The prior art has failed to effectively hide and ensure the security and authenticity of OTA upgrade files.

Method used

By performing multi-layer digital signature and cyclic redundancy verification on the upgraded file package, including inner, implicit and outer signatures, and hiding and verification with the preset parameters of the target device, ensuring the integrity and authenticity of the file.

Benefits of technology

The security authentication and authenticity authentication of OTA upgrade files are realized to ensure the security and user experience of the vehicle system upgrade.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120337310B_ABST
    Figure CN120337310B_ABST
Patent Text Reader

Abstract

The present application provides a file protection method and system, including: obtaining an upgrade file package transmitted in advance or in real time through a file sending end, the upgrade file package is used to upgrade a target device, including a vehicle; then decrypting the upgrade file package to obtain a decrypted hash value and a cyclic redundancy check value; and confirming whether the upgrade file package has been tampered with based on the comparison result of the decrypted hash value with the target hash value, and the comparison result of the decrypted cyclic redundancy check value with the target check value; the target hash value is obtained by hashing the upgrade file package, and the target check value is obtained by performing a cyclic redundancy check on the upgrade file package. By confirming whether the upgrade file package has been tampered with, the present application can perform security authentication and authenticity authentication on the upgrade file, thereby ensuring the upgrade security requirements of the entire vehicle system when upgrading the vehicle, and improving user experience and security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of encryption technology, and in particular to a file protection method and system. Background Art

[0002] Over-the-Air (OTA) refers to the technology used to remotely update software or firmware for devices like vehicles and mobile phones. In the automotive sector, OTA has become a core function of intelligent connected vehicles, enabling rapid iteration, feature optimization, and vulnerability fixes, improving user experience and safety.

[0003] However, the related art does not describe how to hide OTA upgrade files or how to ensure the security and authenticity of OTA upgrade files. Summary of the Invention

[0004] In view of the above-mentioned shortcomings of the prior art, the purpose of this application is to provide a file protection method and system for solving the technical problems existing in the prior art.

[0005] To achieve the above-mentioned and other related purposes, the present application provides a file protection method, which is applied to a file receiving end and includes the following steps:

[0006] Obtaining an upgrade file package transmitted in advance or in real time by a file sending end, wherein the upgrade file package is used to upgrade a target device, wherein the target device includes a vehicle;

[0007] Decrypt the upgrade file package to obtain a decrypted hash value and a cyclic redundancy check value;

[0008] According to the comparison result of the decrypted hash value and the target hash value, and the comparison result of the decrypted cyclic redundancy check value and the target check value, confirm whether the upgrade file package has been tampered with; wherein, the target hash value is obtained by hashing the upgrade file package, and the target check value is obtained by performing a cyclic redundancy check on the upgrade file package.

[0009] In one embodiment of the present application, the process of decrypting the upgrade file package to obtain the decrypted hash value and cyclic redundancy check value includes:

[0010] Decrypting the inner digital signature of the upgrade file package to obtain an inner hash value; wherein the inner hash value is obtained by performing a hash calculation on the encrypted upgrade file of the upgrade file package;

[0011] and / or, performing decryption based on the implicit digital signature of the upgrade file package to obtain an implicit hash value and an implicit cyclic redundancy check value; wherein the implicit hash value is obtained by performing a hash calculation on implicit data corresponding to the upgrade file package, the implicit cyclic redundancy check value is obtained by performing a cyclic redundancy check on the implicit data, and the implicit data is obtained by adding preset parameters of the target device to the encrypted upgrade file and then hiding them;

[0012] And / or, decryption is performed based on the outer digital signature of the upgrade file package to obtain an outer hash value and an outer cyclic redundancy check value; wherein, the outer hash value is obtained by hashing the explicit file corresponding to the upgrade file package, and the outer cyclic redundancy check value is obtained by performing a cyclic redundancy check on the explicit file, and the explicit file includes the encrypted upgrade file, the inner digital signature, the implicit data, the implicit cyclic redundancy check value and the implicit digital signature.

[0013] In one embodiment of the present application, the process of confirming whether the upgrade file package has been tampered with based on the comparison result of the decrypted hash value with the target hash value, and the comparison result of the decrypted cyclic redundancy check value with the target check value includes:

[0014] Comparing the outer hash value with the target hash value, and if the outer hash value and the target hash value are equal, then comparing the outer cyclic redundancy check value with the target check value;

[0015] and, under the condition that the outer cyclic redundancy check value is equal to the target check value, comparing the inner hash value with the target hash value;

[0016] and, under the condition that the inner hash value is equal to the target hash value, comparing the implicit hash value with the target hash value;

[0017] and, under the condition that the implicit hash value is equal to the target hash value, comparing the implicit cyclic redundancy check value with the target check value;

[0018] Furthermore, under the condition that the implicit cyclic redundancy check value is equal to the target check value, the upgrade file package has not been tampered with.

[0019] In one embodiment of the present application, the process of confirming whether the upgrade file package has been tampered with based on the comparison result of the decrypted hash value with the target hash value, and the comparison result of the decrypted cyclic redundancy check value with the target check value, further includes:

[0020] Under the condition that the outer hash value is not equal to the target hash value, or under the condition that the outer cyclic redundancy check value is not equal to the target check value, or under the condition that the inner hash value is not equal to the target hash value, or under the condition that the implicit hash value is not equal to the target hash value, or under the condition that the implicit cyclic redundancy check value is not equal to the target check value, or under the condition that the number of comparisons between the outer hash value and the target hash value exceeds a preset number, or under the condition that the number of comparisons between the outer cyclic redundancy check value and the target check value exceeds a preset number, or under the condition that the number of comparisons between the inner hash value and the target hash value exceeds a preset number, or under the condition that the number of comparisons between the implicit hash value and the target hash value exceeds a preset number, or under the condition that the number of comparisons between the implicit hash value and the target hash value exceeds a preset number, the upgrade file package has been tampered with.

[0021] In one embodiment of the present application, the preset parameters include an electronic control unit identification code, an electronic control unit production serial number, a system on chip serial number, and a current physical time;

[0022] Among them, the electronic control units in the vehicle communicate with each other through a controller area network bus or an Ethernet bus to transmit communication messages and interact with signals, and the vehicle interacts with the file sending end through a cockpit domain controller to interact with data information.

[0023] The present application also provides a file protection method, which is applied to a file sending end, and the method comprises the following steps:

[0024] Encrypt the upgrade file content and obtain an inner digital signature based on the encrypted upgrade file;

[0025] Obtaining an implicit digital signature based on preset parameters of a target device; wherein the target device includes a vehicle;

[0026] An outer digital signature is generated according to the inner digital signature and the implicit digital signature, and an upgrade file package for upgrading the target device is obtained based on the outer digital signature.

[0027] In one embodiment of the present application, the method further includes:

[0028] Encrypting the upgrade file content to obtain an encrypted upgrade file;

[0029] Performing hash calculation on the encrypted upgrade file to obtain an inner hash value, and encrypting the inner hash value to obtain an inner digital signature;

[0030] Adding the preset parameters of the target device to the encrypted upgrade file and hiding them according to the preset permissions to form implicit data;

[0031] Performing a hash calculation on the implicit data to obtain an implicit hash value; and performing a cyclic redundancy check on the implicit data to obtain an implicit cyclic redundancy check value; and encrypting the implicit hash value and the implicit cyclic redundancy check value to obtain an implicit digital signature.

[0032] In one embodiment of the present application, the method further includes:

[0033] The encrypted upgrade file, the inner digital signature, the implicit data, the implicit cyclic redundancy check value, and the implicit digital signature are used as an explicit file, and a hash calculation is performed on the explicit file to obtain an outer hash value; a cyclic redundancy check is performed on the explicit file to obtain an outer cyclic redundancy check value; and the outer hash value and the outer cyclic redundancy check value are encrypted to obtain the outer digital signature.

[0034] The outer digital signature is associated with the explicit file to obtain an upgrade file package for upgrading the target device.

[0035] The present application also provides a file protection system, which is applied to a file receiving end, and the system includes:

[0036] A data acquisition module is used to obtain an upgrade file package transmitted in advance or in real time by a file sending end, wherein the upgrade file package is used to upgrade a target device, wherein the target device includes a vehicle;

[0037] A decryption module, configured to decrypt the upgrade file package to obtain a decrypted hash value and a cyclic redundancy check value;

[0038] A comparison protection module is used to confirm whether the upgrade file package has been tampered with based on the comparison result of the decrypted hash value and the target hash value, and the comparison result of the decrypted cyclic redundancy check value and the target check value; wherein the target hash value is obtained by hashing the upgrade file package, and the target check value is obtained by performing a cyclic redundancy check on the upgrade file package.

[0039] The present application also provides a file protection system, which is applied to a file sending end, and the system includes:

[0040] The inner digital signature module is used to encrypt the contents of the upgrade file and obtain the inner digital signature based on the encrypted upgrade file;

[0041] An implicit digital signature module, configured to obtain an implicit digital signature using preset parameters of a target device, wherein the target device includes a vehicle;

[0042] An outer digital signature module, configured to generate an outer digital signature based on the inner digital signature and the implicit digital signature;

[0043] An upgrade file package module is used to obtain an upgrade file package for upgrading the target device according to the outer digital signature.

[0044] As described above, the present application provides a file protection method and system, which has the following beneficial effects: obtaining an upgrade file package transmitted in advance or in real time through a file sending end, the upgrade file package is used to upgrade a target device, and the target device includes a vehicle; then decrypting the upgrade file package to obtain a decrypted hash value and a cyclic redundancy check value; and confirming whether the upgrade file package has been tampered with based on the comparison result of the decrypted hash value and the target hash value, as well as the comparison result of the decrypted cyclic redundancy check value and the target check value; wherein, the target hash value is obtained by performing a hash calculation on the upgrade file package, and the target check value is obtained by performing a cyclic redundancy check on the upgrade file package. It can be seen from this that the present application can perform security authentication and authenticity authentication on the upgrade file by confirming whether the upgrade file package has been tampered with, thereby ensuring the upgrade security requirements of the entire vehicle system when upgrading the vehicle, and improving user experience and security. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 A flowchart of a file protection method provided in one embodiment of the present application;

[0046] Figure 2 This is a schematic diagram of an interaction for generating an inner digital signature according to an embodiment of the present application;

[0047] Figure 3 This is a schematic diagram of an interaction for generating an outer digital signature according to an embodiment of the present application;

[0048] Figure 4 A schematic diagram of a process for generating an outer digital signature according to an embodiment of the present application;

[0049] Figure 5 A schematic diagram of performing hash calculations provided in an embodiment of the present application;

[0050] Figure 6 A flowchart of a file protection method provided in another embodiment of the present application;

[0051] Figure 7 A schematic diagram of performing hash value comparison provided in an embodiment of the present application;

[0052] Figure 8 A flowchart of a file protection method provided in another embodiment of the present application;

[0053] Figure 9 A schematic diagram of the hardware structure of a file protection system provided in one embodiment of the present application;

[0054] Figure 10 A schematic diagram of the hardware structure of a file protection system provided in another embodiment of the present application;

[0055] Figure 11 The figure is a schematic diagram of the hardware structure of a computer device suitable for implementing one or more embodiments of the present application. DETAILED DESCRIPTION

[0056] The following describes the embodiments of the present application by specific specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the content disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present application. It is understood that, in the absence of conflict, the features in the following embodiments and embodiments can be combined with each other. In addition, it is understood that the illustrations provided in the following embodiments only illustrate the basic concept of the present application in a schematic manner, and only the components related to the present application are shown in the drawings rather than being drawn according to the number, shape and size of the components during actual implementation. The type, quantity and proportion of each component during actual implementation can be a kind of arbitrary change, and its component layout type may also be more complicated.

[0057] Figure 1 A schematic diagram of a file protection method is shown. Specifically, in an exemplary embodiment, Figure 1 As shown, this embodiment provides a file protection method, which is applied to a file sending end, and the method includes the following steps:

[0058] S110, encrypting the upgrade file content and obtaining an inner digital signature based on the encrypted upgrade file;

[0059] S120, obtaining an implicit digital signature based on preset parameters of a target device; wherein the target device includes a vehicle;

[0060] S130 , generating an outer digital signature according to the inner digital signature and the implicit digital signature, and obtaining an upgrade file package for upgrading the target device based on the outer digital signature.

[0061] In some exemplary embodiments, the process of encrypting the content of the upgrade file and obtaining an inner digital signature based on the encrypted upgrade file may include: encrypting the content of the upgrade file to obtain an encrypted upgrade file; wherein the content of the upgrade file is used to form an upgrade file package; performing hash calculation on the encrypted upgrade file to obtain an inner hash value, and obtaining an inner digital signature by encrypting the inner hash value.

[0062] In some exemplary embodiments, the process of obtaining an implicit digital signature based on the preset parameters of the target device may include: adding the preset parameters of the target device to the encrypted upgrade file, and hiding them according to the preset permissions to form implicit data; performing a hash calculation on the implicit data to obtain an implicit hash value; and performing a cyclic redundancy check on the implicit data to obtain an implicit cyclic redundancy check value; and, encrypting the implicit hash value and the implicit cyclic redundancy check value to obtain an implicit digital signature.

[0063] In some exemplary embodiments, the process of generating an outer digital signature based on an inner digital signature and an implicit digital signature, and obtaining an upgrade file package for upgrading a target device based on the outer digital signature may include: taking the encrypted upgrade file, the inner digital signature, the implicit data, the implicit cyclic redundancy check value and the implicit digital signature as explicit files, and performing a hash calculation on the explicit file to obtain an outer hash value; and performing a cyclic redundancy check on the explicit file to obtain an outer cyclic redundancy check value; and encrypting the outer hash value and the outer cyclic redundancy check value to obtain an outer digital signature; and associating the outer digital signature with the explicit file to obtain an upgrade file package for upgrading the target device.

[0064] In some exemplary embodiments, a hash value may also be referred to as a HASH value, and a hash calculation may also be referred to as a HASH calculation. In some examples, the HASH algorithm used in performing the HASH calculation includes, but is not limited to, MD5, SHA-128, SHA-256, and other algorithms. The characteristics of the HASH algorithm are: (1) Input sensitivity: Any change in the original input information should result in a significant change in the new HASH value. (2) Irreversibility: Given a plaintext and a HASH algorithm, the HASH value can be calculated within a limited time and resources. However, given a HASH value, it is difficult to reverse the plaintext within a limited time. (3) Conflict avoidance: It is difficult to find two plaintexts with different contents such that their HASH values ​​are consistent.

[0065] In some exemplary embodiments, if the target device is a vehicle, the preset parameters of the target device include, but are not limited to, the electronic control unit (ECU) identification code, ECU production serial number, system on chip (SOC) serial number, and current physical time. ECUs within a vehicle communicate with each other via a controller area network (CAN) bus or Ethernet bus, and the vehicle exchanges data with the file sender via a cockpit domain controller. For example, ECUs within a cockpit domain controller communicate with each other via a controller area network bus or Ethernet bus. Therefore, the ECU identification code, ECU production serial number, SOC serial number, and current physical time can be saved in an encrypted upgrade file. Administrator privileges for the encrypted upgrade file can then be obtained, and the encrypted upgrade file containing the ECU identification code, ECU production serial number, SOC serial number, and current physical time can be hidden to form implicit data.

[0066] In some exemplary embodiments, the file sending end may be the cloud, and the file receiving end may be the vehicle.

[0067] In some exemplary embodiments, the generated HASH value may be encrypted using a private key to generate a corresponding digital signature.

[0068] In some exemplary embodiments, Figure 2 As shown, the encrypted upgrade file can be hashed to obtain an inner hash value, and then the inner hash value can be encrypted to obtain an inner digital signature.

[0069] In some exemplary embodiments, Figure 2 As shown, the HASH result or HASH value obtained by HASH calculation can also be expressed in the form of a letter digest; that is, the HASH result or HASH value can be expressed in the form of a letter digest.

[0070] In some exemplary embodiments, Figure 3 and Figure 4As shown, the implicit data is hashed to obtain an implicit hash value; a cyclic redundancy check (CRC) is performed on the implicit data to obtain an implicit CRC value; the implicit hash value and the implicit CRC value are then encrypted to obtain an implicit digital signature. The encrypted upgrade file, the inner digital signature, the implicit data, the implicit CRC value, and the implicit digital signature are then used as the explicit file. The explicit file is hashed to obtain an outer hash value; a CRC is performed on the explicit file to obtain an outer CRC value; and the outer hash value and the outer CRC value are encrypted to obtain an outer digital signature.

[0071] In some exemplary embodiments, the entire or partial process of performing hash calculation or HASH calculation can be referred to Figure 5 For example, in Figure 5 In the example, after the data content John Smlth is HASH calculated, the HASH value obtained is 02; after the data content Usa Smlth is HASH calculated, the HASH value obtained is 01; after the data content Sam Doe is HASH calculated, the HASH value obtained is 04; after the data content Sandra Dee is HASH calculated, the HASH value obtained can also be 02.

[0072] As can be seen, this method hashes the upgrade file to generate a digital signature. The ECU identification code, ECU production serial number, SOC serial number, and current physical time are then saved and hidden in an encrypted upgrade file to generate implicit data. The implicit data is then hashed and CRCed, and the implicit hash and CRC values ​​are encrypted to generate an implicit digital signature. The encrypted upgrade file, inner digital signature, implicit data, implicit CRC value, and implicit digital signature are then used as an explicit file. The explicit file is hashed and CRCed, and the outer hash and CRC values ​​are encrypted to generate an outer digital signature. Finally, the outer digital signature is associated with the explicit file to generate an upgrade file package for performing an OTA (Over-The-Air) upgrade on the target device (e.g., a vehicle). When an OTA upgrade is required for a vehicle, the integrity and authenticity of the upgrade file can be ensured by performing outer digital signature verification and CRC verification, implicit digital signature verification, implicit CRC verification, and inner digital signature verification, thereby meeting the security requirements for vehicle system upgrades. Therefore, this method effectively reduces the probability of hash value collisions through digital signatures and CRC checks. Furthermore, through multiple signature verification using both inner and outer digital signatures and CRC checks, the upgrade file is more resistant to collisions. Furthermore, the digital signature generated from the implicit file content cannot be collided with, ensuring the security of the entire vehicle system. Furthermore, this method supports multiple digital signatures and verifications, explicit and implicit digital certificate signing and verification, and upgrade data hiding.

[0073] Figure 6 A schematic diagram of a file protection method is shown. Specifically, in an exemplary embodiment, Figure 6 As shown, this embodiment provides a file protection method, which is applied to a file receiving end. The method includes the following steps:

[0074] S610, obtaining an upgrade file package transmitted in advance or in real time by a file sending end, where the upgrade file package is used to upgrade a target device, where the target device includes a vehicle;

[0075] S620, decrypting the upgrade file package to obtain a decrypted hash value and a cyclic redundancy check value;

[0076] S630, confirm whether the upgrade file package has been tampered with based on the comparison result of the decrypted hash value and the target hash value, and the comparison result of the decrypted cyclic redundancy check value and the target check value; wherein, the target hash value is obtained by hashing the upgrade file package, and the target check value is obtained by performing a cyclic redundancy check on the upgrade file package.

[0077] In some exemplary embodiments, the process of obtaining the target hash value by performing hash calculation on the upgrade file package is described in detail in the following example. Figure 7 As shown. Figure 7 In the Figure 7 The HASH value or letter summary in the middle upper row is used as the target hash value. Figure 7 The HASH value or letter summary in the middle and lower rows is used as the decrypted hash value. Figure 7 As shown, when performing hash value comparison, you can first remove the digital signature, then decrypt it with the public key to obtain the corresponding decrypted HASH value, and then perform HASH calculation on the upgrade file content itself as the target hash value. Then, the decrypted HASH value obtained is compared with the target hash value. If the two are consistent, it proves that the upgrade file has not been modified.

[0078] In some exemplary embodiments, decrypting the upgrade file package to obtain a decrypted hash value and cyclic redundancy check value may include: decrypting the upgrade file package based on an inner digital signature to obtain an inner hash value; wherein the inner hash value is obtained by hashing the encrypted upgrade file in the upgrade file package. As an example, the specific process of obtaining the inner hash value by hashing the encrypted upgrade file in the upgrade file package can be found in some of the aforementioned embodiments and will not be further described here.

[0079] In some exemplary embodiments, the process of decrypting the upgrade file package to obtain a decrypted hash value and a cyclic redundancy check value may include: decrypting the upgrade file package based on an implicit digital signature to obtain an implicit hash value and an implicit cyclic redundancy check value; wherein the implicit hash value is obtained by hashing the implicit data corresponding to the upgrade file package, the implicit cyclic redundancy check value is obtained by performing a cyclic redundancy check on the implicit data, and the implicit data is obtained by adding preset parameters of the target device to the encrypted upgrade file and then hiding them. As an example, the specific process of obtaining the implicit hash value by hashing the implicit data corresponding to the upgrade file package and / or obtaining the implicit cyclic redundancy check value by performing a cyclic redundancy check on the implicit data can be found in some of the above embodiments and will not be further described here.

[0080] In some exemplary embodiments, the process of decrypting the upgrade file package to obtain a decrypted hash value and a cyclic redundancy check value may include: decrypting the upgrade file package based on its outer digital signature to obtain an outer hash value and an outer cyclic redundancy check value; wherein the outer hash value is obtained by hashing the explicit file corresponding to the upgrade file package, and the outer cyclic redundancy check value is obtained by performing a cyclic redundancy check on the explicit file, the explicit file including the encrypted upgrade file, the inner digital signature, implicit data, an implicit cyclic redundancy check value, and the implicit digital signature. As an example, the specific process of obtaining the outer hash value by hashing the explicit file corresponding to the upgrade file package, and / or obtaining the outer cyclic redundancy check value by performing a cyclic redundancy check on the explicit file can be referred to in some of the above embodiments and will not be repeated here.

[0081] In some exemplary embodiments, based on the comparison results of the decrypted hash value and the target hash value, and the comparison results of the decrypted cyclic redundancy check value and the target check value, the process of confirming whether the upgrade file package has been tampered with may include: comparing the outer hash value and the target hash value, and under the condition that the outer hash value and the target hash value are equal, then comparing the outer cyclic redundancy check value and the target check value; and, under the condition that the outer cyclic redundancy check value and the target check value are equal, then comparing the inner hash value and the target hash value; and, under the condition that the inner hash value and the target hash value are equal, then comparing the implicit hash value and the target hash value; and, under the condition that the implicit hash value and the target hash value are equal, then comparing the implicit cyclic redundancy check value and the target check value; and, under the condition that the implicit cyclic redundancy check value and the target check value are equal, the upgrade file package has not been tampered with. The comparison process of the outer hash value and the target hash value, the comparison process of the inner hash value and the target hash value, and the comparison process of the implicit hash value and the target hash value can be found in [1]. Figure 7 The hash value comparison diagram shown is not repeated here.

[0082] In some exemplary embodiments, the process of confirming whether the upgrade file package has been tampered with based on the comparison result of the decrypted hash value and the target hash value, and the comparison result of the decrypted cyclic redundancy check value and the target check value may further include: if the outer hash value and the target hash value are not equal, or if the outer cyclic redundancy check value and the target check value are not equal, or if the inner hash value and the target hash value are not equal, or if the implicit hash value and the target hash value are not equal, or if the implicit cyclic redundancy check value and the target check value are not equal, or if the number of comparisons between the outer hash value and the target hash value exceeds a preset number, or if the number of comparisons between the outer cyclic redundancy check value and the target check value exceeds a preset number, or if the number of comparisons between the inner hash value and the target hash value exceeds a preset number, or if the number of comparisons between the implicit hash value and the target hash value exceeds a preset number, or if the number of comparisons between the implicit hash value and the target hash value exceeds a preset number, or if the number of comparisons between the implicit cyclic redundancy check value and the target check value exceeds a preset number, the upgrade file package has been tampered with. The comparison process between the outer hash value and the target hash value, the comparison process between the inner hash value and the target hash value, and the comparison process between the implicit hash value and the target hash value can be found in Figure 7 The hash value comparison diagram shown is not described in detail here. In some examples, the preset number of times can be set according to actual conditions, and the preset number of times is not limited to a specific value here. For example, the preset number of times can be set to 3 times.

[0083] In some exemplary embodiments, the preset parameters include an electronic control unit identification code, an electronic control unit production serial number, an on-chip system serial number, and the current physical time; wherein, the electronic control units in the vehicle communicate with each other through a controller area network bus or an Ethernet bus for message transmission and signal interaction, and the vehicle interacts with the file sender through a cockpit domain controller (CDC).

[0084] Figure 8 A schematic diagram of a file protection method is shown. Specifically, in an exemplary embodiment, Figure 8 As shown, this embodiment provides a file protection method, which includes the following steps:

[0085] The upgrade thread is started through the ECU in the vehicle, the upgrade text version is obtained from the file sender, and the upgrade file package is downloaded. The upgrade file package is hashed and CRC-checked to obtain the corresponding hash value and CRC value; and the outer digital signature of the upgrade file package is decrypted to obtain the outer hash value and outer CRC value.

[0086] Compare the outer HASH value with the HASH value obtained in the previous step. If the outer HASH value is equal to the HASH value obtained in the previous step, proceed to the next step. If the outer HASH value is not equal to the HASH value obtained in the previous step, exit the comparison directly to confirm that the upgrade file package has been tampered with. If the number of comparisons exceeds 3, exit the comparison directly to confirm that the upgrade file package has been tampered with. Also, compare the outer CRC value with the CRC value obtained in the previous step. If the outer CRC value is equal to the CRC value obtained in the previous step, proceed to the next step. If the outer CRC value is not equal to the CRC value obtained in the previous step, exit the comparison directly to confirm that the upgrade file package has been tampered with.

[0087] Perform hash calculation on the explicit file of the upgrade file package to obtain the corresponding hash value, and decrypt the digital signature of the explicit file to obtain the inner hash value;

[0088] Compare the inner HASH value with the HASH value obtained in the previous step. If the inner HASH value is equal to the HASH value obtained in the previous step, proceed to the next step. If the inner HASH value is not equal to the HASH value obtained in the previous step, exit the comparison directly to confirm that the upgrade file package has been tampered with. If the number of comparisons exceeds 3, exit the comparison directly to confirm that the upgrade file package has been tampered with.

[0089] Obtain management permissions for the upgrade file package, read hidden files, and perform HASH calculation and CRC verification on the implicit data of the upgrade file package to obtain the corresponding HASH value and CRC value; and decrypt the implicit digital signature of the upgrade file package to obtain the implicit HASH value and implicit CRC value.

[0090] Compare the implicit HASH value with the HASH value obtained in the previous step. If the implicit HASH value is equal to the HASH value obtained in the previous step, proceed to the next step. If the implicit HASH value is not equal to the HASH value obtained in the previous step, exit the comparison immediately to confirm that the upgrade file package has been tampered with. If the number of comparisons exceeds 3, exit the comparison immediately to confirm that the upgrade file package has been tampered with. Also, compare the implicit CRC value with the CRC value obtained in the previous step. If the implicit CRC value is equal to the CRC value obtained in the previous step, proceed to the next step. If the implicit CRC value is not equal to the CRC value obtained in the previous step, exit the comparison immediately to confirm that the upgrade file package has been tampered with.

[0091] It can be seen that when an OTA upgrade is required for a target device (such as a vehicle), this method can ensure the integrity and authenticity of the upgrade file by performing outer digital signature verification and CRC verification, implicit digital signature verification, implicit CRC verification, and inner digital signature verification, thereby meeting the security requirements of the entire vehicle system upgrade. Therefore, this method effectively reduces the probability of HASH value collisions through digital signatures and CRC verification. At the same time, through multiple signature verifications of inner and outer digital signatures and CRC verification, the upgrade file can have better collision resistance; and the digital signature generated from the implicit file content cannot be collided, ensuring the security of the entire vehicle system. At the same time, this method supports multiple digital signatures and verifications, supports explicit and implicit digital certificate signing and verification, and supports upgrading data hiding.

[0092] In another exemplary embodiment of the present application, Figure 9 As shown, this embodiment provides a file protection system, which is applied to a file sending end and includes:

[0093] The inner digital signature module 101 is used to encrypt the content of the upgrade file and obtain an inner digital signature based on the encrypted upgrade file;

[0094] An implicit digital signature module 102 is configured to obtain an implicit digital signature using preset parameters of a target device, wherein the target device includes a vehicle;

[0095] The outer digital signature module 103 is used to generate an outer digital signature based on the inner digital signature and the implicit digital signature;

[0096] The upgrade file package module 104 is configured to obtain an upgrade file package for upgrading the target device according to the outer digital signature.

[0097] It can be understood that the file protection system provided by the above embodiment and the file protection method provided by the above embodiment belong to the same concept, wherein the specific manner in which the file protection method performs operations has been described in detail in the above embodiment and will not be repeated here. In actual applications, the file protection system provided by the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the file protection system into different functional modules, and then implement all or part of the functions of the corresponding functional modules through the file protection method described in the above embodiment. No specific restrictions are imposed here. For example, the inner digital signature module 101 can be used to execute step S110 and the steps associated therewith, the implicit digital signature module 102 can be used to execute step S120 and the steps associated therewith, and the outer digital signature module 103 and the upgrade file package module 104 can be used to execute step S130 and the steps associated therewith. The specific execution process can be found in the above embodiment and will not be repeated here.

[0098] As can be seen, this system hashes the upgrade file to generate a digital signature. It then saves the ECU identification code, ECU production serial number, SOC serial number, and current physical time into an encrypted upgrade file and hides the data, generating implicit data. The implicit data is then hashed and CRCed, and the implicit hash and CRC values ​​are encrypted to generate an implicit digital signature. The encrypted upgrade file, inner digital signature, implicit data, implicit CRC value, and implicit digital signature are then used as an explicit file. The explicit file is hashed and CRCed, and the outer hash and CRC values ​​are encrypted to generate an outer digital signature. Finally, the outer digital signature is associated with the explicit file to generate the upgrade file package used for OTA (Over-The-Air) upgrades of the target device (e.g., a vehicle). When an OTA upgrade is required for a vehicle, the integrity and authenticity of the upgrade file are ensured by performing outer digital signature verification and CRC verification, implicit digital signature verification, implicit CRC verification, and inner digital signature verification, thereby meeting the security requirements of vehicle system upgrades. Therefore, this system effectively reduces the probability of hash value collisions through digital signatures and CRC checks. Furthermore, through multiple signature verification using both inner and outer digital signatures and CRC checks, upgrade files are more resistant to collisions. Furthermore, digital signatures generated from implicit file content cannot be collided with, ensuring the security of the entire vehicle system. Furthermore, this system supports multiple digital signatures and verifications, explicit and implicit digital certificate signing and verification, and upgrade data hiding.

[0099] In another exemplary embodiment of the present application, Figure 10 As shown, this embodiment provides a file protection system, which is applied to a file receiving end and includes:

[0100] The data acquisition module 111 is used to obtain an upgrade file package transmitted in advance or in real time by a file sending end, wherein the upgrade file package is used to upgrade a target device, including a vehicle;

[0101] Decryption module 112, used to decrypt the upgrade file package to obtain a decrypted hash value and a cyclic redundancy check value;

[0102] The comparison protection module 113 is used to confirm whether the upgrade file package has been tampered with based on the comparison result of the decrypted hash value and the target hash value, and the comparison result of the decrypted cyclic redundancy check value and the target check value; wherein, the target hash value is obtained by hashing the upgrade file package, and the target check value is obtained by performing a cyclic redundancy check on the upgrade file package.

[0103] It can be understood that the file protection system provided by the above embodiment and the file protection method provided by the above embodiment belong to the same concept, wherein the specific manner in which the file protection method performs operations has been described in detail in the above embodiment and will not be repeated here. In actual applications, the file protection system provided by the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the file protection system into different functional modules, and then implement all or part of the functions of the corresponding functional modules through the file protection method described in the above embodiment. There is no specific limitation on this here. For example, the data acquisition module 111 can be used to execute step S610 and the steps associated therewith, the decryption module 112 can be used to execute step S620 and the steps associated therewith, and the comparison protection module 113 can be used to execute step S630 and the steps associated therewith. The specific execution process can be found in the above embodiment and will not be repeated here.

[0104] As can be seen, when an OTA upgrade is required for a target device (such as a vehicle), this system ensures the integrity and authenticity of the upgrade file by performing outer digital signature verification and CRC verification, implicit digital signature verification, implicit CRC verification, and inner digital signature verification, thereby meeting the security requirements of the entire vehicle system upgrade. Therefore, this system effectively reduces the probability of hash value collisions through digital signatures and CRC verification. At the same time, through multiple signature verifications of inner and outer digital signatures and CRC verification, the upgrade file has better collision resistance. In addition, the digital signature generated from the implicit file content cannot be collided, ensuring the security of the entire vehicle system. At the same time, this system supports multiple digital signatures and verifications, supports explicit and implicit digital certificate signing and verification, and supports the hiding of upgrade data.

[0105] The embodiment of the present application further provides a computer device, which may include a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program so that the computer device executes Figure 1 、 Figure 6 and / or Figure 8 The steps of the file protection method. Figure 11 FIG1 shows a schematic diagram of the structure of a computer device 1000. Figure 11 As shown, the computer device 1000 includes: a processor 1010 , a memory 1020 , a power supply 1030 , a display unit 1040 , and an input unit 1060 .

[0106] The processor 1010 is the control center of the computer device 1000. It connects various components using various interfaces and lines, and performs various functions of the computer device 1000 by running or executing computer programs / instructions stored in the memory 1020, thereby monitoring the computer device 1000 as a whole. In the embodiment of the present application, when the processor 1010 calls the computer program stored in the memory 1020, it executes the following Figure 1 、 Figure 6 and / or Figure 8 The steps of the file protection method are as follows. Optionally, processor 1010 may include one or more processing units; preferably, processor 1010 may integrate an application processor and a modem processor, wherein the application processor primarily processes the operating system, user interface, and applications, and the modem processor primarily processes wireless communications. In some embodiments, the processor and memory may be implemented on a single chip; in some embodiments, they may also be implemented on separate chips.

[0107] The memory 1020 may primarily include a program storage area and a data storage area. The program storage area may store an operating system, various applications, and the like; the data storage area may store instruction data and the like generated based on the use of the computer device 1000. Furthermore, the memory 1020 may include a high-speed random access memory and a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device.

[0108] The computer device 1000 also includes a power supply 1030 (such as a battery) for supplying power to various components. The power supply can be logically connected to the processor 1010 through a power management system, thereby managing functions such as charging, discharging, and power consumption through the power management system.

[0109] The display unit 1040 can be used to display information input by the user or information provided to the user, as well as various menus of the computer device 1000. In the embodiment of the present application, it is mainly used to display the display interface of each application in the computer device 1000 and objects such as text and images displayed on the display interface. The display unit 1040 may include a display panel 1050. The display panel 1050 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.

[0110] The input unit 1060 can be used to receive user input, such as numbers or characters. The input unit 1060 may include a touch panel 1070 and other input devices 1080. The touch panel 1070, also known as a touch screen, can receive user touch operations on or near it (e.g., operations performed by a user using a finger, stylus, or any other suitable object or accessory on or near the touch panel 1070).

[0111] Specifically, the touch panel 1070 can detect user touch operations and the signals generated by the touch operations, convert these signals into touch point coordinates, and transmit them to the processor 1010. Furthermore, the touch panel 1070 can receive and execute commands from the processor 1010. Furthermore, the touch panel 1070 can be implemented using various types, such as resistive, capacitive, infrared, and surface acoustic wave. Other input devices 1080 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick.

[0112] Of course, the touch panel 1070 can cover the display panel 1050. When the touch panel 1070 detects a touch operation on or near it, it transmits it to the processor 1010 to determine the type of touch event. Then the processor 1010 provides corresponding visual output on the display panel 1050 according to the type of touch event. Figure 11 In the embodiment, the touch panel 1070 and the display panel 1050 are two independent components to realize the input and output functions of the computer device 1000, but in some embodiments, the touch panel 1070 and the display panel 1050 can be integrated to realize the input and output functions of the computer device 1000.

[0113] The computer device 1000 may further include one or more sensors, such as a pressure sensor, a gravity acceleration sensor, a proximity light sensor, etc. Of course, according to the needs of specific applications, the computer device 1000 may also include other components such as a camera.

[0114] The embodiment of the present application further provides a computer-readable storage medium, in which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the above-mentioned device can perform the above-mentioned Figure 1 、 Figure 6 and / or Figure 8 The steps of the file protection method.

[0115] It will be understood by those skilled in the art that Figure 11This is merely an example of a computer device and does not constitute a limitation of the device. The device may include more or fewer components than shown, or may combine certain components or different components. For ease of description, the above sections are divided into modules (or units) based on their functions and described separately. Of course, when implementing this application, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.

[0116] It will be understood by those skilled in the art that the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be applied to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the functions in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including the instruction device, which implements the function specified in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0117] It is understood that the collection, storage, use, processing, transmission, provision, disclosure, and deletion of relevant data (e.g., file upgrade packages, vehicle preset parameters, etc.) in the above embodiments are performed with or with the user's consent. For example, file upgrade packages and vehicle preset parameters are obtained with the user's knowledge and consent; or they are proactively provided by the user after reading the relevant instructions; or they are proactively authorized / provided / uploaded by the user when using some or all of the functions described in the above embodiments; or they are obtained through other means or channels with or with the user's consent.

[0118] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Anyone skilled in the art may modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by one of ordinary skill in the art without departing from the spirit and technical concepts disclosed in this application shall be covered by the claims of this application.

Claims

1. A file protection method, characterized in that: Applied to a file receiving end, the method comprises the following steps: Obtaining an upgrade file package transmitted in advance or in real time by a file sending end, wherein the upgrade file package is used to upgrade a target device, wherein the target device includes a vehicle; Decrypting based on the upgrade file package to obtain a decrypted hash value and a cyclic redundancy check value; including: decrypting based on the inner digital signature of the upgrade file package to obtain an inner hash value; wherein the inner hash value is obtained by performing a hash calculation on the encrypted upgrade file of the upgrade file package; and / or, decrypting based on the implicit digital signature of the upgrade file package to obtain an implicit hash value and an implicit cyclic redundancy check value; wherein the implicit hash value is obtained by performing a hash calculation on the implicit data corresponding to the upgrade file package, and the implicit cyclic redundancy check value is obtained by performing a cyclic redundancy check on the implicit data. The implicit data is obtained by adding the preset parameters of the target device to the encrypted upgrade file and then hiding them; and / or, decrypting the upgrade file package based on the outer digital signature to obtain an outer hash value and an outer cyclic redundancy check value; wherein the outer hash value is obtained by hashing the explicit file corresponding to the upgrade file package, and the outer cyclic redundancy check value is obtained by performing a cyclic redundancy check on the explicit file, and the explicit file includes the encrypted upgrade file, the inner digital signature, the implicit data, the implicit cyclic redundancy check value, and the implicit digital signature; According to the comparison result of the decrypted hash value and the target hash value, and the comparison result of the decrypted cyclic redundancy check value and the target check value, confirm whether the upgrade file package has been tampered with; wherein, the target hash value is obtained by hashing the upgrade file package, and the target check value is obtained by performing a cyclic redundancy check on the upgrade file package.

2. The file protection method according to claim 1, characterized in that: The process of confirming whether the upgrade file package has been tampered with based on the comparison result of the decrypted hash value with the target hash value, and the comparison result of the decrypted cyclic redundancy check value with the target check value includes: Comparing the outer hash value with the target hash value, and if the outer hash value and the target hash value are equal, then comparing the outer cyclic redundancy check value with the target check value; and, under the condition that the outer cyclic redundancy check value is equal to the target check value, comparing the inner hash value with the target hash value; and, under the condition that the inner hash value is equal to the target hash value, comparing the implicit hash value with the target hash value; and, under the condition that the implicit hash value is equal to the target hash value, comparing the implicit cyclic redundancy check value with the target check value; Furthermore, under the condition that the implicit cyclic redundancy check value is equal to the target check value, the upgrade file package has not been tampered with.

3. The file protection method according to claim 2, characterized in that: The process of confirming whether the upgrade file package has been tampered with according to the comparison result of the decrypted hash value with the target hash value, and the comparison result of the decrypted cyclic redundancy check value with the target check value, further includes: Under the condition that the outer hash value is not equal to the target hash value, or under the condition that the outer cyclic redundancy check value is not equal to the target check value, or under the condition that the inner hash value is not equal to the target hash value, or under the condition that the implicit hash value is not equal to the target hash value, or under the condition that the implicit cyclic redundancy check value is not equal to the target check value, or under the condition that the number of comparisons between the outer hash value and the target hash value exceeds a preset number, or under the condition that the number of comparisons between the outer cyclic redundancy check value and the target check value exceeds a preset number, or under the condition that the number of comparisons between the inner hash value and the target hash value exceeds a preset number, or under the condition that the number of comparisons between the implicit hash value and the target hash value exceeds a preset number, or under the condition that the number of comparisons between the implicit hash value and the target hash value exceeds a preset number, the upgrade file package has been tampered with.

4. The file protection method according to any one of claims 1 to 3, characterized in that: The preset parameters include an electronic control unit identification code, an electronic control unit production serial number, a system-on-chip serial number, and a current physical time; Among them, the electronic control units in the vehicle communicate with each other through a controller area network bus or an Ethernet bus to transmit communication messages and interact with signals, and the vehicle interacts with the file sending end through a cockpit domain controller to interact with data information.

5. A file protection method, characterized in that: Applied to the file sending end, the method includes the following steps: Encrypt the upgrade file content and obtain an inner digital signature based on the encrypted upgrade file; Obtaining an implicit digital signature based on preset parameters of a target device, comprising: adding the preset parameters of the target device to the encrypted upgrade file and hiding them according to preset permissions to form implicit data; performing a hash calculation on the implicit data to obtain an implicit hash value; and performing a cyclic redundancy check on the implicit data to obtain an implicit cyclic redundancy check value; and encrypting the implicit hash value and the implicit cyclic redundancy check value to obtain an implicit digital signature; wherein the target device includes a vehicle; An outer digital signature is generated according to the inner digital signature and the implicit digital signature, and an upgrade file package for upgrading the target device is obtained based on the outer digital signature.

6. The file protection method according to claim 5, characterized in that: The method further comprises: Encrypting the upgrade file content to obtain an encrypted upgrade file; A hash calculation is performed on the encrypted upgrade file to obtain an inner hash value, and an inner digital signature is obtained by encrypting the inner hash value.

7. The file protection method according to claim 6, characterized in that: The method further comprises: The encrypted upgrade file, the inner digital signature, the implicit data, the implicit cyclic redundancy check value, and the implicit digital signature are used as an explicit file, and a hash calculation is performed on the explicit file to obtain an outer hash value; a cyclic redundancy check is performed on the explicit file to obtain an outer cyclic redundancy check value; and the outer hash value and the outer cyclic redundancy check value are encrypted to obtain the outer digital signature. The outer digital signature is associated with the explicit file to obtain an upgrade file package for upgrading the target device, where the target device includes a vehicle.

8. A file protection system, characterized in that: Applied to a file receiving end, the system includes: A data acquisition module is used to obtain an upgrade file package transmitted in advance or in real time by a file sending end, wherein the upgrade file package is used to upgrade a target device, wherein the target device includes a vehicle; A decryption module is configured to decrypt the upgrade file package to obtain a decrypted hash value and a cyclic redundancy check value; the decryption module comprises: decrypting based on an inner digital signature of the upgrade file package to obtain an inner hash value; wherein the inner hash value is obtained by performing a hash calculation on the encrypted upgrade file of the upgrade file package; and / or decrypting based on an implicit digital signature of the upgrade file package to obtain an implicit hash value and an implicit cyclic redundancy check value; wherein the implicit hash value is obtained by performing a hash calculation on the implicit data corresponding to the upgrade file package, and the implicit cyclic redundancy check value is obtained by performing a cyclic calculation on the implicit data. The implicit data is obtained by adding preset parameters of the target device to the encrypted upgrade file and then hiding them; and / or, decrypting the upgrade file package based on its outer digital signature to obtain an outer hash value and an outer cyclic redundancy check value; wherein the outer hash value is obtained by hashing the explicit file corresponding to the upgrade file package, and the outer cyclic redundancy check value is obtained by performing a cyclic redundancy check on the explicit file, and the explicit file includes the encrypted upgrade file, the inner digital signature, the implicit data, the implicit cyclic redundancy check value, and the implicit digital signature; A comparison protection module is used to confirm whether the upgrade file package has been tampered with based on the comparison result of the decrypted hash value and the target hash value, and the comparison result of the decrypted cyclic redundancy check value and the target check value; wherein the target hash value is obtained by hashing the upgrade file package, and the target check value is obtained by performing a cyclic redundancy check on the upgrade file package.

9. A file protection system, characterized in that: Applied to the file sending end, the system includes: The inner digital signature module is used to encrypt the contents of the upgrade file and obtain the inner digital signature based on the encrypted upgrade file; An implicit digital signature module, configured to obtain an implicit digital signature using preset parameters of a target device, comprising: adding the preset parameters of the target device to the encrypted upgrade file and hiding them according to preset permissions to form implicit data; performing a hash calculation on the implicit data to obtain an implicit hash value; performing a cyclic redundancy check on the implicit data to obtain an implicit cyclic redundancy check value; and encrypting the implicit hash value and the implicit cyclic redundancy check value to obtain an implicit digital signature; wherein the target device includes a vehicle; An outer digital signature module, configured to generate an outer digital signature based on the inner digital signature and the implicit digital signature; An upgrade file package module is used to obtain an upgrade file package for upgrading the target device according to the outer digital signature.

Citation Information

Patent Citations

  • Vehicle verification method, related device and system

    CN117195216A

  • Firmware upgrade package verification method and device, terminal and storage medium

    CN119128887A