Skip to content

Instantly share code, notes, and snippets.

@PlaceReporter99
Created February 1, 2024 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PlaceReporter99/8da52f37c9ad0424ea253ead20948d99 to your computer and use it in GitHub Desktop.
Save PlaceReporter99/8da52f37c9ad0424ea253ead20948d99 to your computer and use it in GitHub Desktop.
A secure password generator using characters from different languages.
import secrets
CHARS = [*range(0x1200,0x1380)] + [*range(0x780,0x7b2)] + [*range(0x1780,0x17fa)] + [*range(0x900,0x980)] + [*range(0xabc0,0xabfa)] + [*range(0x20,0x7e)] + [*range(0x0c80, 0x0cf4)]
def get_pass(length, num):
return [''.join(secrets.choice([*map(chr, CHARS)]) for _ in range(length)) for _ in range(num)]
def main():
print()
length = int(input("Length of password?\n"))
print()
num = int(input("How many passwords?\n"))
print()
print('\n'.join(get_pass(length, num)))
print()
print("Passwords generated!")
if input("Press enter to do it again, type in anything else and then press enter to quit.") == "":
main()
else:
quit()
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment