cryptographically_secure_generators.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:py-prng 作者: czechnology 项目源码 文件源码
def _gen_param_e(self):
        # use builtin RNG
        rand = SystemRandom()
        n_bits = self.n.bit_length()

        phi = (self.p - 1) * (self.q - 1)
        mx = min(phi - 1, n_bits // 80)  # top limits are phi (exclusive) and N/80 (inclusive)
        self.e = rand.randint(2, mx)
        while gcd(self.e, phi) != 1:
            self.e = rand.randint(2, mx)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号