Quantitative evaluation and optimization methods for software and hardware system security

By constructing control and data flow diagrams, identifying attack surfaces and risks, developing security defense mechanisms, and optimizing defense measures, we solve the problem of difficulty in assessing security risks and costs of software and hardware systems, minimize system security risks and costs, and improve Safety and security.

CN117744095BActive Publication Date: 2024-09-03ZHUHAI ZHANXIN SEMICON CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410118184.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-29
Publication Date
2024-09-03
Estimated Expiration
2044-01-29

AI Technical Summary

Technical Problem

It is difficult to effectively assess and optimize the security risks and related costs of software and hardware systems with existing technology. Especially when faced with complex security requirements and diverse attack scenarios, the lack of a systematic security defense mechanism makes the system vulnerable to attacks and vulnerabilities. Frequent.

Method used

This paper proposes a quantitative security assessment and optimization method for software and hardware systems. By constructing control and data flow diagrams, identifying attack surfaces, assessing risks and costs, developing security defense mechanisms, and optimizing defense measures to minimize system security risks and related costs. Specific steps include identifying attack surfaces, assessing risks, developing security defense mechanisms, updating attack costs, evaluating the total cost of defense measures, and selecting a defense subset that minimizes the total cost.

Benefits of technology

It achieves quantitative assessment and optimization of security risks and related costs of software and hardware systems, preventively eliminates vulnerabilities, increases attack costs, reduces the probability of successful attacks, reduces value losses caused by security vulnerabilities, and improves system security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117744095B
    Figure CN117744095B
Patent Text Reader

Abstract

The present invention proposes a quantitative assessment and optimization method for the security of software and hardware systems, which includes a quantitative assessment method for system security risks and related costs, a system security analysis method based on control and data flows, and a system security optimization design method: given a system #imgabs0#, find a subgroup #imgabs2# from a set of security defense mechanisms #imgabs1# so that the system security risks and related costs are minimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of security assessment, and in particular to a method for quantitative security assessment and optimization of software and hardware systems. Background Art

[0002] Secure systems are implemented at many levels. At each level, the security strength of the security mechanisms is evaluated based on the assumption that the underlying implementation meets a given set of security requirements, which are then enforced at lower levels.

[0003] There is a complex set of security requirements, most notably confidentiality, integrity, and availability (aka CIA).

[0004] Confidentiality requires that a system not leak more information than expected. Cryptographic primitives are based on two foundations: secret cryptographic keys and a certain degree of randomness. Most software and hardware today implement pseudo-random number generation. An attacker can break cryptographic primitives by gaining knowledge of the cryptographic key or the predictability of the pseudo-random numbers.

[0005] Integrity requires that the system does not perform more or less than expected. Existing verification techniques, such as testing, ensure that the system does not perform less than expected. Ensuring that the system does not perform more than expected is a much more difficult problem. Formal verification helps, but is not a complete solution.

[0006] Especially in the software and hardware implementation of security systems, there are different levels of security risks, as shown below:

[0007]

[0008]

[0009] In operation, security products are often designed and manufactured at trusted sites and deployed at untrusted sites where attackers may have physical access to the products, which poses various risks.

[0010] 1. An attacker may compromise the confidentiality of the system by collecting and analyzing leaked information from various output channels, including power consumption and timing performance.

[0011] 2. An attacker may be able to compromise the integrity of the system by inserting enhancements in multiple input channels.

[0012] 3. An attacker can compromise the integrity and confidentiality of the internal nodes of a security system by exploiting the existence of signal propagation paths from inputs and / or to outputs. The attacker nodes of a security system can hold confidential or secret information, such as encryption keys, or provide critical functions, such as enabling security mechanisms such as encryption and authentication. A large number of internal nodes exist, and their combination forms the internal state of the security system. The combination of these internal states forms high-order internal states, which are exploited by, for example, high-order differential power analysis (DPA). Therefore, a system security assurance procedure is very necessary. Without proper security design, it is easy for an adversary to break into a security system. There are many vulnerabilities.

[0013] (a) An attacker may tamper with the system's memory contents and launch malicious programs. For example, in a stack-corruption code injection attack, malicious code is sent to the heap disguised as data, and then the attacker tampers with the procedure return address in the stack to execute the malicious code.

[0014] (b) An attacker can inject transient faults into the internal nodes of an IC through radiation or illumination from a laser pointer

[45] , or tamper with many physical settings such as clock frequency or supply voltage.

[0015] (c) Test circuits, such as scan chains, are powerful attack paths for IC internal nodes.

[0016] (d) In StarBleed, the attacker tampers with the encrypted FPGA configuration bitstream so that the 32-bit string in the bitstream is written in plaintext to the WBSTAR register on the FPGA and can subsequently be read out by another bitstream.

[0017] (e) In MeltDown, the attacker executes an indirect memory addressing instruction that accesses a prohibited memory address and uses the memory contents to calculate another memory address to access. In most existing processors, the privilege checking mechanism invalidates the instruction that prohibits memory access, but leaves a side effect that the memory contents of the second address are cached. The attacker then performs a cache timing side channel attack to find out the second memory address that contains the memory contents of the first address. The attacker does this by accessing multiple memory addresses and finding the memory address that has a shorter access time because its contents have been cached. By repeating this process, the attacker is able to access the entire physical memory space and bypass the privilege checking mechanism. Many variations that exploit the side effects of transient instruction speculative execution are proposed in Spectre.

[0018] Security risks exist in the design and manufacture of security systems, where almost all software and hardware components are susceptible to tampering and IP theft.

[0019] 1. VLSI design company's competitors may

[0020] (a) Compromise the integrity of a VLSI design or install a hardware Trojan horse that acts as a logic bomb or information leakage backdoor and embeds enhancements in the logic without regard to known embedded subliminal information such as IP copyright protection watermarks, unused states of finite state machines, or malicious instruction sequences; or

[0021] (b) Compromising the confidentiality of VLSI designs through IP theft.

[0022] 2. The contract manufacturer's adversaries can

[0023] (a) Compromise the integrity of a VLSI chip by installing a hardware Trojan horse; or (b) Compromise the confidentiality of a VLSI design by reverse engineering.

[0024] To this end, a security defense mechanism is needed for security protection. However, for security products running in a larger system, they may be in a diverse environment and may be subject to unknown attacks. Without sufficient understanding of this larger context, it is very challenging to develop security defense mechanisms and ensure security requirements.

[0025] VLSI testing includes ATPG, applying stimulus, running the circuit under test in test mode, and collecting and verifying responses. Under the fault model, stimulus is generated until the expected fault coverage is achieved. Similarly, security defense mechanisms against security attacks need to be designed by collecting and verifying responses.

