예제 #1
0
파일: RSA.py 프로젝트: TiesB/pearl7
    def get_e(self, mTotient):
        e = 1
        t = 0

        while (
            not methods.isProbablePrime(e) and not t == 1
        ):  # run this loop until e is a prime, with a gcd of 1 with mTotient.
            e = random.randint(3, mTotient)  # get random number between 3 and your mTotient
            t, x, y = methods.extendedEuclidianAlgorithm(e, mTotient)  # Use the xEA to determine the GCD.

        return e
예제 #2
0
파일: RSA.py 프로젝트: TiesB/pearl7
    def get_private_key(self, e, mTotient):
        t, x, y = methods.extendedEuclidianAlgorithm(e, mTotient)

        d = x % mTotient
        return d