Skip to content

Instantly share code, notes, and snippets.

@Ddedalus
Created August 2, 2019 10:42
Show Gist options
  • Select an option

  • Save Ddedalus/60ac9c04839f1b04aa460cc90c31fc73 to your computer and use it in GitHub Desktop.

Select an option

Save Ddedalus/60ac9c04839f1b04aa460cc90c31fc73 to your computer and use it in GitHub Desktop.
Generate private key in Python over arbitrary alphabet
import secrets
import string
alphabet = string.ascii_letters + string.digits
key = ''.join(secrets.choice(alphabet) for i in range(40))
print(key)
# source: https://www.geeksforgeeks.org/secrets-python-module-generate-secure-random-numbers/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment