Exemple #1
0
    def create_auth_key(self):
        from random import SystemRandom
        rand = SystemRandom()

        req_pq = scheme.req_pq(nonce=rand.getrandbits(128))
        log.debug(req_pq)
        yield from self.connection.send_insecure_message(req_pq)
        response = yield from self.connection.get_ingress()
        resPQ = response.get_message()
        log.debug(resPQ)

        pq = int.from_bytes(resPQ.pq.data, 'big')

        p, q = prime.primefactors(pq, True)
Exemple #2
0
 def create_auth_key(self):
     req_pq = scheme.req_pq(tl.int128_c(self.random.getrandbits(128)))
     yield from self.send_insecure_message(req_pq)