- VSCode
- VSCode Extensions: Python, Jupyter
- Git
- Python >=3.9 and <=3.11
- Download latest version of ChipWhisperer Setup from https://github.com/newaetech/chipwhisperer/releases.
- Install. Recommended Installation folder:
C:\cw
. Make sure that the paths does not contain whitespaces.
-
Clone ChipWhisperer repository somewhere (In the following we will assume that the location is
~/work/chipwhisperer
):cd ~/work/ git clone --branch 5.7.0 https://github.com/newaetech/chipwhisperer.git
-
Install required packages. Here as example for a Debian based OS:
sudo apt install libusb-dev make avr-libc gcc-avr gcc-arm-none-eabi
-
Adjust udev rules and allow user to access serial interfaces:
sudo cp ~/work/chipwhisperer/hardware/50-newae.rules /etc/udev/rules.d/50-newae.rules sudo udevadm control --reload-rules sudo usermod -aG dialout $USER sudo usermod -aG plugdev $USER
-
Clone this repository somewhere (In the following we will assume that the location is
~/work/ws2324/securecoding_ws2324
):cd ~/work/ws2324 git clone https://github.com/hackenbergstefan/securecoding_ws2324.git
-
Create virtual environment and activate it:
cd ~/work/ws2324/securecoding_ws2324 python -m venv .venv # On Unix like: . .venv/bin/activate # On Windows: .venv/Scripts/activate
-
Install requirements:
(.venv)$ pip install -r requirements.lock
Create a file .env
inside the repository with the following content:
Windows:
# C:\work\ws2324\securecoding_ws2324\.env
PATH=C:\cw\cw\usr\bin;C:\cw\cw\home\portable\armgcc\bin;C:\cw\cw\home\portable\avrgcc\bin;$env["PATH"]
CWFIRMWAREPATH=C:\cw\cw\home\portable\chipwhisperer\hardware\victims\firmware
Unix like (Assume your username is stefan
):
# /home/stefan/work/ws2324/securecoding_ws2324/.env
CWFIRMWAREPATH=/home/stefan/work/chipwhisperer/hardware/victims/firmware
Reload VSCode (Ctrl+Shift+P -> "Developer: Reload Window"
)
- Open repository folder with VSCode VSCode should have recognized your virtual environment
- Inside VSCode open ./lecture_0/test_setup.ipynb
- Select kernel from virtual environment
- Run cells step by step
In case requirements.txt
and/or requirements.lock
changed execute:
-
Ensure you have activated the corresponding virtual environment. E.g.
Unix like:
. .venv/bin/activate
Windows:
.venv/bin/activate
-
Run
pip install -r requirements.lock