Giter Club home page Giter Club logo

chipwhisperer-jupyter's People

Contributors

adamheinrich avatar adamws avatar alex-dewar avatar colinoflynn avatar doegox avatar franzheubach avatar grazfather avatar jam1garner avatar jpcrypt avatar jrozner avatar lcardososantos avatar monsterandy avatar nezza avatar pyvirus avatar x3nny avatar yymydyy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chipwhisperer-jupyter's Issues

bokeh version conflict on demos/husky/03-Husky Glitching notebook

For the plotting in the show(o) block, you must have specifically bokeh-2.4.3.
However it conflicts with other library requirements:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
jupyter-bokeh 4.0.0 requires bokeh==3.*, but you have bokeh 2.4.3 which is incompatible.
panel 1.3.8 requires bokeh<3.4.0,>=3.2.0, but you have bokeh 2.4.3 which is incompatible.

using a higher version of bokeh will result in error upon execution of the above block.

Add preprocessor to the notebooks to allow testing with multiple hardware attached

It would be really nice to be able to have a server with multiple hardware boards attached and have the jupyter notebooks run for all of them. This will require a preprocessor that changes all the cw.scope() calls to ones that have the serial numbers in them, specified by the tutorials.yaml configuration file for running the functional tests.

Bokeh Error in lab 4.1

"from bokeh.plotting import figure, show\n",
"from bokeh.io import output_notebook\n",
"from bokeh.palettes import brewer\n",
"\n",
"output_notebook()\n",
"p = figure()\n",
"\n",
"plot_start = 0\n",
"plot_end = 2000\n",
"xrange = range(len(trace_array[0]))[plot_start:plot_end]\n",
"bnum = 0\n",
"color_mapper = brewer['PRGn'][9]\n",
"\n",
"for tnum in range(len(trace_array)):\n",
" hw_of_byte = HW[aes_internal(textin_array[tnum][bnum], key[bnum])]\n",
" p.line(xrange, trace_array[tnum][plot_start:plot_end], line_color=color_mapper[hw_of_byte])\n",
"\n",
"show(p)"

Running the above code from lab4.1 results in

SerializationError: can't serialize <class 'range'> 

I'm running the default packages from requirements.txt with the suggested pyenv 3.9.5. Bokeh 3.1.1 is relatively new, maybe thats the issue? I found a quick fix, try replacing:

# xrange = range(len(trace_array[0]))[plot_start:plot_end]

with

xrange = [x for x in range(len(trace_array[0]))][plot_start:plot_end] 

Add filter for notebooks using jq

Look into adding a filter for Jupyter Notebook using jq that removes output and metadata. Issues:

  • Doesn't seem to play nice with rebasing and merge conflicts
  • jq needs to be manually added to the users's path on Windows

how to compile Verilog code

Hello, I would like to ask if it is possible to compile Verilog code using the ChipWhisperer-Lite XMEGA. The tutorials I have found so far are all based on C code. As I understand it, I need to create a new folder in the \hardware\victims\firmware directory and add my Verilog code there. Could you please confirm if this is the correct approach? I am not entirely sure. Thank you so much!

traitlets needs to be pinned to 5.9.0

I get the error

$ python -m jupyter notebook
Traceback (most recent call last):
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/notebook/traittypes.py", line 235, in _resolve_classes
    klass = self._resolve_string(klass)
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/traitlets/traitlets.py", line 2018, in _resolve_string
    return import_item(string)
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/traitlets/utils/importstring.py", line 31, in import_item
    module = __import__(package, fromlist=[obj])
ModuleNotFoundError: No module named 'jupyter_server.contents'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/.pyenv/versions/cw/bin/jupyter-notebook", line 8, in <module>
    sys.exit(main())
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/jupyter_core/application.py", line 281, in launch_instance
    super().launch_instance(argv=argv, **kwargs)
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/traitlets/config/application.py", line 1075, in launch_instance
    app = cls.instance(**kwargs)
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/traitlets/config/configurable.py", line 583, in instance
    inst = cls(*args, **kwargs)
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/traitlets/traitlets.py", line 1294, in __new__
    inst.setup_instance(*args, **kwargs)
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/traitlets/traitlets.py", line 1337, in setup_instance
    super(HasTraits, self).setup_instance(*args, **kwargs)
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/traitlets/traitlets.py", line 1313, in setup_instance
    init(self)
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/notebook/traittypes.py", line 226, in instance_init
    self._resolve_classes()
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/notebook/traittypes.py", line 238, in _resolve_classes
    warn(f"{klass} is not importable. Is it installed?", ImportWarning)
TypeError: warn() missing 1 required keyword-only argument: 'stacklevel'

As suggested by https://stackoverflow.com/questions/77549493/modulenotfounderror-no-module-named-jupyter-server-contents, this is solved by uninstalling traitlets and reinstalling to fixed version of 5.9.0. I suggest to add it to requirements.txt, but I canΒ΄t test it right. However, reinstalling and installing to this version fixes this issue for me.

SOLN_Fault 1_2 not working

Hey,

while working through your (great!) glitching courses I might have encountered a bug in the 1_2 password bypass example, leading to the bypass not working as intended.

As a result from a lot of head-scratching and trial and error I came to notice, that the bypass fails for every wrong password not starting with the correct letter 't'.
This especially expands to the all-zero password used in the solution.
When using an otherwise incorrect password starting with 't' however, the bypass works like a charm.

Given my understanding is correct, the clock glitch should allow us to skip one single instruction.
Looking at the disassembly I assume to see a reason for the described outcome:
image

When the first letter is 't', r25 is not set to zero at 0x00000338 and the glitch might eventually skip the backward jump at 0x0000033e.
If the initial character takes any other value however, we might glitch over the r25 = 0 assignment, but then are still left in the loop where simply the next check will leave us failing.
Glitching over 0x0000033e instead, the assignment is executed as it should and we are again lost.
Accordingly, the attack can not work as long as the assembly looks as it does and we merely may skip one instruction.

Does this make any sense to you?

Kind regards,
Max

FAULT 104, wrong SimpleSerial Version

Simple typo, but on the latest version of the tutorial for Fault 104, the SimpleSerial pre-compile is set to 2_0, which errors the compilation defaulting back to 1_0.
Setting the SS_VER='SS_VER_2_1' successfully built and compiled the FW.

Change SCOPTYPE variable to be sn

SCOPETYPE can be gotten through the serial number instead. May want to add a check after %run Helper_Scripts/Setup.ipynb to make sure that the selected scope will work for a given tutorial for each tutorial.

Broken tutorials

There's probably tutorials that are broken due to API changes. These will need to be solved before release

Japanese Translation

Hello, thanks for this awesome tutorial!
I would like to contribute Japanese translation for chipwhisperer-jupyter courses.
Could you see it if I fork this repo and send pull-request?

Tutorial Status

Testing server: Currently not running

Passing:

  • Intro_1
  • Intro_2
  • Intro_3
  • SPA_1
  • DPA_1
  • DPA_2
  • DPA_3 (Arm/Xmega)
  • CPA_1
  • CPA_2
  • CPA_3
  • CPA_5
  • Multi_1 (Arm/Xmega)
  • Profiling_1
  • TVLA_1
  • Fault_1 (Arm/Xmega)
  • Fault_2 (Arm)
  • Fault_3 (Arm/Xmega)
  • Fault_5 (Arm)

Issues:

  • Fault_4 should be switched around to using the new robust simpleserial_read that handles glitches
  • DPA_3 on Nano might fail to break a byte or two

notebook needs to be pinned at <= 6.5.5 because "ModuleNotFoundError: No module named 'notebook.base'" in notebook >= 7.0.0

notebook needs to be pinned at <= 6.5.5 because "ModuleNotFoundError: No module named 'notebook.base'" in notebook >= 7.0.0
perhaps this belongs in chipwhisperer-jupyter requirements.txt not sure

Jupyter-contrib/jupyter_nbextensions_configurator#164

pip install notebook==6.5.5

[E 2023-08-16 15:03:18.848 ServerApp] Uncaught exception GET /api/nbconvert?1692165798678 (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/api/nbconvert?1692165798678', version='HTTP/1.1', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "/home/user/.pyenv/versions/cw/lib/python3.10/site-packages/tornado/web.py", line 1786, in _execute
        result = await result
      File "/home/user/.pyenv/versions/cw/lib/python3.10/site-packages/jupyter_server/services/nbconvert/handlers.py", line 40, in get
        exporters = await run_sync(base.get_export_names)
      File "/home/user/.pyenv/versions/cw/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
        return await get_asynclib().run_sync_in_worker_thread(
      File "/home/user/.pyenv/versions/cw/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
        return await future
      File "/home/user/.pyenv/versions/cw/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
        result = context.run(func, *args)
      File "/home/user/.pyenv/versions/cw/lib/python3.10/site-packages/nbconvert/exporters/base.py", line 150, in get_export_names
        e = get_exporter(exporter_name)(config=config)
      File "/home/user/.pyenv/versions/cw/lib/python3.10/site-packages/nbconvert/exporters/base.py", line 109, in get_exporter
        exporter = [e for e in exporters if e.name == name or e.name == name.lower()][0].load()
      File "/home/user/.pyenv/versions/3.10.12/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
        module = import_module(match.group('module'))
      File "/home/user/.pyenv/versions/3.10.12/lib/python3.10/importlib/__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/home/user/.pyenv/versions/cw/lib/python3.10/site-packages/jupyter_contrib_nbextensions/__init__.py", line 5, in <module>
        import jupyter_nbextensions_configurator
      File "/home/user/.pyenv/versions/cw/lib/python3.10/site-packages/jupyter_nbextensions_configurator/__init__.py", line 18, in <module>
        from notebook.base.handlers import APIHandler, IPythonHandler
    ModuleNotFoundError: No module named 'notebook.base'

sca201 lab 3_1a does not seem to work with target stm32f071rb

Hello,

I was trying to go through lab 3_1a in sca201 the other day, but could not get past the beginning of "Communicating with the Bootloader" : the expected checksum (0xA1) would never show up.

In fact, I believe that the limited amount of RAM on the STM32F071RB is causing a stack overflow which, apparently, is messing with the UART part of the HAL : getch() can only be called once, and any subsequent call to getch() hangs the program. This problem does not arise with the STM32F303RC which has more RAM (48 kB vs 16 kB).

  • This works :
int main(void)
  {
    platform_init();
    init_uart();
    trigger_setup();

    // Do this forever (we don't actually have a jumper to bootloader)
    uint8_t i;
    uint16_t crc;
    uint8_t c;
    while(1){
        c = (uint8_t)getch();
        putch(c);
    }
}
  • But this does not :
int main(void)
  {
    platform_init();
    init_uart();
    trigger_setup();

  **//Load Super-Secret key
    aes256_context ctx;
    uint8_t tmp32[32] = SECRET_KEY;

    //Load super-secret IV
    uint8_t iv[16] = IV;**

    //Do this forever (we don't actually have a jumper to bootloader)
    uint8_t i;
    uint16_t crc;
    uint8_t c;
    while(1){
        c = (uint8_t)getch();
        putch(c);
    }
}

I tried to determine precisely what in the HAL gets overwritten, but have not been successful in my endeavours.

Respectfully Yours,

TotallyNotAStudent0

Lab 2_1A: Volatile Long Ints

Hi,

I have been working through Lab 2_1A using the ChipWhisperer NANO board. I am attempting to insert the multiply instructions; however, doing so results in a syntax error when initializing volatile long int A since Python doesn't support these keywords. I am pasting the instructions into a Jupyter cell and inserting them in that fashion. Maybe I am missing something about how to insert instructions?

'NoneType' object has no attribute 'serialstm32f'

We are the recent purchaser of the Chipwhisperer Pro 1200 kit.
We are trying to run the file '1 - Connecting to Hardware', unfortunately we are facing 'NoneType' object has no attribute 'serialstm32f' when we attempt to run the following command:

cw.program_target(scope, cw.programmers.STM32FProgrammer,"../hardware/victims/firmware/simpleserial-aes/simpleserial-aes-CW308_STM32F3.hex" )

We have followed all the commands preceding the mentioned one, as same in the '1 - Connecting to Hardware file'

Any steps we missed or how should we proceed?

ChipWhisperer Setup Test.ipynb

Hi,

I think there is a mismatch between the installed libusb1 package and the use of usb in ChipWhisperer Setup Test.ipynb called by
ChipWhisperer Setup Test.ipynb

Screenshot from 2021-09-16 09-58-58

Building Firmware on Windows

Following the instructions for Lab 2_1A, I've encountered the following issue when attempting to build firmware.

I'm running the following in Jupyter:

%%cmd -s "$PLATFORM" cd C:/Users/15055/ChipWhisperer5_64/cw/home/portable/chipwhisperer/hardware/victims/firmware/simpleserial-base-lab2 make PLATFORM=CWNANO CRYPTO_TARGET=NONE

Note that I'm using %%cmd rather than %%bash due to working in a Windows environment. I've used Chocolatey to install a working make command on Windows. I'm using the ChipWhisperer-NANO board and therefore use CWNANO for my platform.

I'm encountering the following error:

process_begin: CreateProcess(NULL, rm -f -- simpleserial-base-CWNANO.hex, ...) failed. make (e=2): The system cannot find the file specified. make[1]: *** [.././Makefile.inc:510: clean_objs] Error 2 make[1]: Leaving directory 'C:/Users/15055/ChipWhisperer5_64/cw/home/portable/chipwhisperer/hardware/victims/firmware/simpleserial-base-lab2' make: *** [.././Makefile.inc:323: all] Error 2

I've verified that the simpleserial-base-lab2 directory exists and contains the makefile and simpleserial-base.c file. What steps should I take to resolve this error?

`Installing ChipWhisperer` link in Readme is dead.

The Installing ChipWhisperer link in the Getting Started section of the readme appears to be dead:


        \          SORRY            /
         \                         /
          \    This page does     /
           ]   not exist yet.    [    ,'|
           ]                     [   /  |
           ]___               ___[ ,'   |
           ]  ]\             /[  [ |:   |
           ]  ] \           / [  [ |:   |
           ]  ]  ]         [  [  [ |:   |
           ]  ]  ]__     __[  [  [ |:   |
           ]  ]  ] ]\ _ /[ [  [  [ |:   |
           ]  ]  ] ] (#) [ [  [  [ :===='
           ]  ]  ]_].nHn.[_[  [  [
           ]  ]  ]  HHHHH. [  [  [
           ]  ] /   `HH("N  \ [  [
           ]__]/     HHH  "  \[__[
           ]         NNN         [
           ]         N/"         [
           ]         N H         [
          /          N            \
         /           q,            \
        /                           \

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.