Skip to main content
v2026.11,986 entries · CC-BY 4.0

ChipWhisperer: Power Analysis Research Guide

ChipWhisperer guide for side-channel analysis and fault injection in hardware security research: install the Python toolchain, run CPA, and fix errors.

Written and maintained by CASRAI Editorial Board

Published · Last updated

On this page

ChipWhisperer is an open-source toolchain developed for side-channel analysis (SCA) and fault injection (FI) research on embedded hardware targets. Created by Colin O’Flynn and maintained by NewAE Technology, the platform combines hardware capture boards with an extensible Python software library. In experimental cybersecurity research, ChipWhisperer enables reproducible evaluations of cryptographic implementations, side-channel leakage, and physical fault injection vulnerabilities without requiring high-cost digital storage oscilloscopes.

This guide explains how ChipWhisperer is applied in academic and industrial security research, provides verified installation instructions from official documentation, details a step-by-step cryptographic power trace capture and Correlation Power Analysis (CPA) attack, and provides diagnostics for common target communication errors.

What it is used for in research

In hardware security research, embedded cryptographic devices emit physical side-channel leakages during computation, such as instantaneous variations in power consumption and electromagnetic radiation. ChipWhisperer is designed to measure and analyze these physical signals through a synchronous sampling architecture. Instead of oversampling an asynchronous signal at multi-gigahertz rates using expensive laboratory oscilloscopes, ChipWhisperer locks the Analog-to-Digital Converter (ADC) clock directly to the target device clock. This synchronous clocking eliminates phase jitter and temporal drift, allowing researchers to capture aligned power traces at modest sample rates (typically four times the target clock frequency).

Research applications centered on ChipWhisperer span several primary domains:

  • Differential and Correlation Power Analysis (DPA/CPA): Recovering secret cryptographic keys from microcontrollers and FPGAs executing symmetric algorithms (such as AES and DES) or asymmetric schemes (such as RSA and elliptic curve cryptography).
  • Hardware Countermeasure Evaluation: Evaluating the empirical resilience of algorithmic countermeasures, including Boolean masking, threshold implementations, and random clock jittering.
  • Fault Injection Attacks: Inducing transient execution faults via targeted voltage glitching or clock glitching to bypass authentication gates, corrupt cryptographic state, or trigger instruction skips.
  • Electromagnetic Fault Injection (EMFI): Mapping localized susceptibility to localized magnetic pulses using companion tools like ChipSHOUTER and planar magnetic probes.

Empirical findings established with the toolchain are regularly presented at premier peer-reviewed cybersecurity venues, including the IEEE Symposium on Security and Privacy, the Network and Distributed System Security (NDSS) Symposium, and the Annual Computer Security Applications Conference (ACSAC). Hardware evaluations published in journals such as the IEEE Transactions on Information Forensics and Security routinely rely on ChipWhisperer capture boards and trace datasets to validate theoretical attack vectors and hardware mitigation designs.

How to install or access it

ChipWhisperer software and target firmware build scripts are distributed through official NewAE repositories as open-source software under the GNU General Public License v3 (GPL-3.0). The recommended deployment on Linux (Ubuntu or Debian) utilizes a dedicated Python virtual environment and configured USB udev rules.

1. System prerequisites

Install the required build tools, system USB libraries, and Python development packages via the system package manager:

sudo apt update
sudo apt install -y 
    libusb-dev 
    make 
    git 
    gcc-arm-none-eabi 
    libusb-1.0-0-dev 
    usbutils 
    python3 
    python3-venv 
    python3-dev

2. Virtual environment and repository setup

Clone the core repository from GitHub, initialize the submodule for interactive tutorials, and activate a clean virtual environment:

git clone https://github.com/newaetech/chipwhisperer.git
cd chipwhisperer
git submodule update --init jupyter
python3 -m venv ~/.cwvenv
source ~/.cwvenv/bin/activate

