Skip to content

[BUG] Password generator uses weak random module instead of secrets module#1332

Open
Siddh2024 wants to merge 1 commit into
steam-bell-92:mainfrom
Siddh2024:fix/1294-password-forge-secrets
Open

[BUG] Password generator uses weak random module instead of secrets module#1332
Siddh2024 wants to merge 1 commit into
steam-bell-92:mainfrom
Siddh2024:fix/1294-password-forge-secrets

Conversation

@Siddh2024

Copy link
Copy Markdown
Contributor

Description

This PR addresses issue #1294 by replacing the insecure
andom\ module with the cryptographically secure \secrets\ module in the Password Forge game.

Changes Made

  • Replaced
    andom.randint(0, 9)\ with \secrets.randbelow(10)\ for banned digit generation
  • Replaced
    andom.randint(12, 24)\ with \secrets.randbelow(13) + 12\ for target sum generation
  • Replaced
    andom.choice(...)\ with \secrets.choice(...)\ for lucky letter selection

The \secrets\ module uses cryptographically strong randomness (OS-provided entropy), making generated values unpredictable — essential for any password-related functionality.

Related Issue

Fixes #1294

- Switch from random.randint to secrets.randbelow
- Switch from random.choice to secrets.choice
- Ensures cryptographically secure password generation

Fixes steam-bell-92#1294
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

@Siddh2024 is attempting to deploy a commit to the Anuj's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Password generator uses weak random module instead of secrets module

1 participant