added basic cryptography, advertising, and forwarding functionality to the LoRa handler. Also added a UUID class for generating unique IDs for each device.

also, i have 2 radios now! :D
This commit is contained in:
2026-05-15 10:24:49 +10:00
parent 8abf447d66
commit 6f8083fdc2
8 changed files with 201 additions and 55 deletions

16
relay/connection.py Normal file
View File

@@ -0,0 +1,16 @@
from crypt_random import secure_random
class Connection:
def load_public_constants(self):
with open("public_constants.txt", "r") as f:
self.P = int(f.readline(), 16)
self.G = int(f.readline(), 16)
def __init__(self):
self.load_public_constants()
self.private_key = int.from_bytes(secure_random(1024), "big")
self.public_key = pow(self.G, self.private_key) % self.P