Data encryption analysis method and device, storage medium and electronic equipment

By detecting the frequency and Hanming information during the encryption process in the chip, refine the frequency particle size, and analyzing the correlation between plain text ciphertext pairs and frequency values, the data analysis difficulty caused by power consumption adjustment in the chip is solved, and the data analysis problem is achieved. Accurate data encryption analysis.

CN118940282APending Publication Date: 2024-11-12NATIONZ TECH INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310540887.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-12
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In some chips, power consumption adjustment caused by the performance grading adjustment function increases the difficulty of data analysis, and the frequency data particle size is coarse, making it difficult to effectively utilize data changes.

Method used

By sending plaintext to the data encryption terminal to detect the frequency information and Hanming information during the encryption process, obtain the initial frequency granularity based on this information, and expand the data volume of the frequency through the granularity, analyze the pairs of plaintext ciphertexts and frequency fetching. The correlation between values ​​is obtained.

Benefits of technology

It realizes the conversion of energy consumption information into frequency information, facilitates data encryption analysis, obtains more accurate data encryption analysis results, and uses frequency particle size to refine and expand the frequency data volume, improving the accuracy of the analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118940282A_ABST
    Figure CN118940282A_ABST
Patent Text Reader

Abstract

The invention discloses a data encryption analysis method and device, a storage medium and electronic device.The data encryption analysis method comprises the steps that a to-be-encrypted plaintext is sent to a data encryption end, and frequency information and Hamming information in the process that the data encryption end encrypts the to-be-encrypted plaintext are detected; obtaining a plaintext and ciphertext pair based on the to-be-encrypted plaintext and the ciphertext obtained by encrypting the to-be-encrypted plaintext; obtaining an initial frequency granularity corresponding to the data encryption end based on the frequency information; performing granularity refinement on the initial frequency granularity based on the Hamming information, and obtaining a frequency value set corresponding to the frequency information by using the refined target frequency granularity; the correlation between the plaintext and ciphertext pair and each frequency value in the frequency value set is analyzed, a data encryption analysis result is obtained, the data volume of the frequency is expanded through frequency granularity refinement, a more accurate data encryption analysis result is obtained, and effective utilization of frequency information in the data encryption process is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data encryption analysis method, device, storage medium and electronic device. Background Art

[0002] The energy consumption generated during the operation of the chip is correlated with the data processed by the chip. Therefore, data information can be obtained by analyzing the power consumption information generated by the chip when performing cryptographic operations.

[0003] However, some chips are equipped with a performance grading adjustment function based on energy consumption, which adjusts power consumption according to the workload required by the chip to stabilize the chip performance at several preset levels. The original purpose of doing so was to save energy, but it also brings difficulties to the data analysis of the chip. Summary of the invention

[0004] The present application at least provides a data encryption analysis method, device, storage medium and electronic device.

[0005] The first aspect of the present application provides a data encryption analysis method, including: sending plaintext to be encrypted to a data encryption end, detecting frequency information and Hamming information of the plaintext to be encrypted by the data encryption end during the encryption process, and obtaining a plaintext-ciphertext pair based on the plaintext to be encrypted and the ciphertext obtained by encrypting the plaintext to be encrypted; obtaining an initial frequency granularity corresponding to the data encryption end based on the frequency information; refining the initial frequency granularity based on the Hamming information, and obtaining a frequency value set corresponding to the frequency information using the refined target frequency granularity; analyzing the correlation between the plaintext-ciphertext pair and each frequency value in the frequency value set to obtain a data encryption analysis result.

[0006] In one embodiment, the frequency information and Hamming information of the encryption process of the plaintext to be encrypted are detected by the data encryption end, including: determining the number of Hamming values ​​corresponding to the preset calculation unit in the encryption process; and using the number of Hamming values ​​as the Hamming information of the encryption process of the plaintext to be encrypted.

[0007] In one embodiment, the preset calculation unit is an encrypted intermediate value in the encryption process; determining the number of Hamming value values ​​corresponding to the preset calculation unit in the encryption process includes: determining the byte size of the encrypted intermediate value; based on the byte size of the encrypted intermediate value, obtaining the number of Hamming value values ​​corresponding to the encrypted intermediate value in the encryption process.

[0008] In one embodiment, based on the byte size of the encrypted intermediate value, the number of Hamming value values ​​corresponding to the encrypted intermediate value in the encryption process is obtained, including: based on the byte size of the encrypted intermediate value, obtaining a Hamming weight value set and a Hamming distance value set; obtaining the Hamming weight weight corresponding to the Hamming weight value set and the Hamming distance weight corresponding to the Hamming distance value set; based on the Hamming weight weight and the Hamming distance weight, performing weighted calculations on each Hamming weight value in the Hamming weight value set and each Hamming distance value in the Hamming distance value set; and obtaining the number of Hamming value values ​​corresponding to the encrypted intermediate value in the encryption process by counting the number of weighted calculation results obtained by the weighted calculation.

[0009] In one embodiment, a plaintext to be encrypted is sent to a data encryption end, and frequency information and Hamming information of the plaintext to be encrypted during the encryption process of the plaintext to be encrypted by the data encryption end are detected, including: obtaining the number of encryption executions corresponding to the plaintext to be encrypted, sending the plaintext to be encrypted and the number of encryption executions corresponding to the plaintext to be encrypted to the data encryption end, so that the data encryption end repeatedly encrypts the plaintext to be encrypted multiple times according to the number of encryption executions; during the process of the data encryption end performing multiple encryptions of the plaintext to be encrypted, if it is detected that the data encryption end triggers a dynamic voltage frequency adjustment event, frequency information is obtained based on the dynamic voltage frequency adjustment event.

[0010] In one embodiment, there are multiple plaintexts to be encrypted and multiple plaintext-ciphertext pairs; the correlation between the plaintext-ciphertext pairs and the frequency values ​​in the frequency value set is analyzed to obtain data encryption analysis results, including: obtaining the encrypted intermediate value corresponding to each plaintext-ciphertext pair in the encryption process; calculating the Hamming value of each encrypted intermediate value; obtaining the frequency value matching the Hamming value of each encrypted intermediate value from the frequency value set to obtain the frequency value related to each plaintext-ciphertext pair; and obtaining the data encryption analysis result based on the frequency value related to each plaintext-ciphertext pair.

[0011] In one embodiment, calculating the Hamming value of each encrypted intermediate value includes: calculating the Hamming weight and the Hamming distance corresponding to each encrypted intermediate value, and obtaining the Hamming weight weight corresponding to the Hamming weight and the Hamming distance weight corresponding to the Hamming distance; based on the Hamming weight weight and the Hamming distance weight, performing weighted calculation on the Hamming weight and the Hamming distance corresponding to each encrypted intermediate value to obtain the Hamming value of each encrypted intermediate value.

[0012] The second aspect of the present application provides a data encryption analysis device, including: a detection module, which is used to send a plaintext to be encrypted to a data encryption end, detect the frequency information and Hamming information of the data encryption end in the process of encrypting the plaintext to be encrypted, and obtain a plaintext-ciphertext pair based on the plaintext to be encrypted and the ciphertext obtained by encrypting the plaintext to be encrypted; an initial frequency granularity acquisition module, which is used to obtain the initial frequency granularity corresponding to the data encryption end based on the frequency information; a granularity refinement module, which is used to refine the initial frequency granularity based on the Hamming information, and obtain a frequency value set corresponding to the frequency information using the refined target frequency granularity; an analysis module, which is used to analyze the correlation between the plaintext-ciphertext pair and each frequency value in the frequency value set to obtain a data encryption analysis result.

[0013] A third aspect of the present application provides an electronic device, including a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the above-mentioned data encryption analysis method.

[0014] A fourth aspect of the present application provides a computer-readable storage medium on which program instructions are stored, and when the program instructions are executed by a processor, the above-mentioned data encryption analysis method is implemented.

[0015] The above scheme sends the plaintext to be encrypted to the data encryption end, detects the frequency information and Hamming information of the plaintext to be encrypted by the data encryption end, and obtains the plaintext-ciphertext pair based on the plaintext to be encrypted and the ciphertext obtained by encrypting the plaintext to be encrypted; obtains the initial frequency granularity corresponding to the data encryption end based on the frequency information; refines the initial frequency granularity based on the Hamming information, and obtains the frequency value set corresponding to the frequency information using the refined target frequency granularity; analyzes the correlation between the plaintext-ciphertext pair and each frequency value in the frequency value set to obtain the data encryption analysis result, which can not only convert the energy consumption information into frequency information to facilitate the implementation of data encryption analysis, but also expand the frequency data volume through frequency granularity refinement, calculate these data using the power consumption analysis method, and obtain more accurate data encryption analysis results, thereby realizing the effective use of frequency information in the data encryption process.

[0016] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.

[0018] Figure 1 It is a schematic diagram of the implementation environment involved in this application;

[0019] Figure 2 is a flow chart of a data encryption analysis method shown in an exemplary embodiment of the present application;

[0020] Figure 3 is a schematic diagram of obtaining frequency information shown in an exemplary embodiment of the present application;

[0021] Figure 4 is a flow chart of a data encryption analysis method shown in another exemplary embodiment of the present application;

[0022] Figure 5 is a block diagram of a data encryption analysis device shown in an exemplary embodiment of the present application;

[0023] Figure 6 is a schematic structural diagram of an electronic device shown in an exemplary embodiment of the present application;

[0024] Figure 7 It is a schematic diagram of the structure of a computer-readable storage medium shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0025] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.

[0026] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.

[0027] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.

[0028] The data encryption analysis method provided in the embodiment of the present application is described below.

[0029] See also Figure 1 , Figure 1 Schematic diagram of an implementation environment involved in the data encryption analysis method in this application. Figure 1 As shown, the implementation environment includes a data analysis end and a data encryption end, and the data analysis end and the data encryption end can be directly or indirectly connected via wired or wireless communication.

