As of August 2020 the site you are on ( is deprecated, and content is now at


Jump to: navigation, search

Tutorial B5 Breaking AES (Straightforward)

2,188 bytes added, 22:37, 24 September 2017
Analyzing the Traces
= Analyzing the Traces =
== Opening File & Viewing Traces ==
<ol style="list-style-type: decimal;">
<li>You can choose to plot a specific range of traces. For example type '''0-10''' in the '''Trace(s) to plot'' window.</li>
<li>Hit the ''Redraw'' button when you change the trace plot range.</li>
<li>You can right-click on the waveform to change options, or left-click and drag to zoom.</li>
== Running Attack Script == In ChipWhisperer V4.0, we now use attack scripts for everything. As in the capture program, switch to the '''Python Console''' tab & find the attack scripts. There may be additional scripts there, but you should find one called "". It has the following contents: <psyntaxhighlight lang=python>import chipwhisperer as cwfrom import CPAfrom import CPAProgressivefrom chipwhisperer.analyzer.attacks.models.AES128_8bit import AES128_8bit, SBox_outputfrom chipwhisperer.analyzer.preprocessing.add_noise_random import AddNoiseRandom #self.project = cw.openProject("2017-mar23-xmega-aes.cwp")traces = self.project.traceManager() #Example: If you wanted to add noise, turn the .enabled to "True"self.ppmod[0] = AddNoiseRandom()self.ppmod[File:attacksettings0].png|imagenoise = 0.05self.ppmod[0].enabled = False attack = CPA()leak_model = AES128_8bit(SBox_output)attack.setAnalysisAlgorithm(CPAProgressive, leak_model) attack.setTraceStart(0)attack.setTracesPerAttack(50)attack.setIterations(1)attack.setReportingInterval(10)attack.setTargetSubkeys([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])attack.setTraceSource(self.ppmod[0])attack.setPointRange((0, 3000)) self.results_table.setAnalysisSource(attack)self.correlation_plot.setAnalysisSource(attack)self.output_plot.setAnalysisSource(attack)self.pge_plot.setAnalysisSource(attack)attack.processTraces()</psyntaxhighlightYou can see this script has several sections: # Imports for needed functions.# Loading of project (if using a project from disk) & setting of trace information.# Configuration of attack.# Connecting output (drawing) widgets to the attack.# Running the attack. If you need to modify the script, you can edit the file in an external editor. You will need to ensure your system is configured to open your preferred editor on ".py" files, OR configure the editor under ''Help --> Preferences''. The default options should work, but you can modify for example the ''Reporting Interval'' to see more detailed graphs. </liol style="list-style-type: decimal;"><li><p>Finally run the attack by switching to the ''Results Table'' tab and then hitting the ''AttackRun'' buttonwith the script selected:</p><p>[[File:attackv4_runscript.png|image400px]]</p></li>
<li><p>If you adjusted the ''Reporting Interval'' to a smaller number such as 5, you'll see the progression of attack results as more traces are used. If not you should simply see the final results, which should have the correct key highlighted in red. In the following case the correct key ''was'' recovered:</p>
Approved_users, bureaucrat, administrator

Navigation menu