Пример #1
0
    def run(self) :
        x = self.__analysis.get(self.__method)

        self.__context[ "STRING" ] = x.get_ts()

        self.__context[ "L_X" ].append(
                                         misc.str2long( hashlib.md5( self.__context[ "STRING" ] ).hexdigest() )
                                      )
Пример #2
0
    def run(self) :
        self.__context[ "SIGNATURES" ].append( self.__analysis.get_method_signature(self.__method, _analysis.GRAMMAR_TYPE_ANONYMOUS) )
        self.__context[ "SIGNATURES" ].append( self.__method_analysis.get_ts() )

        for i in self.__context[ "SIGNATURES" ] :
            if len(i) > 10 :
                self.__context[ "L_X" ].append(
                                                 misc.str2long( hashlib.md5( i ).hexdigest() )
                                              )
Пример #3
0
    def run(self):
        self.__context["SIGNATURES"].append(
            self.__analysis.get_method_signature(
                self.__method, _analysis.GRAMMAR_TYPE_ANONYMOUS))
        self.__context["SIGNATURES"].append(self.__method_analysis.get_ts())

        for i in self.__context["SIGNATURES"]:
            if len(i) > 10:
                self.__context["L_X"].append(
                    misc.str2long(hashlib.md5(i).hexdigest()))
Пример #4
0
    def __init__(self, secret, pieces, threshold) :
        self.__secret = secret
        self.__hash = hashlib.sha256(self.__secret).hexdigest()

        self.__secret_long = misc.str2long(self.__secret)
        self.__hash_long = hashlib.sha256(str(self.__secret_long)).hexdigest()

        self.__pieces = pieces
        self.__threshold = threshold

#      print "SECRET %s => TO LONG %d" % (self.__secret, self.__secret_long)
#      print "HASH SECRET %s" % self.__hash
#      print "THRESHOLD %d" % self.__threshold

        self.poly = Polynomial(self.__threshold, self.__secret_long)