From d7cc314ffe8088923c1ba66b224ebd329c3642a3 Mon Sep 17 00:00:00 2001 From: Lachezar <31971186+Todorov-Lachezar@users.noreply.github.com> Date: Tue, 9 Nov 2021 14:36:03 -0500 Subject: [PATCH 1/2] Delete alice.py --- src/py-cli/websock/alice.py | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100755 src/py-cli/websock/alice.py diff --git a/src/py-cli/websock/alice.py b/src/py-cli/websock/alice.py deleted file mode 100755 index bad5596..0000000 --- a/src/py-cli/websock/alice.py +++ /dev/null @@ -1,22 +0,0 @@ -""" -!/usr/bin/env python - -https://pypi.org/project/websockets/ - -@author Lachezar Todorov -""" - -import asyncio -import encrypt_decrypt - -from websockets import connect - -class Alice(): - async def messageEncrypt(uri, publicKey, message): - encryptedMessage = encrypt_decrypt.encrypt_decrypt.encryption(message, publicKey) - async with connect(uri) as websocket: - await websocket.send(encryptedMessage) - #message = await websocket.recv() - #print(message) - - #asyncio.run(hello("ws://localhost:8765")) \ No newline at end of file From 3d8db78895e3beba30606f7476b2cbc1692268a6 Mon Sep 17 00:00:00 2001 From: Lachezar <31971186+Todorov-Lachezar@users.noreply.github.com> Date: Tue, 9 Nov 2021 14:36:13 -0500 Subject: [PATCH 2/2] Delete bob.py --- src/py-cli/websock/bob.py | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100755 src/py-cli/websock/bob.py diff --git a/src/py-cli/websock/bob.py b/src/py-cli/websock/bob.py deleted file mode 100755 index a566bf3..0000000 --- a/src/py-cli/websock/bob.py +++ /dev/null @@ -1,31 +0,0 @@ -""" -!/usr/bin/env python - -https://pypi.org/project/websockets/ - -@author Lachezar Todorov -""" - -import asyncio -import encrypt_decrypt -from websockets import serve - -class Bob(): - def __init__(self,privateKey): - self.pk = privateKey - - async def decrypt(websocket, path): - privateKey = "" #dummy variable to make code work, please change! - async for message in websocket: - message = await websocket.recv() - decryptedMessage = encrypt_decrypt.encrypt_decrypt.decryption(message, privateKey) - #await websocket.send(decryptedMessage) - print(decryptedMessage) - - async def messageDecrypt(privateKey): - #do something with privateKey to send it to decrypt - - async with serve(Bob.decrypt, "localhost", 8765): - await asyncio.Future() # run forever - - #asyncio.run(main()) \ No newline at end of file