Abstract
We present HMM attacks, a new type of cryptanalysis based on modeling randomized side channel countermeasures as Hidden Markov Models (HMM’s). We also introduce Input Driven Hidden Markov Models (IDHMM’s), a generalization of HMM’s that provides a powerful and unified cryptanalytic framework for analyzing countermeasures whose operational behavior can be modeled by a probabilistic finite state machine. IDHMM’s generalize previous cryptanalyses of randomized side channel countermeasures, and they also often yield better results. We present efficient algorithms for key recovery using IDHMM’s. Our methods can take advantage of multiple traces of the side channel and are inherently robust to noisy measurements. Lastly, we apply IDHMM’s to analyze two randomized exponentiation algorithms proposed by Oswald and Aigner. We completely recover the secret key using as few as ten traces of the side channel.
Introduction
Side-channel attacks exploit physical leakages—such as power consumption or electromagnetic radiation—to extract secret keys from cryptographic hardware. To mitigate these threats, engineers implement randomized countermeasures. These techniques introduce non-deterministic behavior, such as dummy operations or randomized instruction ordering, to "blur" the observable signal and complicate the attacker's task.
Historically, analyzing these randomized schemes has been an ad-hoc process, often resulting in specialized attacks that fail under noisy conditions. This paper addresses the need for a formal, unified framework to evaluate the security provided by randomization and to perform robust cryptanalysis even in the presence of significant measurement noise.
Methodology: Input Driven Hidden Markov Models
The authors propose a transition from manual case studies to a formal probabilistic framework based on Input Driven Hidden Markov Models (IDHMMs).
Probabilistic Finite State Machines (PFSMs)
The first step in the framework is modeling randomized countermeasures as PFSMs. In these machines, transitions between states are determined by both a secret input (the key bit $k_i$) and a random variable (e.g., a coin flip). This captures the probabilistic nature of the countermeasure's execution flow.
The IDHMM Framework
While standard HMMs are effective for inferring hidden states from observable outputs, they do not traditionally account for external inputs. The authors extend the HMM into an IDHMM, where the secret key acts as the "input" driving the state transitions. This allows the model to explicitly link the secret key to the sequence of observable side-channel emissions.
Belief Propagation across Multiple Traces
To handle noise and aggregate information, the authors utilize an approximate inference algorithm based on belief propagation. This approach processes multiple side-channel traces sequentially. The posterior probability of the key bits derived from one trace serves as the prior for the next, allowing the model to converge on the correct key even when individual measurements are highly unreliable.
Experimental Evaluation
The attack was evaluated using simulated traces of two randomized exponentiation algorithms, OA1 and OA2, proposed by Oswald and Aigner. The experiments utilized 192-bit secret keys and tested various observation error rates ($p_e$) ranging from 0% to 40%.
Key Results
The IDHMM attack demonstrated significant improvements over prior art in terms of efficiency and noise tolerance.
As shown in the table above, the HMM attack is remarkably efficient:
- Efficiency: Under perfect conditions ($p_e = 0$), the full 192-bit key was recovered using only 10 traces, compared to 292 traces required by the Okeya-Sakurai attack.
- Noise Tolerance: The framework remains effective even with high noise levels. At a 25% error rate ($p_e = 0.25$), the key could be recovered with 50–500 traces.
- Computational Workfactor: By combining the probabilistic attack with a limited brute-force search of the most likely candidates, the 192-bit key recovery was achieved with a workfactor of $2^{38}$ operations, which is computationally feasible on standard hardware.
Conclusion
The IDHMM framework demonstrates that randomization does not eliminate information but rather redistributes it. By modeling the secret key as the driver of a probabilistic system, attackers can systematically "collect" this information across multiple executions. While the effectiveness of the attack depends on the accuracy of the device model and knowledge of error rates, it represents a significant advancement in the systematic cryptanalysis of randomized side-channel countermeasures.
Summary updated