0Pricing
Cryptology Academy · Lesson

Power Analysis: SPA & DPA

Capture power traces and perform simple and differential power analysis.

Power Analysis: SPA & DPA is a free Cryptology Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cryptology Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

What Is Power Analysis?

Power analysis measures the instantaneous electrical power consumed by a device during cryptographic operations. Power draw depends on the data being processed, leaking secret key bits.

Simple Power Analysis (SPA)

In SPA, a single power trace is visually inspected. Square-and-multiply exponentiation leaks the exponent: a multiply step has a different power profile than a square step alone.

Differential Power Analysis (DPA)

DPA uses statistical analysis across many traces. The attacker fixes a single key-bit hypothesis, partitions traces by the predicted intermediate value, and looks for a correlation spike.

The Hamming Weight Model

A key assumption: power consumption is proportional to the number of 1-bits (Hamming weight) of the value being processed. This holds well for CMOS logic at low frequencies.

Correlation Power Analysis (CPA)

CPA uses Pearson correlation between the predicted Hamming weight of an intermediate value and measured power at each time sample. The correct key hypothesis gives the highest correlation.

Capturing Power Traces in Practice

Researchers use a current-sense resistor in series with the target device and an oscilloscope or ChipWhisperer board to digitize the trace at 100 MS/s or higher.

DPA on AES: Key Recovery

Target the first AES round: for each of 256 key-byte candidates, predict SubBytes output Hamming weight, correlate with traces. The correct byte pops out with correlation ~0.9+.

High-Order DPA

Masked implementations split each intermediate into random shares. Second-order DPA combines two time points (share and mask) using a product or absolute-difference combination function.

DPA on RSA Square-and-Multiply

RSA private-key exponent bits are recovered by distinguishing square-only from square-then-multiply power patterns across many traces using a chosen-message attack.

Tools and Platforms

The open-source ChipWhisperer platform provides hardware + Python software for capture, trace alignment, and CPA. It supports AES, RSA, and ECC targets out of the box.

Knowledge Check

In Correlation Power Analysis, what distinguishes the correct key hypothesis from wrong ones?

Lesson Recap

SPA reads a single trace visually; DPA uses statistics across many traces. CPA uses Pearson correlation with a Hamming-weight model. Countermeasures include masking and randomized projective coordinates for ECC.

Frequently asked questions

Is the “Power Analysis: SPA & DPA” lesson free?

Yes — the full text of “Power Analysis: SPA & DPA” is free to read here on the web, and the Cryptology Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cryptology Academy course, upgrade to CoddyKit PRO.

What will I learn in “Power Analysis: SPA & DPA”?

Capture power traces and perform simple and differential power analysis. You practise Cryptology Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Cryptology Academy?

No prior experience is required. Cryptology Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Power Analysis: SPA & DPA” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Cryptology Academy lesson?

Yes. Every Cryptology Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Timing Attacks: Extracting Keys from Execution Time
  2. Power Analysis: SPA & DPA
  3. Electromagnetic & Acoustic Side Channels
  4. Countermeasures: Masking, Blinding & Constant-Time Code
← Back to Cryptology Academy