Deleted test files
This commit is contained in:
parent
6ec668d7a4
commit
f8edfdbd3b
|
@ -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"))
|
|
@ -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())
|
Loading…
Reference in New Issue
Block a user