Пример #1
0
    def DHTSearchReturn(self, data):
        # Write the contact information of our user to a local file for use
        utils = Utils()
        messagingPartnerInfo = utils.writeRecipitent(data)
        messagingPartnerInfo = json.loads(messagingPartnerInfo)

        # Open file and write to it
        with open("DHT.json", "r") as f:
            contents = f.read()
        self.recipitent = json.loads(contents)


        logging.info("ONION ROUTING START")

        # Instantiate our onion router
        onionRouter = OR()

        # Set the end node (reciever)
        OR.recieverIP = messagingPartnerInfo['ip']
        OR.recieverPort = int(messagingPartnerInfo['port'])
        OR.recieverPublicKey = messagingPartnerInfo['publickey']

        # Create our circuit
        onionRouter.constructRoute(self.recipitent)
        onionRouter.createOnionKeys()
        OR.loadInRecipitent()
        onionRouter.exchangeKeys()

        logging.info("ONION ROUTING END")
Пример #2
0
 def setUp(self):
     self.utils = Utils()