From ceec693e122b4cae6aa54496dff920ec9d419d65 Mon Sep 17 00:00:00 2001 From: Siddh2024 Date: Mon, 22 Jun 2026 23:57:16 +0530 Subject: [PATCH] fix: replace random module with secrets in Password Forge - Switch from random.randint to secrets.randbelow - Switch from random.choice to secrets.choice - Ensures cryptographically secure password generation Fixes #1294 --- games/Password-Forge/Password-Forge.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/games/Password-Forge/Password-Forge.py b/games/Password-Forge/Password-Forge.py index dbac77ee..0194dc0a 100644 --- a/games/Password-Forge/Password-Forge.py +++ b/games/Password-Forge/Password-Forge.py @@ -1,4 +1,4 @@ -import random +import secrets import re def main(): @@ -28,11 +28,11 @@ def main(): # ---------------- RANDOM GAME VALUES ---------------- # - banned_digit = random.randint(0, 9) + banned_digit = secrets.randbelow(10) - target_sum = random.randint(12, 24) + target_sum = secrets.randbelow(13) + 12 - lucky_letter = random.choice( + lucky_letter = secrets.choice( "abcdefghijklmnopqrstuvwxyz" )