[0030] The data encryption end may be a terminal or a server, and is used to encrypt the received plaintext to be encrypted. The chip for data encryption deployed in the data encryption end may encrypt the received plaintext to be encrypted. The chip has a dynamic voltage and frequency scaling (DVFS) function, which enables the chip to adjust the operating frequency and voltage of the chip in real time according to the different computing power requirements of the running application (for the same chip, the higher the frequency, the higher the required voltage), to ensure that the power provided meets both the computing power requirements and the chip security. There are usually multiple voltage and frequency (VF) levels in the chip, each level specifies the corresponding power supply voltage and operating frequency. The chip can switch between different (Volt and Frequency, VF) levels during operation to adjust performance and power consumption. Among them, performance adjustment is achieved by changing the frequency of the processor core, and power consumption adjustment is achieved by changing the frequency and power supply voltage of the processor core. Therefore, the change of chip frequency is related to the data processed by the chip. However, due to the VF classification, the frequency data can only be taken in a few VF levels, and the granularity is coarse, which is difficult to use for data changes.

[0031] Based on the above problems, the data analysis end provided in the present application refines the initial frequency granularity for the coarser-granularity DVFS hierarchical adjustment strategy, and analyzes the correlation between the frequency and the processed data based on the refined granularity.

[0032] Specifically, the data analysis end can be a terminal or a server, which is used to send the plaintext to be encrypted to the data encryption end to obtain a plaintext-ciphertext pair, and detect the frequency information and Hamming information of the plaintext to be encrypted by the data encryption end, and then refine the initial frequency granularity corresponding to the frequency information according to the Hamming information, and use the refined target frequency granularity to obtain the frequency value set corresponding to the frequency information, and then analyze the correlation between the plaintext-ciphertext pair and each frequency value in the frequency value set, so as to realize the analysis of the correlation between the processed data and the frequency.

[0033] Among them, the terminal can be a mobile phone, a computer, an intelligent voice interaction device, a smart home appliance, a vehicle terminal, an aircraft, etc., which is not limited in this application. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms, etc., which is not limited in this application.

[0034] See also Figure 2 , Figure 2 is a flowchart of a data encryption analysis method shown in an exemplary embodiment of the present application. The data encryption analysis method can be applied to Figure 1 It should be understood that the method can also be applied to other exemplary implementation environments and be specifically executed by devices in other implementation environments, and this embodiment does not limit the implementation environment to which the method is applicable.

[0035] The data encryption analysis method proposed in the embodiment of the present application is introduced in detail below using the data analysis end as the specific execution entity.

[0036] like Figure 2 As shown, in an exemplary embodiment, the data encryption analysis method includes at least steps S210 to S240, which are described in detail as follows:

[0037] Step S210: Send the plaintext to be encrypted to the data encryption end, detect the frequency information and Hamming information of the plaintext to be encrypted during the encryption process of the plaintext to be encrypted by the data encryption end, and obtain a plaintext-ciphertext pair based on the plaintext to be encrypted and the ciphertext obtained by encrypting the plaintext to be encrypted.

[0038] Data encryption refers to converting encrypted plaintext into meaningless ciphertext through encryption keys and encryption functions.

[0039] The data analysis end sends the plaintext to be encrypted to the data encryption end, and detects the frequency information and Hamming information of the plaintext to be encrypted by the data encryption end. The frequency information is used to reflect the power consumption related to the encryption of the plaintext by the data encryption end, and the Hamming information is used to distinguish different data in the encryption process. Due to DVFS, the corresponding frequencies of different data may all be the same value, and thus the correlation between the frequency and the processed data cannot be reflected. However, the Hamming information corresponding to different data is different. Therefore, the data can be distinguished by the Hamming information.

[0040] Next, the process of obtaining Hamming information is described in detail:

[0041] In some embodiments, detecting the frequency information and Hamming information of the encryption process of the plaintext to be encrypted by the data encryption end includes: determining the number of Hamming value values ​​corresponding to the preset calculation unit in the encryption process; and using the number of Hamming value values ​​as the Hamming information of the encryption process of the plaintext to be encrypted.

[0042] The preset calculation unit is the relevant data involved in the encryption process of the plaintext to be encrypted, and different preset calculation units can be selected according to different encryption algorithms used in the encryption process. The Hamming value can be obtained based on the Hamming distance, or based on the Hamming weight, or based on the Hamming distance and the Hamming weight, which is not limited in this application.

[0043] Exemplarily, the preset calculation unit is an encrypted intermediate value in the encryption process; determining the number of Hamming value values ​​corresponding to the preset calculation unit in the encryption process includes: determining the byte size of the encrypted intermediate value; based on the byte size of the encrypted intermediate value, obtaining the number of Hamming value values ​​corresponding to the encrypted intermediate value in the encryption process.

[0044] The encrypted intermediate value refers to the intermediate encryption result obtained when the plaintext to be encrypted is encrypted.

