updated decypter finally
This commit is contained in:
parent
79934ad55b
commit
36eed68030
5
main.py
5
main.py
@ -171,9 +171,10 @@ class Client:
|
|||||||
return
|
return
|
||||||
|
|
||||||
# The server encrypts its response using a nonce derived from OUR RNonce, and the public keys.
|
# 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)
|
decrypted_payload = self.box.decrypt(payload, server_response_nonce)
|
||||||
|
|
||||||
# The decrypted payload of ServerHello contains the server's nonce (SNonce)
|
# The decrypted payload of ServerHello contains the server's nonce (SNonce)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user