International Association for Cryptologic Research

International Association
for Cryptologic Research

Transactions on Cryptographic Hardware and Embedded Systems, Volume 2024

Who Watches the Watchers: Attacking Glitch Detection Circuits


README

Artifacts for "Who Watches the Watchers: Attacking Glitch Detection Circuits"

This folder contains artifacts for the paper "Who Watches the Watchers: Attacking Glitch Detection Circuits" submitted to CHES 2024. These artifacts contain the necessary source code and information to reproduce the results from the paper.

Contents

artifacts/
├── bitstreams/     <-- prebuilt bitstreams
├── python/         <-- scripts for running experiments
└── HDL/            <-- parent folder for HDL code
    ├── aes/        <-- HDL code for AES implementations
    ├── detectors/  <-- HDL code for detector implementations
    ├── cmoda7/     <-- HDL code and vivado project for glitch generator board
    └── cw305/      <-- HDL code and vivado project for target board

A high-level overview of the contents of these artifacts are given above. The artifacts include prebuilt bitstreams for convenience, new bitstreams can be generated if you have Vivado installed. Scripts for generating Vivado projects and bitstreams are in the cmoda7 and cw305 folders.

Prerequisites

Hardware

CW305 FPGA target board - We have used a CW305 target board from NewAE with an xc7a100t FPGA as the target for this project.

Cmod A7 - We have used a Cmod A7-15T board from Digilent with an xc7a15t FPGA as an external glitch generator board. Other boards with Xilinx 7-series FPGAs could also work with appropriate adaptations of the source code.

Software

Vivado - If you want to modify the HDL and generate new bitstreams you need an installation of Vivado. We have used Vivado ML Standard Edition 2022.2

xc3prog - Used to program the cmoda7 board (Vivado can also be used).

python3 - For running scripts. We have used Python 3.10.12.

Python packages:

chipwhisperer - For interfacing with the cw305 target board. We used version 5.7.0. https://chipwhisperer.readthedocs.io/en/latest/

pycryptodome - Used to compare the ciphertexts from the target board to the expected results. https://pypi.org/project/pycryptodome/

matplotlib - Used to plot the results. https://pypi.org/project/matplotlib/

numpy - Used to handle data and store results in files. https://pypi.org/project/numpy/

Running experiments

Internal Glitch Generator

Connect the CW305 board to your PC, make sure that DIP-switch J16 is set to 0/off

Run the python script internal.py which will produce a data_internal.npz file with the results.

Results can be visualised using the plot_results.py script.

External Glitch Generator

Connect the cmoda7 board to your PC and program it with the appropriate bitstream, for example with the command xc3sprog -c jtaghs1_fast ./bitstreams/cmod_top.bit

Connect the glitch output pin of the generator board (p26) to the CLKIN port on the target board (x7).

Connect the trigger output of the target board (J1, pin 16) to pin 1 of the generator board.

Make sure that DIP-switch J16 on the target board is set to 1/on

Run the python script external.py which will produce a data_external.npz file with the results.

Results can be visualised using the plot_results.py script.