WO2023216077A1 - Attestation method, apparatus and system - Google Patents

Attestation method, apparatus and system Download PDF

Info

Publication number
WO2023216077A1
WO2023216077A1 PCT/CN2022/091803 CN2022091803W WO2023216077A1 WO 2023216077 A1 WO2023216077 A1 WO 2023216077A1 CN 2022091803 W CN2022091803 W CN 2022091803W WO 2023216077 A1 WO2023216077 A1 WO 2023216077A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
node
data
certification
verification
Prior art date
Application number
PCT/CN2022/091803
Other languages
French (fr)
Chinese (zh)
Inventor
王辰昱
吴永铮
魏卓
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2022/091803 priority Critical patent/WO2023216077A1/en
Publication of WO2023216077A1 publication Critical patent/WO2023216077A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities

Definitions

  • This application relates to the field of security technology, and in particular to a verification method, device and system.
  • Authentication (attestation) technology is one of the key technologies in trusted computing and is used to verify whether the data to be verified on the side of the verified device is in a trusted state.
  • the proving program and the data to be verified run in the same execution environment (such as a regular execution environment (rich execution environment, REE)) with potential malicious programs without any difference, and the proving program and the data to be verified may can be tampered with by malicious programs.
  • the proving program and data to be verified are isolated from potential malicious programs based on hardware.
  • the proving program and data to be verified run in a trusted execution environment (TEE), and potential malicious programs run in REE.
  • TEE trusted execution environment
  • REE trusted execution environment
  • the certification program and the data to be verified running on the TEE cannot be tampered with by potential malicious programs in the REE.
  • the security based on hardware verification technology is higher than the security based on software verification technology.
  • Embodiments of the present application provide a verification method, device and system, which help improve security in a system architecture based on software verification technology.
  • embodiments of the present application provide a verification method that can be executed by the certification node of the first device.
  • the certification node can run the certification program preset in the first device and calculate based on the target data to be verified.
  • the verification result to be verified is provided to the verification node of the second device, so that the verification node performs credibility verification on the target data.
  • the method may include: the certification node obtains a target address sequence, wherein the target address sequence points to the target data to be verified; the certification node obtains the certification result according to the target data; the certification node provides the verification node with the The certification result is provided, wherein the certification result is associated with a first moment, and the certification result and the first moment are used for credibility verification of the target data.
  • the proof node and the verification node can be configured to: when verifying the credibility of the target data, in addition to the proof results from the proof node, information from other check dimensions can also be added at the same time, such as proof result correlation. the first moment.
  • the certification node can provide information of at least one checking dimension, such as certification results, to the verification node, so that the verification node can combine information of at least two checking dimensions (for example, including but not limited to the certification results from the certification node, the certification results The first moment of association, etc.) jointly verify the credibility of the target data, thereby improving security in the system architecture based on software verification technology.
  • the communication volume between the proving node and the verification node is small, and it will not bring too much performance overhead, nor will it have a great impact on other services (such as security services) of the first device to which the proving node belongs.
  • This solution can balance security and performance.
  • the certification node obtains a target address sequence, including: the certification node obtains a target parameter; the certification node generates the target address sequence according to the target parameter and a target function.
  • the target parameter includes a random number
  • the target function includes a pseudo-random generator function.
  • the objective function can be configured at the proof node.
  • the target function can be run in response to the target parameters to generate the target address sequence.
  • the proof node can read the target data to perform calculations based on the target address sequence.
  • the target parameter includes a random number, and a pseudo-random generator function is used to generate the target address sequence, which can add randomness to the calculation process based on the target data, thereby improving security.
  • the certification node obtains the target parameters, including: the certification node obtains the target parameters from the challenge node or the real-time operating system RTOS of the first device to which the certification node belongs, wherein, the challenge node is a node that triggers verification of the credibility of the target data.
  • the challenge node or the RTOS of the first device can trigger the certification node to run the certification program through the target parameter to perform the reading and calculation process of the target data, so that the verification method of the embodiment of the present application can be implemented. More flexible.
  • the certification node obtains the target address sequence, including: the certification node obtains the target address sequence from the RTOS of the first device to which the certification node belongs, wherein, The target address sequence is generated by the RTOS based on target parameters and target functions.
  • the objective function can be configured in the RTOS of the first device to which the proving node belongs. After the proving node starts running the proving program, the objective function located in the RTOS can run in response to the target parameters. , to generate the target address sequence. Prove that the node can obtain the target address sequence from the RTOS in order to read the target data based on the target address sequence for calculation.
  • the target parameter may include a random number
  • the target function may include a pseudo-random generator function. Using the pseudo-random generator function to generate a target address sequence can add randomness to the entire calculation process and improve security.
  • the certification node runs on at least one first resource unit
  • the at least one first resource unit is a resource unit included in the first device to which the certification node belongs, so
  • the resource unit described above is used at least to run the program.
  • the at least one first resource unit runs programs other than key programs of the first device, where the key programs at least include programs that perform security tasks and/or programs that perform scheduling tasks.
  • the resource unit may be a processor core of the first device.
  • the first device to which the certification node belongs can include multiple resource units, and the first device can schedule at least one first resource unit for the certification node, so that the certification program of the certification node can run on at least one first resource unit, This allows the running of the certification program to occupy less resource units occupied by key programs, thereby reducing the impact of the certification process on other services on the first device side.
  • the target address sequence includes at least two addresses, the at least two addresses point to at least two data blocks included in the target data, and the certification node is based on the Obtaining a certification result for the target data includes: the certification node uses a target algorithm to calculate at least two data blocks contained in the target data in a first order to obtain the certification result.
  • the target algorithm may adopt a serial calculation structure, and the target algorithm may include a hash algorithm.
  • the proof node can use a serial calculation structure to calculate at least two data blocks contained in the target data in sequence until the proof result is obtained.
  • this serial calculation method can effectively prevent an attacker from using the multi-resource unit characteristic of the first device to construct an algorithm to execute the verification algorithm in parallel, thereby reducing the execution time.
  • the target address sequence includes the at least two addresses, the at least two addresses point to at least two data blocks included in the target data, and further includes: in the When the length of the data block pointed to by the first address among the at least two addresses is greater than the data length threshold, the data block pointed by the first address is segmented.
  • the data length threshold may be a data length threshold preset for the target algorithm.
  • the node can segment the data blocks whose data length exceeds the data length threshold according to the data characteristics of different data blocks contained in the target data and obtain the corresponding of data sub-blocks.
  • the proof node can perform calculations based on data blocks that do not require data segmentation and data sub-blocks obtained after segmentation, thereby ensuring that all data in different data blocks pointed to by addresses in the target address sequence can be calculated.
  • the method further includes: the proving node obtains a base address; the proving node obtains a base address according to the values of at least two addresses in the base address and the target address sequence. , calculate the original value pointing to the address of the target data, and the original value is used to read the target data.
  • the proof node can obtain the base address and subtract the base address from the value of each address in the target address sequence to obtain the original value of the address pointing to the target data. , to use the original value to read the target data and try to avoid the address being tampered with by the attacker.
  • the method further includes: the certification node determines tag information based on the original value; the certification node provides the tag information to the verification node, and the tag The information is used to derive the original value in reverse.
  • the proving node can provide the tag information corresponding to the original value of the address pointing to the target data to the verification node, so that the verification node can reversely deduce the original value based on the tag information, thereby performing the same calculation process on the verification node side.
  • the mirror data can be read and calculated based on the original value obtained by reverse derivation, and a credible certification result can be obtained, which can be used to verify the credibility of the target data.
  • the target address sequence generated according to the target parameters may include at least two addresses.
  • the certification node may convert the original addresses pointing to at least two addresses of the target data.
  • the tag information corresponding to the value is provided to the verification node. This method does not require the transmission of complete pointer data and can reduce the communication volume between the proving node and the verification node.
  • the target data includes data in memory space allocated for at least one of the following programs: a key program or a certification program run by the certification node.
  • the key programs at least include programs that perform security tasks and/or programs that perform scheduling tasks.
  • the key programs of the first device to which the proving node belongs that need to be securely protected and the data in the program memory space of the proving program need to be verified.
  • the target function of the first device can be configured as: in the generated target address sequence The address should at least point to the data in the program memory space of the key program and the certification program to reduce the possibility of these data being tampered with by an attacker.
  • the first device to which the certification node belongs and the second device to which the verification node belongs are located in the same system-on-chip SoC, wherein the first device is located in the SoC untrusted hardware, the second device is located in the trusted hardware of the SoC; or the first device and the second device are different devices, wherein the first device is an untrusted device, The second device is a trusted device.
  • the first device to which the certification node belongs and the second device to which the verification node belongs can include multiple product forms. Among them, it is only necessary to ensure that the second device is located on trusted hardware or is a trusted device, and the first device can be located on untrusted hardware or is an untrusted device.
  • the verification method of the embodiment of the present application although the proof node is running on In a non-trusted environment, the verification results from the certification node can be verified by the verification node running in the trusted environment to determine the credibility of the target data on the first device side, with little impact on the first device side. Under the condition of performance and other business execution, the security of target data can still be guaranteed.
  • the trustworthiness verification of the target data passes; wherein the trust condition includes: the proof The proof result provided by the node is the same as the proof result obtained by the verification node according to the target parameter, and the first time interval associated with the first moment is within the time range allowed by the verification node.
  • trust conditions can be set based on the information of at least two inspection dimensions, so that during the verification process, the target data can be verified by judging whether the obtained information of the at least two inspection dimensions meets the preset trust conditions.
  • Credibility It should be noted that this is only an illustration of the trustworthy conditions in the embodiments of the present application without any limitation. In other embodiments, when the check dimensions are changed or other check dimension information is added, the trustworthy conditions can be modified accordingly. , the embodiment of the present application does not limit this.
  • the first time interval associated with the first moment may be the execution time of the calculation process on the proving node side.
  • the challenge node issues a challenge to the proving node at the second moment, it can simultaneously instruct the verification node, and the verification node can learn the revelation moment of the challenge.
  • the verification node receives the certification result from the certification node at the first moment, the verification node can learn the end moment of the challenge.
  • the first time interval can be the time difference between the first moment and the second moment and the time obtained by the allowed time error. interval. If the first time interval is within the allowed time error range, it means that the algorithm has not been tampered with in the execution time dimension, and the target data is credible at least in the algorithm execution time dimension. If the first time interval is not within the allowed time error range, it means that the algorithm may have been tampered with in the execution time dimension, and the target data is not trustworthy at least in the algorithm execution time dimension.
  • embodiments of the present application provide a verification method, which can be executed by a verification node on the second device side.
  • the verification node can run a verification program preset in the second device, and perform verification according to the verification result to be verified. (for example, the first certification result from the certification node), verifying the credibility of the target data on the first device side.
  • the method includes: the verification node obtains a target parameter, the target parameter includes a random number; the verification node obtains a first certification result from the certification node, wherein the first certification result is the certification node according to the to-be-verified The target data is obtained, and the first certification result is associated with the first time; the verification node verifies the credibility of the target data based on the target parameters, the first certification result and the first time.
  • the verification node and the certification node can be configured such that, in addition to the first certification result from the certification node, when verifying the credibility of the target data, information from other checking dimensions can also be added at the same time, such as The first moment of proof of the correlation of the results. Furthermore, the verification node can jointly verify the credibility of the target data based on the information to be verified obtained from the certification node (such as the first certification result from the certification node) and other information (such as the first moment associated with the first certification result), This improves security in system architectures based on software verification technology.
  • the communication volume between the verification node and the proving node is small, and it will not bring too much performance overhead, nor will it have a great impact on other services (such as security services) of the first device to which the proving node belongs.
  • This solution can balance security and performance.
  • the verification node obtains the target parameters, including: the verification node obtains the target parameters from the challenge node or the RTOS of the second device to which the verification node belongs, wherein, The challenge node is a node that triggers verification of the credibility of the target data.
  • the RTOS of the challenge node or the second device can trigger the certification node to run the verification program through the target parameters to perform the credibility verification process of the target data, making the implementation of the verification method of the embodiment of the present application more flexible.
  • the verification node verifies the credibility of the target data based on the target parameters, the first certification result and the first moment, including: The verification node obtains a second certification result based on the target parameters; the verification node verifies the credibility of the target data based on the second certification result, the first certification result and the first time.
  • the verification node can obtain the second certification result according to the target parameters.
  • the second certification result is credible and can be used to verify whether the first certification result from the certification node is credible, thereby verifying the target on the first device side. Credibility of data.
  • the verification result can obtain the second verification result according to the target parameters in at least one way.
  • Example 1 the verification node and the proof node can use the same method to calculate and obtain the corresponding proof results.
  • the verification node obtains the second certification result according to the target parameter, which may include: the verification node obtains a target address sequence according to the target parameter, wherein the target address sequence points to the mirror data of the target data; The verification node obtains the second certification result based on the mirror data.
  • the verification node obtains the target address sequence based on the target parameters, which may include: the verification node generates the target address sequence based on the target parameters and the target function; or, the verification node generates the target address sequence based on the target parameters.
  • the objective function may include a pseudo-random generation function.
  • the target address sequence includes at least two addresses, and the at least two addresses point to at least two data blocks contained in the mirror data, and the verification node performs the verification according to the Obtaining the second certification result from the mirror data includes: the verification node adopts a target algorithm to calculate at least two data blocks contained in the mirror data in a first order to obtain the second certification result.
  • the target algorithm may adopt a serial calculation structure, and the target algorithm may include a hash algorithm.
  • the target address sequence includes the at least two addresses, the at least two addresses point to at least two data blocks included in the mirror data, and further includes: in the When the length of the data block pointed to by the first address among the at least two addresses is greater than the data length threshold, the data block pointed by the first address is segmented.
  • the method further includes: the verification node obtains tag information from the certification node; the verification node determines, based on the tag information and the target address sequence, the direction to the The original value of the address of the mirror data, which is used to read the mirror data.
  • Example 2 The verification node does not need to perform the same calculation steps as the proof node, but can obtain the second proof result by looking up the table.
  • the verification node obtains the second certification result according to the target parameter, which may include: the verification node uses the target parameter as an index to obtain the second certification result from a first list, wherein the first The list includes a plurality of parameters, including the target parameter, and a proof result associated with each parameter.
  • the method may further include: the verification node obtaining tag information from the certification node; the verification node using the target parameter as an index, from the first list
  • Obtaining the second certification result includes: the verification node using the target parameter and the tag information as an index to obtain the second certification result from the first list.
  • this tag information is an example of information for the interaction between the proving node and the verification node. The transmission and use of the tag information depends on the specific algorithm adopted by the proving node side.
  • the proving node uses a pointer to the target data in order to eliminate the impact of base address randomization, The original value of the address, the proving node can determine the tag information based on the original value, and transfer the tag information to the verification node in association with the first proof result, for the verification node to reversely deduce the original value, or search for the corresponding tag information in combination with the original value
  • the proof results are not limited by the embodiments of this application.
  • the first device to which the certification node belongs and the second device to which the verification node belongs are located in the same system-on-chip SoC, wherein the first device is located in the SoC untrusted hardware, the second device is located in the trusted hardware of the SoC; or the first device and the second device are different devices, wherein the first device is an untrusted device, The second device is a trusted device.
  • the second device further includes a challenge node, which is a node that triggers verification of the credibility of the target data; or, the second device and the The third device to which the challenge node belongs is a different device, and the third device and the first device are different devices.
  • a challenge node which is a node that triggers verification of the credibility of the target data
  • the verification node verifies the credibility of the target data based on the target parameters, the first certification result and the first moment, including: The verification node determines whether the target data satisfies the preset trust conditions according to the target parameters, the first certification result and the first moment, so as to verify the credibility of the target data; wherein, the The credible conditions include: the first certification result is the same as the second certification result obtained by the verification node according to the target parameter, and the first time interval associated with the first moment is within the time range allowed by the verification node.
  • embodiments of the present application provide a device for proving a node, including: an acquisition unit, configured to acquire a target address sequence, wherein the target address sequence points to target data to be verified; and a processing unit, configured to Obtain a proof result according to the target data; a transceiver unit configured to provide the proof result to a verification node, wherein the proof result is associated with a first time, and the proof result and the first time are used for the target data credibility verification.
  • the acquisition unit is configured to: acquire target parameters; generate the target address sequence according to the target parameters and the target function; wherein the target parameters include random numbers, so
  • the objective function includes a pseudo-random generation function.
  • the acquisition unit is configured to: acquire the target parameter from a challenge node or a real-time operating system RTOS of the first device to which the certification node belongs, wherein the challenge node is Trigger nodes that verify the authenticity of the target data.
  • the acquisition unit is configured to: acquire the target address sequence from the RTOS of the first device to which the certification node belongs, wherein the target address sequence is the target address sequence according to the RTOS.
  • Target parameters and objective functions are generated.
  • the certification node runs on at least one first resource unit, and the at least one first resource unit is a resource unit included in the first device to which the certification node belongs, so The resource unit described above is used at least to run the program.
  • the at least one first resource unit runs programs other than key programs of the first device, where the key programs at least include programs that perform security tasks and/or A program that performs scheduled tasks.
  • the target address sequence includes at least two addresses, the at least two addresses point to at least two data blocks included in the target data, and the processing unit is configured to: A target algorithm is used to calculate at least two data blocks contained in the target data in a first order to obtain the proof result.
  • the target algorithm adopts a serial computing structure, and the target algorithm includes a hash algorithm.
  • the target address sequence includes the at least two addresses, the at least two addresses point to at least two data blocks included in the target data, and further includes: in the When the length of the data block pointed to by the first address among the at least two addresses is greater than the data length threshold, the data block pointed by the first address is segmented.
  • the processing unit further includes: obtaining a base address; and calculating data pointing to the target based on the values of the base address and at least two addresses in the target address sequence. The original value of the address, which is used to read the target data.
  • the processing unit is further configured to: determine tag information according to the original value; the certification node provides the tag information to the verification node, and the tag information is Derive the original value in reverse.
  • the target data includes data in the memory space allocated for at least one of the following programs: a key program or a certification program run by the certification node, and the key program at least includes : Programs that perform security tasks and/or programs that perform scheduling tasks.
  • the first device to which the certification node belongs and the second device to which the verification node belongs are located in the same system-on-chip SoC, wherein the first device is located in the SoC untrusted hardware, the second device is located in the trusted hardware of the SoC; or the first device and the second device are different devices, wherein the first device is an untrusted device, The second device is a trusted device.
  • the trustworthiness verification of the target data passes; wherein the trust condition includes: the proof The result is the same as the certification result obtained by the verification node, and the first time interval associated with the first moment is within the time range allowed by the verification node.
  • embodiments of the present application disclose a device for verifying a node, including: an acquisition unit for obtaining target parameters, where the target parameters include random numbers; and obtaining the first certification result from the certification node, wherein, The first proof result is obtained by the proof node based on the target data to be verified, and the first proof result is associated with the first moment; the determination unit is used to determine the target parameter, the first proof result and the At the first moment, the credibility of the target data is verified.
  • the acquisition unit is configured to: acquire the target parameter from a challenge node or an RTOS of a second device to which the verification node belongs, wherein the challenge node is the one that triggers the verification.
  • the determination unit is configured to: obtain a second certification result according to the target parameter; and the verification node obtains a second certification result according to the second certification result, the first certification result and At the first moment, the credibility of the target data is verified.
  • the acquisition unit is configured to: acquire a target address sequence according to the target parameter, wherein the target address sequence points to mirror data of the target data; the device further A processing unit is included for obtaining the second proof result based on the mirror data.
  • the acquisition unit is configured to generate the target address sequence according to the target parameter and the target function.
  • the acquisition unit is configured to: acquire the target address sequence from the RTOS of the second device to which the verification node belongs based on the target parameter, where the target address sequence is generated by the RTOS based on the target parameter and the target function.
  • the objective function includes a pseudo-random generation function.
  • the target address sequence includes at least two addresses, the at least two addresses point to at least two data blocks included in the mirror data, and the processing unit is configured to:
  • the verification node uses a target algorithm to calculate at least two data blocks contained in the mirror data in a first order to obtain the second certification result.
  • the target algorithm adopts a serial computing structure, and the target algorithm includes a hash algorithm.
  • the target address sequence includes the at least two addresses, the at least two addresses point to at least two data blocks included in the mirror data, and further includes: in the When the length of the data block pointed to by the first address among the at least two addresses is greater than the data length threshold, the data block pointed by the first address is segmented.
  • the obtaining unit is further configured to: obtain tag information from the certification node; the determining unit is further configured to determine the pointing direction based on the tag information and the target address sequence.
  • the original value of the address of the mirror data the original value is used to read the mirror data.
  • the acquisition unit is configured to: use the target parameter as an index to acquire the second proof result from a first list, where the first list is used to indicate A plurality of parameters and a proof result associated with each parameter, the plurality of parameters including the target parameter.
  • the acquisition unit is also used to acquire tag information from the certification node; use the target parameter as an index to obtain the second certification result from the first list, It includes: the verification node uses the target parameter and the mark information as an index to obtain the second certification result from the first list.
  • the first device to which the certification node belongs and the second device to which the verification node belongs are located in the same system-on-chip SoC, wherein the first device is located in the SoC untrusted hardware, the second device is located in the trusted hardware of the SoC; or the first device and the second device are different devices, wherein the first device is an untrusted device, The second device is a trusted device.
  • the second device further includes a challenge node, which is a node that triggers verification of the credibility of the target data; or, the second device and the The third device to which the challenge node belongs is a different device, and the third device and the first device are different devices.
  • a challenge node which is a node that triggers verification of the credibility of the target data
  • the verification node verifies the credibility of the target data based on the target parameter, the first certification result and the first moment, including: The verification node determines whether the target data satisfies the preset trust conditions according to the target parameters, the first certification result and the first moment, so as to verify the credibility of the target data; wherein, the The credible conditions include: the first certification result is the same as the second certification result obtained by the verification node according to the target parameter, and the first time interval associated with the first moment is within the time range allowed by the verification node.
  • embodiments of the present application provide a communication system, including a device for implementing the above first aspect and the method described in any possible implementation of the first aspect, and a device for implementing the above second aspect and the second aspect. Any possible device for implementing the method described in this aspect.
  • embodiments of the present application provide a chip system, including at least one processor and an interface circuit.
  • the processor is configured to execute instructions and/or data interaction through the interface circuit, so that the chip system executes the above-mentioned
  • the method described in the first aspect and any possible implementation of the first aspect, or the method described in the above second aspect and any possible implementation of the second aspect is performed.
  • embodiments of the present application provide a terminal, including the device described in the above third aspect and any possible implementation of the third aspect, or the chip system described in the above fifth aspect, and/or the above fourth aspect.
  • the terminal equipment includes but is not limited to: intelligent transportation equipment (such as cars, ships, drones, trains, trucks, etc.), intelligent manufacturing equipment (such as robots, industrial equipment, intelligent logistics, smart factories, etc.), intelligent terminals (Mobile phones, computers, tablets, PDAs, desktops, headphones, speakers, wearable devices, vehicle-mounted devices, etc.).
  • embodiments of the present application provide a vehicle that can be used to implement the method described in the above first aspect and any possible implementation of the first aspect, and/or to implement the method described in the above second aspect and any possible implementation manner of the first aspect. The method described in any of the two possible implementation methods.
  • embodiments of the present application provide a vehicle, which may include the device described in the above third aspect and any possible implementation of the third aspect, and/or include the device that implements any of the above fourth aspect and any possible implementation of the fourth aspect.
  • embodiments of the present application provide a computer-readable storage medium, including a program or instructions.
  • program or instructions When the program or instructions are executed, the method described in the first aspect and any possible implementation of the first aspect is performed. is executed, or the method described in the above second aspect and any possible implementation manner of the second aspect is executed.
  • embodiments of the present application provide a computer program product, which when a computer reads and executes the computer program product, causes the computer to execute the method described in the above-mentioned first aspect and any possible implementation of the first aspect, Alternatively, perform the method described in the above second aspect and any possible implementation manner of the second aspect.
  • Figure 1 shows a schematic diagram of the principle of the verification technology according to the embodiment of the present application
  • Figure 2 shows a schematic diagram of the data section in the program memory space according to the embodiment of the present application
  • Figure 3 shows the software-based verification architecture of the embodiment of the present application
  • Figure 4 shows the hardware-based verification structure of the embodiment of the present application
  • Figure 5 shows a schematic diagram of the system structure of an example of the embodiment of the present application.
  • Figure 6 shows a schematic diagram of a verification framework according to an embodiment of the present application.
  • Figure 7 shows a schematic diagram of another verification framework according to the embodiment of the present application.
  • Figure 8 shows a schematic diagram of the verification principle based on a dual-core system according to the embodiment of the present application
  • Figure 9 shows the calculation process in an example attack scenario according to the embodiment of the present application.
  • Figure 10 shows an example of the certification result information table according to the embodiment of the present application.
  • Figure 11 shows the calculation process in another example of an attack scenario according to the embodiment of the present application.
  • Figure 12 shows the calculation process in another example of an attack scenario according to the embodiment of the present application.
  • Figure 13 shows the calculation process in another example of an attack scenario according to the embodiment of the present application.
  • Figure 14 shows a schematic diagram of the verification principle based on a multi-core system according to the embodiment of the present application
  • Figure 15 shows a schematic flow chart of the verification method according to the embodiment of the present application.
  • Figure 16 shows a schematic diagram of a device to be verified according to an embodiment of the present application
  • Figure 17 shows a schematic diagram of the verification device according to the embodiment of the present application.
  • Figure 18 shows a schematic diagram of a communication device according to an embodiment of the present application.
  • Verification technology is one of the key technologies in trusted computing and is used to verify whether the device being verified is in a trusted state. For example, whether the code, data status, etc. are as expected.
  • verification technology mainly involves the following three parties:
  • Challenger The party that poses a security challenge to the prover during the verification process.
  • the challenger will send a challenge (e.g. denoted as c) to the prover.
  • This challenge (c) is also sent to the validator.
  • the purpose of the challenger sending the challenge is to add more randomness to the verification process and prevent attackers from forging responses.
  • the prover can run a preset proof program based on the challenge sent by the challenger, calculate the target data to be verified, calculate the corresponding reply to challenge (c) (for example, represented as r), and provide it to the verifier, in order to Provide the verifier with proof results of whether the prover is in a trustworthy state.
  • c reply to challenge
  • Verifier During the verification process, the party that verifies and responds to the challenge of the prover.
  • the verifier can receive the challenge (c) issued by the challenger and the reply (r) issued by the prover for verification, and return the verification result (for example, expressed as V(c, r)) to the challenger.
  • the challenger can know the credibility of the target data on the prover's side based on the verification results.
  • the challenger and the verifier can be the same user, such as the same person or the same company.
  • the challenger and the verifier may be different users.
  • the challenger may be a device user and the verifier may be a device manufacturer. This is not limited in the embodiments of this application.
  • the challenger may be called a challenge node
  • the prover may be called a certification node
  • the verifier may be called a verification node.
  • the device to which the proving node belongs may be called the first device
  • the device to which the verification node belongs may be called the second device
  • the device to which the challenge node belongs may be called the third device.
  • the proof result obtained by the proof node executing the proof calculation process is called the first proof result.
  • the verification node can obtain a credible proof result (for example, expressed as a second proof result) through the verification method in the embodiment of the present application, and use the second proof As a result, the first certification result from the certification node is verified, and the verification result is obtained.
  • the proof program can be preset in the first device to which the proof node belongs. After receiving the challenge from the challenge node, the first device to which the proof node belongs can run the proof program to perform the proof calculation process to obtain The first proves the result.
  • the proof program may include but is not limited to subroutines that perform the following calculation processing:
  • the above subroutine is only an example of the certification program in the embodiment of the present application and does not limit it in any way.
  • the certification program run by the certification node may include but is not limited to the above subroutine, which will not be discussed here. Repeat.
  • the program run by the verification node when performing the verification calculation process.
  • the verification program can be preset on the second device to which the verification node belongs. After receiving the challenge from the challenge node, the second device to which the verification node belongs can run the verification program to perform the verification calculation process, and obtain Validation results.
  • the verification program may include but is not limited to subroutines that perform the following calculation processing:
  • the method of obtaining the second certification result according to the target parameters may be similar to the method of obtaining the first certification result on the certification node side.
  • the verification program may include but not Limited to subroutines that perform the following calculation processing:
  • the verification program may include a table lookup program.
  • the locally stored trusted information can be obtained through table lookup based on the target parameters from the challenge node, and used The trusted information serves as the second certification result to verify the first certification result from the certification node to verify the credibility of the target data of the first device to which the certification node belongs.
  • the above subroutines are only examples of the verification program in the embodiment of the present application and are not limiting in any way.
  • the verification program run by the verification node may include but is not limited to the above subroutines, which will not be discussed here. Repeat.
  • Program memory space (or memory segment):
  • main memory space physical address space
  • program memory space the memory space allocated by the system for a user program
  • the user program may include any program in the computer, such as the above-mentioned certification program or verification program, as well as the key programs mentioned below.
  • the data in the program memory space can be divided into different data segments (segments) according to the usage, such as code segment (code segment), read-only data segment (read-only data segment) and general data segment (normal data segment), as shown in Figure 2.
  • code segment code segment
  • read-only data segment read-only data segment
  • general data segment normal data segment
  • different data sections represent different access rights to the data in the section.
  • the data in the code segment is executable but cannot be read and written;
  • the data in the read-only data segment is not executable and can only be read;
  • the data in the general data segment is not executable but can be read and written.
  • the program runs in the code segment, and the data block contained in the target data to be verified may be located in the code segment, may be located in the read-only data segment, or may be located in the normal data segment.
  • Code injection attacks refer to attackers (or attack nodes) modifying code segment data to change the operations performed by the code during execution, thereby performing malicious operations and endangering security.
  • Key data tampering attacks refer to attackers modifying key data (such as static data) in different data sections, such as access permission data, machine configuration data, etc., to indirectly change the operations performed during the execution process, thereby executing malicious operation, endangering safety.
  • key data such as static data
  • data sections such as access permission data, machine configuration data, etc.
  • Code pointer/data pointer tampering attack means that the attacker indirectly changes the operations performed during the execution process by modifying the code pointer pointing to the code address or the data pointer pointing to the data address, thereby performing malicious operations and endangering security.
  • the pointer is the memory address
  • the pointer variable is the variable used to store the memory address.
  • the length of the storage unit occupied by different types of pointer variables is the same, and the variables that store data are different depending on the type of data. , the length of storage space occupied is also different.
  • the verification method in the embodiment of this application can ensure the security of the target data at least in the above three attack scenarios.
  • SWAT Software based attestation
  • the operating environment includes a rich execution environment (REE).
  • REE rich execution environment
  • the application (APP) running in REE is a program that can be attacked by attackers and is a potentially malicious program.
  • the program and target data run in the same execution environment as the REE APP, such as the REE operating system (OS).
  • OS REE operating system
  • the certification program runs in an untrusted environment, and the certification program and the data to be verified may be tampered with by malicious programs, and security cannot be guaranteed.
  • the operating environment based on hardware isolation can include REE and trusted execution environment (TEE).
  • REE OS and multiple REE APPs can be run in REE.
  • TEE OS, multiple TEE APPs and certification programs can be run in TEE.
  • REE OS and multiple REE APPs are located on untrusted hardware and can be attacked by attackers, which are potentially malicious programs. Due to hardware isolation, the proving program and the verified target data are located in the trusted environment of TEE and cannot be tampered with by potential malicious programs in the REE, so that the proving program and the target data are protected. Therefore, from a security perspective, the security of technology based on hardware verification is higher than that of technology based on software verification.
  • SoC System-on-a-chip
  • SoC refers to the technology that integrates a complete system on a single chip and groups all or part of the necessary electronic circuits.
  • the system generally includes a central processing unit (CPU), memory, and peripheral circuits.
  • CPU central processing unit
  • memory volatile and non-volatile memory
  • peripheral circuits the specific modules integrated on the SoC can be different and more complex.
  • the system-on-chip of a sound detection device provides all users with an audio receiver, an analog-to-digital converter (ADC), a microprocessor, necessary memory, and input and output logic control on a single chip. equipment.
  • ADC analog-to-digital converter
  • microprocessor necessary memory
  • input and output logic control on a single chip. equipment.
  • the SoC applicable to the embodiments of this application may include two parts, such as a CPU part and a hardware security module (HSM) part.
  • the CPU part is untrusted hardware and may include at least two CPU cores (examples of resource units, at least used for running programs).
  • the HSM part is trusted hardware based on hardware isolation.
  • the proof node in the embodiment of this application can be located in the CPU part, and the verification node and challenge node can be located in the HSM part.
  • the key tasks are tasks of the first device that need to be securely protected, such as applications with high real-time requirements in smart car scenarios, password verification tasks, visual recognition tasks, etc.
  • Key programs and key modules are code segment data that implement key tasks.
  • key programs can include code that runs complete logic, such as code for visual recognition programs.
  • a key module is a piece of code for the key functions of the program, such as the machine learning operation logic code of the visual recognition program, the scheduling logic code in the operating system, etc.
  • Key data is data to achieve key tasks.
  • This data can include data located in different data sections in the program memory space, such as code section key data, read-only data section key data, general data section key data, etc.
  • Program interrupt means that when the computer is executing the current program, some abnormal situations and special requests that urgently need to be handled occur.
  • the CPU temporarily terminates the current program and switches to the execution of the interrupt service routine to handle more urgent events that occur randomly. After the interrupt is processed, the CPU will automatically return to the original program to continue execution.
  • Program interrupts are not only suitable for input and output operations of external devices, but also for processing random events that occur in the outside world.
  • the first device to which the proving node belongs, the second device to which the verification node belongs, and the third device to which the challenge node belongs can all be configured to use program interruption to trigger the execution of corresponding sub-processes included in the verification process.
  • the challenge node needs to initiate a challenge, it can use the interrupt service program of the third device to send the target parameter that triggers the challenge to the first device to which the certification node belongs.
  • the interrupt service program is activated and executed, triggering the running of the preset proof program to perform the proof calculation process on the target data to be verified by the first device, and obtain the first proof.
  • the first certification result can be provided to the second device to which the verification node belongs.
  • the interrupt service routine of the third device may also send the target parameters of the challenge to the second device to which the verification node belongs.
  • the interrupt service program is activated and executed, triggering the running of the preset verification program to obtain the first certification result from the certification node, and combined with the first certification result, verify Credibility of the target data of the first device.
  • the first device may include at least two resource units.
  • at least one of the at least two resource units may be respectively bound and used to run different programs of the first device.
  • the at least one first resource unit is used to run programs other than critical programs of the first device (such as certification program)
  • at least one second resource unit is used to run a key program of the first device
  • the key program at least includes a program for executing safety tasks and/or a program for executing scheduling tasks.
  • the first device may be a dual-core or multi-core device, and the resource unit of the first device may be, for example, a CPU core of the first device.
  • the first device may include at least two CPU cores that are bound to run critical tasks.
  • the CPU core of a program may be called the second core, and the CPU core bound to run programs other than critical programs may be called the first core.
  • the program interruption method is only an example of the communication method between the respective devices of the challenge node, the proving node and the verification node in the embodiment of the present application, and does not limit it in any way.
  • the devices to which each node belongs Any suitable communication method (such as network communication, software and hardware communication, etc.) can also be used between devices to implement information interaction to initiate the verification process, which is not limited in the embodiments of the present application.
  • At least one refers to one or more, and “multiple” refers to two or more.
  • “And/or” describes the association of associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A, B can be singular or plural.
  • the character “/” generally indicates that the related objects are in an “or” relationship.
  • “At least one of the following” or similar expressions thereof refers to any combination of these items, including any combination of a single item (items) or a plurality of items (items).
  • At least one of a, b, or c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.
  • the ordinal numbers such as “first”, “second” and “third” mentioned in the embodiments of this application are used to distinguish multiple objects and are not used to limit the priority or priority of multiple objects. Importance.
  • the first device, the second device, and the third device are only used to distinguish different devices, but do not indicate differences in priority or importance of the three devices.
  • the embodiments of the present application provide a verification method, device and system, which help to improve security in a system architecture based on software verification technology.
  • the method and the device are based on the same technical concept. Since the principles of the method and the device to solve the problem are similar, the implementation of the device and the method can be referred to each other, and the repeated points will not be repeated.
  • the following takes the smart car scenario as an example to introduce the verification scheme of the embodiment of the present application. It should be understood that the verification solution of the embodiment of the present application can also be applied to other scenarios that have higher performance requirements and need to ensure data security based on software verification technology. The embodiment of the present application does not limit this.
  • Figure 5 shows a schematic diagram of the system architecture of an example of the embodiment of the present application.
  • the system architecture may include multiple modules located on the same SoC, such as at least one electronic control unit (ECU) deployed on the same system on a chip or system on a chip (SoC) connected to the vehicle.
  • ECU electronice control unit
  • SoC system on a chip
  • electrical control unit, ECU) CPU for example, represented as ECU CPU
  • HSM hardware security module
  • the SoC can adopt a hardware isolation mechanism and be divided into REE and TEE.
  • the ECU CPU can belong to REE
  • the HSM can belong to TEE.
  • ECU CPU includes at least two CPU cores (Core), a real-time operating system (RTOS) running on the at least two CPU cores (for ease of differentiation, for example, expressed as RTOS1) and all application programs ( For example APP1 and APP2).
  • Core CPU cores
  • RTOS real-time operating system
  • APP1 and APP2 application programs
  • the HSM may include an HSM core, an RTOS (e.g., represented as RTOS2) running on the HSM core, and an application for implementing a secure service.
  • the security service may include, but is not limited to, cryptographic accelerators such as advanced encryption. Standard (advanced encryption standard, AES), RSA (rivest-shamir-adleman) encryption algorithms; secure file storage; over-the-air technology (OTA) upgrade; password storage; anomaly detection, etc.
  • the SOC contains two pieces of memory. Among these two pieces of memory, a main memory with a larger storage capacity can be used by the CPU core, and a memory with a smaller capacity is used as a private memory (private memory) for the exclusive use of the HSM core.
  • the communication between the CPU core and the HSM core can exchange information through a shared memory. When the CPU core transmits data to the HSM core, the following steps are included:
  • S1 The CPU core writes data to the shared memory that needs to be transmitted to the HSM core.
  • S2 The CPU core sends an interrupt request to the HSM core.
  • the HSM core when the HSM core transmits data to the CPU core, the HSM core can write the data that needs to be transmitted to the CPU core into the shared memory through steps similar to S1-S3 above, in order to serve the activated interrupt on the CPU core. program reads.
  • information interaction between the CPU core and the HSM core on the same SoC can be achieved through steps similar to S1-S3 above, and will not be described again below.
  • a conventional verification framework is shown in Figure 6.
  • the challenge node, proof node and verification node run together in the HSM.
  • the target data to be verified itself is stored and run in the main memory, and the CPU core passes
  • the shared memory transmits the target data to be verified to the HSM for the proof node and the verification node to perform subsequent proof calculation processes and verification calculation processes to verify the credibility of the target data.
  • the proving node can continuously read the target data to be verified from the shared memory. data block, and after calculating the corresponding proof result based on the data block contained in the target data, the proof result is sent to the verification node.
  • the difference from the hardware-based verification framework in Figure 4 is that based on the verification framework in Figure 6, the target data to be verified itself runs in the main memory. There is a possibility that the attacking node may take advantage of this difference.
  • the proof node Before the proof node reads the target data from the shared memory, the tampered data in the target data is restored to the original data. In this way, the proof node still performs calculations based on the original data, and the obtained proof results may still indicate that the data is credible, and cannot detect whether the data has been tampered with and restored, thus failing to ensure security.
  • the verification framework shown in Figure 6 requires a large amount of communication bandwidth between the CPU core and the HSM core. Specifically: limited by the size of the input and output cache inside the HSM core, the amount of data that the HSM core can read from the shared memory at one time is limited. When the amount of target data to be verified is very large, the proving node needs to interact with the shared memory multiple times through the HSM core and continuously read the data blocks contained in the target data. This method will occupy the time of the HSM core to respond to other security requests.
  • a network communication application running on the CPU core needs to encrypt a data packet, it will write the data packet into the shared memory and request the HSM core to encrypt the data packet through an interrupt request. If it turns out that the node is continuing to read data from the shared memory, the HSM core will be delayed in responding to the request for packet encryption.
  • the embodiment of this application proposes a verification framework, as shown in Figure 7.
  • the verification node can be run on the target CPU core on the ECU CPU side (the two in Figure 7 on any one of the CPU cores), while the challenge node and verification node run on the HSM core.
  • the target data to be verified is stored in the main memory accessible by the target CPU core, and the mirror data of the target data is stored in the main memory accessible by the HSM core. Private memory.
  • the challenge node may also be located in a different device from the verification node.
  • the challenge node may be located in a device other than the ECU, CPU and HSM not shown in Figure 7 .
  • the challenge node when the challenge node needs to securely verify the target data to be verified on the ECU CPU side, for example, it can pass the HSM core to the target used to initiate the challenge. Parameters are written to shared memory and an interrupt request is sent to the CPU core. The corresponding interrupt service routine on the CPU side can be activated in response to the interrupt request and read the target parameter from the shared memory. At the same time, the interrupt service program can instruct the certification node to run the preset certification program based on the obtained target parameters to calculate the target data to be verified, obtain the first certification result, and send the first certification to the verification node through the shared memory. result.
  • the verification node can run a preset verification program in response to the target parameters from the challenge node, based on the target parameters and the first certification result from the certification node, while adding information from other checking dimensions in the embodiment of the present application (such as the certification node's Prove the execution time information of the calculation process) to verify the credibility of the target data.
  • the verification framework shown in Figure 7 can use the existing hardware security modules in the smart car scenario to construct the verification framework. It does not require additional hardware modifications, has small changes to the system architecture, and has high compatibility.
  • running the proof node and the target data to be verified in the regular execution environment of the ECU CPU and performing the complete proof calculation process without switching the running context can greatly reduce the communication volume between the ECU CPU and the HSM. Reduce performance overhead and ensure that the implementation of the current business of the ECU CPU or HSM is not affected by the verification process.
  • the verification node can combine information from at least two inspection dimensions to jointly verify the credibility of the verified target data of the ECU CPU, which can effectively prevent attacks and ensure security.
  • the verification scheme can also separate the ECU CPU and HSM in Figure 7, and use the HSM in other devices to implement the verification scheme of the embodiment of the present application.
  • the HSM in Figure 7 is applied to the vehicle integrated unit (VIU) to protect the security of programs and data running in the CPU on the VIU.
  • the board device (or device) including the HSM in Figure 7 can also be applied to the security verification scenario of an external device that is locally connected to the board device.
  • the external device may generally include a device that does not have trusted hardware or HSM due to cost reasons.
  • the board device may include but is not limited to a mobile data center (MDC), a vehicle dynamics control system (VDC), etc.
  • MDC mobile data center
  • VDC vehicle dynamics control system
  • the board device may include but is not limited to a mobile data center (MDC), a vehicle dynamics control system (VDC), etc.
  • MDC mobile data center
  • VDC vehicle dynamics control system
  • the above ECU CPU and HSM are located in different devices, at least it is necessary to ensure that the HSM where the verification node is located is a trusted device, and the verification node can run in an untrusted device.
  • the trusted device and the untrusted device can communicate and interact through messages or other methods to implement the verification method in the embodiment of the present application. This communication method is not limited in the embodiment of the present application.
  • the verification scheme of the embodiment of the present application is applied in the SoC scenario below, with the ECU CPU to which the certification node belongs as the first device, and the HSM to which the challenge node and verification node belong as the second device (i.e., the second device and the third device). (the device is the same device)) as an example, combined with the verification framework shown in Figure 7, the implementation principle of the verification solution in the embodiment of the present application is introduced, as shown in Figure 8. Among them, the information interaction process between the ECU, CPU and HSM and the memory is not shown in Figure 8. For detailed implementation details, please refer to the relevant descriptions in Figures 5 to 7, which will not be described again here.
  • the verification solution can include the following steps:
  • the HSM to which the challenge node belongs can be considered as an example of a peripheral of the ECU CPU.
  • the challenge node needs to initiate a verification process for the target data of the ECU CPU, it can activate the interrupt of the HSM.
  • Service program which runs in RTOS2, can send an interrupt request to the ECU CPU to which the proving node belongs to initiate a challenge.
  • the HSM core can write the target parameters of the challenge to the shared memory for reading by the corresponding interrupt service program activated on the ECU CPU side.
  • the target parameter may include a random number, represented as N, for example.
  • the corresponding interrupt service program on the ECU CPU side can be activated.
  • the interrupt service program can run in RTOS1 and instruct the proof node to run the preset proof program to execute the proof calculation process.
  • the proof calculation process includes the following steps:
  • the proving node runs the preset proving program on the target CPU core allocated by the task scheduler.
  • the task scheduler running on RTOS1 is an example of a key module of the ECU CPU and is used to execute scheduling tasks.
  • a CPU core is an example of a resource unit of a first device in which the task scheduler can assign one of the two CPU cores of the ECU CPU to A core (for example, CPU core 1) is bound to a key program that performs a critical task, and the other CPU core (for example, CPU core 2) is bound as a target core to a program other than the key program, such as a certification program.
  • the proof node can run the preset proof program on the target core according to the scheduling information of the task scheduler, thereby executing the proof calculation process and obtaining the first proof result.
  • the task scheduler may schedule in advance.
  • the proving program can be run directly on the target core assigned by the task scheduler.
  • the task scheduler can use the running information of all current CPU cores of the ECU CPU in real time (such as running programs, load information, etc.) to prove that the node schedules the CPU core that is not running the key program as the target core.
  • the embodiment of this application is for task scheduling.
  • the scheduling timing of the server is not limited. Through task scheduling, the proof node will not seize the running resources of key programs during the entire process of proof calculation, which helps ensure the realization of high real-time services on the ECU CPU side.
  • the certification node can obtain the target address sequence generated by the target function, and calculate the first certification result based on the target address sequence.
  • the target address sequence can be generated based on the target parameters of the challenge and the target function preset in the ECU CPU.
  • the target address sequence can point to the target data to be verified.
  • the proof node The target data can be read and calculated according to the target address sequence to obtain the first proof result.
  • RTOS1 can be pre-configured to run the program corresponding to the target function after the interrupt service routine is activated.
  • the interrupt service program activated on the ECU CPU side can trigger (or notify) RTOS1 to run the program corresponding to the target function to generate the target address sequence and convert the The target address sequence is provided to the certification node, and the certification node performs the subsequent certification calculation process based on the target address sequence.
  • the interrupt service program can call the program corresponding to the target function running on RTOS1 according to the target parameter to trigger the running of the program corresponding to the target function and the process of generating the target address sequence.
  • the proof node can be pre-configured to run the program corresponding to the target function after the interrupt service routine is activated.
  • the interrupt service program activated on the ECU CPU side can trigger the process of the proof node calling the program corresponding to the target function by sending the target parameters that trigger the challenge to the proof node.
  • the proof node can call the program corresponding to the target function to generate the target address sequence, and perform the subsequent proof calculation process based on the target address sequence.
  • the objective function may include a pseudo-random number generator function.
  • the target parameter that triggers the challenge can be used as a seed, and a pseudo-random number generator can be used to generate the target address sequence.
  • the target address sequence may include at least two addresses, and the at least two addresses may point to at least two data blocks contained in the target data.
  • the length of the target address sequence may be L, which represents the number of the at least two addresses, and L is an integer greater than or equal to 2.
  • the target address sequence can be associated with time point 2, which can be used as one of the time information used to verify the credibility of the target data and provided in association with the calculated first proof result. The verification node will be described in detail in the embodiment below and will not be described again here.
  • S822 in Figure 8 is only used to schematically illustrate that a target address sequence can be generated by running a program corresponding to the target function, and does not limit the method of generating the target address sequence.
  • the program corresponding to the task scheduler and the program not shown in the figure for executing key tasks may be an example of the key program in the embodiment of the present application, and the program corresponding to the objective function may be a subroutine included in the proving program.
  • the proof program may also include other subroutines not shown. For details, please refer to the relevant introduction above and will not be repeated here.
  • the node After the node obtains the target address sequence, it can read the data block contained in the target data according to the address contained in the target address sequence, and use the target algorithm to calculate the data blocks contained in the target data in the first order to obtain the first Prove the results.
  • the target data to be verified on the ECU CPU side can include any data on the first device side that needs to be verified for credibility.
  • the target data can be data in the memory space allocated by any of the following programs: key programs or proofs Programs, key programs may at least include programs that perform safety tasks and/or programs that perform scheduling tasks.
  • the safety task and scheduling task are an example of critical tasks.
  • Safety tasks include tasks that need to be safely protected on the ECU CPU side, such as tasks running artificial intelligence (artificial intelligence, AI) recognition algorithms.
  • Scheduling tasks may include tasks performed by the task scheduler, such as scheduling target cores for attestation nodes.
  • the proof program includes all programs preset in the ECU CPU for the proof node to implement the proof calculation process. It should be understood that this is only an example of the target data to be verified and is not a limitation. In practical applications, the target data to be verified may not be limited to the above examples, and will not be described again here.
  • the target algorithm may adopt a serial computing structure.
  • the serial calculation structure may include M function blocks (for example, represented as F) for serial calculations.
  • Each function block is configured to perform calculations using a target algorithm and may be used to perform calculations on input addresses or data contents. Calculate until the proven result is obtained, M ⁇ L, M is an integer.
  • parallel calculations cannot be performed. When performing proof calculations based on this structure, you must wait until the calculation of the previous function block is completed to obtain the corresponding calculation results before proceeding to the next address or next step based on the next function block. Calculation of part of the data content.
  • the serial computing structure may be a Merkle–Damgard structure.
  • the above-mentioned target algorithm may include a hash algorithm, including but not limited to MD5, SHA1 and other hash algorithms, and the first proof result obtained may be a hash value, for example.
  • the five addresses can be represented as A1, A2, A3, A4, and A5.
  • the target data read based on A1-A5 can contain five data blocks, represented as V1, V2, V3, V4, V5.
  • the data types and sizes of V1-V5 can be different.
  • some data blocks can be code segment data
  • some data blocks can be read-only data segment data
  • some data blocks can be 4 bytes
  • some data blocks can be It is 8 bytes or longer (for example, 32 bytes), so I won’t go into details here.
  • the node uses the target algorithm and the first order to construct the serial computing structure, it can start from the initialization vector (initial nector, IV) and construct five function blocks, represented as F1, F2, F3, F4, and F5.
  • the data blocks V1-V5 can be used as the input content of the function blocks F1-F5 respectively, and are input to the function blocks F1-F5 for calculation in sequence. After the final calculation is completed (finalize), the first proof result is obtained.
  • Figure 9 is only an illustration of the correspondence between the addresses in the target address sequence, the data blocks contained in the target data, and the function blocks of the serial calculation structure, and is not limited to each function block of the serial calculation structure. input content.
  • the values of at least two addresses in the target address sequence can also be used as the input content of each function block of the serial calculation structure, so that each function block can The corresponding data block is read according to the address and calculated until the first proof result is obtained.
  • the embodiment of the present application does not limit the specific implementation of this calculation.
  • S830 The certification node provides the first certification result to the verification node.
  • the certification node may send the first certification result to the second device to which the verification node belongs. Accordingly, the verification node may receive the first certification result from the certification node at time point 3. Furthermore, when the verification node runs a preset verification program, it can verify the credibility of the target data based on information from at least two inspection dimensions including the first verification result.
  • the information of the at least two checking dimensions may include the first proof result itself, and the execution time information of the proof calculation process of the proof node.
  • the execution time information may be determined by the time point 1 (for example, called the second moment) that triggers the challenge. ) and the time point 3 (for example, called the first moment) at which the proof calculation process ends are determined, for example, the time difference between time point 1 and time point 3.
  • the verification node can simultaneously determine whether the target data of the first device to which the certification node belongs satisfies a preset credibility condition based on the first certification result and the time difference to determine the credibility of the target data.
  • the trustworthy condition may include: the first certification result provided by the certification node is the same as the second certification result obtained by the verification node according to the target parameter, and the first time interval associated with the first moment is within the time allowed by the verification node. within the range.
  • the verification node when conducting credibility verification based on the above execution time information, can determine whether the total time taken by the certification node to execute the above certification calculation process meets the credibility condition based on the time difference between time point 3 and time point 1, that is, Whether the time difference between time point 3 and time point 1 is used as the first time interval is within a credible time range (the time error caused by communication interaction has been estimated in advance and is covered within the allowed time range). If the time difference is too long or too short and does not fall within the credible time range, the certification node may be attacked, indicating that the first certification result from the certification node is untrustworthy. If the time difference is within the credible time interval, it at least means that the certification node is credible in the execution time dimension.
  • the verification node can obtain a credible second certification result based on the target parameters, and use whether the second certification result is the same as the first certification result to verify the credibility of the target data. Credibility. If they are the same, it means that the first certification result on the node side is credible, and it proves that the target data of the first device to which the node belongs has not been tampered with. If they are not the same, it means that the first certification result on the certification node side is not credible, and the target data of the first device to which the certification node belongs may have been illegally tampered with.
  • the verification node can determine the credibility of the target data on the certification node side. If any of the above conditions are not met, the target data on the proof node side is considered to be untrustworthy, and the first device to which the proof node belongs may have been illegally attacked.
  • the second certification result may be obtained by the verification node performing the same calculation process as that on the certification node side.
  • the verification node can run the preset verification program in the HSM core, perform the same calculation process as the above S822, and store the target data to be verified in the private memory. Perform calculations on the mirror data in the node to obtain the second proof result.
  • the calculation process described above in conjunction with the proof node for example, replacing the target data with mirror data, which will not be described again here.
  • the mirror data needs to be stored in the private memory of the HSM. Although the additional stored mirror data will not affect the final calculation results, it will occupy a large amount of storage space in the HSM. When the private memory is insufficient to store the mirror data of all target data, it will affect the implementation of the verification scheme of the embodiment of this application.
  • an optional implementation method is to not store the mirror data of the target data to be verified in the private memory space of the HSM, but to maintain a list in advance, such as a certification result information table or a first list.
  • a list can be used to store multiple parameters and the credible proof results associated with each parameter.
  • the multiple parameters can include target parameters.
  • the verification node After receiving the target parameter from the challenge node and the first proof result from the proof node, the verification node can use the target parameter as an index to obtain the expected proof result from the saved first list by looking up the table, expressed as The second proves the result. Therefore, the certification node can simultaneously verify the credibility of the target data based on the received first certification result, the second certification result obtained by looking up the table, and the time point 3 at which the first certification result was received.
  • the multiple parameters in the first list are random numbers, and the challenging node can select target parameters from the multiple parameters included in the first list to initiate a challenge.
  • the verification node can use the same pseudo-random number generator function as the proving node to generate the target address sequence, and the result of the target address sequence is often determined by the input random number N. Therefore, for the verification node, for any random number N, the target address sequence generated on the proving node side is certain and predictable. Based on this, the verification node can generate the proof result corresponding to each random number in advance according to the target algorithm and store it in the private memory of the HSM. Due to the credibility of the private memory, the second certification result obtained by the verification node through table lookup is credible and can be used to verify the credibility of the first certification result.
  • the first list maintained by the verification node is A list of verified hash values, as shown in Figure 10.
  • the first list may at least include a plurality of random numbers (for example, represented as N1, N2, N3, N4, N5, etc.) and a hash paired with each random number. value (e.g. expressed as hash value 1, hash value 2, hash value 3, hash value 4, hash value 5).
  • the challenge node randomly selects a random number (such as N1) from the parameters stored in the first list as the target parameter and sends it to the proof node and verification node to trigger the challenge.
  • the proof node can execute the above S820-S830 to obtain the first proof result and provide it to the verification node.
  • the verification node does not need to perform the same calculation steps, but only needs to access the private memory through table lookup, according to the trigger obtained from the challenge node.
  • the target parameter N1 of the challenge and the saved first list are used to query the corresponding hash value 1 through N1 as the second proof result.
  • the verification node needs to determine whether the hash value 1 is the same as the first proof result from the proof node.
  • the proof results obtained by both parties are the same, which means that the first proof result from the proof node is credible and the target data has not been tampered with. If the first proof result is any one of hash value 2, hash value 3, hash value 4, hash value 5, or other hash values, and the proof results obtained by both parties are different, it means that the third proof from the proof node Once the proof result is unreliable, the target data may have been illegally tampered with.
  • Figure 10 is only an illustration of the first list in the embodiment of the present application and is not limiting.
  • the length of the first list is not limited to 5 pairs of data, and the length of the first list can be appropriately increased as needed. , for example, 1000 pairs of data, making it difficult for an attacker to obtain all the information of the first list, or to obtain all the information of the first list within a limited time (for example, within 10 minutes), thereby improving security.
  • the content contained in the first list may not be limited to multiple parameters and multiple proof results. For example, it may also include the value of an address contained in a target address sequence that can be predicted based on multiple parameters and the target function, as follows. It will be introduced with reference to the embodiment and will not be described in detail here.
  • the processing method shown in Figure 9 can be applied to perform proof calculations on the target data located in the code section shown in Figure 2.
  • the processing method shown in Figure 9 can be applied to perform proof calculations on the target data located in the code section shown in Figure 2.
  • the verification result indicates that the first proof result is credible, you can Effectively prevent attackers from tampering with code segment data.
  • the attacker can attack by modifying key data in each data section of the program.
  • the key data can include, for example, file access permission data, machine Configuration data, etc. Therefore, the target data to be verified is not limited to the code segment data, but may also include data located in the read-only data segment shown in Figure 2 or data in the general data segment, collectively referred to as target data of the data segment.
  • Different data blocks read based on different addresses in the target address sequence may correspond to different types and different data lengths. For example, the length of some data read from the code segment is no more than 64 bytes.
  • the length of some passwords to be verified is approximately 128 bits.
  • the maximum data length of the input algorithm function is limited.
  • some hash algorithms limit the length of data input in a hash constructor (F) to a maximum of 64 bytes.
  • an optional implementation method is to preset a data length threshold for each address in the target address sequence according to the target algorithm.
  • the data length threshold is used to indicate the maximum data length entered in the function block corresponding to the address. If the data block contained in the target data is read based on the value of the address in the target address sequence, it can be based on a certain address or certain addresses (for example, represented as a first address, and the number of the first addresses is not limited to one).
  • the data block exceeds the data length threshold, the data block is segmented, and then a serial calculation structure is constructed based on the data blocks that do not need to be segmented and the data blocks obtained after segmentation processing, and calculation is performed.
  • the three addresses can be represented as A1, A2, and A3.
  • the data blocks read based on A1-A3 are represented as V1, V2, and V3.
  • the target algorithm is a hash algorithm
  • the data length threshold specified by the hash algorithm is 64 bytes.
  • the data length thresholds corresponding to A1, A2, and A3 are all 64 bytes.
  • the data lengths of V1, V2, and V3 are 60 bytes respectively.
  • V1 Bytes, 70 bytes, and 90 bytes, then the data length of V1 is less than 64 bytes and does not need to be divided; the data length of V2 is greater than 64 bytes and less than 128 bytes, so V2 needs to be divided into two data blocks, for example Represented as V2-1 and V2-2.
  • the data length of V3 is greater than 64 bytes and less than 128 bytes. V3 needs to be split into two data blocks, for example, represented as V3-1 and V3-2.
  • the target data obtained according to this segmentation method includes five data blocks, represented as V1, V2-1, V2-2, V3-1, and V3-2.
  • the proof node will construct a serial computing structure using the target algorithm and first order based on a process similar to Figure 9. Specific example: starting from IV, construct five function blocks, represented as F1, F2, F3, F4, F5.
  • the data blocks V1, V2-1, V2-2, V3-1, and V3-2 contained in the target data will be input to F1-F5 in the first order for calculation. After the final calculation is completed (finalize), the corresponding first One proves the result.
  • the verification node can perform the same calculation steps to obtain the corresponding second proof result according to the calculation processing method shown in Figure 11, or obtain the second proof result through table lookup.
  • the data length of the address storage data corresponding to the target address sequence is increased during the verification process to ensure that all data in the data block pointed to by the address will be recorded in the hash value.
  • the attacker cannot forge a credible proof result. Accordingly, when the first certification result from the certification node is obtained and the verification is completed at the verification node, and the verification result indicates that the first certification result is credible, attackers can be effectively prevented from tampering with key data statically stored in each data section.
  • the hash algorithm is used as an example to illustrate the data length threshold without limiting it.
  • corresponding data length thresholds may be preset according to data types, and the preset data length thresholds for different addresses may be different.
  • the data length threshold can be an empirical value or can be determined based on the algorithm parameters used.
  • the embodiment of the present application does not limit the method of determining the data length threshold corresponding to each address in the target address sequence.
  • the number of splits for the data block pointed to by each address is not limited to once. For example, in Figure 11, if the data length of the data block V3 pointed to by A3 is 255 bytes, the data length threshold needs to be 64 bytes.
  • V3 is divided three times to obtain four data sub-blocks, represented as V3-1, V3-2, V3-3, and V3-4. Therefore, the same method as in Figure 11 can be used to construct the calculation structure and perform calculations. Combine V3-1, V3-2, V3-3, and V3-4 to perform calculations respectively until the corresponding calculation structure is obtained.
  • the attacker can attack by modifying the code pointer pointing to the code address or the data pointer pointing to the data address. Therefore, the target data to be verified is not limited to the above code segment data or statically stored key data, but may also include code pointers or data pointers.
  • the storage areas of code pointers and data pointers in the data section include two types: static data area and dynamic data area. The pointer address stored in the static data area is fixed, and the pointer address stored in the dynamic data area is not fixed. Embodiments of the present application can protect pointers (including static code pointers and static data pointers) stored in the static data area.
  • the randomization method is: when the CPU runs the program for the first time, when the operating system loads the program, it will randomize the base address (Base Address) of the program and randomly generate a base address. The base address remains unchanged after the program is run. .
  • the code address/data address is the base address plus the original value of the code/data (physical space address). The original value is a fixed value, while the randomly generated base address remains unchanged during a run, and the base address changes after each restart of the CPU.
  • each address may store a code pointer or data pointer.
  • the code pointer or data pointer is obtained based on the randomized base address and does not point to the original value of the code/data.
  • the node can obtain the base address before reading the data block contained in the target data based on the value of the address contained in the target address sequence, and calculate the point to the target based on the base address and the value stored at at least two addresses in the target address sequence.
  • the original value of the address of each data block of data which is used to read each data block of the target data.
  • the proof node (or verification node) can perform a calculation process similar to Figure 9 or Figure 11 based on the calculated original value, and read the target data and calculate based on the original value to obtain the corresponding proof result.
  • the three addresses can be represented as A1, A2, A3.
  • the values stored in A1-A3 are the base addresses subject to randomization.
  • the value of the affected static code pointer or the value of the static data pointer, for example, is expressed as CP1, DP3, DP1.
  • the proving node can obtain the base address (e.g. represented as B) and determine the original value of the address pointing to the target data to be verified based on the value of the address contained in the target address sequence and this base address, e.g. using the respective addresses contained in the target address sequence.
  • the value minus the base address is expressed as CP1-B, DP3-B, DP1-B.
  • the proof node uses a method similar to Figure 9 or Figure 11 to construct a serial calculation structure, and performs serial calculations on the data blocks read based on these original values until the corresponding proof result is obtained.
  • a method similar to Figure 9 or Figure 11 to construct a serial calculation structure, and performs serial calculations on the data blocks read based on these original values until the corresponding proof result is obtained.
  • an address can only store one pointer at one point in time, but the pointers stored at different points in time can be different.
  • a possible implementation method is that the proof node can obtain the mark information based on the original value used in the above calculation, and the proof node can also provide the mark information to the verification node so that the verification node can verify Credibility of target data.
  • the proving node may take the last M bits of the original value as a tag (Tag), where M is an integer greater than or equal to 1.
  • M is an integer greater than or equal to 1.
  • the last significant bit (LSB) of the original value can be selected.
  • the original values CP1-B, DP3-B, and DP1-B correspond to mark 1, mark 2, and mark 3 respectively, which can be expressed as LSB8 (CP1-B), LSB8 (DP3-B), LSB8 ( DP1-B).
  • the proof node needs to send both the calculated first proof result and the detected mark information to the verification node, and the verification node combines the first proof result and the mark information to verify the credibility of the target data.
  • the verification node can predict the multiple addresses randomly generated by the proving node and their associated The original pointer value is saved. For example, the verification node can maintain a reverse lookup table on the HSM side. After receiving the first proof result and marking information from the proving node, the verification node can deduct the proof node based on each marking information and the reverse lookup table. The original value used in the calculation, and based on the original value, the same calculation process as that on the proof node side is performed to obtain the expected second proof result.
  • the verification node can determine according to time point 3 whether the total time taken by the certification node to perform the above-mentioned certification calculation process meets the preset credibility conditions, and determine whether the first certification result and the second certification result are the same. If the total elapsed time is within the time range allowed by the verification node and the proof results obtained by both parties are the same, it means that the target data on the proof node side has not been tampered with by the attacker and is credible. If the total time elapsed is not within the time range allowed by the verification node and/or the certification results obtained by both parties are different, it indicates that the target data on the certification node side may have been illegally tampered with and is not trustworthy. It should be understood that the lookup table may belong to the first list mentioned above, or may be a second list independent of the first list, which is not limited in the embodiments of the present application.
  • the three addresses can be represented as A1, A2, A3.
  • Each address may store multiple code pointers or data pointers (raw pointers not randomized based on the base address), such as CP1*, CP2*, CP3*, CP4* stored in A1, expressed as CP1*@A1, CP2*@ A1, CP3*@A1, CP4*@A1; DP1*, DP2*, DP3* stored in A2, expressed as DP1*@A2, DP2*@A2, DP3*@A2; DP1*, DP2*, stored in A3 DP3*, expressed as DP1*@A3, DP2*@A3, DP3*@A3.
  • code pointers or data pointers such as CP1*, CP2*, CP3*, CP4* stored in A1, expressed as CP1*@A1, CP2*@ A1, CP3*@A1, CP4*@A1; DP1*, DP2*, DP3* stored in A2, expressed as DP1
  • the verification node After the verification node receives at least two mark information (such as mark 1, mark 2 and mark 3) from the proof node, it can reversely deduce the values of A1 and A2 used by the proof node when performing the proof calculation process through the inverse lookup table. , the original pointer value associated with A3, such as CP1*, DP3*, DP1*. Then, the verification node can perform the same calculation steps as the certification node side based on the original pointer value to perform hash calculation based on the data block of the mirror data read by the original pointer until the corresponding second certification result is obtained. Verification The node can compare the second certification result with the first certification result from the certification node to verify the credibility of the target data on the certification node side.
  • mark information such as mark 1, mark 2 and mark 3
  • the dual-core system architecture applicable to the embodiments of the present application has been introduced based on the above in conjunction with Figures 8 to 13, as well as the detailed implementation process of the verification method implemented under this system architecture.
  • the real-time characteristics of the dual-core system can be utilized to verify the credibility of the target data to be verified by the proof node by combining the calculation results from the proof node and other check dimension information (such as execution time information) , to verify the trusted status of the first device to which the proof node belongs, to ensure the security of the first device.
  • this solution can also randomly extract the code segments, configuration data (files), static code pointers, and static data pointers of the first device's key programs or proof program operations, and use different methods for verification, which can be used in many aspects. Protect target data and effectively prevent attacks.
  • the dual-core feature can be used for task scheduling, so that the running of the proof program will not seize the CPU cores used by key programs to ensure the operation requirements of high-real-time services and greatly reduce the number of CPU cores and HSM cores. The amount of communication between them reduces the impact of the verification process on the performance of the first device.
  • the verification scheme introduced above in conjunction with Figures 8 to 13 in the embodiment of the present application is also applicable to a multi-core system (for example, including three or more CPU cores).
  • a multi-core system for example, including three or more CPU cores.
  • FIG 14 including CPU core 1 , CPU core 2, CPU core 3 and CPU core 4.
  • the attacker may also use the multi-core concurrency characteristics to accelerate calculations.
  • the challenge node in the multi-core system, can be based on the first device that proves the node belongs.
  • the total number of CPU cores (such as ECU CPU), the number of CPU cores allocated to key tasks, the number of target parameters that are adjusted to interact with the proof node or verification node, and the number of generated target address sequences, etc.
  • On at least one CPU core occupied by critical tasks try to fully run the proof program and verify the credibility of the target data to compensate for multi-core concurrency vulnerabilities.
  • n represents the number of CPU cores of the first device, and n is an integer greater than or equal to 3. It is assumed that the task scheduler of the first device allocates k CPU cores to key programs that perform key tasks, and k is an integer greater than or equal to 1. Then, in S810, at time point 1, when the challenge node issues a challenge to the proving node and the verification node, it can send n-k random numbers as target parameters. In S821, RTOS1 can allocate n-k target CPU cores to n-k proof nodes through the task scheduler.
  • the target function can generate n-k target address sequences based on n-k target parameters, and the certification node can calculate n-k certification results based on the n-k target address sequences.
  • the n-k certification results are associated with n-k time points.
  • the certification node sends n-k certification results to the second device to which the verification node belongs, and the verification node verifies the credibility of the target data of the first device to which the certification node belongs based on the n-k certification results and n-k time points. .
  • the detailed implementation details are the same as the implementation of the above-mentioned dual-core system. Please refer to the relevant descriptions above in conjunction with Figures 8 to 13, and will not be described again here.
  • the embodiment of this application also provides a verification method, which can be implemented collaboratively by the above-mentioned certification node and verification node. As shown in Figure 15, the verification method can include the following steps:
  • the certification node obtains a target address sequence, where the target address sequence points to the target data to be verified.
  • the certification node obtains the first certification result based on the target data.
  • the certification node provides the first certification result to the verification node, wherein the first certification result is associated with a first time, and the first certification result and the first time are used for the credibility of the target data. verify.
  • the verification node verifies the credibility of the target data based on the target parameters, the first certification result and the first time.
  • the certification node can run on at least one first resource unit, the at least one first resource unit is a resource unit included in the first device to which the certification node belongs, and the resource unit is at least used to run a program.
  • the at least one first resource unit runs programs other than key programs of the first device, where the key programs at least include programs that perform security tasks and/or programs that perform scheduling tasks.
  • the proving node can obtain the target parameters and generate the target address sequence according to the target parameters and the target function.
  • the proving node can be from the challenge node or the proving node to which the proving node belongs.
  • the real-time operating system RTOS of the first device acquires the target parameter, and the challenge node is a node that triggers verification of the credibility of the target data.
  • the target parameters include random numbers, and the target function includes a pseudo-random generation function.
  • the proving node may obtain the target address sequence from the RTOS of the first device to which the proving node belongs, and the target address sequence is generated by the RTOS based on the target parameters and the target function.
  • the target parameters include random numbers, and the target function includes a pseudo-random generation function.
  • the target address sequence includes at least two addresses, and the at least two addresses point to at least two data blocks contained in different parts of the target data.
  • the proving node can use the target algorithm to process the target in the first order. Calculation is performed on at least two data blocks containing different data to obtain the first proof result.
  • the proving node can also cut the data block pointed to by the first address among the at least two addresses when the length of the data block pointed to by the first address is greater than the data length threshold. Then, the certification node can obtain the first certification result using the data blocks that do not need to be segmented and the data blocks obtained after the segmentation process.
  • the proving node can also obtain the base address, and calculate the original value of the address pointing to the target data based on the base address and the value of at least two addresses in the target address sequence, where the original value is to read the target data.
  • the number of first addresses is not limited to one.
  • the verification node may obtain the target parameter from a challenge node or an RTOS of the second device to which the verification node belongs, and the challenge node is a node that triggers verification of the credibility of the target data.
  • the verification node can adopt the same calculation method as the proving node side, obtain the second proof result according to the target parameters, and obtain the second proof result according to the second proof result, the first proof result from the proof node and the third proof result.
  • the verification node obtaining the second certification result according to the target parameter may include: the verification node may obtain a target address sequence according to the target parameter, wherein the target address sequence points to the mirror data of the target data; the verification node The second proof result is obtained based on the mirror data.
  • the verification node obtaining the target address sequence according to the target parameter may include: the verification node generates the target address sequence according to the target parameter and the target function; or, the verification node obtains the target address sequence from the second device to which the verification node belongs based on the target parameter.
  • the RTOS obtains the target address sequence, wherein the target address sequence is generated by the RTOS according to the target parameters and the target function.
  • the objective function includes a pseudo-random generation function.
  • the target address sequence includes at least two addresses, and the at least two addresses point to at least two data blocks contained in the mirror data.
  • the verification node obtaining the second certification result based on the mirror data may include: The verification node uses a target algorithm to calculate at least two data blocks contained in the mirror data in a first order to obtain the second certification result.
  • the at least two addresses point to at least two data blocks contained in the mirror data, which may include: the length of the data block pointed to by the first address among the at least two addresses is greater than the data length. When the threshold is reached, the data block pointed to by the first address is segmented.
  • the verification node obtains the second certification result according to the target parameter may include: the verification node uses the target parameter as an index to obtain the second certification result from the first list, wherein, The first list includes a plurality of parameters and a certification result associated with each parameter, and the plurality of parameters includes the target parameter.
  • the verification node can obtain the tag information from the certification node; the verification node uses the target parameter as an index to obtain the second certification result from the first list, including: the verification node uses the Using the target parameters and the tag information as indexes, the second proof result is obtained from the first list.
  • the first device to which the certification node belongs and the second device to which the verification node belongs are located in the same system-on-chip SoC, where the first device is located in a non-accessible part of the SoC.
  • Trust hardware the second device is located in the trusted hardware of the SoC; or, the first device and the second device are different devices, wherein the first device is an untrusted device, and the third device
  • the second device is a trusted device.
  • the second device may further include a challenge node, which is a node that triggers verification of the credibility of the target data; or, the second device and the challenge node belong to the third node.
  • the three devices are different devices, and the third device and the first device are different devices.
  • the verification node verifies the credibility of the target data according to the target parameter, the first certification result and the first moment, which may include: the verification node verifies the credibility of the target data according to the target parameter, the first certification result and the first moment.
  • a certification result and the first moment determining whether the target data satisfies preset credibility conditions to verify the credibility of the target data; wherein the credibility conditions include: the first certification result It is the same as the second proof result obtained by the verification node according to the target parameter, and the first time interval associated with the first moment is within the time range allowed by the verification node.
  • the embodiment of the present application also provides a communication device for executing the method performed by the certification node or the verification node in the above method embodiment. Relevant features can be found in the above method embodiment and will not be described again here.
  • the device 1600 may correspond to a certification node, and the device 1600 may include: an acquisition unit 1601, used to acquire a target address sequence that points to the target data to be verified; a processing unit 1602, used to obtain the proof result according to the target data; the transceiver unit 1603, used to provide the proof result to the verification node, wherein the proof result is associated with the first time, and the proof result and the first time are used Verification of the credibility of the target data.
  • an acquisition unit 1601 used to acquire a target address sequence that points to the target data to be verified
  • a processing unit 1602 used to obtain the proof result according to the target data
  • the transceiver unit 1603 used to provide the proof result to the verification node, wherein the proof result is associated with the first time, and the proof result and the first time are used Verification of the credibility of the target data.
  • the device 1700 may correspond to a verification node, and the device 1700 may include: an acquisition unit 1701, configured to obtain a target parameter and obtain the first certification result from the certification node, the target parameter Including random numbers, the first proof result is obtained by the proof node based on the target data to be verified, and the first proof result is associated with the first moment; the determination unit 1702 is used to determine the first proof result based on the target parameters, the first proof As a result and the first moment, the credibility of the target data is verified.
  • an acquisition unit 1701 configured to obtain a target parameter and obtain the first certification result from the certification node, the target parameter Including random numbers, the first proof result is obtained by the proof node based on the target data to be verified, and the first proof result is associated with the first moment; the determination unit 1702 is used to determine the first proof result based on the target parameters, the first proof As a result and the first moment, the credibility of the target data is verified.
  • each functional unit in the embodiment of the present application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the above integrated units can be implemented in the form of hardware or software functional units.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially or part of the contribution or all or part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium and includes a number of instructions. It is used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of this application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), magnetic disk or optical disk and other media that can store program code. .
  • embodiments of the present application provide a computer-readable storage medium.
  • the computer-readable storage medium stores program code.
  • the program code When the program code is run on the computer, the computer Execute the above method embodiment.
  • the embodiment of the present application provides a computer program product, which when the computer program product is run on a computer, causes the computer to execute the above method embodiment.
  • the device 1800 shown in Figure 18 includes at least one processor 1810 and a communication interface 1830.
  • memory 1820 may also be included.
  • connection medium between the processor 1810 and the memory 1820 is not limited in the embodiment of the present application.
  • the processor 1810 when communicating with other devices, can transmit data through the communication interface 1830.
  • the processor 1810 in Figure 18 can call the computer execution instructions stored in the memory 1820, so that the device 1800 can execute any of the above method embodiments.
  • Embodiments of the present application also relate to a chip system, which includes a processor for calling a computer program or computer instructions stored in a memory, so that the processor executes the method of any of the above embodiments.
  • the processor may be coupled to the memory through an interface.
  • the chip system may also directly include a memory, in which computer programs or computer instructions are stored.
  • the memory may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
  • non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically removable memory. Erase electrically programmable read-only memory (EPROM, EEPROM) or flash memory.
  • Volatile memory can be random access memory (RAM), which is used as an external cache.
  • RAM static random access memory
  • DRAM dynamic random access memory
  • SDRAM synchronous dynamic random access memory
  • double data rate SDRAM double data rate SDRAM
  • DDR SDRAM double data rate SDRAM
  • ESDRAM enhanced synchronous dynamic random access memory
  • SLDRAM synchronous link dynamic random access memory
  • direct rambus RAM direct rambus RAM
  • Embodiments of the present application also relate to a processor, which is configured to call a computer program or computer instructions stored in a memory, so that the processor executes the method described in any of the above embodiments.
  • the processor is an integrated circuit chip that has signal processing capabilities.
  • the processor can be a field programmable gate array (FPGA), a general-purpose processor, a digital signal processor (DSP), or an application specific integrated circuit (ASIC).
  • FPGA field programmable gate array
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • other programmable logic devices discrete gate or transistor logic devices, discrete hardware components, system on chip (SoC), central processor unit (CPU), or network processing It can also be a network processor (NP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips, which can implement or execute the embodiments of the present application.
  • NP network processor
  • MCU microcontroller unit
  • PLD programmable logic device
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
  • the steps of the method disclosed in conjunction with the embodiments of the present application can be directly implemented by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field.
  • the storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
  • embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions
  • the device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
  • These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device.
  • Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

An attestation method, apparatus and system, which relate to the technical field of security. The method comprises: a proof node acquiring a target address sequence, wherein the target address sequence points to target data to be attested; the proof node obtaining a proof result according to the target data; and the proof node providing the proof result to an attestation node, wherein the proof result is associated with a first moment, and the proof result and the first moment are used for credibility attestation of the target data. The method helps to improve security in a system architecture of a software-based attestation technique.

Description

一种验证方法、装置和系统A verification method, device and system 技术领域Technical field
本申请涉及安全技术领域,特别涉及一种验证方法、装置和系统。This application relates to the field of security technology, and in particular to a verification method, device and system.
背景技术Background technique
验证(attestation)技术是可信计算的关键技术之一,用于验证被验证设备侧的待验证数据是否处于可信状态。Authentication (attestation) technology is one of the key technologies in trusted computing and is used to verify whether the data to be verified on the side of the verified device is in a trusted state.
目前常用的验证技术包括基于软件验证(software based attestation)技术和基于硬件验证(hardware based attestation)技术。其中,基于软件验证技术中,证明程序和待验证数据,无差异地与潜在的恶意程序运行在同一执行环境(例如常规执行环境(rich execution environment,REE))中,证明程序与待验证数据可能会被恶意程序篡改。基于硬件验证技术中,证明程序和待验证数据,与潜在的恶意程序基于硬件隔离,证明程序和待验证数据运行在可信执行环境(trusted execution environment,TEE),潜在的恶意程序运行在REE中,运行在TEE的证明程序与待验证数据无法被REE中潜在的恶意程序篡改,基于硬件验证技术的安全性高于基于软件验证技术的安全性。Currently commonly used verification technologies include software-based attestation technology and hardware-based attestation technology. Among them, based on software verification technology, the proving program and the data to be verified run in the same execution environment (such as a regular execution environment (rich execution environment, REE)) with potential malicious programs without any difference, and the proving program and the data to be verified may can be tampered with by malicious programs. In hardware-based verification technology, the proving program and data to be verified are isolated from potential malicious programs based on hardware. The proving program and data to be verified run in a trusted execution environment (TEE), and potential malicious programs run in REE. , the certification program and the data to be verified running on the TEE cannot be tampered with by potential malicious programs in the REE. The security based on hardware verification technology is higher than the security based on software verification technology.
然而,在一些实际应用场景(比如智能汽车场景)中,出于实际性能考虑,常常不会使用基于硬件验证技术的系统架构。并且,在基于硬件隔离的场景中,运行上下文需要频繁地在REE与TEE之间切换,将带来巨大性能开销,若将实时性要求高的应用(比如智能车控)置于TEE中,将会带来巨大的性能损失。因此,为保障性能,更适于应用基于软件验证技术。However, in some practical application scenarios (such as smart car scenarios), system architecture based on hardware verification technology is often not used due to actual performance considerations. Moreover, in a scenario based on hardware isolation, the running context needs to frequently switch between REE and TEE, which will bring huge performance overhead. If applications with high real-time requirements (such as smart car control) are placed in TEE, it will Will bring huge performance loss. Therefore, in order to ensure performance, it is more suitable to apply software-based verification technology.
而在基于软件验证技术的系统架构中迫切需要提升安全性。There is an urgent need to improve security in system architectures based on software verification technology.
发明内容Contents of the invention
本申请实施例提供一种验证方法、装置和系统,有助于在基于软件验证技术的系统架构中提升安全性。Embodiments of the present application provide a verification method, device and system, which help improve security in a system architecture based on software verification technology.
第一方面,本申请实施例提供一种验证方法,该方法可由第一装置的证明节点执行,该证明节点可以运行该第一装置内预置的证明程序,并根据待验证的目标数据计算得到待验证的证明结果,以便将该验证结果提供给第二装置的验证节点,以使该验证节点对该目标数据进行可信性验证。In the first aspect, embodiments of the present application provide a verification method that can be executed by the certification node of the first device. The certification node can run the certification program preset in the first device and calculate based on the target data to be verified. The verification result to be verified is provided to the verification node of the second device, so that the verification node performs credibility verification on the target data.
其中,该方法可以包括:证明节点获取目标地址序列,其中,所述目标地址序列指向待验证的目标数据;所述证明节点根据所述目标数据得到证明结果;所述证明节点向验证节点提供所述证明结果,其中,所述证明结果关联第一时刻,所述证明结果和所述第一时刻用于所述目标数据的可信性验证。Wherein, the method may include: the certification node obtains a target address sequence, wherein the target address sequence points to the target data to be verified; the certification node obtains the certification result according to the target data; the certification node provides the verification node with the The certification result is provided, wherein the certification result is associated with a first moment, and the certification result and the first moment are used for credibility verification of the target data.
通过上述方法,证明节点和验证节点可以被配置为:在对目标数据的可信性进行验证时,除了基于来自证明节点的证明结果外,还可以同时加入其它检查维度的信息,例如证明结果关联的第一时刻。进而,证明节点可以向验证节点提供至少一种检查维度的信息,例如证明结果,使得验证节点可以结合至少两种检查维度的信息(例如包括但不限于来自于证明节点的证明结果、该证明结果关联的第一时刻等)共同验证目标数据的可信性,从 而在基于软件验证技术的系统架构中提升安全性。同时,证明节点与验证节点之间的通信量较少,并不会带来过多的性能开销,也不会对证明节点所属第一装置的其它业务(例如安全业务)带来较大影响,该方案可以兼顾安全性和性能。Through the above method, the proof node and the verification node can be configured to: when verifying the credibility of the target data, in addition to the proof results from the proof node, information from other check dimensions can also be added at the same time, such as proof result correlation. the first moment. Furthermore, the certification node can provide information of at least one checking dimension, such as certification results, to the verification node, so that the verification node can combine information of at least two checking dimensions (for example, including but not limited to the certification results from the certification node, the certification results The first moment of association, etc.) jointly verify the credibility of the target data, thereby improving security in the system architecture based on software verification technology. At the same time, the communication volume between the proving node and the verification node is small, and it will not bring too much performance overhead, nor will it have a great impact on other services (such as security services) of the first device to which the proving node belongs. This solution can balance security and performance.
结合第一方面,一种可能的实现方式中,所述证明节点获取目标地址序列,包括:所述证明节点获取目标参数;所述证明节点根据所述目标参数和目标函数生成所述目标地址序列,其中,所述目标参数包括随机数,所述目标函数包括伪随机生成器函数。In conjunction with the first aspect, in a possible implementation manner, the certification node obtains a target address sequence, including: the certification node obtains a target parameter; the certification node generates the target address sequence according to the target parameter and a target function. , wherein the target parameter includes a random number, and the target function includes a pseudo-random generator function.
通过上述方法,一种可选的实现方式中,目标函数可以被配置在证明节点。在证明节点启动运行证明程序后,该目标函数能够响应于目标参数运行,以生成目标地址序列。该证明节点可以基于该目标地址序列读取目标数据来进行计算。其中,该目标参数包括随机数,并且以伪随机生成器函数生成目标地址序列,可以为基于目标数据的计算过程增加随机性,从而提升安全性。Through the above method, in an optional implementation, the objective function can be configured at the proof node. After the proving node starts running the proving program, the target function can be run in response to the target parameters to generate the target address sequence. The proof node can read the target data to perform calculations based on the target address sequence. Among them, the target parameter includes a random number, and a pseudo-random generator function is used to generate the target address sequence, which can add randomness to the calculation process based on the target data, thereby improving security.
结合第一方面,一种可能的实现方式中,所述证明节点获取目标参数,包括:所述证明节点从挑战节点或者所述证明节点所属第一装置的实时操作系统RTOS获取所述目标参数,其中,所述挑战节点为触发验证所述目标数据的可信性的节点。In conjunction with the first aspect, in a possible implementation manner, the certification node obtains the target parameters, including: the certification node obtains the target parameters from the challenge node or the real-time operating system RTOS of the first device to which the certification node belongs, Wherein, the challenge node is a node that triggers verification of the credibility of the target data.
通过上述方法,挑战节点或者所述第一装置的RTOS可以通过目标参数触发该证明节点运行证明程序,以执行对所述目标数据的读取和计算过程,使得本申请实施例的验证方法的实施更加灵活。Through the above method, the challenge node or the RTOS of the first device can trigger the certification node to run the certification program through the target parameter to perform the reading and calculation process of the target data, so that the verification method of the embodiment of the present application can be implemented. More flexible.
结合第一方面,一种可能的实现方式中,所述证明节点获取目标地址序列,包括:所述证明节点从所述证明节点所属第一装置的RTOS获取所述目标地址序列,其中,所述目标地址序列是所述RTOS根据目标参数和目标函数生成的。In conjunction with the first aspect, in a possible implementation manner, the certification node obtains the target address sequence, including: the certification node obtains the target address sequence from the RTOS of the first device to which the certification node belongs, wherein, The target address sequence is generated by the RTOS based on target parameters and target functions.
通过上述方法,另一种可选的实现方式中,目标函数可以被配置在证明节点所属第一装置的RTOS,在证明节点启动运行证明程序后,位于该RTOS的目标函数能够响应于目标参数运行,以生成目标地址序列。证明节点可以从RTOS获取该目标地址序列,以便根据该目标地址序列读取目标数据来进行计算。其中,该目标参数可以包括随机数,目标函数可以包括伪随机生成器函数,以该伪随机生成器函数生成目标地址序列,可以为整个计算过程增加随机性,提升安全性。Through the above method, in another optional implementation, the objective function can be configured in the RTOS of the first device to which the proving node belongs. After the proving node starts running the proving program, the objective function located in the RTOS can run in response to the target parameters. , to generate the target address sequence. Prove that the node can obtain the target address sequence from the RTOS in order to read the target data based on the target address sequence for calculation. The target parameter may include a random number, and the target function may include a pseudo-random generator function. Using the pseudo-random generator function to generate a target address sequence can add randomness to the entire calculation process and improve security.
结合第一方面,一种可能的实现方式中,所述证明节点运行于至少一个第一资源单元上,所述至少一个第一资源单元为所述证明节点所属第一装置包括的资源单元,所述资源单元至少用于运行程序。示例地,所述至少一个第一资源单元运行除所述第一装置的关键程序之外的程序,所述关键程序至少包括执行安全任务的程序和/或执行调度任务的程序。示例地,该资源单元可以为第一装置的处理器核心。In connection with the first aspect, in a possible implementation manner, the certification node runs on at least one first resource unit, and the at least one first resource unit is a resource unit included in the first device to which the certification node belongs, so The resource unit described above is used at least to run the program. For example, the at least one first resource unit runs programs other than key programs of the first device, where the key programs at least include programs that perform security tasks and/or programs that perform scheduling tasks. For example, the resource unit may be a processor core of the first device.
通过上述方法,证明节点所属第一装置可以包括多个资源单元,该第一装置可以为证明节点调度至少一个第一资源单元,以便证明节点的证明程序可以运行在至少一个第一资源单元上,使得证明程序的运行尽量不占用关键程序所占用的资源单元,从而降低验证过程对第一装置侧的其它业务的影响。Through the above method, the first device to which the certification node belongs can include multiple resource units, and the first device can schedule at least one first resource unit for the certification node, so that the certification program of the certification node can run on at least one first resource unit, This allows the running of the certification program to occupy less resource units occupied by key programs, thereby reducing the impact of the certification process on other services on the first device side.
结合第一方面,一种可能的实现方式中,所述目标地址序列包括至少两个地址,所述至少两个地址指向所述目标数据包含的至少两个数据块,所述证明节点根据所述目标数据得到证明结果,包括:所述证明节点采用目标算法,按照第一顺序对所述目标数据包含的至少两个数据块进行计算,得到所述证明结果。所述目标算法可以采用串行计算结构,所述目标算法可以包括哈希算法。In conjunction with the first aspect, in a possible implementation, the target address sequence includes at least two addresses, the at least two addresses point to at least two data blocks included in the target data, and the certification node is based on the Obtaining a certification result for the target data includes: the certification node uses a target algorithm to calculate at least two data blocks contained in the target data in a first order to obtain the certification result. The target algorithm may adopt a serial calculation structure, and the target algorithm may include a hash algorithm.
通过上述方法,证明节点可以采用串行计算结构,依次对目标数据包含的至少两个数据块进行计算,直至得到证明结果。在第一装置包括多个资源单元的情况下,该串行计算方式可以有效防止攻击者利用第一装置的多资源单元特性构造算法并行执行验证算法,从而压缩执行时间。Through the above method, the proof node can use a serial calculation structure to calculate at least two data blocks contained in the target data in sequence until the proof result is obtained. In the case where the first device includes multiple resource units, this serial calculation method can effectively prevent an attacker from using the multi-resource unit characteristic of the first device to construct an algorithm to execute the verification algorithm in parallel, thereby reducing the execution time.
结合第一方面,一种可能的实现方式中,所述目标地址序列包括所述至少两个地址,所述至少两个地址指向所述目标数据包含的至少两个数据块,还包括:在所述至少两个地址中的第一地址指向的数据块的长度大于数据长度阈值时,对所述第一地址指向的数据块进行切分。In conjunction with the first aspect, in a possible implementation, the target address sequence includes the at least two addresses, the at least two addresses point to at least two data blocks included in the target data, and further includes: in the When the length of the data block pointed to by the first address among the at least two addresses is greater than the data length threshold, the data block pointed by the first address is segmented.
通过上述方法,数据长度阈值可以是为目标算法预设的数据长度阈值。在对目标数据包含的数据块进行计算时,证明节点可以根据目标数据包含的不同数据块的数据特性,按照该数据长度阈值,对数据长度超出该数据长度阈值的数据块进行切分,得到相应的数据子块。进一步,证明节点即可基于不需要进行数据切分的数据块以及切分后获得的数据子块进行计算,从而确保目标地址序列中的地址指向的不同数据块的所有数据都能够被计算。Through the above method, the data length threshold may be a data length threshold preset for the target algorithm. When calculating the data blocks contained in the target data, it is proved that the node can segment the data blocks whose data length exceeds the data length threshold according to the data characteristics of different data blocks contained in the target data and obtain the corresponding of data sub-blocks. Furthermore, the proof node can perform calculations based on data blocks that do not require data segmentation and data sub-blocks obtained after segmentation, thereby ensuring that all data in different data blocks pointed to by addresses in the target address sequence can be calculated.
结合第一方面,一种可能的实现方式中,所述方法还包括:所述证明节点获取基地址;所述证明节点根据所述基地址和所述目标地址序列中的至少两个地址的值,计算指向所述目标数据的地址的原始值,所述原始值用于读取所述目标数据。In conjunction with the first aspect, in a possible implementation, the method further includes: the proving node obtains a base address; the proving node obtains a base address according to the values of at least two addresses in the base address and the target address sequence. , calculate the original value pointing to the address of the target data, and the original value is used to read the target data.
通过上述方法,考虑到第一装置首次运行程序时,第一装置的操作系统在加载程序时,会对程序运行的基地址进行随机化,运行后该基地址不变。为了降低基地址随机化对生成目标地址序列时的影响,该证明节点可以通过获取基地址,并使目标地址序列中的各个地址的值减去该基地址,得到指向目标数据的地址的原始值,以利用该原始值读取目标数据,尽量避免地址被攻击者篡改的情形。Through the above method, considering that when the first device runs the program for the first time, the operating system of the first device will randomize the base address of the program when loading the program, and the base address will not change after running. In order to reduce the impact of base address randomization on generating the target address sequence, the proof node can obtain the base address and subtract the base address from the value of each address in the target address sequence to obtain the original value of the address pointing to the target data. , to use the original value to read the target data and try to avoid the address being tampered with by the attacker.
结合第一方面,一种可能的实现方式中,所述方法还包括:所述证明节点根据所述原始值确定标记信息;所述证明节点向所述验证节点提供所述标记信息,所述标记信息用于反向推导所述原始值。In conjunction with the first aspect, in a possible implementation, the method further includes: the certification node determines tag information based on the original value; the certification node provides the tag information to the verification node, and the tag The information is used to derive the original value in reverse.
通过上述方法,证明节点可以将指向目标数据的地址的原始值对应的标记信息提供给验证节点,以便验证节点根据该标记信息反向推导该原始值,从而在验证节点侧执行相同的计算过程时,可以基于反向推导获得的原始值读取镜像数据和计算,获得可信的证明结果,该可信的证明结果可以用于目标数据的可信性验证。需要说明的是,本申请实施例中,在一次验证过程中,根据目标参数生成的目标地址序列中可以包括至少两个地址,相应地,证明节点可以将指向目标数据的至少两个地址的原始值对应的标记信息提供给验证节点,该方法无需传输完整的指针数据,可以减少证明节点和验证节点之间的通信量。Through the above method, the proving node can provide the tag information corresponding to the original value of the address pointing to the target data to the verification node, so that the verification node can reversely deduce the original value based on the tag information, thereby performing the same calculation process on the verification node side. , the mirror data can be read and calculated based on the original value obtained by reverse derivation, and a credible certification result can be obtained, which can be used to verify the credibility of the target data. It should be noted that in this embodiment of the present application, during a verification process, the target address sequence generated according to the target parameters may include at least two addresses. Correspondingly, the certification node may convert the original addresses pointing to at least two addresses of the target data. The tag information corresponding to the value is provided to the verification node. This method does not require the transmission of complete pointer data and can reduce the communication volume between the proving node and the verification node.
结合第一方面,一种可能的实现方式中,所述目标数据包括为以下至少一种程序分配的内存空间中的数据:关键程序或所述证明节点运行的证明程序。所述关键程序至少包括执行安全任务的程序和/或执行调度任务的程序。In conjunction with the first aspect, in a possible implementation, the target data includes data in memory space allocated for at least one of the following programs: a key program or a certification program run by the certification node. The key programs at least include programs that perform security tasks and/or programs that perform scheduling tasks.
通过上述方法,证明节点所属第一装置的需要被安全保护的关键程序以及证明程序的程序内存空间中的数据均需要被验证,第一装置的目标函数可以被配置为:生成的目标地址序列中的地址,至少指向关键程序和证明程序的程序内存空间中的数据,以降低这些数据被攻击者篡改的可能性。结合第一方面,一种可能的实现方式中,所述证明节点所属的第一装置与所述验证节点所属的第二装置位于同一系统级芯片SoC,其中,所述第一装置位于所述SoC的非可信硬件,所述第二装置位于所述SoC的可信硬件;或者,所述第一装 置和所述第二装置为不同装置,其中,所述第一装置为非可信装置,所述第二装置为可信装置。Through the above method, the key programs of the first device to which the proving node belongs that need to be securely protected and the data in the program memory space of the proving program need to be verified. The target function of the first device can be configured as: in the generated target address sequence The address should at least point to the data in the program memory space of the key program and the certification program to reduce the possibility of these data being tampered with by an attacker. In conjunction with the first aspect, in a possible implementation, the first device to which the certification node belongs and the second device to which the verification node belongs are located in the same system-on-chip SoC, wherein the first device is located in the SoC untrusted hardware, the second device is located in the trusted hardware of the SoC; or the first device and the second device are different devices, wherein the first device is an untrusted device, The second device is a trusted device.
通过上述方法,证明节点所属第一装置和验证节点所属第二装置可以包括多种产品形态。其中,只需确保第二装置位于可信硬件或为可信装置即可,第一装置可以位于非可信硬件或为非可信装置,通过本申请实施例的验证方法,虽然证明节点运行在非可信环境中,但是可以通过运行在可信环境中的验证节点对来自证明节点的证明结果进行验证,以确定第一装置侧目标数据的可信性,在几乎不影响第一装置侧的性能以及其它业务的执行的情况下,仍可保障目标数据的安全性。Through the above method, the first device to which the certification node belongs and the second device to which the verification node belongs can include multiple product forms. Among them, it is only necessary to ensure that the second device is located on trusted hardware or is a trusted device, and the first device can be located on untrusted hardware or is an untrusted device. Through the verification method of the embodiment of the present application, although the proof node is running on In a non-trusted environment, the verification results from the certification node can be verified by the verification node running in the trusted environment to determine the credibility of the target data on the first device side, with little impact on the first device side. Under the condition of performance and other business execution, the security of target data can still be guaranteed.
结合第一方面,一种可能的实现方式中,在所述目标数据满足预设的可信条件时,所述目标数据的可信性验证通过;其中,所述可信条件包括:所述证明节点提供的证明结果与所述验证节点根据目标参数获得的证明结果相同,以及所述第一时刻关联的第一时间区间在所述验证节点允许的时间范围内。In conjunction with the first aspect, in a possible implementation, when the target data satisfies a preset trust condition, the trustworthiness verification of the target data passes; wherein the trust condition includes: the proof The proof result provided by the node is the same as the proof result obtained by the verification node according to the target parameter, and the first time interval associated with the first moment is within the time range allowed by the verification node.
通过上述方法,可以根据至少两种检查维度的信息设置可信条件,以在验证过程中,通过判断所获得的至少两种检查维度的信息是否满足预设的可信条件,来验证目标数据的可信性。需要说明的是,此处仅是对本申请实施例的可信条件的示例说明而非任何限定,在其它实施例中,当变更检查维度或者增加其它的检查维度信息,可信条件可以相应的修改,本申请实施例对此不做限定。Through the above method, trust conditions can be set based on the information of at least two inspection dimensions, so that during the verification process, the target data can be verified by judging whether the obtained information of the at least two inspection dimensions meets the preset trust conditions. Credibility. It should be noted that this is only an illustration of the trustworthy conditions in the embodiments of the present application without any limitation. In other embodiments, when the check dimensions are changed or other check dimension information is added, the trustworthy conditions can be modified accordingly. , the embodiment of the present application does not limit this.
其中,第一时刻关联的第一时间区间可以为证明节点侧的计算过程的执行时间。挑战节点在第二时刻向证明节点发起挑战时,可以同步指示验证节点,验证节点可以获知挑战的启示时刻。验证节点第一时刻在接收到来自证明节点的证明结果时,验证节点可以获知挑战的结束时刻,第一时间区间可以是第一时刻和第二时刻之间的时间差以及允许的时间误差获得的时间区间。若该第一时间区间在允许的时间误差范围内,表示算法在执行时间维度未被篡改,目标数据至少在算法执行时间维度是可信的。若该第一时间区间未在允许的时间误差范围内,表示算法在执行时间维度可能被篡改,目标数据至少在算法执行时间维度是不可信的。The first time interval associated with the first moment may be the execution time of the calculation process on the proving node side. When the challenge node issues a challenge to the proving node at the second moment, it can simultaneously instruct the verification node, and the verification node can learn the revelation moment of the challenge. When the verification node receives the certification result from the certification node at the first moment, the verification node can learn the end moment of the challenge. The first time interval can be the time difference between the first moment and the second moment and the time obtained by the allowed time error. interval. If the first time interval is within the allowed time error range, it means that the algorithm has not been tampered with in the execution time dimension, and the target data is credible at least in the algorithm execution time dimension. If the first time interval is not within the allowed time error range, it means that the algorithm may have been tampered with in the execution time dimension, and the target data is not trustworthy at least in the algorithm execution time dimension.
第二方面,本申请实施例提供了一种验证方法,该方法可由第二装置侧的验证节点执行,该证明节点可以运行该第二装置内预置的验证程序,并根据待验证的证明结果(例如来自证明节点的第一证明结果),验证第一装置侧的目标数据的可信性。In the second aspect, embodiments of the present application provide a verification method, which can be executed by a verification node on the second device side. The verification node can run a verification program preset in the second device, and perform verification according to the verification result to be verified. (for example, the first certification result from the certification node), verifying the credibility of the target data on the first device side.
其中,该方法包括:验证节点获取目标参数,所述目标参数包括随机数;所述验证节点获取来自证明节点的第一证明结果,其中,所述第一证明结果为所述证明节点根据待验证的目标数据得到,所述第一证明结果关联第一时刻;所述验证节点根据所述目标参数、所述第一证明结果和所述第一时刻,验证所述目标数据的可信性。Wherein, the method includes: the verification node obtains a target parameter, the target parameter includes a random number; the verification node obtains a first certification result from the certification node, wherein the first certification result is the certification node according to the to-be-verified The target data is obtained, and the first certification result is associated with the first time; the verification node verifies the credibility of the target data based on the target parameters, the first certification result and the first time.
通过上述方法,验证节点和证明节点可以被配置为:在对目标数据的可信性进行验证时,除了基于来自证明节点的第一证明结果之外,还可以同时加入其它检查维度的信息,例如第一证明结果关联的第一时刻。进而,验证节点可以根据从证明节点获得的待验证信息(例如来自证明节点的第一证明结果)、以及其它信息(例如第一证明结果关联的第一时刻)共同验证目标数据的可信性,从而在基于软件验证技术的系统架构中提升安全性。同时,验证节点和证明节点之间的通信量较少,并不会带来过多的性能开销,也不会对证明节点所属第一装置的其它业务(例如安全业务)带来较大影响,该方案可以兼顾安全性 和性能。Through the above method, the verification node and the certification node can be configured such that, in addition to the first certification result from the certification node, when verifying the credibility of the target data, information from other checking dimensions can also be added at the same time, such as The first moment of proof of the correlation of the results. Furthermore, the verification node can jointly verify the credibility of the target data based on the information to be verified obtained from the certification node (such as the first certification result from the certification node) and other information (such as the first moment associated with the first certification result), This improves security in system architectures based on software verification technology. At the same time, the communication volume between the verification node and the proving node is small, and it will not bring too much performance overhead, nor will it have a great impact on other services (such as security services) of the first device to which the proving node belongs. This solution can balance security and performance.
结合第二方面,一种可能的实现方式中,所述验证节点获取目标参数,包括:所述验证节点从挑战节点或者所述验证节点所属第二装置的RTOS获取所述目标参数,其中,所述挑战节点为触发验证所述目标数据的可信性的节点。In conjunction with the second aspect, in a possible implementation manner, the verification node obtains the target parameters, including: the verification node obtains the target parameters from the challenge node or the RTOS of the second device to which the verification node belongs, wherein, The challenge node is a node that triggers verification of the credibility of the target data.
通过上述方法,挑战节点或者第二装置的RTOS可以通过目标参数触发该证明节点运行验证程序,以执行对目标数据的可信性验证过程,使得本申请实施例的验证方法的实施更加灵活。Through the above method, the RTOS of the challenge node or the second device can trigger the certification node to run the verification program through the target parameters to perform the credibility verification process of the target data, making the implementation of the verification method of the embodiment of the present application more flexible.
结合第二方面,一种可能的实现方式中,所述验证节点根据所述目标参数、所述第一证明结果和所述第一时刻,验证所述目标数据的可信性,包括:所述验证节点根据所述目标参数获取第二证明结果;所述验证节点根据所述第二证明结果、所述第一证明结果和所述第一时刻,验证所述目标数据的可信性。In conjunction with the second aspect, in a possible implementation, the verification node verifies the credibility of the target data based on the target parameters, the first certification result and the first moment, including: The verification node obtains a second certification result based on the target parameters; the verification node verifies the credibility of the target data based on the second certification result, the first certification result and the first time.
通过上述方法,验证节点可以根据目标参数获取第二证明结果,该第二证明结果是可信的,可以用于验证来自证明节点的第一证明结果是否可信,从而验证第一装置侧的目标数据的可信性。Through the above method, the verification node can obtain the second certification result according to the target parameters. The second certification result is credible and can be used to verify whether the first certification result from the certification node is credible, thereby verifying the target on the first device side. Credibility of data.
需要说明的是,本申请实施例中,验证结果可以通过至少一种方式,根据目标参数获得第二证明结果。It should be noted that in the embodiment of the present application, the verification result can obtain the second verification result according to the target parameters in at least one way.
示例1,验证节点和证明节点可以采用相同的方法计算获得相应的证明结果。所述验证节点根据所述目标参数获取第二证明结果,可以包括:所述验证节点根据所述目标参数获取目标地址序列,其中,所述目标地址序列指向所述目标数据的镜像数据;所述验证节点根据所述镜像数据得到所述第二证明结果。相似地,所述验证节点根据所述目标参数获取目标地址序列,可以包括:所述验证节点根据所述目标参数和目标函数生成所述目标地址序列;或者,所述验证节点根据所述目标参数,从所述验证节点所属第二装置的RTOS获取所述目标地址序列,其中,所述目标地址序列是所述RTOS根据目标参数和目标函数生成的。所述目标函数可以包括伪随机生成函数。相似方法实现细节可参见上述第一方面的相关描述,在此不再赘述。Example 1, the verification node and the proof node can use the same method to calculate and obtain the corresponding proof results. The verification node obtains the second certification result according to the target parameter, which may include: the verification node obtains a target address sequence according to the target parameter, wherein the target address sequence points to the mirror data of the target data; The verification node obtains the second certification result based on the mirror data. Similarly, the verification node obtains the target address sequence based on the target parameters, which may include: the verification node generates the target address sequence based on the target parameters and the target function; or, the verification node generates the target address sequence based on the target parameters. , obtaining the target address sequence from the RTOS of the second device to which the verification node belongs, wherein the target address sequence is generated by the RTOS according to the target parameters and the target function. The objective function may include a pseudo-random generation function. For implementation details of similar methods, please refer to the relevant description of the first aspect above and will not be described again here.
在该示例1的一种可能的实现方式中,所述目标地址序列包括至少两个地址,所述至少两个地址指向所述镜像数据包含的至少两个数据块,所述验证节点根据所述镜像数据得到所述第二证明结果,包括:所述验证节点采用目标算法,按照第一顺序对所述镜像数据包含的至少两个数据块进行计算,得到所述第二证明结果。示例地,所述目标算法可以采用串行计算结构,所述目标算法可以包括哈希算法。In a possible implementation of Example 1, the target address sequence includes at least two addresses, and the at least two addresses point to at least two data blocks contained in the mirror data, and the verification node performs the verification according to the Obtaining the second certification result from the mirror data includes: the verification node adopts a target algorithm to calculate at least two data blocks contained in the mirror data in a first order to obtain the second certification result. For example, the target algorithm may adopt a serial calculation structure, and the target algorithm may include a hash algorithm.
在该示例1的一种可能的实现方式中,所述目标地址序列包括所述至少两个地址,所述至少两个地址指向所述镜像数据包含的至少两个数据块,还包括:在所述至少两个地址中的第一地址指向的数据块的长度大于数据长度阈值时,对所述第一地址指向的数据块进行切分。In a possible implementation of Example 1, the target address sequence includes the at least two addresses, the at least two addresses point to at least two data blocks included in the mirror data, and further includes: in the When the length of the data block pointed to by the first address among the at least two addresses is greater than the data length threshold, the data block pointed by the first address is segmented.
在该示例1的一种可能的实现方式中,所述方法还包括:所述验证节点获取来自证明节点的标记信息;所述验证节点根据所述标记信息和所述目标地址序列,确定指向所述镜像数据的地址的原始值,所述原始值用于读取所述镜像数据。In a possible implementation of Example 1, the method further includes: the verification node obtains tag information from the certification node; the verification node determines, based on the tag information and the target address sequence, the direction to the The original value of the address of the mirror data, which is used to read the mirror data.
示例2,验证节点无需与证明节点执行相同的计算步骤,而是可以通过查表的方式获得第二证明结果。例如,所述验证节点根据所述目标参数获取第二证明结果,可以包括:所述验证节点以所述目标参数作为索引,从第一列表获取所述第二证明结果,其中,所述 第一列表包括多个参数以及每个参数关联的证明结果,所述多个参数包括所述目标参数。Example 2: The verification node does not need to perform the same calculation steps as the proof node, but can obtain the second proof result by looking up the table. For example, the verification node obtains the second certification result according to the target parameter, which may include: the verification node uses the target parameter as an index to obtain the second certification result from a first list, wherein the first The list includes a plurality of parameters, including the target parameter, and a proof result associated with each parameter.
在该示例2的一种可能的实现方式中,所述方法还可以包括:所述验证节点获取来自所述证明节点的标记信息;所述验证节点以所述目标参数作为索引,从第一列表获取所述第二证明结果,包括:所述验证节点以所述目标参数和所述标记信息作为索引,从所述第一列表获取所述第二证明结果。应理解,该标记信息为证明节点与验证节点交互的信息示例,标记信息的传递与使用取决于证明节点侧采用的具体算法,当证明节点为消除基地址随机化的影响而使用指向目标数据的地址的原始值,证明节点可以根据原始值确定标记信息,并与第一证明结果关联地向验证节点传递该标记信息,用于验证节点反向推导该原始值,或者结合该标记信息搜索相应的证明结果,本申请实施例对此不做限定。In a possible implementation of Example 2, the method may further include: the verification node obtaining tag information from the certification node; the verification node using the target parameter as an index, from the first list Obtaining the second certification result includes: the verification node using the target parameter and the tag information as an index to obtain the second certification result from the first list. It should be understood that this tag information is an example of information for the interaction between the proving node and the verification node. The transmission and use of the tag information depends on the specific algorithm adopted by the proving node side. When the proving node uses a pointer to the target data in order to eliminate the impact of base address randomization, The original value of the address, the proving node can determine the tag information based on the original value, and transfer the tag information to the verification node in association with the first proof result, for the verification node to reversely deduce the original value, or search for the corresponding tag information in combination with the original value The proof results are not limited by the embodiments of this application.
结合第二方面,一种可能的实现方式中,所述证明节点所属的第一装置与所述验证节点所属的第二装置位于同一系统级芯片SoC,其中,所述第一装置位于所述SoC的非可信硬件,所述第二装置位于所述SoC的可信硬件;或者,所述第一装置和所述第二装置为不同装置,其中,所述第一装置为非可信装置,所述第二装置为可信装置。In conjunction with the second aspect, in a possible implementation manner, the first device to which the certification node belongs and the second device to which the verification node belongs are located in the same system-on-chip SoC, wherein the first device is located in the SoC untrusted hardware, the second device is located in the trusted hardware of the SoC; or the first device and the second device are different devices, wherein the first device is an untrusted device, The second device is a trusted device.
结合第二方面,一种可能的实现方式中,所述第二装置还包括挑战节点,所述挑战节点为触发验证所述目标数据的可信性的节点;或者,所述第二装置和所述挑战节点所属的第三装置为不同装置,所述第三装置和所述第一装置为不同装置。In conjunction with the second aspect, in a possible implementation, the second device further includes a challenge node, which is a node that triggers verification of the credibility of the target data; or, the second device and the The third device to which the challenge node belongs is a different device, and the third device and the first device are different devices.
结合第二方面,一种可能的实现方式中,所述验证节点根据所述目标参数、所述第一证明结果和所述第一时刻,验证所述目标数据的可信性,包括:所述验证节点根据所述目标参数、所述第一证明结果和所述第一时刻,确定所述目标数据是否满足预设的可信条件,以验证所述目标数据的可信性;其中,所述可信条件包括:所述第一证明结果与所述验证节点根据所述目标参数获得的第二证明结果相同,以及所述第一时刻关联的第一时间区间在所述验证节点允许的时间范围内。In conjunction with the second aspect, in a possible implementation, the verification node verifies the credibility of the target data based on the target parameters, the first certification result and the first moment, including: The verification node determines whether the target data satisfies the preset trust conditions according to the target parameters, the first certification result and the first moment, so as to verify the credibility of the target data; wherein, the The credible conditions include: the first certification result is the same as the second certification result obtained by the verification node according to the target parameter, and the first time interval associated with the first moment is within the time range allowed by the verification node. Inside.
第三方面,本申请实施例提供了一种用于证明节点的装置,包括:获取单元,用于获取目标地址序列,其中,所述目标地址序列指向待验证的目标数据;处理单元,用于根据所述目标数据得到证明结果;收发单元,用于向验证节点提供所述证明结果,其中,所述证明结果关联第一时刻,所述证明结果和所述第一时刻用于所述目标数据的可信性验证。In the third aspect, embodiments of the present application provide a device for proving a node, including: an acquisition unit, configured to acquire a target address sequence, wherein the target address sequence points to target data to be verified; and a processing unit, configured to Obtain a proof result according to the target data; a transceiver unit configured to provide the proof result to a verification node, wherein the proof result is associated with a first time, and the proof result and the first time are used for the target data credibility verification.
结合第三方面,一种可能的实现方式中,所述获取单元用于:获取目标参数;根据所述目标参数和目标函数生成所述目标地址序列;其中,所述目标参数包括随机数,所述目标函数包括伪随机生成函数。In conjunction with the third aspect, in a possible implementation, the acquisition unit is configured to: acquire target parameters; generate the target address sequence according to the target parameters and the target function; wherein the target parameters include random numbers, so The objective function includes a pseudo-random generation function.
结合第三方面,一种可能的实现方式中,所述获取单元用于:从挑战节点或者所述证明节点所属第一装置的实时操作系统RTOS获取所述目标参数,其中,所述挑战节点为触发验证所述目标数据的可信性的节点。In conjunction with the third aspect, in a possible implementation, the acquisition unit is configured to: acquire the target parameter from a challenge node or a real-time operating system RTOS of the first device to which the certification node belongs, wherein the challenge node is Trigger nodes that verify the authenticity of the target data.
结合第三方面,一种可能的实现方式中,所述获取单元用于:从所述证明节点所属第一装置的RTOS获取所述目标地址序列,其中,所述目标地址序列是所述RTOS根据目标参数和目标函数生成的。Combined with the third aspect, in a possible implementation, the acquisition unit is configured to: acquire the target address sequence from the RTOS of the first device to which the certification node belongs, wherein the target address sequence is the target address sequence according to the RTOS. Target parameters and objective functions are generated.
结合第三方面,一种可能的实现方式中,所述证明节点运行于至少一个第一资源单元上,所述至少一个第一资源单元为所述证明节点所属第一装置包括的资源单元,所述资源单元至少用于运行程序。In conjunction with the third aspect, in a possible implementation, the certification node runs on at least one first resource unit, and the at least one first resource unit is a resource unit included in the first device to which the certification node belongs, so The resource unit described above is used at least to run the program.
结合第三方面,一种可能的实现方式中,所述至少一个第一资源单元运行除所述第一 装置的关键程序之外的程序,所述关键程序至少包括执行安全任务的程序和/或执行调度任务的程序。In conjunction with the third aspect, in a possible implementation, the at least one first resource unit runs programs other than key programs of the first device, where the key programs at least include programs that perform security tasks and/or A program that performs scheduled tasks.
结合第三方面,一种可能的实现方式中,所述目标地址序列包括至少两个地址,所述至少两个地址指向所述目标数据包含的至少两个数据块,所述处理单元用于:采用目标算法,按照第一顺序对所述目标数据包含的至少两个数据块进行计算,得到所述证明结果。In conjunction with the third aspect, in a possible implementation, the target address sequence includes at least two addresses, the at least two addresses point to at least two data blocks included in the target data, and the processing unit is configured to: A target algorithm is used to calculate at least two data blocks contained in the target data in a first order to obtain the proof result.
结合第三方面,一种可能的实现方式中,所述目标算法采用串行计算结构,所述目标算法包括哈希算法。Combined with the third aspect, in a possible implementation manner, the target algorithm adopts a serial computing structure, and the target algorithm includes a hash algorithm.
结合第三方面,一种可能的实现方式中,所述目标地址序列包括所述至少两个地址,所述至少两个地址指向所述目标数据包含的至少两个数据块,还包括:在所述至少两个地址中的第一地址指向的数据块的长度大于数据长度阈值时,对所述第一地址指向的数据块进行切分。Combined with the third aspect, in a possible implementation, the target address sequence includes the at least two addresses, the at least two addresses point to at least two data blocks included in the target data, and further includes: in the When the length of the data block pointed to by the first address among the at least two addresses is greater than the data length threshold, the data block pointed by the first address is segmented.
结合第三方面,一种可能的实现方式中,所述处理单元还包括:获取基地址;根据所述基地址和所述目标地址序列中的至少两个地址的值,计算指向所述目标数据的地址的原始值,所述原始值用于读取所述目标数据。In conjunction with the third aspect, in a possible implementation, the processing unit further includes: obtaining a base address; and calculating data pointing to the target based on the values of the base address and at least two addresses in the target address sequence. The original value of the address, which is used to read the target data.
结合第三方面,一种可能的实现方式中,所述处理单元还用于:根据所述原始值确定标记信息;所述证明节点向所述验证节点提供所述标记信息,所述标记信息用于反向推导所述原始值。Combined with the third aspect, in a possible implementation, the processing unit is further configured to: determine tag information according to the original value; the certification node provides the tag information to the verification node, and the tag information is Derive the original value in reverse.
结合第三方面,一种可能的实现方式中,所述目标数据包括为以下至少一种程序分配的内存空间中的数据:关键程序或所述证明节点运行的证明程序,所述关键程序至少包括:执行安全任务的程序和/或执行调度任务的程序。Combined with the third aspect, in a possible implementation, the target data includes data in the memory space allocated for at least one of the following programs: a key program or a certification program run by the certification node, and the key program at least includes : Programs that perform security tasks and/or programs that perform scheduling tasks.
结合第三方面,一种可能的实现方式中,所述证明节点所属的第一装置与所述验证节点所属的第二装置位于同一系统级芯片SoC,其中,所述第一装置位于所述SoC的非可信硬件,所述第二装置位于所述SoC的可信硬件;或者,所述第一装置和所述第二装置为不同装置,其中,所述第一装置为非可信装置,所述第二装置为可信装置。In conjunction with the third aspect, in a possible implementation manner, the first device to which the certification node belongs and the second device to which the verification node belongs are located in the same system-on-chip SoC, wherein the first device is located in the SoC untrusted hardware, the second device is located in the trusted hardware of the SoC; or the first device and the second device are different devices, wherein the first device is an untrusted device, The second device is a trusted device.
结合第三方面,一种可能的实现方式中,在所述目标数据满足预设的可信条件时,所述目标数据的可信性验证通过;其中,所述可信条件包括:所述证明结果与所述验证节点获得的证明结果相同,以及所述第一时刻关联的第一时间区间在所述验证节点允许的时间范围内。In conjunction with the third aspect, in a possible implementation manner, when the target data satisfies a preset trust condition, the trustworthiness verification of the target data passes; wherein the trust condition includes: the proof The result is the same as the certification result obtained by the verification node, and the first time interval associated with the first moment is within the time range allowed by the verification node.
第四方面,本申请实施例公开了一种用于验证节点的装置,包括:获取单元,用于获取目标参数,所述目标参数包括随机数;获取来自证明节点的第一证明结果,其中,所述第一证明结果为所述证明节点根据待验证的目标数据得到的,所述第一证明结果关联第一时刻;确定单元,用于根据所述目标参数、所述第一证明结果和所述第一时刻,验证所述目标数据的可信性。In the fourth aspect, embodiments of the present application disclose a device for verifying a node, including: an acquisition unit for obtaining target parameters, where the target parameters include random numbers; and obtaining the first certification result from the certification node, wherein, The first proof result is obtained by the proof node based on the target data to be verified, and the first proof result is associated with the first moment; the determination unit is used to determine the target parameter, the first proof result and the At the first moment, the credibility of the target data is verified.
结合第四方面,一种可能的实现方式中,所述获取单元用于:从挑战节点或者所述验证节点所属第二装置的RTOS获取所述目标参数,其中,所述挑战节点为触发验证所述目标数据的可信性的节点。In conjunction with the fourth aspect, in a possible implementation manner, the acquisition unit is configured to: acquire the target parameter from a challenge node or an RTOS of a second device to which the verification node belongs, wherein the challenge node is the one that triggers the verification. A node that describes the credibility of the target data.
结合第四方面,一种可能的实现方式中,所述确定单元用于:根据所述目标参数获取第二证明结果;所述验证节点根据所述第二证明结果、所述第一证明结果和所述第一时刻,验证所述目标数据的可信性。In conjunction with the fourth aspect, in a possible implementation, the determination unit is configured to: obtain a second certification result according to the target parameter; and the verification node obtains a second certification result according to the second certification result, the first certification result and At the first moment, the credibility of the target data is verified.
结合第四方面,一种可能的实现方式中,所述获取单元用于:根据所述目标参数获取 目标地址序列,其中,所述目标地址序列指向所述目标数据的镜像数据;所述装置还包括处理单元,用于根据所述镜像数据得到所述第二证明结果。In conjunction with the fourth aspect, in a possible implementation, the acquisition unit is configured to: acquire a target address sequence according to the target parameter, wherein the target address sequence points to mirror data of the target data; the device further A processing unit is included for obtaining the second proof result based on the mirror data.
结合第四方面,一种可能的实现方式中,所述获取单元用于:根据所述目标参数和目标函数生成所述目标地址序列。或者,所述获取单元用于:根据所述目标参数,从所述验证节点所属第二装置的RTOS获取所述目标地址序列,所述目标地址序列是所述RTOS根据目标参数和目标函数生成的。其中,所述目标函数包括伪随机生成函数。Combined with the fourth aspect, in a possible implementation manner, the acquisition unit is configured to generate the target address sequence according to the target parameter and the target function. Alternatively, the acquisition unit is configured to: acquire the target address sequence from the RTOS of the second device to which the verification node belongs based on the target parameter, where the target address sequence is generated by the RTOS based on the target parameter and the target function. . Wherein, the objective function includes a pseudo-random generation function.
结合第四方面,一种可能的实现方式中,所述目标地址序列包括至少两个地址,所述至少两个地址指向所述镜像数据包含的至少两个数据块,所述处理单元用于:所述验证节点采用目标算法,按照第一顺序对所述镜像数据包含的至少两个数据块进行计算,得到所述第二证明结果。In conjunction with the fourth aspect, in a possible implementation, the target address sequence includes at least two addresses, the at least two addresses point to at least two data blocks included in the mirror data, and the processing unit is configured to: The verification node uses a target algorithm to calculate at least two data blocks contained in the mirror data in a first order to obtain the second certification result.
结合第四方面,一种可能的实现方式中,所述目标算法采用串行计算结构,所述目标算法包括哈希算法。Combined with the fourth aspect, in a possible implementation manner, the target algorithm adopts a serial computing structure, and the target algorithm includes a hash algorithm.
结合第四方面,一种可能的实现方式中,所述目标地址序列包括所述至少两个地址,所述至少两个地址指向所述镜像数据包含的至少两个数据块,还包括:在所述至少两个地址中的第一地址指向的数据块的长度大于数据长度阈值时,对所述第一地址指向的数据块进行切分。In conjunction with the fourth aspect, in a possible implementation, the target address sequence includes the at least two addresses, the at least two addresses point to at least two data blocks included in the mirror data, and further includes: in the When the length of the data block pointed to by the first address among the at least two addresses is greater than the data length threshold, the data block pointed by the first address is segmented.
结合第四方面,一种可能的实现方式中,所述获取单元还用于:获取来自证明节点的标记信息;所述确定单元还用于根据所述标记信息和所述目标地址序列,确定指向所述镜像数据的地址的原始值,所述原始值用于读取所述镜像数据。In conjunction with the fourth aspect, in a possible implementation, the obtaining unit is further configured to: obtain tag information from the certification node; the determining unit is further configured to determine the pointing direction based on the tag information and the target address sequence. The original value of the address of the mirror data, the original value is used to read the mirror data.
结合第四方面,一种可能的实现方式中,所述获取单元用于:以所述目标参数作为索引,从第一列表获取所述第二证明结果,其中,所述第一列表用于指示多个参数以及每个参数关联的证明结果,所述多个参数包括所述目标参数。Combined with the fourth aspect, in a possible implementation, the acquisition unit is configured to: use the target parameter as an index to acquire the second proof result from a first list, where the first list is used to indicate A plurality of parameters and a proof result associated with each parameter, the plurality of parameters including the target parameter.
结合第四方面,一种可能的实现方式中,所述获取单元还用于获取来自所述证明节点的标记信息;以所述目标参数作为索引,从第一列表获取所述第二证明结果,包括:所述验证节点以所述目标参数和所述标记信息作为索引,从所述第一列表获取所述第二证明结果。Combined with the fourth aspect, in a possible implementation, the acquisition unit is also used to acquire tag information from the certification node; use the target parameter as an index to obtain the second certification result from the first list, It includes: the verification node uses the target parameter and the mark information as an index to obtain the second certification result from the first list.
结合第四方面,一种可能的实现方式中,所述证明节点所属的第一装置与所述验证节点所属的第二装置位于同一系统级芯片SoC,其中,所述第一装置位于所述SoC的非可信硬件,所述第二装置位于所述SoC的可信硬件;或者,所述第一装置和所述第二装置为不同装置,其中,所述第一装置为非可信装置,所述第二装置为可信装置。In connection with the fourth aspect, in a possible implementation manner, the first device to which the certification node belongs and the second device to which the verification node belongs are located in the same system-on-chip SoC, wherein the first device is located in the SoC untrusted hardware, the second device is located in the trusted hardware of the SoC; or the first device and the second device are different devices, wherein the first device is an untrusted device, The second device is a trusted device.
结合第四方面,一种可能的实现方式中,所述第二装置还包括挑战节点,所述挑战节点为触发验证所述目标数据的可信性的节点;或者,所述第二装置和所述挑战节点所属的第三装置为不同装置,所述第三装置和所述第一装置为不同装置。In conjunction with the fourth aspect, in a possible implementation, the second device further includes a challenge node, which is a node that triggers verification of the credibility of the target data; or, the second device and the The third device to which the challenge node belongs is a different device, and the third device and the first device are different devices.
结合第四方面,一种可能的实现方式中,所述验证节点根据所述目标参数、所述第一证明结果和所述第一时刻,验证所述目标数据的可信性,包括:所述验证节点根据所述目标参数、所述第一证明结果和所述第一时刻,确定所述目标数据是否满足预设的可信条件,以验证所述目标数据的可信性;其中,所述可信条件包括:所述第一证明结果与所述验证节点根据所述目标参数获得的第二证明结果相同,以及所述第一时刻关联的第一时间区间在所述验证节点允许的时间范围内。In conjunction with the fourth aspect, in a possible implementation manner, the verification node verifies the credibility of the target data based on the target parameter, the first certification result and the first moment, including: The verification node determines whether the target data satisfies the preset trust conditions according to the target parameters, the first certification result and the first moment, so as to verify the credibility of the target data; wherein, the The credible conditions include: the first certification result is the same as the second certification result obtained by the verification node according to the target parameter, and the first time interval associated with the first moment is within the time range allowed by the verification node. Inside.
第五方面,本申请实施例提供了一种通信系统,包括用于实现上述第一方面以及第一方面任一可能实现方式所述的方法的装置,以及用于实现上述第二方面以及第二方面任一可能实现方式所述的方法的装置。In a fifth aspect, embodiments of the present application provide a communication system, including a device for implementing the above first aspect and the method described in any possible implementation of the first aspect, and a device for implementing the above second aspect and the second aspect. Any possible device for implementing the method described in this aspect.
第六方面,本申请实施例提供了一种芯片系统,包括至少一个处理器和接口电路,所述处理器用于通过所述接口电路执行指令和/或数据的交互,使得所述芯片系统执行上述第一方面以及第一方面任一可能实现方式所述的方法,或者,执行上述第二方面以及第二方面任一可能实现方式所述的方法。In a sixth aspect, embodiments of the present application provide a chip system, including at least one processor and an interface circuit. The processor is configured to execute instructions and/or data interaction through the interface circuit, so that the chip system executes the above-mentioned The method described in the first aspect and any possible implementation of the first aspect, or the method described in the above second aspect and any possible implementation of the second aspect is performed.
第七方面,本申请实施例提供了一种终端,包括如上述第三方面以及第三方面任一可能实现方式所述的装置或上述第五方面所述的芯片系统,和/或上述第四方面以及第四方面任一可能实现方式所述的装置或上述第五方面所述的芯片系统,或者,包括如上第五方面所述的通信系统。示例地,该终端设备包括但不限于:智能运输设备(诸如汽车、轮船、无人机、火车、货车等)、智能制造设备(诸如机器人、工业设备、智能物流、智能工厂等)、智能终端(手机、计算机、平板电脑、掌上电脑、台式机、耳机、音响、穿戴设备、车载设备等)。In a seventh aspect, embodiments of the present application provide a terminal, including the device described in the above third aspect and any possible implementation of the third aspect, or the chip system described in the above fifth aspect, and/or the above fourth aspect. The device described in any possible implementation manner of the aspect and the fourth aspect, or the chip system described in the fifth aspect, or includes the communication system described in the fifth aspect. For example, the terminal equipment includes but is not limited to: intelligent transportation equipment (such as cars, ships, drones, trains, trucks, etc.), intelligent manufacturing equipment (such as robots, industrial equipment, intelligent logistics, smart factories, etc.), intelligent terminals (Mobile phones, computers, tablets, PDAs, desktops, headphones, speakers, wearable devices, vehicle-mounted devices, etc.).
第八方面,本申请实施例提供了一种车辆,该车辆可用于实现如上述第一方面以及第一方面任一可能实现方式所述的方法,和/或,实现如上述第二方面以及第二方面任一可能实现方式所述的方法。In an eighth aspect, embodiments of the present application provide a vehicle that can be used to implement the method described in the above first aspect and any possible implementation of the first aspect, and/or to implement the method described in the above second aspect and any possible implementation manner of the first aspect. The method described in any of the two possible implementation methods.
第九方面,本申请实施例提供了一种车辆,该车辆可以包括上述第三方面以及第三方面任一可能实现方式所述的装置,和/或包括实现上述第四方面以及第四方面任一可能实现方式所述的装置,或者,包括上述第五方面所述的通信系统。In a ninth aspect, embodiments of the present application provide a vehicle, which may include the device described in the above third aspect and any possible implementation of the third aspect, and/or include the device that implements any of the above fourth aspect and any possible implementation of the fourth aspect. The device described in one possible implementation manner, or includes the communication system described in the fifth aspect.
第十方面,本申请实施例提供了一种计算机可读存储介质,包括程序或指令,当所述程序或指令被执行时,上述第一方面以及第一方面任一可能实现方式所述的方法被执行,或者,上述第二方面以及第二方面任一可能实现方式所述的方法被执行。In a tenth aspect, embodiments of the present application provide a computer-readable storage medium, including a program or instructions. When the program or instructions are executed, the method described in the first aspect and any possible implementation of the first aspect is performed. is executed, or the method described in the above second aspect and any possible implementation manner of the second aspect is executed.
第十一方面,本申请实施例提供一种计算机程序产品,当计算机读取并执行所述计算机程序产品时,使得计算机执行上述第一方面以及第一方面任一可能实现方式所述的方法,或者,执行上述第二方面以及第二方面任一可能实现方式所述的方法。In an eleventh aspect, embodiments of the present application provide a computer program product, which when a computer reads and executes the computer program product, causes the computer to execute the method described in the above-mentioned first aspect and any possible implementation of the first aspect, Alternatively, perform the method described in the above second aspect and any possible implementation manner of the second aspect.
本申请实施例在上述各方面提供的实现的基础上,还可以进行进一步组合以提供更多实现。Based on the implementations provided by the above aspects, the embodiments of the present application can be further combined to provide more implementations.
上述第二方面至第十一方面中任一方面中的任一可能实现方式可以达到的技术效果,可以相应参照上述第一方面中任一方面中的任一可能实现方式可以达到的技术效果描述,重复之处不予论述。The technical effects that can be achieved by any possible implementation method in any of the above-mentioned second to eleventh aspects can be described with reference to the technical effects that can be achieved by any possible implementation method in any of the above-mentioned first aspects. , duplication will not be discussed.
附图说明Description of the drawings
图1示出了本申请实施例的验证技术的原理示意图;Figure 1 shows a schematic diagram of the principle of the verification technology according to the embodiment of the present application;
图2示出了本申请实施例的程序内存空间中的数据区段的示意图;Figure 2 shows a schematic diagram of the data section in the program memory space according to the embodiment of the present application;
图3示出了本申请实施例的基于软件的验证架构;Figure 3 shows the software-based verification architecture of the embodiment of the present application;
图4示出了本申请实施例的基于硬件的验证结构;Figure 4 shows the hardware-based verification structure of the embodiment of the present application;
图5示出了本申请实施例的一个示例的系统结构的示意图;Figure 5 shows a schematic diagram of the system structure of an example of the embodiment of the present application;
图6示出了本申请实施例的一种验证框架的示意图;Figure 6 shows a schematic diagram of a verification framework according to an embodiment of the present application;
图7示出了本申请实施例的另一种验证框架的示意图;Figure 7 shows a schematic diagram of another verification framework according to the embodiment of the present application;
图8示出了本申请实施例的基于双核系统的验证原理示意图;Figure 8 shows a schematic diagram of the verification principle based on a dual-core system according to the embodiment of the present application;
图9示出了本申请实施例的一个示例的攻击场景下的计算过程;Figure 9 shows the calculation process in an example attack scenario according to the embodiment of the present application;
图10示出了本申请实施例的一个示例的证明结果信息表;Figure 10 shows an example of the certification result information table according to the embodiment of the present application;
图11示出了本申请实施例的另一个示例的攻击场景下的计算过程;Figure 11 shows the calculation process in another example of an attack scenario according to the embodiment of the present application;
图12示出了本申请实施例的另一个示例的攻击场景下的计算过程;Figure 12 shows the calculation process in another example of an attack scenario according to the embodiment of the present application;
图13示出了本申请实施例的另一个示例的攻击场景下的计算过程;Figure 13 shows the calculation process in another example of an attack scenario according to the embodiment of the present application;
图14示出了本申请实施例的基于多核系统的验证原理示意图;Figure 14 shows a schematic diagram of the verification principle based on a multi-core system according to the embodiment of the present application;
图15示出了本申请实施例的验证方法的流程示意图;Figure 15 shows a schematic flow chart of the verification method according to the embodiment of the present application;
图16示出了本申请实施例的待验证装置的示意图;Figure 16 shows a schematic diagram of a device to be verified according to an embodiment of the present application;
图17示出了本申请实施例的验证装置的示意图;Figure 17 shows a schematic diagram of the verification device according to the embodiment of the present application;
图18示出了本申请实施例的通信装置的示意图。Figure 18 shows a schematic diagram of a communication device according to an embodiment of the present application.
具体实施方式Detailed ways
下面首先对本申请实施例涉及的部分用语进行解释说明,以便本领域技术人员理解。Some terms involved in the embodiments of this application are first explained below to facilitate understanding by those skilled in the art.
1、验证(attestation)技术:1. Attestation technology:
验证技术是可信计算的关键技术之一,用于验证被验证设备是否处于可信状态。例如代码、数据状态等是否符合预期。Verification technology is one of the key technologies in trusted computing and is used to verify whether the device being verified is in a trusted state. For example, whether the code, data status, etc. are as expected.
如图1所示,验证技术主要涉及以下三方:As shown in Figure 1, verification technology mainly involves the following three parties:
(1)挑战者(challenger):在验证过程中,向证明者提出安全挑战的一方。(1) Challenger: The party that poses a security challenge to the prover during the verification process.
挑战者会发送一个挑战(例如表示为c)给证明者。该挑战(c)也会发送给验证者。其中,挑战者发送挑战的目的是在验证过程中增加更多的随机性,防止攻击者伪造应答。The challenger will send a challenge (e.g. denoted as c) to the prover. This challenge (c) is also sent to the validator. Among them, the purpose of the challenger sending the challenge is to add more randomness to the verification process and prevent attackers from forging responses.
(2)证明者(prover):在验证过程中,可信状态接受检查的一方。(2) Prover: The party whose trustworthy status is checked during the verification process.
证明者可以根据挑战者发送来的挑战,运行事先预置的证明程序,对待验证的目标数据进行计算,计算出挑战(c)相应的回复(例如表示为r),并提供给验证者,以向验证者提供证明者是否处于可信状态的证明结果。The prover can run a preset proof program based on the challenge sent by the challenger, calculate the target data to be verified, calculate the corresponding reply to challenge (c) (for example, represented as r), and provide it to the verifier, in order to Provide the verifier with proof results of whether the prover is in a trustworthy state.
(3)验证者(verifier):在验证过程中,验证证明者的挑战并回应的一方。(3) Verifier: During the verification process, the party that verifies and responds to the challenge of the prover.
验证者可以接收挑战者发出的挑战(c)与证明者发出的回复(r)进行验证,并将验证结果(例如表示为V(c,r))返回给挑战者。挑战者可以根据该验证结果,知悉证明者侧的目标数据的可信性。The verifier can receive the challenge (c) issued by the challenger and the reply (r) issued by the prover for verification, and return the verification result (for example, expressed as V(c, r)) to the challenger. The challenger can know the credibility of the target data on the prover's side based on the verification results.
其中,根据实际验证场景的不同,挑战者与验证者可以是同一用户,比如同一个人或同一企业。或者,挑战者与验证者可以是不同用户,比如挑战者是设备使用者,验证者是设备制造商等,本申请实施例对此不做限定。Among them, depending on the actual verification scenario, the challenger and the verifier can be the same user, such as the same person or the same company. Alternatively, the challenger and the verifier may be different users. For example, the challenger may be a device user and the verifier may be a device manufacturer. This is not limited in the embodiments of this application.
下文实施例中,为便于区分,挑战者可以称为挑战节点,证明者可以称为证明节点,验证者可以称为验证节点。证明节点所属装置可以称为第一装置,验证节点所属装置可以称为第二装置,挑战节点所属装置可以称为第三装置。证明节点执行证明计算过程获得的证明结果称为第一证明结果,验证节点可以通过本申请实施例的验证方法获取可信的证明结果(例如表示为第二证明结果),并使用该第二证明结果对来自证明节点的第一证明结果进行验证,获得验证结果。In the following embodiments, for ease of distinction, the challenger may be called a challenge node, the prover may be called a certification node, and the verifier may be called a verification node. The device to which the proving node belongs may be called the first device, the device to which the verification node belongs may be called the second device, and the device to which the challenge node belongs may be called the third device. The proof result obtained by the proof node executing the proof calculation process is called the first proof result. The verification node can obtain a credible proof result (for example, expressed as a second proof result) through the verification method in the embodiment of the present application, and use the second proof As a result, the first certification result from the certification node is verified, and the verification result is obtained.
2、证明程序:2. Certification procedure:
证明节点执行证明计算过程时所运行的程序。The program that the proof node runs when performing the proof calculation process.
本申请实施例中,证明程序可以预置在证明节点所属的第一装置,证明节点所属的第一装置在接收到来自挑战节点的挑战后,可以运行该证明程序,以执行证明计算过程,获得第一证明结果。其中,该证明程序可以包括但不限于执行以下计算处理的子程序:In the embodiment of this application, the proof program can be preset in the first device to which the proof node belongs. After receiving the challenge from the challenge node, the first device to which the proof node belongs can run the proof program to perform the proof calculation process to obtain The first proves the result. Among them, the proof program may include but is not limited to subroutines that perform the following calculation processing:
(1)根据触发挑战的目标参数生成目标地址序列;(1) Generate a target address sequence based on the target parameters that trigger the challenge;
(2)根据目标地址序列中的至少两个地址读取目标数据包含的至少两个数据块;(2) Read at least two data blocks contained in the target data according to at least two addresses in the target address sequence;
(3)根据数据特征对所读取到的不同数据块进行处理,例如切分处理;(3) Process the different data blocks read according to the data characteristics, such as segmentation processing;
(4)根据目标算法对处理得到的数据块进行计算,得到该第一证明结果。(4) Calculate the processed data block according to the target algorithm to obtain the first proof result.
需要说明的是,上述子程序仅是对本申请实施例的证明程序的示例说明而非任何限定,在其它实施例中,证明节点运行的证明程序可以包括但不限于以上子程序,在此不再赘述。It should be noted that the above subroutine is only an example of the certification program in the embodiment of the present application and does not limit it in any way. In other embodiments, the certification program run by the certification node may include but is not limited to the above subroutine, which will not be discussed here. Repeat.
3、验证程序:3. Verification procedure:
验证节点执行验证计算过程时所运行的程序。The program run by the verification node when performing the verification calculation process.
本申请实施例中,验证程序可以预置在验证节点所属的第二装置,验证节点所属的第二装置在接收到来自挑战节点的挑战后,可以运行该验证程序,以执行验证计算过程,获得验证结果。其中,该验证程序可以包括但不限于执行以下计算处理的子程序:In the embodiment of this application, the verification program can be preset on the second device to which the verification node belongs. After receiving the challenge from the challenge node, the second device to which the verification node belongs can run the verification program to perform the verification calculation process, and obtain Validation results. Among them, the verification program may include but is not limited to subroutines that perform the following calculation processing:
(1)根据触发挑战的目标参数获得第二证明结果;(1) Obtain the second proof result based on the target parameters that trigger the challenge;
(2)获取来自证明节点的第一证明结果;(2) Obtain the first proof result from the proof node;
(3)根据第一证明结果、第二证明结果以及其它检查信息,验证目标数据的可信性。(3) Verify the credibility of the target data based on the first certification result, the second certification result and other inspection information.
本申请实施例的一个可选示例中,运行验证程序时,根据目标参数获得第二证明结果的方法可以与证明节点侧获得第一证明结果的方法相似,具体例如,该验证程序可以包括但不限于执行以下计算处理的子程序:In an optional example of the embodiment of this application, when running the verification program, the method of obtaining the second certification result according to the target parameters may be similar to the method of obtaining the first certification result on the certification node side. For example, the verification program may include but not Limited to subroutines that perform the following calculation processing:
(1.1)根据触发挑战的目标参数生成目标地址序列;(1.1) Generate a target address sequence based on the target parameters that trigger the challenge;
(1.2)根据目标地址序列中的至少两个地址读取目标数据的镜像数据包含的至少两个数据块;(1.2) Read at least two data blocks contained in the mirror data of the target data according to at least two addresses in the target address sequence;
(1.3)根据数据特征对所读取到的不同数据块进行处理,例如切分处理;(1.3) Process the different data blocks read according to the data characteristics, such as segmentation processing;
(1.4)根据目标算法对处理得到的数据块进行计算,得到第二证明结果。(1.4) Calculate the processed data block according to the target algorithm to obtain the second proof result.
本申请实施例的另一个可选示例中,验证程序可以包括查表程序,运行该验证程序,可以根据来自于挑战节点的目标参数,通过查表的方式获取本地存储的可信信息,并使用该可信信息作为第二证明结果,对来自证明节点的第一证明结果进行验证,以验证该证明节点所属第一装置的目标数据的可信性。In another optional example of the embodiment of this application, the verification program may include a table lookup program. When the verification program is run, the locally stored trusted information can be obtained through table lookup based on the target parameters from the challenge node, and used The trusted information serves as the second certification result to verify the first certification result from the certification node to verify the credibility of the target data of the first device to which the certification node belongs.
需要说明的是,上述子程序仅是对本申请实施例的验证程序的示例说明而非任何限定,在其它实施例中,验证节点运行的验证程序可以包括但不限于以上子程序,在此不再赘述。It should be noted that the above subroutines are only examples of the verification program in the embodiment of the present application and are not limiting in any way. In other embodiments, the verification program run by the verification node may include but is not limited to the above subroutines, which will not be discussed here. Repeat.
4、程序内存空间(或称为内存段):4. Program memory space (or memory segment):
在计算机中,一般指主存储器空间(物理地址空间)或系统为一个用户程序分配的内存空间,称为程序内存空间。In computers, it generally refers to the main memory space (physical address space) or the memory space allocated by the system for a user program, which is called program memory space.
本申请实施例中,该用户程序可以包括计算机中的任何程序,例如上述证明程序或验证程序、以及下文述及的关键程序。在程序运行过程中,程序内存空间中的数据可以根据使用用途分为不同的数据区段(segment),例如代码段(code segment)、只读数据段(read-only data segment)和通常数据段(normal data segment),如图2所示。其中,不同数据区段代表着段内数据有着不同的访问权限。比如,代码段内的数据可执行但不可读写;只读数据段内的数据不可执行且只能被读取;通常数据段内的数据不可执行但可以被读写。 通常,程序运行在代码段,而待验证的目标数据包含的数据块可能位于代码段,可能位于只读数据段,也有可能位于通常数据段中。In this embodiment of the present application, the user program may include any program in the computer, such as the above-mentioned certification program or verification program, as well as the key programs mentioned below. During the running of the program, the data in the program memory space can be divided into different data segments (segments) according to the usage, such as code segment (code segment), read-only data segment (read-only data segment) and general data segment (normal data segment), as shown in Figure 2. Among them, different data sections represent different access rights to the data in the section. For example, the data in the code segment is executable but cannot be read and written; the data in the read-only data segment is not executable and can only be read; the data in the general data segment is not executable but can be read and written. Usually, the program runs in the code segment, and the data block contained in the target data to be verified may be located in the code segment, may be located in the read-only data segment, or may be located in the normal data segment.
在验证技术领域,针对程序内存空间的不同数据区段,业内主要存在以下攻击场景:In the field of verification technology, for different data sections of the program memory space, the following attack scenarios mainly exist in the industry:
(1)代码注入攻击场景:(1)Code injection attack scenario:
代码注入攻击指的是攻击者(或称为攻击节点)通过修改代码段数据,改变代码在执行过程中的所执行的操作,从而执行恶意操作,危害安全。Code injection attacks refer to attackers (or attack nodes) modifying code segment data to change the operations performed by the code during execution, thereby performing malicious operations and endangering security.
(2)关键数据篡改攻击场景:(2) Key data tampering attack scenarios:
关键数据篡改攻击指的是攻击者通过修改不同数据区段中的关键数据(例如静态数据),例如访问权限数据、机器的配置数据等,间接改变执行过程中的所执行的操作,从而执行恶意操作,危害安全。Key data tampering attacks refer to attackers modifying key data (such as static data) in different data sections, such as access permission data, machine configuration data, etc., to indirectly change the operations performed during the execution process, thereby executing malicious operation, endangering safety.
(3)代码指针(code ponter,CP)/数据指针(data ponter,DP)篡改攻击场景:(3) Code pointer (code pointer, CP)/data pointer (data pointer, DP) tampering attack scenario:
代码指针/数据指针篡改攻击指的是攻击者通过修改指向代码地址的代码指针或指向数据地址的数据指针,间接改变执行过程中的所执行的操作,而执行恶意操作,危害安全。Code pointer/data pointer tampering attack means that the attacker indirectly changes the operations performed during the execution process by modifying the code pointer pointing to the code address or the data pointer pointing to the data address, thereby performing malicious operations and endangering security.
其中,指针也就是内存地址,指针变量是用来存放内存地址的变量,在同一CPU构架下,不同类型的指针变量所占用的存储单元长度是相同的,而存放数据的变量因数据的类型不同,所占用的存储空间长度也不同。Among them, the pointer is the memory address, and the pointer variable is the variable used to store the memory address. Under the same CPU architecture, the length of the storage unit occupied by different types of pointer variables is the same, and the variables that store data are different depending on the type of data. , the length of storage space occupied is also different.
本申请实施例的验证方法,至少可以在以上三种攻击场景下,保障目标数据的安全性。The verification method in the embodiment of this application can ensure the security of the target data at least in the above three attack scenarios.
5、基于软件验证(software based attestation,SWAT)技术:5. Software based attestation (SWAT) technology:
证明计算过程中,证明程序和被验证的目标数据不受硬件保护(与不可信程序运行在同一执行环境中)时,被称为基于软件验证技术。During the proof calculation process, when the proof program and the verified target data are not protected by hardware (running in the same execution environment as the untrusted program), it is called software-based verification technology.
如图3所示,运行环境包括常规执行环境(rich execution environment,REE)。REE中运行的应用程序(application,APP)为可被攻击者攻击的程序,是潜在的恶意程序。证明程序和目标数据,与REE APP运行在同一执行环境中,例如REE操作系统(operating system,OS)。该情形下,证明程序运行在不可信环境中,证明程序与被验证数据可能会被恶意程序篡改,无法保障安全性。As shown in Figure 3, the operating environment includes a rich execution environment (REE). The application (APP) running in REE is a program that can be attacked by attackers and is a potentially malicious program. Prove that the program and target data run in the same execution environment as the REE APP, such as the REE operating system (OS). In this case, the certification program runs in an untrusted environment, and the certification program and the data to be verified may be tampered with by malicious programs, and security cannot be guaranteed.
6、基于硬件验证(hardware based attestation)技术:6. Hardware based attestation technology:
证明计算过程中,证明程序和被验证的目标数据受硬件保护(与不可行程序运行在不同执行环境中)时,被称为基于硬件的验证。During the proof calculation process, when the proof program and the verified target data are protected by hardware (running in a different execution environment from the infeasible program), it is called hardware-based verification.
如图4所示,基于硬件隔离的运行环境可以包括REE和可信执行环境(trusted execution environment,TEE)。REE中可以运行REE OS以及多个REE APP。TEE中可以运行TEE OS、多个TEE APP以及证明程序。其中,REE OS以及多个REE APP位于非可信硬件,可被攻击者攻击的程序,是潜在的恶意程序。由于硬件隔离,证明程序和被验证的目标数据位于TEE这一可信环境中,无法被REE中的潜在恶意程序篡改,使得证明程序和目标数据得到保护。因此,从安全性上来说,基于硬件验证的技术的安全性高于基于软件验证的技术的安全性。As shown in Figure 4, the operating environment based on hardware isolation can include REE and trusted execution environment (TEE). REE OS and multiple REE APPs can be run in REE. TEE OS, multiple TEE APPs and certification programs can be run in TEE. Among them, REE OS and multiple REE APPs are located on untrusted hardware and can be attacked by attackers, which are potentially malicious programs. Due to hardware isolation, the proving program and the verified target data are located in the trusted environment of TEE and cannot be tampered with by potential malicious programs in the REE, so that the proving program and the target data are protected. Therefore, from a security perspective, the security of technology based on hardware verification is higher than that of technology based on software verification.
然而,由于基于硬件隔离,使得运行上下文需要在REE与TEE之间频繁地切换,将会带来巨大性能开销。因此,若将对实时性要求高的应用(比如智能车控)置于TEE中,在验证设备可信状态时,将会带来巨大的性能损失。在一些实际应用场景(比如智能汽车)中,出于实际性能考虑,常常不会使用基于硬件的验证架构。故而,在这些对性能要求较高的场景中,需要使用基于软件验证的技术来验证设备是否处于可信状态。而在基于软件 验证的技术的验证场景中,如何保障安全性仍为亟需解决的重要问题。However, due to hardware-based isolation, the running context needs to be frequently switched between REE and TEE, which will bring huge performance overhead. Therefore, if applications with high real-time requirements (such as smart car control) are placed in a TEE, huge performance losses will occur when verifying the trusted status of the device. In some practical application scenarios (such as smart cars), hardware-based verification architecture is often not used due to actual performance considerations. Therefore, in these scenarios with high performance requirements, software verification-based technology needs to be used to verify whether the device is in a trusted state. In verification scenarios based on software verification technology, how to ensure security is still an important issue that needs to be solved.
7、系统级芯片(system-on-a-chip,SoC)(或称为片上系统):7. System-on-a-chip (SoC) (or system-on-a-chip):
SoC指的是在单个芯片上集成一个完整的系统,对所有或部分必要的电子电路进行包分组的技术。SoC refers to the technology that integrates a complete system on a single chip and groups all or part of the necessary electronic circuits.
该系统一般包括中央处理器(central processing unit,CPU)、存储器、以及外围电路等。在不同的应用场景下,SoC上集成的具体模块可以不同,且可以更加复杂。例如,声音检测设备的片上系统是在单个芯片上为所有用户提供包括音频接收端、模数转换器(analog-to-digital converte,ADC)、微处理器、必要的存储器以及输入输出逻辑控制等设备。The system generally includes a central processing unit (CPU), memory, and peripheral circuits. In different application scenarios, the specific modules integrated on the SoC can be different and more complex. For example, the system-on-chip of a sound detection device provides all users with an audio receiver, an analog-to-digital converter (ADC), a microprocessor, necessary memory, and input and output logic control on a single chip. equipment.
本申请实施例适用的SoC可以包括两个部分,例如CPU部分和硬件安全模块(hardware security module,HSM)部分。其中,CPU部分为非可信硬件,可以包括至少两个CPU核心(core)(资源单元的示例,至少用于运行程序),该HSM部分是基于硬件隔离的可信硬件。其中,当应用于SoC,一个可选的实施例中,本申请实施例的证明节点可以位于CPU部分,验证节点和挑战节点可以位于HSM部分。The SoC applicable to the embodiments of this application may include two parts, such as a CPU part and a hardware security module (HSM) part. The CPU part is untrusted hardware and may include at least two CPU cores (examples of resource units, at least used for running programs). The HSM part is trusted hardware based on hardware isolation. When applied to SoC, in an optional embodiment, the proof node in the embodiment of this application can be located in the CPU part, and the verification node and challenge node can be located in the HSM part.
8、关键任务、关键程序和关键模块、关键数据:8. Key tasks, key procedures, key modules, and key data:
本申请实施例中,关键任务为第一装置的需要被安全保护的任务,比如,智能汽车场景中的实时性要求高的应用、密码验证任务、视觉识别任务等。In the embodiment of this application, the key tasks are tasks of the first device that need to be securely protected, such as applications with high real-time requirements in smart car scenarios, password verification tasks, visual recognition tasks, etc.
关键程序和关键模块为实现关键任务的代码段数据。其中,关键程序可以包括完整运行逻辑的代码,例如视觉识别程序的代码。关键模块是程序的关键功能的一段代码,例如视觉识别程序的机器学习运算逻辑代码、操作系统中的调度逻辑代码等。Key programs and key modules are code segment data that implement key tasks. Among them, key programs can include code that runs complete logic, such as code for visual recognition programs. A key module is a piece of code for the key functions of the program, such as the machine learning operation logic code of the visual recognition program, the scheduling logic code in the operating system, etc.
关键数据为实现关键任务的数据,该数据可以包括程序内存空间中位于不同的数据区段的数据,例如代码段关键数据、只读数据段关键数据、通常数据段关键数据等。Key data is data to achieve key tasks. This data can include data located in different data sections in the program memory space, such as code section key data, read-only data section key data, general data section key data, etc.
9、程序中断方式:9. Program interruption mode:
一种计算机中的消息通知方式。程序中断是指计算机执行现行程序的过程中,出现某些急需处理的异常情况和特殊请求,CPU暂时终止现行程序,而转去执行中断服务程序,来对随机发生的更紧迫的事件进行处理。在中断处理完毕后,CPU将自动返回原来的程序继续执行。程序中断不仅适用于外部设备的输入输出操作,也适用于对外界发生的随机事件的处理。A method of message notification in computers. Program interrupt means that when the computer is executing the current program, some abnormal situations and special requests that urgently need to be handled occur. The CPU temporarily terminates the current program and switches to the execution of the interrupt service routine to handle more urgent events that occur randomly. After the interrupt is processed, the CPU will automatically return to the original program to continue execution. Program interrupts are not only suitable for input and output operations of external devices, but also for processing random events that occur in the outside world.
本申请实施例中,证明节点所属的第一装置、验证节点所属的第二装置以及挑战节点所属的第三装置,均可以被配置为采用程序中断方式触发执行验证过程包含的相应子过程。其中,挑战节点在需要发起挑战时,可以采用第三装置的中断服务程序,向证明节点所属的第一装置发送触发挑战的目标参数。证明节点所属的第一装置接收到该目标参数后,中断服务程序被激活和执行,触发运行预置的证明程序,来对第一装置的待验证的目标数据执行证明计算过程,得到第一证明结果,该第一证明结果可以被提供至验证节点所属的第二装置。第三装置的中断服务程序在发起挑战时,还可以同时将发起挑战的目标参数发送给验证节点所属的第二装置。验证节点所属的第二装置接收到该目标参数后,中断服务程序被激活和执行,触发运行预置的验证程序,来获取来自证明节点的第一证明结果,以及结合该第一证明结果,验证第一装置的目标数据的可信性。In the embodiment of the present application, the first device to which the proving node belongs, the second device to which the verification node belongs, and the third device to which the challenge node belongs can all be configured to use program interruption to trigger the execution of corresponding sub-processes included in the verification process. When the challenge node needs to initiate a challenge, it can use the interrupt service program of the third device to send the target parameter that triggers the challenge to the first device to which the certification node belongs. After the first device to which the proof node belongs receives the target parameter, the interrupt service program is activated and executed, triggering the running of the preset proof program to perform the proof calculation process on the target data to be verified by the first device, and obtain the first proof. As a result, the first certification result can be provided to the second device to which the verification node belongs. When initiating a challenge, the interrupt service routine of the third device may also send the target parameters of the challenge to the second device to which the verification node belongs. After the second device belonging to the verification node receives the target parameter, the interrupt service program is activated and executed, triggering the running of the preset verification program to obtain the first certification result from the certification node, and combined with the first certification result, verify Credibility of the target data of the first device.
其中,该第一装置可以包括至少两个资源单元,为了确保该证明计算过程的执行不影响第一装置侧的其它程序的运行过程以及相关业务的实现,该至少两个资源单元中的至少 一个第一资源单元和至少一个第二资源单元可以分别被绑定、用于运行第一装置的不同程序,例如至少一个第一资源单元用于运行第一装置的除关键程序以外的程序(例如证明程序),至少一个第二资源单元用于运行第一装置的关键程序,该关键程序至少包括执行安全任务的程序和/或执行调度任务的程序。示例地,该第一装置可以为双核或多核装置,该第一装置的资源单元例如可以为第一装置的CPU核心,该第一装置可以包括至少两个CPU核心,被绑定用于运行关键程序的CPU核心可以称为第二核心,被绑定用于运行除关键程序以外的程序的CPU核心可以称为第一核心。Wherein, the first device may include at least two resource units. In order to ensure that the execution of the proof calculation process does not affect the running process of other programs on the first device side and the implementation of related services, at least one of the at least two resource units The first resource unit and the at least one second resource unit may be respectively bound and used to run different programs of the first device. For example, the at least one first resource unit is used to run programs other than critical programs of the first device (such as certification program), at least one second resource unit is used to run a key program of the first device, the key program at least includes a program for executing safety tasks and/or a program for executing scheduling tasks. For example, the first device may be a dual-core or multi-core device, and the resource unit of the first device may be, for example, a CPU core of the first device. The first device may include at least two CPU cores that are bound to run critical tasks. The CPU core of a program may be called the second core, and the CPU core bound to run programs other than critical programs may be called the first core.
需要说明的是,程序中断方式仅是对本申请实施例中,对于挑战节点、证明节点和验证节点各自所属装置之间的通信方式的示例而非任何限定,在其它实施例中,各个节点所属的装置之间也可以采用任意合适的通信方式(例如网络通信、软硬件通信等)实现信息交互,以发起验证过程,本申请实施例对此不做限定。It should be noted that the program interruption method is only an example of the communication method between the respective devices of the challenge node, the proving node and the verification node in the embodiment of the present application, and does not limit it in any way. In other embodiments, the devices to which each node belongs Any suitable communication method (such as network communication, software and hardware communication, etc.) can also be used between devices to implement information interaction to initiate the verification process, which is not limited in the embodiments of the present application.
需要说明的是,本申请实施例中“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a和b,a和c,b和c,或a和b和c,其中a,b,c可以是单个,也可以是多个。It should be noted that in the embodiments of this application, "at least one" refers to one or more, and "multiple" refers to two or more. "And/or" describes the association of associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A, B can be singular or plural. The character "/" generally indicates that the related objects are in an "or" relationship. "At least one of the following" or similar expressions thereof refers to any combination of these items, including any combination of a single item (items) or a plurality of items (items). For example, at least one of a, b, or c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.
以及,除非有特别说明,本申请实施例提及“第一”、“第二”、“第三”等序数词是用于对多个对象进行区分,不用于限定多个对象的优先级或者重要程度。例如,第一装置、第二装置、第三装置,只是为了区分不同的装置,而不是表示这三个装置的优先级或者重要程度等的不同。And, unless otherwise specified, the ordinal numbers such as “first”, “second” and “third” mentioned in the embodiments of this application are used to distinguish multiple objects and are not used to limit the priority or priority of multiple objects. Importance. For example, the first device, the second device, and the third device are only used to distinguish different devices, but do not indicate differences in priority or importance of the three devices.
本申请实施例提供了一种验证方法、装置和系统,有助于在基于软件验证技术的系统架构中提升安全性。其中,方法和装置是基于同一技术构思的,由于方法及装置解决问题的原理相似,因此装置与方法的实施可以相互参见,重复之处不再赘述。The embodiments of the present application provide a verification method, device and system, which help to improve security in a system architecture based on software verification technology. Among them, the method and the device are based on the same technical concept. Since the principles of the method and the device to solve the problem are similar, the implementation of the device and the method can be referred to each other, and the repeated points will not be repeated.
为了便于理解,下面以智能汽车场景为例,对本申请实施例的验证方案进行介绍。应理解,本申请实施例的验证方案还可以应用于其它对性能要求较高、且需要基于软件验证技术保障数据安全性的场景中,本申请实施例对此不做限定。For ease of understanding, the following takes the smart car scenario as an example to introduce the verification scheme of the embodiment of the present application. It should be understood that the verification solution of the embodiment of the present application can also be applied to other scenarios that have higher performance requirements and need to ensure data security based on software verification technology. The embodiment of the present application does not limit this.
图5示出了本申请实施例的一个示例的系统架构的示意图。Figure 5 shows a schematic diagram of the system architecture of an example of the embodiment of the present application.
如图5所示,该系统架构可以包括位于同一SoC上的多个模块,例如在同一片上系统或系统级芯片(system on a chip,SoC)上部署的连接于车辆的至少一个电子控制单元(electrical control unit,ECU)的CPU(例如表示为ECU CPU),以及硬件安全模块HSM。As shown in Figure 5, the system architecture may include multiple modules located on the same SoC, such as at least one electronic control unit (ECU) deployed on the same system on a chip or system on a chip (SoC) connected to the vehicle. electrical control unit, ECU) CPU (for example, represented as ECU CPU), and the hardware security module HSM.
其中,该SoC可以采用硬件隔离机制,划分为REE和TEE,ECU CPU可以属于REE,HSM可以属于TEE。Among them, the SoC can adopt a hardware isolation mechanism and be divided into REE and TEE. The ECU CPU can belong to REE, and the HSM can belong to TEE.
ECU CPU包括至少两个CPU核心(Core)、运行在该至少两个CPU核心上的实时操作系统(real-time operating system,RTOS)(为便于区分,例如表示为RTOS1)以及所有的应用程序(例如APP1和APP2)。ECU CPU includes at least two CPU cores (Core), a real-time operating system (RTOS) running on the at least two CPU cores (for ease of differentiation, for example, expressed as RTOS1) and all application programs ( For example APP1 and APP2).
HSM可以包括HSM核心、运行在HSM核心上的RTOS(例如表示为RTOS2)以及用于实现安全服务(secure service)的应用程序,该安全服务例如可以包括但不限于:密 码加速程序,例如高级加密标准(advanced encryption standard,AES)、RSA(rivest-shamir-adleman)加密算法;文件安全存储;空中下载技术(over-the-air technology,OTA)升级;密码存储;异常检测等。The HSM may include an HSM core, an RTOS (e.g., represented as RTOS2) running on the HSM core, and an application for implementing a secure service. The security service may include, but is not limited to, cryptographic accelerators such as advanced encryption. Standard (advanced encryption standard, AES), RSA (rivest-shamir-adleman) encryption algorithms; secure file storage; over-the-air technology (OTA) upgrade; password storage; anomaly detection, etc.
该SOC上包含两块内存(memory),这两块内存中,一块存储容量较大的主内存可供CPU核心使用,一块容量较小的内存作为私有内存(private memory)供HSM核心独占使用。CPU核心与HSM核心间的通信可以通过一块共享内存(shared memory)进行信息交流。当CPU核心向HSM核心传输数据时,包括以下步骤:The SOC contains two pieces of memory. Among these two pieces of memory, a main memory with a larger storage capacity can be used by the CPU core, and a memory with a smaller capacity is used as a private memory (private memory) for the exclusive use of the HSM core. The communication between the CPU core and the HSM core can exchange information through a shared memory. When the CPU core transmits data to the HSM core, the following steps are included:
S1:CPU核心向共享内存写入需要向HSM核心传输的数据。S1: The CPU core writes data to the shared memory that needs to be transmitted to the HSM core.
S2:CPU核心向HSM核心发送中断请求。S2: The CPU core sends an interrupt request to the HSM core.
S3:HSM核心上的相应中断服务程序被激活后,读取共享内存中存储的数据。由此,CPU核心完成向HSM核心的数据传输。S3: After the corresponding interrupt service routine on the HSM core is activated, the data stored in the shared memory is read. As a result, the CPU core completes the data transmission to the HSM core.
相似地,当HSM核心向CPU核心传输数据时,可以通过与上述S1-S3相似的步骤,由HSM核心向共享内存写入需要向CPU核心传输的数据,以供CPU核心上被激活的中断服务程序读取。下文中,如无特别指出,涉及到同一SoC上的CPU核心与HSM核心之间的信息交互,均可通过以上S1-S3相似的步骤实现,下文中将不再赘述。Similarly, when the HSM core transmits data to the CPU core, the HSM core can write the data that needs to be transmitted to the CPU core into the shared memory through steps similar to S1-S3 above, in order to serve the activated interrupt on the CPU core. program reads. In the following, unless otherwise specified, information interaction between the CPU core and the HSM core on the same SoC can be achieved through steps similar to S1-S3 above, and will not be described again below.
基于图5所示的系统架构,一种常规的验证框架如图6所示,挑战节点、证明节点与验证节点共同运行在HSM,待验证的目标数据本身存储和运行在主内存,CPU核心通过共享内存将待验证的目标数据传输至HSM,以供证明节点和验证节点进行后续证明计算过程和验证计算过程,以验证目标数据的可信性。Based on the system architecture shown in Figure 5, a conventional verification framework is shown in Figure 6. The challenge node, proof node and verification node run together in the HSM. The target data to be verified itself is stored and run in the main memory, and the CPU core passes The shared memory transmits the target data to be verified to the HSM for the proof node and the verification node to perform subsequent proof calculation processes and verification calculation processes to verify the credibility of the target data.
其中,与图4中基于硬件隔离的验证框架实现的验证过程类似的,在基于图6的验证框架实现的验证过程中,证明节点可以持续地从共享内存中读取待验证的目标数据包含的数据块,并基于该目标数据包含的数据块进行计算得到相应的证明结果后,将该证明结果发送给验证节点。但是,与图4中基于硬件的验证框架的区别在于,基于图6的验证框架,待验证的目标数据本身运行在主内存,这会存在一种可能性是,攻击节点有可能利用该区别,在证明节点从共享内存读取目标数据之前,将该目标数据中被篡改的数据恢复成原始数据。这样,证明节点仍基于原始数据进行计算,得到的证明结果仍可能表示该数据是可信的,不能检测出该数据是否被篡改和恢复过,从而无法保障安全性。Among them, similar to the verification process implemented by the verification framework based on hardware isolation in Figure 4, in the verification process implemented based on the verification framework in Figure 6, the proving node can continuously read the target data to be verified from the shared memory. data block, and after calculating the corresponding proof result based on the data block contained in the target data, the proof result is sent to the verification node. However, the difference from the hardware-based verification framework in Figure 4 is that based on the verification framework in Figure 6, the target data to be verified itself runs in the main memory. There is a possibility that the attacking node may take advantage of this difference. Before the proof node reads the target data from the shared memory, the tampered data in the target data is restored to the original data. In this way, the proof node still performs calculations based on the original data, and the obtained proof results may still indicate that the data is credible, and cannot detect whether the data has been tampered with and restored, thus failing to ensure security.
同时,图6示出的验证框架,需要大量占用CPU核心和HSM核心之间的通信带宽。具体而言:受HSM核心内部的输入输出缓存的大小限制,HSM核心一次性从共享内存中读取的数据量是有限的。当待验证的目标数据量非常庞大时,证明节点需要多次通过HSM核心与共享内存交互,持续地读取目标数据包含的数据块。而这种方式会挤占HSM核心响应其它安全请求的时间。At the same time, the verification framework shown in Figure 6 requires a large amount of communication bandwidth between the CPU core and the HSM core. Specifically: limited by the size of the input and output cache inside the HSM core, the amount of data that the HSM core can read from the shared memory at one time is limited. When the amount of target data to be verified is very large, the proving node needs to interact with the shared memory multiple times through the HSM core and continuously read the data blocks contained in the target data. This method will occupy the time of the HSM core to respond to other security requests.
例如,CPU核心上运行的一个网络通信应用需要对数据包进行加密时,会将该数据包写入共享内存,并通过中断请求来要求HSM核心对该数据包进行加密。如果此时证明节点在持续通过共享内存读取数据,则HSM核心响应数据包加密的请求则会延迟。For example, when a network communication application running on the CPU core needs to encrypt a data packet, it will write the data packet into the shared memory and request the HSM core to encrypt the data packet through an interrupt request. If it turns out that the node is continuing to read data from the shared memory, the HSM core will be delayed in responding to the request for packet encryption.
因此,图6所示的验证框架,无法兼顾安全性和性能开销。Therefore, the verification framework shown in Figure 6 cannot balance security and performance overhead.
针对于此,本申请实施例提出了一种验证框架,如图7所示,在图5所示系统架构的基础上,可以将证明节点运行在ECU CPU侧的目标CPU核心(图7中两个CPU核心中的任一个)上,而挑战节点和验证节点运行在HSM核心上,待验证的目标数据存储在目 标CPU核心可访问的主内存,目标数据的镜像数据存储在HSM核心可访问的私有内存。应理解,该挑战节点也可以与验证节点位于不同装置,例如挑战节点位于图7未示出的除ECU CPU和HSM以外的装置。In response to this, the embodiment of this application proposes a verification framework, as shown in Figure 7. Based on the system architecture shown in Figure 5, the verification node can be run on the target CPU core on the ECU CPU side (the two in Figure 7 on any one of the CPU cores), while the challenge node and verification node run on the HSM core. The target data to be verified is stored in the main memory accessible by the target CPU core, and the mirror data of the target data is stored in the main memory accessible by the HSM core. Private memory. It should be understood that the challenge node may also be located in a different device from the verification node. For example, the challenge node may be located in a device other than the ECU, CPU and HSM not shown in Figure 7 .
以挑战节点和验证节点位于同一装置为例,图7中,挑战节点在需要对ECU CPU侧的待验证的目标数据进行安全验证的情况下,例如可以通过HSM核心,将用于发起挑战的目标参数写入共享内存,并向CPU核心发送中断请求。CPU侧的相应中断服务程序可以响应于该中断请求而被激活,并从共享内存中读取该目标参数。同时,中断服务程序可以根据所获得的目标参数,指示证明节点运行预置的证明程序,来对待验证的目标数据进行计算,得到第一证明结果,以及通过共享内存向验证节点发送该第一证明结果。验证节点可以响应于来自挑战节点的目标参数运行预置的验证程序,根据该目标参数以及来自于证明节点的第一证明结果,同时加入本申请实施例的其它检查维度的信息(例如证明节点的证明计算过程的执行时间信息),来验证目标数据的可信性。Taking the challenge node and the verification node located in the same device as an example, in Figure 7, when the challenge node needs to securely verify the target data to be verified on the ECU CPU side, for example, it can pass the HSM core to the target used to initiate the challenge. Parameters are written to shared memory and an interrupt request is sent to the CPU core. The corresponding interrupt service routine on the CPU side can be activated in response to the interrupt request and read the target parameter from the shared memory. At the same time, the interrupt service program can instruct the certification node to run the preset certification program based on the obtained target parameters to calculate the target data to be verified, obtain the first certification result, and send the first certification to the verification node through the shared memory. result. The verification node can run a preset verification program in response to the target parameters from the challenge node, based on the target parameters and the first certification result from the certification node, while adding information from other checking dimensions in the embodiment of the present application (such as the certification node's Prove the execution time information of the calculation process) to verify the credibility of the target data.
其中,图7所示的验证框架,一方面,可以利用智能汽车场景中的已有硬件安全模块构造验证框架,不需要额外的硬件修改,对系统架构的改动小、兼容性高。另一方面,将证明节点和待验证的目标数据运行在ECU CPU的这一常规执行环境并进行完整的证明计算过程,无需切换运行上下文,可以极大地减少ECU CPU与HSM之间的通信量,降低性能开销,保障ECU CPU或HSM的当前业务的实现不受验证过程的影响。再一方面,验证节点可以结合至少两种检查维度的信息共同验证ECU CPU的被验证的目标数据的可信性,可以有效地防止攻击,保障安全性。Among them, the verification framework shown in Figure 7, on the one hand, can use the existing hardware security modules in the smart car scenario to construct the verification framework. It does not require additional hardware modifications, has small changes to the system architecture, and has high compatibility. On the other hand, running the proof node and the target data to be verified in the regular execution environment of the ECU CPU and performing the complete proof calculation process without switching the running context can greatly reduce the communication volume between the ECU CPU and the HSM. Reduce performance overhead and ensure that the implementation of the current business of the ECU CPU or HSM is not affected by the verification process. On the other hand, the verification node can combine information from at least two inspection dimensions to jointly verify the credibility of the verified target data of the ECU CPU, which can effectively prevent attacks and ensure security.
需要说明的是,上述图5-图7所示的系统架构,仅是以SoC为例,对本申请实施例的验证方案的适用场景的示例说明而非任何限定。在另外一些实施例中,该验证方案还可以将图7中的ECU CPU和HSM拆分开,而将HSM用于其他装置中,来实现本申请实施例的验证方案。例如将图7的HSM应用于车辆集成单元(vehicle integrated unit,VIU),以保护VIU上CPU中运行的程序与数据的安全性。或者,还可以将包含图7的HSM的板卡装置(或设备),应用到与板卡装置本地连接的外置装置的安全性验证的场景中。其中,该外置装置通常可以包括因成本原因而不具备可信硬件或HSM的装置。示例地,该板卡装置可以包括但不限于移动数据中心(mobile data center,MDC)、车辆动态控制系统(vehicle dynamics control,VDC)等。当上述ECU CPU和HSM位于不同的装置时,至少需要确保验证节点所在的HSM属于可信装置,证明节点可以运行在非可信装置中。该可信装置和非可信装置之间可以通过消息或其它方式进行通信交互,以实现本申请实施例的验证方法,本申请实施例对此通信方式不做限定。It should be noted that the system architecture shown in Figures 5 to 7 above is only an SoC as an example, and is not intended to be any limitation to the applicable scenarios of the verification solution in the embodiment of the present application. In other embodiments, the verification scheme can also separate the ECU CPU and HSM in Figure 7, and use the HSM in other devices to implement the verification scheme of the embodiment of the present application. For example, the HSM in Figure 7 is applied to the vehicle integrated unit (VIU) to protect the security of programs and data running in the CPU on the VIU. Alternatively, the board device (or device) including the HSM in Figure 7 can also be applied to the security verification scenario of an external device that is locally connected to the board device. The external device may generally include a device that does not have trusted hardware or HSM due to cost reasons. For example, the board device may include but is not limited to a mobile data center (MDC), a vehicle dynamics control system (VDC), etc. When the above ECU CPU and HSM are located in different devices, at least it is necessary to ensure that the HSM where the verification node is located is a trusted device, and the verification node can run in an untrusted device. The trusted device and the untrusted device can communicate and interact through messages or other methods to implement the verification method in the embodiment of the present application. This communication method is not limited in the embodiment of the present application.
为了便于理解,下面以本申请实施例的验证方案应用在SoC场景、以证明节点所属的ECU CPU作为第一装置、挑战节点和验证节点所属的HSM作为第二装置(即第二装置和第三装置为同一装置)为例,结合图7所示的验证框架,对本申请实施例的验证方案的实现原理进行介绍,参见图8所示。其中,图8中未示出ECU CPU和HSM各自与内存之间的信息交互过程,详细实现细节可参见图5-图7的相关描述,在此不再赘述。In order to facilitate understanding, the verification scheme of the embodiment of the present application is applied in the SoC scenario below, with the ECU CPU to which the certification node belongs as the first device, and the HSM to which the challenge node and verification node belong as the second device (i.e., the second device and the third device). (the device is the same device)) as an example, combined with the verification framework shown in Figure 7, the implementation principle of the verification solution in the embodiment of the present application is introduced, as shown in Figure 8. Among them, the information interaction process between the ECU, CPU and HSM and the memory is not shown in Figure 8. For detailed implementation details, please refer to the relevant descriptions in Figures 5 to 7, which will not be described again here.
如图8所示,以双核系统(包括两个CPU核心)为例,该验证方案可以包括以下步骤:As shown in Figure 8, taking a dual-core system (including two CPU cores) as an example, the verification solution can include the following steps:
S810:在时间点1,挑战节点向证明节点所属的ECU CPU发送一个挑战。S810: At time point 1, the challenge node sends a challenge to the ECU CPU to which the proving node belongs.
示例地,以采用程序中断方式为例,该挑战节点所属的HSM可以认为是ECU CPU的 外设的一个示例,挑战节点在需要发起对ECU CPU的目标数据的验证流程时,可以激活HSM的中断服务程序,该中断服务程序运行在RTOS2,可以向证明节点所属的ECU CPU发送中断请求,以发起挑战。For example, taking the program interrupt method as an example, the HSM to which the challenge node belongs can be considered as an example of a peripheral of the ECU CPU. When the challenge node needs to initiate a verification process for the target data of the ECU CPU, it can activate the interrupt of the HSM. Service program, which runs in RTOS2, can send an interrupt request to the ECU CPU to which the proving node belongs to initiate a challenge.
参见前文结合图5和图7的描述,在SoC场景中,HSM核心可以向共享内存写入发起挑战的目标参数,以供ECU CPU侧被激活的相应中断服务程序读取。示例地,该目标参数可以包括随机数,例如表示为N。Referring to the previous description combined with Figure 5 and Figure 7, in the SoC scenario, the HSM core can write the target parameters of the challenge to the shared memory for reading by the corresponding interrupt service program activated on the ECU CPU side. For example, the target parameter may include a random number, represented as N, for example.
S820:响应于来自HSM的中断请求,ECU CPU侧的相应中断服务程序可以被激活,该中断服务程序可以运行在RTOS1,并指示证明节点运行预置的证明程序,从而执行证明计算流程。其中,该证明计算过程以包括以下步骤:S820: In response to the interrupt request from the HSM, the corresponding interrupt service program on the ECU CPU side can be activated. The interrupt service program can run in RTOS1 and instruct the proof node to run the preset proof program to execute the proof calculation process. Among them, the proof calculation process includes the following steps:
S821:证明节点在任务调度器分配的目标CPU核心上运行预置的证明程序。S821: The proving node runs the preset proving program on the target CPU core allocated by the task scheduler.
本申请实施例中,运行在RTOS1的任务调度器为ECU CPU的关键模块的一个示例,用于执行调度任务。例如,CPU核心为第一装置的资源单元的示例,在该第一装置中,任务调度器可以通过设置(例如亲和性(affinity)设置),将ECU CPU的两个CPU核心中的一个CPU核心(例如CPU核心1)绑定至给执行关键任务的关键程序,将该另一个CPU核心(例如CPU核心2)作为目标核心绑定至除关键程序以外的程序,例如证明程序。证明节点可以根据任务调度器的调度信息,在目标核心上运行预置的证明程序,从而执行证明计算流程,得到第一证明结果。In the embodiment of this application, the task scheduler running on RTOS1 is an example of a key module of the ECU CPU and is used to execute scheduling tasks. For example, a CPU core is an example of a resource unit of a first device in which the task scheduler can assign one of the two CPU cores of the ECU CPU to A core (for example, CPU core 1) is bound to a key program that performs a critical task, and the other CPU core (for example, CPU core 2) is bound as a target core to a program other than the key program, such as a certification program. The proof node can run the preset proof program on the target core according to the scheduling information of the task scheduler, thereby executing the proof calculation process and obtaining the first proof result.
需要说明的是,本申请实施例中,任务调度器可以是预先进行调度的。证明节点触发运行证明程序时,该证明程序可以直接在任务调度器分配的目标核心上运行。或者,任务调度器可以实时地根据ECU CPU当前所有CPU核心的运行信息(例如运行的程序、负载信息等)为证明节点调度未运行关键程序的CPU核心作为目标核心,本申请实施例对任务调度器的调度时机不做限定。通过任务调度,证明节点执行证明计算的整个过程中,将不会抢占关键程序的运行资源,有助于保障ECU CPU侧的高实时性业务的实现。It should be noted that in the embodiment of the present application, the task scheduler may schedule in advance. When the proving node triggers running the proving program, the proving program can be run directly on the target core assigned by the task scheduler. Alternatively, the task scheduler can use the running information of all current CPU cores of the ECU CPU in real time (such as running programs, load information, etc.) to prove that the node schedules the CPU core that is not running the key program as the target core. The embodiment of this application is for task scheduling. The scheduling timing of the server is not limited. Through task scheduling, the proof node will not seize the running resources of key programs during the entire process of proof calculation, which helps ensure the realization of high real-time services on the ECU CPU side.
S822:证明程序的运行过程中,证明节点可以获取目标函数生成的目标地址序列,并根据该目标地址序列进行计算得到第一证明结果。S822: During the running of the certification program, the certification node can obtain the target address sequence generated by the target function, and calculate the first certification result based on the target address sequence.
本申请实施例中,该目标地址序列可以是根据发起挑战的目标参数和ECU CPU内预置的目标函数生成的,该目标地址序列可以指向待验证的目标数据,在证明计算过程中,证明节点可以根据目标地址序列读取目标数据并进行计算,得到该第一证明结果。In the embodiment of this application, the target address sequence can be generated based on the target parameters of the challenge and the target function preset in the ECU CPU. The target address sequence can point to the target data to be verified. During the proof calculation process, the proof node The target data can be read and calculated according to the target address sequence to obtain the first proof result.
具体实施时,第一种可能的实现方式中,RTOS1可以预先被配置用于在中断服务程序被激活后运行目标函数对应的程序。ECU CPU接收到来自挑战节点的发起挑战的目标参数后,ECU CPU侧被激活的中断服务程序,可以触发(或者说通知)RTOS1运行目标函数对应的程序,以生成该目标地址序列,并将该目标地址序列提供给证明节点,由证明节点基于该目标地址序列进行后续证明计算过程。其中,该中断服务程序可以根据该目标参数,调用运行在RTOS1的目标函数对应的程序,来触发目标函数对应的程序的运行以及生成目标地址序列的过程。第二种可能的实现方式中,证明节点可以预先被配置用于在中断服务程序被激活后运行目标函数对应的程序。ECU CPU接收到来自挑战节点的发起挑战的目标参数后,ECU CPU侧被激活的中断服务程序,可以通过向证明节点发送触发挑战的目标参数,来触发证明节点调用目标函数对应的程序的过程。证明节点可以调用该目标函数对应的程序以生成该目标地址序列,并基于该目标地址序列进行后续证明计算过程。In specific implementation, in the first possible implementation manner, RTOS1 can be pre-configured to run the program corresponding to the target function after the interrupt service routine is activated. After the ECU CPU receives the challenge target parameters from the challenge node, the interrupt service program activated on the ECU CPU side can trigger (or notify) RTOS1 to run the program corresponding to the target function to generate the target address sequence and convert the The target address sequence is provided to the certification node, and the certification node performs the subsequent certification calculation process based on the target address sequence. Among them, the interrupt service program can call the program corresponding to the target function running on RTOS1 according to the target parameter to trigger the running of the program corresponding to the target function and the process of generating the target address sequence. In a second possible implementation, the proof node can be pre-configured to run the program corresponding to the target function after the interrupt service routine is activated. After the ECU CPU receives the target parameters of the challenge from the challenge node, the interrupt service program activated on the ECU CPU side can trigger the process of the proof node calling the program corresponding to the target function by sending the target parameters that trigger the challenge to the proof node. The proof node can call the program corresponding to the target function to generate the target address sequence, and perform the subsequent proof calculation process based on the target address sequence.
示例地,该目标函数可以包括伪随机数生成器函数。在上述第一种可能的实现方式和 第二种可能的实现方式中,目标函数对应的程序在运行时,可以以触发挑战的目标参数作为种子,利用伪随机数生成器生成该目标地址序列。该目标地址序列可以包括至少两个地址,该至少两个地址可以指向目标数据包含的至少两个数据块。其中,该目标地址序列的长度可以L,表示该至少两个地址的数量,L为大于或等于2的整数。一个可选的实施方式中,该目标地址序列可以关联时间点2,该时间点2可以作为用于验证目标数据的可信性的时间信息之一,与计算得到的第一证明结果关联地提供给验证节点,将在下文实施例中详述,在此不再赘述。By way of example, the objective function may include a pseudo-random number generator function. In the first possible implementation method and the second possible implementation method mentioned above, when the program corresponding to the target function is running, the target parameter that triggers the challenge can be used as a seed, and a pseudo-random number generator can be used to generate the target address sequence. The target address sequence may include at least two addresses, and the at least two addresses may point to at least two data blocks contained in the target data. The length of the target address sequence may be L, which represents the number of the at least two addresses, and L is an integer greater than or equal to 2. In an optional implementation, the target address sequence can be associated with time point 2, which can be used as one of the time information used to verify the credibility of the target data and provided in association with the calculated first proof result. The verification node will be described in detail in the embodiment below and will not be described again here.
需要说明的是,图8中S822仅用于示意性说明可以通过运行目标函数对应的程序来生成目标地址序列,并不限定该目标地址序列的生成方法。并且,任务调度器对应的程序以及图中未示出的用于执行关键任务的程序等可以是本申请实施例的关键程序的一个示例,目标函数对应的程序可以为证明程序包含的一个子程序,该证明程序还可以包含其它未示出的子程序,详细可参见前文的相关介绍,在此不再赘述。It should be noted that S822 in Figure 8 is only used to schematically illustrate that a target address sequence can be generated by running a program corresponding to the target function, and does not limit the method of generating the target address sequence. Moreover, the program corresponding to the task scheduler and the program not shown in the figure for executing key tasks may be an example of the key program in the embodiment of the present application, and the program corresponding to the objective function may be a subroutine included in the proving program. , the proof program may also include other subroutines not shown. For details, please refer to the relevant introduction above and will not be repeated here.
证明节点在获得目标地址序列后,可以根据该目标地址序列包含的地址读取目标数据包含的数据块,并采用目标算法,按照第一顺序对该目标数据包含的数据块进行计算,得到第一证明结果。It proves that after the node obtains the target address sequence, it can read the data block contained in the target data according to the address contained in the target address sequence, and use the target algorithm to calculate the data blocks contained in the target data in the first order to obtain the first Prove the results.
其中,ECU CPU侧待验证的目标数据可以包括第一装置侧的任何需要验证可信性的数据,例如,该目标数据可以为以下任一种程序分配的内存空间中的数据:关键程序或证明程序,关键程序至少可以包括执行安全任务的程序和/或执行调度任务的程序。其中,该安全任务和调度任务为关键任务的一个示例,安全任务包括ECU CPU侧需要被安全保护的任务,比如运行人工智能(artificial intelligence,AI)识别算法的任务等。调度任务可以包括任务调度器所执行的任务,例如为证明节点调度目标核心。证明程序包括在ECU CPU为证明节点预置的用于实现证明计算过程的全部程序。应理解,此处仅是对待验证的目标数据的示例说明而非限定。在实际应用中,待验证的目标数据可以不限于上述举例,在此不再赘述。Among them, the target data to be verified on the ECU CPU side can include any data on the first device side that needs to be verified for credibility. For example, the target data can be data in the memory space allocated by any of the following programs: key programs or proofs Programs, key programs may at least include programs that perform safety tasks and/or programs that perform scheduling tasks. Among them, the safety task and scheduling task are an example of critical tasks. Safety tasks include tasks that need to be safely protected on the ECU CPU side, such as tasks running artificial intelligence (artificial intelligence, AI) recognition algorithms. Scheduling tasks may include tasks performed by the task scheduler, such as scheduling target cores for attestation nodes. The proof program includes all programs preset in the ECU CPU for the proof node to implement the proof calculation process. It should be understood that this is only an example of the target data to be verified and is not a limitation. In practical applications, the target data to be verified may not be limited to the above examples, and will not be described again here.
在一个可选的实施方式中,目标算法可以采用串行计算结构。比如,该串行计算结构可以包括用于串行计算的M个函数块(例如表示为F),每个函数块被配置为采用目标算法进行计算,可以用于对输入的地址或数据内容进行计算,直至得到证明结果,M≥L,M为整数。按照该串行计算结构为无法进行并行计算的结构,基于该结构进行证明计算时,必须等到前一个函数块的计算完成得到相应的计算结果后,才能基于下一个函数块进行下一个地址或者下一部分数据内容的计算。这样,攻击者将无法利用第一装置的多资源单元的特性构造算法并行执行验证算法,从而压缩执行时间。示例地,该串行计算结构例如可以为Merkle–Damgard结构。上述目标算法可以包括哈希算法,包括但不限于MD5、SHA1等哈希算法,所获得的第一证明结果例如为哈希值。In an optional implementation, the target algorithm may adopt a serial computing structure. For example, the serial calculation structure may include M function blocks (for example, represented as F) for serial calculations. Each function block is configured to perform calculations using a target algorithm and may be used to perform calculations on input addresses or data contents. Calculate until the proven result is obtained, M≥L, M is an integer. According to this serial calculation structure, parallel calculations cannot be performed. When performing proof calculations based on this structure, you must wait until the calculation of the previous function block is completed to obtain the corresponding calculation results before proceeding to the next address or next step based on the next function block. Calculation of part of the data content. In this way, the attacker will not be able to utilize the characteristics of the multi-resource unit of the first device to construct an algorithm to execute the verification algorithm in parallel, thereby compressing the execution time. For example, the serial computing structure may be a Merkle–Damgard structure. The above-mentioned target algorithm may include a hash algorithm, including but not limited to MD5, SHA1 and other hash algorithms, and the first proof result obtained may be a hash value, for example.
示例地,如图9所示,以目标地址序列中包括五个地址(L=5)为例,该五个地址可以表示为A1,A2,A3,A4,A5。基于A1-A5读取到的目标数据可以包含五个数据块,表示为V1,V2,V3,V4,V5。V1-V5的数据类型、大小等可以各不相同,例如,有些数据块可以为代码段数据,有些数据块可以为只读数据段的数据,有些数据块可以是4字节,有些数据块可以是8字节或更长(例如32字节),在此不再赘述。证明节点在采用目标算法和第一顺序构造串行计算结构时,可以从初始化向量(initial nector,IV)开始,构造五个函数块,表示为F1,F2,F3,F4,F5。数据块V1-V5可以分别作为函数块F1-F5的输 入内容,输入至函数块F1-F5依次进行计算,在最后计算完成(finalize)后,获得该第一证明结果。For example, as shown in Figure 9, taking the target address sequence including five addresses (L=5) as an example, the five addresses can be represented as A1, A2, A3, A4, and A5. The target data read based on A1-A5 can contain five data blocks, represented as V1, V2, V3, V4, V5. The data types and sizes of V1-V5 can be different. For example, some data blocks can be code segment data, some data blocks can be read-only data segment data, some data blocks can be 4 bytes, and some data blocks can be It is 8 bytes or longer (for example, 32 bytes), so I won’t go into details here. It is proved that when the node uses the target algorithm and the first order to construct the serial computing structure, it can start from the initialization vector (initial nector, IV) and construct five function blocks, represented as F1, F2, F3, F4, and F5. The data blocks V1-V5 can be used as the input content of the function blocks F1-F5 respectively, and are input to the function blocks F1-F5 for calculation in sequence. After the final calculation is completed (finalize), the first proof result is obtained.
需要说明的是,图9仅是对目标地址序列中的地址、目标数据包含的数据块、串行计算结构的函数块的对应关系的说明,并不限定在串行计算结构的各个函数块中输入的内容。在其它实施例中,根据所采用的目标算法的具体实现,例如还可以将目标地址序列中至少两个地址的值分别作为该串行计算结构的各个函数块的输入内容,使得各个函数块可以根据地址读取相应的数据块并进行计算,直至得到第一证明结果,本申请实施例对此计算的具体实现方式不做限定。It should be noted that Figure 9 is only an illustration of the correspondence between the addresses in the target address sequence, the data blocks contained in the target data, and the function blocks of the serial calculation structure, and is not limited to each function block of the serial calculation structure. input content. In other embodiments, depending on the specific implementation of the target algorithm used, for example, the values of at least two addresses in the target address sequence can also be used as the input content of each function block of the serial calculation structure, so that each function block can The corresponding data block is read according to the address and calculated until the first proof result is obtained. The embodiment of the present application does not limit the specific implementation of this calculation.
S830:证明节点向验证节点提供第一证明结果。S830: The certification node provides the first certification result to the verification node.
例如,在时间点3,证明节点可以向验证节点所属的第二装置发送该第一证明结果。相应地,验证节点可以在时间点3接收到来自证明节点的第一证明结果。进一步,验证节点运行预置的验证程序时,可以基于包含该第一证明结果在内的至少两个检查维度的信息,验证目标数据的可信性。For example, at time point 3, the certification node may send the first certification result to the second device to which the verification node belongs. Accordingly, the verification node may receive the first certification result from the certification node at time point 3. Furthermore, when the verification node runs a preset verification program, it can verify the credibility of the target data based on information from at least two inspection dimensions including the first verification result.
示例地,该至少两种检查维度的信息可以包括第一证明结果本身、以及证明节点的证明计算过程的执行时间信息,该执行时间信息例如可由触发挑战的时间点1(例如称为第二时刻)和证明计算过程结束的时间点3(例如称为第一时刻)确定,例如为时间点1和时间点3的时间差。该验证节点可以根据该第一证明结果和该时间差,同时确定证明节点所属的第一装置的目标数据是否满足预设的可信条件,以确定该目标数据的可信性。For example, the information of the at least two checking dimensions may include the first proof result itself, and the execution time information of the proof calculation process of the proof node. The execution time information may be determined by the time point 1 (for example, called the second moment) that triggers the challenge. ) and the time point 3 (for example, called the first moment) at which the proof calculation process ends are determined, for example, the time difference between time point 1 and time point 3. The verification node can simultaneously determine whether the target data of the first device to which the certification node belongs satisfies a preset credibility condition based on the first certification result and the time difference to determine the credibility of the target data.
比如,该可信条件可以包括:所述证明节点提供的第一证明结果与该验证节点根据目标参数获得的第二证明结果相同,以及第一时刻关联的第一时间区间在验证节点允许的时间范围内。For example, the trustworthy condition may include: the first certification result provided by the certification node is the same as the second certification result obtained by the verification node according to the target parameter, and the first time interval associated with the first moment is within the time allowed by the verification node. within the range.
其中,在基于上述执行时间信息进行可信性验证时,验证节点可以根据时间点3与时间点1之间的时间差,确定证明节点执行上述证明计算过程的总耗时是否符合可信条件,即时间点3与时间点1之间的时间差作为第一时间区间是否在可信的时间范围内(由于通信交互引起的时间误差已预先估算并涵盖在允许的时间范围内)。若该时间差过长或过短而不在该可信的时间范围,则证明节点可能被攻击,表明来自证明节点的第一证明结果是非可信的。若该时间差在该可信时间区间内,则至少表示该证明节点在执行时间维度是可信的。Among them, when conducting credibility verification based on the above execution time information, the verification node can determine whether the total time taken by the certification node to execute the above certification calculation process meets the credibility condition based on the time difference between time point 3 and time point 1, that is, Whether the time difference between time point 3 and time point 1 is used as the first time interval is within a credible time range (the time error caused by communication interaction has been estimated in advance and is covered within the allowed time range). If the time difference is too long or too short and does not fall within the credible time range, the certification node may be attacked, indicating that the first certification result from the certification node is untrustworthy. If the time difference is within the credible time interval, it at least means that the certification node is credible in the execution time dimension.
在基于上述第一证明结果进行可信性验证时,验证节点可以根据目标参数获得可信的第二证明结果,并利用该第二证明结果与第一证明结果是否相同,来验证目标数据的可信性。如果相同,则表示证明节点侧的第一证明结果是可信的,证明节点所属的第一装置的目标数据未被篡改。如果不相同,则表明证明节点侧的第一证明结果是非可信的,证明节点所属的第一装置的目标数据可能被非法篡改。When conducting credibility verification based on the above-mentioned first certification result, the verification node can obtain a credible second certification result based on the target parameters, and use whether the second certification result is the same as the first certification result to verify the credibility of the target data. Credibility. If they are the same, it means that the first certification result on the node side is credible, and it proves that the target data of the first device to which the node belongs has not been tampered with. If they are not the same, it means that the first certification result on the certification node side is not credible, and the target data of the first device to which the certification node belongs may have been illegally tampered with.
在执行时间信息在允许的时间范围内、以及第一验证结果与第二验证结果相同的情况下,验证节点方可确定证明节点侧的目标数据的可信性。在以上任一情况不符合的情况下,均认为证明节点侧的目标数据是非可信的,证明节点所属的第一装置可能已被非法攻击。Only when the execution time information is within the allowed time range and the first verification result and the second verification result are the same, the verification node can determine the credibility of the target data on the certification node side. If any of the above conditions are not met, the target data on the proof node side is considered to be untrustworthy, and the first device to which the proof node belongs may have been illegally attacked.
需要说明的是,本申请实施例中,在验证节点侧,第二证明结果可以是验证节点执行与证明节点侧相同的计算过程获得的。例如,验证节点可以在接收到挑战节点通过中断服务程序发出的目标参数后,在HSM核心运行预置的验证程序,执行与上述S822相同的计算过程,根据待验证的目标数据的存储在私有内存中的镜像数据进行计算,获得该第二证 明结果,详细实现细节可参见上文结合证明节点描述的计算过程(例如将目标数据替换为镜像数据),在此不再赘述。It should be noted that in the embodiment of the present application, on the verification node side, the second certification result may be obtained by the verification node performing the same calculation process as that on the certification node side. For example, after receiving the target parameters sent by the challenge node through the interrupt service routine, the verification node can run the preset verification program in the HSM core, perform the same calculation process as the above S822, and store the target data to be verified in the private memory. Perform calculations on the mirror data in the node to obtain the second proof result. For detailed implementation details, please refer to the calculation process described above in conjunction with the proof node (for example, replacing the target data with mirror data), which will not be described again here.
然而,由于在验证节点侧执行与S822相同的计算过程,需要在HSM的私有内存中存储镜像数据,虽然额外存储的镜像数据不会影响最终的计算结果,但是会占用大量的存储空间,在HSM的私有内存不足以存放所有目标数据的镜像数据时,将会影响本申请实施例的验证方案的实施。However, since the same calculation process as S822 is performed on the verification node side, the mirror data needs to be stored in the private memory of the HSM. Although the additional stored mirror data will not affect the final calculation results, it will occupy a large amount of storage space in the HSM. When the private memory is insufficient to store the mirror data of all target data, it will affect the implementation of the verification scheme of the embodiment of this application.
因此,一种可选的实现方式是,可以不在HSM的私有内存空间存储待验证的目标数据的镜像数据,而是预先维护一张列表,例如称为证明结果信息表或第一列表,该第一列表中可以用于存储多个参数,以及每个参数关联的可信的证明结果,该多个参数可以包括目标参数。验证节点在接收到来自挑战节点的目标参数以及来自证明节点的第一证明结果后,可以以该目标参数作为索引,通过查表的方式,从保存的第一列表获取期望的证明结果,表示为第二证明结果。从而,证明节点可以根据接收到的第一证明结果、查表获得的第二证明结果和接收第一证明结果的时间点3等信息,同时验证目标数据的可信性。Therefore, an optional implementation method is to not store the mirror data of the target data to be verified in the private memory space of the HSM, but to maintain a list in advance, such as a certification result information table or a first list. A list can be used to store multiple parameters and the credible proof results associated with each parameter. The multiple parameters can include target parameters. After receiving the target parameter from the challenge node and the first proof result from the proof node, the verification node can use the target parameter as an index to obtain the expected proof result from the saved first list by looking up the table, expressed as The second proves the result. Therefore, the certification node can simultaneously verify the credibility of the target data based on the received first certification result, the second certification result obtained by looking up the table, and the time point 3 at which the first certification result was received.
其中,第一列表中的多个参数为随机数,挑战节点可以在该第一列表包含的多个参数中选择目标参数发起挑战。验证节点可以和证明节点使用相同的伪随机数生成器函数生成目标地址序列,而目标地址序列的结果往往由输入的随机数N决定。因此,对于验证节点而言,对于任意一个随机数N,在证明节点侧生成的目标地址序列是确定且可以预知的。基于此,验证节点可以预先根据目标算法生成每个随机数对应的证明结果,并存储在HSM的私有内存中。由于该私有内存的可信性,从而验证节点通过查表的方式获得的第二证明结果是可信的,可用于验证第一证明结果的可信性。The multiple parameters in the first list are random numbers, and the challenging node can select target parameters from the multiple parameters included in the first list to initiate a challenge. The verification node can use the same pseudo-random number generator function as the proving node to generate the target address sequence, and the result of the target address sequence is often determined by the input random number N. Therefore, for the verification node, for any random number N, the target address sequence generated on the proving node side is certain and predictable. Based on this, the verification node can generate the proof result corresponding to each random number in advance according to the target algorithm and store it in the private memory of the HSM. Due to the credibility of the private memory, the second certification result obtained by the verification node through table lookup is credible and can be used to verify the credibility of the first certification result.
以第一列表中记录的参数是随机数、以验证节点所采用的目标算法为哈希算法、根据每个参数计算得到的证明结果为哈希值为例,验证节点维护的第一列表为一种验证哈希值的列表,如图10所示,该第一列表至少可以包括多个随机数(例如表示为N1、N2、N3、N4、N5等)以及与每个随机数配对的哈希值(例如表示为哈希值1、哈希值2、哈希值3、哈希值4、哈希值5)。Assume that the parameters recorded in the first list are random numbers, the target algorithm used by the verification node is the hash algorithm, and the proof result calculated based on each parameter is the hash value. The first list maintained by the verification node is A list of verified hash values, as shown in Figure 10. The first list may at least include a plurality of random numbers (for example, represented as N1, N2, N3, N4, N5, etc.) and a hash paired with each random number. value (e.g. expressed as hash value 1, hash value 2, hash value 3, hash value 4, hash value 5).
当挑战节点从第一列表存储的参数中随机选择一个随机数(例如N1)作为目标参数发送给证明节点和验证节点,来触发挑战。证明节点可以执行上述S820-S830,得到第一证明结果并提供给验证节点,而验证节点则无需执行相同的计算步骤,而只需通过查表的方式访问私有内存,根据从挑战节点获得的触发挑战的目标参数N1以及保存的第一列表,通过N1查询对应的哈希值1,作为第二证明结果。在进行可信性验证时,验证节点需要确定该哈希值1与来自证明节点的第一证明结果是否相同。例如若第一证明结果也为哈希值1,则双方获得的证明结果相同,则表明来自证明节点的第一证明结果是可信的,目标数据未被篡改。若第一证明结果为哈希值2、哈希值3、哈希值4或哈希值5中的任一个或其它哈希值,则双方获得证明结果不相同,则表明来自证明节点的第一证明结果是非可信的,目标数据可能已被非法篡改。When the challenge node randomly selects a random number (such as N1) from the parameters stored in the first list as the target parameter and sends it to the proof node and verification node to trigger the challenge. The proof node can execute the above S820-S830 to obtain the first proof result and provide it to the verification node. The verification node does not need to perform the same calculation steps, but only needs to access the private memory through table lookup, according to the trigger obtained from the challenge node. The target parameter N1 of the challenge and the saved first list are used to query the corresponding hash value 1 through N1 as the second proof result. When performing trustworthiness verification, the verification node needs to determine whether the hash value 1 is the same as the first proof result from the proof node. For example, if the first proof result is also hash value 1, then the proof results obtained by both parties are the same, which means that the first proof result from the proof node is credible and the target data has not been tampered with. If the first proof result is any one of hash value 2, hash value 3, hash value 4, hash value 5, or other hash values, and the proof results obtained by both parties are different, it means that the third proof from the proof node Once the proof result is unreliable, the target data may have been illegally tampered with.
应理解,图10仅是对本申请实施例的第一列表的示例说明而非限定,在实际应用中,该第一列表的长度不限于5对数据,可以根据需要适当增加该第一列表的长度,例如1000对数据,使得攻击者难以获取该第一列表的全部信息,或者,难以在有限的时间内(例如10分钟内)获取该第一列表的全部信息,提升安全性。可选的实现方式中,该第一列表包含的内容可以不限于多个参数和多个证明结果,例如还可以包括根据多个参数以及目标函 数可以预知的目标地址序列包含的地址的值,下文结合实施例进行介绍,在此不再赘述。It should be understood that Figure 10 is only an illustration of the first list in the embodiment of the present application and is not limiting. In practical applications, the length of the first list is not limited to 5 pairs of data, and the length of the first list can be appropriately increased as needed. , for example, 1000 pairs of data, making it difficult for an attacker to obtain all the information of the first list, or to obtain all the information of the first list within a limited time (for example, within 10 minutes), thereby improving security. In an optional implementation, the content contained in the first list may not be limited to multiple parameters and multiple proof results. For example, it may also include the value of an address contained in a target address sequence that can be predicted based on multiple parameters and the target function, as follows. It will be introduced with reference to the embodiment and will not be described in detail here.
需要说明的是,图9所示的处理方式可以适用于对位于图2所示的代码段的目标数据进行证明计算。在上文中述及的(1)代码注入攻击场景中,通过结合图9所示的计算方式获得相应的第一证明结果并在验证节点完成验证、且验证结果指示第一证明结果可信,可以有效防止攻击者篡改代码段数据。It should be noted that the processing method shown in Figure 9 can be applied to perform proof calculations on the target data located in the code section shown in Figure 2. In the (1) code injection attack scenario mentioned above, by combining the calculation method shown in Figure 9 to obtain the corresponding first proof result and completing the verification at the verification node, and the verification result indicates that the first proof result is credible, you can Effectively prevent attackers from tampering with code segment data.
此外,在上文中述及的(2)关键数据篡改攻击场景中,攻击者可以通过修改程序的各个数据区段中的关键数据进行攻击,该关键数据例如可以包括文件的访问权限数据、机器的配置数据等。因此,待验证的目标数据不限于代码段数据,还可以包括位于图2所示的只读数据段的数据或通常数据段的数据,统称为数据段的目标数据。基于目标地址序列中的不同地址读取到的不同数据块可能对应不同类型、不同数据长度。比如,对于从代码段读取到的一些数据的长度不大于64字节。又例如,待验证的AI模型的数据长度在几十兆字节(megabytes,MB,1MB=1024KB)至几百兆字节之间。又例如,待验证的某些配置文件的长度约为10千字节(kbytes,KB,1KB=1024bite)。又例如,待验证的某些密码的长度约为128比特(bite)。而一些算法中会限制输入算法函数的最大数据长度。比如,某些哈希算法会限制在一次哈希构造函数(F)中输入的数据长度最大为64字节。In addition, in the (2) key data tampering attack scenario mentioned above, the attacker can attack by modifying key data in each data section of the program. The key data can include, for example, file access permission data, machine Configuration data, etc. Therefore, the target data to be verified is not limited to the code segment data, but may also include data located in the read-only data segment shown in Figure 2 or data in the general data segment, collectively referred to as target data of the data segment. Different data blocks read based on different addresses in the target address sequence may correspond to different types and different data lengths. For example, the length of some data read from the code segment is no more than 64 bytes. For another example, the data length of the AI model to be verified ranges from tens of megabytes (MB, 1MB = 1024KB) to hundreds of megabytes. For another example, the length of some configuration files to be verified is about 10 kilobytes (kbytes, KB, 1KB=1024bite). For another example, the length of some passwords to be verified is approximately 128 bits. In some algorithms, the maximum data length of the input algorithm function is limited. For example, some hash algorithms limit the length of data input in a hash constructor (F) to a maximum of 64 bytes.
在该(2)关键数据篡改攻击场景中,为保障证明计算过程的执行,一种可选的实现方式是,可以根据目标算法,对目标地址序列中的每个地址预设数据长度阈值,该数据长度阈值用于指示该地址对应的函数块中输入的最大数据长度。若根据目标地址序列中的地址的值读取目标数据包含的数据块时,可以在基于某个地址或某些地址(例如表示为第一地址,该第一地址的数量不限于一个)指向的数据块的长度超出该数据长度阈值时,对该数据块进行切分,然后基于不需要进行切分的数据块以及切分处理后得到的数据块构造串行计算结构,并进行计算。In this (2) key data tampering attack scenario, in order to ensure the execution of the proof calculation process, an optional implementation method is to preset a data length threshold for each address in the target address sequence according to the target algorithm. The data length threshold is used to indicate the maximum data length entered in the function block corresponding to the address. If the data block contained in the target data is read based on the value of the address in the target address sequence, it can be based on a certain address or certain addresses (for example, represented as a first address, and the number of the first addresses is not limited to one). When the length of the data block exceeds the data length threshold, the data block is segmented, and then a serial calculation structure is constructed based on the data blocks that do not need to be segmented and the data blocks obtained after segmentation processing, and calculation is performed.
如图11所示,以目标地址序列中包括三个地址(L=3)为例,该三个地址可以表示为A1,A2,A3。基于A1-A3读取到的数据块表示为V1,V2,V3。假设目标算法为哈希算法,且该哈希算法指定的数据长度阈值为64字节,A1,A2,A3对应的数据长度阈值均为64字节,V1、V2、V3的数据长度分别为60字节、70字节、90字节,那么V1的数据长度小于64字节,无需切分;V2的数据长度大于64字节、小于128字节,V2需要切分为两个数据块,例如表示为V2-1和V2-2。V3的数据长度大于64字节、小于128字节,V3需要拆分为两个数据块,例如表示为V3-1和V3-2。As shown in Figure 11, taking the target address sequence including three addresses (L=3) as an example, the three addresses can be represented as A1, A2, and A3. The data blocks read based on A1-A3 are represented as V1, V2, and V3. Assume that the target algorithm is a hash algorithm, and the data length threshold specified by the hash algorithm is 64 bytes. The data length thresholds corresponding to A1, A2, and A3 are all 64 bytes. The data lengths of V1, V2, and V3 are 60 bytes respectively. Bytes, 70 bytes, and 90 bytes, then the data length of V1 is less than 64 bytes and does not need to be divided; the data length of V2 is greater than 64 bytes and less than 128 bytes, so V2 needs to be divided into two data blocks, for example Represented as V2-1 and V2-2. The data length of V3 is greater than 64 bytes and less than 128 bytes. V3 needs to be split into two data blocks, for example, represented as V3-1 and V3-2.
按照该切分方法获取到的目标数据包括五个数据块,表示为V1、V2-1、V2-2、V3-1、V3-2。证明节点会基于与图9相似的过程,采用目标算法和第一顺序构造串行计算结构。具体例如:从IV开始,构造五个函数块,表示为F1,F2,F3,F4,F5。目标数据包含的数据块V1、V2-1、V2-2、V3-1、V3-2会按照第一顺序输入至F1-F5来进行计算,在最后计算完成(finalize)后,获得相应的第一证明结果。相似地,验证节点可以执行相同的计算步骤,根据图11所示的计算处理方式获得相应的第二证明结果,或者通过查表的方式获得该第二证明结果。The target data obtained according to this segmentation method includes five data blocks, represented as V1, V2-1, V2-2, V3-1, and V3-2. The proof node will construct a serial computing structure using the target algorithm and first order based on a process similar to Figure 9. Specific example: starting from IV, construct five function blocks, represented as F1, F2, F3, F4, F5. The data blocks V1, V2-1, V2-2, V3-1, and V3-2 contained in the target data will be input to F1-F5 in the first order for calculation. After the final calculation is completed (finalize), the corresponding first One proves the result. Similarly, the verification node can perform the same calculation steps to obtain the corresponding second proof result according to the calculation processing method shown in Figure 11, or obtain the second proof result through table lookup.
因此,上述通过结合图11所示的计算处理方式,在验证过程中增加了目标地址序列对应地址存储数据的数据长度,保证地址指向的数据块的所有数据都会被记入哈希值。该情形下,即使攻击者有机会修改数据长度信息,但只要攻击者没有时间修改数据内容,攻击 者就无法伪造出可信的证明结果。据此,在获得来自证明节点的第一证明结果并在验证节点完成验证、且验证结果指示第一证明结果可信时,可以有效防止攻击者篡改各个数据区段中静态存储的关键数据。Therefore, by combining the above calculation processing method shown in Figure 11, the data length of the address storage data corresponding to the target address sequence is increased during the verification process to ensure that all data in the data block pointed to by the address will be recorded in the hash value. In this case, even if the attacker has the opportunity to modify the data length information, as long as the attacker does not have time to modify the data content, the attacker cannot forge a credible proof result. Accordingly, when the first certification result from the certification node is obtained and the verification is completed at the verification node, and the verification result indicates that the first certification result is credible, attackers can be effectively prevented from tampering with key data statically stored in each data section.
需要说明的是,上述实施例中以哈希算法为例对数据长度阈值进行示例说明而非限定。在其它实施例中,例如可以根据数据类型预设相应的数据长度阈值,不同地址预设的数据长度阈值可以不同。该数据长度阈值可以为经验值,也可以根据所使用到的算法参数确定,本申请实施例对目标地址序列中的各个地址对应的数据长度阈值的确定方式不做限定。并且,对于每个地址指向的数据块的切分次数不限于一次,例如,图11中,若A3指向的数据块V3的数据长度为255字节,则需要按照数据长度阈值64字节,对该V3进行三次切分,得到四个数据子块,表示为V3-1、V3-2、V3-3、V3-4,从而,即可采用与图11相同的方法构造计算结构以及进行计算,结合V3-1、V3-2、V3-3、V3-4分别进行计算,直至获得相应的计算结构。It should be noted that in the above embodiment, the hash algorithm is used as an example to illustrate the data length threshold without limiting it. In other embodiments, for example, corresponding data length thresholds may be preset according to data types, and the preset data length thresholds for different addresses may be different. The data length threshold can be an empirical value or can be determined based on the algorithm parameters used. The embodiment of the present application does not limit the method of determining the data length threshold corresponding to each address in the target address sequence. Moreover, the number of splits for the data block pointed to by each address is not limited to once. For example, in Figure 11, if the data length of the data block V3 pointed to by A3 is 255 bytes, the data length threshold needs to be 64 bytes. This V3 is divided three times to obtain four data sub-blocks, represented as V3-1, V3-2, V3-3, and V3-4. Therefore, the same method as in Figure 11 can be used to construct the calculation structure and perform calculations. Combine V3-1, V3-2, V3-3, and V3-4 to perform calculations respectively until the corresponding calculation structure is obtained.
此外,在上文中述及的(3)代码指针/数据指针篡改攻击场景中,攻击者可以通过修改指向代码地址的代码指针或指向数据地址的数据指针进行攻击。因此,待验证的目标数据不限于上述代码段数据或静态存储的关键数据,还可能包括代码指针或数据指针。其中,代码指针与数据指针在数据区段中的存储区域包括两种:静态数据区和动态数据区。在静态数据区存储的指针地址固定,在动态数据区存储的指针地址不固定。本申请实施例可以对静态数据区中存储的指针(包括静态代码指针和静态数据指针)进行保护。In addition, in the (3) code pointer/data pointer tampering attack scenario mentioned above, the attacker can attack by modifying the code pointer pointing to the code address or the data pointer pointing to the data address. Therefore, the target data to be verified is not limited to the above code segment data or statically stored key data, but may also include code pointers or data pointers. Among them, the storage areas of code pointers and data pointers in the data section include two types: static data area and dynamic data area. The pointer address stored in the static data area is fixed, and the pointer address stored in the dynamic data area is not fixed. Embodiments of the present application can protect pointers (including static code pointers and static data pointers) stored in the static data area.
由于程序的代码地址与数据地址在程序运行过程中会被随机化,因此代码指针与数据指针的值也会相应地随机化。该随机化方法是:在CPU首次运行程序时,操作系统在加载程序时,会对程序运行的基地址(Base Address)进行随机化,随机生成一个基地址,程序运行后该基地址保持不变。代码地址/数据地址是该基地址加上代码/数据的原始值(物理空间地址)。该原始值是一个固定值,而随机生成的基地址在一次运行过程中保持不变,基地址在CPU每一次重新启动后发生改变。Since the code address and data address of the program will be randomized during the running of the program, the values of the code pointer and data pointer will also be randomized accordingly. The randomization method is: when the CPU runs the program for the first time, when the operating system loads the program, it will randomize the base address (Base Address) of the program and randomly generate a base address. The base address remains unchanged after the program is run. . The code address/data address is the base address plus the original value of the code/data (physical space address). The original value is a fixed value, while the randomly generated base address remains unchanged during a run, and the base address changes after each restart of the CPU.
上述S822中,目标函数生成的目标地址序列中,每个地址可能存储一个代码指针或数据指针,该代码指针或数据指针是基于随机化的基地址得到的,并非指向代码/数据的原始值。证明节点在基于该目标地址序列包含的地址的值读取目标数据包含的数据块之前,可以获取基地址,并基于该基地址和目标地址序列中存储在至少两个地址的值,计算指向目标数据的各个数据块的地址的原始值,该原始值用于读取目标数据的各个数据块。进而,证明节点(或验证节点)可以基于计算得到的原始值执行与图9或图11相似的计算过程,根据原始值读取目标数据和计算获得相应的证明结果。In the above S822, in the target address sequence generated by the target function, each address may store a code pointer or data pointer. The code pointer or data pointer is obtained based on the randomized base address and does not point to the original value of the code/data. Prove that the node can obtain the base address before reading the data block contained in the target data based on the value of the address contained in the target address sequence, and calculate the point to the target based on the base address and the value stored at at least two addresses in the target address sequence. The original value of the address of each data block of data, which is used to read each data block of the target data. Furthermore, the proof node (or verification node) can perform a calculation process similar to Figure 9 or Figure 11 based on the calculated original value, and read the target data and calculate based on the original value to obtain the corresponding proof result.
如图12所示,以目标地址序列中包括三个地址(L=3)为例,该三个地址可以表示为A1,A2,A3,A1-A3中存储的值是受到随机化的基地址影响的静态代码指针的值或静态数据指针的值,例如表示为CP1、DP3、DP1。证明节点可以获取基地址(例如表示为B),并基于目标地址序列包含的地址的值和该基地址确定指向待验证的目标数据的地址的原始值,例如使用目标地址序列包含的各个地址的值减去基地址,表示为CP1-B、DP3-B、DP1-B。进而,证明节点采用与图9或图11相似的方法构造串行计算结构,对基于这些原始值读取到的数据块进行串行计算,直至获得相应的证明结果。相似计算过程可参见上文中结合图9和图11的相关描述,在此不再赘述。As shown in Figure 12, taking the target address sequence including three addresses (L=3) as an example, the three addresses can be represented as A1, A2, A3. The values stored in A1-A3 are the base addresses subject to randomization. The value of the affected static code pointer or the value of the static data pointer, for example, is expressed as CP1, DP3, DP1. The proving node can obtain the base address (e.g. represented as B) and determine the original value of the address pointing to the target data to be verified based on the value of the address contained in the target address sequence and this base address, e.g. using the respective addresses contained in the target address sequence. The value minus the base address is expressed as CP1-B, DP3-B, DP1-B. Furthermore, the proof node uses a method similar to Figure 9 or Figure 11 to construct a serial calculation structure, and performs serial calculations on the data blocks read based on these original values until the corresponding proof result is obtained. For the similarity calculation process, please refer to the relevant descriptions above in conjunction with Figures 9 and 11, and will not be described again here.
另外,由于一个地址中可能存储多个指针的值:一个地址只能在一个时间点存储一个指针,但在不同时间点存储的指针可以不同。为了区分当前证明计算时的地址内容,一种可能的实现方式是,证明节点可以根据上述计算所使用到的原始值获取标记信息,证明节点还可以向验证节点提供该标记信息,以便验证节点验证目标数据的可信性。In addition, since the values of multiple pointers may be stored in one address: an address can only store one pointer at one point in time, but the pointers stored at different points in time can be different. In order to distinguish the address content during the current proof calculation, a possible implementation method is that the proof node can obtain the mark information based on the original value used in the above calculation, and the proof node can also provide the mark information to the verification node so that the verification node can verify Credibility of target data.
示例地,证明节点例如可以取原始值的末M位作为标记(Tag),M为大于或等于1的整数。本申请实施例中,例如可以选取原始值的最末位(least significant bit,LSB)。假设M=8,每个原始值对应的标记信息可以表示为LSB8。如图12所示,原始值CP1-B、DP3-B、DP1-B分别对应的标记1、标记2和标记3,可以表示为LSB8(CP1-B)、LSB8(DP3-B)、LSB8(DP1-B)。For example, the proving node may take the last M bits of the original value as a tag (Tag), where M is an integer greater than or equal to 1. In the embodiment of the present application, for example, the last significant bit (LSB) of the original value can be selected. Assuming M=8, the tag information corresponding to each original value can be expressed as LSB8. As shown in Figure 12, the original values CP1-B, DP3-B, and DP1-B correspond to mark 1, mark 2, and mark 3 respectively, which can be expressed as LSB8 (CP1-B), LSB8 (DP3-B), LSB8 ( DP1-B).
最终,证明节点需要将计算所得的第一证明结果与所检测的标记信息均发送给验证节点,由验证节点结合该第一证明结果和该标记信息,对目标数据进行可信性验证。Finally, the proof node needs to send both the calculated first proof result and the detected mark information to the verification node, and the verification node combines the first proof result and the mark information to verify the credibility of the target data.
其中,由于证明节点和验证节点侧采用相同的多个参数和伪随机数生成器函数,因此,通过预先进行程序分析,在验证节点侧可以预知证明节点侧随机生成的多个地址及其关联的原始指针值并保存。示例地,验证节点可以在HSM侧维护一个反查表,验证节点在收到来自证明节点的第一证明结果和标记信息后,可以根据每个标记信息,结合该反查表,反推出证明节点进行计算时所使用的原始值,并基于该原始值进行与证明节点侧相同的计算过程,获得期望的第二证明结果。从而,验证节点可以根据时间点3确定证明节点执行上述证明计算过程的总耗时是否符合预设的可信条件、以及判断第一证明结果和该第二证明结果是否相同。若总耗时在验证节点允许的时间范围内、且双方获得的证明结果相同,则表示证明节点侧的目标数据未被攻击者篡改,是可信的。若总耗时不在验证节点允许的时间范围内和/或双方获得的证明结果不相同,则表明证明节点侧的目标数据可能被非法篡改,是非可信的。应理解,该反查表可以属于前文述及的第一列表,也可以是独立于第一列表的第二列表,本申请实施例对此不做限定。Among them, since the proving node and the verification node use the same multiple parameters and pseudo-random number generator functions, by performing program analysis in advance, the verification node can predict the multiple addresses randomly generated by the proving node and their associated The original pointer value is saved. For example, the verification node can maintain a reverse lookup table on the HSM side. After receiving the first proof result and marking information from the proving node, the verification node can deduct the proof node based on each marking information and the reverse lookup table. The original value used in the calculation, and based on the original value, the same calculation process as that on the proof node side is performed to obtain the expected second proof result. Therefore, the verification node can determine according to time point 3 whether the total time taken by the certification node to perform the above-mentioned certification calculation process meets the preset credibility conditions, and determine whether the first certification result and the second certification result are the same. If the total elapsed time is within the time range allowed by the verification node and the proof results obtained by both parties are the same, it means that the target data on the proof node side has not been tampered with by the attacker and is credible. If the total time elapsed is not within the time range allowed by the verification node and/or the certification results obtained by both parties are different, it indicates that the target data on the certification node side may have been illegally tampered with and is not trustworthy. It should be understood that the lookup table may belong to the first list mentioned above, or may be a second list independent of the first list, which is not limited in the embodiments of the present application.
在图12所示的在证明节点侧实现的计算过程的基础上,如图13所示,在验证节点侧,预存的反查表中例如包括图12所示的三个地址(L=3)以及这三个地址关联的指针值。该三个地址可以表示为A1,A2,A3。每个地址可能存储多个代码指针或数据指针(未基于基地址随机化的原始指针),例如A1存储的CP1*、CP2*、CP3*、CP4*,表示为CP1*@A1、CP2*@A1、CP3*@A1、CP4*@A1;A2存储的DP1*、DP2*、DP3*,表示为DP1*@A2、DP2*@A2、DP3*@A2;A3存储的DP1*、DP2*、DP3*,表示为DP1*@A3、DP2*@A3、DP3*@A3。验证节点接收到来自证明节点的至少两个标记信息(例如标记1、标记2和标记3)后,可以通过该反查表反向推导出证明节点执行证明计算过程时使用到的与A1,A2,A3关联的原始指针值,例如CP1*、DP3*、DP1*。然后,验证节点可以根据该原始指针值,执行与证明节点侧相同的计算步骤,来基于该原始指针读取到的镜像数据的数据块进行哈希计算,直至得到相应的第二证明结果,验证节点可以将该第二证明结果,与来自证明节点的第一证明结果进行比对,验证该证明节点侧的目标数据的可信性。Based on the calculation process implemented on the proving node side shown in Figure 12, as shown in Figure 13, on the verification node side, the pre-stored lookup table includes, for example, the three addresses (L=3) shown in Figure 12 And the pointer values associated with these three addresses. The three addresses can be represented as A1, A2, A3. Each address may store multiple code pointers or data pointers (raw pointers not randomized based on the base address), such as CP1*, CP2*, CP3*, CP4* stored in A1, expressed as CP1*@A1, CP2*@ A1, CP3*@A1, CP4*@A1; DP1*, DP2*, DP3* stored in A2, expressed as DP1*@A2, DP2*@A2, DP3*@A2; DP1*, DP2*, stored in A3 DP3*, expressed as DP1*@A3, DP2*@A3, DP3*@A3. After the verification node receives at least two mark information (such as mark 1, mark 2 and mark 3) from the proof node, it can reversely deduce the values of A1 and A2 used by the proof node when performing the proof calculation process through the inverse lookup table. , the original pointer value associated with A3, such as CP1*, DP3*, DP1*. Then, the verification node can perform the same calculation steps as the certification node side based on the original pointer value to perform hash calculation based on the data block of the mirror data read by the original pointer until the corresponding second certification result is obtained. Verification The node can compare the second certification result with the first certification result from the certification node to verify the credibility of the target data on the certification node side.
需要说明的是,理论上来说,在目标数据未被攻击者篡改的情况下,CP1*=CP1-B、DP3*=DP3-B、DP1*=DP1-B,在验证节点侧基于CP1*、DP3*、DP1*进行计算后,获得的第二证明结果与来自证明节点的第一证明结果是相同的,表示目标数据是可信的。在目标数据被攻击者篡改的情况下,上述等式可能不成立,例如CP1*=CP1-B、DP3*=DP3-B、DP1*=DP1-B中的至少一个等式不成立,由此验证节点侧基于CP1*、DP3*、DP1*进行计 算时,最终获得的第二证明结果将与来自证明节点的第一证明结果不相同,表示目标数据不可信。It should be noted that, theoretically, when the target data has not been tampered with by the attacker, CP1*=CP1-B, DP3*=DP3-B, DP1*=DP1-B. On the verification node side, based on CP1*, After DP3* and DP1* are calculated, the second proof result obtained is the same as the first proof result from the proof node, indicating that the target data is credible. In the case where the target data is tampered with by the attacker, the above equation may not hold. For example, at least one of the equations CP1*=CP1-B, DP3*=DP3-B, DP1*=DP1-B does not hold, so the verification node When calculating based on CP1*, DP3*, and DP1*, the second proof result finally obtained will be different from the first proof result from the proof node, indicating that the target data is not trustworthy.
至此,已经根据上述结合图8至图13,介绍了本申请实施例适用的双核系统架构,以及在该系统架构下实现的验证方法的详细实现过程。通过上述验证架构和验证方法,可以利用双核系统的实时性特征,通过结合来自证明节点的计算结果以及其它检查维度信息(例如执行时间信息),验证证明节点的待验证的目标数据的可信性,来验证证明节点所属的第一装置的可信状态,确保第一装置的安全性。同时,该方案还可以通过对第一装置的关键程序或证明程序运行的代码段、配置数据(文件)、静态代码指针、静态数据指针随机抽取,并使用不同的方法进行验证,可以多方面地保护目标数据,有效防止攻击。另一方面,该方案中,可以利用双核特性进行任务调度,使得证明程序的运行不会抢占关键程序使用的CPU核心,以保障高实时性业务的运行需求,以及极大地减少CPU核心和HSM核心之间的通信量,从降低验证过程对第一装置的性能的影响。So far, the dual-core system architecture applicable to the embodiments of the present application has been introduced based on the above in conjunction with Figures 8 to 13, as well as the detailed implementation process of the verification method implemented under this system architecture. Through the above verification architecture and verification method, the real-time characteristics of the dual-core system can be utilized to verify the credibility of the target data to be verified by the proof node by combining the calculation results from the proof node and other check dimension information (such as execution time information) , to verify the trusted status of the first device to which the proof node belongs, to ensure the security of the first device. At the same time, this solution can also randomly extract the code segments, configuration data (files), static code pointers, and static data pointers of the first device's key programs or proof program operations, and use different methods for verification, which can be used in many aspects. Protect target data and effectively prevent attacks. On the other hand, in this solution, the dual-core feature can be used for task scheduling, so that the running of the proof program will not seize the CPU cores used by key programs to ensure the operation requirements of high-real-time services and greatly reduce the number of CPU cores and HSM cores. The amount of communication between them reduces the impact of the verification process on the performance of the first device.
可以理解的是,本申请实施例在上述结合图8至图13介绍的验证方案,同样适用于多核系统(例如包括三个或三个以上CPU核心),如图14所示,包括CPU核心1、CPU核心2、CPU核心3和CPU核心4。其中,与双核系统的不同之处在于,在多核系统中,攻击者还可能利用多核并发特性进行加速计算,本申请实施例中,在多核系统中,挑战节点可以根据证明节点所属的第一装置(例如ECU CPU)的CPU核心的总数量、分配给关键任务的CPU核心的数量,调整与证明节点或验证节点交互的目标参数的数量、以及生成的目标地址序列的数量等,以在当前未被关键任务占用的至少一个CPU核心上,尽量充分地运行证明程序并验证目标数据可信性,以补偿多核并发漏洞。It can be understood that the verification scheme introduced above in conjunction with Figures 8 to 13 in the embodiment of the present application is also applicable to a multi-core system (for example, including three or more CPU cores). As shown in Figure 14, including CPU core 1 , CPU core 2, CPU core 3 and CPU core 4. The difference from the dual-core system is that in the multi-core system, the attacker may also use the multi-core concurrency characteristics to accelerate calculations. In the embodiment of the present application, in the multi-core system, the challenge node can be based on the first device that proves the node belongs. The total number of CPU cores (such as ECU CPU), the number of CPU cores allocated to key tasks, the number of target parameters that are adjusted to interact with the proof node or verification node, and the number of generated target address sequences, etc. On at least one CPU core occupied by critical tasks, try to fully run the proof program and verify the credibility of the target data to compensate for multi-core concurrency vulnerabilities.
比如,以n表示第一装置的CPU核心的数量,n为大于或等于3的整数。假设第一装置的任务调度器将k个CPU核心分配给执行关键任务的关键程序,k为大于或等于1的整数。那么,在S810中,在时间点1,挑战节点向证明节点和验证节点发起挑战时,可以发送n-k个随机数作为目标参数。在S821中,RTOS1通过任务调度器,可以为n-k个证明节点分配n-k个目标CPU核心。在S822中,目标函数可以根据n-k个目标参数,生成n-k个目标地址序列,证明节点可以根据n-k个目标地址序列计算得到n-k个证明结果,该n-k个证明结果关联n-k个时间点。在S830中,证明节点向验证节点所属的第二装置发送n-k个证明结果,由验证节点根据该n-k个证明结果以及n-k个时间点,验证证明节点所属的第一装置的目标数据的可信性。详细实现细节与上述双核系统的实现相同,可参见上文结合图8-图13的相关描述,在此不再赘述。For example, n represents the number of CPU cores of the first device, and n is an integer greater than or equal to 3. It is assumed that the task scheduler of the first device allocates k CPU cores to key programs that perform key tasks, and k is an integer greater than or equal to 1. Then, in S810, at time point 1, when the challenge node issues a challenge to the proving node and the verification node, it can send n-k random numbers as target parameters. In S821, RTOS1 can allocate n-k target CPU cores to n-k proof nodes through the task scheduler. In S822, the target function can generate n-k target address sequences based on n-k target parameters, and the certification node can calculate n-k certification results based on the n-k target address sequences. The n-k certification results are associated with n-k time points. In S830, the certification node sends n-k certification results to the second device to which the verification node belongs, and the verification node verifies the credibility of the target data of the first device to which the certification node belongs based on the n-k certification results and n-k time points. . The detailed implementation details are the same as the implementation of the above-mentioned dual-core system. Please refer to the relevant descriptions above in conjunction with Figures 8 to 13, and will not be described again here.
本申请实施例还提供了一种验证方法,该验证方法可由上述证明节点和验证节点协同实现,如图15所示,该验证方法可以包括以下步骤:The embodiment of this application also provides a verification method, which can be implemented collaboratively by the above-mentioned certification node and verification node. As shown in Figure 15, the verification method can include the following steps:
S1510:证明节点获取目标地址序列,其中,所述目标地址序列指向待验证的目标数据。S1510: The certification node obtains a target address sequence, where the target address sequence points to the target data to be verified.
S1520:证明节点根据所述目标数据得到第一证明结果。S1520: The certification node obtains the first certification result based on the target data.
S1530:证明节点向验证节点提供所述第一证明结果,其中,所述第一证明结果关联第一时刻,所述第一证明结果和所述第一时刻用于所述目标数据的可信性验证。S1530: The certification node provides the first certification result to the verification node, wherein the first certification result is associated with a first time, and the first certification result and the first time are used for the credibility of the target data. verify.
S1540:所述验证节点根据目标参数、所述第一证明结果和所述第一时刻,验证所述目标数据的可信性。S1540: The verification node verifies the credibility of the target data based on the target parameters, the first certification result and the first time.
其中,该证明节点可以运行于至少一个第一资源单元上,所述至少一个第一资源单元为所述证明节点所属第一装置包括的资源单元,所述资源单元至少用于运行程序。该所述至少一个第一资源单元运行除所述第一装置的关键程序之外的程序,所述关键程序至少包括执行安全任务的程序和/或执行调度任务的程序。Wherein, the certification node can run on at least one first resource unit, the at least one first resource unit is a resource unit included in the first device to which the certification node belongs, and the resource unit is at least used to run a program. The at least one first resource unit runs programs other than key programs of the first device, where the key programs at least include programs that perform security tasks and/or programs that perform scheduling tasks.
实施上述S1510时,一种可选的实现方式中,证明节点可以获取目标参数,并根据该目标参数和目标函数生成所述目标地址序列,该证明节点可以是从挑战节点或者所述证明节点所属第一装置的实时操作系统RTOS获取该目标参数,该挑战节点为触发验证所述目标数据的可信性的节点。所述目标参数包括随机数,所述目标函数包括伪随机生成函数。另一种可选的实现方式中,证明节点可以从所述证明节点所属第一装置的RTOS获取所述目标地址序列,该目标地址序列是所述RTOS根据目标参数和目标函数生成的。所述目标参数包括随机数,所述目标函数包括伪随机生成函数。详细实现过程可参见上文结合图8-图13的相关描述,在此不再赘述。When implementing the above S1510, in an optional implementation manner, the proving node can obtain the target parameters and generate the target address sequence according to the target parameters and the target function. The proving node can be from the challenge node or the proving node to which the proving node belongs. The real-time operating system RTOS of the first device acquires the target parameter, and the challenge node is a node that triggers verification of the credibility of the target data. The target parameters include random numbers, and the target function includes a pseudo-random generation function. In another optional implementation, the proving node may obtain the target address sequence from the RTOS of the first device to which the proving node belongs, and the target address sequence is generated by the RTOS based on the target parameters and the target function. The target parameters include random numbers, and the target function includes a pseudo-random generation function. For the detailed implementation process, please refer to the relevant descriptions above in conjunction with Figures 8-13, and will not be described again here.
该目标地址序列包括至少两个地址,所述至少两个地址指向所述目标数据的不同包含的至少两个数据块,实施S1520时,证明节点可以采用目标算法,按照第一顺序对所述目标数据的不同包含的至少两个数据块进行计算,得到所述第一证明结果。其中,在进行计算时,一方面,证明节点还可以在所述至少两个地址中的第一地址指向的数据块的长度大于数据长度阈值时,对所述第一地址指向的数据块进行切分,然后,证明节点即可不需要进行切分的数据块以及切分处理后得到的数据块得到所述第一证明结果。另一方面,证明节点还可以获取基地址,并根据所述基地址和所述目标地址序列中的至少两个地址的值,计算指向所述目标数据的地址的原始值,所述原始值用于读取所述目标数据。详细实现过程可参见上文结合图8-图13的相关描述,在此不再赘述。需要说明的是,本申请实施例中,在目标地址序列中存在第一地址的情况下,第一地址的数量不限于一个。The target address sequence includes at least two addresses, and the at least two addresses point to at least two data blocks contained in different parts of the target data. When implementing S1520, the proving node can use the target algorithm to process the target in the first order. Calculation is performed on at least two data blocks containing different data to obtain the first proof result. When performing calculations, on the one hand, the proving node can also cut the data block pointed to by the first address among the at least two addresses when the length of the data block pointed to by the first address is greater than the data length threshold. Then, the certification node can obtain the first certification result using the data blocks that do not need to be segmented and the data blocks obtained after the segmentation process. On the other hand, the proving node can also obtain the base address, and calculate the original value of the address pointing to the target data based on the base address and the value of at least two addresses in the target address sequence, where the original value is to read the target data. For the detailed implementation process, please refer to the relevant descriptions above in conjunction with Figures 8-13, and will not be described again here. It should be noted that in the embodiment of the present application, when there is a first address in the target address sequence, the number of first addresses is not limited to one.
在实施1540之前,验证节点可以从挑战节点或者所述验证节点所属第二装置的RTOS获取所述目标参数,该挑战节点为触发验证所述目标数据的可信性的节点。Before performing step 1540, the verification node may obtain the target parameter from a challenge node or an RTOS of the second device to which the verification node belongs, and the challenge node is a node that triggers verification of the credibility of the target data.
在实施1540时,在一个示例中,验证节点可以采用与证明节点侧相同的计算方法,根据目标参数获取第二证明结果,并根据该第二证明结果、来自证明节点的第一证明结果以及第一证明结果关联的第一时刻,验证目标数据的可信性。其中,验证节点根据所述目标参数获取第二证明结果可以包括:验证节点可以根据所述目标参数获取目标地址序列,其中,所述目标地址序列指向所述目标数据的镜像数据;所述验证节点根据所述镜像数据得到所述第二证明结果。验证节点根据所述目标参数获取目标地址序列可以包括:验证节点根据所述目标参数和目标函数生成所述目标地址序列;或者,验证节点根据所述目标参数,从所述验证节点所属第二装置的RTOS获取所述目标地址序列,其中,所述目标地址序列是所述RTOS根据目标参数和目标函数生成的。所述目标函数包括伪随机生成函数。所述目标地址序列包括至少两个地址,所述至少两个地址指向所述镜像数据包含的至少两个数据块,所述验证节点根据所述镜像数据得到所述第二证明结果可以包括:所述验证节点采用目标算法,按照第一顺序对所述镜像数据包含的至少两个数据块进行计算,得到所述第二证明结果。可选的实施方式中,所述至少两个地址指向所述镜像数据包含的至少两个数据块,可以包括:在所述至少两个地址中的第一地址指向的数据块的长度大于数据长度阈值时,对所述第一地址指向的数据块进行切分。详细实现过程可参见上文结合图8-图13的相关描述,在此不再赘述。When implementing 1540, in one example, the verification node can adopt the same calculation method as the proving node side, obtain the second proof result according to the target parameters, and obtain the second proof result according to the second proof result, the first proof result from the proof node and the third proof result. The first moment to prove the correlation of results and verify the credibility of the target data. Wherein, the verification node obtaining the second certification result according to the target parameter may include: the verification node may obtain a target address sequence according to the target parameter, wherein the target address sequence points to the mirror data of the target data; the verification node The second proof result is obtained based on the mirror data. The verification node obtaining the target address sequence according to the target parameter may include: the verification node generates the target address sequence according to the target parameter and the target function; or, the verification node obtains the target address sequence from the second device to which the verification node belongs based on the target parameter. The RTOS obtains the target address sequence, wherein the target address sequence is generated by the RTOS according to the target parameters and the target function. The objective function includes a pseudo-random generation function. The target address sequence includes at least two addresses, and the at least two addresses point to at least two data blocks contained in the mirror data. The verification node obtaining the second certification result based on the mirror data may include: The verification node uses a target algorithm to calculate at least two data blocks contained in the mirror data in a first order to obtain the second certification result. In an optional implementation, the at least two addresses point to at least two data blocks contained in the mirror data, which may include: the length of the data block pointed to by the first address among the at least two addresses is greater than the data length. When the threshold is reached, the data block pointed to by the first address is segmented. For the detailed implementation process, please refer to the relevant descriptions above in conjunction with Figures 8-13, and will not be described again here.
在实施1540时,在另一个示例中,验证节点根据所述目标参数获取第二证明结果可以包括:验证节点以所述目标参数作为索引,从第一列表获取所述第二证明结果,其中,所述第一列表包括多个参数以及每个参数关联的证明结果,所述多个参数包括所述目标参数。可选的实施方式中,验证节点可以获取来自证明节点的标记信息;所述验证节点以所述目标参数作为索引,从第一列表获取所述第二证明结果,包括:所述验证节点以所述目标参数和所述标记信息作为索引,从所述第一列表获取所述第二证明结果。详细实现过程可参见上文结合图8-图13的相关描述,在此不再赘述。When implementing 1540, in another example, the verification node obtains the second certification result according to the target parameter may include: the verification node uses the target parameter as an index to obtain the second certification result from the first list, wherein, The first list includes a plurality of parameters and a certification result associated with each parameter, and the plurality of parameters includes the target parameter. In an optional implementation, the verification node can obtain the tag information from the certification node; the verification node uses the target parameter as an index to obtain the second certification result from the first list, including: the verification node uses the Using the target parameters and the tag information as indexes, the second proof result is obtained from the first list. For the detailed implementation process, please refer to the relevant descriptions above in conjunction with Figures 8-13, and will not be described again here.
需要说明的是,在本申请实施例中,证明节点所属的第一装置与所述验证节点所属的第二装置位于同一系统级芯片SoC,其中,所述第一装置位于所述SoC的非可信硬件,所述第二装置位于所述SoC的可信硬件;或者,所述第一装置和所述第二装置为不同装置,其中,所述第一装置为非可信装置,所述第二装置为可信装置。一个可选的示例中,该第二装置还可以包括挑战节点,所述挑战节点为触发验证所述目标数据的可信性的节点;或者,所述第二装置和所述挑战节点所属的第三装置为不同装置,所述第三装置和所述第一装置为不同装置。S1540中,验证节点根据所述目标参数、所述第一证明结果和所述第一时刻,验证所述目标数据的可信性,可以包括:所述验证节点根据所述目标参数、所述第一证明结果和所述第一时刻,确定所述目标数据是否满足预设的可信条件,以验证所述目标数据的可信性;其中,所述可信条件包括:所述第一证明结果与所述验证节点根据所述目标参数获得的第二证明结果相同,以及所述第一时刻关联的第一时间区间在所述验证节点允许的时间范围内。详细实现过程可参见上文结合图8-图13的相关描述,在此不再赘述。It should be noted that in this embodiment of the present application, the first device to which the certification node belongs and the second device to which the verification node belongs are located in the same system-on-chip SoC, where the first device is located in a non-accessible part of the SoC. Trust hardware, the second device is located in the trusted hardware of the SoC; or, the first device and the second device are different devices, wherein the first device is an untrusted device, and the third device The second device is a trusted device. In an optional example, the second device may further include a challenge node, which is a node that triggers verification of the credibility of the target data; or, the second device and the challenge node belong to the third node. The three devices are different devices, and the third device and the first device are different devices. In S1540, the verification node verifies the credibility of the target data according to the target parameter, the first certification result and the first moment, which may include: the verification node verifies the credibility of the target data according to the target parameter, the first certification result and the first moment. A certification result and the first moment, determining whether the target data satisfies preset credibility conditions to verify the credibility of the target data; wherein the credibility conditions include: the first certification result It is the same as the second proof result obtained by the verification node according to the target parameter, and the first time interval associated with the first moment is within the time range allowed by the verification node. For the detailed implementation process, please refer to the relevant descriptions above in conjunction with Figures 8-13, and will not be described again here.
本申请实施例还提供了一种通信装置,用于执行上述方法实施例中证明节点或验证节点所执行的方法,相关特征可参见上述方法实施例,在此不再赘述。The embodiment of the present application also provides a communication device for executing the method performed by the certification node or the verification node in the above method embodiment. Relevant features can be found in the above method embodiment and will not be described again here.
如图16所示,在一个示例中,该装置1600可以对应证明节点,该装置1600可以包括:获取单元1601,用于获取目标地址序列,所述目标地址序列指向待验证的目标数据;处理单元1602,用于根据所述目标数据得到证明结果;收发单元1603,用于向验证节点提供所述证明结果,其中,所述证明结果关联第一时刻,所述证明结果和所述第一时刻用于所述目标数据的可信性验证。具体实现方式,请参考图1至图15所示实施例中的详细描述,这里不再赘述。As shown in Figure 16, in one example, the device 1600 may correspond to a certification node, and the device 1600 may include: an acquisition unit 1601, used to acquire a target address sequence that points to the target data to be verified; a processing unit 1602, used to obtain the proof result according to the target data; the transceiver unit 1603, used to provide the proof result to the verification node, wherein the proof result is associated with the first time, and the proof result and the first time are used Verification of the credibility of the target data. For specific implementation methods, please refer to the detailed descriptions in the embodiments shown in Figures 1 to 15, which will not be described again here.
如图17所示,在另一个示例中,该装置1700可以对应验证节点,该装置1700可以包括:获取单元1701,用于获取目标参数和获取来自证明节点的第一证明结果,所述目标参数包括随机数,所述第一证明结果为证明节点根据待验证的目标数据得到的,所述第一证明结果关联第一时刻;确定单元1702,用于根据所述目标参数、所述第一证明结果和所述第一时刻,验证所述目标数据的可信性。具体实现方式,请参考图1至图15所示实施例中的详细描述,这里不再赘述。As shown in Figure 17, in another example, the device 1700 may correspond to a verification node, and the device 1700 may include: an acquisition unit 1701, configured to obtain a target parameter and obtain the first certification result from the certification node, the target parameter Including random numbers, the first proof result is obtained by the proof node based on the target data to be verified, and the first proof result is associated with the first moment; the determination unit 1702 is used to determine the first proof result based on the target parameters, the first proof As a result and the first moment, the credibility of the target data is verified. For specific implementation methods, please refer to the detailed descriptions in the embodiments shown in Figures 1 to 15, which will not be described again here.
需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。在本申请的实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. In actual implementation, there may be other division methods. Each functional unit in the embodiment of the present application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可 以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,read-only memory)、随机存取存储器(RAM,random access memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions. It is used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), magnetic disk or optical disk and other media that can store program code. .
在一种可能的实现方式中,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有程序代码,当所述程序代码在所述计算机上运行时,使得计算机执行上述方法实施例。In a possible implementation manner, embodiments of the present application provide a computer-readable storage medium. The computer-readable storage medium stores program code. When the program code is run on the computer, the computer Execute the above method embodiment.
在一种可能的实现方式中,本申请实施例提供了一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行上述方法实施例。In a possible implementation manner, the embodiment of the present application provides a computer program product, which when the computer program product is run on a computer, causes the computer to execute the above method embodiment.
在一个简单的实施例中,本领域的技术人员可以想到上述实施例中的通信装置均可采用图18所示的形式。In a simple embodiment, those skilled in the art can imagine that the communication devices in the above embodiments can adopt the form shown in FIG. 18 .
如图18所示的装置1800,包括至少一个处理器1810和通信接口1830。在一种可选的设计中,还可以包括存储器1820。The device 1800 shown in Figure 18 includes at least one processor 1810 and a communication interface 1830. In an optional design, memory 1820 may also be included.
本申请实施例中不限定上述处理器1810以及存储器1820之间的具体连接介质。The specific connection medium between the processor 1810 and the memory 1820 is not limited in the embodiment of the present application.
在如图18的装置中,处理器1810在与其他设备进行通信时,可以通过通信接口1830进行数据传输。In the device as shown in Figure 18, when communicating with other devices, the processor 1810 can transmit data through the communication interface 1830.
当通信装置采用图18所示的形式时,图18中的处理器1810可以通过调用存储器1820中存储的计算机执行指令,使得装置1800可以执行上述任一方法实施例。When the communication device adopts the form shown in Figure 18, the processor 1810 in Figure 18 can call the computer execution instructions stored in the memory 1820, so that the device 1800 can execute any of the above method embodiments.
本申请实施例还涉及一种芯片系统,该芯片系统包括处理器,用于调用存储器中存储的计算机程序或计算机指令,以使得该处理器执行上述任一实施例的方法。Embodiments of the present application also relate to a chip system, which includes a processor for calling a computer program or computer instructions stored in a memory, so that the processor executes the method of any of the above embodiments.
在一种可能的实现方式中,该处理器可以通过接口与存储器耦合。In one possible implementation, the processor may be coupled to the memory through an interface.
在一种可能的实现方式中,该芯片系统还可以直接包括存储器,该存储器中存储有计算机程序或计算机指令。In a possible implementation, the chip system may also directly include a memory, in which computer programs or computer instructions are stored.
示例地,存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。By way of example, the memory may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Among them, non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically removable memory. Erase electrically programmable read-only memory (EPROM, EEPROM) or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of illustration, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synchlink DRAM, SLDRAM) ) and direct memory bus random access memory (direct rambus RAM, DR RAM).
本申请实施例还涉及一种处理器,该处理器用于调用存储器中存储的计算机程序或计算机指令,以使得该处理器执行上述任一实施例所述的方法。Embodiments of the present application also relate to a processor, which is configured to call a computer program or computer instructions stored in a memory, so that the processor executes the method described in any of the above embodiments.
示例地,在本申请实施例中,处理器是一种集成电路芯片,具有信号的处理能力。例 如,该处理器可以是现场可编程门阵列(field programmable gate array,FPGA),可以是通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,还可以是系统芯片(system on chip,SoC),还可以是中央处理器(central processor unit,CPU),还可以是网络处理器(network processor,NP),还可以是微控制器(micro controller unit,MCU),还可以是可编程控制器(programmable logic device,PLD)或其他集成芯片,可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。For example, in the embodiment of the present application, the processor is an integrated circuit chip that has signal processing capabilities. For example, the processor can be a field programmable gate array (FPGA), a general-purpose processor, a digital signal processor (DSP), or an application specific integrated circuit (ASIC). Or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, system on chip (SoC), central processor unit (CPU), or network processing It can also be a network processor (NP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips, which can implement or execute the embodiments of the present application. The disclosed methods, steps and logical block diagrams. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly implemented by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。It should be understood that embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions The device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device. Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.
显然,本领域的技术人员可以对本申请实施例进行各种改动和变型而不脱离本申请实施例范围。这样,倘若本申请实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the scope of the embodiments of the present application. In this way, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of this application and equivalent technologies, then this application is also intended to include these modifications and variations.

Claims (30)

  1. 一种验证方法,其特征在于,包括:A verification method, characterized by including:
    证明节点获取目标地址序列,其中,所述目标地址序列指向待验证的目标数据;The proving node obtains a target address sequence, wherein the target address sequence points to the target data to be verified;
    所述证明节点根据所述目标数据得到证明结果;The certification node obtains the certification result based on the target data;
    所述证明节点向验证节点提供所述证明结果,其中,所述证明结果关联第一时刻,所述证明结果和所述第一时刻用于所述目标数据的可信性验证。The certification node provides the certification result to the verification node, wherein the certification result is associated with a first time, and the certification result and the first time are used for credibility verification of the target data.
  2. 根据权利要求1所述的方法,其特征在于,所述证明节点获取目标地址序列,包括:The method according to claim 1, characterized in that the certification node obtains the target address sequence, including:
    所述证明节点获取目标参数;The proof node obtains the target parameters;
    所述证明节点根据所述目标参数和目标函数生成所述目标地址序列;The certification node generates the target address sequence according to the target parameters and the target function;
    其中,所述目标参数包括随机数,所述目标函数包括伪随机生成函数。Wherein, the target parameters include random numbers, and the target function includes a pseudo-random generation function.
  3. 根据权利要求2所述的方法,其特征在于,所述证明节点获取目标参数,包括:The method according to claim 2, characterized in that the certification node obtains target parameters, including:
    所述证明节点从挑战节点或者所述证明节点所属第一装置的实时操作系统RTOS获取所述目标参数,其中,所述挑战节点为触发验证所述目标数据的可信性的节点。The certification node obtains the target parameter from a challenge node or a real-time operating system RTOS of the first device to which the certification node belongs, where the challenge node is a node that triggers verification of the credibility of the target data.
  4. 根据权利要求1所述的方法,其特征在于,所述证明节点获取目标地址序列,包括:The method according to claim 1, characterized in that the certification node obtains the target address sequence, including:
    所述证明节点从所述证明节点所属第一装置的RTOS获取所述目标地址序列,其中,所述目标地址序列是所述RTOS根据目标参数和目标函数生成的。The certification node obtains the target address sequence from the RTOS of the first device to which the certification node belongs, where the target address sequence is generated by the RTOS according to the target parameters and the target function.
  5. 根据权利要求1-4中任一项所述的方法,其特征在于,所述证明节点运行于至少一个第一资源单元上,所述至少一个第一资源单元为所述证明节点所属第一装置包括的资源单元,所述资源单元至少用于运行程序。The method according to any one of claims 1 to 4, characterized in that the certification node runs on at least one first resource unit, and the at least one first resource unit is the first device to which the certification node belongs. Includes resource units, which are at least used to run programs.
  6. 根据权利要求5所述的方法,其特征在于,The method according to claim 5, characterized in that:
    所述至少一个第一资源单元运行除所述第一装置的关键程序之外的程序,所述关键程序至少包括执行安全任务的程序和/或执行调度任务的程序。The at least one first resource unit runs programs other than key programs of the first device, where the key programs at least include programs that perform security tasks and/or programs that perform scheduling tasks.
  7. 根据权利要求1-6中任一项所述的方法,其特征在于,所述目标地址序列包括至少两个地址,所述至少两个地址指向所述目标数据包含的至少两个数据块,所述证明节点根据所述目标数据得到证明结果,包括:The method according to any one of claims 1 to 6, characterized in that the target address sequence includes at least two addresses, and the at least two addresses point to at least two data blocks contained in the target data, so The proof node obtains proof results based on the target data, including:
    所述证明节点采用目标算法,按照第一顺序对所述目标数据包含的至少两个数据块进行计算,得到所述证明结果。The certification node uses a target algorithm to calculate at least two data blocks contained in the target data in a first order to obtain the certification result.
  8. 根据权利要求1-6中任一项所述的方法,其特征在于,所述目标地址序列包括至少两个地址,所述至少两个地址指向所述目标数据包含的至少两个数据块,还包括:The method according to any one of claims 1 to 6, characterized in that the target address sequence includes at least two addresses, the at least two addresses point to at least two data blocks contained in the target data, and further include:
    在所述至少两个地址中的第一地址指向的数据块的长度大于数据长度阈值时,对所述第一地址指向的数据块进行切分。When the length of the data block pointed to by the first address among the at least two addresses is greater than the data length threshold, the data block pointed to by the first address is segmented.
  9. 根据权利要求1-8中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-8, characterized in that the method further includes:
    所述证明节点获取基地址;The proving node obtains the base address;
    所述证明节点根据所述基地址和所述目标地址序列中的至少两个地址的值,计算指向所述目标数据的地址的原始值,所述原始值用于读取所述目标数据。The certification node calculates an original value of an address pointing to the target data based on the base address and the values of at least two addresses in the target address sequence, and the original value is used to read the target data.
  10. 根据权利要求1-9中任一项所述的方法,其特征在于,The method according to any one of claims 1-9, characterized in that,
    所述证明节点所属的第一装置与所述验证节点所属的第二装置位于同一系统级芯片SoC,其中,所述第一装置位于所述SoC的非可信硬件,所述第二装置位于所述SoC的可信硬件;或者,The first device to which the certification node belongs and the second device to which the verification node belongs are located in the same system-on-chip SoC, wherein the first device is located in the untrusted hardware of the SoC, and the second device is located in the SoC. Trusted hardware for the SoC; or,
    所述证明节点所属的第一装置与所述验证节点所属的第二装置位于不同装置,其中,所述第一装置为非可信装置,所述第二装置为可信装置。The first device to which the certification node belongs and the second device to which the verification node belongs are located in different devices, wherein the first device is an untrusted device and the second device is a trusted device.
  11. 根据权利要求1-10中任一项所述的方法,其特征在于,在所述目标数据满足预设的可信条件时,所述目标数据的可信性验证通过;其中,所述可信条件包括:所述证明节点提供的证明结果与所述验证节点根据目标参数获得的证明结果相同,以及所述第一时刻关联的第一时间区间在所述验证节点允许的时间范围内。The method according to any one of claims 1 to 10, characterized in that when the target data satisfies preset trust conditions, the trustworthiness verification of the target data passes; wherein the trustworthiness The conditions include: the certification result provided by the certification node is the same as the certification result obtained by the verification node according to the target parameters, and the first time interval associated with the first moment is within the time range allowed by the verification node.
  12. 一种验证方法,其特征在于,包括:A verification method, characterized by including:
    验证节点获取目标参数,所述目标参数包括随机数;The verification node obtains target parameters, where the target parameters include random numbers;
    所述验证节点获取来自证明节点的第一证明结果,其中,所述第一证明结果为所述证明节点根据待验证的目标数据得到的,所述第一证明结果关联第一时刻;The verification node obtains the first certification result from the certification node, wherein the first certification result is obtained by the certification node based on the target data to be verified, and the first certification result is associated with the first moment;
    所述验证节点根据所述目标参数、所述第一证明结果和所述第一时刻,验证所述目标数据的可信性。The verification node verifies the credibility of the target data based on the target parameter, the first certification result and the first moment.
  13. 根据权利要求12所述的方法,其特征在于,所述验证节点获取目标参数,包括:The method according to claim 12, characterized in that the verification node obtains target parameters, including:
    所述验证节点从挑战节点或者所述验证节点所属第二装置的RTOS获取所述目标参数,其中,所述挑战节点为触发验证所述目标数据的可信性的节点。The verification node obtains the target parameters from a challenge node or an RTOS of the second device to which the verification node belongs, where the challenge node is a node that triggers verification of the credibility of the target data.
  14. 根据权利要求12或13所述的方法,其特征在于,所述验证节点根据所述目标参数、所述第一证明结果和所述第一时刻,验证所述目标数据的可信性,包括:The method according to claim 12 or 13, characterized in that the verification node verifies the credibility of the target data based on the target parameter, the first certification result and the first moment, including:
    所述验证节点根据所述目标参数获取第二证明结果;The verification node obtains the second certification result according to the target parameter;
    所述验证节点根据所述第二证明结果、所述第一证明结果和所述第一时刻,验证所述目标数据的可信性。The verification node verifies the credibility of the target data based on the second certification result, the first certification result and the first time.
  15. 根据权利要求14所述的方法,其特征在于,所述验证节点根据所述目标参数获取第二证明结果,包括:The method according to claim 14, characterized in that the verification node obtains the second certification result according to the target parameter, including:
    所述验证节点根据所述目标参数获取目标地址序列,其中,所述目标地址序列指向所述目标数据的镜像数据;The verification node obtains a target address sequence according to the target parameter, wherein the target address sequence points to the mirror data of the target data;
    所述验证节点根据所述镜像数据得到所述第二证明结果。The verification node obtains the second certification result based on the mirror data.
  16. 根据权利要求15所述的方法,其特征在于,所述验证节点根据所述目标参数获取目标地址序列,包括:The method according to claim 15, characterized in that the verification node obtains a target address sequence according to the target parameters, including:
    所述验证节点根据所述目标参数和目标函数生成所述目标地址序列;或者,The verification node generates the target address sequence according to the target parameters and target function; or,
    所述验证节点根据所述目标参数,从所述验证节点所属第二装置的RTOS获取所述目标地址序列,所述目标地址序列是所述RTOS根据目标参数和目标函数生成的,The verification node obtains the target address sequence from the RTOS of the second device to which the verification node belongs based on the target parameters, and the target address sequence is generated by the RTOS based on the target parameters and the target function,
    其中,所述目标函数包括伪随机生成函数。Wherein, the objective function includes a pseudo-random generation function.
  17. 根据权利要求15或16所述的方法,其特征在于,所述目标地址序列包括至少两个地址,所述至少两个地址指向所述镜像数据包含的至少两个数据块,所述验证节点根据所述镜像数据得到所述第二证明结果,包括:The method according to claim 15 or 16, characterized in that the target address sequence includes at least two addresses, the at least two addresses point to at least two data blocks contained in the mirror data, and the verification node is based on The second proof result obtained from the mirror data includes:
    所述验证节点采用目标算法,按照第一顺序对所述镜像数据包含的至少两个数据块进行计算,得到所述第二证明结果。The verification node uses a target algorithm to calculate at least two data blocks contained in the mirror data in a first order to obtain the second certification result.
  18. 根据权利要求15或16所述的方法,其特征在于,所述目标地址序列包括至少两个地址,所述至少两个地址指向所述镜像数据包含的至少两个数据块,还包括:The method according to claim 15 or 16, characterized in that the target address sequence includes at least two addresses, the at least two addresses point to at least two data blocks included in the mirror data, and further includes:
    在所述至少两个地址中的第一地址指向的数据块的长度大于数据长度阈值时,对所述第一地址指向的数据块进行切分。When the length of the data block pointed to by the first address among the at least two addresses is greater than the data length threshold, the data block pointed to by the first address is segmented.
  19. 根据权利要求14所述的方法,其特征在于,所述验证节点根据所述目标参数获取第二证明结果,包括:The method according to claim 14, characterized in that the verification node obtains the second certification result according to the target parameter, including:
    所述验证节点以所述目标参数作为索引,从第一列表获取所述第二证明结果,其中,所述第一列表包括多个参数以及每个参数关联的证明结果,所述多个参数包括所述目标参数。The verification node uses the target parameter as an index to obtain the second proof result from a first list, where the first list includes multiple parameters and a proof result associated with each parameter, and the multiple parameters include the target parameters.
  20. 根据权利要求19所述的方法,其特征在于,所述方法还包括:The method of claim 19, further comprising:
    所述验证节点获取来自所述证明节点的标记信息;The verification node obtains tag information from the certification node;
    所述验证节点以所述目标参数作为索引,从第一列表获取所述第二证明结果,包括:The verification node uses the target parameter as an index to obtain the second proof result from the first list, including:
    所述验证节点以所述目标参数和所述标记信息作为索引,从所述第一列表获取所述第二证明结果。The verification node uses the target parameter and the tag information as indexes to obtain the second certification result from the first list.
  21. 根据权利要求12-20中任一项所述的方法,其特征在于,The method according to any one of claims 12-20, characterized in that,
    所述证明节点所属的第一装置与所述验证节点所属的第二装置位于同一系统级芯片SoC,其中,所述第一装置位于所述SoC的非可信硬件,所述第二装置位于所述SoC的可信硬件;或者,The first device to which the certification node belongs and the second device to which the verification node belongs are located in the same system-on-chip SoC, wherein the first device is located in the untrusted hardware of the SoC, and the second device is located in the SoC. Trusted hardware for the SoC; or,
    所述第一装置和所述第二装置为不同装置,其中,所述第一装置为非可信装置,所述第二装置为可信装置。The first device and the second device are different devices, wherein the first device is an untrusted device and the second device is a trusted device.
  22. 根据权利要求21所述的方法,其特征在于,The method according to claim 21, characterized in that:
    所述第二装置还包括挑战节点,所述挑战节点为触发验证所述目标数据的可信性的节点;或者,The second device further includes a challenge node, which is a node that triggers verification of the credibility of the target data; or,
    所述第二装置和所述挑战节点所属的第三装置为不同装置,所述第三装置和所述第一装置为不同装置。The second device and the third device to which the challenge node belongs are different devices, and the third device and the first device are different devices.
  23. 根据权利要求12-22中任一项所述的方法,其特征在于,所述验证节点根据所述目标参数、所述第一证明结果和所述第一时刻,验证所述目标数据的可信性,包括:The method according to any one of claims 12-22, characterized in that the verification node verifies the credibility of the target data based on the target parameter, the first certification result and the first moment. sex, including:
    所述验证节点根据所述目标参数、所述第一证明结果和所述第一时刻,确定所述目标数据是否满足预设的可信条件,以验证所述目标数据的可信性;其中,所述可信条件包括:所述第一证明结果与所述验证节点根据所述目标参数获得的第二证明结果相同,以及所述第一时刻关联的第一时间区间在所述验证节点允许的时间范围内。The verification node determines whether the target data satisfies a preset trust condition according to the target parameter, the first certification result and the first moment to verify the credibility of the target data; wherein, The trustworthy conditions include: the first certification result is the same as the second certification result obtained by the verification node according to the target parameter, and the first time interval associated with the first moment is within the range allowed by the verification node. within the time frame.
  24. 一种用于证明节点的装置,其特征在于,包括:A device for proving nodes, characterized by including:
    获取单元,用于获取目标地址序列,其中,所述目标地址序列指向待验证的目标数据;An acquisition unit, configured to acquire a target address sequence, wherein the target address sequence points to the target data to be verified;
    处理单元,用于根据所述目标数据得到证明结果;A processing unit, used to obtain proof results based on the target data;
    收发单元,用于向验证节点提供所述证明结果,其中,所述证明结果关联第一时刻,所述证明结果和所述第一时刻用于所述目标数据的可信性验证。A transceiver unit configured to provide the verification result to the verification node, wherein the verification result is associated with a first time, and the verification result and the first time are used for credibility verification of the target data.
  25. 一种用于验证节点的装置,其特征在于,包括:A device for verifying nodes, characterized by including:
    收发单元,用于获取目标参数和获取来自证明节点的第一证明结果,其中,所述目标参数包括随机数,所述第一证明结果为所述证明节点根据目标数据得到的,所述第一证明结果关联第一时刻;A transceiver unit, configured to obtain target parameters and obtain a first certification result from a certification node, where the target parameter includes a random number, the first certification result is obtained by the certification node based on the target data, and the first certification result is obtained by the certification node based on the target data. Prove that the results are related to the first moment;
    确定单元,用于根据所述目标参数、所述第一证明结果和所述第一时刻,验证所述目标数据的可信性。A determining unit configured to verify the credibility of the target data based on the target parameter, the first certification result and the first moment.
  26. 一种通信系统,其特征在于,包括用于实现如权利要求1-11中任一项所述方法的装置,以及用于实现如权利要求12-23中任一项所述方法的装置。A communication system, characterized by comprising a device for implementing the method according to any one of claims 1-11, and a device for implementing the method according to any one of claims 12-23.
  27. 一种芯片系统,其特征在于,包括至少一个处理器和接口电路,所述处理器用于通过所述接口电路执行指令和/或数据的交互,使得所述芯片系统执行权利要求1-11中任一项所述的方法,或者执行权利要求12-23中任一项所述的方法。A chip system, characterized in that it includes at least one processor and an interface circuit. The processor is used to execute instructions and/or data interaction through the interface circuit, so that the chip system executes any of claims 1-11. The method described in one of the claims 12-23, or the method described in any one of claims 12-23.
  28. 一种车辆,其特征在于,包括如权利要求24所述的装置或权利要求27所述的芯片系统,和/或,如权利要求25所述的装置或权利要求27所述的芯片系统,或者,包括如权利要求26所述的通信系统。A vehicle, characterized by comprising the device according to claim 24 or the chip system according to claim 27, and/or the device according to claim 25 or the chip system according to claim 27, or , including the communication system as claimed in claim 26.
  29. 一种计算机可读存储介质,其特征在于,包括程序或指令,当所述程序或指令被执行时,如权利要求1-11中任意一项所述的方法被执行,或者如权利要求12-23中任一项所述的方法被执行。A computer-readable storage medium, characterized in that it includes a program or instructions. When the program or instructions are executed, the method as claimed in any one of claims 1-11 is executed, or as claimed in claim 12- The method described in any one of 23 is performed.
  30. 一种计算机程序产品,其特征在于,当计算机读取并执行所述计算机程序产品时,使得计算机执行如权利要求1-11中任一项所述的方法,或者执行如权利要求12-23中任一项所述的方法。A computer program product, characterized in that, when a computer reads and executes the computer program product, it causes the computer to perform the method as described in any one of claims 1-11, or to perform the method as described in claims 12-23. any of the methods described.
PCT/CN2022/091803 2022-05-09 2022-05-09 Attestation method, apparatus and system WO2023216077A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/091803 WO2023216077A1 (en) 2022-05-09 2022-05-09 Attestation method, apparatus and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/091803 WO2023216077A1 (en) 2022-05-09 2022-05-09 Attestation method, apparatus and system

Publications (1)

Publication Number Publication Date
WO2023216077A1 true WO2023216077A1 (en) 2023-11-16

Family

ID=88729443

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/091803 WO2023216077A1 (en) 2022-05-09 2022-05-09 Attestation method, apparatus and system

Country Status (1)

Country Link
WO (1) WO2023216077A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118113496A (en) * 2024-04-29 2024-05-31 北京芯驰半导体科技股份有限公司 Inter-process communication method, system and chip based on multi-core heterogeneous SOC

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104520872A (en) * 2012-09-14 2015-04-15 英特尔公司 Methods and apparatus to protect memory regions during low-power states
US9177153B1 (en) * 2005-10-07 2015-11-03 Carnegie Mellon University Verifying integrity and guaranteeing execution of code on untrusted computer platform
US20160085955A1 (en) * 2013-06-10 2016-03-24 Doosra, Inc. Secure Storing and Offline Transferring of Digitally Transferable Assets
CN113168364A (en) * 2018-12-06 2021-07-23 华为技术有限公司 Chip verification method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9177153B1 (en) * 2005-10-07 2015-11-03 Carnegie Mellon University Verifying integrity and guaranteeing execution of code on untrusted computer platform
CN104520872A (en) * 2012-09-14 2015-04-15 英特尔公司 Methods and apparatus to protect memory regions during low-power states
US20160085955A1 (en) * 2013-06-10 2016-03-24 Doosra, Inc. Secure Storing and Offline Transferring of Digitally Transferable Assets
CN113168364A (en) * 2018-12-06 2021-07-23 华为技术有限公司 Chip verification method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118113496A (en) * 2024-04-29 2024-05-31 北京芯驰半导体科技股份有限公司 Inter-process communication method, system and chip based on multi-core heterogeneous SOC

Similar Documents

Publication Publication Date Title
US9298947B2 (en) Method for protecting the integrity of a fixed-length data structure
CN105531713A (en) Generating multiple secure hashes from a single data buffer
JP6780771B2 (en) Verification information granting device, verification device, information management system, method and program
CN113449346B (en) Microprocessor, data processing method, electronic device, and storage medium
CN110750791B (en) Method and system for guaranteeing physical attack resistance of trusted execution environment based on memory encryption
US20080276088A1 (en) Continuous isochronous read access and measurement of data stored in non-volatile memory
WO2023216077A1 (en) Attestation method, apparatus and system
US20230068658A1 (en) Microprocessor, data processing method, electronic device, and storage medium
CN111414640A (en) Key access control method and device
CN109586898B (en) Dual-system communication key generation method and computer-readable storage medium
US11106828B2 (en) Method and apparatus for providing a cryptographic security function for the operation of a device
CN104639313B (en) A kind of detection method of cryptographic algorithm
CN115879099A (en) DCS controller, operation processing method and protection subsystem
CN112269980A (en) Processor architecture
WO2021027504A1 (en) Consensus protocol-based information processing method, and related device
CN111737701A (en) Server trusted root system and trusted starting method thereof
CN113961939B (en) Method and system for protecting safety of embedded operating system
CN116388992A (en) Remote authentication method and device for distributed TEE application
CN116226883A (en) Password service method, device, electronic equipment and storage medium
US9135449B2 (en) Apparatus and method for managing USIM data using mobile trusted module
CN113486375B (en) Storage method and device of equipment information, storage medium and electronic device
KR20150089696A (en) Integrity Verification System and the method based on Access Control and Priority Level
CN114329488A (en) Kernel function credibility verification method and device, electronic equipment and storage medium
CN108449753B (en) Method for reading data in trusted computing environment by mobile phone device
CN113765651A (en) Safety communication method suitable for chips in vehicle-mounted ECU

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22941044

Country of ref document: EP

Kind code of ref document: A1