cryptoSL2024/alice.py

11 lines
261 B
Python
Raw Normal View History

2024-04-13 21:28:33 +02:00
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())