Method, system, device and storage medium for detecting anti-energy analysis attack capability

By collecting and analyzing energy traces from the NTT polynomial multiplier, obtaining the accuracy of the private key in combination with the attack function, and evaluating its ability to resist energy analysis attacks, the problem of lack of evaluation methods in the existing technology is solved, and the security evaluation of cryptographic equipment is achieved and attack ability score.

CN117560135BActive Publication Date: 2024-12-13BEIJING SMARTCHIP MICROELECTRONICS TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311514640.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-14
Publication Date
2024-12-13
Estimated Expiration
2043-11-14

AI Technical Summary

Technical Problem

The prior art lacks effective methods to evaluate and prevent the security of cryptographic devices against energy analysis attacks, especially the ability of NTT polynomial multiplier to resist energy analysis attacks when facing side channel attacks.

Method used

By attacking the NTT polynomial multiplier, the actual energy trace is collected, and the target private key and the actual private key are obtained using the attack function, the private key accuracy is calculated, and its anti-energy analysis attack ability is determined based on the private key accuracy and the set threshold. Provide evaluation methods.

Benefits of technology

It provides a security and reliability evaluation method for detecting cryptographic devices based on NTT polynomial multiplier, which can effectively evaluate their ability to resist energy analysis attacks and provide a first level or a second level of security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117560135B_ABST
    Figure CN117560135B_ABST
Patent Text Reader

Abstract

The present invention discloses a detection method for energy analysis attack resistance capability. The detection method is used to detect an NTT polynomial multiplier. The NTT polynomial multiplier includes a decryption module. The detection method includes: inputting data to the NTT polynomial multiplier; collecting actual energy traces; attacking the decryption process of the NTT polynomial multiplier, and obtaining a target private key according to the actual energy trace; obtaining a private key accuracy according to the target private key and the actual private key; and determining the energy analysis attack resistance capability of the NTT polynomial multiplier according to a comparison result between the private key accuracy and a set threshold. The detection method of the present invention provides an evaluation means for detecting the security and reliability of a cryptographic device based on an NTT polynomial multiplier by attacking the NTT polynomial multiplier and obtaining a target sub-private key according to the actual energy trace, obtaining a private key accuracy according to the target sub-private key and the actual sub-private key, and determining the energy analysis resistance capability of the NTT polynomial multiplier according to a comparison result between the private key accuracy and a set threshold.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of energy analysis attacks, and more specifically, to a detection method and system for energy analysis attack resistance, an electronic device, and a computer-readable storage medium. Background Art

[0002] This kind of physical information leaked outside the communication channel is called side channel information. The leakage of side channel information is the main security threat faced by cryptographic devices. Side channel attack methods mainly include: energy attack, time attack, electromagnetic attack, fault attack, etc. Since energy attack is easy to implement and has a great impact on the security of cryptographic devices, it is a type of attack that needs to be focused on in the development of cryptographic devices. The existence of energy attack poses a serious threat to the practical security of cryptographic devices. In related technologies, there is a lack of evaluation methods for analyzing the security of cryptographic devices. Summary of the invention

[0003] The embodiments of the present invention provide a method for detecting the ability to resist energy analysis attacks, a system for detecting the ability to resist energy analysis attacks, and a computer-readable storage medium.

[0004] The embodiment of the present invention provides a detection method for the ability to resist energy analysis attacks. The detection method is used to detect an NTT polynomial multiplier. The NTT polynomial multiplier includes a decryption module. The decryption module is used to decrypt according to a ciphertext and a private key to obtain a plaintext. The detection method includes: inputting data to the NTT polynomial multiplier; collecting an actual energy trace, wherein the actual energy trace is the voltage of the decryption module; using an attack function to attack the decryption process of the NTT polynomial multiplier, and obtaining a target private key according to the actual energy trace, wherein the target private key is composed of a target sub-private key; and obtaining a target private key according to the target private key and the actual energy trace. The private key obtains a private key accuracy rate, the actual private key is composed of actual sub-private keys, and the private key accuracy rate is used to indicate the proportion of target sub-private keys that are the same as the actual sub-private keys in the target private key; the energy analysis attack resistance capability of the NTT polynomial multiplier is determined according to a comparison result of the private key accuracy rate and a set threshold value, when the private key accuracy rate is higher than the set threshold value, the energy analysis attack resistance capability of the NTT polynomial multiplier is at the first level; when the private key accuracy rate is lower than the set threshold value, the energy analysis attack resistance capability of the NTT polynomial multiplier is at the second level, and the first level is lower than the second level.

[0005] In certain embodiments, the use of an attack function to attack the decryption process of the NTT polynomial multiplier and obtaining a target private key based on the actual energy trace includes: obtaining a hypothetical energy trace based on a hypothetical sub-private key, the hypothetical sub-private key being all possible values ​​of the actual sub-private key to be attacked; calculating the correlation between the hypothetical energy trace and the actual energy trace, and obtaining a target sub-private key based on the correlation, the target sub-private key being the hypothetical sub-private key corresponding to the hypothetical energy trace with the highest correlation, and the target private key being composed of multiple target sub-private keys.

[0006] In some embodiments, the decryption process of the decryption module includes a first calculation process and a second calculation process, the first calculation process and the second calculation process are performed simultaneously, the target private key includes a first part and a second part, and the use of an attack function to attack the decryption process of the NTT polynomial multiplier and obtain the target private key according to the actual energy trace includes: using a first attack function to attack the first calculation process and the second calculation respectively, and the first attack function is designed according to the structure of the decryption module; setting the second calculation process as noise, and using the first attack function to attack the first calculation process, and obtaining the first part according to the actual energy trace; setting the first calculation process to noise, and using the first attack function to attack the second calculation process, and obtaining the second part according to the actual energy trace.

[0007] In some embodiments, the decryption process includes a first calculation process and a second calculation process, the first calculation process and the second calculation process are performed simultaneously, the NTT polynomial multiplier includes a first-stage butterfly unit circuit, and the decryption process of attacking the NTT polynomial multiplier using an attack function and obtaining the target private key according to the actual energy trace includes: using a second attack function to simultaneously attack the first calculation process and the second calculation process, and obtaining the target private key according to the actual energy trace, and the second attack function is designed according to the structure of the decryption module, the bridge rectifier circuit and the first-stage butterfly unit circuit.

[0008] In some embodiments, the number of actual energy traces comprises 10,000.

[0009] In certain embodiments, the set threshold comprises 99%.

[0010] In some embodiments, the inputting data into the NTT polynomial multiplier includes: respectively inputting first data and second data into the NTT polynomial multiplier, the first data including multiple sets of randomly generated private keys and ciphertexts, and the second data including multiple sets of randomly generated ciphertexts and fixed private keys; the actual energy traces include a first set and a second set, the first set being a set of energy traces generated by inputting the first data, and the second set being a set of energy traces generated by inputting the second data.

[0011] In certain embodiments, the detection method further includes: calculating a t value based on energy traces in a first set and energy traces in a second set; determining whether there is information leakage in an NTT polynomial multiplier at the energy trace corresponding to the t value based on a comparison result of an absolute value of the t value and a preset threshold; when the absolute value of the t value is greater than the preset threshold, there is information leakage in the NTT polynomial multiplier at the energy trace corresponding to the t value; when the absolute value of the t value is less than the preset threshold, there is information leakage in the NTT polynomial multiplier at the energy trace corresponding to the t value.

[0012] In certain embodiments, the detection method further includes: obtaining a first analysis result based on the t value, wherein the first analysis result is the proportion of the number of t values ​​exceeding a preset threshold in the total number of t values.

[0013] In some embodiments, the preset threshold value ranges from 4 to 5.

[0014] In some embodiments, determining the ability of the NTT polynomial multiplier to resist energy analysis attacks based on a comparison result of the private key accuracy and a set threshold includes: determining the ability of the NTT polynomial multiplier to resist energy analysis attacks based on the first analysis result and the comparison result.

[0015] In certain embodiments, after the actual energy trace is collected, the detection method further includes: obtaining a waveform graph of the actual energy trace; and performing analysis based on the waveform graph and the data to obtain a second analysis result, wherein the second analysis result includes reasons for the waveform changes of the actual energy trace.

[0016] The embodiment of the present invention provides a detection system for energy analysis attack resistance, the detection system is used to detect an NTT polynomial multiplier, the NTT polynomial multiplier includes a decryption module, the decryption module is used to decrypt according to the ciphertext and the private key to obtain the plaintext, the detection system includes: an input module, a collection module, an attack module and an analysis and processing module, the input module is used to input data to the NTT polynomial multiplier; the collection module is used to collect actual energy traces, the actual energy traces are the voltage of the decryption module; the attack module is used to use an attack function to attack the decryption process of the NTT polynomial multiplier, and obtain a target private key according to the actual energy trace, the target private key is composed of a target sub-private key The analysis and processing module is used to obtain the private key accuracy according to the target private key and the actual private key, the actual private key is composed of actual sub-private keys, and the private key accuracy is used to indicate the proportion of target sub-private keys that are the same as the actual sub-private keys in the target private key; the analysis and processing module is also used to determine the energy analysis attack resistance capability of the NTT polynomial multiplier according to the comparison result of the private key accuracy and a set threshold value, when the private key accuracy is higher than the set threshold value, the energy analysis attack resistance capability of the NTT polynomial multiplier is at the first level; when the private key accuracy is lower than the set threshold value, the energy analysis attack resistance capability of the NTT polynomial multiplier is at the second level, and the first level is lower than the second level.

[0017] In certain embodiments, the attack module further includes a determination submodule and a calculation submodule, the determination submodule being used to obtain a hypothetical energy trace based on a hypothetical sub-private key, the hypothetical sub-private key being all possible values ​​of the actual sub-private key to be attacked; the calculation submodule being used to calculate the correlation between the hypothetical energy trace and the actual energy trace, and obtaining a target sub-private key based on the correlation, the target sub-private key being the hypothetical sub-private key corresponding to the hypothetical energy trace with the highest correlation, and the target private key being composed of multiple target sub-private keys.

[0018] In some embodiments, the decryption process of the decryption module includes a first calculation process and a second calculation process, the first calculation process and the second calculation process are performed simultaneously, the target private key includes a first part and a second part, the attack module includes a first attack sub-module, the first attack sub-module is used to use a first attack function to attack the first calculation process and the second calculation respectively, and the first attack function is designed according to the structure of the decryption module; the first attack sub-module is also used to set the second calculation process as noise, and use the first attack function to attack the first calculation process, and obtain the first part according to the actual energy trace; the first attack sub-module is also used to set the first calculation process as noise, and use the first attack function to attack the second calculation process, and obtain the second part according to the actual energy trace.

[0019] In some embodiments, the decryption process includes a first calculation process and a second calculation process, the first calculation process and the second calculation process are performed simultaneously, the NTT polynomial multiplier includes a first-stage butterfly unit circuit, the attack module includes a second attack sub-module, the second attack sub-module uses a second attack function to simultaneously attack the first calculation process and the second calculation process, and obtains the target private key according to the actual energy trace, and the second attack function is designed according to the structure of the decryption module, the bridge rectifier circuit and the first-stage butterfly unit circuit.

[0020] In some embodiments, the input module includes: an input submodule, which is used to input first data and second data to the NTT polynomial multiplier respectively, the first data includes multiple sets of randomly generated private keys and ciphertexts, and the second data includes multiple sets of randomly generated ciphertexts and fixed private keys; the actual energy traces include a first set and a second set, the first set is a set of energy traces generated by inputting the first data, and the second set is a set of energy traces generated by inputting the second data.

[0021] In certain embodiments, the detection system further includes: a calculation module and a determination module, the calculation module being used to calculate a t value based on energy traces in a first set and energy traces in a second set; the determination module being used to determine whether there is information leakage in an NTT polynomial multiplier at the energy trace corresponding to the t value based on a comparison result of an absolute value of the t value and a preset threshold; when the absolute value of the t value is greater than the preset threshold, there is information leakage in the NTT polynomial multiplier at the energy trace corresponding to the t value; when the absolute value of the t value is less than the preset threshold, there is information leakage in the NTT polynomial multiplier at the energy trace corresponding to the t value.

[0022] In some embodiments, the detection system also includes: an acquisition module and a data analysis module, the acquisition module is used to obtain a waveform graph of the actual energy trace; the data analysis module is used to perform analysis based on the waveform graph and the data to obtain a second analysis result, and the second analysis result includes the reason for the waveform change of the actual energy trace.

[0023] An embodiment of the present invention provides an electronic device, which includes one or more processors and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the steps of the detection method of any of the above embodiments are implemented.

[0024] An embodiment of the present invention provides a computer-readable storage medium, and when the program is executed by a processor, the steps of the detection method of any of the above embodiments are implemented.

[0025] The detection method of the embodiment of the present invention attacks the NTT polynomial multiplier and obtains the target sub-private key according to the collected actual energy trace, and obtains the private key accuracy according to the target sub-private key and the actual sub-private key. The energy analysis resistance capability of the NTT polynomial multiplier is determined according to the comparison result of the private key accuracy and the set threshold, thereby providing an evaluation means for detecting the security and reliability of cryptographic devices based on the NTT polynomial multiplier.

[0026] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0028] Figure 1 It is a structural diagram of a R2MDC pipeline NTT / INTT circuit of the related art;

[0029] Figure 2 It is a schematic flow chart of a detection method according to an embodiment of the present invention;

[0030] Figure 3 is a schematic diagram of a detection system according to an embodiment of the present invention;

[0031] Figure 4 It is a schematic flow chart of a detection method according to an embodiment of the present invention;

[0032] Figure 5 is a schematic diagram of an attack module according to an embodiment of the present invention;

[0033] Figure 6It is a schematic flow chart of a detection method according to an embodiment of the present invention;

[0034] Figure 7 is a schematic diagram of an attack module according to an embodiment of the present invention;

[0035] Figure 8 It is a schematic flow chart of a detection method according to an embodiment of the present invention;

[0036] Fig. 9 is a schematic diagram of the result of using the second attack function to attack the NTT polynomial multiplier in an embodiment of the present invention;

[0037] Fig.10 is a curve diagram of the private key accuracy and the actual number of energy traces according to an embodiment of the present invention;

[0038] Fig.11 It is a schematic flow chart of a detection method according to an embodiment of the present invention;

[0039] Fig.12 is a schematic diagram of a detection system according to an embodiment of the present invention;

[0040] Fig.13 is a schematic diagram of the distribution of t values ​​according to an embodiment of the present invention;

[0041] Fig.14 It is a schematic flow chart of a detection method according to an embodiment of the present invention;

[0042] Fig.15 Schematic diagram of actual energy trace waveform and data flow according to an embodiment of the present invention. DETAILED DESCRIPTION

[0043] The embodiments of the present invention are described in detail below, and the embodiments of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0044] The two important research contents of information security technology include cryptography and cryptanalysis. Cryptography focuses on studying the security of the mathematical theory of cryptographic algorithms. The security of the cryptographic algorithm mechanism itself is a solid foundation for implementation and application. Cryptanalysis focuses on studying the security of cryptographic schemes under implementation and application. In actual application environments, cryptographic schemes have more or less security vulnerabilities of varying degrees. Cryptanalysis is a discipline that comprehensively studies cryptographic attacks and defenses.

[0045] Peter Shor first proposed the quantum prime factorization algorithm in 1994. This quantum algorithm made quantum computing, which had been in the theoretical analysis state before, suddenly have a practical use. This quantum algorithm can enable quantum computers to efficiently handle many classical mathematical problems, such as calculating discrete logarithms and integer decomposition. This new quantum computing technology makes the security assumptions of traditional public key cryptography schemes no longer valid. With the rapid development of computer technology and manufacturing technology, the implementation of quantum computers is only a matter of time, and information security issues will become more and more serious.

[0046] Due to the urgent need for anti-quantum computing cryptographic schemes, the first International Conference on Anti-Quantum Computing Cryptography was held in Belgium in 2006. Researchers from various countries proposed a variety of anti-quantum computing cryptographic schemes at the conference. Among these cryptographic schemes, multivariate public key cryptographic schemes are the most common. Lattice cryptographic schemes, error-correcting code cryptographic schemes, and hash function digital signature schemes were also proposed at the conference. The National Institute of Standards and Technology (NIST) launched a post-quantum cryptographic standardization project in 2016. All shortlisted candidate schemes are based on mathematical problems that cannot be solved by quantum computers. The two most important difficult problems are lattice problems and error-correcting code decoding problems. In the first round, the security of the cryptographic scheme was the focus of the evaluation. In the second round, the implementation issues were considered to a greater extent. In the third round, the side channel attack security assessment was the focus of the evaluation. In the fourth round, the remaining shortlisted candidate schemes were further standardized.

[0047] Digital circuits will inevitably consume energy when performing logical operations. This physical information leaked outside the communication channel is called side channel information, such as energy consumption information, execution time information, and electromagnetic radiation information. Side channel information leakage is the main security threat faced by cryptographic security devices. The security of post-quantum cryptography theory has been mathematically proven, but when the cryptographic scheme is used on actual cryptographic devices, such as sensors, smart cards, or Bluetooth devices, attackers can attack and crack the cryptographic system by analyzing the energy consumption, running time, and electromagnetic radiation of the cryptographic devices. This type of attack is called a side channel attack. There are many types of side channel attacks, but the core goal is the same, which is to obtain secret messages.

[0048] Side channel attacks mainly include: energy attack, time attack, electromagnetic attack, fault attack, etc. Among them, the most important attack method is the side channel attack method based on energy analysis. Since energy attacks are easy to implement and have a great impact on the security of cryptographic devices, they are a type of attack that needs to be focused on during the development of cryptographic devices. Common energy analysis attack methods include simple energy analysis SPA, differential energy analysis DPA, and correlated energy analysis CPA. The existence of energy attacks poses a serious threat to the practical security of cryptographic devices.

[0049] Fast Number Theoretic Transform (NTT) is a discrete Fourier transform algorithm that can be used to implement the Ring-learning With Error (R-LWE) cryptographic scheme. The NTT polynomial multiplier includes 1 preprocessing unit and 8 processing elements (PE). The preprocessing unit consists of a modular multiplication circuit and a read-only memory (ROM) unit. The PE unit includes a BF2 unit, a data delay unit (DU), a two-channel commutator (C2), and a ROM unit. The circuit structure of the fast inverse number theoretic transform (INTT) is similar to that of the NTT circuit. The INTT circuit structure includes 8 PE units and 1 post-processing unit. The difference from the NTT circuit structure is that the data stored in the ROM unit is different. The NTT polynomial multiplier can perform both NTT calculations and INTT calculations. The pipeline NTT / INTT circuit structure of Radix-2 Multi-path Delay Commutator (R2MDC) is as follows: Figure 1 shown.

[0050] In the related art, protection structures such as masks are used to enhance the ability of cryptographic devices to resist side-channel attacks, so that cryptographic devices with protection structures can resist a certain degree of side-channel attacks. However, there is a lack of evaluation methods for analyzing the security of cryptographic devices, making it difficult to evaluate and analyze the ability of cryptographic devices to resist side-channel attacks.

[0051] See also Figure 2 The embodiment of the present invention provides a detection method for the ability to resist energy analysis attacks. The detection method is used to detect an NTT polynomial multiplier. The NTT polynomial multiplier includes a decryption module. The decryption module is used to decrypt the ciphertext and the private key to obtain the plaintext. The detection method includes:

[0052] 01: Input data to NTT polynomial multiplier.

[0053] 02: Collect the actual energy trace. The actual energy trace is the voltage of the decryption module.

[0054] 03: Use the attack function to attack the decryption process of the NTT polynomial multiplier, and obtain the target private key based on the actual energy trace. The target private key is composed of target sub-private keys.

[0055] 04: Get the private key accuracy rate based on the target private key and the actual private key. The actual private key is composed of the actual sub-private keys. The private key accuracy rate is used to indicate the proportion of the target sub-private keys that are the same as the actual sub-private keys in the target private key.

[0056] 05: The ability of the NTT polynomial multiplier to resist energy analysis attacks is determined based on the comparison result between the private key accuracy and the set threshold. When the private key accuracy is higher than the set threshold, the ability of the NTT polynomial multiplier to resist energy analysis attacks is at the first level; when the private key accuracy is lower than the set threshold, the ability of the NTT polynomial multiplier to resist energy analysis attacks is at the second level, and the first level is lower than the second level.

[0057] Specifically, see Figure 3 The detection method of this embodiment can be implemented by the detection system 100 of the embodiment of the present invention, wherein step 01 can be implemented by the input module 10 of the detection system 100, step 02 can be implemented by the acquisition module 30 of the detection system 100, step 03 can be implemented by the attack module 50 of the detection system 100, and step 04 can be implemented by the analysis and processing module 70 of the detection system 100. That is to say, the input module 10 can be used to input data to the NTT polynomial multiplier; the acquisition module 30 can be used to collect actual energy traces; the attack module 50 can be used to use the attack function to attack the decryption process of the NTT polynomial multiplier, and obtain the target private key according to the actual energy trace, the target The private key is composed of target sub-private keys; the analysis and processing module 70 can be used to obtain the private key accuracy based on the target private key and the actual private key, the actual private key is composed of actual sub-private keys, and the private key accuracy can be used to indicate the proportion of target sub-private keys that are the same as the actual sub-private keys in the target private key; the analysis and processing module 70 can also be used to determine the ability of the NTT polynomial multiplier to resist energy analysis attacks based on a comparison result of the private key accuracy and a set threshold value, when the private key accuracy is higher than the set threshold value, the ability of the NTT polynomial multiplier to resist energy analysis attacks is at the first level; when the private key accuracy is lower than the set threshold value, the ability of the NTT polynomial multiplier to resist energy analysis attacks is at the second level, and the first level is lower than the second level.

[0058] This embodiment is described with the attack object being the R-LWE cryptographic scheme implemented based on the NTT polynomial multiplier. The decryption module of the NTT polynomial multiplier includes an analog multiplication circuit (modular multiplication circuit), and a sampling resistor is connected in parallel at both ends of the modular multiplication circuit. The voltage of the sampling resistor is the voltage of the decryption module, and the actual energy trace is the voltage at both ends of the sampling resistor. That is, the effective reuse length of the key is adjusted according to the security strength requirements of the actual application environment. The key generation stage and the decryption stage in the R-LWE cryptographic scheme are prone to information leakage. The difficulty of attacking the key generation stage is relatively large, while the difficulty of attacking the decryption stage is relatively low. Therefore, this embodiment performs a side channel attack on the decryption stage. Since the point-by-point multiplication characteristics of the NTT polynomial multiplier no longer generate a large number of intermediate values, this embodiment selects Vertical Correlation Power Analysis (VCPA), constructs an attack function for the intermediate value out of the output of the modular multiplication circuit of the NTT polynomial multiplier, and performs an energy analysis attack on the NTT polynomial multiplier. The first level and the second level can represent the ability to resist energy analysis attacks. The ability to resist energy analysis attacks corresponding to the first level is weaker than the ability to resist energy analysis attacks corresponding to the second level. The ability of the NTT polynomial multiplier to resist energy analysis attacks can be obtained based on the private key accuracy and the set threshold. If the private key accuracy is higher than the set threshold, it means that there is a large amount of information leakage in the NTT polynomial multiplier, and the ability of this NTT polynomial multiplier to resist energy analysis attacks is weak; if the private key accuracy is lower than the set threshold, it means that the NTT polynomial multiplier leaks less information, and the ability of this NTT polynomial multiplier to resist energy analysis attacks is strong.

[0059] In this way, by attacking the NTT polynomial multiplier and obtaining the target sub-private key according to the actual energy trace collected, and obtaining the private key accuracy according to the target sub-private key and the actual sub-private key, the anti-energy analysis capability of the NTT polynomial multiplier is determined according to the comparison result of the private key accuracy and the set threshold, which provides an evaluation method for detecting the security and reliability of cryptographic devices based on the NTT polynomial multiplier.

[0060] See also Figure 4 In some embodiments, step 02 includes:

[0061] 021: Preprocess the actual energy trace.

[0062] Specifically, a low-pass filter is used to filter the actual energy trace. In one embodiment, a 50 MHz low-pass filter is used to pre-process the energy trace to remove the influence of the noise signal. In this way, the influence of the noise signal can be reduced by pre-processing the actual energy trace.

[0063] See also Figure 4In some embodiments, step 03 includes:

[0064] 031: Obtain a hypothetical energy trace based on the hypothetical sub-private key, assuming that the sub-private key is all possible values ​​of the actual sub-private key to be attacked.

[0065] 032: Calculate the correlation between the hypothetical energy trace and the actual energy trace, and obtain the target sub-private key based on the correlation. The target sub-private key is the hypothetical sub-private key corresponding to the hypothetical energy trace with the highest correlation. The target private key is composed of multiple target sub-private keys.

[0066] Specifically, see Figure 5 , step 031 and step 032 can be implemented by the determination submodule 51 and the calculation submodule 53 of the attack module 50, wherein step 031 can be implemented by the determination submodule 51, and step 032 can be implemented by the calculation submodule 53, that is, the determination submodule 51 can be used to obtain a hypothetical energy trace based on a hypothetical sub-private key, and the hypothetical sub-private key is all possible values ​​of the actual sub-private key to be attacked; the calculation submodule 53 can be used to calculate the correlation between the hypothetical energy trace and the actual energy trace, and obtain the target sub-private key based on the correlation, the target sub-private key is the hypothetical sub-private key corresponding to the hypothetical energy trace with the highest correlation, and the target private key is composed of multiple target sub-private keys.

[0067] Among them, when conducting a VCPA attack, first assume all possible hypothetical values ​​for the actual sub-private key, multiply each hypothetical value by the ciphertext polynomial vector to obtain a hypothetical product vector, and then use the attack function to process each hypothetical product vector to obtain a hypothetical intermediate trace, and use the Hamming distance model to map the hypothetical intermediate trace to obtain a hypothetical energy trace. Perform a correlation analysis on the hypothetical energy trace and the actual energy trace, calculate the correlation coefficient of the hypothetical energy trace and the actual energy trace, and draw a correlation curve based on the correlation coefficient of all hypothetical energy traces of the same actual sub-private key. Determine the hypothetical energy trace corresponding to the point with the highest correlation coefficient value in the correlation curve. The hypothetical sub-private key corresponding to this hypothetical energy trace is the target sub-private key.

[0068] In this way, the hypothetical sub-private key is obtained by assuming all possible values ​​of the actual sub-private key, and then the hypothetical energy trace is obtained by the hypothetical sub-private key. The correlation between the hypothetical energy trace and the actual energy trace is calculated to obtain the target sub-private key, thereby realizing the attack on the decryption process.

[0069] See also Figure 6 In some implementations, the decryption process of the decryption module includes a first calculation process and a second calculation process, the first calculation process and the second calculation process are performed simultaneously, the target private key includes a first part and a second part, and step 03 further includes:

[0070] 0331: Use a first attack function to attack the first calculation process and the second calculation process respectively, and the first attack function is designed according to the structure of the decryption module.

[0071] 0332: Set the second calculation process as noise, and use the first attack function to attack the first calculation process, and obtain the first part according to the actual energy trace.

[0072] 0333: Set the first calculation process as noise, and use the first attack function to attack the second calculation process, and obtain the second part according to the actual energy trace.

[0073] Specifically, see Figure 7 , step 0331, step 0332 and step 0333 can be implemented by the first attack submodule 55, that is, the first attack submodule 55 can be used to use the first attack function to attack the first calculation process and the second calculation respectively, and the first attack function is designed according to the structure of the decryption module; the first attack submodule 55 can also be used to set the second calculation process as noise, and use the first attack function to attack the first calculation process, and obtain the first part according to the actual energy trace; the first attack submodule 55 can also be used to set the first calculation process as noise, and use the first attack function to attack the second calculation process, and obtain the second part according to the actual energy trace.

[0074] In addition, the first attack function is constructed according to the modular multiplication circuit in the decryption module of the NTT polynomial multiplier, and the modular multiplication circuit includes a 26-bit Barrett reduction circuit. The first attack function is constructed using only the output value of a 26-bit Barrett reduction circuit, so that the structure of the first attack function is simple and the amount of calculation is small. This embodiment is described with the cipher dimension n=256. The decryption process of the NTT polynomial multiplier is decrypted according to the ciphertext and the private key, including the number theory fast inverse transform (INNT) calculation of the ciphertext and the private key, that is, in It includes a first calculation process and a second calculation process. The first calculation process is to calculate (anc1⊙anr2+anc2), which is responsible for calculating the 1st to 128th coefficients; the second calculation process is to calculate (bnc1⊙bnr2+bnc2), which is responsible for calculating the 129th to 256th coefficients. The first calculation process and the second calculation process are performed at the same time. If the first calculation process and the second calculation process are attacked at the same time, it is necessary to assume tens of millions of hypothetical sub-private key combinations, and then calculate the hypothetical energy trace and correlation analysis for the hypothetical sub-private keys, and the amount of calculation is too large. Since the data of the first calculation process and the second calculation process are independent of each other in the attack of the first attack function, the first calculation process and the second calculation process are calculated separately. When attacking the first calculation process, the second calculation process is set to noise; when attacking the second calculation process, the first calculation process is set to noise. Since the sub-private keys are assumed to be independent of each other when the first attack function is used to attack the NTT polynomial multiplier, the actual energy trace where information leakage is likely to occur can be determined based on the comparison results of the target private key and the actual private key, so as to locate the leakage location, thereby providing users with a way to locate the information leakage location. In one embodiment, the modulus q=7681 is used. If the first calculation process and the second calculation process are attacked at the same time, 7681×7681=58997761 assumed energy traces and correlation analyses need to be calculated. If the first calculation process and the second calculation process are attacked separately, only 7681×2=15362 assumed energy traces and correlation analyses need to be calculated, and the amount of calculation is reduced by hundreds of times.

[0075] In this way, the first attack function is constructed through the structure of the decryption module. The structure of the first attack function is simple and the calculation amount is small. The first calculation process and the second calculation process are attacked separately, which greatly reduces the calculation amount and can locate the location of the information leakage.

[0076] See also Figure 8 In some implementations, the decryption process includes a first calculation process and a second calculation process, the first calculation process and the second calculation process are performed simultaneously, the NTT polynomial multiplier includes a first-stage butterfly unit circuit, and step 03 further includes:

[0077] 034: Use the second attack function to attack the first calculation process and the second calculation process at the same time, and obtain the target private key according to the actual energy trace. The second attack function is designed according to the structure of the decryption module, the bridge rectifier circuit and the first-stage butterfly unit circuit.

[0078] Specifically, step 034 can be implemented by the second attack submodule 57 of the attack module 50, that is, the second attack submodule 57 can be used to use the second attack function to attack the first calculation process and the second calculation process at the same time, and obtain the target private key according to the actual energy trace. The second attack function is designed according to the structure of the decryption module, the bridge rectifier circuit and the first-stage butterfly unit circuit. The BR circuit can represent the bridge rectifier circuit, and the BF2 circuit can represent the first butterfly unit circuit. When constructing the second attack function, the BR circuit is added on the basis of the decryption module, and the multi-stage register of the BR circuit pipeline structure can generate more intermediate values, so that the attack effect of the second attack function is improved; because in the decryption process, the BF2 circuit, and then the first-stage BF2 circuit is added on the basis of the decryption module, the attack on the NTT polynomial multiplier can be better realized. Optionally, more levels of BF2 circuits can be added to construct the second attack function. The second attack function attacks the first calculation process and the second calculation process at the same time, which can improve the attack effect. The second attack function is constructed according to the modular multiplication circuit in the decryption module of the NTT polynomial multiplier. The modular multiplication circuit includes a 26-bit Barrett reduction circuit. The output value of the 26-bit Barrett reduction circuit is used to construct the second attack function without adding the intermediate value of the accumulator register. This can strip the correlation between the actual sub-private keys so that the processed hypothetical energy and can be applied to all the same actual sub-private keys, so that the second attack function attacks the actual sub-private keys one by one, that is, starting the attack from the first actual sub-private key, using the attack result of the first actual sub-private key to attack the second actual sub-private key, and using the attack result of the second actual sub-private key to attack the third actual sub-private key, and so on until the attack is completed on the last actual sub-private key. Therefore, although the second attack function attacks the first calculation process and the second calculation process at the same time, attacking the actual sub-private keys one by one can reduce the amount of calculation of the second attack function.

[0079] In one embodiment, see Fig. 9 , where the vertical axis is the deviation, the horizontal axis is the sub-private key sequence number, the deviation is the difference between the target sub-private key and the actual sub-private key sequence number, and when the deviation is 0, it means that the target sub-private key and the actual sub-private key are the same. Select the password dimension n = 256, collect 10,000 actual energy traces for attack analysis, and among the target sub-private keys obtained by attacking using complex attack methods, the number that is the same as the actual sub-private key is 125, and the accuracy rate is 97.65%.

[0080] In this way, the second attack function is designed using the structure of the decryption module, the bridge rectifier circuit and the first-stage butterfly unit circuit, and the first calculation process and the second calculation process are attacked simultaneously, so that the private key obtained by the second attack function in the attack has high accuracy and small calculation amount.

[0081] In some embodiments, the number of actual energy traces comprises 10,000.

[0082] Specifically, the number of actual energy traces affects the accuracy of the private key of the attack. As the number of actual energy traces increases, the accuracy of the private key obtained by the attack increases. In one embodiment, the accuracy of the private key is calculated while attacking the NTT polynomial multiplier. The curve of the change of the accuracy of the private key using the VCPA method under a complex attack structure with the increase of the number of actual energy traces is as follows: Fig.10 As shown, the vertical axis is the private key accuracy rate, and the horizontal axis is the number of actual energy traces. The private key success rate increases rapidly within the first 6000 actual energy traces, and the growth rate slows down after 6000 actual energy traces. When the attack analysis is performed on 10,000 actual energy traces, the private key accuracy rate is 97.65%.

[0083] In this way, by selecting 10,000 actual energy traces for attack analysis, a suitable private key accuracy rate can be obtained, thereby making it possible to more accurately determine the ability of the NTT polynomial multiplier to resist energy analysis attacks.

[0084] In certain embodiments, the set threshold comprises 99%.

[0085] Specifically, when the private key accuracy is greater than 99%, the NTT polynomial multiplier leaks too much information, and it can be determined that the NTT polynomial multiplier has poor resistance to energy analysis attacks; when the private key accuracy is less than 99%, the NTT polynomial multiplier leaks less information and can still retain some information without leaking, and it can be determined that the NTT polynomial multiplier has strong resistance to energy analysis attacks. In an implementation example, the resistance to energy analysis attacks of an unprotected NTT polynomial multiplier is tested, and the private key accuracy obtained is 97.65%, so the unprotected NTT polynomial multiplier has strong resistance to energy analysis attacks.

[0086] Thus, the ability of the NTT polynomial multiplier to resist energy analysis attacks can be determined through the private key accuracy and the 99% comparison result.

[0087] See also Fig.11 In some embodiments, step 01 includes:

[0088] 011: The first data and the second data are respectively input into the NTT polynomial multiplier, the first data includes multiple sets of randomly generated private keys and ciphertexts, and the second data includes multiple sets of randomly generated ciphertexts and fixed private keys; the actual energy traces include a first set and a second set, the first set is a set of energy traces generated by inputting the first data, and the second set is a set of energy traces generated by inputting the second data.

[0089] Specifically, step 011 can be implemented by an input submodule, that is, the input submodule can be used to input the first data and the second data to the NTT polynomial multiplier respectively, the first data includes multiple sets of randomly generated private keys and ciphertexts, and the second data includes multiple sets of randomly generated ciphertexts and a fixed private key; the actual energy trace includes a first set and a second set, the first set is a set of energy traces generated by inputting the first data, and the second set is a set of energy traces generated by inputting the second data. The private key r2 and ciphertexts c1 and c2 in the first data are randomly generated, the ciphertexts c1 and c2 in the second data are randomly generated, and the private key r2 is a fixed value, that is, the energy trace in the first set is obtained by inputting the randomly generated private key r2 and ciphertexts c1 and c2 to the NTT polynomial multiplier, and the energy trace in the second set is obtained by inputting the fixed private key r2 and the randomly generated ciphertexts c1 and c2 to the NTT polynomial multiplier, so that attack analysis can be performed based on the energy traces in the first set and the second set. The number of energy traces in the first set and the number of energy traces in the second set are the same or different. In one embodiment, the number of actual energy traces collected is 10,000, the number of energy traces in the first set is 5,000, and the number of energy traces in the second set is 5,000.

[0090] In this way, the actual energy traces including the first set and the second set are obtained by inputting the first data and the second data into the NTT, so that attack analysis can be performed according to the actual energy traces of the first set and the second set.

[0091] In certain embodiments, the detection method further comprises:

[0092] 061: Calculate the t value based on the energy trace in the first set and the energy trace in the second set.

[0093] 062: Determine whether there is information leakage in the NTT polynomial multiplier at the energy trace corresponding to the t value based on the comparison result between the absolute value of the t value and the preset threshold; when the absolute value of the t value is greater than the preset threshold, there is information leakage in the NTT polynomial multiplier at the energy trace corresponding to the t value; when the absolute value of the t value is less than the preset threshold, there is information leakage in the NTT polynomial multiplier at the energy trace corresponding to the t value.

[0094] Specifically, see Fig.12, step 061 and step 062 can be implemented by the calculation module and the determination module of the detection system 100, wherein step 061 can be implemented by the calculation module, and step 062 can be implemented by the determination module, that is, the calculation module can be used to calculate the t value according to the energy traces in the first set and the energy traces in the second set; the determination module can be used to determine whether there is information leakage in the NTT polynomial multiplier at the energy trace corresponding to the t value according to the comparison result of the absolute value of the t value and the preset threshold; when the absolute value of the t value is greater than the preset threshold, there is information leakage in the NTT polynomial multiplier at the energy trace corresponding to the t value; when the absolute value of the t value is less than the preset threshold, there is information leakage in the NTT polynomial multiplier at the energy trace corresponding to the t value. This embodiment uses the test vector leakage assessment (TVLA) method to perform leakage assessment on the NTT polynomial multiplier. The t value is calculated based on the energy traces in the first set and the energy traces in the second set, and the calculation formula of the t value is:

[0095]

[0096] Among them, A represents the first set, B represents the second set, μ A and μ B denote the means of the energy traces in the first and second sets, σ A and σ B Represent the first set and the second set respectively A The standard deviation of the energy trace in the sum, N A and N B Respectively represent the number of energy traces in the first set and the second set. According to the comparison result of the absolute value of the t value and the preset threshold, it can be determined whether there is information leakage in the NTT polynomial multiplier at the energy trace corresponding to the t value.

[0097] In this way, the t value is calculated by the energy traces of the first set and the energy traces of the second set, and the comparison result of the t value and the preset threshold value can be used to determine whether there is information leakage in the NTT polynomial multiplier at the corresponding energy trace.

[0098] In certain embodiments, the detection method further comprises:

[0099] 063: Obtain a first analysis result according to the t value, where the first analysis result is the proportion of the number of t values ​​exceeding a preset threshold in the total number of t values.

[0100] Specifically, the first analysis result is the ratio of the number of t values ​​exceeding the preset threshold to the total number of t values. If the first analysis result is large, there are many locations where information leakage occurs in the NTT polynomial multiplier, and more information may be leaked; if the first analysis result is small, there are few locations where leakage occurs in the NTT polynomial multiplier, and less information may be leaked.

[0101] In this way, the extent of possible information leakage of the NTT polynomial can be determined through the first analysis result.

[0102] In some embodiments, the preset threshold value ranges from 4 to 5.

[0103] Specifically, the preset threshold value range includes 4-5, for example, the preset threshold value can be 4, 4.3, 4.5, 4.7, 5, etc. This embodiment is described with the preset threshold value of 4.5, that is, when the absolute value of the t value is less than 4.5, there is no information leakage in the NTT polynomial multiplier at the energy trace corresponding to the t value; when the absolute value of the t value is greater than 4.5, there is information leakage in the NTT polynomial multiplier at the energy trace corresponding to the t value. In one embodiment, please refer to Fig.13 , where the horizontal axis is the sampling point number, the vertical axis is the t value, and the two solid lines parallel to the horizontal axis in the figure represent the preset threshold, and the absolute value of the vertical axis value corresponding to the two solid lines is the preset threshold. The preset threshold is 4.5, and the first analysis result is 77.38%, that is, the absolute value of the t value of 77.38% of the energy traces exceeds 4.5.

[0104] In this way, by setting a suitable preset threshold, it is possible to determine whether the number-theoretic fast transform polynomial multiplier generates information leakage and the location where the information leakage occurs.

[0105] In some embodiments, step 05 includes:

[0106] 051: Determine the ability of the NTT polynomial multiplier to resist energy analysis attacks according to the first analysis result and the comparison result.

[0107] Specifically, if the first analysis result is large and the private key accuracy is higher than the preset threshold, there are many locations where information leakage occurs in the NTT polynomial multiplier, and attacking the NTT polynomial multiplier can accurately obtain the actual sub-private key, so the NTT polynomial multiplier has weak resistance to energy analysis attacks; if the first analysis result is small and the private key accuracy is less than the preset threshold, there are few locations where leakage occurs in the NTT polynomial multiplier, the amount of information that may be leaked is small, and when attacking the NTT polynomial multiplier, some target sub-private keys are still different from the actual sub-private keys, then the NTT polynomial multiplier has strong resistance to energy analysis attacks.

[0108] In this way, the ability of the NTT polynomial multiplier to resist energy analysis attacks can be determined based on the first analysis result and the comparison result, providing an evaluation method for detecting the security and reliability of cryptographic devices based on the NTT polynomial multiplier.

[0109] See also Fig.14 In some embodiments, after collecting the actual energy trace, the detection method further includes:

[0110] 071: Get the waveform of the actual energy trace.

[0111] 072: Analyze according to the waveform diagram and the data to obtain a second analysis result, wherein the second analysis result includes the reason for the waveform change of the actual energy trace.

[0112] Specifically, see Fig.12 Step 071 and step 072 can be implemented by the acquisition module and the data analysis module of the detection system 100, wherein step 071 can be implemented by the acquisition module, and step 072 can be implemented by the data analysis module, that is, step 071 can be used to obtain the waveform diagram of the actual energy trace, and step 072 can be used to analyze according to the waveform diagram and the data to obtain a second analysis result, and the second analysis result includes the reason for the waveform change of the actual energy trace. The acquisition module can be an oscilloscope, and the voltage waveform of the NTT polynomial multiplier in the decryption stage is as follows: Fig.15 As shown in the figure, the horizontal axis represents the sampling point number. The oscilloscope collects voltage at intervals of 2ns, and the vertical axis represents the voltage across the sampling resistor. It can be seen that the energy trace of the NTT polynomial multiplier is an irregular fluctuation that rises and falls from time to time, that is, the power consumption of the NTT polynomial multiplier is an irregular fluctuation. The energy trace waveform changes with the power consumption of the NTT polynomial multiplier, please refer to Fig.15 The black horizontal bar in the figure indicates the position of the data stream input into the NTT polynomial multiplier. The NTT polynomial multiplier includes a modular multiplication circuit, a data delay unit, and an eight-stage BF2 circuit. By comparing and analyzing the energy trace waveform and the data stream position, we can infer the reason for the fluctuation of the energy trace waveform:

[0113] Section I-II: Data is input to the decryption module of the NTT polynomial multiplier, and the pipelines of the modular multiplication circuit are started one by one. The power consumption of the NTT polynomial multiplier increases rapidly. When the pipeline of the first-stage BF2 circuit is fully loaded with data, the power consumption growth rate decreases and increases at a slower rate. At this time, the slow growth of power consumption is due to the fact that the pipeline of the data delay unit is gradually filled with data;

[0114] II-III stage: the pipeline of the data delay unit is full of data, and starts to input data to the second-stage BF2 circuit, ushering in the second rapid increase in power consumption. Subsequently, when the third-stage BF2 circuit is activated, the power consumption increases rapidly for the third time.

[0115] Segments III-IV: After the calculation process is finished, the modular multiplication circuit is turned off, which rapidly reduces the power consumption. After a few short cycles, the first-level BF2 circuit is turned off after processing all the data, which together lead to a cliff-like reduction in power consumption. Then, the fourth to eighth-level BF2 circuits are activated one by one, and the power consumption increases rapidly several times. Before the eighth-level BF2 circuit is activated, no other level BF2 circuits are turned off, and the power consumption reaches its peak at this time.

[0116] IV-V stage: The second to eighth level BF2 circuits are turned off one by one, and the power consumption is gradually reduced.

[0117] In this way, the key node is located through the change of the energy trace waveform of the NTT polynomial multiplier, and the key node is attacked, such as attacking the data stream when it enters the modular multiplication circuit.

[0118] An embodiment of the present invention provides an electronic device, which includes one or more processors and a memory. The memory stores a computer program. When the computer program is executed by the processor, the steps of the detection method of any of the above embodiments are implemented.

[0119] In this way, the electronic device of this embodiment attacks the NTT polynomial multiplier and obtains the target sub-private key based on the collected actual energy trace, and obtains the private key accuracy based on the target sub-private key and the actual sub-private key. The energy analysis resistance of the NTT polynomial multiplier is determined based on the comparison result of the private key accuracy and the set threshold, thereby providing an evaluation means for detecting the security and reliability of cryptographic devices based on the NTT polynomial multiplier.

[0120] An embodiment of the present invention provides a computer-readable storage medium, and when the program is executed by a processor, the steps of the detection method of any of the above embodiments are implemented.

[0121] In this way, the computer-readable storage medium of this embodiment attacks the NTT polynomial multiplier and obtains the target sub-private key based on the collected actual energy trace, and obtains the private key accuracy based on the target sub-private key and the actual sub-private key, and determines the energy analysis resistance of the NTT polynomial multiplier based on the comparison result of the private key accuracy and the set threshold, thereby providing an evaluation means for detecting the security and reliability of cryptographic devices based on NTT polynomial multipliers.

[0122] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples without contradiction.

[0123] In addition, the term "connection" should be understood in a broad sense, for example, it can include fixed connection, detachable connection, or integral connection; it can include direct connection, indirect connection through an intermediate medium, and internal communication between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0124] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0125] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.

[0126] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A detection method for the ability to resist energy analysis attacks, It is characterized in that The detection method is used to detect an NTT polynomial multiplier, the NTT polynomial multiplier includes a decryption module, the decryption module is used to decrypt according to a ciphertext and a private key to obtain a plaintext, the detection method includes: Inputting data to the NTT polynomial multiplier; collecting an actual energy trace, wherein the actual energy trace is a voltage of the decryption module; Attacking the decryption process of the NTT polynomial multiplier using an attack function, and obtaining a target private key according to the actual energy trace, wherein the target private key is composed of target sub-private keys; Obtaining a private key accuracy rate according to the target private key and the actual private key, wherein the actual private key is composed of actual sub-private keys, and the private key accuracy rate is used to indicate the proportion of target sub-private keys that are identical to the actual sub-private keys in the target private key; The ability of the NTT polynomial multiplier to resist energy analysis attacks is determined based on the comparison result between the private key accuracy and the set threshold. When the private key accuracy is higher than the set threshold, the ability of the NTT polynomial multiplier to resist energy analysis attacks is at the first level; when the private key accuracy is lower than the set threshold, the ability of the NTT polynomial multiplier to resist energy analysis attacks is at the second level, and the first level is lower than the second level.

2. The detection method according to claim 1, It is characterized in that The method of using the attack function to attack the decryption process of the NTT polynomial multiplier and obtaining a target private key according to the actual energy trace includes: Obtaining a hypothetical energy trace according to a hypothetical child private key, wherein the hypothetical child private key is all possible values ​​of the actual child private key to be attacked; The correlation between the assumed energy trace and the actual energy trace is calculated, and a target sub-private key is obtained according to the correlation, wherein the target sub-private key is the assumed sub-private key corresponding to the assumed energy trace with the highest correlation, and the target private key is composed of a plurality of the target sub-private keys.

3. The detection method according to claim 1, It is characterized in that The decryption process of the decryption module includes a first calculation process and a second calculation process, the first calculation process and the second calculation process are performed simultaneously, the target private key includes a first part and a second part, and the decryption process of using the attack function to attack the NTT polynomial multiplier and obtaining the target private key according to the actual energy trace includes: Use a first attack function to attack the first calculation process and the second calculation process respectively, wherein the first attack function is designed according to the structure of the decryption module; The second calculation process is set as noise, and the first attack function is used to attack the first calculation process, and the first part is obtained according to the actual energy trace; The first calculation process is set as noise, and the first attack function is used to attack the second calculation process, and the second part is obtained according to the actual energy trace.

4. The detection method according to claim 1, It is characterized in that The decryption process includes a first calculation process and a second calculation process, the first calculation process and the second calculation process are performed simultaneously, the NTT polynomial multiplier includes a first-stage butterfly unit circuit, and the decryption process of attacking the NTT polynomial multiplier using an attack function and obtaining a target private key according to the actual energy trace includes: The first calculation process and the second calculation process are simultaneously attacked using a second attack function, and the target private key is obtained according to the actual energy trace, wherein the second attack function is designed according to the structure of the decryption module, the bridge rectifier circuit and the first-stage butterfly unit circuit.

5. The detection method according to claim 1, It is characterized in that The number of actual energy traces comprises 10,000.

6. The detection method according to claim 1, It is characterized in that The set threshold includes 99%.

7. The detection method according to claim 1, It is characterized in that The input data to the NTT polynomial multiplier comprises: The first data and the second data are respectively input into the NTT polynomial multiplier, the first data includes multiple sets of randomly generated private keys and ciphertexts, and the second data includes multiple sets of randomly generated ciphertexts and fixed private keys; the actual energy traces include a first set and a second set, the first set is a set of energy traces generated by inputting the first data, and the second set is a set of energy traces generated by inputting the second data.

8. The detection method according to claim 7, It is characterized in that The detection method further comprises: Calculate t-values ​​based on energy traces in the first set and energy traces in the second set; Determine whether there is information leakage in the NTT polynomial multiplier at the energy trace corresponding to the t value according to a comparison result between the absolute value of the t value and a preset threshold; When the absolute value of the t value is greater than the preset threshold, there is information leakage in the NTT polynomial multiplier at the energy trace corresponding to the t value; when the absolute value of the t value is less than the preset threshold, there is information leakage in the NTT polynomial multiplier at the energy trace corresponding to the t value; The t value is calculated by the following formula: Where A represents the first set, B represents the second set, μ A and μ B denote the means of the energy traces in the first set and the second set respectively, σ A and σ B denote the standard deviation of the energy traces in the first set and the second set, respectively, N A and N B Respectively represent the number of energy traces in the first set and the second set.

9. The detection method according to claim 8, It is characterized in that The detection method further comprises: A first analysis result is obtained according to the t value, where the first analysis result is the proportion of the number of t values ​​exceeding a preset threshold in the total number of t values.

10. The detection method according to claim 9, It is characterized in that The value range of the preset threshold includes 4-5.

11. The detection method according to claim 9, It is characterized in that The step of determining the energy analysis attack resistance capability of the NTT polynomial multiplier according to the comparison result between the private key accuracy and the set threshold value includes: The ability of the NTT polynomial multiplier to resist energy analysis attacks is determined according to the first analysis result and the comparison result.

12. The detection method according to claim 1, It is characterized in that After collecting the actual energy trace, the detection method further includes: Obtaining a waveform diagram of the actual energy trace; An analysis is performed based on the waveform diagram and the data to obtain a second analysis result, wherein the second analysis result includes the reason for the waveform change of the actual energy trace.

13. A detection system for the ability to resist energy analysis attacks, It is characterized in that The detection system is used to detect an NTT polynomial multiplier, the NTT polynomial multiplier includes a decryption module, the decryption module is used to decrypt according to a ciphertext and a private key to obtain a plaintext, and the detection system includes: An input module, the input module is used to input data to the NTT polynomial multiplier; A collection module, the collection module is used to collect actual energy traces, the actual energy traces are the voltage of the decryption module; An attack module, the attack module is used to attack the NTT polynomial multiplier decryption process using an attack function, and obtain a target private key according to the actual energy trace, wherein the target private key is composed of target sub-private keys; An analysis and processing module, wherein the analysis and processing module is used to obtain a private key accuracy rate based on the target private key and the actual private key, wherein the actual private key is composed of actual sub-private keys, and the private key accuracy rate is used to indicate the proportion of target sub-private keys that are identical to the actual sub-private keys in the target private key; the analysis and processing module is also used to determine the ability of the NTT polynomial multiplier to resist energy analysis attacks based on a comparison result of the private key accuracy rate and a set threshold value, wherein when the private key accuracy rate is higher than the set threshold value, the ability of the NTT polynomial multiplier to resist energy analysis attacks is at a first level; and when the private key accuracy rate is lower than the set threshold value, the ability of the NTT polynomial multiplier to resist energy analysis attacks is at a second level, and the first level is lower than the second level.

14. The detection system according to claim 13, It is characterized in that The attack module also includes: A determination submodule, the determination submodule being used to obtain a hypothetical energy trace according to a hypothetical child private key, the hypothetical child private key being all possible values ​​of the actual child private key to be attacked; A calculation submodule, the calculation submodule is used to calculate the correlation between the assumed energy trace and the actual energy trace, and obtain a target sub-private key according to the correlation, the target sub-private key is the assumed sub-private key corresponding to the assumed energy trace with the highest correlation, and the target private key is composed of multiple target sub-private keys.

15. The detection system according to claim 13, It is characterized in that The decryption process of the decryption module includes a first calculation process and a second calculation process, the first calculation process and the second calculation process are performed simultaneously, the target private key includes a first part and a second part, and the attack module includes: The first attack submodule is used to use a first attack function to attack the first calculation process and the second calculation process respectively, and the first attack function is designed according to the structure of the decryption module; the first attack submodule is also used to set the second calculation process as noise, and use the first attack function to attack the first calculation process, and obtain the first part according to the actual energy trace; the first attack submodule is also used to set the first calculation process as noise, and use the first attack function to attack the second calculation process, and obtain the second part according to the actual energy trace.

16. The detection system according to claim 13, It is characterized in that The decryption process includes a first calculation process and a second calculation process, the first calculation process and the second calculation process are performed simultaneously, the NTT polynomial multiplier includes a first-stage butterfly unit circuit, and the attack module includes: The second attack submodule uses a second attack function to simultaneously attack the first calculation process and the second calculation process, and obtains the target private key according to the actual energy trace, and the second attack function is designed according to the structure of the decryption module, the bridge rectifier circuit and the first-stage butterfly unit circuit.

17. The detection system according to claim 13, It is characterized in that The input module comprises: An input submodule, the input submodule is used to input first data and second data to the NTT polynomial multiplier respectively, the first data includes multiple sets of randomly generated private keys and ciphertexts, and the second data includes multiple sets of randomly generated ciphertexts and fixed private keys; the actual energy traces include a first set and a second set, the first set is a set of energy traces generated by inputting the first data, and the second set is a set of energy traces generated by inputting the second data.

18. The detection system according to claim 13, It is characterized in that The detection system also includes: A calculation module, the calculation module is used to calculate the t value according to the energy traces in the first set and the energy traces in the second set; A determination module, the determination module is used to determine whether there is information leakage in the NTT polynomial multiplier at the energy trace corresponding to the t value according to the comparison result of the absolute value of the t value and the preset threshold; when the absolute value of the t value is greater than the preset threshold, there is information leakage in the NTT polynomial multiplier at the energy trace corresponding to the t value; when the absolute value of the t value is less than the preset threshold, there is information leakage in the NTT polynomial multiplier at the energy trace corresponding to the t value; The t value is calculated by the following formula: Where A represents the first set, B represents the second set, μ A and μ B denote the means of the energy traces in the first set and the second set respectively, σ A and σ B denote the standard deviation of the energy traces in the first set and the second set, respectively, N A and N B Respectively represent the number of energy traces in the first set and the second set.

19. The detection system according to claim 13, It is characterized in that The detection system also includes: An acquisition module, the acquisition module is used to obtain a waveform diagram of the actual energy trace; A data analysis module is used to perform analysis based on the waveform diagram and the data to obtain a second analysis result, wherein the second analysis result includes the reason for the waveform change of the actual energy trace.

20. An electronic device, It is characterized in that The electronic device includes one or more processors and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the steps of the detection method according to any one of claims 1 to 12 are implemented.

21. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the steps of the detection method according to any one of claims 1 to 12 are implemented.