A method for detecting that SHA3-256 is resistant to preimage attacks

By injecting a random 4-bit fault into the SHA3-256 algorithm and combining it with statistical methods, the intermediate state value is derived in reverse. This solves the problem of preimage attacks in the SHA3-256 algorithm against intermediate phase error statistical fault analysis, and achieves simple and efficient state recovery and improved security.

CN123184989APending Publication Date: 2026-11-27DONGHUA UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611695353.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-30
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

There is a lack of effective detection methods in the existing technology for the SHA3-256 algorithm to resist preimage attacks that are susceptible to intermediate phase error statistical fault analysis.

Method used

By randomly generating messages to be processed, injecting a random 4-bit fault before the last round of inter-column diffusion operation, and combining statistical methods and intermediate staggered paths, the intermediate state values ​​are derived in reverse, the erroneous candidate bits are screened out, and the original image of the message is restored.

Benefits of technology

It enables a simple and efficient way to restore the initial state of the SHA3-256 algorithm, reducing analysis complexity and improving algorithm security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123184989A_ABST
    Figure CN123184989A_ABST
Patent Text Reader

Abstract

The present application relates to a kind of methods for detecting SHA3-256 resist original image attack, the method is first randomly generated message to be handled and as the input of SHA3-256 algorithm, import random 4 bit fault before last round inter-column diffusion operation, obtain fault output.Combining algorithm structure and fault injection position, deduce fault propagation path, on the basis of backtracking intermediate state value affected by fault, and calculate the hamming weight of intermediate state using statistical methods, find the correct value of corresponding state bit.In this process, the implementation cost can be effectively reduced by constructing intermediate phase error path with the help of intermediate phase error method to complete the screening of error candidates.Through repeatedly importing fault and analysis process, the original image of message can be finally deduced.The method provided by the present application is easy to implement, fast and accurate, and provides an important analysis basis for the security research of SHA3-256 algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information security technology, and in particular to a method for detecting SHA3-256 and defending against preimage attacks. Background Technology

[0002] With the rapid development of digital communication and network interconnection technologies, new businesses such as online shopping, online payment, and distributed ledgers have penetrated into all aspects of daily life, making information transmission more efficient and convenient. At the same time, the difficulty of ensuring data integrity and completing identity authentication is also increasing. Against this background, how to effectively prevent messages from being maliciously tampered with and enhance the algorithm's ability to resist collision attacks has become an important issue that needs to be addressed in the field of information security. SHA3-256 originated from a global competition for a new generation of hash standards launched by the National Institute of Standards and Technology (NIST). Its prototype is Keccak, which was included in FIPS 202 and officially released in 2015 after standing out from multiple rounds of evaluation. The algorithm deliberately avoids the inherent weaknesses of MD-type structures, such as their susceptibility to length expansion attacks, and has now been widely deployed in digital signatures, certificate systems, secure communication protocols, and new blockchain platforms. SHA3-256 is built on a sponge structure with Keccak-f

[1600] permutation as its core. Its internal state width is 1600 bits, divided into two parts: a rate of 1088 bits and a capacity of 512 bits. The message is filled at multiple rates and then absorbed block by block according to the rate, followed by a squeezing stage to output a 256-bit digest. The permutation process iterates for 24 rounds, each round performing five steps in sequence: inter-column diffusion, cyclic shift, inter-word permutation, S-box replacement, and round constant addition. Among these, only S-box replacement undertakes non-linear operations, while the remaining steps, such as inter-column diffusion, cyclic shift, inter-word permutation, and round constant addition, are linear operations. The five steps work together to create a strong avalanche effect and high collision resistance. Its core operations consist of bitwise XOR, fixed-offset cyclic shift, non-linear replacement, and round constant injection, trading compact implementation overhead for sufficient safety redundancy, making it particularly suitable for scenarios with stringent long-term security requirements and limited implementation resources.

[0003] Intermediate phase error statistical fault analysis is a branch of fault analysis techniques. Its basic principle is that attackers actively introduce perturbations during the algorithm's operation, intercepting output results that deviate from correct values ​​due to fault propagation, and then using statistical characteristics to analyze the algorithm. Another key aspect of this method is the intermediate phase error strategy, which simultaneously advances the analysis along both forward and backward propagation paths. Candidates conflicting with impossible distributions are eliminated in advance, significantly reducing the analysis complexity. Currently, there is no research, either domestically or internationally, on how to defend the SHA3-256 algorithm against intermediate phase error statistical fault analysis. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a method for detecting SHA3-256 against preimage attacks, which can evaluate the ability of the SHA3-256 algorithm to resist preimage attacks based on intermediate phase error statistical fault analysis.

[0005] The technical solution adopted by this invention to solve its technical problem is: to provide a method for detecting SHA3-256 and resisting preimage attacks, comprising the following steps:

[0006] Step S1: Randomly generate messages to be processed;

[0007] Step S2: The message is processed using the SHA3-256 algorithm, and a random 4-bit fault (excluding the all-1 state) is injected before the last round of inter-column diffusion operation during the algorithm's operation to obtain a fault output.

[0008] Step S3: Based on the location of the fault injection, the intermediate state value of the injected fault location is obtained by reverse derivation through enumerating the candidate bits after the constant addition operation of the last round.

[0009] Step S4: Construct intermediate misaligned paths with a probability of 0 based on the impossible value of intermediate state values, and exclude erroneous candidate bits according to the intermediate misaligned paths;

[0010] Step S5: For the intermediate state values ​​corresponding to the retained candidate bits, use statistical methods to calculate the Hamming weight of the intermediate state values ​​and find the candidate bits corresponding to the minimum Hamming weight.

[0011] Step S6: Repeat steps S2 to S5, and make the position of the random 4-bit fault different each time, and restore all bits after the last round constant addition operation;

[0012] Step S7: Based on all bits after the last round constant addition operation, perform the reverse calculation of the SHA3-256 algorithm to obtain the original image of the message.

[0013] Between steps S2 and S3, the following is also included:

[0014] Determine if the number of fault outputs has reached the preset number;

[0015] If the number of fault outputs does not reach the preset number, return to step S2;

[0016] If the number of fault outputs reaches the preset number, proceed to step S3.

[0017] The intermediate state value of the injected fault location in step S3 is calculated as follows: ,in, To inject intermediate state values ​​at the fault location, This is the intermediate state value after adding the constant of the last round. This is the inverse operation of inter-column diffusion. This is the inverse operation of a circular shift. This is the inverse operation of inter-word substitution. Replace the inverse operation for the S-box. Add the inverse operation to the round constant.

[0018] The intermediate state value cannot be all 1s.

[0019] In step S2, a random 4-bit fault is introduced by means of software simulation or by means of laser, electromagnetic and voltage interference.

[0020] Beneficial effects:

[0021] By employing the above-mentioned technical solution, this invention has the following advantages and positive effects compared with existing technologies: First, this invention randomly generates a message to be processed, which is used as input to the SHA3-256 algorithm. Then, during the computation process, a random half-byte fault model is adopted, and a random 4-bit fault is injected. The fault location is before the last round of inter-column diffusion operation, and the fault output affected by the fault is collected. Then, for the collected fault output, the algorithm structure is used to reverse-engineer the collected fault output, and statistical methods are used for filtering, which can recover the... Specific bits. During the analysis, an intermediate phase shift method can be combined to construct an intermediate phase shift path, filtering out error candidates in advance and reducing implementation costs. Through repeated fault injection and reverse analysis, the complete fault can be recovered. State value, then Starting from the initial state, the reverse calculation of the permutation is performed sequentially to restore the initial state, and then the original image of the message is recovered from the rate part. Attached Figure Description

[0022] Figure 1 A flowchart illustrating the steps to detect whether the SHA3-256 algorithm resists preimage attacks based on intermediate phase error statistical fault analysis;

[0023] Figure 2 A fault propagation diagram after injecting a random nibble fault during the execution of the SHA3-256 algorithm;

[0024] Figure 3 A detailed structural diagram of the SHA3-256 algorithm;

[0025] Figure 4 This is a schematic diagram of the experimental environment for this scheme. Detailed Implementation

[0026] The present invention will be further illustrated below with reference to specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. Furthermore, it should be understood that after reading the teachings of this invention, those skilled in the art can make various alterations or modifications to the invention, and these equivalent forms also fall within the scope defined by the appended claims.

[0027] Basic symbol explanation:

[0028] :information, ;

[0029] Fault output, ;

[0030] : No. The intermediate state value after the inter-row diffusion operation, where ;

[0031] : No. The intermediate state value after the round-shift operation, where ;

[0032] : No. The intermediate state value after the inter-word permutation operation, where ;

[0033] : No. The intermediate state value after the S-box replacement operation, where ;

[0034] : No. The intermediate state value after the addition of the constants in each round, where ;

[0035] : Inter-column diffusion operation, and This is the inverse operation of inter-column diffusion;

[0036] : Circular shift operation, and This is the inverse operation of a circular shift;

[0037] Inter-word substitution operation, and This is the inverse operation of word substitution;

[0038] S-box substitution operation, and Replace the inverse operation for the S-box;

[0039] : Round constant addition operation, and Add the inverse operation to the round constant;

[0040] :cascade.

[0041] Figure 1 The flowchart for testing whether the SHA3-256 algorithm resists preimage attacks based on intermediate phase error statistical fault analysis includes the following steps:

[0042] Step 1: Randomly generate messages to be processed and denot them as follows. .

[0043] Step 2: Process the message using the SHA3-256 algorithm, and during the algorithm's execution (see...). Figure 3 Inject a random 4-bit fault (excluding the all-1 state) into the process, and then collect the fault outputs affected by the fault. The fault injection point is before the last round of inter-column diffusion calculation. It checks if the number of fault outputs has reached a preset number; if not, it repeats the injection and acquisition operations until a sufficient number of fault outputs are obtained. This implementation takes 500 output values ​​as an example. If a fault output occurs... Once you reach 500, proceed to the next step.

[0044] This step can be selected as follows: Figure 4 The experimental setup shown utilizes a computer to generate the input messages for the SHA3-256 algorithm. The input message is processed by the SHA3-256 algorithm, and the output is analyzed. The device encapsulating the SHA3-256 algorithm is used to process the input message and obtain the corresponding output. The fault-injecting device is used to inject faults during the SHA3-256 algorithm's operation, thus obtaining erroneous output. The cryptanalysis device performs subsequent steps to reconstruct the input message. The faulty device can be simulated using software or by manipulating the real hardware using techniques such as voltage interference. This interference will cause the SHA3-256 algorithm to malfunction during operation, resulting in a faulty output.

[0045] Step 3: Derive the fault propagation path and establish a model. The algorithm treats the entire state as a three-dimensional bit array A[5][5]

[64] , with a total of 1600 bits: 25 64-bit words are arranged on a 5×5 grid, each called a lane. A round of permutation is executed by five sub-steps in a fixed order, namely: inter-column diffusion, calculating the bit parity of the 5 lanes in the column one by one, and then XORing the parity of the left and right adjacent columns into each bit of all lanes in the column; cyclic shift, the 64 bits in each lane are cyclically shifted according to a fixed offset determined by the coordinates to realize inter-bit diffusion within the lane; inter-word permutation, rearranging in units of lane; S-box replacement: replacing the same bit position in the horizontal 5 lanes using an S-box; round constant addition, XORing the 64-bit round constant of this round bit by bit to a fixed position.

[0046] Therefore, after a 4-bit fault injection, such as Figure 2 As shown, the algorithm first performs inter-column diffusion to spread to adjacent columns; then it performs cyclic shifting to spread within each lane; next, it performs word permutation to swap the lane positions; finally, it performs S-box replacement to spread across the horizontal lanes. Taking the last round as an example, the calculation process for a single round is as follows: The initial 4-bit fault, after propagation, will affect a total of 86 bits of the output.

[0047] Step 4: Reason the reverse formula and calculate the intermediate state value. The attacker's known information includes: the output affected by the fault and the round constant. Since the SHA3-256 algorithm only squeezes out the first 4 lanes (256 bits) during the squeezing process, the other 70 required state bits can be enumerated to perform reverse calculations and deduce the intermediate state value injected at the fault location. This is done by enumerating the candidate bits after the last round constant addition operation (i.e., the intermediate state value after the 23rd round constant addition operation). The formula for deduce the intermediate state injected at the fault location from the output is:

[0048] .

[0049] Step 5: Construct intermediate fault paths. This implementation uses a random nibble fault model and injects faults via bitwise AND operations, ensuring that the number of 1s in the intermediate state bits is far less than the number of 0s. Therefore, the intermediate state value affected by the fault is almost impossible to be... Therefore, in the backward reasoning process, once a candidate combination makes the intermediate state value equal to... This means that the error occurs when the experimental constraints conflict, resulting in a phase error. This characteristic can be used to construct intermediate phase error paths and eliminate erroneous candidate values ​​in advance, thereby reducing implementation complexity.

[0050] Step 6: For the candidate values ​​selected through the above steps, calculate the Hamming weight of the corresponding intermediate state value using statistical methods. The Hamming weight refers to the number of "1"s in the binary representation of the intermediate state. For example, if the intermediate state value is 13, its binary representation is 1101, so the Hamming weight is 3.

[0051] Step 7: Find the value corresponding to the minimum Hamming weight Enumerated values. Because faults are injected via bitwise AND operations, the distribution of intermediate state values ​​affected by the faults is significantly uneven, with the number of "1"s being far less than the number of "0"s. Therefore, among the candidate enumerated values ​​that satisfy the constraints, the enumerated value corresponding to the minimum Hamming weight is the correct candidate.

[0052] Step 8: Repeat steps 2 to 7, ensuring that the location of the randomly generated 4-bit fault is different each time. After the above processing, recovery can be gradually achieved. All bits.

[0053] Step 9: After recovery After that, with Starting from the initial state, perform 24 rounds of reverse calculations for permutations to restore the initial state, and then recover the original image of the message from the rate component.

[0054] To verify the effectiveness of the above method, experiments were conducted on a computer equipped with an AMD Ryzen 7 9700X processor and 32 GB of memory. A simulation program developed based on VS Code was used to simulate the fault injection and SHA3-256 algorithm processing, which was repeated 2000 times. The experimental results show that the above detection method is accurate. The method provided by this invention is simple to implement, computationally efficient, and yields reliable results, providing important reference value for the security research of the SHA3-256 algorithm.

Claims

1. A method for detecting SHA3-256 defense against preimage attacks, characterized in that, Includes the following steps: Step S1: Randomly generate messages to be processed; Step S2: The message is processed using the SHA3-256 algorithm, and a random 4-bit fault (excluding the all-1 state) is injected before the last round of inter-column diffusion operation during the algorithm's operation to obtain a fault output. Step S3: Based on the location of the fault injection, the intermediate state value of the injected fault location is obtained by reverse derivation through enumerating the candidate bits after the constant addition operation of the last round. Step S4: Construct intermediate misaligned paths with a probability of 0 based on the impossible value of intermediate state values, and exclude erroneous candidate bits according to the intermediate misaligned paths; Step S5: For the intermediate state values ​​corresponding to the retained candidate bits, use statistical methods to calculate the Hamming weight of the intermediate state values ​​and find the candidate bits corresponding to the minimum Hamming weight. Step S6: Repeat steps S2 to S5, and make the position of the random 4-bit fault different each time, and restore all bits after the last round constant addition operation; Step S7: Based on all bits after the last round constant addition operation, perform the reverse calculation of the SHA3-256 algorithm to obtain the original image of the message.

2. The method for detecting SHA3-256 against preimage attacks according to claim 1, characterized in that, Between steps S2 and S3, the following is also included: Determine if the number of fault outputs has reached the preset number; If the number of fault outputs does not reach the preset number, return to step S2; If the number of fault outputs reaches the preset number, proceed to step S3.

3. The method for detecting SHA3-256 defense against preimage attacks according to claim 1, characterized in that, The intermediate state value of the injected fault location in step S3 is calculated as follows: ,in, To inject intermediate state values ​​at the fault location, This is the intermediate state value after adding the constant of the last round. This is the inverse operation of inter-column diffusion. This is the inverse operation of a circular shift. This is the inverse operation of inter-word substitution. Replace the inverse operation for the S-box. Add the inverse operation to the round constant.

4. The method for detecting SHA3-256 defense against preimage attacks according to claim 1, characterized in that, The intermediate state value cannot be all 1s.

5. The method for detecting SHA3-256 defense against preimage attacks according to claim 1, characterized in that, In step S2, a random 4-bit fault is introduced by means of software simulation or by means of laser, electromagnetic and voltage interference.