cryptoSL2024/alice.py
Mateusz Piątkowski 428d692283 init
2024-04-13 21:28:33 +02:00

11 lines
261 B
Python

from utils import generate_secret
from utils import prime, FILE
from Crypto.Math.Numbers import Integer, from_bytes
g = Integer(2)
a = generate_secret()
A_secret = pow(g, Integer.from_bytes(a), prime)
with open(FILE, 'wb') as f:
f.write(A_secret.to_bytes())