I am using ECDH for encryption and decryption as in network i create 3 nodes sensor server and sink. i am encrypting data at sensor and want to decrypt it at server. from tinyec import registry import secrets
` '# The elliptic curve which is used for the ECDH calculations curve = registry.get_curve('brainpoolP256r1')
Ka = secrets.randbelow(curve.field.n)
X = Ka * curve.g
Kb = secrets.randbelow(curve.field.n)
Y = Kb * curve.g
print("Currently exchange the publickey (e.g. through Internet)")
A_SharedKey = Ka * Y
B_SharedKey = Kb * X``
i am using this code + encryption algorithm code in sensor.py file to encrypt data but at server file i am unable to decrypt data due to B_SharedKey i want to know that how can i access this B_SharedKey in server file from sensor file i try to send it to server file but output shows that i have to convert it into str and concatenate with other arguments but its not working as i passed it .... B_SharedKey type is point and how can i access it as it is in server file from sensor file
iam using this code + encryption algorithm code in sensor.py file to encrypt data but at server file i am unable to decrypt data due to B_SharedKey i want to know that how can i access this B_SharedKey in server file from sensor file i try to send it to server file but output shows that i have to convert it into str and concatenate with other arguments but its not working as i passed it .... B_SharedKey type is point and how can i acess it as it is in server file from sensor file in pycharm