diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/src/py-cli/encrypt_decrypt.py b/src/py-cli/encrypt_decrypt.py old mode 100644 new mode 100755 diff --git a/src/py-cli/main.py b/src/py-cli/main.py old mode 100644 new mode 100755 diff --git a/src/py-cli/websock/alice.py b/src/py-cli/websock/alice.py old mode 100644 new mode 100755 index 49c6a42..6704e39 --- a/src/py-cli/websock/alice.py +++ b/src/py-cli/websock/alice.py @@ -1,22 +1,22 @@ -""" -!/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) - +""" +!/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 diff --git a/src/py-cli/websock/bob.py b/src/py-cli/websock/bob.py old mode 100644 new mode 100755 index 81a2563..9cf6b87 --- a/src/py-cli/websock/bob.py +++ b/src/py-cli/websock/bob.py @@ -1,24 +1,24 @@ -""" -!/usr/bin/env python - -https://pypi.org/project/websockets/ - -@author Lachezar Todorov -""" - -import asyncio -import encrypt_decrypt -from websockets import serve - -class Bob(): - async def decrypt(websocket, path, privateKey): - async for message in websocket: - message = await websocket.recv() - decryptedMessage = encrypt_decrypt.encrypt_decrypt.decryption(message, privateKey) - await websocket.send(decryptedMessage) - - async def main(privateKey): - async with serve(Bob.decrypt, "localhost", 8765, privateKey): - await asyncio.Future() # run forever - +""" +!/usr/bin/env python + +https://pypi.org/project/websockets/ + +@author Lachezar Todorov +""" + +import asyncio +import encrypt_decrypt +from websockets import serve + +class Bob(): + async def decrypt(websocket, path, privateKey): + async for message in websocket: + message = await websocket.recv() + decryptedMessage = encrypt_decrypt.encrypt_decrypt.decryption(message, privateKey) + await websocket.send(decryptedMessage) + + async def main(privateKey): + async with serve(Bob.decrypt, "localhost", 8765, privateKey): + await asyncio.Future() # run forever + #asyncio.run(main()) \ No newline at end of file