METHOD FOR VERIFYING DIGITAL SIGNATURE, VEHICLE COMPUTING UNIT, AND VEHICLE - Patent application

By calculating and storing hash values for each block in flash memory during data writing, the method accelerates digital signature verification, enhancing data access speed and cybersecurity in vehicle computing units.

JP7663777B2Active Publication Date: 2025-04-16MERCEDES BENZ GROUP AG
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
JP2024504907
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2021-07-27
Filing Date
2022-07-20
Publication Date
2025-04-16
Estimated Expiration
2042-07-20

AI Technical Summary

Technical Problem

Existing methods for verifying digital signatures in flash memory are time-consuming, as they require calculating and comparing hash values for each data access, which slows down data reading, writing, and booting processes.

Method used

A method where the flash memory calculates and stores hash values for each block during data writing, allowing for faster signature verification by calculating a validation hash from the stored hashes rather than re-calculating hash values from the data itself.

Benefits of technology

This approach significantly speeds up the verification of digital signatures, allowing for faster data access, booting, and software updates, while maintaining cybersecurity by ensuring only trusted data is executed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007663777000001
    Figure 0007663777000001
  • Figure 0007663777000002
    Figure 0007663777000002
  • Figure 0007663777000003
    Figure 0007663777000003
Patent Text Reader

Abstract

The invention relates to a method for verifying a digital signature, in which a hash function is applied to data stored in a flash memory (1) to create a hash that is processed to generate a signature. The invention relates to a method for verifying a digital signature, in which a hash function is applied to data stored in a flash memory (1) to create a hash that is processed to generate a signature, the method comprising at least the following method steps: writing data to at least one memory element (1.1) of the flash memory (1), calculating for each written block (2) of the flash memory (1) a hash from the data written in the respective block (2) by a memory controller (1.2) of the flash memory (1) and storing the calculated hash together with the data in the block (2), and calculating a verification hash (#V) by applying the hash function by the memory controller (1.2) to the at least one hash stored in the block (2). The method includes the steps of: reading at least one hash and a verification hash (#V) stored in a block (2) for which a signature is to be verified by a system (3) higher than the flash memory (1); calculating a check hash (#P) ​​by applying a hash function to the at least one read hash by the system (3) higher than the flash memory (1); comparing the calculated check hash (#P) ​​with the read verification hash (#V); and authenticating the signature if the check hash (#P) ​​matches the verification hash (#V).
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a method for verifying a digital signature of the kind defined in the preamble of claim 1, a vehicle computing unit comprising a flash memory, and a vehicle comprising such a vehicle computing unit. [Background technology]

[0002] With the increasing digitalization, the degree of automation of vehicles is also increasing. To this end, vehicles have ever-increasing numbers and complexity of computing units for evaluating sensor signals and calculating control quantities. To provide functionality, machine-readable code is executed by such computing units. Such code is stored in the form of software in physical data storage devices. To import new functionality, remove bugs and / or close security holes, such software is updated by software updates.

[0003] During the initial boot of the vehicle computing unit, for example when the vehicle is started, data is read from the physical data storage device. Furthermore, when a software update is imported, the data can be overwritten or erased in addition to being read. To prevent unauthorized use of the data stored in the computing unit or in the physical data storage device, the data is typically digitally signed, which can be used to recognize whether the data has been tampered with by a third party or whether the software update originates from a trusted sender. This makes it possible to ensure that only code from a trusted source is executed in the processor of the computing unit.

[0004] One of the techniques underlying digital signatures is the calculation of so-called hash values. To calculate a hash value, any data, for example a text document, an image, an email, a program code or a program code module, is used as input variable for a mathematical function that calculates a string of any length from the data in question. The string can contain numbers and / or letters. The mathematical function used for this purpose is also called a hash function and is ideally a deterministic function, i.e. using the same input data, the same result, i.e. the same hash value, is always calculated using a certain hash function. The hash function must then be strong enough that there is no different data that can lead to the same hash value.

[0005] A checksum is used to check whether data stored in a memory element of a physical data storage device has been written "correctly". This is called a cyclic redundancy check (CRC). For example, errors can occur when writing data and / or reading it from the data storage device, which causes the data to be read or written incorrectly. A CRC is suitable for recognizing random errors. If it is also desired to additionally check the integrity of the data, a cryptographic hash function is applied instead of a checksum. For this purpose, a hash is formed from the written or read data and compared with a comparison hash. The hash exchanged between the respective systems can then be transmitted encrypted on the basis of proven signature verification methods. If both hashes match, this means that the data was written or read correctly. However, verifying data is relatively time-consuming, since a hash value must be formed for the relevant data each time it is verified.

[0006] For storing data, various storage media such as hard disks and flash memories are known. Distributed devices such as embedded systems, for example vehicle control devices, typically use flash memories for storing relevant data. Such flash memories may be fixedly integrated in a computing unit, for example in a system on chip (SOC). Such flash memories include at least one memory element for storing data as well as a memory controller for addressing the respective memory element. Furthermore, the memory element has a structure of blocks and pages. The memory element then includes a number of blocks, which in turn each include a number of pages. Data is stored in the flash memory page by page and erased block by block.

[0007] From the patent application WO 2005 / 023301 a secure hybrid boot system and a secure boot method for a hybrid system are known. Such a hybrid system comprises a number of different subsystems, each with its own storage device for storing software as well as its own CPU or processor for executing the software. For improved cyber security, a signature-based authenticity verification check of the software contained in the different storage devices is performed during the boot process of the respective subsystem or of the respective hybrid device. Such a boot method provides that a first subsystem has a first signature, which signature corresponds to a first hash of the software stored in the storage device at the first subsystem. The first hash of the first software is transmitted from the first subsystem to a second subsystem, which has a second signature corresponding to the first hash of the first software. An authenticity verification check is then performed by comparing the corresponding hashes. [Prior art documents] [Patent documents]

[0008] [Patent Document 1] DE 102020117552 Summary of the Invention [Problem to be solved by the invention]

[0009] It is an object of the present invention to provide a method for verifying a digital signature, which speeds up the storing, reading and / or erasing of data to and / or from memory elements of a flash memory. [Means for solving the problem]

[0010] According to the invention, this problem is solved by a method for verifying a digital signature with the features of claim 1. Advantageous embodiments and developments as well as a vehicle computing unit with a flash memory and a vehicle with such a vehicle computing unit emerge from the dependent claims.

[0011] In a method for verifying a digital signature of the type mentioned in the introduction, the hash processed to generate the signature is produced by applying a hash function to data stored in a flash memory, whereby, according to the invention, at least the following method steps are performed: - writing data to at least one memory element of a flash memory; - for each written block of the flash memory, calculating a hash by a memory controller of the flash memory from the data written in the respective block and storing the calculated hash in the block together with the data; - calculating a verification hash by applying a hash function by the memory controller to at least one hash stored in the block; - reading, by a system higher than the flash memory, for a block whose signature is to be verified, at least one hash stored in the block and a verification hash; - calculating a check hash by applying a hash function to at least one of the read hashes by a system above the flash memory; - comparing the read verification hash with the calculated check hash; If the verification hash and the check hash match, a step of authenticating the signature is performed.

[0012] The method according to the invention speeds up the verification of the digital signature on the data stored in the flash memory. This allows the corresponding data in the flash memory to be read or overwritten faster. Thus, the corresponding computer system or computing unit can boot faster, software to be executed can be loaded faster or the software stored in the flash memory can be updated faster. The main idea is that for the generation of the check hash, it is not necessary to generate a hash on the data stored in the flash memory, but the check hash is calculated simply by applying a hash function to the stored hash / s. Due to the smaller amount of data, the hash can be read from the flash memory faster than the data used to configure the software.

[0013] The hash function may be any cryptographic hash function, such as HAVAL, Whirlpool, or the Secure Hash Algorithm (SHA), in particular SHA2 or SHA3.

[0014] The individual hashes stored in the blocks as well as the verification hash are then calculated by the flash memory itself, more precisely by the memory controller of the flash memory. The verification hash can be stored in any block of the memory elements of the flash memory. The memory controller also knows where the verification hash needs to be read as soon as a corresponding inquiry occurs, since it addresses the corresponding memory element. The flash memory is integrated into a higher-level system. The higher-level system is a computing unit. The computing unit includes a processor for executing the software stored in the flash memory in the form of data. It is also possible for the higher-level system to be communicatively connected to other computing units than the flash memory. In this way, data can be read from the flash memory and transferred from the higher-level system to the other computing units. In accordance with this, data can be transmitted from the other computing units to the higher-level system and sent to the flash memory for storage in this way. For example, software updates of software executable in the higher-level system can be imported.

[0015] If the system higher than the flash memory is, for example, a vehicle control device to be booted, the corresponding software stored in the flash memory in the form of data is read and executed by the processor. However, to read the corresponding software, a signature verification must be successful in order to prevent potentially tampered data and thus compromised software being sent to the vehicle control device from being executed. Thus, by using the method according to the invention, it is not necessary to read the respective data from the block for signature verification and to calculate the check hash therefrom, but only to read one / several hashes already calculated by the flash memory and stored in the flash memory and apply a hash function to the hash read from the block to calculate the check hash. This proceeds very quickly. Thus, the system higher than the flash memory can be booted faster and the corresponding software can be started and executed faster or software updates can be installed faster.

[0016] When a software update is installed, data or parts of data of individual blocks of memory elements of the flash memory are replaced or supplemented with new data. Since the data is changed, the corresponding hashes of the corresponding blocks containing the changed data are also changed. When new or changed data is written to a block, the flash memory, i.e. the memory controller, also calculates a new hash for this block. Accordingly, it is also necessary to calculate a new verification hash, since the hash / s on which the verification hash is based has changed.

[0017] In this case, it may be necessary to modify firmware in the flash memory and / or in the system above the flash memory in order to enable the memory controller to store the calculated hash in the memory elements of the flash memory, and / or to read the hashes stored in each block, block by block.

[0018] A preferred development of the method according to the invention provides that the signature of at least one block is verified in order to read and / or overwrite the data stored in the block, which, as already mentioned, makes it possible to prevent the implementation or execution of unsafe software in the vehicle control unit.

[0019] According to another preferred embodiment of the method, an individual page hash is generated for at least one written page of a block of the flash memory, i.e. of the memory element in question, and stored in the respective page. Data is always stored in the form of pages in the memory element of the flash memory, block by block and in the respective block. To provide at least one hash for a block, a corresponding hash can be stored for any page of the respective block. However, it is also possible to generate a unique hash for one written page, several written pages or all written pages of a block. Correspondingly, a hash function can be applied to one page hash, several page hashes or all page hashes of a block in order to generate a verification hash. A hash for the respective block can also be calculated from one or several page hashes, and the block hash calculated from the at least one page hash can be used for the calculation of the verification hash.

[0020] In general, any combination of page hashes and / or block hashes are possible for the computation of the verification hash, but the system computing the verification hash must have access to information about which hashes are used in the computation to ensure a match between the verification hash and the check hash is obtained.

[0021] According to another preferred embodiment of the method according to the invention, if the signatures of at least two blocks are verified, the signature of each block is verified separately. If the software is so large that the corresponding code needs to be stored in several blocks, then each block, or the data stored therein, must also be verified for integrity. This can be done for each block individually. For example, for each block, a verification hash is calculated by the memory controller from a representative hash for each block (possibly after taking the page hash) and stored in the corresponding block. Correspondingly, the system above the flash memory calculates a check hash for each block from a representative hash for each block and compares these with the respective verification hash. This allows a particularly reliable signature verification. In the event of data manipulation, the blocks containing the altered data can then be directly identified.

[0022] Another preferred embodiment of the method according to the invention provides that if at least two blocks are verified, a common block signature can also be verified. For this purpose, a common verification hash is calculated from the respective hashes of the blocks. This allows the time required to read data from the corresponding blocks to be further reduced, since the signature of the corresponding blocks can be verified faster. It is then possible for the flash memory to already generate a common signature for the blocks, i.e. generate the corresponding common verification hash, before data is read from the corresponding blocks. This is possible, for example, at the time of the first storage, i.e. when the software is installed in the flash memory. For example, the memory controller knows which data belongs to the corresponding software and accordingly knows which blocks need to be read when loading the software. The common verification hash can then be pre-calculated by the memory controller for these blocks from the individual block hashes.

[0023] However, the installation of an update may only require replacing a few code modules of the software. In that case, these code modules may be stored in any block and page. Therefore, the memory controller cannot know in advance which block or page it has to access. Therefore, one possible embodiment of the method also contemplates that the memory controller generates the corresponding verification hash only if there remains a query to read or write data from a different block.

[0024] Reading and / or overwriting data stored in different blocks and pages is especially important for installing software differential updates. Signature verification is preferably performed during software differential updates of software executable on a system higher than the flash memory, for example. A software differential update is a software update in which only modified code modules are exchanged. This allows the amount of software updates involved to be reduced. Therefore, less data needs to be written, which reduces the time to install the software update.

[0025] In a vehicle computing unit having a flash memory, according to the invention, the flash memory is set up to perform the method described above. The vehicle computing unit may be any computing unit. For example, the vehicle computing unit may be a central board computer, a telematic unit, or other control device of a vehicle subsystem. The flash memory may be fabricated as a NAND flash or a NOR flash. The flash memory may have one or more memory elements. The memory elements are composed of a combination of blocks in which data is stored in memory cells per page. The memory elements may have any size. For example, the memory elements may have a size of 100 KB, 64 MB, 1 GB, 128 GB, 1 TB, etc. The flash memory further comprises a memory controller for addressing the memory elements. The vehicle computing unit may be communicatively connected to other vehicle computing units. For example, software updates may be received wirelessly from a communication module and may be transferred for importing software updates, for example engine control software.

[0026] According to the invention, a vehicle comprises a vehicle computing unit as described above. The vehicle may be any vehicle, such as a car, a truck, a transporter, a bus, etc. Using the method according to the invention and the vehicle computing unit according to the invention, the boot or loading process of software in the vehicle can be accelerated. Furthermore, software updates can also be quickly performed in the corresponding vehicle computing unit or in the flash memory of the vehicle computing unit. Furthermore, the cyber security of the corresponding vehicle computing unit is maintained, since a signature verification is performed for access to the flash memory.

[0027] Further preferred embodiments of the inventive method for verifying a digital signature, the vehicle computing system and the vehicle will become apparent from the following detailed description of the preferred embodiments with reference to the accompanying drawings. [Brief description of the drawings]

[0028] [Figure 1] FIG. 2 is a schematic plan view showing a vehicle computing unit. [Diagram 2] FIG. 1 is a principle diagram showing the memory structure of a memory element of a flash memory. [Diagram 3] 4 shows a schematic procedure of signature verification for read and / or write access to a flash memory. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0029] 1 shows a vehicle computing unit 5, for example an engine control unit or a central board computer. The vehicle computing unit 5 comprises at least one flash memory 1 and is thus a higher-level system 3 than the flash memory 1. Furthermore, the vehicle computing unit 5 comprises a processor 6 for executing program code stored in the flash memory 1.

[0030] Furthermore, the flash memory 1 includes at least one memory element 1.1 as well as a memory controller 1.2. Data is stored in the memory elements 1.1. The memory controller 1.2 then addresses the respective memory element 1.1, so that the correct data is addressed during a write or read access to the flash memory 1.

[0031] Figure 2 shows the structure of a memory device 1.1. The memory device 1.1 comprises a number of blocks 2, in which the data to be stored is stored page-wise, i.e. in the form of at least one page 4. Flash memories can then only be written page-wise and erased block-wise.

[0032] To improve cyber security, a signature verification is performed before a write or read access to the data stored in the flash memory 1. The signature verification requires a comparison of hash values. To achieve this, in the prior art, at least one hash value is calculated from the data stored in the flash memory 1 and stored. Then, when accessing the data, the processor accessing the data also calculates a hash value from the read data. This hash value is compared with the previously calculated hash value. If both hash values ​​match, the signature verification is authenticated. However, this requires a relatively long time, since a new hash value must be calculated from the data every time the data is written or read.

[0033] In the method according to the invention, the flash memory 1, i.e. the memory controller 1.2, calculates a hash for at least each block 2 when data is written to the flash memory 1 and stores this hash together with the data to be written in the respective block 2. The idea behind the method according to the invention is that, instead of the data stored in the flash memory 1, the hash calculated by the flash memory 1 is read into a corresponding hash function to calculate the hash used for signature verification. The advantage is that reading the hash calculated by the flash memory 1 is much faster than reading the data itself. That way the signature verification can be performed much faster.

[0034] For signature verification, check hash#P (see Fig. 3) is compared with verification hash#V. Verification hash#V is calculated from at least one block hash#B. For example, at least one block hash#B is fed into a hash function, from which verification hash#V is derived. Each block hash#B and verification hash#V are stored in page 4 of block 2. For this purpose, any page 4 can generally be used. For example, verification hash#V can be stored in a different page 4 than the corresponding block hash#B of block 2, as shown by the dashed triangle in Fig. 2.

[0035] When writing data to the flash memory 1, it is also possible that only one page hash #S is generated for at least one page 4 of a block 2. For example, each page 4 stores a certain portion of payload data 7, i.e., code for implementing a program. The flash memory 1, i.e. the memory controller 1.2, reads the payload data 7 as an input variable into a hash function and calculates therefrom the respective block hash #B and / or page hash #S.

[0036] The payload data 7 is stored in the respective page 4, possibly together with the page hash #S. Once the write process is completed, for the corresponding block 2, a verification hash #V is determined from the respective block hash #B using another hash function. The verification hash #V is then stored in any page 4 of the same block 2. The individual hash functions used to calculate the hash may be the same or may be different from each other. The hash functions may differ from each other with respect to their respective strengths.

[0037] Blocks 2 for which the block hash #B was calculated differently can also be combined for the calculation of the verification hash #V. For example, for a first number of blocks 2, each block hash #B may have been calculated from payload data 7, and for a second number of blocks 2, each block hash #B may have been calculated from page hash #S.

[0038] FIG. 3 shows a schematic progression of signature verification. For example, first, the flash memory 1 or, more precisely, the memory controller 1.2 calculates a block hash #B for each block from data to be written in the flash memory 1. In this case, the block hash #B can be calculated directly from the payload data 7 or from the page hash #S. Then, a verification hash #V is calculated from at least one block hash #B and is also stored in block 2. Since in theory, one block hash #B is sufficient for the calculation of the verification hash #V, in FIG. 3, only the block hash #B is connected to the verification hash #V by a solid line. The dashed lines indicate that the use of multiple block hashes #B and / or page hashes #S for the calculation of the verification hash #V is optional, or is taken into consideration only when many payload data 7 need to be written / read, and therefore these must be written to multiple blocks 2 or read from multiple blocks 2.

[0039] Then, when an attempt is made to access the payload data 7, whether it be to read, write and / or erase, the computation unit accessing the data, e.g. the processor 6 of the vehicle computation unit 5, advantageously calculates a check hash #P corresponding to the verification hash #V. If the check hash #P matches the verification hash #V, the signature verification is successful. On the other hand, if the check hash #P and the verification hash #V do not match, this indicates tampering with the payload data 7, and the signature verification is accordingly rejected.

[0040] To calculate the check hash #P, the processor 6 uses the same hash function as the flash memory 1. To calculate the check hash #P, in the method according to the invention, instead of the payload data 7, the page hash #S and / or the block hash #B are read from the flash memory 1 by the calculation unit having access to the flash memory 1. If the respective data has been corrupted between the initial storage of the data in the flash memory 1 and its reading by the corresponding calculation unit, the hash read from the flash memory 1 will not match the initial hash, because the memory controller 1.2 calculates a new block hash #B when writing the data. However, since the verification hash #V has not been changed during the operation, this means that the check hash #P will not match the verification hash #V if the data has been manipulated.

[0041] On the other hand, if the data stored in the flash memory 1 is changed by a trusted source, the verification hash #V is also calculated anew after successful signature verification.

[0042] By applying cryptographic techniques that have been proven in signature verification, such as encryption and decryption using a private key and a public key, it is possible to prevent leakage of the hash exchanged between the calculation unit and the flash memory 1.

Claims

1. 1. A method for verifying a digital signature in which a hash function is applied to data stored in a flash memory (1) to create a hash which is processed to generate a signature, comprising: At least the following method steps: - writing data to at least one memory element (1.1) of a flash memory (1); - for each written block (2) of said flash memory (1), calculating a hash by a memory controller (1.2) of said flash memory (1) from the data written in the respective block (2) and storing the calculated hash in said block (2) together with said data; - calculating a verification hash (#V) by applying a hash function by said memory controller (1.2) to at least one hash stored in a block (2); - reading, by a system (3) superior to said flash memory (1), for a block (2) whose signature is to be verified, at least one hash stored in said block (2) and said verification hash (#V); - calculating a check hash (#P) ​​by applying a hash function to at least one of the read hashes by said system (3) above said flash memory (1); - comparing said calculated check hash (#P) ​​with said read verification hash (#V); - authenticating the signature if said check hash (#P) ​​matches said verification hash (#V).

2. 2. The method according to claim 1, characterized in that the signature of at least one block (2) is verified in order to read and / or overwrite data stored in the block (2).

3. 3. The method according to claim 1 or 2, characterized in that for at least one written page (4) of a block (2) of the flash memory (1) an individual page hash (#S) is generated and stored in the respective page (#S).

4. 4. The method of claim 3, wherein a hash function is applied to at least one page hash (#S) to generate a hash of the block (2).

5. 3. The method according to claim 1 or 2, characterized in that if the signatures of at least two blocks (2) are verified, the signature of each block (2) is verified separately.

6. 3. The method according to claim 1 or 2, characterized in that, to verify the signatures of at least two blocks (2) by a common signature, a verification hash (#V) is calculated from the individual hashes of both of the blocks (2) to be verified.

7. 3. The method according to claim 1 or 2, characterized in that the signature verification is performed during the execution of a software differential update of software executable in a higher system (3) than the flash memory (1).

8. In a vehicle computing unit (5) having a flash memory (1), 3. A vehicle computing unit, characterized in that the flash memory (1) is configured to implement the method according to claim 1 or 2.

9. A vehicle, characterized in that it comprises a vehicle computing unit (5) according to claim 8.

Citation Information

Patent Citations

  • SAFE HYBRID BOAT SYSTEMS AND SAFE BOAT PROCEDURES FOR HYBRID SYSTEMS

    DE102020117552A1

  • Method and apparatus for incremental code signing

    JP2008293033A

  • Data authentication method and data authentication system

    JP2012114934A

  • Method for updating software of a control device of a vehicle

    US20180113703A1

  • Digital forensic image verification system

    US20180373894A1