Probe-based hybrid remote verification method and system

By inserting probes in safety-critical applications and generating control flow diagrams, combining pseudo-random methods and critical data integrity verification, the problems of low accuracy and path explosion in existing remote proof methods are solved, and efficient remote verification and Key data integrity detection.

CN118965454APending Publication Date: 2024-11-15STATE GRID HENAN ELECTRIC POWER ELECTRIC POWER SCI RES INST +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411005802.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The existing remote proof method based on static evidence has low accuracy, and the dynamic evidence-based method has path explosion problems and cannot verify the integrity of critical data, and cannot effectively detect attacks on control flows and critical data.

Method used

Using a hybrid remote verification method based on probes, insert probes in safety-critical applications through a dedicated compiler to generate control flow diagrams, combine pseudo-random methods to traverse memory addresses to generate standard static and control flow measurements, and define key variables and use position insertion probes to capture and verify critical data integrity and generate online measurement reports for comparison.

Benefits of technology

It improves the accuracy of remote proofs, reduces the problem of path explosion, ensures the integrity verification of key data, enhances the detection capabilities of control flow and data attacks, and realizes an efficient verification process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118965454A_ABST
    Figure CN118965454A_ABST
Patent Text Reader

Abstract

The invention discloses a probe-based hybrid remote verification method and system, and the method comprises the following steps: 1, inserting a probe in a safety critical application, automatically recognizing and expanding control related variables and semantic key variables through a special compiler, and generating a control flow diagram; step 2, generating a standard static measurement value through pseudo-random traversal of a memory address, and generating a standard control flow measurement value through a control flow diagram; 3, challenge information is generated according to the control flow diagram and the standard measurement value, a static measurement value and a control flow measurement value are generated according to challenge of a verification party, and the verification party captures key variable information through a probe to generate a key data integrity measurement value; step 4, summarizing the static measurement value, the control flow measurement value and the key data integrity measurement value into an online measurement report and sending the online measurement report to a verification party; and step 5, comparing the online measurement report with the offline standard value by the verification party, and proving that the application is not attacked. The problems that the control flow proving efficiency is low and the integrity of key data is not verified are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of Internet of Things security, and more specifically, relates to a hybrid remote verification method and system based on a probe. Background Art

[0002] Trusted execution environment technology can be used to protect applications and data in IoT devices, isolating security-critical applications from untrusted computing bases. Trusted execution environment provides a secure area by isolating software and hardware resources to ensure that the programs and data therein are not interfered with by external parties.

[0003] Remote attestation is a key component of a trusted execution environment, which is a trusted execution environment that proves to a third party that it has not been compromised and that its results are trustworthy. Remote attestation can establish a trust relationship between the trusted execution environment and the external environment and provide a reliable way to verify the state and execution results of the trusted execution environment.

[0004] Existing remote attestation methods based on static evidence have low accuracy during verification. Among the existing remote attestation methods based on dynamic evidence, the attestation method that detects control flow has the strongest detection capability, but there is a path explosion problem, that is, the presence of nested loops and branches in conventional programs will lead to infinite control flow paths, making it difficult to pre-calculate the hash of all legal control flows, which will result in low detection efficiency and the inability to verify all control flows. In addition, existing remote attestation methods do not verify the integrity of key data and cannot detect attacks that modify key data. Summary of the invention

[0005] In order to solve the deficiencies in the prior art, the present invention provides a probe-based hybrid remote verification method to solve the path explosion problem and the problem of failure to verify the integrity of key data in the control flow proof method.

[0006] The present invention provides a probe-based hybrid remote verification method and system, comprising the following steps:

[0007] Step 1: Insert probes in safety-critical applications to monitor and capture control-related variables and semantically critical variables in real time, and generate control flow graphs using a dedicated compiler;

[0008] Step 2, using a pseudo-random method to traverse the memory address to generate a standard static measurement value, generating a standard control flow measurement value through a control flow graph, and using the standard static measurement value and the standard control flow measurement value as an offline standard value;

[0009] Step 3: Generate challenge information based on the control flow graph and standard measurement values, generate static measurement values ​​and control flow measurement values ​​according to the challenge of the verifier, and the prover captures key variable information through the probe to generate key data integrity measurement values;

[0010] Step 4: Aggregate the generated static measurement values, control flow measurement values, and key data integrity measurement values ​​into an online measurement report, encrypt it, and send it to the verification party;

[0011] In step 5, the verifier compares the static measurement values, control flow measurement values, and key data integrity measurement values ​​in the online measurement report with the offline standard values ​​to verify that the application has not been tampered with or attacked.

[0012] Preferably, in step 1, a dedicated compiler is used to insert probes at key locations of the source code; the insertion locations include control flow instructions, key data definitions and uses; the compiler identifies key locations through static analysis and data flow analysis and performs insertion.

[0013] The dedicated compiler generates a control flow graph of the program while inserting the probe; the control flow graph is used to describe the execution path of each basic block in the program;

[0014] The dedicated compiler identifies control-related variables and semantically critical variables through pointer analysis and data dependency analysis; the control-related variables include conditional variables, which determine the code path of the target program execution.

[0015] Preferably, in step 1, control flow instructions and control-related variables are identified by a dedicated compiler, semantic key variables are identified after annotation by the programmer, and an initial set of control-related variables and semantic key variables is formed;

[0016] The dedicated compiler forms target key variables by expanding the initial set; the dedicated compiler identifies pointers to target key variables and target key variable dependencies by analyzing all pointers in the program, and globally points to a mapping to record each pointer and the global location it points to, for tracking and identifying target key variables and target key variable dependencies;

[0017] The extended initial set includes all direct and indirect pointers to variables in the initial set, and all pointers to dependencies of the variables in the initial set.

[0018] Verify the integrity of target key variables, including verifying the integrity of target key variables and target key variable dependencies.

[0019] Preferably, step 2 comprises:

[0020] Step 2.1, use a pseudo-random method to generate memory addresses and traverse the memory space of the entire safety-critical application; for each pseudo-randomly generated memory address, read its content and status, use a hash function to calculate the hash value of the content in the memory address, merge the hash values ​​of the contents in all memory addresses, and generate a standard static measurement value for the entire safety-critical application;

[0021] Step 2.2, select two checkpoints in the control flow graph of the program, which are used to mark the beginning and end of the path respectively; starting from the first checkpoint, record each operation of the program moving in the control flow graph, including function calls, function returns, conditional branches, and serialize them into an operation list; use a hash function to hash the operation list to generate a standard control flow measurement value for safety-critical applications.

[0022] Preferably, in step 2.2, the standard control flow measurement value includes two checkpoints, which respectively identify the starting and ending positions of the path; and a hash value of an operation list associated with all code blocks traversed when moving from the first checkpoint to the second checkpoint.

[0023] Preferably, step 3 comprises:

[0024] Step 3.1, the verifier uses the control flow graph and pre-generated standard measurement values ​​to construct the challenge information. The control flow graph is used to provide the structural information of the program, and the standard measurement values ​​are used to provide the benchmark data. The verifier generates the challenge information based on the selected checkpoints and operation lists, including the random numbers and keys used to generate static measurement values, instructions to instruct the prover to perform static and control flow measurements, and key variable information that needs to be captured by the prover.

[0025] Step 3.2, using the random number and key in the challenge information, a working random number is generated based on the random number, and the prover uses the working random number to pseudo-randomly traverse the memory address, calculate the hash value of the memory content, and obtain the static measurement value;

[0026] Step 3.3, the prover records the operation list of the program from one checkpoint to the next checkpoint, calculates the hash value of the operation list, and generates a control flow measurement value;

[0027] In step 3.4, the dedicated compiler inserts probes at each variable definition and usage location in the key variable set. At runtime, the label generated by the dedicated compiler for the key variable and the value to be assigned to the variable are captured at the definition point of each key variable. The springboard sends the information to the measurement module, which ultimately generates key data integrity measurement values ​​based on the key variable integrity check results.

[0028] Preferably, the measurement module maintains a hash map in which key-value pairs including variable addresses and variable values ​​are stored;

[0029] The measurement module updates the hash map at each key variable definition and checks at each key variable use; key variables include local variables and global variables, and the definition and use sites have matching values; value mismatch indicates that the key variable is corrupted.

[0030] Preferably, in step 5.1, the static measurement value is compared with the standard static measurement value. If the values ​​are the same, it means that the file has not been tampered with, otherwise the verification fails;

[0031] Step 5.2, compare the control flow measurement value with the standard value control flow measurement value stored in the measurement database, check whether the destination checkpoint of each control flow measurement value is the source checkpoint of the next control flow measurement value; use the shadow stack to check the operation list to see if there is an unmatched return edge. If the check passes, it means that there is no control flow attack, otherwise the verification fails;

[0032] Step 5.3, check the key data integrity measurement value. If the value matches, it means that there is no data-only attack and the verification passes. Otherwise, the verification fails.

[0033] Preferably, in step 5.2, the shadow stack is used to check attacks on hijacking the return address of the function, and the attacks on hijacking the return address of the function are detected by checking the legal return edge relationship;

[0034] At the beginning of the detection, the shadow stack is empty, and the dynamic measurement value is checked to push the function call edge involved into the stack. When an edge involving a function return is detected, check whether the edge is a legal return edge of the top edge of the stack;

[0035] If the edge involving the function return matches the edge at the top of the stack, it means that there has been no attack to hijack the function return address. The edge at the top of the stack is popped out, indicating that the function returns normally. If they do not match, the check fails, indicating that an attack has occurred.

[0036] A second aspect of the present invention provides a probe-based hybrid remote verification system, comprising: a dedicated compiler module, a challenge generation module, a static measurement module, a control flow measurement module, and a key data integrity measurement module;

[0037] A dedicated compiler module is used to automatically identify control flow instructions and control related variables, and to identify semantically critical variables after annotation by the program writer; to form an initial set of critical variables, to automatically expand the set to include direct and indirect pointers to the variables and their dependencies, and to insert probes at the definition and use locations of critical variables;

[0038] The challenge generation module generates challenge information by the verifier using the control flow graph and standard measurement values, including instructions for generating random numbers and keys, and instructing the prover to perform static and control flow measurements;

[0039] The static measurement module uses the random number and key in the challenge information to pseudo-randomly traverse the memory and generate static measurement values;

[0040] The control flow measurement module records the operation list of the program from one checkpoint to the next checkpoint based on the control flow graph and the query information, calculates the hash value of the operation list, and generates the control flow measurement value;

[0041] The key data integrity measurement module is used to capture the information of key variables during operation and send it to the measurement module, maintain a hash map, store key-value pairs of variable addresses and variable values, perform dynamic boundary checks, and generate key data integrity measurement values.

[0042] Compared with the prior art, the beneficial effects of the present invention include at least:

[0043] 1. The present invention combines static and dynamic evidence for remote attestation, effectively improving the accuracy of verification. The dedicated compiler automatically identifies and annotates key variables during the compilation process, ensuring that all potential security threats are captured during verification;

[0044] 2. The present invention adopts an intelligent control flow measurement method, which reduces the path explosion problem by selecting virtual checkpoints and key basic blocks. The dedicated compiler can dynamically expand the key variable set and generate necessary checkpoints, thereby avoiding the computational complexity caused by infinite control flow paths;

[0045] 3. Automatically identify control flow instructions and variables through a dedicated compiler, and identify semantic key variables after the programmer's annotations, generate the initial set and extended set of key variables, and improve the detection efficiency. The system can automatically analyze and expand key variables and their dependencies, making the verification process efficient;

[0046] 4. Based on control flow measurement, the present invention further adds a key data integrity verification module. By inserting probes at the definition and use locations of key variables, the variable values ​​are captured and checked to ensure the integrity of key data, effectively prevent attacks on key data, and enhance the detection capability of remote proof. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 It is an overall flow chart of a probe-based hybrid remote attestation method provided in accordance with an embodiment of the present invention;

[0048] Figure 2 It is a general architecture diagram of a probe-based hybrid remote attestation method provided in accordance with an embodiment of the present invention. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. The embodiments described in this application are only part of the embodiments of the present invention, not all of them. Based on the spirit of the present invention, other embodiments obtained by ordinary technicians in this field without creative work are all within the scope of protection of the present invention.

[0050] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. The orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. is based on the orientation or positional relationship shown in the accompanying drawings, only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. The terms "installed", "connected" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can also be the internal communication of two components, it can be a wireless connection or a wired connection. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0051] In addition, if the meaning of "and / or" appears in the present invention, it includes three parallel solutions. Taking "A and / or B" as an example, it includes solution A, solution B, or solutions that satisfy both A and B. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the protection scope required by the present invention.

[0052] Remote attestation is a security mechanism to ensure that devices are trustworthy and is often used to protect IoT devices. A trusted third party (verifier) ​​is responsible for challenging a suspicious device (prover) to prove that it has not been compromised. Remote attestation can provide various assurances in different ways, each with its own advantages and disadvantages. In general, remote attestation is divided into multiple categories based on how it establishes a root of trust in the message sent from the prover to the verifier. Without a basis for trust, any evidence provided by the prover cannot be trusted by the verifier. For example, the prover may use old system state information to deceive the verifier, or call a malicious server to forge a response. Remote attestation schemes provide many different assurances to the prover device through many different strategies. Typically, remote attestation begins when the verifier sends a challenge to the prover. The challenge usually includes some randomness and requires the prover to provide evidence of his innocence. The evidence depends on the level of assurance provided by the remote attestation scheme design. Existing remote attestation methods based on static evidence have low accuracy when verifying. Among the existing remote attestation methods based on dynamic evidence, the attestation method for detecting control flow has the strongest detection capability, but there is a path explosion problem, that is, the presence of nested loops and branches in conventional programs will lead to infinite control flow paths, making it difficult to pre-calculate the hashes of all legal control flows, which will result in low detection efficiency and the inability to verify all control flows. In addition, the existing remote attestation methods do not verify the integrity of key data and cannot detect attacks that modify key data.

[0053] like Figure 1 As shown, embodiment 1 of the present invention provides a hybrid remote verification method based on a probe, comprising the following steps:

[0054] Step 1, inserting a probe into a safety-critical application for real-time monitoring and capturing of control-related variables and semantically critical variables, and a dedicated compiler generates a control flow graph; preferably, the safety-critical application is an application that requires remote attestation and verification; the probe is inserted at the location where control flow instructions and key data are defined and used; the key data are control-related variables and semantically critical variables; the control-related variables are variables whose values ​​directly determine the execution code path of a specific program, such as conditional variables; although the value of the semantically critical variable will not directly affect the code execution path, it will affect the result of the operation.

[0055] Specifically, control flow instructions and control-related variables are automatically identified by the dedicated compiler, and semantically critical variables are identified by the dedicated compiler after being annotated by the program writer. Control-related variables and semantically critical variables form the initial set of critical variables, and then the dedicated compiler automatically expands this set to include direct and indirect pointers to these variables and their dependencies. Pointers to critical variables allow the variable to be indirectly defined or used, so such data pointers are regarded as special critical variables, and the dedicated compiler iteratively identifies them from the global point-to-map generated by pointer analysis. The dependencies of critical variables are variables that may affect their values. Verifying the integrity of critical variables means verifying the integrity of critical variables and their dependencies. Given a set of critical variables, the dedicated compiler first builds a program dependency graph, and then performs a reverse traversal for each variable along the data dependency edge to find all their dependencies. Newly discovered variables during the traversal are added to the set of critical variables. When the set cannot be expanded further, the iterative search for dependencies stops. This automatic dependency discovery also simplifies the annotation of critical variables, and program developers only need to annotate one variable for each critical data instead of all variables.

[0056] Step 2, using a pseudo-random method to traverse the memory address to generate a standard static measurement value, generating a standard control flow measurement value through a control flow graph, and using the standard static measurement value and the standard control flow measurement value as an offline standard value;

[0057] Preferably, step 2 specifically includes the following steps:

[0058] Step 2.1, use a pseudo-random algorithm to generate memory addresses and traverse the memory space of the entire safety-critical application; for each generated memory address, read its content and status, use a hash function to calculate the hash value of the content of the memory address, merge and accumulate the hash values ​​of all memory addresses, and generate a standard static measurement value for the entire application;

[0059] The pseudo-random algorithm includes but is not limited to the Phelix algorithm; using the Phelix algorithm as a random number generator in the remote attestation system can provide high security, high efficiency and long-term reliability, and help ensure the security and stability of the system;

[0060] Specifically, assuming that the application size will not exceed 232-1 bytes (i.e., 4GB, there will be no applications larger than this size on IoT devices), the most significant 32 bits of the memory address are fixed and the least significant 32 bits of the memory address are randomly generated. Compared with randomly generating 64-bit addresses, this approach will minimize the overhead. Specifically, the Phelix algorithm first generates a random number and a key, then generates a working random number N based on the random number, and generates a working key K based on the key. After that, the initial state word is generated based on the working random number N and the working key K, and the memory is traversed. Basically, each round depends on the five state words (Z0(i), ..., Z4(i)) of the round function, two keywords (Xi,0, Xi,1) and the memory content of the previously generated address. Finally, based on the traversed memory content, static measurement values ​​of safety-critical applications are generated.

[0061] Step 2.2, select two checkpoints in the control flow graph of the program to mark the beginning and end of the path; starting from the source checkpoint, record each operation of the program moving in the control flow graph, including function calls, function returns, conditional branches, and serialize them into an operation list; use a hash function to hash the operation list to generate a standard control flow measurement value for safety-critical applications.

[0062] Preferably, in step 2.2, the standard control flow measurement value includes two checkpoints and a hash of an operation list associated with important basic blocks traversed when moving from a source checkpoint to a target checkpoint. The checkpoint is a separator used to identify the beginning or end of a subpath within the execution path of a program in a control flow graph. A checkpoint can be a point that identifies the beginning or end of a thread, or an exit point that indicates an application module (such as a system call or library function call point). It can also be a virtual checkpoint used to manage special cases such as loops and recursion. The operation list is an edge that identifies a unique execution path that a process passes through when moving from one checkpoint to the next, including edges of procedure calls, procedure returns, and branches (i.e., conditional jumps and indirect jumps).

[0063] Specifically, loops, recursions, signals, and exceptions involved in program execution introduce new challenges in the representation of control flow graphs because they can generate uncountable execution paths. For example, loops and recursions can generate an indeterminate number of possible combinations of operation lists, while signals and exceptions can introduce unpredictable execution paths at any time. The processing method for loops is to select the conditional node of the loop as a virtual checkpoint, and the processing method for recursion is to select the node N3 that executes the recursion as a virtual checkpoint. In both processing methods, only the paths that can be selected are modeled without considering the actual number of executions.

[0064] Step 3, generating query information based on the control flow graph and standard measurement values, generating static measurement values ​​and control flow measurement values ​​according to the query, capturing key variable information through probes, and generating key data integrity measurement values;

[0065] Preferably, in step 3.1, the verifier uses a control flow graph and pre-generated standard measurement values ​​to construct challenge information, wherein the control flow graph is used to provide structural information of the program, and the standard measurement values ​​are used to provide benchmark data; the verifier generates challenge information according to the selection of specific checkpoints and operation lists, including random numbers and keys for generating static measurement values, instructions for instructing the prover to perform static and control flow measurements, and key variable information that needs to be captured by the prover;

[0066] In step 3.2, a working random number is generated based on the random number using the random number and the key in the challenge information. The prover uses the working random number to pseudo-randomly traverse the memory address, calculate the hash value of the memory content, and obtain a static measurement value. The method for generating a static measurement value is the same as that described in step 2.1 and will not be repeated here.

[0067] In step 3.3, the prover records the operation list of the program from one checkpoint to the next checkpoint, calculates the hash value of the operation list, and generates a control flow measurement value; the calculation method of the control flow measurement is the same as the method described in step 2.2 and will not be repeated here.

[0068] Step 3.4, critical data integrity measurement, generates critical data integrity measurement values. The dedicated compiler inserts probes at each variable definition and usage location in the critical variable set. At runtime, each critical variable definition point will capture the label generated by the dedicated compiler for the critical variable and the value to be assigned to the variable. The springboard then sends the information to the measurement module. Similarly, the variable label and the current value of the variable will be captured at the critical variable usage location and sent to the measurement module. The measurement module will eventually generate critical data integrity measurement values ​​based on the key variable integrity check results.

[0069] Specifically, the measurement module maintains a hash map that stores key-value pairs containing variable addresses and variable values. The measurement module updates the hash map at each critical variable definition and checks it at each critical variable use. Regardless of whether the variable is a local variable or a global variable, its definition and use sites should always have matching values. Value mismatches indicate that the critical variable is corrupted.

[0070] Optionally, additional checks are required for pointers accessing critical variables. For a simple example, the critical variable definition is *(P+n)=x, where P is the base address of the critical variable A and n is the address offset. If there is a vulnerability in the program, the indirect reference *(P+n) may exceed the boundary of the critical variable A and access another critical variable B. When this out-of-bounds write occurs, the measurement module will mistakenly update the value of B to x, stored in its hash map. To solve this problem, dynamic boundary checks are enforced for pointers accessing critical variables. When a critical pointer is indirectly referenced, the measurement module checks whether the indirect reference violates the boundaries of the current pointer object. This checking mechanism relies on the dynamic boundary information collected by the measurement module for each critical pointer. If an out-of-bounds behavior is found, the measurement module only performs checks on the overlapping bytes between the accessed memory area and the variable originally pointed to, that is, only updates or checks the expected pointed value. This design ensures the correctness of critical variable checks while allowing intentional out-of-bounds pointer indirect references in normal programs.

[0071] Step 4, the prover generates an online measurement report and encrypts the online measurement report and sends it to the verifier; the online measurement report includes the static measurement value, control flow measurement value and key data integrity measurement value generated in step 3;

[0072] Preferably, the encrypted transmission includes combining symmetric encryption and asymmetric encryption, and the specific steps are as follows:

[0073] (1) Generate a symmetric key (AES);

[0074] (2) Encrypt online measurement reports using symmetric keys;

[0075] (3) Encrypt the symmetric key using the verifier’s public key (RSA);

[0076] (4) Sending the encrypted online measurement report and the encrypted symmetric key to the verification party;

[0077] After receiving the encrypted data, the authenticator performs the following steps:

[0078] (1) Decrypt the symmetric key using the private key (RSA).

[0079] (2) Use the decrypted symmetric key (AES) to decrypt the online measurement report.

[0080] To ensure data security, a hash function (such as SHA-256) is used to calculate the hash value of the online measurement report and send the hash value together with the encrypted data. The verifier can calculate the hash value of the decrypted report again and compare it to ensure that the data has not been tampered with.

[0081] Authentication is performed using digital signature technology, including signing the report with a private key and the verifier using a public key to verify the signature, ensuring the source and authenticity of the data.

[0082] In step 5, the verifier compares the static measurement values, control flow measurement values, and key data integrity measurement values ​​in the online measurement report with the offline standard values ​​to prove that the application has not been tampered with or attacked.

[0083] Preferably, in step 5.1, the static measurement value is compared with the standard static measurement value. If the values ​​are the same, it means that the file has not been tampered with, otherwise the verification fails;

[0084] Step 5.2, compare the control flow measurement value with the standard value control flow measurement value stored in the measurement database, check whether the destination checkpoint of each control flow measurement value is the source checkpoint of the next control flow measurement value; use the shadow stack to check the operation list to see if there is an unmatched return edge. If the check passes, it means that there is no control flow attack, otherwise the verification fails;

[0085] Specifically, the shadow stack is used to check attacks on hijacking function return addresses, and the attacks on hijacking function return addresses are detected by checking the legal return edge relationship;

[0086] At the beginning of the detection, the shadow stack is empty. The dynamic measurement value is checked to push the function call edge involved into the stack. When an edge involving a function return is detected, it is checked whether the edge is a legal return edge of the top edge of the stack.

[0087] If the edge involving the function return matches the edge at the top of the stack, it means that there has been no attack to hijack the function return address. The edge at the top of the stack is popped out, indicating that the function returns normally. If they do not match, the check fails, indicating that an attack has occurred.

[0088] Step 5.3, check the key data integrity measurement value. If the value matches, it means that there is no data-only attack and the verification passes. Otherwise, the verification fails.

[0089] Example 2 of the present invention provides a probe-based hybrid remote verification system, including: a dedicated compiler module, a challenge generation module, a static measurement module, a control flow measurement module, and a key data integrity measurement module;

[0090] A dedicated compiler module is used to automatically identify control flow instructions and control related variables, and to identify semantically critical variables after annotation by the program writer; to form an initial set of critical variables, to automatically expand the set to include direct and indirect pointers to the variables and their dependencies, and to insert probes at the definition and use locations of critical variables;

[0091] The challenge generation module generates challenge information by the verifier using the control flow graph and standard measurement values, including instructions for generating random numbers and keys, and instructing the prover to perform static and control flow measurements;

[0092] The static measurement module uses the random number and key in the challenge information to pseudo-randomly traverse the memory and generate static measurement values;

[0093] The control flow measurement module records the operation list of the program from one checkpoint to the next checkpoint based on the control flow graph and the query information, calculates the hash value of the operation list, and generates the control flow measurement value;

[0094] The key data integrity measurement module is used to capture the information of key variables during operation and send it to the measurement module, maintain a hash map, store key-value pairs of variable addresses and variable values, perform dynamic boundary checks, and generate key data integrity measurement values.

[0095] In this embodiment, a hybrid remote verification method based on a probe is provided, which can be used for the above-mentioned IoT devices. Figure 2 FIG. 1 is a general architecture diagram of a probe-based hybrid remote attestation method according to an embodiment of the present invention. Figure 2 As shown, remote attestation involves the participation of a verifier and a prover.

[0096] The verifier is the remote attestation server, which is used to verify based on the online measurement report fed back by the verifier to determine whether the security-critical application of the verifier has been attacked. The verifier is the IoT device that needs to be verified, which is used to perform online measurement of the security-critical application and generate an online measurement report based on the challenge information provided by the verifier, and then send the online measurement report to the verifier.

[0097] The beneficial effects of the present invention include at least:

[0098] 1. The present invention combines static and dynamic evidence for remote attestation, effectively improving the accuracy of verification. The dedicated compiler automatically identifies and annotates key variables during the compilation process, ensuring that all potential security threats are captured during verification;

[0099] 2. The present invention adopts an intelligent control flow measurement method, which reduces the path explosion problem by selecting virtual checkpoints and key basic blocks. The dedicated compiler can dynamically expand the key variable set and generate necessary checkpoints, thereby avoiding the computational complexity caused by infinite control flow paths;

[0100] 3. Automatically identify control flow instructions and variables through a dedicated compiler, and identify semantic key variables after the programmer's annotations, generate the initial set and extended set of key variables, and improve the detection efficiency. The system can automatically analyze and expand key variables and their dependencies, making the verification process efficient;

[0101] 4. Based on control flow measurement, the present invention further adds a key data integrity verification module. By inserting probes at the definition and use locations of key variables, the variable values ​​are captured and checked to ensure the integrity of key data, effectively prevent attacks on key data, and enhance the detection capability of remote proof.

[0102] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

[0103] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0104] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A probe-based hybrid remote verification method and system, characterized in that: The following steps are involved: Step 1: Insert probes in safety-critical applications to monitor and capture control-related variables and semantically critical variables in real time, and generate control flow graphs using a dedicated compiler; Step 2, using a pseudo-random method to traverse the memory address to generate a standard static measurement value, generating a standard control flow measurement value through a control flow graph, and using the standard static measurement value and the standard control flow measurement value as an offline standard value; Step 3, generating query information based on the control flow graph and standard measurement values, generating static measurement values ​​and control flow measurement values ​​according to the query, capturing key variable information through probes, and generating key data integrity measurement values; Step 4: Aggregate the generated static measurement values, control flow measurement values, and key data integrity measurement values ​​into an online measurement report, encrypt it, and send it to the verification party; In step 5, the verifier compares the static measurement values, control flow measurement values, and key data integrity measurement values ​​in the online measurement report with the offline standard values ​​to verify that the application has not been tampered with or attacked.

2. The probe-based hybrid remote verification method according to claim 1, characterized in that: In step 1, a dedicated compiler is used to insert probes at key locations in the source code; the insertion locations include control flow instructions, key data definitions and uses; the compiler identifies key locations and inserts them through static analysis and data flow analysis. The dedicated compiler generates a control flow graph of the program while inserting the probe; the control flow graph is used to describe the execution path of each basic block in the program; The dedicated compiler identifies control-related variables and semantically critical variables through pointer analysis and data dependency analysis; the control-related variables include conditional variables, which determine the code path of the target program execution.

3. The probe-based hybrid remote verification method according to claim 2, characterized in that: In step 1, control flow instructions and control-related variables are identified by a dedicated compiler, and semantic key variables are identified after annotation by the programmer, forming an initial set of control-related variables and semantic key variables; The dedicated compiler forms target key variables by expanding the initial set; the dedicated compiler identifies pointers to target key variables and target key variable dependencies by analyzing all pointers in the program, and globally points to a mapping to record each pointer and the global location it points to, for tracking and identifying target key variables and target key variable dependencies; The extended initial set includes all direct and indirect pointers to variables in the initial set, and all pointers to dependencies of the variables in the initial set. Verify the integrity of target key variables, including verifying the integrity of target key variables and target key variable dependencies.

4. The probe-based hybrid remote verification method according to claim 1, characterized in that: Step 2 includes: Step 2.1, use a pseudo-random method to generate memory addresses and traverse the memory space of the entire safety-critical application; for each pseudo-randomly generated memory address, read its content and status, use a hash function to calculate the hash value of the content in the memory address, merge the hash values ​​of the contents in all memory addresses, and generate a standard static measurement value for the entire safety-critical application; Step 2.2, select two checkpoints in the control flow graph of the program, which are used to mark the beginning and end of the path respectively; starting from the first checkpoint, record each operation of the program moving in the control flow graph, including function calls, function returns, conditional branches, and serialize them into an operation list; use a hash function to hash the operation list to generate a standard control flow measurement value for safety-critical applications.

5. A probe-based hybrid remote verification method according to claim 4, characterized in that: In step 2.2, the standard control flow measurement value includes two checkpoints, which respectively identify the starting and ending positions of the path; and a hash value of an operation list associated with all code blocks traversed when moving from the first checkpoint to the second checkpoint.

6. The probe-based hybrid remote verification method according to claim 1, characterized in that: Step 3 includes: Step 3.1, the verifier uses the control flow graph and pre-generated standard measurement values ​​to construct the challenge information. The control flow graph is used to provide the structural information of the program, and the standard measurement values ​​are used to provide the benchmark data. The verifier generates the challenge information based on the selected checkpoints and operation lists, including the random numbers and keys used to generate static measurement values, instructions to instruct the prover to perform static and control flow measurements, and key variable information that needs to be captured by the prover. Step 3.2, using the random number and key in the challenge information, a working random number is generated based on the random number, and the prover uses the working random number to pseudo-randomly traverse the memory address, calculate the hash value of the memory content, and obtain the static measurement value; Step 3.3, the prover records the operation list of the program from one checkpoint to the next checkpoint, calculates the hash value of the operation list, and generates a control flow measurement value; In step 3.4, the dedicated compiler inserts probes at each variable definition and usage location in the key variable set. At runtime, the label generated by the dedicated compiler for the key variable and the value to be assigned to the variable are captured at the definition point of each key variable. The springboard sends the information to the measurement module, which ultimately generates key data integrity measurement values ​​based on the key variable integrity check results.

7. The probe-based hybrid remote verification method according to claim 6, characterized in that: The measurement module maintains a hash map in which key-value pairs including variable addresses and variable values ​​are stored; The measurement module updates the hash map at each key variable definition and performs a check at each key variable use; Critical variables include local variables and global variables, and both the definition and use sites have matching values; a value mismatch indicates that the critical variable is corrupted.

8. The probe-based hybrid remote verification method according to claim 1, characterized in that: Step 5.1, compare the static measurement value with the standard static measurement value. If the values ​​are the same, it means that the file has not been tampered with, otherwise the verification fails; Step 5.2, compare the control flow measurement value with the standard value control flow measurement value stored in the measurement database, check whether the destination checkpoint of each control flow measurement value is the source checkpoint of the next control flow measurement value; use the shadow stack to check the operation list to see if there is an unmatched return edge. If the check passes, it means that there is no control flow attack, otherwise the verification fails; Step 5.3, check the key data integrity measurement value. If the value matches, it means that there is no data-only attack and the verification passes. Otherwise, the verification fails.

9. The probe-based hybrid remote verification method according to claim 1, characterized in that: In step 5.2, the shadow stack is used to check attacks on hijacking the return address of the function, and the attacks on the return address of the hijacking function are detected by checking the legal return edge relationship; At the beginning of the detection, the shadow stack is empty, and the dynamic measurement value is checked to push the function call edge involved into the stack. When an edge involving a function return is detected, check whether the edge is a legal return edge of the top edge of the stack; If the edge involving the function return matches the edge at the top of the stack, it means that there is no attack to hijack the function return address. Pop the edge at the top of the stack, indicating that the function returns normally; If they do not match, the check fails, indicating an attack.

10. A probe-based hybrid remote verification system, comprising: Specialized compiler modules, challenge generation modules, static measurement modules, control flow measurement modules, and critical data integrity measurement modules; A probe-based hybrid remote verification method according to any one of claims 1 to 9 is implemented, characterized in that: A dedicated compiler module is used to automatically identify control flow instructions and control related variables, and to identify semantically critical variables after annotation by the program writer; to form an initial set of critical variables, to automatically expand the set to include direct and indirect pointers to the variables and their dependencies, and to insert probes at the definition and use locations of critical variables; The challenge generation module generates challenge information by the verifier using the control flow graph and standard measurement values, including instructions for generating random numbers and keys, and instructing the prover to perform static and control flow measurements; The static measurement module uses the random number and key in the challenge information to pseudo-randomly traverse the memory and generate static measurement values; The control flow measurement module records the operation list of the program from one checkpoint to the next checkpoint based on the control flow graph and the query information, calculates the hash value of the operation list, and generates the control flow measurement value; The key data integrity measurement module is used to capture the information of key variables during operation and send it to the measurement module, maintain a hash map, store key-value pairs of variable addresses and variable values, perform dynamic boundary checks, and generate key data integrity measurement values.