11 lines
261 B
Python
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())
|