Fault injection attack method and device for signature algorithm

By introducing single-bit faults into the private key of the SM9 algorithm and using the comparative analysis of correct and incorrect signature results, the problem that SM9 national secret algorithm is difficult to attack in resource-limited environments in the existing technology is solved, low-cost and efficient private key recovery is achieved, and the security evaluation and protection capabilities of the cryptographic chip are improved.

CN120151008APending Publication Date: 2025-06-13SHENZHEN INST OF ADVANCED TECH CHINESE ACAD OF SCI +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510266704.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-07
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

The prior art is difficult to effectively carry out fault injection attacks on the SM9 national secret algorithm in resource-limited environments, and the existing attack methods require complex equipment and a large number of computing resources, and are less practical and operable.

Method used

By introducing a single-bit bit fault on the X coordinate of the private key of the SM9 algorithm, and combining the comparative analysis of the correct signature and wrong signature results, the complete private key is calculated.

Benefits of technology

It realizes effective recovery of private keys at low computing costs, simple operation, low computing resource requirements, high practicality and operability, and is suitable for the design and security evaluation of cryptographic chips.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120151008A_ABST
    Figure CN120151008A_ABST
Patent Text Reader

Abstract

The invention relates to the field of information security, in particular to a fault injection attack method and device for a signature algorithm. The method comprises the following steps: introducing a single-bit fault on an X coordinate of a private key; obtaining a correct signature result and a fault signature result of the target user; and comparing and analyzing the correct signature result and the wrong signature result, and calculating a complete private key. According to the method, a single-bit fault is introduced to the X coordinate of the private key, and the private key is effectively recovered by combining the comparative analysis of the correct signature result and the wrong signature result. The method is simple to operate, low in computing resource demand and high in practicability and operability, and provides a new view angle for design and security evaluation of the cryptographic chip. According to the method, a single-bit fault is introduced into the private key, and the private key can be effectively recovered at relatively low calculation cost by utilizing a known correct signature result and a known wrong signature result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security, and more particularly, to a fault injection attack method and apparatus for a signature algorithm. Background Art

[0002] With the increasing demand for information security, secure and trustworthy cryptographic chips play a crucial role in protecting sensitive data. The SM9 national cryptographic algorithm, as a Chinese self-developed identity-based cryptographic algorithm, is widely used in fields such as signature authentication, data encryption and decryption, and key exchange. Due to the characteristics of high efficiency, small parameters, and wide application range of the SM9 national cryptographic algorithm, it is particularly suitable for use in resource-constrained application environments such as the Internet of Vehicles. In recent years, the attack means against security chips have been continuously upgraded, and among them, fault injection attacks have become an important security threat. By injecting transient errors during the execution of the encryption algorithm, attackers can use these faults to infer the encryption key, thus threatening the overall security of the system. In order to improve the anti-attack ability of cryptographic chips, the State Cryptography Administration clearly stipulates in the "Cryptographic Detection Guidelines for Security Chips" that commercial cryptographic chips of high security levels must have the ability to resist fault injection attacks. Therefore, it is particularly important to study new error injection attack methods. This not only helps to identify and mitigate potential security risks in the early design stage, but also provides a reference for the defense mechanism of cryptographic chips.

[0003] The current research on attacks against the SM9 algorithm mainly focuses on the weaknesses of the algorithm parameters and the specific calculation process. Traditional attack methods usually require highly professional equipment and a large amount of computing resources, which makes them difficult to implement in practical applications. The existing attack techniques against the SM9 national cryptographic algorithm usually rely on complex calculation processes and high-performance computing resources, and are difficult to implement in resource-constrained environments. Some attack methods require special experimental equipment and conditions, which makes these methods difficult to operate and verify in practical applications. Some scholars use side-channel attacks to collect and analyze a large amount of data, such as power consumption analysis and electromagnetic radiation analysis. These side-channel attack methods require long-term observation and a large amount of data collection to deduce the private key information, and the process is complex and the data volume is huge. Due to the need for high-end equipment and complex calculations, the practicality and operability of existing methods are relatively low, and it is difficult to be widely applied in actual attack and defense tests. Summary of the Invention

[0004] Embodiments of the present invention provide a fault injection attack method and apparatus for a signature algorithm, which can effectively recover the private key at a relatively low computational cost.

[0005] According to an embodiment of the present invention, a fault injection attack method for a signature algorithm is provided, including the following steps:

[0006] S101: Introduce a single-bit fault on the X coordinate of the private key;

[0007] S102: Obtain the correct signature result and the faulty signature result of the target user;

[0008] S103: Compare and analyze the correct signature result and the incorrect signature result to calculate the complete private key.

[0009] Further, in step S101, during the private key operation of the SM9 national cryptography algorithm, introduce a single-bit fault on the X coordinate of the private key.

[0010] Further, in step S101, introducing a single-bit fault includes, during the private key signature process, by attacking the X component of the private key to disrupt the correct execution of the algorithm.

[0011] Further, in step S103, use the difference equation to calculate the complete private key.

[0012] Further, in step S102, signature generation includes the following steps:

[0013] Let the message to be signed be the bit string M. To obtain the digital signature (h, S) of the message M, the user A as the signer should implement the following operation steps:

[0014] A1: Calculate the element g in the group G T as g = e(P 1 , P pub-s )

[0015] A2: Generate a random number r ∈ [1, N - 1];

[0016] A3: Calculate the element w in the group G T as w = g r , and convert the data type of w to a bit string;

[0017] A4: Calculate the integer h = H 2 (M || w, N);

[0018] A5: Calculate the integer l = (r - h) mod N. If l = 0, then return to A2;

[0019] A6: Calculate the element S in the group G 1 as S = [l]ds A ;

[0020] A7: The signature of the message M is (h, S).

[0021] Further, in step S101, fault introduction includes:

[0022] Step 1: Ensure that there is a fully functional SM9 algorithm, including signature and signature verification functions; run the algorithm to obtain the correct signature result S(X S ,Y S ) = [l]dS A (X,Y);

[0023] Step 2: Calculate the correct elliptic curve parameters based on the signature result

[0024] Step 3: Perform a fault injection attack on the private key. Assume that a 1-bit 0-1 flip occurs, denoted as dS' A (X',Y');

[0025] Step 4: Re-run the algorithm to calculate the incorrect signature result S'(X' S ,Y' S ) = [l']dS' A (X',Y');

[0026] Step 5: Calculate the incorrect elliptic curve parameters based on the incorrect signature result

[0027] Step 6: Substitute and into their respective elliptic curves; establish the equations:

[0028] Y 2 = X 3 + b

[0029] Y' 2 = X' 3 + b'

[0030] Y = Y'

[0031] Step 7: Let X' = (X + 2 n ), n ∈ [0 - 255]; establish the differential equation for X and X':

[0032] X 3 + b - X' 3 - b' = Y - Y'

[0033]

[0034] Step 8: Substitute n ∈ [0 - 255], let A = 3·2 n , B = 3·2 2n , Δ = B 2 - 4AC (mod q), and obtain:

[0035]

[0036] Transform the equation:

[0037] (2AX+B) 2 =Δ(modq)

[0038] Calculate 2AX+B=ω, then:

[0039]

[0040] Step 9: Pass Y 2 =X 3 +b Calculates the value of Y.

[0041] Furthermore, the fault introduction also includes:

[0042] Step 10: The private key pair obtained by the combined calculation is the original private key that was cracked through normal signature verification, and the private key is successfully recovered.

[0043] According to another embodiment of the present invention, a fault injection attack device for a signature algorithm is provided, comprising:

[0044] A fault introduction unit, used to introduce a single-bit fault on the X coordinate of the private key;

[0045] A result acquisition unit, used to acquire a correct signature result and a faulty signature result of a target user;

[0046] The comparison calculation unit is used to compare and analyze the correct signature result and the incorrect signature result to calculate the complete private key.

[0047] A storage medium stores a program file capable of implementing any of the above-mentioned fault injection attack methods for a signature algorithm.

[0048] A processor is used to run a program, wherein when the program is running, any one of the above-mentioned fault injection attack methods for a signature algorithm is executed.

[0049] The fault injection attack method and device for the signature algorithm in the embodiment of the present invention effectively recovers the private key by introducing a single-bit fault on the X coordinate of the private key and combining the comparative analysis of the correct signature and the incorrect signature results. This method is simple to operate, has low computing resource requirements, has high practicality and operability, and provides a new perspective for the design and security assessment of cryptographic chips. The present invention can effectively recover the private key at a lower computing cost by introducing a single-bit fault in the private key and using the known correct signature results and incorrect signature results. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The accompanying drawings described herein are used to provide a further understanding of the present invention and form a part of this application. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0051] Figure 1 is a flowchart of the fault injection attack method for the signature algorithm of the present invention;

[0052] Figure 2 is a flowchart of the SM9 signature algorithm in the fault injection attack method for the signature algorithm of the present invention;

[0053] Figure 3 is a flowchart of the SM9 fault injection attack in the fault injection attack method for the signature algorithm of the present invention;

[0054] Figure 4 is a module diagram of the fault injection attack device for the signature algorithm of the present invention. Detailed Embodiments

[0055] In order to enable those skilled in the art of the present technology to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0056] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above accompanying drawings are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order different from those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily need to be limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0057] Embodiment 1

[0058] According to an embodiment of the present invention, a fault injection attack method for a signature algorithm is provided. Refer to Figure 1 , including the following steps:

[0059] S101: Introduce a single-bit fault on the X coordinate of the private key;

[0060] S102: Obtain the correct signature result and the faulty signature result of the target user;

[0061] S103: Compare and analyze the correct signature result and the faulty signature result to calculate the complete private key.

[0062] In the fault injection attack method for the signature algorithm in the embodiments of the present invention, a single-bit fault is introduced on the X coordinate of the private key, and through the comparative analysis of the correct signature and the faulty signature results, the private key can be effectively recovered. This method is simple to operate and has low computational resource requirements, with high practicality and operability, providing a new perspective for the design and security evaluation of cryptographic chips. By introducing a single-bit fault in the private key and using the known correct signature result and faulty signature result, the present invention can effectively recover the private key at a low computational cost.

[0063] The following uses specific embodiments to elaborate in detail on the fault injection attack method for the signature algorithm of the present invention:

[0064] Aiming at the shortcomings of the prior art, the present invention proposes an attack method based on single-bit fault injection. This method introduces a single-bit fault on the X coordinate of the SM9 private key and, through the comparative analysis of the correct signature and the faulty signature results, effectively recovers the private key. This method is simple to operate and has low computational resource requirements, with high practicality and operability, providing a new perspective for the design and security evaluation of cryptographic chips. The technical problem to be solved by the present invention is how to attack the private key in the signature process of the SM9 national cryptographic algorithm through a simple and effective method. By introducing a single-bit fault in the private key and using the known correct signature result and faulty signature result, the private key can be effectively recovered at a low computational cost.

[0065] Specifically, this method analyzes by introducing a single-bit fault and using the known correct signature and faulty signature results, significantly reducing the computational resource requirements, enabling effective implementation even on ordinary computing devices; it does not require complex experimental equipment and special conditions, only needs to inject a fault into one bit of the private key to achieve the attack, greatly simplifying the experimental conditions; it simplifies the attack process, uses the change in the signature result brought about by the fault injection to simplify the mathematical derivation and calculation steps, making the attack process more intuitive and efficient. The present invention overcomes some of the shortcomings of the prior art through a simple and effective fault injection attack method, and can effectively attack the SM9 private key under low computational resources and simple experimental conditions, thereby enhancing the evaluation and protection capabilities of the security of cryptographic chips.

[0066] The basic principle of this method is to inject a single-bit fault into the X coordinate of the private key during the private key operation of the SM9 national cryptographic algorithm. Then, by obtaining the correct signature and the faulty signature results of the target user, the complete private key is calculated using differential equations. This method simplifies the attack process and reduces the computational resource requirements, with high practicality and operability.

[0067] The detailed description of the technical solution of the present invention is as follows:

[0068] SM9 signature generation algorithm:

[0069] Let the message to be signed be the bit string M. To obtain the digital signature (h, S) of the message M, the user A as the signer should perform the following operation steps, see Figure 2 :

[0070] A1: Calculate the element g in the group G T as g = e(P 1 , P pub-s );

[0071] A2: Generate a random number r ∈ [1, N - 1];

[0072] A3: Calculate the element w in the group G T as w = g r , and convert the data type of w to a bit string;

[0073] A4: Calculate the integer h = H 2 (M || w, N);

[0074] A5: Calculate the integer l = (r - h) mod N. If l = 0, then return to A2;

[0075] A6: Calculate the element S in the group G 1 as S = [l]ds A ;

[0076] A7: The signature of the message M is (h, S).

[0077] Attack method:

[0078] The core method of the present invention is to introduce a single-bit fault into the private key of the SM9 algorithm while ensuring that the information in other positions is not affected. The specific method is to disrupt the correct execution of the algorithm by attacking the X component of the private key during the SM9 signature process. Through fault injection, an incorrect signature result is generated, and combined with the known correct signature result, differential analysis is performed using these signature pairs to recover the X component of the private key, and finally, through mathematical reasoning and algorithm implementation, the complete private key is successfully recovered, see Figure 3 , and the specific steps are as follows:

[0079] Step 1: Ensure that there is a fully functional and operational SM9 algorithm, including signature and signature verification functions. Run the algorithm to obtain the correct signature result S(X S ,Y S ) = [l]dS A (X,Y);

[0080] Step 2: Calculate the correct elliptic curve parameters based on the signature result

[0081] Step 3: Perform a fault injection attack on the private key. Assume that a 1-bit 0-1 flip occurs, denoted as dS' A (X',Y');

[0082] Step 4: Re-run the algorithm to calculate the incorrect signature result S'(X' S ,Y' S ) = [l']dS' A (X',Y');

[0083] Step 5: Calculate the incorrect elliptic curve parameters based on the incorrect signature result

[0084] Step 6: Substitute and into their respective elliptic curves. Establish the equations:

[0085] Y 2 = X 3 + b

[0086] Y' 2 = X' 3 + b'

[0087] Y = Y'

[0088] Step 7: Let X' = (X + 2 n ), n ∈ [0 - 255]. Subtract the second equation from the first equation to establish a difference equation for X and X':

[0089] X 3 + b - X' 3 - b' = Y - Y'

[0090]

[0091] Step 8: Substitute n ∈ [0 - 255]. At this time, the present invention transforms the complex problem of solving the private key by fault injection attack into the problem of solving a unary quadratic equation. Let A = 3·2 n , B = 3·2 2n , Δ = B 2-4AC(modq), we get:

[0092]

[0093] Since high-dimensional division on elliptic curves is very difficult to calculate, the equation is transformed:

[0094] (2AX+B) 2 =Δ(modq)

[0095] At this time, in the finite field F q Taking the square root is a highly complex task, and the choice of square root algorithm depends on the structural characteristics of the finite field. In this experiment, q≡5(mod8), which determines the appropriate algorithm for calculating the square root. When the present invention calculates a square root ω, the other square root is q-ω. The specific details are shown in Table 1 below.

[0096] Table 1

[0097]

[0098] Through the above algorithm, 2AX+B=ω can be successfully calculated. At this time:

[0099]

[0100] Step 9: Use the same algorithm as above to calculate 2 =X 3 +b calculates the value of Y;

[0101] Step 10: The private key pair obtained by the combined calculation can be used to verify the original private key that was cracked, thus successfully recovering the private key.

[0102] The key points and intended protection points of the present invention are:

[0103] 1. The conditions and methods for attacking private key recovery by injecting a single-bit fault into the private key of the SM9 signature algorithm;

[0104] 2. After the fault is injected, the correct signature result and the incorrect signature result are used for differential analysis to recover the private key.

[0105] Compared with the prior art, the advantages of the present invention are:

[0106] The error injection attack target of the present invention is the private key in the SM9 signature algorithm. By injecting a single-bit fault, the private key can be effectively restored through differential analysis of the faulty signature and the correct signature result. This method has a significant cracking efficiency compared to traditional channel measurement methods such as step-by-step search or guessing the private key, and can accurately obtain the private key at a lower computing cost.

[0107] The present invention has been verified by experiments, and the experimental code is written in Python. The experimental results are consistent with the theoretical analysis, proving that the method is feasible. The specific experimental steps and methods are as follows:

[0108] This experiment strictly follows the parameters of SM9 General Rules, and the signature algorithm and signature verification algorithm have been strictly reviewed to prove their correctness. The preparation phase data includes the key generation phase of KGC, specifically the generators of G1 and G2, the signature master private key, the signature master public key, and the signature private key. The details are shown in Table 2-4 below:

[0109] Table 2 Key generation phase data

[0110]

[0111] The attack begins:

[0112] Table 3 Signature private key data before and after the attack

[0113]

[0114]

[0115] Through the above attack model, the present invention obtains the following data:

[0116] Table 4 Experimental results

[0117]

[0118] By combining the signature pair and verifying the signature, we know that X,Y 1 is the recovered signature private key. At this point, the attack experiment is completed.

[0119] Example 2

[0120] According to another embodiment of the present invention, a fault injection attack device for a signature algorithm is provided. Figure 4 ,include:

[0121] A fault introduction unit 201, used to introduce a single-bit fault on the X coordinate of the private key;

[0122] A result acquisition unit 202 is used to acquire a correct signature result and a faulty signature result of a target user;

[0123] The comparison calculation unit 203 is used to compare and analyze the correct signature result and the incorrect signature result to calculate the complete private key.

[0124] In the fault injection attack device for the signature algorithm in the embodiments of the present invention, a single-bit fault is introduced into the X coordinate of the private key, and through the comparative analysis of the correct signature and the wrong signature results, the private key can be effectively recovered. This method is simple to operate, has low computational resource requirements, and has high practicability and operability, providing a new perspective for the design and security evaluation of cryptographic chips. The present invention can effectively recover the private key at a low computational cost by introducing a single-bit fault into the private key and using the known correct signature result and wrong signature result.

[0125] The following takes specific embodiments to elaborate in detail on the fault injection attack device for the signature algorithm of the present invention:

[0126] Aiming at the shortcomings of the prior art, the present invention proposes an attack device based on single-bit fault injection. The device introduces a single-bit fault into the X coordinate of the SM9 private key, and through the comparative analysis of the correct signature and the wrong signature results, the private key can be effectively recovered. This method is simple to operate, has low computational resource requirements, and has high practicability and operability, providing a new perspective for the design and security evaluation of cryptographic chips. The technical problem to be solved by the present invention is how to attack the private key in the signature process of the SM9 national cryptographic algorithm through a simple and effective method. By introducing a single-bit fault into the private key and using the known correct signature result and wrong signature result, the private key can be effectively recovered at a low computational cost.

[0127] Specifically, the device analyzes by introducing a single-bit fault and using the known correct signature and wrong signature results, significantly reducing the demand for computational resources, so that it can be effectively implemented on ordinary computing devices; it does not require complex experimental equipment and special conditions, and only needs to inject a fault into one bit of the private key to achieve the attack, greatly simplifying the experimental conditions; it simplifies the attack process, and uses the change in the signature result brought by the fault injection to simplify the mathematical derivation and calculation steps, making the attack process more intuitive and efficient. The present invention overcomes some of the shortcomings of the prior art through a simple and effective fault injection attack device, and can effectively attack the SM9 private key under low computational resources and simple experimental conditions, thereby enhancing the evaluation and protection capabilities of the security of cryptographic chips.

[0128] The basic principle of the device is to inject a single-bit fault into the X coordinate of the private key during the private key operation process of the SM9 national cryptographic algorithm, and then calculate the complete private key by using the differential equation through obtaining the correct signature and the faulty signature results of the target user. This method simplifies the attack process, reduces the demand for computational resources, and has high practicability and operability.

[0129] The detailed elaboration of the technical solution of the present invention is as follows:

[0130] SM9 Signature Generation Algorithm:

[0131] Let the message to be signed be the bit string M. To obtain the digital signature (h, S) of the message M, the user A as the signer should implement the following operation steps. See Figure 2 :

[0132] A1: Calculate the element g in the group G T as g = e(P 1 , P pub-s );

[0133] A2: Generate a random number r ∈ [1, N - 1];

[0134] A3: Calculate the element w in the group G T as w = g r , and convert the data type of w to a bit string;

[0135] A4: Calculate the integer h = H 2 (M||w, N);

[0136] A5: Calculate the integer l = (r - h) mod N. If l = 0, then return to A2;

[0137] A6: Calculate the element S in the group G 1 as S = [l]ds A ;

[0138] A7: The signature of the message M is (h, S).

[0139] Attack Method:

[0140] The core method of the present invention is to introduce a single-bit fault into the private key of the SM9 algorithm while ensuring that the information in other positions is not affected. The specific method is to attack the X component of the private key during the SM9 signature process to disrupt the correct execution of the algorithm. Through fault injection, an incorrect signature result is generated, and combined with the known correct signature result, differential analysis is performed using these signature pairs to recover the X component of the private key, and finally, through mathematical reasoning and algorithm implementation, the complete private key is successfully recovered. See Figure 3 , and the specific steps are as follows.

[0141] The first step: Ensure that there is a fully functional SM9 algorithm that can run normally, including signature and signature verification functions. Run the algorithm to obtain the correct signature result S(X S , Y S ) = [l]dS A (X, Y);

[0142] The second step: Calculate the correct elliptic curve parameters according to the signature result

[0143] Step 3: Conduct a fault injection attack on the private key. Assume a 1-bit 0-1 flip occurs, denoted as dS'. A (X', Y');

[0144] Step 4: Re-run the algorithm and calculate the incorrect signature result S'(X' S , Y' S ) = [l']dS' A (X', Y');

[0145] Step 5: Calculate the incorrect elliptic curve parameters based on the incorrect signature result

[0146] Step 6: Substitute and into their respective elliptic curves. Establish the equations:

[0147] Y 2 = X 3 + b

[0148] Y' 2 = X' 3 + b'

[0149] Y = Y'

[0150] Step 7: Let X' = (X + 2 n ), n ∈ [0 - 255]. Subtract the second equation from the first one to establish a difference equation for X and X':

[0151] X 3 + b - X' 3 - b' = Y - Y'

[0152]

[0153] Step 8: Substitute n ∈ [0 - 255]. At this time, the present invention transforms the complex problem of solving the private key through fault injection attack into a problem of solving a unary quadratic equation. Let A = 3·2 n , B = 3·2 2n , Δ = B 2 - 4AC (mod q), and obtain:

[0154]

[0155] Since the division in high dimensions on the elliptic curve is very difficult to calculate, transform the equation:

[0156] (2AX + B) 2 = Δ (mod q)

[0157] At this time, in the finite field Fq Taking the square root in it is a highly complex task, and the choice of the square root algorithm depends on the structural characteristics of the finite field. In this experiment, q ≡ 5 (mod 8), which determines the appropriate algorithm for calculating the square root. When the present invention calculates a square root ω, the other square root is q - ω. The specific details are as shown in Algorithm in Table 1 below.

[0158] Table 1

[0159]

[0160]

[0161] Through the above algorithm, 2AX + B = ω can be successfully calculated. At this time:

[0162]

[0163] Step 9: Similarly, using the above algorithm, calculate the value of Y through Y 2 = X 3 + b;

[0164] Step 10: By combining the calculated private key pairs, the one that can pass the normal signature verification is the original private key that has been cracked, and thus the private key is successfully restored.

[0165] The key points and points to be protected in the present invention are:

[0166] 1. Conditions and attack methods for attacking the private key recovery by injecting single-bit faults into the private key in the SM9 signature algorithm;

[0167] 2. A method for recovering the private key by using differential analysis of the correct signature result and the wrong signature result after the fault injection.

[0168] Compared with the prior art, the advantages of the present invention are:

[0169] The object of the error injection attack in the present invention is the private key in the SM9 signature algorithm. By injecting single-bit faults, the private key can be effectively recovered through differential analysis of the faulty signature and the correct signature result. This method has significantly higher cracking efficiency than traditional side-channel methods such as gradually searching or speculating on the private key, and can accurately obtain the private key at a lower computational cost.

[0170] The present invention has been verified by experiments. The experimental code is written in Python, and the experimental results are consistent with the theoretical analysis, proving that this method is feasible. The specific experimental steps and methods are as follows:

[0171] This experiment strictly follows the parameters of SM9 General Rules, and the signature algorithm and signature verification algorithm have been strictly reviewed to prove their correctness. The preparation phase data includes the key generation phase of KGC, specifically the generators of G1 and G2, the signature master private key, the signature master public key, and the signature private key. The details are shown in Table 2-4 below:

[0172] Table 2 Key generation phase data

[0173]

[0174] The attack begins:

[0175] Table 3 Signature private key data before and after the attack

[0176]

[0177] Through the above attack model, the present invention obtains the following data:

[0178] Table 4 Experimental results

[0179]

[0180] By combining the signature pair and verifying the signature, we know that X,Y 1 is the recovered signature private key. At this point, the attack experiment is completed.

[0181] Example 3

[0182] A storage medium stores a program file capable of implementing any one of the above-mentioned fault injection attack methods for a signature algorithm.

[0183] Example 4

[0184] A processor is used to run a program, wherein when the program is running, any one of the above-mentioned fault injection attack methods for a signature algorithm is executed.

[0185] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0186] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0187] In several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the system embodiments described above are merely illustrative. For example, the division of units can be a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be through some interfaces. The indirect couplings or communication connections of units or modules can be in electrical or other forms.

[0188] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0189] In addition, in each embodiment of the present invention, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0190] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in each embodiment of the present invention. The foregoing storage medium includes: various media such as USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs that can store program codes.

[0191] The above are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.

Claims

1. A fault injection attack method for a signature algorithm, characterized in that: The following steps are involved: S101: Introduce a single-bit fault on the X coordinate of the private key; S102: Obtain the correct signature result and the faulty signature result of the target user; S103: Compare and analyze the correct signature result and the incorrect signature result to calculate the complete private key.

2. The fault injection attack method for the signature algorithm according to claim 1, characterized in that: In step S101, a single-bit fault is introduced on the X coordinate of the private key during the private key calculation process of the SM9 national encryption algorithm.

3. The fault injection attack method for a signature algorithm according to claim 1, characterized in that: In step S101, introducing a single-bit fault includes destroying the correct execution of the algorithm by attacking the X component of the private key during the private key signing process.

4. The fault injection attack method for a signature algorithm according to claim 1, characterized in that: In step S103, a complete private key is calculated using a differential equation.

5. The fault injection attack method for a signature algorithm according to claim 1, characterized in that: In step S102, signature generation includes the following steps: Suppose the message to be signed is a bit string M. In order to obtain the digital signature (h, S) of message M, user A as the signer should implement the following operation steps: A1: Calculate group G T The element g=e(P1,P pub-s ); A2: Generate a random number r∈[1,N-1]; A3: Calculate group G T The element w=g r , convert the data type of w to a bit string; A4: Calculate the integer h=H2(M||w,N); A5: Calculate the integer l = (rh) mod N. If l = 0, return to A2. A6: Calculate the element S = [l]ds in the group G1 A ; A7: The signature of message M is (h, S).

6. The fault injection attack method for a signature algorithm according to claim 1, characterized in that: In step S101, fault introduction includes: Step 1: Ensure that there is a fully functional and normal SM9 algorithm, including signature and verification functions; run the algorithm to obtain the correct signature result S(X S ,Y S )=[l]dS A (X,Y); Step 2: Calculate the correct elliptic curve parameters based on the signature result Step 3: Perform a fault injection attack on the private key. Assume that a 1-bit 0-1 flip occurs, denoted as dS' A (X',Y'); Step 4: Re-run the algorithm and calculate the error signature result S'(X' S ,Y' S )=[l']dS' A (X',Y'); Step 5: Calculate the wrong elliptic curve parameters based on the wrong signature result Step 6: and Substitute the respective elliptic curves; establish the equation: Y 2 =X 3 +b Y' 2 =X' 3 +b' Y=Y' Step 7: Order X'=(X+2 n ), n∈[0-255]; establish the difference equation for X and X': X 3 +b-X' 3 -b'=Y-Y' Step 8: Substitute n∈[0-255] and set A=3·2 n ,B=3·2 2n , Δ=B 2 -4AC(modq), we get: Transform the equation: (2AX+B) 2 =Δ(modq) Calculate 2AX+B=ω, then: Step 9: Pass Y 2 =X 3 +b Calculates the value of Y.

7. The fault injection attack method for a signature algorithm according to claim 6, characterized in that: Fault introduction also includes: Step 10: The private key pair obtained by the combined calculation is the original private key that was cracked through normal signature verification, and the private key is successfully recovered.

8. A fault injection attack device for a signature algorithm, characterized in that: include: A fault introduction unit, used to introduce a single-bit fault on the X coordinate of the private key; A result acquisition unit, used to acquire a correct signature result and a faulty signature result of a target user; The comparison calculation unit is used to compare and analyze the correct signature result and the incorrect signature result to calculate the complete private key.

9. A storage medium, characterized in that: The storage medium stores a program file capable of implementing the fault injection attack method for the signature algorithm as described in any one of claims 1 to 7.

10. A processor, characterized in that: The processor is used to run a program, wherein the program, when running, executes the fault injection attack method for the signature algorithm described in any one of claims 1 to 7.