diff --git a/vona/utils/__main__.py b/vona/utils/__main__.py new file mode 100644 index 0000000..aa2a3ed --- /dev/null +++ b/vona/utils/__main__.py @@ -0,0 +1,10 @@ +print("Available utils:") + +a = [ + "makekey" +] + +for t in a: + print(f"\t{t}") + +print("") \ No newline at end of file diff --git a/vona/utils/makekey.py b/vona/utils/makekey.py index c66fe69..13a13d0 100644 --- a/vona/utils/makekey.py +++ b/vona/utils/makekey.py @@ -3,7 +3,23 @@ import base64 import os -key = base64.b64encode(os.urandom(32)).decode("utf-8")[:43].replace("/", "_") -key_id = base64.b64encode(os.urandom(32)).decode("utf-8")[:6].replace("/", "_") + +def mkchar() -> str: + return os.urandom(4).hex()[:1] + + +key = ( + base64.b64encode(os.urandom(32)) + .decode("utf-8")[:43] + .replace("/", mkchar()) + .replace("+", mkchar()) +) + +key_id = ( + base64.b64encode(os.urandom(32)) + .decode("utf-8")[:6] + .replace("/", mkchar()) + .replace("+", mkchar()) +) print(f"ed25519 {key_id} {key}")