Example #1
0
    def doAttack(self):

        start = datetime.now()

        self.attack.setTargetBytes(self.targetBytes())
        self.attack.setReportingInterval(self.getReportingInterval())

        self.attack.getStatistics().clear()
        self.attack.setStatsReadyCallback(self.statsReady)

        for itNum in range(1, self.getIterations()+1):
            startingTrace = self.getTraceNum() * (itNum - 1) + self.getTraceStart()
            endingTrace = self.getTraceNum() * itNum + self.getTraceStart()

            print "Traces %d-%d" % (startingTrace, endingTrace)

            progress = AttackProgressDialog()
            progress.setWindowModality(Qt.WindowModal)
            progress.setMinimumDuration(1000)
            progress.offset = startingTrace

            #TODO:  pointRange=self.TraceRangeList[1:17]
            try:
                self.attack.addTraces(self.trace, (startingTrace, endingTrace), progress, pointRange=self.getPointRange())
            except KeyboardInterrupt:
                self.log("Attack ABORTED... stopping")

        end = datetime.now()
        self.log("Attack Time: %s" % str(end - start))
        self.attackDone.emit()
Example #2
0
    def doAttack(self):

        start = datetime.now()
        self.attack.setReportingInterval(self.getReportingInterval())

        #TODO: support start/end point different per byte
        (startingPoint, endingPoint) = self.getPointRange(None)

        self.attack.getStatistics().clear()

        for itNum in range(1, self.getIterations() + 1):
            startingTrace = self.getTraceNum() * (itNum -
                                                  1) + self.getTraceStart()
            endingTrace = self.getTraceNum() * itNum + self.getTraceStart()

            # print "%d-%d"%(startingPoint, endingPoint)
            data = []
            textins = []
            textouts = []

            print "%d-%d" % (startingTrace, endingTrace)

            for i in range(startingTrace, endingTrace):
                d = self.trace.getTrace(i)

                if d is None:
                    continue

                d = d[startingPoint:endingPoint]

                data.append(d)
                textins.append(self.trace.getTextin(i))
                textouts.append(self.trace.getTextout(i))

            #self.attack.clearStats()
            self.attack.setByteList(self.bytesEnabled())
            self.attack.setStatsReadyCallback(self.statsReady)

            progress = AttackProgressDialog()
            progress.setWindowModality(Qt.WindowModal)
            progress.setMinimumDuration(1000)
            progress.offset = startingTrace

            #TODO:  pointRange=self.TraceRangeList[1:17]
            try:
                self.attack.addTraces(data,
                                      textins,
                                      textouts,
                                      knownkeys=None,
                                      progressBar=progress)
            except KeyboardInterrupt:
                self.log("Attack ABORTED... stopping")

        end = datetime.now()
        self.log("Attack Time: %s" % str(end - start))
        self.attackDone.emit()
Example #3
0
    def doAttack(self):

        start = datetime.now()

        #TODO: support start/end point different per byte
        (startingPoint, endingPoint) = self.getPointRange(None)

        self.attack.setTargetBytes(self.targetBytes())
        self.attack.setKeyround(self.keyround())
        self.attack.setDirection(self.direction())
        self.attack.setReportingInterval(self.getReportingInterval())

        self.attack.getStatistics().clear()
        self.attack.setStatsReadyCallback(self.statsReady)

        for itNum in range(1, self.getIterations()+1):
            startingTrace = self.getTraceNum() * (itNum - 1) + self.getTraceStart()
            endingTrace = self.getTraceNum() * itNum + self.getTraceStart()

            #print "%d-%d"%(startingPoint, endingPoint)
            data = []
            textins = []
            textouts = []
            knownkeys = []

            print "%d-%d"%(startingTrace, endingTrace)

            for i in range(startingTrace, endingTrace):
                d = self.trace.getTrace(i)

                if d is None:
                    continue

                d = d[startingPoint:endingPoint]

                data.append(d)
                textins.append(self.trace.getTextin(i))
                textouts.append(self.trace.getTextout(i))
                knownkeys.append(self.trace.getKnownKey(i))

            progress = AttackProgressDialog()
            progress.setWindowModality(Qt.WindowModal)
            progress.setMinimumDuration(1000)
            progress.offset = startingTrace

            #TODO:  pointRange=self.TraceRangeList[1:17]
            try:
                self.attack.addTraces(data, textins, textouts, knownkeys, progress)
            except KeyboardInterrupt:
                self.log("Attack ABORTED... stopping")

        end = datetime.now()
        self.log("Attack Time: %s" % str(end - start))
        self.attackDone.emit()