21 lines
470 B
Python
Executable File
21 lines
470 B
Python
Executable File
#!/usr/bin/python3
|
|
|
|
from cryptography.hazmat.backends import default_backend
|
|
from cryptography.hazmat.primitives.asymmetric import ec
|
|
from cryptography.hazmat.primitives import serialization
|
|
|
|
|
|
def gen_key():
|
|
private_key = ec.generate_private_key(
|
|
ec.SECP256K1(), default_backend()
|
|
)
|
|
return private_key
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
key = gen_key()
|
|
hexkey = key.private_numbers().private_value.to_bytes(32, 'big').hex()
|
|
|
|
print(hexkey)
|