3. USB permissions and udev configuration

Access to NewAE USB capture devices without superuser permissions requires configuring system udev rules and assigning the active user to appropriate device groups:

sudo cp 50-newae.rules /etc/udev/rules.d/50-newae.rules
sudo udevadm control --reload-rules
sudo groupadd -fr chipwhisperer
sudo usermod -aG chipwhisperer $USER
sudo usermod -aG plugdev $USER

After updating user group assignments, log out and log back in, or reboot the workstation, so that new group memberships take effect.

4. Python package installation

Install the ChipWhisperer package in editable development mode alongside tutorial dependencies inside the active virtual environment:

python -m pip install -e .
python -m pip install -r jupyter/requirements.txt

5. Verifying the installation

Confirm that the Python interpreter imports the module successfully and resolves the installed package path:

python -c "import chipwhisperer as cw; print(cw.__name__, cw.__file__)"

Step-by-step instructions

This numbered task demonstrates an end-to-end research workflow: connecting to a capture scope, programming an Arm target board with cryptographic firmware, capturing power traces, and executing Correlation Power Analysis to recover a 128-bit AES key.

Step 1: Connect to capture hardware and target board

Open a Python session (or Jupyter notebook) within the activated virtual environment, initialize the scope interface, attach the target, and load default clock and trigger configurations:

import chipwhisperer as cw

# Connect to the capture scope (e.g., ChipWhisperer-Lite or Husky)
scope = cw.scope()

# Connect to the attached target board using the scope communication bus
target = cw.target(scope)

# Apply default scope clocking, ADC sampling, and trigger settings
scope.default_setup()

Step 2: Build and program target firmware

Compile the SimpleSerial AES firmware from the repository victim firmware directory using the target platform and matching protocol version (such as SS_VER_2_1), then flash the generated binary to the microcontroller:

cd hardware/victims/firmware/simpleserial-aes
make PLATFORM=CW308_STM32F3 CRYPTO_TARGET=TINYAES128C SS_VER=SS_VER_2_1 -j

Flash the compiled Intel HEX binary using the Python programming interface:

prog = cw.programmers.STM32FProgrammer
cw.program_target(scope, prog, "simpleserial-aes-CW308_STM32F3.hex")

Step 3: Capture power traces during cryptographic operations

Initialize a ChipWhisperer project to store trace waveforms and associated metadata. Generate randomized plaintexts, arm the scope, transmit encryption commands to the target over SimpleSerial, and record power traces:

import numpy as np
from tqdm import trange

# Initialize key-text pair generator and project container
ktp = cw.ktp.Basic()
project = cw.create_project("aes_cpa_study.cwp", overwrite=True)

num_traces = 50
for i in trange(num_traces, desc="Capturing power traces"):
    key, text = ktp.next()
    
    # Arm capture scope prior to triggering target computation
    scope.arm()
    
    # Send plaintext 'p' command to SimpleSerial victim
    target.simpleserial_write('p', text)
    
    # Wait for target execution to complete and capture samples
    timeout = scope.capture()
    if timeout:
        raise RuntimeError("Scope capture timed out: target trigger not detected.")
    
    # Read back 16-byte AES ciphertext response 'r'
    response = target.simpleserial_read('r', 16)
    
    # Retrieve digitized analog power trace
    trace = scope.get_last_trace()
    project.traces.append(cw.Trace(trace, text, response, key))

# Commit captured traces to disk
project.save()

Step 4: Configure Correlation Power Analysis (CPA) leakage model

Load the analyzer module and define the hypothetical power consumption model. In standard first-round AES attacks, the leakage model predicts instantaneous power proportional to the Hamming weight of the first round S-box output:

import chipwhisperer.analyzer as cwa

# Define leakage model targeting the first round S-box output
leak_model = cwa.leakage_models.sbox_output

# Create the CPA attack instance targeting all 16 key bytes
attack = cwa.cpa(project, leak_model)

Step 5: Execute key recovery analysis

Run the progressive CPA algorithm over the captured project traces and extract the highest-ranked key hypothesis:

results = attack.run()
best_key = results.key_guess()

print("Recovered AES-128 Key:", [hex(b) for b in best_key])

Output and how to read it

Interpreting ChipWhisperer output requires evaluating both raw capture waveforms and post-processed statistical metrics:

Raw power trace arrays

Calling scope.get_last_trace() returns a one-dimensional NumPy float array representing discrete voltage measurements across time. Each point corresponds to an ADC sample synchronized to target clock transitions. In unmasked hardware implementations, repeating cryptographic rounds (e.g., the 10 rounds of AES-128) appear as periodic peaks and valleys in power consumption across the sample axis.

Pearson correlation coefficients

During Correlation Power Analysis, the analyzer evaluates Pearson correlation coefficients (denoted r) between measured power consumption and hypothetical power values predicted by the leakage model. For each of the 256 candidate byte values (0x00 through 0xFF) across all 16 key positions:

  • Incorrect subkey guesses: Maintain low correlation near zero (typically absolute correlation |r| less than 0.1) across all sample points because modeled data does not correlate with target circuit activity.
  • Correct subkey guess: Produces a prominent statistical spike (often absolute correlation |r| between 0.35 and 0.85) at the precise sample index corresponding to the S-box substitution cycle.

Partial Guessing Entropy (PGE) and Measurements to Disclosure (MTD)

The analyzer ranks subkey guesses by absolute correlation. Partial Guessing Entropy (PGE) measures the rank of the true subkey byte within candidate hypotheses; a PGE of 0 indicates that the correct byte holds the highest correlation. Measurements to Disclosure (MTD) represents the minimum number of captured traces required for all 16 subkeys to simultaneously achieve PGE = 0. In unmitigated software implementations running on 8-bit or 32-bit microcontrollers, MTD typically falls between 20 and 80 traces.

Troubleshooting

Hardware-in-the-loop experimentation frequently encounters target communication and triggering mismatches. The table below lists documented errors and their technical resolutions based on official NewAE diagnostics:

Error Message Probable Root Cause Verified Technical Resolution
Target did not ack SimpleSerial protocol version mismatch between Python host driver and compiled victim firmware. Ensure host instantiation matches the firmware protocol. If compiled with SS_VER=SS_VER_2_1, instantiate target using cw.target(scope, cw.targets.SimpleSerial2). If using legacy SS_VER_1_1, recompile with consistent flags.
Timeout in OpenADC capture(), no trigger seen! Scope armed but target GPIO trigger pin did not transition high during execution. Confirm scope trigger configuration matches target pin routing (scope.trigger.triggers = 'tio4' and scope.trigger.module = 'basic'). Verify firmware invokes trigger_high() and trigger_low() around the target cipher.
LIBUSB_ERROR_BUSY Active USB device handle held open by another process or zombie Python kernel. Explicitly disconnect devices using scope.dis() and target.dis() in cleanup blocks. Terminate competing Jupyter notebook kernels or background acquisition scripts.
Baud rate / Framing errors Target clock frequency altered without recalculating SimpleSerial UART divider. Re-run scope.default_setup() to synchronize clock dividers, or adjust target baud rate explicitly when changing clock generation frequencies from the default 7.37 MHz target clock.
LIBUSB_ERROR_ACCESS Workstation lacks permissions to access NewAE USB vendor IDs (0x2b3e). Deploy 50-newae.rules to /etc/udev/rules.d/, execute sudo udevadm control --reload-rules, and add the user account to the chipwhisperer and plugdev groups.

Free alternatives

While ChipWhisperer provides an integrated capture and analysis environment, researchers evaluate side-channel resistance using several alternative open-source software libraries and hardware evaluation tools. Incorporating sound scientific software development standards across these frameworks ensures computational reproducibility in hardware security studies:

Framework / Tool Primary Scope Language / Ecosystem Software License Key Capabilities and Distinctions
ChipWhisperer Integrated capture hardware and post-acquisition analysis Python, C, Verilog GPL-3.0 (SW) / CC-BY-SA (HW) Synchronous ADC sampling, built-in glitch generation, end-to-end Jupyter tutorials, and direct target board control.
FOBOS Hardware side-channel analysis benchmarking Python, VHDL Open Source (George Mason University) Designed for evaluation of cryptographic primitives on standard commercial FPGA boards; separates control from acquisition.
lascar High-performance trace analysis and statistical leakage Python LGPL-3.0 Developed by Ledger; optimized for out-of-core processing of massive trace sets, higher-order DPA, and Welch’s t-test evaluations (analysis only).
scared Side-channel analysis and statistical modeling Python (NumPy / Numba) LGPL-3.0 Developed by eShard; provides accelerated CPA, DPA, and mutual information analysis for pre-recorded trace arrays without hardware drivers.
Jlsca High-throughput side-channel analysis engine Julia Open Source (Riscure) Leverages Julia just-in-time compilation for rapid statistical evaluation of large trace datasets; focused on algorithmic post-processing.
sigrok / PulseView Signal capture and protocol analysis C, C++, Python GPL-3.0 Broad support for generic logic analyzers and oscilloscopes with protocol decoding; lacks specialized cryptographic power leakage models.

FAQ

What is the difference between SimpleSerial 1.1 and SimpleSerial 2.1 in ChipWhisperer?

SimpleSerial is the communication protocol used between the host computer and the victim microcontroller over UART. SimpleSerial 1.1 uses simple ASCII commands (such as p for plaintext and k for key) operating at a default baud rate of 38,400 bps. SimpleSerial 2.1 introduces structured packet framing, length headers, error-checking CRC bytes, and higher default transmission speeds (typically 230,400 bps), improving communication reliability during high-throughput trace acquisitions.

Can ChipWhisperer software be used without NewAE capture hardware?

Yes. The chipwhisperer.analyzer package functions independently of capture hardware. Researchers can import pre-recorded trace datasets acquired from third-party oscilloscopes or simulated power models into cw.Project containers to execute Correlation Power Analysis, profiling attacks, or leakage assessments.

How does synchronous sampling differ from traditional oscilloscope capture in side-channel analysis?

Traditional oscilloscopes sample asynchronously at very high frequencies (e.g., 1 to 5 GS/s) to reconstruct waveform shapes, which introduces clock phase jitter between the scope and the target microcontroller. ChipWhisperer synthesizes an internal ADC sampling clock that is phase-locked directly to the target device clock oscillator. Because every clock cycle is sampled at exact, repeatable phase intervals, synchronous sampling achieves higher signal-to-noise ratios with far fewer data points per trace.

What is Correlation Power Analysis (CPA) in ChipWhisperer?

Correlation Power Analysis is a statistical attack that correlates observed physical power consumption against a hypothetical model of internal data transitions. In AES-128, the attack models power dissipation based on the Hamming weight or Hamming distance of the first-round S-box substitution output. The subkey hypothesis yielding the highest Pearson correlation coefficient across the sample traces identifies the correct secret key byte.

How many power traces are required to recover an AES key using ChipWhisperer?

For an unmasked software implementation of AES-128 running on an 8-bit or 32-bit microcontroller without hardware side-channel countermeasures, ChipWhisperer typically recovers all 16 key bytes within 30 to 100 power traces. Implementations with hardware acceleration, power filtering, or masking countermeasures require thousands of traces or higher-order statistical analysis.

Sources

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · full access

Ask about ChipWhisperer: Power Analysis Research Guide

Full access: large monthly usage, up to 10 source passages behind each answer, and MCP and API access for Claude Code, Codex and other CLIs. Cancel any time.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →