Skip to content

Commit ceec693

Browse files
committed
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 steam-bell-92#1294
1 parent 317ab4d commit ceec693

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

games/Password-Forge/Password-Forge.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import random
1+
import secrets
22
import re
33

44
def main():
@@ -28,11 +28,11 @@ def main():
2828

2929
# ---------------- RANDOM GAME VALUES ---------------- #
3030

31-
banned_digit = random.randint(0, 9)
31+
banned_digit = secrets.randbelow(10)
3232

33-
target_sum = random.randint(12, 24)
33+
target_sum = secrets.randbelow(13) + 12
3434

35-
lucky_letter = random.choice(
35+
lucky_letter = secrets.choice(
3636
"abcdefghijklmnopqrstuvwxyz"
3737
)
3838

0 commit comments

Comments
 (0)