Data verification device and method

By using a data verification device and method, digital signatures and hash algorithms are used to verify the data written by the platform controller, solving the problem in the prior art that data image files cannot be protected after the platform controller is running normally, and realizing continuous verification and protection of data.

CN118940255APending Publication Date: 2024-11-12NUVOTON
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311385052.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-05-09
Filing Date
2023-10-24
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In the prior art, the embedded controller only verifies the firmware image file of the platform controller when the system power is turned on, and cannot provide protection after the platform controller starts to operate normally, which makes the firmware image file vulnerable to malicious rewriting.

Method used

A data verification device is employed, including a main memory, a backup memory, a platform controller, and an embedded controller. Through address checking, address allocation, and verification circuitry, digital signatures and hash algorithms are used to verify the data image file written by the platform controller, ensuring the legality of the data and restoring it to backup data when necessary.

Benefits of technology

Even after the platform controller is running normally, it can still effectively verify and protect the data image file, prevent malicious rewriting, and ensure the integrity and security of the data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118940255A_ABST
    Figure CN118940255A_ABST
Patent Text Reader

Abstract

The invention provides a data verification device and method. The data verification device can comprise a main memory, a backup memory, a platform controller and an embedded controller. The main memory can be used for storing data. The backup memory can be used for storing the data stored in the main memory. The platform controller can generate a write instruction to write a first data image file to the main memory. The first data mapping file includes update data and a digital signature. The embedded controller can obtain a first data image file from the platform controller. When the embedded controller detects the write instruction, the embedded controller verifies the update data according to the first data image file or a second data image file corresponding to the first data image file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention are mainly related to a data verification technology, and more particularly to a data verification device and method for verifying a data image file written by a platform controller hub (PCH) when the platform controller hub (PCH) is running. Background Art

[0002] Information security has become an issue of concern to everyone in today's society. For example, the application fields of the Internet of Things, artificial intelligence, and mobile payment are inseparable from the need for information security. The need for information security is nothing more than preventing cyber attacks from malicious parties. A common attack method is to rewrite the firmware image file (Firmware Image) of the platform controller hub (PCH), for example: rewriting the firmware data in the firmware image file to execute malicious programs to steal secret information.

[0003] In the current protection mechanism, the embedded controller (EC) verifies the legitimacy of the firmware image file stored in the main memory when the system power is turned on. Only when the firmware image file is successfully verified, the embedded controller allows the platform controller to access the main memory (for example, to perform boot loader operations).

[0004] However, the embedded controller protects the platform controller only when the system power is just turned on. Therefore, when the platform controller starts to run normally (i.e., after the boot loader operation is completed), the embedded controller can no longer provide any protection mechanism for the firmware image file written by the platform controller.

[0005] Therefore, how to provide verification for the firmware image file written to the platform controller after the platform controller starts to run normally is a topic worth discussing. Summary of the invention

[0006] In view of the above problems in the prior art, an embodiment of the present invention provides a data verification device and method.

[0007] According to one embodiment of the present invention, a data verification device is provided. The data verification device may include a main memory, a backup memory, a platform controller and an embedded controller. The main memory may be used to store data. The backup memory may be used to back up the data stored in the main memory. The platform controller is coupled to the main memory and generates a write instruction to write a first data image file to the main memory, wherein the first data image file includes update data and a digital signature. The embedded controller is coupled to the main memory, the backup memory and the platform controller. The embedded controller obtains the first data image file from the platform controller. When the embedded controller detects the write instruction, the embedded controller verifies the update data according to the first data image file or a second data image file corresponding to the first data image file.

[0008] In one embodiment, the embedded controller may include a memory circuit, an address check circuit, an address allocation circuit and a verification circuit. The address check circuit is coupled to the main memory. The address check circuit can detect the above-mentioned write instruction, obtain the first data image file from the platform controller, and determine whether the first data image file is written to the entire address space or a portion of the address space of the main memory. The address allocation circuit is coupled to the memory circuit, the above-mentioned address check circuit and the backup memory. The address allocation circuit can generate a second data image file. The verification circuit is coupled to the address allocation circuit, and performs the above-mentioned verification according to the first data image file or the second data image file.

[0009] In one embodiment, when the address check circuit determines that the first data image file is written to the entire address space of the main memory, the verification circuit decrypts the digital signature to obtain a first hash value, and generates a second hash value according to the updated data through a hash algorithm. In addition, the verification circuit compares whether the first hash value and the second hash value are the same to verify the updated data.

[0010] In one embodiment, when the address check circuit determines that the first data image file is written to a partial address space of the main memory, the address check circuit transmits a first address information to the address allocation circuit and transmits the first data image file and a second address information to the memory circuit. The first address information corresponds to a mapping relationship between the main memory and the memory circuit, and the second address information corresponds to the memory circuit. The address allocation circuit obtains a storage data corresponding to the first data image file and the second address information from the memory circuit and obtains backup data from the backup memory, and generates a second data image file according to the storage data, the first address information and the backup data, and transmits the second data image file to the verification circuit. The verification circuit can decrypt the above-mentioned digital signature included in the second data image file to obtain a first hash value, and generate a second hash value according to the adjusted update data included in the second data image file through a hash algorithm. In addition, the verification circuit can compare whether the first hash value and the second hash value are the same to verify the adjusted update data.

[0011] In one embodiment, when the address check circuit determines that the first data image file is written into a partial address space of the main memory, the address check circuit transmits the first data image file and a first address information to the address allocation circuit. The first address information corresponds to a mapping relationship between the main memory and the memory circuit. The address allocation circuit obtains backup data from the backup memory, and transmits a second address information and an adjustment data corresponding to the first data image file, the first address information and the backup data to the memory circuit according to the first data image file, the first address information and the backup data. The memory circuit transmits the second data image file to the verification circuit according to the adjustment data and the second address information. The second address information corresponds to the memory circuit. The verification circuit decrypts the digital signature contained in the second data image file to obtain a first hash value, and generates a second hash value according to the adjusted update data contained in the second data image file through a hash algorithm. In addition, the verification circuit compares whether the first hash value and the second hash value are the same to verify the adjusted update data.

[0012] In one embodiment, when the update data fails to pass the authentication, the embedded controller may restore the main memory according to the backup data stored in the backup memory.

[0013] According to an embodiment of the present invention, a data verification method is provided. The data verification method is applicable to a data verification device. The steps of the data verification method include: detecting whether a platform controller of the data verification device generates a write instruction through an embedded controller of the data verification device; when the embedded controller detects that the platform controller generates the write instruction, obtaining a first data image file from the platform controller through the embedded controller, wherein the first data image file includes update data and a digital signature; and verifying the update data through the embedded controller according to the first data image file or a second data image file corresponding to the first data image file.

[0014] As for other additional features and advantages of the present invention, those skilled in the art may make slight changes and modifications based on the data verification device and method disclosed in the implementation method of the present invention without departing from the spirit and scope of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 is a block diagram showing a data verification device 100 according to an embodiment of the present invention.

[0016] Figure 2 FIG. 1 is a block diagram showing an embedded controller 140 according to an embodiment of the present invention.

[0017] Figure 3 FIG. 4 is a block diagram showing an embedded controller 140 according to another embodiment of the present invention.

[0018] Figure 4 is a flow chart showing a data verification method according to an embodiment of the present invention.

[0019] Figure 5 is a flowchart of step S440 according to an embodiment of the present invention.

[0020] Figure 6 is a flowchart of step S450 according to an embodiment of the present invention.

[0021] Figure 7 is a flowchart of step S450 according to another embodiment of the present invention.

[0022] Reference numerals:

[0023] 100: Data verification device

[0024] 110: Main memory

[0025] 120: Backup memory

[0026] 130: Platform controller

[0027] 140: Embedded Controller

[0028] 210, 310: Address check circuit

[0029] 220, 320: Address allocation circuit

[0030] 230, 330: Verification circuit

[0031] 240, 340: first memory circuit

[0032] 250, 350: second memory circuit

[0033] 260: Read control line

[0034] DATA_1: data image file

[0035] DATA_2: Storage data

[0036] DATA_2': Adjust data

[0037] DATA_3: Reorganized data image file

[0038] Flash_ADDR: first address information

[0039] RAM_ADDR: Second address information

[0040] Read: control signal

[0041] S410~S450, S510~S540, S610~S680, S710~S780: Steps DETAILED DESCRIPTION

[0042] This section describes the preferred method of implementing the present invention, which is intended to illustrate the spirit of the present invention rather than to limit the scope of protection of the present invention. The scope of protection of the present invention shall be determined by the scope of the attached patent application.

[0043] Figure 1 FIG. 1 is a block diagram showing a data verification device 100 according to an embodiment of the present invention. Figure 1 As shown, the data verification device 100 may include a main memory 110, a backup memory 120, a platform controller hub (PCH) 130 and an embedded controller (EC) 140. Figure 1 The data verification device 100 shown in FIG. 1 is only for the convenience of illustrating the embodiment of the present invention, but the present invention is not limited to Figure 1The data verification device 100 may also include other components.

[0044] According to the embodiment of the present invention, the data verification device 100 may be applied to an integrated circuit or a microcontroller (MCU), but the present invention is not limited thereto.

[0045] According to an embodiment of the present invention, the main memory 110 and the backup memory 120 may be flash memories. The main memory 110 may be connected to the platform controller 130 and the embedded controller 140 via a serial peripheral interface (SPI). The backup memory 120 may also be connected to the embedded controller 140 via a serial peripheral interface. The main memory 110 may be used to store data image files, such as firmware data image files. The backup memory 120 is used to back up the data stored in the main memory 110.

[0046] According to an embodiment of the present invention, the platform controller 130 may be used to update the data image file stored in the main memory 110. When the platform controller 130 wants to write a new data image file (e.g., an updated firmware data image file) to the main memory 110, the platform controller 130 may generate a write command to write the updated data image file to the main memory 110.

[0047] According to an embodiment of the present invention, the embedded controller 140 may be used to verify whether the data image file written into the main memory 110 by the platform controller 130 is legal. The operation of the embedded controller 140 will be described in more detail below.

[0048] Figure 2 FIG. 1 is a block diagram showing an embedded controller 140 according to an embodiment of the present invention. Figure 2 As shown, the embedded controller 140 may include an address checking circuit 210 , an address assigning circuit 220 , a verification circuit 230 , a first memory circuit 240 , and a second memory circuit 250 .

[0049] According to an embodiment of the present invention, the address checking circuit 210 may communicate with the main memory 110 via a serial peripheral interface (SPI), and the address assigning circuit 220 may communicate with the backup memory 120 via a serial peripheral interface (SPI).

[0050] According to an embodiment of the present invention, the first memory circuit 240 may be a random access memory (RAM), and the second memory circuit 250 may be a read-only memory (ROM). The second memory circuit 250 may store relevant data to be verified by the verification circuit 230, such as a public key and a code related to verification. The verification circuit 230 may perform a verification procedure according to the data stored in the second memory circuit 250.

[0051] The address check circuit 210 can detect whether the platform controller 130 generates a write command. When the address check circuit 210 detects the write command generated by the platform controller 130, the address check circuit 210 can first determine whether the data image file DATA_1 written by the platform controller 130 to the main memory 110 is written into the entire address space or a portion of the address space of the main memory 110. The data image file DATA_1 written by the platform controller 130 to the main memory 110 may include update data and a digital signature, and the digital signature may be encrypted based on the update data.

[0052] When the address check circuit 210 determines that the data image file DATA_1 written by the platform controller 130 to the main memory 110 is written to the entire address space of the main memory 110, the verification circuit 230 can use the public key stored in the second memory circuit 250 to decrypt the digital signature in the data image file DATA_1 to obtain a first hash value (Digest 1). In addition, the verification circuit 230 can operate the updated data in the data image file DATA_1 through a hash algorithm (e.g., Secure Hash Algorithm (SHA)) to generate a second hash value (Digest 2). Then, the verification circuit 230 can compare whether the first hash value and the second hash value are the same to verify the updated data in the data image file DATA_1.

[0053] If the update data authentication succeeds, the address check circuit 210 may continue to detect whether the platform controller 130 generates a new write command. If the update data authentication fails, the verification circuit 230 may first send a RESET signal to suspend the platform controller 130 from accessing the data of the main memory 110, and restore the main memory 110 according to the backup data stored in the backup memory 120. In other words, the verification circuit 230 may overwrite the data stored in the main memory 110 with the backup data stored in the backup memory 120. After the main memory 110 is restored, the verification circuit 230 releases the restriction of the RESET signal on the platform controller 130.

[0054] When the address checking circuit 210 determines that the data image file DATA_1 written into the main memory 110 by the platform controller 130 is written into a partial address space of the main memory 110, the address checking circuit 210 can transmit a first address information Flash_ADDR to the address allocation circuit 220 and transmit the second address information RAM_ADDR and the data image file DATA_1 written into the main memory 110 to the first memory circuit 240.

[0055] exist Figure 2 In the embodiment of the present invention, the first address information Flash_ADDR may include a mapping relationship corresponding to or associated with the main memory 110 and the first memory circuit 240. The address allocation circuit 220 may know the corresponding relationship between the address of the main memory 110 for storing the data image file DATA_1 and the address of the first memory circuit 240 for storing the data image file DATA_1 according to the first address information Flash_ADDR.

[0056] exist Figure 2 In the embodiment of the present invention, the second address information RAM_ADDR may include address information of storing the data image file DATA_1 in the first memory circuit 240. The first memory circuit 240 may store the data image file DATA_1 at the address indicated by the second address information RAM_ADDR according to the second address information RAM_ADDR, and the first memory circuit 240 may output the storage data DATA_2 corresponding to the data image file DATA_1 and the second address information RAM_ADDR to the address allocation circuit 220. The address allocation circuit 220 may control the access of the address check circuit 210 to the first memory circuit 240 through a read control line 260. That is, when the address check circuit 210 receives a control signal Read from the read control line 260, the address check circuit 210 may generate the second address information RAM_ADDR.

