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

Random number generator seed doesn't have enough entropy #43

Closed
uzaxirr opened this issue Jan 3, 2023 · 5 comments
Closed

Random number generator seed doesn't have enough entropy #43

uzaxirr opened this issue Jan 3, 2023 · 5 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@uzaxirr
Copy link
Member

uzaxirr commented Jan 3, 2023

Description

As math/rand uses a statistical random number generator, using a low entropy seed (such as constants and the current system time) may allow an attacker to predict what the following number generated is.

Occurrences

There is 1 occurrence of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/ZeStream/zestream-server/issue/GO-S1033/occurrences/
Screenshot 2023-01-03 at 10 53 17 AM

@uzaxirr uzaxirr added bug Something isn't working good first issue Good for newcomers labels Jan 3, 2023
@vivek378521
Copy link
Contributor

vivek378521 commented Jan 3, 2023

This package generates crc64 hash and will enable higher entropy. https://pkg.go.dev/hash/crc64

I can fix this if the approach sounds okay to you. @uzaxirr

@vivek378521
Copy link
Contributor

Hey @uzaxirr Any thoughts on the above comment? Thanks!

@abskrj
Copy link
Member

abskrj commented Jan 4, 2023

you can pick this up @vivek378521

@abskrj abskrj assigned abskrj and vivek378521 and unassigned abskrj Jan 4, 2023
@vivek378521
Copy link
Contributor

@abhishekraj272 I have raised the PR: #50

Also added a simple test to check if the value is 8 digits or not. The test passed hence the PR was raised.

@abskrj
Copy link
Member

abskrj commented Jan 7, 2023

Fixed with #50

@abskrj abskrj closed this as completed Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants