A secret key signature method against side channel attacks

By introducing random noise into the commercial cryptographic signature process to disrupt the signature time distribution, the problem of insufficient protection against side-channel attacks in existing technologies is solved, and the system's anti-attack capability is improved.

CN122372215APending Publication Date: 2026-07-10GUIZHOU WUJIANG HYDROPOWER DEV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUIZHOU WUJIANG HYDROPOWER DEV
Filing Date
2026-04-17
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing commercial cryptographic signature schemes are insufficiently protected against side-channel attacks, especially timing analysis attacks. Attackers can recover private keys by measuring the time or power consumption trajectory of signature operations, thus threatening system security.

Method used

Random noise is introduced during the signing process. By adding delayed random noise to the commercial cryptographic signature algorithm, the signing operation time is made to be randomly distributed, preventing attackers from guessing the private key by measuring the time.

Benefits of technology

It improves the system's ability to resist side-channel attacks, especially timing analysis attacks, prevents the leakage of private key information, and enhances the security of signature operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122372215A_ABST
    Figure CN122372215A_ABST
Patent Text Reader

Abstract

This invention relates to a commercial cryptographic signature method resistant to side-channel attacks, comprising the following steps: Step 1: Network configuration initialization: Key generation and transaction signing in the system both occur within a designated network; Step 2: Private key conversion and public key generation: Incoming data is converted to an integer using the private key sk and a private key sk object is constructed. The corresponding public key is derived based on elliptic curve cryptography rules; Step 3: Public key and address generation: A hash operation is performed on the public key to generate a public key hash value. Combined with the address format generated by the version, a locking script is constructed based on the public key hash; Step 4: Noise injection operation: A delayed random noise is added during the commercial signature process. By injecting random noise into the signature algorithm, side-channel information is disrupted, preventing attackers from inferring the user's secret data based on the time information leaked during the transaction process, thus improving the system's ability to resist side-channel attacks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of commercial cryptographic signature technology, specifically a commercial cryptographic signature method resistant to side-channel attacks. Background Technology

[0002] Side-channel attacks (SCA) are attack methods that infer secret information by analyzing physical information (such as execution time, power consumption, and electromagnetic radiation) leaked during the execution of cryptographic operations by cryptographic devices or systems. Unlike traditional cryptanalysis, side-channel attacks do not rely on mathematical weaknesses in algorithms but rather exploit information leaks at the physical implementation level, thus posing a serious threat to many cryptographic systems. In commercial cryptographic applications such as finance, government affairs, and the Internet of Things, commercial cryptographic algorithms based on elliptic curve cryptography (ECC) (such as SM2) are widely used for digital signatures. The core operations of these algorithms, such as scalar multiplication and modular inversion, often have execution time or power consumption that is correlated with the bit values ​​of the operands (especially the private key). Attackers can effectively recover the complete private key by accurately measuring the time of multiple signature operations or collecting their power consumption trajectories, and by using statistical analysis techniques (such as differential power analysis, correlation power analysis, and time series analysis). This allows them to forge signatures, steal assets, or compromise system integrity. Existing commercial cryptographic signature schemes, especially software-based implementations, often focus on functional correctness and computational efficiency, while neglecting protection against side-channel attacks, particularly time series analysis attacks. The signature operation process is fixed, and the execution time of critical operations may depend on the specific bit pattern of the private key, which provides attackers with the opportunity to perform time series analysis. Summary of the Invention

[0003] To address the aforementioned technical problems, this invention provides a commercial cryptographic signature method resistant to side-channel attacks.

[0004] To achieve the above objectives, the present invention provides the following technical solution: A commercial cryptographic signature method resistant to side-channel attacks includes the following steps: Step 1: Complete network configuration initialization: Key generation and transaction signing in the system both take place within the specified network; Step 2: Private key conversion and public key generation: Convert the incoming data into an integer using the private key sk and construct a private key sk object. Derive the corresponding public key based on elliptic curve cryptography rules. Step 3: Generate public key and address: Perform a hash operation on the public key to generate a public key hash value, combine it with the address format generated by the version, and construct a locking script based on the public key hash; Step 4: Perform noise injection: Add delayed random noise during the business signature process; Step 5: Generate a business signature: Obtain the hash value of the input specified by the private key to form an unlocking script. Combine the unlocking script with the locking script and call Step 4 during the business signature generation process. The time delay in the signing process is randomized to prevent attackers from guessing the private key by measuring the operation time. Finally, return the signature result. Step Six: Evaluation and Detection: Set up an evaluation algorithm to evaluate the system's ability to resist side-channel attacks, using time imbalance as an indicator.

[0005] Furthermore, the network configuration initialization in step one includes the following steps: S11: Set network type: Determine whether the current operating environment is the main network or the test network, and load the corresponding address prefix and transaction format rules accordingly; S12: Initialize cryptographic parameters: Load the system parameters for the elliptic curve and configure the hash algorithm used for key generation and signature calculation; S13: Loading transaction and script execution rules: Establishing standard transaction input / output structures and P2PKH script templates; S14: Write the cryptographic parameters into the system runtime context to ensure that subsequent private key generation, public key derivation and transaction signing operations are all performed in a unified network configuration environment.

[0006] Furthermore, the step two of converting the incoming data into an integer using the private key sk includes: during the private key generation process, receiving the input hexadecimal format private key sk, converting the hexadecimal string into the corresponding integer form according to the numerical parsing method with a base of 16, and inputting the integer as the private key parameter.

[0007] Furthermore, the locking script in step three is specifically as follows: S21: Data preparation: The script reads and copies the public key data provided in the unlocking script; S22: Identity verification: Perform a hash operation on the copied public key to generate its public key hash value, and compare the calculated public key hash value with the public key hash value set in the locking script in the transaction output; S23: Authorization Verification: After the public key hash comparison is successful, the script will use the verified public key to verify the digital signature provided in the unlocking script and the current transaction data.

[0008] Furthermore, the random delay noise mentioned in step S4 is implemented through a random number generation mechanism, and the delay duration is a random value within the range of 0 to 0.005 seconds.

[0009] Furthermore, the noise injection described in step four is performed before the commercial cryptographic signature calculation begins and / or after the signature calculation is completed.

[0010] Furthermore, the specific process of generating the commercial cryptographic signature in step five includes: S51: Obtain the hash value of the transaction input as the signature target data; S52: Call the private key object to sign the hash value based on the commercial cryptographic algorithm; S53: Insert random delay operations during the signing process to make the signing operation time randomly distributed.

[0011] Furthermore, the formula for calculating the time imbalance index mentioned in step six is ​​as follows: ,in This represents the time for each commercial cryptographic signature operation.

[0012] Compared with the prior art, the present invention provides a commercial cryptographic signature method resistant to side-channel attacks, which has the following beneficial effects: by injecting random noise into the signature algorithm to disrupt the side-channel information, attackers are unable to infer the user's secret data based on the time information leaked in the transaction process, thereby improving the system's ability to resist side-channel attacks.

[0013] The features and advantages of the present invention will be described in detail through embodiments and in conjunction with the accompanying drawings. Attached Figure Description

[0014] Figure 1 This is a performance comparison chart of the signature algorithm of this invention and traditional signature schemes in resisting side-channel attacks. Detailed Implementation

[0015] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. However, it should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of the invention. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concept of the invention.

[0016] Specific implementation method one: Combining Figure 1 This embodiment describes a commercial cryptographic signature method resistant to side-channel attacks, comprising the following steps: Step 1: Complete network configuration initialization: Ensure that all key generation and transaction signing in the system are on the specified network; Step Two: During the private key generation process, the input hexadecimal formatted private key sk is received, and the private key undergoes numerical conversion processing. Specifically, the hexadecimal string is converted into its corresponding integer form using a base-16 numerical parsing method, and this integer is used as the private key parameter input to construct the private key object PrivateKey. Based on the private key object, the corresponding public key is further derived according to the rules of elliptic curve cryptography, and the public key is stored in the variable self.pk for subsequent address generation and signature operations. Step 3: Generate Public Key and Address: Based on the derived public key, firstly, perform a hash operation on the public key, generating a public key hash value through a hash algorithm. Then, combine the public key hash value with the version prefix corresponding to the network type, and generate an address in P2PKH (Pay to Public Key Hash) format through encoding. Based on this, extract the corresponding public key hash from the P2PKH address, and construct a locking script according to Bitcoin script rules. Specifically, the locking script sets the unlocking conditions for transaction outputs based on the public key hash. Step 4: Perform noise injection: Add delayed random noise during the business signature process; Step 5: Generate a signature: Obtain the hash value of the input specified by the private key signature, and call Step 4 during the signature generation process. The time delay in the signature process is randomized to prevent attackers from guessing the private key by measuring the operation time. Finally, return the signature result. Step Six: Evaluation and Detection: Set up an evaluation algorithm to evaluate the system's ability to resist side-channel attacks, using time imbalance as an indicator.

[0017] Specific Implementation Method Two: Combining Figure 1 This embodiment describes the following steps for completing network configuration initialization in step one: S11: Set network type: Determine whether the current operating environment is the main network or the test network, and load the corresponding address prefix and transaction format rules accordingly; S12: Initialize cryptographic parameters: Load the system parameters for the elliptic curve and configure the hash algorithm used for key generation and signature calculation; S13: Loading transaction and script execution rules: Establishing standard transaction input / output structures and P2PKH script templates; S14: Write the above network parameters and cryptographic parameters into the system runtime context to ensure that subsequent private key generation, public key derivation and transaction signing operations are all performed in a unified network configuration environment.

[0018] Specific implementation method three: Combining Figure 1This embodiment describes the process of converting the input data into an integer using the private key sk in step two. The input data process in step two is as follows: During the private key generation process, the input hexadecimal format private key sk is received, the hexadecimal string is converted into the corresponding integer form according to the numerical parsing method with a base of 16, and the integer is input as the private key parameter.

[0019] Specific implementation method four: Combination Figure 1 This embodiment describes the specific structure of the locking script in step three of this embodiment as follows: The specific structure of the locking script in step three is as follows: S21: Data preparation: The script reads and copies the public key data provided in the unlocking script; S22: Identity verification: Perform a hash operation on the copied public key to generate its public key hash value, and compare the calculated public key hash value with the public key hash value set in the locking script in the transaction output; S23: Authorization Verification: After the public key hash comparison is successful, the script will use the verified public key to verify the digital signature provided in the unlocking script and the current transaction data.

[0020] By combining the above instruction sequence, the transaction output can be successfully unlocked only when the public key provided in the transaction input matches the public key hash specified in the locking script, and the corresponding signature verification passes, thereby completing the transaction verification.

[0021] Specific Implementation Method Five: Combining Figure 1 In this embodiment, the random delay noise in step S4 is implemented through a random number generation mechanism. The delay duration is a random value within the range of 0 to 0.005 seconds. Specifically, it is achieved by calling self.add_random_delay(), where the add_random_delay() method generates a random delay using random.uniform(0,0.005). This ensures that the overall execution time of each signature operation is randomly distributed, preventing attackers from inferring the specific information of the private key by measuring the total duration of the signature operation.

[0022] Specific Implementation Method Six: Combination Figure 1 In this embodiment, the noise injection described in step four is performed before and / or after the commercial cryptographic signature calculation. Since attackers typically deduce the private key by precisely measuring the signing operation time, traditional signature methods, due to their fixed operation time, are vulnerable to timing analysis attacks. However, by introducing random noise, the operation time for each signature is no longer a fixed value, making it difficult for attackers to deduce any valid private key information, thus further improving the signature operation's resistance to attacks.

[0023] Specific implementation method seven: Combining Figure 1 This embodiment describes the specific process of generating the commercial cryptographic signature in step five, which includes: S51: Obtain the hash value of the transaction input as the signature target data; S52: Call the private key object to sign the hash value based on the commercial cryptographic algorithm; S53: Insert random delay operations during the signing process to make the signing operation time randomly distributed.

[0024] Specific implementation method eight: Combination Figure 1 This embodiment describes the time imbalance index mentioned in step six. By setting an evaluation algorithm, time imbalance is used as an indicator to evaluate the system's ability to resist side-channel attacks. It is assumed that the time for each signature operation is... The formula for assessing time imbalance can then be expressed as: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions or improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A commercial cryptographic signature method resistant to side-channel attacks, characterized in that, Includes the following steps: Step 1: Complete network configuration initialization: Key generation and transaction signing in the system both take place within the specified network; Step 2: Private key conversion and public key generation: Convert the incoming data into an integer using the private key sk and construct a private key sk object. Derive the corresponding public key based on elliptic curve cryptography rules. Step 3: Generate public key and address: Perform a hash operation on the public key to generate a public key hash value, combine it with the address format generated by the version, and construct a locking script based on the public key hash; Step 4: Perform noise injection: Add delayed random noise during the business signature process; Step 5: Generate a business signature: Obtain the hash value of the input specified by the private key to form an unlocking script. Combine the unlocking script with the locking script and call Step 4 during the business signature generation process. The time delay in the signing process is randomized to prevent attackers from guessing the private key by measuring the operation time. Finally, return the signature result.

2. The commercial cryptographic signature method resistant to side-channel attacks as described in claim 1, characterized in that: Step one, which involves completing the network configuration initialization, includes the following steps: S11: Set network type: Determine whether the current operating environment is the main network or the test network, and load the corresponding address prefix and transaction format rules accordingly; S12: Initialize cryptographic parameters: Load the system parameters for the elliptic curve and configure the hash algorithm used for key generation and signature calculation; S13: Loading transaction and script execution rules: Establishing standard transaction input / output structures and P2PKH script templates; S14: Write the cryptographic parameters into the system runtime context to ensure that subsequent private key generation, public key derivation and transaction signing operations are all performed in a unified network configuration environment.

3. The commercial cryptographic signature method against side-channel attacks as described in claim 1, characterized in that: Step two, which involves converting the incoming data into an integer using the private key sk, includes: during the private key generation process, receiving the input hexadecimal format private key sk, converting the hexadecimal string into the corresponding integer form according to the numerical parsing method with a base of 16, and inputting the integer as the private key parameter.

4. The commercial cryptographic signature method against side-channel attacks as described in claim 1, characterized in that: The locking script in step three is specifically as follows: S21: Data preparation: The script reads and copies the public key data provided in the unlocking script; S22: Identity verification: Perform a hash operation on the copied public key to generate its public key hash value, and compare the calculated public key hash value with the public key hash value set in the locking script in the transaction output; S23: Authorization Verification: After the public key hash comparison is successful, the script will use the verified public key to verify the digital signature provided in the unlocking script and the current transaction data.

5. The commercial cryptographic signature method against side-channel attacks as described in claim 1, characterized in that: The random delay noise mentioned in step S4 is implemented through a random number generation mechanism, and the delay duration is a random value in the range of 0 to 0.005 seconds.

6. The commercial cryptographic signature method against side-channel attacks as described in claim 4, characterized in that: The noise injection described in step four is performed before the commercial cryptographic signature calculation begins and / or after the signature calculation is completed.

7. The commercial cryptographic signature method resistant to side-channel attacks as described in claim 1, characterized in that: The specific process of generating the commercial cryptographic signature in step five includes: S51: Obtain the hash value of the transaction input as the signature target data; S52: Call the private key object to sign the hash value based on the commercial cryptographic algorithm; S53: Insert random delay operations during the signing process to make the signing operation time randomly distributed.