ChipWhisperer-Jupyter Educational Courses

repository·main·Indexed 43 days ago

https://github.com/newaetech/chipwhisperer-jupyter

A collection of Jupyter-based courses for learning Side-Channel Analysis (SCA) and Fault Injection (FI) attacks using the ChipWhisperer platform. The curriculum includes fundamental and advanced labs such as SCA101, SCA201-205, FAULT101, and FAULT201, covering topics like DPA, CPA, TVLA, and Differential Fault Analysis (DFA) across various hardware configurations including CW-Lite, CW-Nano, and CW-Husky.

Tokens
123.1K
Snippets
381
Records
447
Agent score
56%

What's inside ChipWhisperer-Jupyter

  1. Overview of ChipWhisperer-Jupyter Courses

    main

    The repository contains a structured curriculum for learning Side-Channel Analysis (SCA) and Fault Injection (FI) attacks using ChipWhisperer. The courses are categorized by difficulty and topic, ranging from fundamental power analysis to advanced fault attacks on cryptographic implementations.

    Course Categories

    • SCA (Side-Channel Analysis): Focuses on power analysis attacks (e.g., DPA, CPA, TVLA) on various implementations including AES, RSA, and ECC.
    • FAULT (Fault Injection): Focuses on glitching attacks (Clock and Voltage) and Differential Fault Analysis (DFA) to bypass security or extract keys.

    Learning Path Recommendation

    To get started, it is recommended to complete SCA101 before starting FAULT101 (specifically Labs 1-X and 2-X). This ensures familiarity with the required ChipWhisperer software and fundamental concepts.

  2. Understand the SCA and FAULT course naming convention

    main

    Courses in this repository follow a specific prefix and numbering system to indicate their subject matter and difficulty level.

    Prefixes

    • sca: Side Channel (Power) Analysis courses.
    • fault: Fault Injection (Glitching) courses.

    Numbering System

    • 1xx: Fundamentals. A 101 course is a prerequisite for all higher-level courses.
    • 2xx: Advanced topics. These have dependencies noted within the specific labs or courses.
    • appx: Applications. These also have specific dependencies noted in the content.
  3. Setup ChipWhisperer and Target Hardware

    main

    Initialize the ChipWhisperer scope and target, then run the generic setup script. After that, compile the firmware for the specific platform and target, and program the target device.

    import chipwhisperer as cw
    scope = cw.scope()
    target = cw.target(scope)
    scope.default_setup()
    
    # Configuration constants
    SCOPETYPE = 'OPENADC'
    PLATFORM = 'CWLITEARM'
    CRYPTO_TARGET = 'MBEDTLS'
    VERSION='HARDWARE'
    SS_VER='SS_VER_2_0'
    
    # Run generic setup (assumes path to Setup_Generic.ipynb is correct)
    %run "../../Setup_Scripts/Setup_Generic.ipynb"
    # Compile firmware
    # Replace $1, $2, $3 with PLATFORM, CRYPTO_TARGET, and SS_VER
    cd ../../../firmware/mcu/simpleserial-aes
    make PLATFORM=$1 CRYPTO_TARGET=$2 SS_VER=$3
    # Program the target
    fw_path = '../../../firmware/mcu/simpleserial-aes/simpleserial-aes-{}.hex'.format(PLATFORM)
    cw.program_target(scope, prog, fw_path)
  4. Prerequisites for Attacking Across MixColumns

    main

    This lab focuses on a modified CPA attack designed to succeed even when the leakage model crosses a MixColumns operation (common in hardware AES implementations).

    Requirement: This lab requires the SCARED library. Note that installation may be difficult on Windows systems.

    Target Compatibility: This leakage model is known to work against:

    • STM32F4, STM32L4, STM32L5
    • K82F MMCAU
    • CW305 Default AES Implementation
    • MBEDTLS and TINYAES128C
  5. Hardware requirements for Fault 101 Labs

    main

    The Fault 101 (fault101) labs require specific hardware configurations. Compatibility varies by lab.

    Supported Hardware Groups

    • Group A HW: Includes CW-Lite (XMEGA or ARM), SCAPACK-L1, SCAPACK-L2, or CW1200.
    • CW-Nano: ChipWhisperer-Nano (planned partial support).

    Lab Compatibility Matrix

    Lab NameCW-NanoGroup A HW
    1.1: Introduction to Clock Glitching❌✅
    1.2: Clock Glitching to Bypass Password❌✅
    1.3: Clock Glitching to Memory Dump❌✅
    2.1: Introduction to Voltage Glitching❌✅
    2.1: Introduction to Voltage Glitching with CWNano✅❌
    2.2: Voltage Glitching to Bypass Password❌✅
    2.2: Voltage Glitching with CWNano to Bypass Password✅❌
    2.3: Voltage Glitching to Memory Dump❌✅
  6. Hardware and Simulator requirements for SCA204 Labs

    main

    The SCA204 (Power Analysis on Hardware ECC) labs can be completed using either physical hardware or pre-recorded power traces (Simulator).

    Hardware Requirements:

    • Capture Device: CW-Lite, SCAPACK-L1, SCAPACK-L2, CW1200, or CW-Husky. Note that while CW-Lite is supported, CW1200 or Husky is recommended to avoid slow/tedious execution.
    • Target Device: CW312-A35 or CW305.

    Simulator:

    • Pre-recorded power traces are available for free and can be used for most parts of the course.
  7. SCA201: Power Analysis Attacks on AES Implementations

    main

    SCA201 focuses on advanced AES attacks, including:

    • Trace Resynchronization: Using Sum of Absolute Differences (SAD) and Dynamic Time Warp (DTW).
    • CPA Attacks: Targeting 32-bit AES, Hardware AES (Last-Round State and Mix-Columns).
    • Bootloader Attacks: AES-256 Bootloader attacks and reverse engineering using power analysis.
  8. Additional hardware requirements for SCA201 Labs

    main

    Certain SCA201 labs require specific target hardware in addition to the standard ChipWhisperer setups:

    • Lab 2.1 (CPA on 32bit AES): Requires an ARM Target. This is included with CW-Lite w/ARM Target, SCAPACK-L1, SCAPACK-L2, or CW1200 kits.
    • Lab 2.2 (CPA on Hardware AES Implementation): Requires CW308T_STM32F4HWC (available standalone via Mouser).
    • Lab 2.3 (CPA on User FPGA AES Implementation): Requires CW308T_S6LX9 (available standalone via Mouser).