コード例 #1
0
ファイル: client.py プロジェクト: shawnzam/QingBethShawn
def main():
   keys = rsa.initializeKeys()
   public = keys[0]
   private = keys[1]
   myconnect(HOST, PORT)
   sendThread = Thread(target=send, args=(s, public))
   recvThread = Thread(target=recv, args=(s, private))
   sendThread.start()
   recvThread.start()
   recvThread.join()
   sendThread.join()
   s.close()
   sys.exit()
コード例 #2
0
ファイル: server.py プロジェクト: shawnzam/QingBethShawn
def main():
    keys = rsa.initializeKeys()
    private = keys[1]  #I am going to use this to decrypt
    public = keys[0]  #send this to the client
    print "Running the server..."
    s.bind((HOST, PORT))
    s.listen(1)
    conn, address = s.accept()
    sendThread = Thread(target=send, args=(conn, public))
    recvThread = Thread(target=recv, args=(conn, private))
    sendThread.start()
    recvThread.start()
    sendThread.join()
    recvThread.join()