As of August 2020 the site you are on (wiki.newae.com) is deprecated, and content is now at rtfm.newae.com.

Changes

Jump to: navigation, search

Tutorial B6 Breaking AES (Manual CPA Attack)

61 bytes added, 15:11, 18 May 2016
Exploring the Trace Data: Cleanup
== Exploring the Trace Data ==
The next step is to read the trace data. I assume If youdon've already t have performed a capture. You need to find the source trace filesany data yet, which have a <code>.npy</code> extension. You can you should follow the path of a <code>.cwp</code> steps in [[Tutorial B5 Breaking AES (ChipWhisperer ProjectStraightforward) file ]] to find the associated trace <code>.cfg</code> file. The same directory as the <code>.cfg</code> file will have the <code>.npy</code> filesrecord some traces.
You need to find the source trace files, which have a <code>.npy</code> extension. You can follow the path of a <code>.cwp</code> (ChipWhisperer Project) file to find the associated trace <code>.cfg</code> file. The same directory as the <code>.cfg</code> file will have the <code>.npy</code> files. As an example, consider say that our <code>.cwp</code> file contains this line:
<pre>[Trace Management]
tracefile0 = default-data-dir\traces\config_2013.11.18-16.40.58_.cfg</pre>
 
Opening the <code>.cfg</code> file shows the <code>prefix=</code> line, which tells us the name of the data files:
numPoints = 3000
prefix = 2013.11.18-16.40.58_</pre>
This means our trace file is in <code>default-data-dir\traces\2013.11.18-16.40.58_traces.npy</code> for example, and the plaintext is in <code>default-data-dir\traces\2013.11.18-16.40.58_textin.npy</code>.
Using default installs, this directory will be <code>C:\chipwhisperer\software\chipwhisperer\capture\default-data-dir\traces</code>. Let's assume you've run a capture and have 50 traces of our usual AVR target.
Then use <code>np.load</code> as such (note: the '''r''' infront of the string means you don't need to escape slahes
<blockquotepre>>>> traces = np.load(r'C:chipwhisperersoftwarechipwhisperercapturedefault-data-dirtraces2013.11.18-16.40.58_traces.npy') >>> pt = np.load(r'C:chipwhisperersoftwarechipwhisperercapturedefault-data-dirtraces2013.11.18-16.40.58_textin.npy')</blockquotepre>You can print , for example , the first plaintext sent to the device:
<pre>>>> pt[0]
[<matplotlib.lines.Line2D object at 0x05EF3CF0>]
>>> plt.show()</pre>
After executing <code>plotplt.show()</code> you should get a window to pop up with the single power trace.
== Reading the Trace Data in a Script ==
Approved_users
510
edits

Navigation menu