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 A5 Breaking AES-256 Bootloader

1,221 bytes added, 17:48, 21 June 2016
Appendix C: AES-256 14th Round Key Script: Updated script
= Appendix C: AES-256 14th Round Key Script =
 
'''NB: This script works for 0.10 release or later, see local copy in doc/html directory of chipwhisperer release if you need earlier versions'''
 
Full attack script, copy/paste into a file then add as active attack script:
<pre># AES-256 14th Round Key Attackfrom chipwhisperer.common.autoscript scripts.base import AutoScriptBaseUserScriptBase#Imports from Preprocessing
import chipwhisperer.analyzer.preprocessing as preprocessing
#Imports from CaptureAttackfrom chipwhisperer.analyzer.attacks.CPA cpa import CPAfrom chipwhisperer.analyzer.attacks.CPAProgressive cpa_algorithms.progressive import CPAProgressive
import chipwhisperer.analyzer.attacks.models.AES128_8bit
#Imports from utilList class UserScript(UserScriptBase): name = "Auto-generated" description = "Auto-generated Attack Script" def __init__(self, api): UserScriptBase.__init__(self, api) self.initProject() self.initPreprocessing() self.initAnalysis() self.initReporting()
class userScript(AutoScriptBase):
preProcessingList = []
def initProject(self):
pass
def initPreprocessing(self):
self.preProcessingList traces = [] return self.preProcessingListapi.project().traceManager()
def initAnalysis(self):
self.attack = CPA() self.parent, console=attack.setTraceSource(self.consoletraces, showScriptParameterblockSignal=self.showScriptParameterTrue)
self.attack.setAnalysisAlgorithm(CPAProgressive,chipwhisperer.analyzer.attacks.models.AES128_8bit,chipwhisperer.analyzer.attacks.models.AES128_8bit.LEAK_HW_INVSBOXOUT_FIRSTROUND)
self.attack.setTraceStart(0)
self.attack.setTracesPerAttack(99200)
self.attack.setIterations(1)
self.attack.setReportingInterval(10)
self.attack.setTargetBytes([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
self.attack.setTraceManager(self.traceManager()) self.attack.setProject(self.project()) self.attack.setPointRange((0,10992)) return self.attack  def initReporting(self, results): results.setAttack(self.attack) results.setTraceManager(self.traceManager(10991)) self.results = results
def doAnalysisinitReporting(self): # Configures the attack observers (usually a set of GUI widgets) self.api.getResults("Attack Settings").setAnalysisSource(self.attack) self.doAttackapi.getResults("Correlation vs Traces in Attack").setAnalysisSource(self.attack) self.api.getResults("Output vs Point Plot").setAnalysisSource(self.attack) self.api.getResults("PGE vs Trace Plot").setAnalysisSource(self.attack) self.api.getResults("Results Table").setAnalysisSource(self.attack) self.api.getResults("Save to Files").setAnalysisSource(self.attack) self.api.getResults("Trace Output Plot").setTraceSource(self.traces) self.api.getResults("Trace Recorder").setTraceSource(self.traces)</pre>
def run(self):
self.attack.processTraces()
if __name__ == '__main__':
from chipwhisperer.common.api.CWCoreAPI import CWCoreAPI
import chipwhisperer.analyzer.ui.CWAnalyzerGUI as cwa
from chipwhisperer.common.utils.parameter import Parameter
app = cwa.makeApplication() # Comment if you don't need the GUI
Parameter.usePyQtGraph = True # Comment if you don't need the GUI
api = CWCoreAPI() # Instantiate the API
gui = cwa.CWAnalyzerGUI(api) # Comment if you don't need the GUI
gui.show() # Comment if you don't need the GUI
api.runScriptClass(UserScript) # Run UserScript through the API
app.exec_() # Comment if you don't need the GUI
</pre>
= Appendix D: AES-256 13th Round Key Script =
Approved_users
510
edits

Navigation menu