commit 13d9561313156d35f9cc7b55cea9b8ed623d20f4 Author: Christopher Gumm Date: Fri Sep 11 21:12:11 2026 -0400 Initial commt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..01a4df8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# Python bytecode & cache +__pycache__/ +*.py[cod] +*$py.class + +# Virtual environments +.venv/ +venv/ +ENV/ +env/ + +# Environment variables & secrets +.env +.env.* +!.env.example + +# IDE & Editor folders +.vscode/ +.idea/ + +# Distribution / Packaging +build/ +dist/ +*.egg-info/ diff --git a/main.py b/main.py new file mode 100644 index 0000000..85369b3 --- /dev/null +++ b/main.py @@ -0,0 +1,30 @@ + +import secrets +import string + +# 1. Define your character groups +letters = string.ascii_letters +digits = string.digits +special = "!@#$%^&" + +# 2. Combine all characters for the "pool" +all_characters = letters + digits + special + +# 3. Start the password with one guaranteed character from each group +password_list = [ + secrets.choice(letters), + secrets.choice(digits), + secrets.choice(special) +] + +# 4. Fill the remaining length (16 - 3 = 13 characters) from the full pool +password_list += [secrets.choice(all_characters) for _ in range(13)] + +# 5. Shuffle the list so the guaranteed characters aren't always at the start +# We use secrets.SystemRandom() to ensure the shuffle is cryptographically secure +secrets.SystemRandom().shuffle(password_list) + +# 6. Join into a single string +password = "".join(password_list) + +print(password) \ No newline at end of file