Esempio n. 1
0
    def Pollard_p_1(self):
        # Pollard P minus 1 factoring, using the algorithm as described by https://math.berkeley.edu/~sagrawal/su14_math55/notes_pollard.pdf
        from p_1 import pollard_P_1

        # Pollard P-1 attack
        self.pub_key.p, self.pub_key.q = pollard_P_1(self.pub_key.n)

        if self.pub_key.q is not None:
            self.priv_key = PrivateKey(long(self.pub_key.p),
                                       long(self.pub_key.q),
                                       long(self.pub_key.e),
                                       long(self.pub_key.n))

        return
Esempio n. 2
0
    def Pollard_p_1(self):
        # Pollard P minus 1 factoring, using the algorithm as described by https://math.berkeley.edu/~sagrawal/su14_math55/notes_pollard.pdf
        from p_1 import pollard_P_1

        if not hasattr(self.pub_key, "p"):
            self.pub_key.p = None
        if not hasattr(self.pub_key, "q"):
            self.pub_key.q = None

        # Pollard P-1 attack
        poll_res = pollard_P_1(self.pub_key.n)
        if poll_res and len(poll_res) > 1:
            self.pub_key.p, self.pub_key.q = poll_res

        if self.pub_key.q is not None:
            self.priv_key = PrivateKey(int(self.pub_key.p), int(self.pub_key.q),
                                       int(self.pub_key.e), int(self.pub_key.n))

        return
Esempio n. 3
0
    def Pollard_p_1(self):
        # Pollard P minus 1 factoring, using the algorithm as described by https://math.berkeley.edu/~sagrawal/su14_math55/notes_pollard.pdf
        from p_1 import pollard_P_1

        if not hasattr(self.pub_key, "p"):
            self.pub_key.p = None
        if not hasattr(self.pub_key, "q"):
            self.pub_key.q = None

        # Pollard P-1 attack
        poll_res = pollard_P_1(self.pub_key.n)
        if poll_res and len(poll_res) > 1:
            self.pub_key.p, self.pub_key.q = poll_res

        if self.pub_key.q is not None:
            self.priv_key = PrivateKey(int(self.pub_key.p), int(self.pub_key.q),
                                       int(self.pub_key.e), int(self.pub_key.n))

        return