Abstract
The HMAC algorithm is widely used to provide authentication and message integrity in digital communications. However, if the HMAC cryptographic algorithm is implemented in a cryptographic circuit, it is vulnerable to side-channel attacks. In this paper, we research the SM3 cryptographic hash algorithm and propose a Differential Power Analysis (DPA) attack strategy for the software-based implementation of HMAC-SM3. In the experiment, we launch a successful DPA attack on a practical cryptographic circuit and discuss the security implications for software-based HMAC-SM3 implementations.
Introduction
While cryptographic algorithms like HMAC (Hash-based Message Authentication Code) are mathematically robust, their physical implementations often "leak" information. As a device processes sensitive data, its power consumption fluctuates in ways that correlate with the secret keys being used. This phenomenon, known as a Side-Channel Attack (SCA), allows attackers to bypass mathematical complexity by observing physical side effects.
This research focuses on SM3, a 256-bit cryptographic hash function released by the Chinese State Encryption Administration. While previous studies have targeted HMAC-SHA2, this paper addresses the gap in side-channel vulnerability research for HMAC-SM3, particularly in software-based implementations on cryptographic circuits.
The HMAC-SM3 Attack Surface
The HMAC-SM3 algorithm involves an inner and outer hash process, as illustrated in Figure 1. The researchers identified that the first round of the SM3 compression function is the most vulnerable point for side-channel leakage.
The attack targets the initial values ($V_0$) of the internal registers ($A, B, C, \dots, H$), which are directly derived from the XOR of the secret key and a fixed "ipad" (inner padding) value. By focusing on the first round, the attacker can analyze the key before it is extensively mixed by the subsequent 63 rounds of the compression function.
Methodology: Differential Power Analysis
The researchers employed a Differential Power Analysis (DPA) strategy using the Hamming Weight (HW) model. This model assumes that power consumption is proportional to the number of "1" bits processed by the circuit at any given time.
To manage the computational complexity of attacking a 32-bit register ($2^{32}$ possibilities), the authors used a "divide and conquer" approach, attacking 8 bits at a time ($2^8$ or 256 guesses). They targeted a specific intermediate variable, $\theta_0$, which is a sum of several internal functions. By recovering $\theta_0$, they could mathematically reverse the process to find the original register values and, ultimately, the secret key.
The attack process involved capturing power traces from a physical hardware platform while it processed random messages. The researchers used autocorrelation on these traces to precisely identify the timing of the iterative compression rounds, allowing them to trigger their analysis at the exact moment the key-dependent operations occurred.
Experimental Results
The DPA attack successfully recovered the secret key information from the HMAC-SM3 implementation. The statistical significance of the attack is demonstrated by the correlation results for the target subkey.
As shown in the results table, the correct subkey (0x10) yielded a correlation of 0.1240, which is significantly higher than the next highest "ghost" peak (0.0916). This clear statistical distinction confirms the effectiveness of the DPA strategy and the vulnerability of the 32-bit word structure in the SM3 algorithm when implemented without specific side-channel countermeasures.
Conclusion
This study proves that even standardized, mathematically secure algorithms like SM3 are susceptible to side-channel attacks in practical implementations. The success of the DPA attack on HMAC-SM3 highlights the critical need for active defenses, such as masking (adding random noise) or hiding (shuffling operation timing), in embedded hardware environments to ensure true cryptographic security.
Summary updated