[0057] The address allocation circuit 220 may obtain the storage data DATA_2 corresponding to the data image file DATA_1 and the second address information RAM_ADDR from the first memory circuit 240 and the backup data from the backup memory 120. Then, the address allocation circuit 220 may generate a reorganized data image file DATA_3 according to the storage data DATA_2, the first address information Flash_ADDR and the backup data, and transmit the reorganized data image file DATA_3 to the verification circuit 230.

[0058] Taking Tables 1 to 4 as examples, the data image file DATA_1 may include the content shown in Table 1, the stored data DATA_2 may include the content shown in Table 2, the backup data may include the content shown in Table 3, and the reorganized data image file DATA_3 may include the content shown in Table 4. The address allocation circuit 220 generates the content included in the reorganized data image file DATA_3 according to the first address information Flash_ADDR, the content included in the stored data DATA_2, and the content included in the backup data, that is, according to the access time sequence. In other words, the address allocation circuit 220 can reconstruct the data content currently stored in the main memory 110 according to the first address information Flash_ADDR, the content included in the stored data DATA_2, and the content included in the backup data.

[0059] Table 1

[0060] Main memory address DATA_1 1 abc 3 def 5 g

[0061] Table 2

[0062] First memory address DATA_2 50 abc 51 def 52 g

[0063] Table 3

[0064] Backup memory address Backing up your data 0 aaa 1 bbb 2 ccc 3 ddd 4 eee 5 F 6 Ggg 7 hhh

[0065] Table 4

[0066] time order DATA_3 T1 Backup memory address 0 aaa T2 First memory address 50 abc T3 Backup memory address 2 ccc T4 First memory address 51 def T5 Backup memory address 4 eee T6 First memory address 52 g T7 Backup memory address 6 ggg T8 Backup memory address 7 hhh

[0067] After the verification circuit 230 obtains the reorganized data image file DATA_3, the verification circuit 230 may decrypt the digital signature (which is the same as the digital signature included in the data image file DATA_1) included in the reorganized data image file DATA_3 using the public key stored in the second memory circuit 250 to obtain a first hash value, and generate a second hash value according to the adjusted update data included in the reorganized data image file DATA_3 through a hash algorithm. Then, the verification circuit 230 may compare whether the first hash value and the second hash value are the same to verify the adjusted update data.

[0068] If the adjusted update data authentication succeeds, the address check circuit 210 may continue to detect whether the platform controller 130 generates a new write command. If the adjusted update data authentication fails, the verification circuit 230 may first send a RESET signal to suspend the platform controller 130 from accessing the data of the main memory 110, and restore the main memory 110 according to the backup data stored in the backup memory 120. In other words, the verification circuit 230 may overwrite the data stored in the main memory 110 with the backup data stored in the backup memory 120. After the main memory 110 is restored, the verification circuit 230 releases the restriction of the RESET signal on the platform controller 130.

[0069] Figure 3 FIG. 1 is a block diagram showing an embedded controller 140 according to another embodiment of the present invention. Figure 3 As shown, the embedded controller 140 may include an address checking circuit 310 , an address assigning circuit 320 , a verification circuit 330 , a first memory circuit 340 , and a second memory circuit 350 .

[0070] According to an embodiment of the present invention, the address checking circuit 310 may communicate with the main memory 110 via a serial peripheral interface (SPI), and the address assigning circuit 320 may communicate with the backup memory 120 via a serial peripheral interface (SPI).

[0071] According to an embodiment of the present invention, the first memory circuit 340 may be a random access memory (RAM), and the second memory circuit 350 may be a read-only memory (ROM). The second memory circuit 350 may store relevant data to be verified by the verification circuit 330, such as a public key and a code related to verification. The verification circuit 330 may perform a verification procedure according to the data stored in the second memory circuit 350.

[0072] The address check circuit 310 detects whether the platform controller 130 generates a write command. When the address check circuit 310 detects the write command generated by the platform controller 130, the address check circuit 310 may first determine whether the data image file DATA_1 written by the platform controller 130 to the main memory 110 is written into the entire address space or a portion of the address space of the main memory 110. The data image file DATA_1 written by the platform controller 130 to the main memory 110 includes the update data and a digital signature, and the digital signature may be encrypted based on the update data.

[0073] When the address checking circuit 310 determines that the data image file DATA_1 written by the platform controller 130 into the main memory 110 is written into the entire address space of the main memory 110, the operation performed by the verification circuit 330 is similar to that of the verification circuit 230, and thus will not be described in detail herein.

[0074] When the address checking circuit 310 determines that the data image file DATA_1 written by the platform controller 130 into the main memory 110 is written into a partial address space of the main memory 110 , the address checking circuit 310 may transmit the first address information Flash_ADDR and the data image file DATA_1 to the address allocating circuit 320 .

[0075] exist Figure 3 In the embodiment of the present invention, the first address information Flash_ADDR may include a mapping relationship corresponding to or associated with the main memory 110 and the first memory circuit 340. The address allocation circuit 320 may know the corresponding relationship between the address of the main memory 110 for storing the data image file DATA_1 and the address of the first memory circuit 340 for storing the data image file DATA_1 according to the first address information Flash_ADDR.

[0076] The address allocation circuit 320 can generate an adjustment data DATA_2' corresponding to the data image file DATA_1, the first address information Flash_ADDR and the backup data stored in the backup memory 120 according to the first address information Flash_ADDR, the data image file DATA_1 and the backup data. Then, the address allocation circuit 320 can transmit a second address information RAM_ADDR and the adjustment data DATA_2' to the first memory circuit 340.

[0077] exist Figure 3 In the embodiment of the present invention, the second address information RAM_ADDR may include address information of the adjustment data DATA_2' stored in the first memory circuit 340. The first memory circuit 340 may store the adjustment data DATA_2' at the address indicated by the second address information RAM_ADDR according to the second address information RAM_ADDR. In addition, the first memory circuit 340 may generate a reorganized data image file DATA_3 according to the second address information RAM_ADDR and the adjustment data DATA_2', and output the reorganized data image file DATA_3 to the verification circuit 330.

[0078] Taking Tables 5 to 8 as examples, the data image file DATA_1 may include the content shown in Table 5, the adjusted data DATA_2' may include the content shown in Table 6, the backup data may include the content shown in Table 7, and the reconstructed data image file DATA_3 may include the content shown in Table 8. The address allocation circuit 320 generates the adjusted data DATA_2' according to the first address information Flash_ADDR, the data image file DATA_1, and the backup data stored in the backup memory 120. In other words, the address allocation circuit 320 can reconstruct the data content currently stored in the main memory 110 according to the first address information Flash_ADDR, the data image file DATA_1, and the content contained in the backup data stored in the backup memory 120 and the content contained in the backup data. The first memory circuit 340 can then generate the reconstructed data image file DATA_3 according to the second address information RAM_ADDR and the adjusted data DATA_2'.

[0079] Table 5

[0080] Main memory address DATA_1 1 abc 3 def 5 g

[0081] Table 6

[0082] First memory address order DATA_2' time 51 DATA_1 abc T1 53 DATA_1 def T2 55 DATA_1 g T3 50 Backup memory address 0 aaa T4 52 Backup memory address 2 ccc T5 54 Backup memory address 4 eee T6 56 Backup memory address 6 ggg T7 57 Backup memory address 7 hhh T8

[0083] Table 7

[0084]

[0085]

[0086] Table 8

[0087] First memory address Backing up your data 50 aaa 51 bbb 52 ccc 53 ddd 54 eee 55 fff 56 ggg 57 hhh

[0088] After the verification circuit 330 obtains the reorganized data image file DATA_3, the verification circuit 330 may use the public key stored in the second memory circuit 350 to decrypt the digital signature (which is the same as the digital signature included in the data image file DATA_1) included in the reorganized data image file DATA_3 to obtain a first hash value, and generate a second hash value according to the adjusted update data included in the reorganized data image file DATA_3 through a hash algorithm. Then, the verification circuit 330 may compare whether the first hash value and the second hash value are the same to verify the adjusted update data.

[0089] If the adjusted update data authentication succeeds, the address check circuit 310 may continue to detect whether the platform controller 130 generates a new write command. If the adjusted update data authentication fails, the verification circuit 330 may first send a RESET signal to suspend the platform controller 130 from accessing the data of the main memory 110, and restore the main memory 110 according to the backup data stored in the backup memory 120. In other words, the verification circuit 330 may overwrite the data stored in the main memory 110 with the backup data stored in the backup memory 120. After the main memory 110 is restored, the verification circuit 330 releases the restriction of the RESET signal on the platform controller 130.

[0090] Figure 4 is a flow chart of a data verification method according to an embodiment of the present invention. Figure 4 The data verification method shown is applicable to the data verification device 100. In addition, it is particularly noted that the data verification method is applied when the platform controller 130 of the data verification device 100 has started to operate normally. Figure 4 As shown, in step S410 , the embedded controller 140 of the data verification device 100 detects whether the platform controller 130 of the data verification device 100 generates a write instruction.

[0091] When the embedded controller 140 detects that the platform controller 130 generates a write command, step S420 is performed. In step S420, the embedded controller 140 obtains a first data image file from the platform controller 130. The first data image file may include an update data and a digital signature.

[0092] In step S430 , the embedded controller 140 determines whether the first data image file is written into the entire address space or a portion of the address space of the main memory 110 of the data verification device 100 .

[0093] When the embedded controller 140 determines that the first data image file is written into the entire address space of the main memory 110, step S440 is performed. In step S440, the embedded controller 140 verifies the update data according to the first data image file.

[0094] When the embedded controller 140 determines that the first data image file is written into a partial address space of the main memory 110, step S450 is performed. In step S450, the embedded controller 140 generates a second data image file according to the first data image file, the backup data stored in the backup memory 120 of the data verification device 100, and the memory address information, and verifies the updated data according to the second data image file.

[0095] Figure 5 is a flowchart of step S440 according to an embodiment of the present invention. Figure 5 The data verification method shown is applicable to the data verification device 100. In step S510, the verification circuit of the embedded controller 140 decrypts the digital signature to obtain a first hash value.

[0096] In step S520 , the verification circuit generates a second hash value according to the update data of the first data image file through a hash algorithm.

[0097] In step S530 , the verification circuit compares whether the first hash value and the second hash value are the same to verify the update data.

[0098] When the first hash value and the second hash value are the same (that is, the updated data passes the verification), the process returns to step S410. The embedded controller 140 continues to detect whether the platform controller 130 of the data verification device 100 generates a new write instruction.

[0099] When the first hash value and the second hash value are different (i.e., indicating that the updated data has not passed the verification), step S540 is performed, and the embedded controller 140 restores the main memory 110 according to the backup data stored in the backup memory 120. Then, the process returns to step S410. The embedded controller 140 continues to detect whether the platform controller 130 of the data verification device 100 generates a new write instruction.

[0100] Figure 6 is a flowchart of step S450 according to an embodiment of the present invention. Figure 6 The data verification method shown is applicable to the data verification device 100 and Figure 2 In step S610, the address checking circuit of the embedded controller 140 transmits the first address information to the address allocation circuit of the embedded controller 140 and transmits the first data image file and the second address information to a memory circuit (i.e., the first memory circuit 240) of the embedded controller 140. In this embodiment, the first address information corresponds to a mapping relationship between the main memory 110 and the above-mentioned memory circuit, and the second address information corresponds to the memory circuit.

[0101] In step S620 , the address allocation circuit of the embedded controller 140 obtains storage data corresponding to the first data image file and the second address information from the memory circuit and obtains backup data from the backup memory 120 of the data verification device 100 .

[0102] In step S630 , the address allocation circuit of the embedded controller 140 generates a second data image file according to the stored data, the first address information and the backup data.

[0103] In step S640 , the address allocation circuit of the embedded controller 140 transmits the second data image file to the verification circuit of the embedded controller 140 .

[0104] In step S650 , the verification circuit of the embedded controller 140 decrypts the digital signature included in the second data image file to obtain a first hash value.

[0105] In step S660 , the verification circuit of the embedded controller 140 generates a second hash value according to the adjusted update data included in the second data image file through a hash algorithm.

[0106] In step S670 , the verification circuit of the embedded controller 140 compares whether the first hash value and the second hash value are the same, so as to verify the adjusted update data.

[0107] When the first hash value and the second hash value are the same (which means the adjusted updated data passes the verification), the process returns to step S410. The embedded controller 140 continues to detect whether the platform controller 130 of the data verification device 100 generates a new write instruction.

[0108] When the first hash value and the second hash value are different (i.e., the adjusted updated data fails to pass the verification), step S680 is performed, and the embedded controller 140 restores the main memory 110 according to the backup data stored in the backup memory 120. Then, the process returns to step S410. The embedded controller 140 continues to detect whether the platform controller 130 of the data verification device 100 generates a new write instruction.

[0109] Figure 7 is a flowchart of step S450 according to another embodiment of the present invention. Figure 7 The data verification method shown is applicable to the data verification device 100 and Figure 3 In step S710, the address checking circuit of the embedded controller 140 transmits the first data image file and the first address information to the address allocation circuit of the embedded controller 140. In this embodiment, the first address information corresponds to a mapping relationship between the main memory 110 and the memory circuit (i.e., the first memory circuit 340) of the embedded controller 140.

[0110] In step S720 , the address allocation circuit of the embedded controller 140 obtains the backup data from the backup memory 120 of the data verification apparatus 100 .

[0111] In step S730, the address allocation circuit of the embedded controller 140 transmits the second address information and an adjustment data corresponding to the first data image file, the first address information and the backup data to the memory circuit according to the first data image file, the first address information and the backup data. In this embodiment, the second address information corresponds to the memory circuit.

[0112] In step S740 , the memory circuit of the embedded controller 140 transmits the second data image file to the verification circuit of the embedded controller 140 according to the adjustment data and the second address information.

[0113] In step S750, the digital signature included in the second data image file is decrypted by the verification circuit to obtain a first hash value.

[0114] In step S760 , the verification circuit generates a second hash value according to the adjusted update data included in the second data image file through a hash algorithm.

[0115] In step S770, the verification circuit compares the first hash value and the second hash value to see whether they are the same, so as to verify the adjusted update data.

[0116] When the first hash value and the second hash value are the same (which means the adjusted updated data passes the verification), the process returns to step S410. The embedded controller 140 continues to detect whether the platform controller 130 of the data verification device 100 generates a new write instruction.

[0117] When the first hash value and the second hash value are different (i.e., the adjusted updated data fails to pass the verification), step S780 is performed, and the embedded controller 140 restores the main memory 110 according to the backup data stored in the backup memory 120. Then, the process returns to step S410. The embedded controller 140 continues to detect whether the platform controller 130 of the data verification device 100 generates a new write instruction.

[0118] According to the data verification method proposed in the present invention, when the platform controller is already running, the embedded controller can still verify the data image file written by the platform controller to the main memory. Therefore, according to the data verification method proposed in the present invention, when the platform controller is running, the embedded controller can still provide protection for the platform controller, and can prevent the platform controller from accessing the data image file that has been attacked.

[0119] The serial numbers in this specification and the scope of the patent application, such as "first", "second", etc., are only for the convenience of explanation and there is no sequential relationship between them.

[0120] The steps of the method and algorithm disclosed in the specification of the present invention can be directly applied to hardware and software modules or a combination of the two by executing a processor. A software module (including execution instructions and related data) and other data can be stored in a data storage device, such as a random access memory (RAM), a flash memory, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), an electronic erasable programmable read-only memory (EEPROM), a register, a hard disk, a portable hard disk, a compact disk read-only memory (CD-ROM), a DVD or any other computer-readable storage medium format in the prior art. A storage medium can be coupled to a machine device, for example, such as a computer / processor (for convenience of explanation, the processor is represented in this specification), and the above-mentioned processor can read information (such as code) and write information to the storage medium. A storage medium can integrate a processor. An application-specific integrated circuit (ASIC) includes a processor and a storage medium. A user device includes an application-specific integrated circuit. In other words, the processor and the storage medium are included in the user device in a manner that is not directly connected to the user device. In addition, in some embodiments, any suitable computer program product includes a readable storage medium, wherein the readable storage medium includes code related to one or more disclosed embodiments. In some embodiments, the computer program product may include packaging materials.

[0121] The above paragraphs are described using multiple levels. Obviously, the teachings of this article can be implemented in multiple ways, and any specific architecture or function disclosed in the examples is only a representative situation. According to the teachings of this article, any person skilled in the art should understand that each level disclosed in this article can be implemented independently or two or more levels can be combined for implementation.

[0122] Although the present invention has been disclosed as above by way of embodiments, it is not intended to limit the present invention. Those skilled in the art may make slight changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the scope of the attached patent application.

Claims

1. A data verification device, characterized in that: include: a main memory for storing data; A backup memory for backing up the data stored in the main memory; a platform controller coupled to the main memory and generating a write instruction to write a first data image file to the main memory, wherein the first data image file includes an update data and a digital signature; and an embedded controller coupled to the main memory, the backup memory and the platform controller, and obtaining the first data image file from the platform controller; When the embedded controller detects the write instruction, the embedded controller verifies the update data according to the first data image file or a second data image file corresponding to the first data image file.

2. The data verification device according to claim 1, characterized in that: Embedded controllers include: a memory circuit; an address checking circuit coupled to the main memory, wherein the address checking circuit detects the write instruction, obtains the first data image file from the platform controller, and determines whether the first data image file is written into the entire address space or a portion of the address space of the main memory; an address allocation circuit coupled to the memory circuit, the address check circuit and the backup memory, and generating the second data image file; and A verification circuit is coupled to the address allocation circuit and performs the verification according to the first data image file or the second data image file.

3. The data verification device according to claim 2, characterized in that: When the address check circuit determines that the first data image file is written to the entire address space of the main memory, the verification circuit decrypts the digital signature to obtain a first hash value, and generates a second hash value based on the updated data through a hash algorithm, and the verification circuit compares whether the first hash value and the second hash value are the same to verify the updated data.

4. The data verification device according to claim 2, characterized in that: When the address checking circuit determines that the first data image file is written into a partial address space of the main memory, the address checking circuit transmits a first address information to the address allocation circuit and transmits the first data image file and a second address information to the memory circuit, wherein the first address information corresponds to a mapping relationship between the main memory and the memory circuit, and the second address information corresponds to the memory circuit.

5. The data verification device according to claim 4, characterized in that: The address allocation circuit obtains storage data corresponding to the first data image file and the second address information from the memory circuit and obtains backup data from the backup memory, and generates the second data image file based on the storage data, the first address information and the backup data, and transmits the second data image file to the verification circuit.

6. The data verification device according to claim 5, characterized in that: The verification circuit decrypts the digital signature contained in the second data image file to obtain a first hash value, and generates a second hash value based on the adjusted update data contained in the second data image file through a hash algorithm, and the verification circuit compares whether the first hash value and the second hash value are the same to verify the adjusted update data.

7. The data verification device according to claim 2, characterized in that: When the address checking circuit determines that the first data image file is written into a partial address space of the main memory, the address checking circuit transmits the first data image file and a first address information to the address allocation circuit, wherein the first address information corresponds to a mapping relationship between the main memory and the memory circuit.

8. The data verification device according to claim 7, characterized in that: The address allocation circuit obtains backup data from the backup memory, and transmits a second address information and an adjustment data corresponding to the first data image file, the first address information and the backup data to the memory circuit according to the first data image file, the first address information and the backup data, and the memory circuit transmits the second data image file to the verification circuit according to the adjustment data and the second address information, wherein the second address information corresponds to the memory circuit.

9. The data verification device according to claim 8, characterized in that: The verification circuit decrypts the digital signature contained in the second data image file to obtain a first hash value, and generates a second hash value based on the adjusted update data contained in the second data image file through a hash algorithm, and the verification circuit compares whether the first hash value and the second hash value are the same to verify the adjusted update data.

10. The data verification device according to claim 1, characterized in that: When the update data fails to pass the authentication, the embedded controller restores the main memory according to the backup data stored in the backup memory.

11. A data verification method, characterized in that: A data verification device is provided, comprising: Detecting, by an embedded controller of the data verification device, whether a platform controller of the data verification device generates a write instruction to write a first data image file into a main memory; When the embedded controller detects that the platform controller generates the write instruction, the embedded controller obtains the first data image file from the platform controller, wherein the first data image file includes update data and a digital signature; and The embedded controller verifies the update data according to the first data image file or a second data image file corresponding to the first data image file.

12. The data verification method according to claim 11, characterized in that: Also includes: Detecting the write instruction and obtaining the first data image file from the platform controller through an address check circuit of the embedded controller; and The address checking circuit is used to determine whether the first data image file is written into the entire address space or a portion of the address space of the main memory.

13. The data verification method according to claim 12, characterized in that: Also includes: When the address check circuit determines that the first data image file is written into the entire address space of the main memory, a verification circuit of the embedded controller decrypts the digital signature to obtain a first hash value; Generate a second hash value according to the update data by using a hash algorithm through the verification circuit; and The verification circuit compares the first hash value and the second hash value to see whether they are the same, so as to verify the update data.

14. The data verification method according to claim 12, characterized in that: Also includes: When the address checking circuit determines that the first data image file is written into a partial address space of the main memory, the address checking circuit transmits a first address information to an address allocation circuit and transmits the first data image file and a second address information to a memory circuit of the embedded controller, wherein the first address information corresponds to a mapping relationship between the main memory and the memory circuit, and the second address information corresponds to the memory circuit.

15. The data verification method according to claim 14, characterized in that: Also includes: Obtaining a storage data corresponding to the first data image file and the second address information from the memory circuit through the address allocation circuit and obtaining backup data from a backup memory of the data verification device; generating the second data image file according to the storage data, the first address information and the backup data by the address allocation circuit; and The second data image file is transmitted to a verification circuit of the embedded controller through the address allocation circuit.

16. The data verification method according to claim 15, characterized in that: Also includes: Decrypting the digital signature contained in the second data image file through the verification circuit to obtain a first hash value; Generate a second hash value according to the adjusted update data included in the second data image file by using a hash algorithm through the verification circuit; and The verification circuit compares the first hash value and the second hash value to see if they are the same, so as to verify the adjusted update data.

17. The data verification method according to claim 12, characterized in that: Also includes: When the address checking circuit determines that the first data image file is written into a partial address space of the main memory, the first data image file and a first address information are transmitted to the address allocation circuit through the address checking circuit, wherein the first address information corresponds to a mapping relationship between the main memory and a memory circuit of the embedded controller.

18. The data verification method according to claim 17, characterized in that: Also includes: Obtaining backup data from a backup memory of the data verification device through the address allocation circuit; Transmitting a second address information and an adjustment data corresponding to the first data image file, the first address information and the backup data to the memory circuit through the address allocation circuit according to the first data image file, the first address information and the backup data, wherein the second address information corresponds to the memory circuit; and The second data image file is transmitted to a verification circuit of the embedded controller through the memory circuit according to the adjustment data and the second address information.

19. The data verification method according to claim 18, characterized in that: Also includes: Decrypting the digital signature contained in the second data image file through the verification circuit to obtain a first hash value; Generate a second hash value according to the adjusted update data included in the second data image file by using a hash algorithm through the verification circuit; and The verification circuit compares the first hash value and the second hash value to see if they are the same, so as to verify the adjusted update data.

20. The data verification method according to claim 11, characterized in that: Also includes: When the updated data fails to pass the authentication, the embedded controller restores the main memory according to the backup data stored in a backup memory of the data verification device.