[0045] Byte is a unit of measurement used in computer information technology to measure storage capacity. Usually, 1 byte is equal to 8 bits. Each bit stores a 1-bit binary code, and its value is 0 or 1. It is understandable that the byte size of the encrypted intermediate value may be different if the encryption algorithm used in the encryption process is different. The byte size of the encrypted intermediate value can be determined by obtaining the encryption algorithm used in the encryption process.

[0046] The byte size of the encrypted intermediate value is determined, so as to count the number of Hamming value values ​​corresponding to the encrypted intermediate value according to the byte size of the encrypted intermediate value.

[0047] For example, based on the byte size of the encrypted intermediate value, the number of Hamming value values ​​corresponding to the preset calculation unit in the encryption process is obtained, including: based on the byte size of the encrypted intermediate value, a Hamming weight value set and a Hamming distance value set are obtained; the Hamming weight weight corresponding to the Hamming weight value set and the Hamming distance weight corresponding to the Hamming distance value set are obtained; based on the Hamming weight weight and the Hamming distance weight, each Hamming weight value in the Hamming weight value set and each Hamming distance value in the Hamming distance value set are weighted calculated respectively; the number of weighted calculation results obtained by the weighted calculation is counted to obtain the number of Hamming value values ​​corresponding to the encrypted intermediate value in the encryption process.

[0048] Among them, Hamming Weight (HW) is the number of non-zero symbols in a string of symbols; Hamming Distance (HD) represents the number of different characters in corresponding positions of two (same length) strings.

[0049] First, based on the byte size of the encrypted intermediate value, the Hamming weight value set and the Hamming distance value set are obtained. Taking the symmetric encryption algorithm (Advanced Encryption Standard, AES) as an example, the encrypted intermediate value of AES is the S-box input, and its byte size is 1 byte, then the S-box input contains 8 bits. Since each bit is 0 or 1, the Hamming weight value set corresponding to the S-box input is statistically obtained to be 9 values ​​from 0 to 8. The Hamming distance between the S-box input and the S-box output is used as the Hamming distance corresponding to the S-box input, and the Hamming distance value set is also 9 values ​​from 0 to 8.

[0050] Then, the Hamming weight corresponding to the Hamming weight value set and the Hamming distance weight corresponding to the Hamming distance value set are obtained. Based on the Hamming weight weight and the Hamming distance weight, weighted calculations are performed on each Hamming weight value in the Hamming weight value set and each Hamming distance value in the Hamming distance value set, and the number of weighted calculation results obtained by the weighted calculations is counted.

[0051] Among them, the Hamming weight and the Hamming distance weight can be pre-set or flexibly calculated. For example, the Hamming weight and the Hamming distance weight can be flexibly calculated according to different encryption algorithms used, different encryption keys, different initial frequency granularities corresponding to DVFS, etc.

[0052] Based on the Hamming weight and the Hamming distance weight, weighted calculation is performed on each Hamming weight value in the Hamming weight value set and each Hamming distance value in the Hamming distance value set.

[0053] For example, the Hamming weight is 0.5, the Hamming distance weight is 0.5, and weighted calculations are performed on each Hamming weight value in the Hamming weight value set and each Hamming distance value in the Hamming distance value set. The weighted calculation results include 0, 0.5, 1, 1.5...7.5, 8. Therefore, the number of weighted calculation results obtained by statistical weighted calculation is 17, that is, the number of Hamming value values ​​corresponding to the encrypted intermediate value in the encryption process is 17.

[0054] It can be understood that if the Hamming value is obtained based on the Hamming distance, the number of Hamming value values ​​is obtained directly according to the number of Hamming distance values ​​in the Hamming distance value set; if the Hamming value is obtained based on the Hamming weight, the number of Hamming value values ​​is obtained directly according to the number of Hamming weight values ​​in the Hamming weight value set.

[0055] The number of Hamming values ​​is used as the Hamming information in the encryption process of the plaintext to be encrypted.

[0056] Next, the process of obtaining frequency information is described in detail:

[0057] In some embodiments, a plaintext to be encrypted is sent to a data encryption end, and frequency information and Hamming information of the plaintext to be encrypted during the encryption process of the plaintext to be encrypted by the data encryption end are detected, including: obtaining the number of encryption executions corresponding to the plaintext to be encrypted, sending the plaintext to be encrypted and the number of encryption executions corresponding to the plaintext to be encrypted to the data encryption end, so that the data encryption end repeatedly encrypts the plaintext to be encrypted multiple times according to the number of encryption executions; during the process of multiple encryptions of the plaintext to be encrypted by the data encryption end, if it is detected that the data encryption end triggers a dynamic voltage frequency adjustment event, the frequency information is obtained based on the dynamic voltage frequency adjustment event.

[0058] The DVFS mechanism is triggered only when the load on the data encryption end reaches a certain level. At this time, the data encryption end will adjust the operating frequency according to the load, so that the frequency of the data encryption end is dynamically adjusted among several pre-set frequency levels. A single cryptographic operation generally cannot trigger the DVFS mechanism. Therefore, the data encryption end needs to perform multiple cryptographic operations to allow the data encryption end to have sufficient load to trigger the DVFS mechanism.

[0059] Among them, the number of encryption executions corresponding to the encrypted plaintext can be determined according to the trigger threshold of the DVFS mechanism and the encryption algorithm used in the cryptographic operation, and this application does not limit this.

[0060] For example, see Figure 3 , Figure 3 This is a schematic diagram of obtaining frequency information shown in an exemplary embodiment of the present application, such as Figure 3 As shown, if the number of encryption executions corresponding to the plaintext to be encrypted is N, the data analysis end sends the plaintext to be encrypted and the operation instruction to the data encryption end. The operation instruction is used to instruct the data encryption end to perform the same cryptographic operation on the plaintext to be encrypted N times, and finally obtain a set of plaintext ciphertext pairs. And in the process of the data encryption end performing the same cryptographic operation on the plaintext to be encrypted N times, the data analysis end sends the running frequency acquisition instruction to the data encryption end, and detects whether the data encryption end reaches the DVFS trigger threshold to adjust the frequency level based on the frequency acquisition instruction, that is, whether the dynamic voltage frequency adjustment event is triggered. If so, the frequency data is recorded from the next cryptographic operation to obtain the frequency information of the data encryption end in the encryption process of the plaintext to be encrypted. For example, if the recorded frequency information is 3Ghz and 3.2Ghz, it means that the data encryption end triggers the DVFS mechanism and adjusts the original frequency level of 3Ghz to 3.2Ghz.

[0061] In some implementations, a VF grading strategy acquisition instruction may be directly sent to the data encryption end, and then the frequency information may be obtained according to the VF grading strategy information returned by the data encryption end. For example, the VF grading strategy information indicates that the DVFS mechanism of the data encryption end divides the performance status into three levels: high, medium, and low, and adjusts the frequency to 1 GHz at the high level, 0.8 GHz at the medium level, and 0.6 GHz at the low level.

[0062] Step S220: obtaining an initial frequency granularity corresponding to the data encryption end based on the frequency information.

[0063] The initial frequency granularity corresponding to the data encryption end can be obtained according to the frequency information.

[0064] For example, if the frequency information indicates that the DVFS mechanism divides the performance status into three levels: high, medium, and low, and the frequency is adjusted to 1 GHz at the high level, 0.8 GHz at the medium level, and 0.6 GHz at the low level, then the initial frequency granularity corresponding to the data encryption end is 0.2 GHz.

[0065] Step S230: Refine the initial frequency granularity based on the Hamming information, and obtain a frequency value set corresponding to the frequency information using the refined target frequency granularity.

[0066] Based on the above embodiment, the process of granularity refinement is described in detail below:

[0067] Exemplarily, the target frequency granularity may be calculated using the following formula:

[0068] k=K / {A*HW(h)+B*HD(h)}

[0069] Among them, K is the initial frequency granularity before refinement, k is the target frequency granularity after refinement, h is the encrypted intermediate value involved in the encryption process of the plaintext to be encrypted, A is the Hamming weight, B is the Hamming distance weight, A+B=1, and {} represents the number of weighted calculation results obtained by statistical weighted calculation.

[0070] Then, a frequency value set corresponding to the frequency information is obtained according to the target frequency granularity.

[0071] For example, the granularity K before refinement is 0.2, the Hamming weight A is 0.5, the Hamming distance weight B is 0.5, and the value ranges of the Hamming weight value set and the Hamming distance value set are both 0 to 8. The weighted calculation results include 0, 0.5, 1, 1.5...7.5, 8. Therefore, the number of weighted calculation results obtained by statistical weighted calculation is 17. Then the target frequency granularity k after refinement is 0.2 / 17=0.058. If the frequency information before refinement is 1Ghz or 2Ghz, and the initial frequency granularity is 1Ghz, then the frequency value set corresponding to the refined frequency information is The frequency value corresponding to the weighted calculation result of 0 is 1.058Ghz, the frequency value corresponding to the weighted calculation result of 0.5 is 1.106Ghz..., and the frequency value corresponding to the weighted calculation result of 8 is 2Ghz. That is, the calculation process of the frequency value corresponding to each weighted calculation result is: calculate the product of the target frequency granularity and the number of bits of the weighted calculation result in the ascending order among all weighted calculation results to obtain the difference frequency, take the minimum frequency in the frequency information as the basic frequency, sum the difference frequency and the basic frequency, and obtain the frequency value corresponding to the weighted calculation result. Count the frequency values ​​corresponding to each weighted calculation result to obtain the frequency value set corresponding to the frequency information.

[0072] By refining the granularity, the frequency values ​​will be more diverse, which will facilitate the subsequent analysis of the correlation between frequency and data.

[0073] Step S240: Analyze the correlation between the plaintext and ciphertext pairs and each frequency value in the frequency value set to obtain a data encryption analysis result.

[0074] According to the frequency value set obtained after granularity refinement, the availability of frequency data is improved, and the correlation between the plaintext ciphertext pairs and the various frequency values ​​in the refined frequency value set is analyzed to obtain more accurate and usable data encryption analysis results.

[0075] Specifically, based on the above embodiment, the process of correlation analysis is described in detail below:

[0076] In some embodiments, the number of plaintexts to be encrypted is multiple, and therefore the number of plaintext-ciphertext pairs is also multiple; the correlation between the plaintext-ciphertext pairs and each frequency value in the frequency value set is analyzed to obtain the data encryption analysis result, including: obtaining the encrypted intermediate value corresponding to each plaintext-ciphertext pair in the encryption process; calculating the Hamming value of each encrypted intermediate value; obtaining the frequency value matching the Hamming value of each encrypted intermediate value from the frequency value set to obtain the frequency value related to each plaintext-ciphertext pair; and obtaining the data encryption analysis result based on the frequency value related to each plaintext-ciphertext pair.

[0077] The process of determining the frequency value set corresponding to each plaintext to be encrypted includes: during the process of multiple encryptions of the currently sent plaintext to be encrypted by the data encryption end, if it is detected that the data encryption end triggers a dynamic voltage frequency adjustment event, frequency information is obtained based on the dynamic voltage frequency adjustment event, and the frequency value set corresponding to the frequency information is used as the frequency value set corresponding to the currently sent plaintext to be encrypted. Then, based on the encrypted intermediate value corresponding to the currently sent plaintext to be encrypted in the encryption process, according to the Hamming value of the encrypted intermediate value, the frequency value related to the plaintext-ciphertext pair corresponding to the currently sent plaintext to be encrypted is selected from the frequency value set corresponding to the currently sent plaintext to be encrypted.

[0078] For example, 10 different plaintexts to be encrypted are sent to the data encryption end for encryption in sequence, so that the data encryption end repeatedly encrypts the 10 different plaintexts to be encrypted respectively, and detects that the 10 different plaintexts to be encrypted trigger a dynamic voltage frequency adjustment event during the encryption process of the data encryption end, which are the corresponding frequency information respectively. For example, the frequency information corresponding to the 10 different plaintexts to be encrypted are all 1Ghz and 2Ghz, which indicates that when the data encryption end encrypts the 10 different plaintexts to be encrypted, it adjusts the original frequency level of 1Ghz to 2Ghz by triggering the DVFS mechanism.

[0079] If the initial frequency granularity corresponding to the data encryption end is not refined, the processing processes of multiple different data will correspond to the same frequency information, making it difficult to analyze the relationship between these data and the frequency. In combination with the above embodiment, the frequency value set corresponding to 1Ghz and 2Ghz obtained after granularity refinement includes 1.058Ghz, 1.106Ghz..., 2Ghz, and then, based on the encrypted intermediate value corresponding to the currently sent plaintext to be encrypted in the encryption process, according to the Hamming value of the encrypted intermediate value, the frequency value related to the plaintext-ciphertext pair corresponding to the currently sent plaintext to be encrypted is selected from the frequency value set corresponding to the currently sent plaintext to be encrypted.

[0080] Among them, calculating the Hamming value of each encrypted intermediate value includes: calculating the Hamming weight and the Hamming distance corresponding to each encrypted intermediate value, and obtaining the Hamming weight weight corresponding to the Hamming weight and the Hamming distance weight corresponding to the Hamming distance; based on the Hamming weight weight and the Hamming distance weight, performing weighted calculation on the Hamming weight and the Hamming distance corresponding to each encrypted intermediate value to obtain the Hamming value of each encrypted intermediate value.

[0081] For example, the Hamming value of the first encrypted intermediate value corresponding to the first plaintext to be encrypted is 0, and the Hamming value of the second encrypted intermediate value corresponding to the second plaintext to be encrypted is 0.5. From the frequency value set corresponding to the currently sent plaintext to be encrypted, the process of selecting the frequency value associated with the plaintext-ciphertext pair corresponding to the currently sent plaintext to be encrypted can be that each frequency value in the frequency value set is associated with a Hamming value, such as 1.058Ghz is associated with the Hamming value 0, and 1.106Ghz is associated with the Hamming value 0.5. This association relationship is obtained based on the association relationship between each weighted calculation result and the frequency value when the frequency value set corresponding to the frequency information is obtained according to the target frequency granularity in step S230. Then, the frequency value associated with the first plaintext-ciphertext pair corresponding to the first plaintext to be encrypted is 1.058Ghz, and the frequency value associated with the second plaintext-ciphertext pair corresponding to the second plaintext to be encrypted is 1.106Ghz.

[0082] Based on the above method, 10 different plaintexts to be encrypted correspond to 10 different intermediate values. The 10 different plaintext-ciphertext pairs obtained by encryption correspond to 10 different frequency values ​​in the 1Ghz and 2Ghz ranges, respectively, which can make the frequency values ​​more diversified and improve the correlation between frequency and data.

[0083] In some embodiments, see Figure 4 , Figure 4 A flowchart of a data encryption analysis method shown in another exemplary embodiment of the present application is as follows: Figure 4 As shown, the data analysis end is a personal computer (PC), and the data encryption end is a chip; step S410: the PC sends the plaintext to be encrypted and the operation instruction to the chip, and the operation instruction is used to instruct the chip to perform N cryptographic operations on the plaintext to be encrypted; step S420: the chip performs N cryptographic operations on the plaintext to be encrypted, and when the DVFS mechanism is triggered, it performs T real-time frequency records in a certain period to obtain frequency information; S430: the PC receives the ciphertext and frequency information after the operation, returns to step S410, and repeatedly sends M groups of different plaintexts to be encrypted and the operation instruction to the chip, thereby obtaining M groups of plaintexts. S440: according to the values ​​of the Hamming weight and the Hamming distance of the encrypted intermediate value involved in the cryptographic operation, the initial frequency granularity corresponding to the data encryption end is refined and expanded, wherein the specific implementation steps of the refinement and expansion refer to step S230; S450: using M groups of plaintext-ciphertext pairs, M groups of frequency information, the Hamming weight and the Hamming distance corresponding to each group of plaintext-ciphertext pairs and the refined and expanded frequency information, a correlation analysis is performed to obtain the data encryption analysis result, wherein the specific implementation steps of the correlation analysis refer to step S240.

[0084] The data encryption analysis method provided by the present application sends a plaintext to be encrypted to a data encryption end, detects the frequency information and Hamming information of the plaintext to be encrypted by the data encryption end during the encryption process, and obtains a plaintext-ciphertext pair based on the plaintext to be encrypted and the ciphertext obtained by encrypting the plaintext to be encrypted; obtains an initial frequency granularity corresponding to the data encryption end based on the frequency information; refines the initial frequency granularity based on the Hamming information, and obtains a frequency value set corresponding to the frequency information using the refined target frequency granularity; analyzes the correlation between the plaintext-ciphertext pair and each frequency value in the frequency value set to obtain a data encryption analysis result, which can not only convert energy consumption information into frequency information to facilitate the implementation of data encryption analysis, but also expand the amount of frequency data through frequency granularity refinement, calculate these data using the power consumption analysis method, and obtain more accurate data encryption analysis results, thereby achieving effective utilization of frequency information in the data encryption process.

[0085] Figure 5 FIG. 1 is a block diagram of a data encryption analysis device shown in an exemplary embodiment of the present application. Figure 5 As shown, the exemplary data encryption analysis device 500 includes: a detection module 510, an initial frequency granularity acquisition module 520, a granularity refinement module 530, and an analysis module 540. Specifically:

[0086] The detection module 510 is used to send the plaintext to be encrypted to the data encryption end, detect the frequency information and Hamming information of the plaintext to be encrypted by the data encryption end, and obtain a plaintext-ciphertext pair based on the plaintext to be encrypted and the ciphertext obtained by encrypting the plaintext to be encrypted;

[0087] An initial frequency granularity acquisition module 520 is used to obtain an initial frequency granularity corresponding to the data encryption end based on the frequency information;

[0088] A granularity refinement module 530 is used to refine the initial frequency granularity based on the Hamming information, and obtain a frequency value set corresponding to the frequency information using the refined target frequency granularity;

[0089] The analysis module 540 is used to analyze the correlation between the plaintext and ciphertext pairs and each frequency value in the frequency value set to obtain a data encryption analysis result.

[0090] In the above-mentioned exemplary data encryption analysis device, not only can energy consumption information be converted into frequency information to facilitate the implementation of data encryption analysis, but the amount of frequency data can also be expanded by refining the frequency granularity, and these data can be calculated using power consumption analysis methods to obtain more accurate data encryption analysis results, thereby achieving effective utilization of frequency information in the data encryption process.

[0091] Among them, the functions of each module can be found in the data encryption analysis method embodiment, and will not be repeated here.

[0092] See also Figure 6 , Figure 6 6 is a schematic diagram of the structure of an embodiment of an electronic device of the present application. The electronic device 600 includes a memory 601 and a processor 602, and the processor 602 is used to execute program instructions stored in the memory 601 to implement the steps in any of the above data encryption analysis method embodiments. In a specific implementation scenario, the electronic device 600 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 600 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.

[0093] Specifically, the processor 602 is used to control itself and the memory 601 to implement the steps in any of the above data encryption analysis method embodiments. The processor 602 can also be called a central processing unit (CPU). The processor 602 may be an integrated circuit chip with signal processing capabilities. The processor 602 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 602 can be implemented by an integrated circuit chip.

[0094] See also Figure 7 , Figure 7 The computer-readable storage medium 700 stores program instructions 710 that can be executed by a processor, and the program instructions 710 are used to implement the steps in any of the above data encryption analysis method embodiments.

[0095] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0096] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0097] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0098] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.

Claims

1. A data encryption analysis method, It is characterized in that The method comprises: Sending a plaintext to be encrypted to a data encryption end, detecting frequency information and Hamming information in a process in which the data encryption end encrypts the plaintext to be encrypted, and obtaining a plaintext-ciphertext pair based on the plaintext to be encrypted and a ciphertext obtained by encrypting the plaintext to be encrypted; Obtaining an initial frequency granularity corresponding to the data encryption end based on the frequency information; Refining the initial frequency granularity based on the Hamming information, and obtaining a frequency value set corresponding to the frequency information using the refined target frequency granularity; The correlation between the plaintext-ciphertext pair and each frequency value in the frequency value set is analyzed to obtain a data encryption analysis result.

2. The method according to claim 1, It is characterized in that The detecting the frequency information and the Hamming information in the process of encrypting the plaintext to be encrypted by the data encryption end includes: Determine the number of Hamming values ​​corresponding to the preset calculation unit in the encryption process; The number of Hamming value values ​​is used as the Hamming information in the encryption process of the plaintext to be encrypted.

3. The method according to claim 2, It is characterized in that The preset calculation unit is an encrypted intermediate value in the encryption process; The determining the number of Hamming value values ​​corresponding to the preset calculation unit in the encryption process includes: Determine the byte size of the encrypted intermediate value; Based on the byte size of the encrypted intermediate value, the number of Hamming value values ​​corresponding to the encrypted intermediate value during the encryption process is obtained.

4. The method according to claim 3, It is characterized in that The obtaining, based on the byte size of the encrypted intermediate value, the number of Hamming value values ​​corresponding to the encrypted intermediate value in the encryption process includes: Based on the byte size of the encrypted intermediate value, a Hamming weight value set and a Hamming distance value set are obtained; Obtaining the Hamming weight weight corresponding to the Hamming weight value set and the Hamming distance weight corresponding to the Hamming distance value set; Based on the Hamming weight and the Hamming distance weight, respectively, weighted calculation is performed on each Hamming weight value in the Hamming weight value set and each Hamming distance value in the Hamming distance value set; The number of weighted calculation results obtained by the weighted calculation is counted to obtain the number of Hamming value values ​​corresponding to the encrypted intermediate value in the encryption process.

5. The method according to claim 1, It is characterized in that The sending of the plaintext to be encrypted to the data encryption end and detecting the frequency information and the Hamming information in the process of encrypting the plaintext to be encrypted by the data encryption end include: Obtaining the number of encryption executions corresponding to the plaintext to be encrypted, and sending the plaintext to be encrypted and the number of encryption executions corresponding to the plaintext to be encrypted to the data encryption end, so that the data encryption end repeatedly encrypts the plaintext to be encrypted multiple times according to the number of encryption executions; During the process of the data encryption end encrypting the plaintext to be encrypted multiple times, if it is detected that the data encryption end triggers a dynamic voltage and frequency adjustment event, the frequency information is obtained based on the dynamic voltage and frequency adjustment event.

6. The method according to claim 1, It is characterized in that There are multiple plaintexts to be encrypted, and multiple plaintext-ciphertext pairs; the analysis of the correlation between the plaintext-ciphertext pairs and each frequency value in the frequency value set to obtain a data encryption analysis result includes: Obtain the encrypted intermediate value corresponding to each plaintext-ciphertext pair during the encryption process; Calculating a Hamming value for each of the encrypted intermediate values; Acquire a frequency value matching the Hamming value of each of the encrypted intermediate values ​​from the frequency value set, and obtain a frequency value associated with each of the plaintext-ciphertext pairs; Based on the frequency values ​​associated with each plaintext-ciphertext pair, a data encryption analysis result is obtained.

7. The method according to claim 6, It is characterized in that The calculating of the Hamming value of each of the encrypted intermediate values ​​comprises: Calculating the Hamming weight and the Hamming distance corresponding to each of the encrypted intermediate values, and obtaining the Hamming weight weight corresponding to the Hamming weight and the Hamming distance weight corresponding to the Hamming distance; Based on the Hamming weight and the Hamming distance weight, a weighted calculation is performed on the Hamming weight and the Hamming distance corresponding to each of the encrypted intermediate values ​​to obtain a Hamming value of each of the encrypted intermediate values.

8. A data encryption analysis device, It is characterized in that The device comprises: A detection module, configured to send a plaintext to be encrypted to a data encryption end, detect frequency information and Hamming information in a process in which the data encryption end encrypts the plaintext to be encrypted, and obtain a plaintext-ciphertext pair based on the plaintext to be encrypted and a ciphertext obtained by encrypting the plaintext to be encrypted; An initial frequency granularity acquisition module, used to obtain the initial frequency granularity corresponding to the data encryption end based on the frequency information; A granularity refinement module, configured to refine the initial frequency granularity based on the Hamming information, and obtain a frequency value set corresponding to the frequency information using the refined target frequency granularity; The analysis module is used to analyze the correlation between the plaintext and ciphertext pairs and each frequency value in the frequency value set to obtain a data encryption analysis result.

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

10. An electronic device, It is characterized in that The electronic device comprises a memory and a processor, wherein the processor is configured to execute program instructions stored in the memory to implement the method according to any one of claims 1 to 7.