[0026] However, security defenders do not know all possible security attack scenarios. When designing a secure system or applying security checks, security attacks may be dormant (for example, in the form of a Trojan horse), imminent, or even in the development stage.

[0027] However, security attacks have certain common characteristics, which help increase the coverage of attacks when developing security defense mechanisms.

[0028] First, consider an attack surface or a set of attack targets or vulnerabilities, such as system inputs (including various physical settings), outputs (including various side channels), and internal key components of the security system, on which security attacks are carried out, for example, to compromise confidentiality and / or integrity, and security defense mechanisms based on cryptographic primitives can be effectively applied to prevent such attacks.

[0029] This attack surface can be related to security boundaries, such as the scope of confidential information, including channels for information leakage; and the scope of privileged execution, including the source of control and the root of authenticity. Analysis of privileged control and confidential data propagation helps to identify such security boundaries and pinpoint vulnerabilities such as entry and exit points of privileged control and confidential data scopes. In addition, side channels have different sources of information leakage, such as the difference in power consumption or timing performance between two internal states of the system. They require different analysis methods, such as finding the difference in power consumption or timing performance between two internal states.

[0030] Additionally, consider attack paths that lead to attack surfaces, such as sequences of events that lead to successful attacks or security breaches, information leaks or communication channels for command and control, authentication chains, boot sequences, or signal propagation paths in hardware systems through which an attacker drives signals to or reads signals from inputs, outputs, or internal critical components of a security system. Identifying and removing such paths can prevent attacks that exploit that path.

[0031] To do this by designing for integrity, secure system designers can identify the attack path and disable it or protect it using cryptographic primitives, for example, authentication, encryption, or integrity verification in VLSI test and FPGA configuration.

[0032] Without sufficient knowledge of possible attack methods and attack paths, safety system designers may need to further protect the internal state of the safety system. Techniques include:

[0033] 1. Limiting logic doesn't care,

[0034] 2. Disable unused finite states.

[0035] 3.Static code encryption in XOM security processors,

[0036] 4. Static code integrity verification, such as CODESSEAL, SP, SPEF and AEGIS security processors,

[0037] 5. Dynamic code integrity verification based on classic control flow checking techniques, such as basic path signature analysis that checks the integrity of basic code blocks based on hashes in REM security processors,

[0038] 6. Dynamic integrity verification of sampled signal sequences of hardware systems based on cryptographic checksums, such as the TEA architecture, and from classic fault-tolerant design techniques, for example, error detection / correction codes (EDC / ECC) for soft errors can be enhanced to cryptographic checksums against adversary tampering. At the system level, fault-tolerant computing usually requires redundant execution of programs in watchdog coprocessors, such as redundant multithreading (RMT) in multi-core systems, which compares the outputs of submitted instructions. Lock-step concurrency checking schemes further compare internal states of each cycle, such as program control flow, hardware control signals, memory accesses, and the rationality of results. These techniques can be enhanced with cryptographic primitives to resist adversary tampering.

[0039] On the basis of the above, for confidentiality design, that is, for confidentiality, it is necessary to identify attack paths, such as from the output to the internal nodes containing confidential or secret information, and remove or protect them through cryptographic primitives such as authentication of sufficient strength.

[0040] Additionally, attack surfaces like system outputs need to be protected by cryptographic primitives like encryption. Attack surfaces may include a large number of internal states and combinations of internal states or higher-order internal states, such as in high-order differential power analysis. Such internal states need to be identified and information leakage from such internal states needs to be minimized. For example,

[0041] 1. For power analysis, power consumption differences need to be identified and minimized, for example, by hiding, masking, or new logic styles;

[0042] 2. For timing side-channel attacks, it is necessary to identify and minimize differences in timing performance.

[0043] Furthermore, randomness is the basis of most, if not all, cryptographic primitives today. In most VLSI simplifications today, true randomness needs to be achieved, not pseudo-random number generation.

[0044] Security products are usually designed and manufactured at trusted sites and deployed at untrusted sites, where attackers may have physical access to the product, which brings various risks, such as attackers may compromise the confidentiality of the system by collecting and analyzing leaked information from various output channels (including power consumption and timing performance), and attackers may destroy the integrity of the system by inserting enhancements in multiple input channels. Therefore, a system security assurance program is very necessary.

[0045] Without proper security design, it is easy for an adversary to break into a secure system. There are many vulnerabilities based on which an attacker can tamper with the system's memory contents and launch malicious programs. Summary of the invention

[0046] The purpose of the present invention is to provide a method for quantitatively evaluating the security of software and hardware systems and for optimizing them, that is, to provide a method for quantitatively evaluating system security risks and security-related costs, and a design method for minimizing system security risks and security-related costs.

[0047] To achieve the above objectives, the technical solution of the present invention is as follows.

[0048] Quantitative assessment and optimization methods for software and hardware system security, including the cost of security defense mechanisms and the expected value of value loss caused by security incidents of system components;

[0049] The cost of the security defense mechanism is:

[0050]

[0051] The above formula is used to assess the security risk and related costs of system M under a set of security defense mechanisms D, where i is a component of system M, E[v(i|D)] is the expected value of the value loss caused by a security incident of component i under a set of security defense mechanisms D, and d is a security defense mechanism in D, whose cost is C(d);

[0052] where E[v(i)]=v(i)P(A(i))

[0053] In the above formula, v(i) is the value of the risk in component i, and P(A(i)) is the probability of successfully carrying out attack A on component i;

[0054] The value loss v(i) caused by the security incident of component i includes the value v of the information that may be leaked from module i i (i) and any further material damage v to the safety system M that may result from a breach of the integrity of component i d (i) as follows:

[0055] v(i)=v i (i)+v d (i)

[0056] The probability of successfully carrying out an attack A on component i is P(A(i))=f(C(A)), where f(.) is a monotonically decreasing function and C(A) is the cost of attacking A.

[0057] Preferably, the f(.) is an inverse sigmoid function or f(.) is an inverse step function, that is:

[0058]

[0059] Preferably, the cost C(A) of implementing a successful security attack in a set of security attack schemes A is given by the minimum value of the cost among these schemes, that is:

[0060]

[0061] Preferably, the analysis of the security risk and associated costs of the system M is based on a control and data flow diagram, the control and data flow diagram being defined as G = (M, L data ,L ctrl ), where each node m∈M is a component in the system under study, L ctrl Each control transmission link or L data Each data transmission link in is directional.

[0062] Preferably, in the forward propagation starting from the confidential information node, the expected value loss v caused by information leakage is evaluated at the subsequent node j i (j) is given by the following expression:

[0063]

[0064] Where (i,j)∈L data is a data transmission link, security vulnerability a is an integrity vulnerability or information leakage. When security vulnerability a propagates forward from node i to subsequent node j under condition c(i,j), the probability P(a(j)) of security vulnerability a occurring at node j is given by the following expression:

[0065] P(a(j))=P(a(i))P(c(i,j))

[0066] The expected value loss at node j includes the expected value loss at the previous node i, the probability that the condition c(i, j) required for the security vulnerability a to propagate from node i to node j is satisfied, the expected value loss of node j itself, and the probability of a security incident occurring at node j.

[0067] Preferably, nodes with security risks include information that may be leaked and potential damage to the system under study. In the back propagation starting from these risky nodes, the expected value loss at node i is given by the following expression:

[0068]

[0069] where (i,j)∈L ctrl To control the transmission link, security vulnerability a is an integrity vulnerability or information leakage. When security vulnerability a propagates forward from node i to subsequent node j under condition c(i,j), the probability P(a(j)) of security vulnerability a occurring at node j is given by the following expression:

[0070] P(a(j))=P(a(i))P(c(i,j))

[0071] The expected value loss at node i includes the expected value loss at the subsequent node j, the probability that the condition c(i, j) required for the security vulnerability a to propagate from node i to node j is satisfied, the expected value loss of node i itself, and the probability of a security incident occurring at node i.

[0072] An optimization method, given a system M, finds a subset D from a set of security defense mechanisms D * , so that the security risk and the associated cost are minimized, wherein the security risk and the associated cost are given by the method of claim 2;

[0073] For a system M, the risk value v(i) of component i∈M, the adversary resource limit r, and the output is a set of security defenses D to be applied * , the method is:

[0074] a. Identify the attack surface, including input X, output Y, and internal key components i∈M;

[0075] b. Evaluate the attack surface risks v(X), v(Y), and v(i);

[0076] c. Identify possible security vulnerabilities A and assess their costs C(A);

[0077] d. Develop security defense mechanism D and evaluate its cost C(D);

[0078] e. Selecting a defensive subset

[0079] f. In defense If it exists, update the cost of attacking C(A|D′);

[0080] g. Evaluate the possibility of security vulnerabilities E(A|D′) based on r;

[0081] h. Evaluate the total cost associated with secure C(M|D′) in the presence of defense measure D′ and evaluate the total cost associated with secure C(M|D′) in the presence of a subset of defenses;

[0082] e. Choice and safety C(M|D * ) associated with the minimum total cost defense subset Choice and Safety C(M|D * ) is a subset of defenses associated with the minimum total cost.

[0083] Preferably, the total cost associated with the evaluation of safety C(M|D′) is a safety analysis, the input of which is the components in the system M, the control link Lctrl , data link L data , the risk value v(i) of the component, the attack surface, the leakage probability and the transmission condition c(i,j), the output is the assessment of vulnerability and critical path, the steps are as follows:

[0084] ①. Construct a control and data flow diagram;

[0085] ②. Identify risky value nodes, including secret and confidential information and critical functions;

[0086] ③. Identify attack surfaces, including information leakage exit points and integrity violation entry points;

[0087] ④. Assign the probability of security breaches and the conditions for control and data transmission;

[0088] ⑤. Forward propagation from the information leakage node to the information leakage exit point;

[0089] ⑥ Backward propagation from risky value nodes to integrity violation entry points;

[0090] ⑦. Assess vulnerabilities on the attack surface;

[0091] ⑧. Identify the critical path of the vulnerability.

[0092] Preferably, the safety analysis is a detailed step of step h, namely:

[0093] The step ① is to construct a control and data flow diagram G=(M,L data ,L ctrl ), where each node m∈M is a component in the system under study, L ctrl Each control transmission link or L data Each data transmission link in is directional.

[0094] Preferably, the steps ② and ③ are steps for security designers to identify the risk values ​​of certain nodes in the control and data flow diagrams, including the information that may be leaked. i (m) value, and the potential damage that could result from a disruption of the control link v d (m),security designers identify attack surfaces, including information leakage exit points, including power and timing side channels, and integrity violation entry points;

[0095] In step ④, the security designer will further allocate the probability of integrity damage or information leakage at certain nodes. There are more probabilities that meet the conditions for allowing data or control transmission. This probability is numerically estimated or symbolized.

[0096] Preferably, step ⑤ is to evaluate the expected value loss caused by information leakage on subsequent nodes in the forward propagation starting from the confidential information node; the expected value loss of information leakage on node j includes the expected value loss on the previous node i, the probability that the condition c(i, j) required for the security vulnerability a to propagate from node i to node j is satisfied, the expected value loss of node j itself, and the probability of a security incident occurring at node j;

[0097] Its expression is as follows:

[0098]

[0099] Where (i,j)∈L data For the data transmission link, the expected value loss of node j itself is as follows:

[0100] E[v i (j)]=v i (j)P(a(j))

[0101] v i (i) is the information value at node i, P(a(j)) is the probability of security vulnerability a occurring at node j. When security vulnerability a propagates forward from node i to subsequent node j under condition c(i,j), the probability P(a(j)) of security vulnerability a occurring at node j is expressed as:

[0102] P(a(j))=P(a(i))P(c(i,j))

[0103] Where P(a(i)) is the probability that security vulnerability a occurs in node i, and P(c(i,j)) is the probability that condition c(i,j) is satisfied;

[0104] Among them, security vulnerabilities a include integrity vulnerabilities or information leakage.

[0105] Preferably, in step ⑥, in the back propagation starting from the risky nodes including the information that may be leaked and the potential damage to the system, the expected value loss is accumulated on the nodes before them, and the expression of the expected value loss at node i is as follows:

[0106]

[0107] Where (i,j)∈L ctrl is the control transfer link. Security vulnerability a is an integrity vulnerability or information leakage. When security vulnerability a propagates from node i to subsequent node j under condition c(i,j), the probability P(a(j)) of security vulnerability a occurring at node j is given by the following expression:

[0108] P(a(j))=P(a(i))P(c(i,j))

[0109] The expected value loss at node i includes the expected value loss at the subsequent node j, the probability that the condition c(i, j) required for the security vulnerability a to propagate from node i to node j is satisfied, the expected value loss of node i itself, and the probability of a security incident occurring at node i.

[0110] Preferably, step ⑦ is to evaluate potential integrity violation entry points and information leakage exit points through their expected value losses. Based on the calculated expected value losses, the security defender will identify further integrity violation or information leakage vulnerabilities on certain internal nodes of the system.

