Skip to content

Commit

Permalink
Add messages
Browse files Browse the repository at this point in the history
  • Loading branch information
223880 committed Sep 17, 2024
1 parent a7cb049 commit 238ae4c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async def _send_request_to_peer(self, peer, wallet: Wallet):
try:
host, port = peer.split(':')
reader, writer = await asyncio.open_connection(host, int(port))

# ZK proof keys and encrypt the request
Secret = DLRep(utils.get_random_secret())
request = self._create_coinjoin_request(wallet)
Expand All @@ -76,7 +76,14 @@ async def _send_request_to_peer(self, peer, wallet: Wallet):
cipher = AES.new(key, AES.MODE_EAX)
nonce = cipher.nonce
ciphertext, tag = cipher.encrypt_and_digest(pad(request.encode(), AES.block_size))


# Send keys and encrypted ZK proof
writer.write(json.dumps({
"secret": self.Secret.value,
"session_id": self.session_id,
"DLRep": self.DLRep.value
}).encode())
await writer.drain()
# Send the key and encrypted message
writer.write(json.dumps({
"key": key.hex(),
Expand Down

0 comments on commit 238ae4c

Please sign in to comment.