Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace random with secrets #6

Conversation

AdamJCavanaugh
Copy link
Contributor

@AdamJCavanaugh AdamJCavanaugh commented Jun 1, 2023

Closes #5

As far as I could tell, the try/except wasn't doing anything beneficial, so I simplified by removing it.

Regarding the full replacement, it's what's recommended by the random library itself:

The pseudo-random generators of this module should not be used for security purposes. For security or cryptographic uses, see the secrets module.

  • All tests pass successfully
  • Running from Python returns random passwords

@AdamJCavanaugh AdamJCavanaugh changed the title replace random with secrets; closes iss#5 replace random with secrets Jun 1, 2023
@soslan
Copy link
Owner

soslan commented Jun 2, 2023

Thank you for this! Let me explore this more since compatibility with Python 2.7 and 3.5 might be broken here, and the package is still regularly downloaded for those versions.
Also, systems without urandom available should be considered. I am thinking of using an --accept-random flag for users without urandom.

@AdamJCavanaugh
Copy link
Contributor Author

Great point, thanks. I'll have some time to check 2.7 and 3.5 early next week, hopefully and work to make sure it's non-breaking. You're welcome to do updates before as well, of course.

@AdamJCavanaugh AdamJCavanaugh closed this by deleting the head repository Sep 11, 2024
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.

Replace random with secrets
2 participants