[0111] Preferably, step ⑧ is to determine the critical path of the vulnerability, and the identified vulnerability and critical path are used as targets of countermeasures.

[0112] In the present invention, for risk value, the risk value of confidentiality leakage is measured by the value of possible information leakage.

[0113] The risk value of integrity breach is measured by the potential value loss that could result from a compromised security system.

[0114] For a given component i, there is a basic risk value v(i) of a security attack

[0115] v(i)=v i (i)+v d (i)

[0116] where v(i) is the value of information that may be leaked from module i, v d (i) is the further material damage that may be caused to the safety system under study due to the integrity violation of component i.

[0117] Integrity breaches may propagate through the system because a compromised component may compromise more components. Therefore, the expected total risk value of an integrity breach is measured by the sum of the base risk values ​​of components within the scope of the integrity breach. Integrity breaches may lead to subsequent confidentiality breaches. Therefore, the risk value of an integrity breach may include the risk value of all possible subsequent confidentiality breaches.

[0118] In ISO26262, there is a range of safety impacts: from component failure to hazardous or unexpected situations, to risk of injury or damage, to the required risk reduction based on the acceptable risk level. Similarly, the safety impact of a security vulnerability in a component of a safety system can be assessed based on the use case of the system and the risk value of the component can be assessed.

[0119] Based on the risk value of the components in the security system, we choose the security level to be achieved for the components. Given a security level, we consider the cost of launching a security attack and the cost of deploying a security defense solution.

[0120] In the present invention, for the attack cost, assuming there is a smart adversary, the cost C(A) of selecting a successful security attack from a set of successful security attack schemes A is given by the minimum value of the costs of these schemes.

[0121]

[0122] At the primitive level, the cost of a successful security attack on a cryptographic primitive (e.g., through cryptanalysis) is given by the algorithmic strength of the primitive, i.e., the key size, or the number of bits in the cryptographic primitive's key. A cryptographic primitive can be cracked if the cost of the attack is less than the cost of brute force or trying all possible 2N keys, where N is the key size.

[0123] At the hardware level, the cost of a successful security attack can be based on the cost to an attacker of driving or reading signals to or from input, output, or internal nodes, for example, leveraging existing controllability and observability measures in VLSI testing.

[0124] Based on the above, the expected value loss of the present invention is given by the following formula:

[0125] E[v(i)]=v(i)P(A(i))

[0126] Where v(i) is the risk value of module i, and P(A) is the probability of a security vulnerability or the probability of selecting a security attack from a set of security attack scenarios A. P(A) decreases as the cost of conducting a security attack C(A) increases.

[0127] P(A(i))=f(C(A))

[0128] where f(.) is a monotonically decreasing function. Given a limit r on the resources that an attacker may spend on an attack, f(.) can be given by an inverse step function:

[0129]

[0130] Or it can be an approximation of the inverse step function mentioned above, such as the inverse sigmoid function.

[0131] Since the existence of security defense mechanisms affects the cost of attack, the likelihood of breach, the adversary’s resource limitations, and / or the expected value loss of a security breach, they further impose costs, for this purpose.

[0132] For the total security-related costs, we consider the expected value loss caused by security vulnerabilities (e.g., including the cost of fixing security vulnerabilities, as defined in (3), and the cost of security defense, including the cost of developing, deploying, and operating security mechanisms).

[0133] The total cost associated with system safety is

[0134] C(M|D)=∑ i∈M E[v(i)|D]+∑ d∈D C(d)

[0135] where i is a component in the security system M under study, E[v(i)|D] is the expected value loss caused by a security vulnerability in component i in the presence of a set of security defense mechanisms D, D is a security defense mechanism in group D, and C(d) is the cost of D.

[0136] In the present invention, the safety design can be expressed as the following optimization problem.

[0137] That is, given a security system M, find a subgroup D from a set of security defense mechanisms D * , so that the total cost related to security is minimized, that is:

[0138]

[0139] This is an NP-hard combinatorial problem, but can be solved with lower complexity in some special cases. In practice, a greedy algorithm can be applied.

[0140] Advantages of the present invention:

[0141] 1. A preventive security mechanism is one that completely eliminates a vulnerability, or effectively increases the cost of a particular attack to infinity, for example, by identifying and removing paths for an attacker to access and / or tamper with inputs, outputs, or internal nodes. For example, StarBleed can be removed by resetting the WBSTAR register; MeltDown can be eliminated by invalidating a cache line updated by an invalid instruction.

[0142] 2. Mitigation security mechanisms increase the cost of successfully conducting specific types of security attacks without completely preventing the security vulnerability from occurring, such as moving target defense through address space layout randomization (ASLR), or randomization against side-channel analysis.

[0143] 3. Detective security checks performed shortly before a security attack reduce the time-to-check-to-time-of-use (TOCTTOU), or the attacker’s resource limit r, thereby reducing the attacker’s probability of launching a successful attack.

[0144] 4. Performing detective security checks after a security breach does not increase the cost of a security attack, as detected security attacks are still counted as successful attacks, while it may help reduce the value loss caused by the security breach.

[0145] Without prior knowledge of attack scenarios, applying security checks more frequently can reduce the expected value loss caused by security vulnerabilities. Security checks come at a cost though. A simple solution is to perform security checks immediately before critical tasks to reduce the time of check to time of use (TOCTTOU). In general, security checks can be scheduled to minimize the total cost, including the expected value loss and the cost of security checks. BRIEF DESCRIPTION OF THE DRAWINGS

[0146] Figure 1 Forward propagation security analysis based on control and data flow graphs.

[0147] Figure 2 Security analysis for backpropagation based on control and data flow graphs.

[0148] Figure 3 Schematic diagram of the FPGA architecture of Example 1 of the present invention.

[0149] Figure 4 This is a control and data flow diagram of the secure FPGA of embodiment 1 of the present invention.

[0150] Figure 5 This is a control and data flow diagram of the processor of embodiment 2 of the present invention. DETAILED DESCRIPTION

[0151] The present invention is described in detail below with reference to the accompanying drawings.

[0152] like Figure 1-2 As shown, the quantitative assessment and optimization methods of software and hardware system security include the cost of security defense mechanisms and the expected value of value loss caused by security incidents of system components;

[0153] The cost of the security defense mechanism is:

[0154]

[0155] The above formula is used to assess the security risk and related costs of system M under a set of security defense mechanisms D, where i is a component of system M, E[v(i|D)] is the expected value of the value loss caused by a security incident of component i under a set of security defense mechanisms D, and d is a security defense mechanism in D, whose cost is C(d);

[0156] where E[v(i)]=v(i)P(A(i))

[0157] In the above formula, v(i) is the value of the risk in component i, and P(A(i)) is the probability of successfully carrying out attack A on component A;

[0158] The value loss v(i) caused by the security incident of component i includes the value v of the information that may be leaked from module i i (i) and any further material damage v to the safety system M that may result from a breach of the integrity of component i d (i) as follows:

[0159] v(i)=v i (i)+v d (i)

[0160] The probability of successfully carrying out an attack A on component i is P(A(i))=f(C(A)), where f(.) is a monotonically decreasing function and C(A) is the cost of attacking A.

[0161] Preferably, the f(.) is an inverse sigmoid function or f(.) is an inverse step function, that is:

[0162]

[0163] Preferably, the cost C(A) of implementing a successful security attack in a set of security attack schemes A is given by the minimum value of the cost among these schemes, that is:

[0164]

[0165] Preferably, the analysis of the security risk and associated costs of the system M is based on a control and data flow diagram, the control and data flow diagram being defined as G = (M, L data ,L ctrl ), where each node m∈M is a component in the system under study, L ctrl Each control transmission link or L data Each data transmission link in is directional.

[0166] Preferably, in the forward propagation starting from the confidential information node, the expected value loss v caused by information leakage is evaluated at the subsequent node j i (j) is given by the following expression:

[0167]

[0168] Where (i,j)∈L datais a data transmission link, security vulnerability a is an integrity vulnerability or information leakage. When security vulnerability a propagates forward from node i to subsequent node j under condition c(i,j), the probability P(a(j)) of security vulnerability a occurring at node j is given by the following expression:

[0169] P(a(j))=P(a(i))P(c(i,j))

[0170] The expected value loss at node j includes the expected value loss at the previous node i, the probability that the condition c(i, j) required for the security vulnerability a to propagate from node i to node j is satisfied, the expected value loss of node j itself, and the probability of a security incident occurring at node j.

[0171] Preferably, nodes with security risks include information that may be leaked and potential damage to the system under study. In the back propagation starting from these risky nodes, the expected value loss at node i is given by the following expression:

[0172]

[0173] where (i,j)∈L ctrl To control the transmission link, security vulnerability a is an integrity vulnerability or information leakage. When security vulnerability a propagates forward from node i to subsequent node j under condition c(i,j), the probability P(a(j)) of security vulnerability a occurring at node j is given by the following expression:

[0174] P(a(j))=P(a(i))P(c(i,j))

[0175] The expected value loss at node i includes the expected value loss at the subsequent node j, the probability that the condition c(i, j) required for the security vulnerability a to propagate from node i to node j is satisfied, the expected value loss of node i itself, and the probability of a security incident occurring at node i.

[0176] An optimization method, given a system M, finds a subset D from a set of security defense mechanisms D * , so that the security risk and the associated cost are minimized, wherein the security risk and the associated cost are given by the method of claim 2;

[0177] For a system M, the risk value v(i) of component i∈M, the adversary resource limit r, and the output is a set of security defenses d to be applied * , the method is:

[0178] a. Identify the attack surface, including input X, output Y, and internal key components i∈M;

[0179] b. Evaluate the attack surface risks v(X), v(Y), and v(i);

[0180] c. Identify possible security vulnerabilities A and assess their costs C(A);

[0181] d. Develop security defense mechanism D and evaluate its cost C(D);

[0182] e. Selecting a defensive subset

[0183] f. In defense If it exists, update the cost of attacking C(A|D′);

[0184] g. Evaluate the possibility of security vulnerabilities E(A|D′) based on r;

[0185] h. Evaluate the total cost associated with secure C(M|D′) in the presence of defense measure D′ and evaluate the total cost associated with secure C(M|D′) in the presence of a subset of defenses;

[0186] e. Choice and safety C(M|D * ) associated with the minimum total cost defense subset Choice and Safety C(M|D * ) is a subset of defenses associated with the minimum total cost.

[0187] Preferably, the assessment and security C(M|S * ) is the total cost of the safety analysis, the input of which is the components in the system M and the control link L ctrl , data link L data , the risk value v(i) of the component, the attack surface, the leakage probability and the transmission condition c(i,j), the output is the assessment of vulnerability and critical path, the steps are as follows:

[0188] ①. Construct a control and data flow diagram;

[0189] ②. Identify risky value nodes, including secret and confidential information and critical functions;

[0190] ③. Identify attack surfaces, including information leakage exit points and integrity violation entry points;

[0191] ④. Assign the probability of security breaches and the conditions for control and data transmission;

[0192] ⑤. Forward propagation from the information leakage node to the information leakage exit point;

[0193] ⑥ Backward propagation from risky value nodes to integrity violation entry points;

[0194] ⑦. Assess vulnerabilities on the attack surface;

[0195] ⑧. Identify the critical path of the vulnerability.

[0196] Preferably, the safety analysis is a detailed step of step h, namely:

[0197] The step ① is to construct a control and data flow diagram G=(M,L data ,L ctrl ), where each node m∈M is a component in the system under study, L ctrl Each control transmission link or L data Each data transmission link in is directional.

[0198] Preferably, the steps ② and ③ are steps for security designers to identify the risk values ​​of certain nodes in the control and data flow diagrams, including the information that may be leaked. i (m) value, and the potential damage that could result from a disruption of the control link v d (m),security designers identify attack surfaces, including information leakage exit points, including power and timing side channels, and integrity violation entry points;

[0199] In step ④, the security designer will further allocate the probability of integrity damage or information leakage at certain nodes. There are more probabilities that meet the conditions for allowing data or control transmission. This probability is numerically estimated or symbolized.

[0200] Preferably, step ⑤ is to evaluate the expected value loss caused by information leakage on subsequent nodes in the forward propagation starting from the confidential information node; the expected value loss of information leakage on node j includes the expected value loss on the previous node i, the probability that the condition c(i, j) required for the security vulnerability a to propagate from node i to node j is satisfied, the expected value loss of node j itself, and the probability of a security incident occurring at node j;

[0201] Its expression is as follows:

[0202]

[0203] Where (i,j)∈L data For the data transmission link, the expected value loss of node j itself is as follows:

[0204] E[v i (j)]=v i (j)P(a(j))

[0205] v i(i) is the information value at node i, P(a(j)) is the probability of security vulnerability a occurring at node j. When security vulnerability a propagates forward from node i to subsequent node j under condition c(i,j), the probability P(a(j)) of security vulnerability a occurring at node j is expressed as:

[0206] P(a(j))=P(a(i))P(c(i,j))

[0207] Where P(a(i)) is the probability that security vulnerability a occurs in node i, and P(c(i,j)) is the probability that condition c(i,j) is satisfied;

[0208] Among them, security vulnerabilities a include integrity vulnerabilities or information leakage.

[0209] Preferably, in step ⑥, in the back propagation starting from the risky nodes including the information that may be leaked and the potential damage to the system, the expected value loss is accumulated on the nodes before them, and the expression of the expected value loss at node i is as follows:

[0210]

[0211] Where (i,j)∈L ctrl is the control transfer link. Security vulnerability a is an integrity vulnerability or information leakage. When security vulnerability a propagates from node i to subsequent node j under condition c(i,j), the probability P(a(j)) of security vulnerability a occurring at node j is given by the following expression:

[0212] P(a(j))=P(a(i))P(c(i,j))

[0213] The expected value loss at node i includes the expected value loss at the subsequent node j, the probability that the condition c(i, j) required for the security vulnerability a to propagate from node i to node j is satisfied, the expected value loss of node i itself, and the probability of a security incident occurring at node i.

[0214] Preferably, step ⑦ is to evaluate potential integrity violation entry points and information leakage exit points through their expected value losses. Based on the calculated expected value losses, the security defender will identify further integrity violation or information leakage vulnerabilities on certain internal nodes of the system.

[0215] Preferably, step ⑧ is to determine the critical path of the vulnerability, and the identified vulnerability and critical path are used as targets of countermeasures.

[0216] First, in this embodiment, a system security design is given. Its input is: system M, risk value v(i) of component i∈M, and adversary resource r. Its output is: a set of security defenses D to be applied *.

[0217] It is impossible to consider all possible security attack scenarios. In order to increase the coverage of security attack scenarios, we first consider an attack surface, including the input, output, and internal key components of the designed system. The input and output of the system include various channels. Some internal components of the system store confidential or secret information, or have critical functions, such as allowing access to confidential information or executing key cryptographic primitives.

[0218] The risk value of each channel on the attack surface is then assessed, including input X (including various physical settings), output Y (including various side channels), and internal key modules in the system under design, including the value of any information that may be leaked, and the potential damage to the system in the application if the system under design is compromised by an adversary.

[0219] Then possible security vulnerabilities are identified and their cost C(A) is assessed for the adversary, for example in a penetration test. Considering all possible attack scenarios is impossible, so the cost of the attack may be underestimated here.

[0220] Then develop a security defense mechanism D and evaluate its cost C(D).

[0221] Then, select the defensive subset Here, a combination of multiple defense mechanisms can be considered. In general, finding the optimal one is NP-hard, which reflects the complexity of the problem. Parallel processing can be applied to multiple defense subsets in subsequent steps.

[0222] Then update the attack cost C(A|D′) of each defense D′ subset.

[0223] Further evaluation in defense The probability of a security vulnerability occurring when a subset exists is P(A′|D′).

[0224] Further evaluation in defense The total cost associated with securing C(M|D′) in the presence of a subset.

[0225] Then choose and safety C(M|D * ) The minimum total cost defense associated with A subset of .

[0226] The above method provides a generally applicable solution to the above NP-hard optimization problem.

[0227] Then, a greedy algorithm is used in the above security design. For system M, the risk value v(i) of component i∈M, the adversary resource limit r, the output is a set of security defense mechanisms D to be applied. The specific steps are as follows:

[0228] I. Identify the attack surface, including input X, output Y, and internal key components i∈M;

[0229] II. Evaluate the values ​​of risks v(X), v(Y), and v(i) on the attack surface;

[0230] III. Identify possible security vulnerabilities A and assess their costs C(A);

[0231] IV. Choose a security defense mechanism D and include d in D;

[0232] V. Update the cost of attacking C(A|D) in the presence of defense D;

[0233] VI. Evaluate the possibility of security vulnerabilities E(A|D) based on r;

[0234] VII. Evaluate the security risks and associated costs C(M|D) in the presence of defense D;

[0235] VIII. If you are not satisfied with the safety risk and related costs C(M|D), go to step IV. If you are satisfied, go to the next step.

[0236] Ⅸ. Get defense plan D and exit.

[0237] Security analysis based on control and data flow

[0238] This paper presents a security analysis algorithm based on control and data flow, which is the key to the defense of system security design. The details of the total cost associated with security C(M|D′) in the presence of a subset and the evaluation of the security risk and the associated cost C(M|D) in the presence of defense D in the adopted greedy algorithm are as follows:

[0239] First, the security designer constructs a control and data flow diagram G = (M, L data ,L ctrl ), where each node m∈M is a component in the system under study, L ctrl Each control transmission link or L data Each data transmission link in is directional.

[0240] Security designers identify the risk value of certain nodes in the control and data graph, including the information that may be leaked. i (m) value, and the potential damage that could result from a disruption of the control link v d (m).

[0241] Security designers identify attack surfaces, including information leakage exit points, such as system output Y, including power and timing side channels, and integrity violation entry points, such as system input X.

[0242] Security designers further assign the probability of integrity breach or information leakage at certain nodes, as well as the conditions for control and data transmission. There are further probabilities of satisfying the conditions for allowing control or data transmission. This probability can be either numerically estimated or symbolic.

[0243] Then, it propagates forward from the information leakage node to the information leakage exit point, and backward from the risky value node to the integrity violation entry point to evaluate the vulnerabilities on the attack surface and identify the critical path of the vulnerability.

[0244] like Figure 1 As shown, in the forward propagation starting from the confidential information node, the expected value loss caused by information leakage is evaluated at the subsequent nodes. The expected value loss of information leakage at node j is given by the following expression

[0245]

[0246] Where (i,j)∈L data For data transmission links,

[0247] E[v i (j)]=v i (j)P(a(j))

[0248] v i (i) is the information value at node i. Note that a node may contain confidential information from multiple sources. Conditional probabilities may apply. Note that when a security vulnerability a (integrity vulnerability or information leakage) propagates forward from node i to subsequent node j with condition c(i, j), the probability P(a(j)) of security vulnerability a occurring at node j is

[0249] P(a(j))=P(a(i))P(c(i,j))

[0250] Where P(a(i)) is the product of the probabilities of information leakage at node i, and P(c(i,j)) is the probability of satisfying condition c(i,j), assuming that the conditions are independent, otherwise conditional probability applies.

[0251] like Figure 2 As shown, in the back propagation starting from these nodes with risk value (including possible leaked information and potential damage to the system under study), the expected value loss is accumulated on the nodes before them. The expected value loss at node i is given by the following expression

[0252]

[0253] Where (i,j)∈L ctrl Control transfer link.

[0254] Potential integrity violation entry points and information leakage exit points are evaluated by their expected value loss. Based on the calculated expected value loss, security defenders may identify further integrity violation or information leakage vulnerabilities at certain internal nodes of the system.

[0255] Identify critical paths to vulnerabilities. These identified vulnerabilities and critical paths can be targeted with countermeasures.

[0256] Example 1: A secure FPGA example

[0257] refer to Figure 3 , Figure 3 A secure FPGA architecture is shown. In the storage of this FPGA, there is a set of security lock bits used to set the FPGA configuration mode; a password to verify the FPGA configuration mode change; and an ES key.

[0258] This FPGA has the following three configuration modes and four use cases.

[0259] Plain text configuration: In a trusted facility, the simplest configuration method using a plain text bit stream can be applied.

[0260] Password Protection: After the initial plaintext bitstream configuration in the previous mode, the FPGA is set to a mode that prohibits any further reprogramming unless the correct password is provided. This requires writing the password to the FPGA and setting the security lock bit to this mode.

[0261] Encrypted and Authenticated Bitstream: Only an encrypted and authenticated bitstream can be programmed into the FPGA at an untrusted site, such as a contract manufacturer site or in the field at a customer location. To enable this mode, at a trusted site, write the AES key and password to the FPGA and set the security lock bit to this mode.

[0262] One-Time Programmable: The FPGA is no longer programmable. This is achieved by setting the security lock bit to a mode that disables any further reprogramming, which then disables the password matching function. Applying the control and data flow based security analysis is as follows.

[0263] Passwords and AES keys are recognized as confidential, while the security lock bit and password matching features provide key functionality, see Figure 4 ,A control and data flow graph was constructed including the components of these secret and critical ,functions as nodes, and the control links between them.

[0264] An attack surface is identified, including brute force guessing of JTAG input passwords, power analysis attacks on AES keys, fault injection of password matching outputs and security lock bits. Further, an integrity violation (tampering) node is included at the receiving end of the graph.

[0265] No forward propagation is required because there is no data transmission link, i.e., the password and AES key are not propagated except in two information leakage channels, respectively by brute force attacks on the password and power analysis attacks on the AES key, as Figure 4 As shown by the dotted line in .

[0266] Backward propagation starts from the last node where integrity is violated and determines a complex additional path:

[0267] (a) Obtaining AES keys from power analysis attacks;

[0268] (b) The password is subject to brute force attack;

[0269] (c) From fault injection attack to password matching results;

[0270] (d) From error injection attack to secure lock position;

[0271] (e) From fault injection attacks to plaintext mode holders.

[0272] Brute force password cracking has a very low success rate. Power analysis and fault injection attacks have a considerable success rate. Fault injection into a secure lock bit may have a lower success rate than fault injection into a unit at the output of a password matching signature, or into a unit holding a plain text configuration mode. These security risks cannot be ignored.

[0273] Countermeasures include fixing power consumption side channels, protecting cryptographic matching outputs, security lock bits, plaintext pattern holders, and other critical components from fault injection attacks, for example through redundancy in error correction codes.

[0274] Taking these countermeasures may require further quantitative evaluation.

[0275] Embodiment 2: This embodiment provides a secure processor

[0276] The control and data flow based security analysis is applied on the processor as follows.

[0277] refer to Figure 5 ,First, a graph based on control and data flow is constructed, including ,instruction issue, execution and commit units, register files, instruction cache, data cache, memory, and network interface.

[0278] Identifies a secret in memory, such as a cryptographic key. The key is identified by Figure 3The data transfer links shown by the dashed lines in the figure are to the data cache, register file, and execution unit. There are further control links from memory to the instruction cache, issue unit, and execution unit. We identify the data cache as a node for information leakage, for example by a cache timing side channel. We further identify the execution unit as a node for information leakage, for example by a power analysis side channel. We identify instructions in memory as integrity violation entry points.

[0279] The keys from memory propagate forward to the data cache where the cache timing side channel is located, and to the execution units where the power consumption side channel is located.

[0280] From this datapath propagates backwards to the problem unit, instruction cache, and memory.

[0281] This suggests that the attacker runs a program that sends the key from memory to the data cache or execution unit, such as in MeltDown, Spectre, or power analysis attacks.

[0282] Countermeasures include:

[0283] (a) Prevent the adversary from running the program;

[0284] (b) fixed cache timing side channels, such as invalidating the associated cache line when canceling an instruction;

[0285] (c) Fixed power consumption side channel.

[0286] Taking these countermeasures may require further quantitative evaluation.

[0287] The above is a detailed description of the present invention in combination with specific embodiments, and it cannot be determined that the specific implementation methods of the present invention are limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, making several equivalent substitutions or obvious modifications without departing from the concept of the present invention, and having the same performance or use, should be regarded as belonging to the patent protection scope of the present invention determined by the submitted claims.

Claims

1. A method for quantitative safety assessment and optimization of software and hardware systems, characterized by: This includes the cost of security defense mechanisms and the expected value of the loss of value caused by security incidents of system components; The cost of the security defense mechanism is: The above formula is used to assess the security risk and related costs of system M under a set of security defense mechanisms D, where i is a component of system M, E[v(i|D)] is the expected value of the value loss caused by a security incident of component i under a set of security defense mechanisms D, and d is a security defense mechanism in D, whose cost is C(d); where E[v(i)]=v(i)P(A(i)) In the above formula, v(i) is the value of the risk in component i, and P(A(i)) is the probability of successfully carrying out attack A on component i; The value loss v(i) caused by the security incident of component i includes the value v of the information that may be leaked from module i i (i) and any further material damage v to the safety system M that may result from a breach of the integrity of component i d (i) as follows: v(i)=v i (i)+v d (i) The probability of successfully carrying out an attack A on component i is P(A(i))=f(C(A)), where f(.) is a monotonically decreasing function and C(A) is the cost of attacking A; The f(.) is an inverse sigmoid function or f(.) is an inverse step function, that is: The cost C(A) of implementing a successful security attack in a set of security attack schemes A is given by the minimum cost among these schemes, that is: The analysis of the safety risk and associated costs of the system M is based on the control and data flow diagram, which is defined as G = (M, L data ,L ctrl ), where each node m∈M is a component in the system under study, L ctrl Each control transmission link or L data Each data transmission link in is directional; In the forward propagation starting from the confidential information node, the expected value loss v caused by information leakage is evaluated at the subsequent node j i (j) is given by the following expression: Where (i,j)∈L data is a data transmission link, security vulnerability a is an integrity vulnerability or information leakage. When security vulnerability a propagates forward from node i to subsequent node j under condition c(i,j), the probability P(a(j)) of security vulnerability a occurring at node j is given by the following expression: P(a(j))=P(a(i))P(c(i,j)) The expected value loss at node j includes the expected value loss at the previous node i, the probability that the security vulnerability a propagates from node i to node j and the condition c(i, j) is satisfied, the expected value loss of node j itself, and the probability of a security incident occurring at node j; Nodes with security risks include information that may be leaked and potential damage to the system under study. In the back propagation starting from these risky nodes, the expected value loss at node i is given by the following expression: where (i,j)∈L ctrl To control the transmission link, security vulnerability a is an integrity vulnerability or information leakage. When security vulnerability a propagates forward from node i to subsequent node j under condition c(i,j), the probability P(a(j)) of security vulnerability a occurring at node j is given by the following expression: P(a(j))=P(a(i))P(c(i,j)) The expected value loss at node i includes the expected value loss at the subsequent node j, the probability that the security vulnerability a propagates from node i to node j and the condition c(i, j) is satisfied, the expected value loss of node i itself, and the probability of a security incident occurring at node i; Optimization method, given a system M, find a subgroup D from a set of security defense mechanisms D * , so that the security risk and the associated cost are minimized, where the security risk and the associated cost are given by the above method; For a system M, the risk value v(i) of component i∈M, the adversary resource limit r, and the output is a set of security defenses D to be applied * , the method is: a. Identify the attack surface, including input X, output Y, and internal key components i∈M; b. Evaluate the attack surface risks v(X), v(Y), and v(i); c. Identify possible security vulnerabilities A and assess their costs C(A); d. Develop security defense mechanism D and evaluate its cost C(D); e. Selecting a defensive subset f. In defense If it exists, update the cost of attacking C(A|D′); g. Evaluate the possibility of security vulnerabilities E(A|D′) based on r; h. Evaluate the total cost associated with secure C(M|D′) in the presence of defense measure D′ and evaluate the total cost associated with secure C(M|D′) in the presence of a subset of defenses; e. Choice and safety C(M|D * ) associated with the minimum total cost defense subset Choice and Safety C(M|D * ) is a subset of defenses associated with the minimum total cost.

2. The method for quantitatively evaluating and optimizing software and hardware system security according to claim 1, characterized in that: The total cost associated with safety C(M|D′) is evaluated as the safety analysis, the input of which is the components in the system M, the control link L ctrl , data link L data , the risk value v(i) of the component, the attack surface, the leakage probability and the transmission condition c(i,j), the output is the assessment of vulnerability and critical path, the steps are as follows: ①. Construct a control and data flow diagram; ②. Identify risky value nodes, including secret and confidential information and critical functions; ③. Identify attack surfaces, including information leakage exit points and integrity violation entry points; ④. Assign the probability of security breaches and the conditions for control and data transmission; ⑤. Forward propagation from the information leakage node to the information leakage exit point; ⑥ Backward propagation from risky value nodes to integrity violation entry points; ⑦. Assess vulnerabilities on the attack surface; ⑧. Identify the critical path of the vulnerability.

3. The method for quantitatively evaluating and optimizing software and hardware system security according to claim 2, characterized in that: The safety analysis is the detailed steps of step h, namely: The step ① is to construct a control and data flow diagram G=(M,L data ,L ctrl ), where each node m∈M is a component in the system under study, L ctrl Each control transmission link or L data Each data transmission link in is directional.

4. The method for quantitatively evaluating and optimizing software and hardware system security according to claim 3, characterized in that: Steps ② and ③ are steps for security designers to identify the risk values ​​of certain nodes in the control and data flow diagrams, including the information that may be leaked. i (m) value, and the potential damage that could result from a disruption of the control link v d (m),security designers identify attack surfaces, including information leakage exit points, including power and timing side channels, and integrity violation entry points; In step ④, the security designer will further allocate the probability of integrity damage or information leakage at certain nodes. There are more probabilities that meet the conditions for allowing data or control transmission. This probability is numerically estimated or symbolized.

5. The method for quantitatively evaluating and optimizing software and hardware system security according to claim 4, characterized in that: The step ⑤ is to evaluate the expected value loss caused by information leakage on subsequent nodes in the forward propagation starting from the confidential information node; the expected value loss of information leakage on node j includes the expected value loss on the previous node i, the probability that the condition c(i, j) required for the security vulnerability a to propagate from node i to node j is satisfied, the expected value loss of node j itself, and the probability of a security incident occurring at node j; Its expression is as follows: Where (i,j)∈L data For the data transmission link, the expected value loss of node j itself is as follows: E[v i (j)]=in i (j)P(a(j)) v i (i) is the information value at node i, P(a(j)) is the probability of security vulnerability a occurring at node j. When security vulnerability a propagates forward from node i to subsequent node j under condition c(i,j), the probability P(a(j)) of security vulnerability a occurring at node j is expressed as: P(a(j))=P(a(i))P(c(i,j)) Where P(a(i)) is the probability that security vulnerability a occurs in node i, and P(c(i,j)) is the probability that condition c(i,j) is satisfied; Among them, security vulnerabilities a include integrity vulnerabilities or information leakage.

6. The method for quantitatively evaluating and optimizing software and hardware system security according to claim 5, characterized in that: The step ⑥ is that in the back propagation starting from the risky nodes including the information that may be leaked and the potential damage to the system, the expected value loss is accumulated on the nodes before them, and the expression of the expected value loss at node i is as follows: Where (i,j)∈L ctrl To control the transmission link, security vulnerability a is an integrity vulnerability or information leakage. When security vulnerability a propagates forward from node i to subsequent node j under condition c(i,j), the probability P(a(j)) of security vulnerability a occurring at node j is given by the following expression: P(a(j))=P(a(i))P(c(i,j)) The expected value loss at node i includes the expected value loss at the subsequent node j, the probability that the condition c(i, j) required for the security vulnerability a to propagate from node i to node j is satisfied, the expected value loss of node i itself, and the probability of a security incident occurring at node i.

7. The method for quantitatively evaluating and optimizing software and hardware system security according to claim 6, characterized in that: The step ⑦ is to evaluate the potential integrity violation entry points and information leakage exit points through their expected value losses. Based on the calculated expected value losses, the security defender will identify further integrity violation or information leakage vulnerabilities at certain internal nodes of the system.

8. The method for quantitatively evaluating and optimizing software and hardware system security according to claim 7, characterized in that: The step ⑧ is to determine the critical path of the vulnerability, and the identified vulnerability and critical path are used as the target of the countermeasure.