dist-iot-net/src/py-cli/main.py

26 lines
513 B
Python
Raw Normal View History

2021-10-16 16:16:37 +00:00
"""
A client to send an encrypted message to another client
@author hornetfighter515, Lachezar Todorov
2021-10-16 16:16:37 +00:00
"""
import encrypt_decrypt
import websock.alice
import websock.bob
import asyncio
def main():
message = "Hello World"
key_length = 512
#Bob's keys
publicKey, privateKey = encrypt_decrypt.encrypt_decrypt.make_keys(key_length)
asyncio.run(websock.alice.Alice.messageEncrypt("ws://localhost:8765", publicKey, message))
asyncio.run(websock.bob.Bob.messageDecrypt(privateKey))