updated decypter finally

This commit is contained in:
Lain Iwakura 2025-06-20 23:36:37 +03:00
parent 79934ad55b
commit 36eed68030
No known key found for this signature in database
GPG Key ID: C7C18257F2ADC6F8

View File

@ -171,9 +171,10 @@ class Client:
return
# The server encrypts its response using a nonce derived from OUR RNonce, and the public keys.
server_response_nonce = blake2b(self.client_nonce + self.client_public_key.encode() + self.server_public_key.encode(), encoder=nacl.encoding.RawEncoder)[:24]
# The order of public keys might be swapped on the server side. Let's try that.
server_response_nonce = blake2b(self.client_nonce + self.server_public_key.encode() + self.client_public_key.encode(), encoder=nacl.encoding.RawEncoder)[:24]
# We decrypt the server's response using our pre-calculated shared secret 's'.
# We decrypt the server's response using our box.
decrypted_payload = self.box.decrypt(payload, server_response_nonce)
# The decrypted payload of ServerHello contains the server's nonce (SNonce)