diff --git a/chatmaild/src/chatmaild/newemail.py b/chatmaild/src/chatmaild/newemail.py index 198afce5..8b484fe6 100644 --- a/chatmaild/src/chatmaild/newemail.py +++ b/chatmaild/src/chatmaild/newemail.py @@ -3,7 +3,6 @@ """CGI script for creating new accounts.""" import json -import random import secrets import string from urllib.parse import quote @@ -16,7 +15,9 @@ ALPHANUMERIC_PUNCT = string.ascii_letters + string.digits + string.punctuation def create_newemail_dict(config: Config): - user = "".join(random.choices(ALPHANUMERIC, k=config.username_max_length)) + user = "".join( + secrets.choice(ALPHANUMERIC) for _ in range(config.username_max_length) + ) password = "".join( secrets.choice(ALPHANUMERIC_PUNCT) for _ in range(config.password_min_length + 3)