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

26 lines
513 B
Python
Executable File

"""
A client to send an encrypted message to another client
@author hornetfighter515, Lachezar Todorov
"""
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))