Skip to content

Conversation

@albertoh88
Copy link

This update improves the password generator by replacing the standard random module with Python's secrets module, which is cryptographically secure. Additionally, the previous use of password.join(...) has been replaced with "".join(...) for correct concatenation of characters.

Changes made:

  • Replaced all occurrences of random.sample with secrets.choice to enhance security.
  • Updated all string concatenations from password.join(...) to "".join(...) to ensure proper password formation.
  • Functions generate passwords according to selected character types, preserving original logic.

These changes make the generated passwords safer, harder to predict, and the code more consistent.

This update improves the password generator by replacing the standard random module with Python's `secrets` module, which is cryptographically secure. Additionally, the previous use of `password.join(...)` has been replaced with `"".join(...)` for correct concatenation of characters.

Changes made:
- Replaced all occurrences of `random.sample` with `secrets.choice` to enhance security.
- Updated all string concatenations from `password.join(...)` to `"".join(...)` to ensure proper password formation.
- Functions generate passwords according to selected character types, preserving original logic.

These changes make the generated passwords safer, harder to predict, and the code more consistent.
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.

1 participant