Last active
February 29, 2024 11:57
-
-
Save MEXAHOTABOP/e7b6d25a9fb9115ddd20822d420e97b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey | |
private_key = X25519PrivateKey.generate() | |
public_key = private_key.public_key() | |
def base64it(the_key): | |
return base64.urlsafe_b64encode(the_key).decode().rstrip("=") | |
print("private: ", base64it(private_key.private_bytes_raw())) | |
print("public: ", base64it(public_key.public_bytes_raw())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment