bank: wrap pleasechangeme with random prefix and suffix

This commit is contained in:
Hernâni Marques 2026-07-10 15:32:00 +02:00
parent 8318a590e9
commit 2519c8844b
No known key found for this signature in database

View file

@ -129,11 +129,11 @@ def _rand_username() -> str:
def _rand_password() -> str:
# Always embed "pleasechangeme" so users know to set their own later.
# Suffix: readable, no ambiguous 0/O/1/l.
# Embed "pleasechangeme" with random material before and after.
alphabet = "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789"
suffix = "".join(secrets.choice(alphabet) for _ in range(8))
return "pleasechangeme" + suffix
prefix = "".join(secrets.choice(alphabet) for _ in range(4))
suffix = "".join(secrets.choice(alphabet) for _ in range(6))
return prefix + "pleasechangeme" + suffix
def create_personal_account() -> dict: