Importing from CSV

Hi Colin,

I was wondering is there a function to import my own external data into the analyzer? Currently I have data in a .csv file, decided to take that file and convert it into a .npy file. However, when reading the .npy file I created, I end up getting “nan” errors when executing the attack. Looking at the data it looks exactly the same as yours when I check the output of the files in python. This is the code I use to convert from csv and save it into npy.

import numpy as np
from numpy import genfromtxt

myData = genfromtxt('tracesT005.csv', delimiter=';' , dtype=None)
myTextData = genfromtxt('textInT005.csv', delimiter=';' ,dtype=None)
myKeyData = genfromtxt('keyInT005.csv', delimiter=';' ,dtype=None)'traces.npy',myData)'knownkey.npy',myKeyData)'textin.npy',myTextData)

For debugging purposes I used the traces and known text that I acquired using the chipwhisperer capture tool and used that data to run a cpa attack ( … alcpa.html) with the attack being successful. I then took the known text I had and converted it from csv to npy and got “nan” errors. When looking at my data and the data that the capture tools saves, it looks identical. Below you can see that both textin looks the same.

What format or extra parameters do you use when saving the data in the chipwhisperer capture tool to be stored in npy?


ok, I got it working now using this format:

myData = genfromtxt('traceT005.csv', delimiter=';' , dtype=None)
myTextData = genfromtxt('textInT005.csv', delimiter=';' ,dtype='uint8')


Glad it worked - sorry on the delay, had issues getting automated notices from the forum software so just seeing this now!