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

Use cryptographically random values where required #88

Merged
merged 7 commits into from
Mar 22, 2024

Conversation

PaulusParssinen
Copy link
Contributor

@PaulusParssinen PaulusParssinen commented Mar 22, 2024

Contributes to #86

This PR changes uses of the pseudo-RNG System.Random to the OS provided cryptographic RNG API System.Security.Cryptography.RandomNumberGenerator where applicable. These randomizations can be optimized further but let's make it secure first 😅

For example, ZRANDMEMBER specifies that the values must be "truly random".

Didn't touch pseudo-random usage in tests.

@PaulusParssinen PaulusParssinen marked this pull request as draft March 22, 2024 14:26
@vazois vazois self-assigned this Mar 22, 2024
@vazois vazois self-requested a review March 22, 2024 16:49
@PaulusParssinen PaulusParssinen marked this pull request as ready for review March 22, 2024 19:04
libs/common/Generator.cs Show resolved Hide resolved
@vazois vazois merged commit 27cd11d into microsoft:main Mar 22, 2024
8 checks passed
@PaulusParssinen PaulusParssinen deleted the fix-pseudo-randoms branch March 22, 2024 20:39
@github-actions github-actions bot locked and limited conversation to collaborators Jul 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants