← Back to Blog

Power Analysis Attacks: SPA, DPA, CPA Explained

Power Analysis Attacks: SPA, DPA, CPA Explained - QNSQY post-quantum encryption guide

In June 1999, Paul Kocher, Joshua Jaffe, and Benjamin Jun published a paper at CRYPTO that quietly demolished an entire generation of secure hardware. The paper, "Differential Power Analysis," showed that the secret keys inside smart cards, secure elements, and embedded cryptographic processors could be extracted by measuring the power consumed during cryptographic operations. The technique required only an oscilloscope, a small resistor in series with the device's power line, and statistical analysis. No device modification was needed. No invasive probing. The smart card industry, which had built its security model around tamper-resistant hardware, found itself with a problem that affected nearly every deployed device.

Twenty-six years later, power analysis remains the dominant practical side-channel attack against hardware cryptographic implementations. The techniques have been refined, the equipment has become cheaper, and the targets have expanded from smart cards to FPGAs, microcontrollers, IoT devices, and now to post-quantum implementations. Smart cards now incorporate countermeasures by default, but billions of embedded devices in the wider ecosystem do not.

This article explains how power analysis works, walks through Simple Power Analysis (SPA), Differential Power Analysis (DPA), and Correlation Power Analysis (CPA), surveys the application to post-quantum schemes, and describes the countermeasures that have evolved over a quarter-century.

Why Power Reveals Secrets

CMOS integrated circuits consume power approximately in proportion to switching activity. When a transistor switches state, current flows briefly to charge the capacitive load. The total power draw of the chip at any moment is the sum of switching currents across all active circuits.

For a cryptographic operation, the switching activity depends on the data being processed. If the algorithm computes (key XOR data), the resulting bits affect how many transistors switch. The Hamming weight of the result, or the Hamming distance between successive states, is correlated with power consumption.

This correlation is small. A single transistor switch is invisible against the noise floor of a complex SoC. But aggregated across thousands of operations and many traces, the signal becomes recoverable.

The measurement setup is straightforward: a small shunt resistor (typically 1-10 ohms) in series with the device's power line, an oscilloscope to measure voltage drop across the resistor (which is proportional to current), and a trigger signal aligned with the cryptographic operation. Modern setups can measure tens of millions of samples per second.

Simple Power Analysis (SPA)

SPA is the simplest form of attack: the attacker visually inspects a power trace and extracts the key from features visible to the eye.

Classical SPA targeted square-and-multiply RSA implementations. The exponentiation algorithm processes the exponent bit by bit. For each bit, the algorithm performs a square; if the bit is 1, it also performs a multiply. The square and multiply have visibly different power profiles. The attacker reads the bit pattern of the exponent (which is the private key) directly from the trace.

A typical SPA trace of an unprotected square-and-multiply RSA implementation shows a clear pattern of "S, S, S-M, S, S-M, S, S, S, S-M, ..." revealing the exponent bits.

For symmetric algorithms, SPA can identify operation boundaries (round structure of AES, for instance) but typically does not extract keys directly. SPA is most effective against asymmetric algorithms with large operand sizes and obvious structural patterns.

For post-quantum algorithms, SPA is most relevant for:

  • identifying the structure of cryptographic operations (number of rounds, position of NTT, position of polynomial multiplication);
  • detecting iteration counts in rejection sampling (ML-DSA), which leak about the secret;
  • visible distinctions between code paths in fault-handling routines.

A well-designed PQ implementation eliminates SPA leakage by making operation boundaries fixed, eliminating data-dependent control flow, and avoiding visible structural differences.

Differential Power Analysis (DPA)

DPA, the original Kocher-Jaffe-Jun technique, is more powerful than SPA. It works on signals far below the visible threshold by aggregating across many traces and using statistical separation.

The attack proceeds as follows:

The attacker captures power traces while the target device performs the cryptographic operation many times with the attacker's chosen inputs.

The attacker selects an "intermediate value" that depends on a small fragment of the key (typically one byte). For AES, this is often the output of the first S-box, which depends on one byte of the key XOR'd with one byte of plaintext.

The attacker hypothesises a value for the key fragment (256 candidates for one byte). For each candidate, the attacker computes the predicted intermediate value for each input.

The attacker partitions the traces into two groups: those where the predicted intermediate's relevant bit is 0, and those where it is 1.

For each candidate key fragment, the attacker computes the difference of mean traces between the two groups. The correct candidate produces a clear "DPA peak" at the moment the intermediate value is processed; incorrect candidates produce flat differences.

The attacker repeats across all key fragments to recover the full key.

DPA against AES has been demonstrated with as few as 100-1000 traces against unprotected implementations. The attack equipment, including modern off-the-shelf oscilloscopes and a few hundred dollars of accessories, costs in the low thousands.

For post-quantum schemes, DPA targets:

Polynomial multiplication. Each output coefficient is a sum of products of secret and public coefficients. Modelling the Hamming weight of secret coefficients allows DPA recovery.

NTT operations. Butterflies in the NTT process pairs of coefficients. The intermediate values leak.

Comparison checks. The Fujisaki-Okamoto transform's re-encryption comparison processes secret-derived values; DPA against the comparison can recover the encapsulated key.

Several published DPA attacks on Kyber (the predecessor to ML-KEM) have demonstrated practical key recovery on Cortex-M4 microcontrollers with traces in the thousands.

Correlation Power Analysis (CPA)

CPA, introduced by Brier, Clavier, and Olivier in 2004, refines DPA by using Pearson correlation between predicted intermediate values and measured power. Where DPA partitions on a single bit, CPA uses the full Hamming weight of the predicted intermediate.

The attack:

For each candidate key fragment, predict the Hamming weight of the intermediate value for each trace.

Compute the Pearson correlation between predicted Hamming weight and measured power at each time point in the trace.

The correct candidate produces a high correlation peak at the time the intermediate is processed; incorrect candidates produce low correlation.

CPA typically requires fewer traces than DPA for the same level of confidence, often by an order of magnitude. CPA also works in the presence of more noise.

For post-quantum schemes, CPA is the standard analytical tool. Most published power analysis attacks against ML-KEM and ML-DSA implementations use CPA, often with refinements:

Template attacks. The attacker first profiles the device with a known key, building templates of power signatures for each possible value of the intermediate. In the attack phase, traces are matched against templates.

Stochastic models. The attacker builds a more sophisticated model of power consumption that accounts for circuit-specific behaviour.

Multivariate analysis. The attacker uses principal component analysis (PCA) or linear discriminant analysis (LDA) to combine information from multiple time points.

Hardware-Targeted vs Software-Targeted Attacks

Power analysis was originally a hardware attack against dedicated cryptographic processors. Smart cards and ASICs have power signatures that closely match the predictions of CMOS switching models, making attacks straightforward.

Software implementations on general-purpose CPUs are noisier. A modern CPU is doing many things simultaneously: cache management, branch prediction, speculative execution, interrupt handling. The cryptographic operation is one signal in a noisy environment.

But software is not immune. Mangard, Oswald, and Popp's textbook "Power Analysis Attacks: Revealing the Secrets of Smart Cards" (Springer, 2007) documented techniques for extracting keys from software implementations on microcontrollers. The published PQ attacks against Cortex-M4 use software implementations and recover keys from a few thousand traces.

For attacks against general-purpose server CPUs, EM analysis (electromagnetic emissions, see below) is often more practical than direct power analysis because of the noise from PSU regulation and complex SoC behaviour.

Electromagnetic Analysis (EMA)

EMA is the cousin of power analysis. Switching transistors emit electromagnetic radiation that can be picked up by near-field probes. The signal is similar in content to power analysis but is recovered without direct contact.

EMA has the practical advantage of being non-contact and being able to localise to specific regions of the chip. An attacker with a good probe can isolate the signature of a specific functional unit (the AES core, the NTT engine) and extract more information than from the chip's pooled power signal.

Differential and correlation EM analysis (DEMA, CEMA) follow the same statistical methodology as DPA and CPA.

Countermeasures

The countermeasure landscape has evolved over 25 years. The main techniques:

Masking. Secret values are split into shares: secret = share_1 XOR share_2 XOR ... Operations are performed on shares. The leakage of any single share reveals nothing about the secret. Higher-order masking protects against attacks combining information from multiple shares.

For lattice cryptography, masking is more complex than for AES because the operations include multiplication, not just XOR. Boolean masking and arithmetic masking must be combined, with secure conversions between them. The Coron-Greuet "GLITCH" papers and the Bronchain-Cassiers TCHES papers detail practical masking schemes for Kyber and Dilithium.

Hiding. The implementation reduces the signal-to-noise ratio of the leakage. Techniques include:

  • noise generators on the power line;
  • random delays inserted between operations;
  • dummy operations that mimic the cryptographic operation;
  • balanced logic styles (dual-rail, where every bit is represented by two complementary signals so that the Hamming weight is constant).

Constant power circuits. Asynchronous circuits and balanced logic styles aim to make power consumption independent of data. These are expensive in area and power but provide strong protection.

Threshold implementations. A specific class of masking schemes that provide provable security against first-order attacks.

Glitch resistance. CMOS circuits exhibit glitches (transient transitions before settling) that can leak. Glitch-resistant logic styles (TI, IP-secure logic) eliminate this.

Higher-order security and attacks. The number of shares determines the order of attack required. Order-d masking requires the attacker to combine d+1 measurements. As order increases, attack complexity increases as the (d+1)-th moment of the noise distribution.

Tools for Power Analysis

The open-source toolkit for power analysis includes:

ChipWhisperer (NewAE Technology). An open-source platform for side-channel analysis that combines hardware (target boards, capture modules) with Python software for analysis. Widely used in research and teaching.

Riscure Inspector. A commercial tool used by security labs.

Brainwaves. A commercial visualisation and analysis platform.

Custom Python pipelines based on numpy, scipy, and matplotlib.

Recent additions for PQ-specific analysis include scripts that target the NTT, polynomial multiplication, and rejection sampling steps.

What This Means for Deployment

For organisations deploying PQ cryptography, the power analysis question depends on the threat model.

Cloud workloads on shared infrastructure. Power analysis is typically not the dominant threat. Cache-timing and microarchitectural attacks are more relevant. Software constant-time implementations and masking countermeasures provide good protection.

HSMs and smart cards. Power analysis is a primary threat. Devices should be evaluated against FIPS 140-3 Level 3 or 4, or Common Criteria EAL 4+ with augmented assurance. Masking and physical countermeasures are required.

IoT and embedded devices. Power analysis is feasible for an attacker with physical access. Software masking is the practical defence; hardware countermeasures depend on the SoC.

Mobile devices. Smartphones face a moderate threat. Secure enclaves (TPMs, secure elements) provide protection for keys; commodity application processors are more exposed.

For more on side-channel attacks specifically against PQ schemes, see Side-Channel Attacks on PQC. For timing-specific attacks, see Timing Attacks on Lattice.

FAQ

How many traces does DPA need? Against an unprotected AES implementation, 100-1000 traces typically suffice. Against PQ implementations, similar ranges apply. With first-order masking, the attack moves to second-order DPA, requiring on the order of 10,000-100,000 traces. With higher-order masking, the trace counts grow exponentially.

Is DPA a threat over the network? Direct DPA is not. The attacker needs power measurements. But cache-timing attacks, which work over the network in some configurations, share statistical methodology with DPA.

Are masked implementations standardised? There is no formal standard. Several research lines (Coron-Prouff, Belaid-Coron-Prouff-Roche-Rondepierre, Bronchain-Cassiers) have produced reference implementations and proofs. The NIST PQC team has not mandated masking but expects implementations destined for high-assurance deployment to include it.

Does FIPS 140-3 require side-channel resistance? FIPS 140-3 Level 3 and Level 4 include physical security requirements that subsume some side-channel resistance, particularly for tamper response. Level 4 has EFP/EFT requirements (environmental failure protection/testing) that address some side channels. Specific quantitative side-channel testing is not part of the FIPS 140-3 framework as of 2026.

Can I run my own power analysis? Yes. ChipWhisperer is the standard entry point. The hardware (a Lite or Lite Plus board) costs a few hundred dollars and the software is open source. Realistic results require some learning, but the tooling is accessible.

Sources

  • Kocher, Jaffe, Jun, "Differential Power Analysis," CRYPTO 1999, https://www.paulkocher.com/doc/DifferentialPowerAnalysis.pdf
  • Brier, Clavier, Olivier, "Correlation Power Analysis with a Leakage Model," CHES 2004, https://link.springer.com/chapter/10.1007/978-3-540-28632-5_2
  • Mangard, Oswald, Popp, "Power Analysis Attacks: Revealing the Secrets of Smart Cards," Springer 2007, https://link.springer.com/book/10.1007/978-0-387-38162-6
  • Bronchain, Cassiers, "Bitslicing Arithmetic/Boolean Masking Conversions for Fun and Profit," TCHES 2022, https://eprint.iacr.org/2022/1230
  • Coron, Greuet, "Provably Secure Masked Implementation of Dilithium," IACR ePrint 2023/385, https://eprint.iacr.org/2023/385
  • ChipWhisperer documentation, NewAE Technology, https://chipwhisperer.readthedocs.io/

Related Articles

Protect Your Data Before Q-Day Arrives

QNSQY's NIST-standardized post-quantum encryption protects files against both current and quantum-era threats.

Try QNSQY