Looping Captures

Hey!

I’m trying to get the “CWCapture.pyw” code to repeat the stock “CW305 Artix Target w/ ChipWhisperer-Lite” attack overnight for several different encryption keys read off of a text document. I then want to store each of these unique-key runs to a file. I am not sure how to best do this. The concept is simple and I know what commands to use in python. However, I don’t have experience with large projects and I don’t know where in the code the key is stored, or where I should loop the code. Is anyone here a master of the CWCapture code structure and could lead me in the right direction?

Thanks,
Chris

Actually its easy to do it. You just need to create a new file, similar to:
chipwhisperer/software/chipwhisperer/capture/acq_patterns/basic.py

It needs to extend AcqKeyTextPattern_Base and implement the relevant methods. Take a look at these links for more information:
wiki.newae.com/Adding_Modules/Parameters
viewtopic.php?f=7&t=202

Another possibility is to modify the example scripts to read and save the keys to/from a file.

Hi Chris,

I think Adriel’s second suggestion should be pretty easy to set up. Take one of the scripts from software/chipwhisperer/capture/scripts/ and modify it to read a set of encryption keys from a file. Then, get your script to load the target with one key, capture multiple traces, and save the project. Repeat until done. it might take a bit of playing around to make sure everything works (ie: so your script properly saves all the data where you want it to) but it shouldn’t be too hard to get it running.

Hey!

I got it working actually. Oddly enough you suggested exactly what I did! However, it seems to be going super slow (I made a forum post about it) . It seems that there may be some sort of memory issue bogging it down? When I restart the application it runs at full speed, then the more traces it takes the more it slows down.
Any thoughts?

Chris

Are you breaking the capture into multiple segments (with 50-100 traces each)?

I am not, do you think this would solve the memory issue I’m having? If so, how could I do that?
Thanks,
Chris

Try to increase the number of sets.

Chris,

I wanted to mention that I was trying some large captures today (total 50000 traces). I did this capture with “Number of Sets” at 50, so each segment of traces only had 1000 traces in it. I didn’t notice any big slowdowns. I’d still like to fix this issue, but increasing the number of sets is a good workaround for now.

Thank you very much! I will be sure to try this soon and let you know how it goes. Really appreciate it.

-Chris

I tried separating it into more sets and I didn’t see a significant change in speed. I did however strip the UI from my modified attack and it seems to capture at a constant rate now. For some reason the UI seems like it was causing the issues.

-Chris