Changes

MATLAB Control of CW-Lite

3,072 bytes added, 01:43, 29 November 2016
no edit summary
Where you will need to adjust the path for your local version/install. You can confirm with pyversion this worked. You shouldn't need to do any more setup now, it should remember this Python environment.
 
== Running Examples ==
 
To run the examples, you will need to ensure you set the MATLAB working directory to the location of the .m script files. The following shows my example setup:
 
[[File:api_matlab_path.png]]
 
The matlab files internally will reference a .py file in that same directory. You should be able to simply connect to the ChipWhisperer-Lite with the following:
 
>> cw = cwconnect()
 
If this works it should print the information about the 'cw' object:
 
cw =
 
Python CWCoreAPI with properties:
 
sigNewProject: [1x1 py.chipwhisperer.common.utils.util.Signal]
valid_aux: [1x1 py.collections.OrderedDict]
auxParam: [1x1 py.chipwhisperer.common.utils.parameter.Parameter]
sigConnectStatus: [1x1 py.chipwhisperer.common.utils.util.Signal]
sigNewTextResponse: [1x1 py.chipwhisperer.common.utils.util.Signal]
valid_attacks: [1x1 py.collections.OrderedDict]
sigTraceDone: [1x1 py.chipwhisperer.common.utils.util.Signal]
traceParam: [1x1 py.chipwhisperer.common.utils.parameter.Parameter]
executingScripts: [1x1 py.chipwhisperer.common.utils.util.Observable]
scopeParam: [1x1 py.chipwhisperer.common.utils.parameter.Parameter]
sigCampaignStart: [1x1 py.chipwhisperer.common.utils.util.Signal]
sigNewInputData: [1x1 py.chipwhisperer.common.utils.util.Signal]
params: [1x1 py.chipwhisperer.common.utils.parameter.Parameter]
settings: [1x1 py.chipwhisperer.common.api.settings.Settings]
valid_acqPatterns: [1x1 py.collections.OrderedDict]
valid_scopes: [1x1 py.collections.OrderedDict]
targetParam: [1x1 py.chipwhisperer.common.utils.parameter.Parameter]
valid_traces: [1x1 py.collections.OrderedDict]
valid_targets: [1x1 py.collections.OrderedDict]
sigAttackChanged: [1x1 py.chipwhisperer.common.utils.util.Signal]
sigCampaignDone: [1x1 py.chipwhisperer.common.utils.util.Signal]
valid_preprocessingModules: [1x1 py.collections.OrderedDict]
 
<chipwhisperer.common.api.CWCoreAPI.CWCoreAPI object at 0x000000013312FD30>
 
 
If this FAILS, you may need to simply unplug/replug the ChipWhisperer-Lite. You may have not closed the connection from the previous test. Note you can actually interact directly with the 'cw' object as in Python. For example we can get information about the current scope module:
 
>> cw.getScope()
 
But you probably just want to run an AES test. To do this, simply perform the following:
 
[cipher, trace] = measure_AES(cw, [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15],[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]);
 
The measure_AES() function passes both the plaintext and key. In this example they are both set to the same array value. It returns the ciphertext resulting & the power trace.
 
You can plot this power trace with:
 
plot(trace)
 
[[File:matlab_plot.png|400px]]
Approved_users, bureaucrat, administrator
1,956
edits