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

Update pseudo random generation to use math/rand/v2 #102

Open
fedevilensky opened this issue Dec 4, 2024 · 2 comments
Open

Update pseudo random generation to use math/rand/v2 #102

fedevilensky opened this issue Dec 4, 2024 · 2 comments

Comments

@fedevilensky
Copy link

Pseudorandom number generation should be updated to use math/rand/v2 as this is the new recommended implementation

@ottosulin
Copy link

ottosulin commented Dec 5, 2024

No, crypto/rand should still be used for security-sensitive operations.

"For example, using math/rand to generate a 128-bit or 256-bit AES key would be a serious mistake, since the key would be easier to brute force. For that kind of use, you need a cryptographically strong random number generator, as provided by crypto/rand" - golang blog.

"This package's outputs might be easily predictable regardless of how it's seeded. For random numbers suitable for security-sensitive work, see the crypto/rand package" - math/rand/v2 docs

@fedevilensky
Copy link
Author

Sorry maybe I was not clear enough. I meant instead of "math/rand" use "math/rand/v2"

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

No branches or pull requests

2 participants