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

Weak Randomness Issue #40

Open
JanetCohen opened this issue Dec 4, 2024 · 0 comments
Open

Weak Randomness Issue #40

JanetCohen opened this issue Dec 4, 2024 · 0 comments

Comments

@JanetCohen
Copy link

JanetCohen commented Dec 4, 2024

In the current code, random.SystemRandom()

q = random.SystemRandom().randint(1, index_max)

is used to generate the indices for shares and the polynomial coefficients. there are a few serious problems that could undermine its security in a real-world scenario:
virtual Environments and Containers,on systems like virtual machines or containers, the entropy pool might be weaker. This means that the randomness produced by SystemRandom() can be predictable, or worse, it could repeat in a way that’s easier for an attacker to exploit.

limited Entropy, Even if we’re using SystemRandom(), the quality of randomness heavily depends on the available entropy. If the system doesn't have enough entropy (like on a freshly booted machine or a heavily constrained environment), the randomness could become weak. This means the values generated for the share indices and polynomial coefficients could be predictable or repeatable, which would allow an attacker to reconstruct the secret more easily with fewer shares than necessary.

whats the risk?

predictable randomness,If the randomness is predictable or repeated, an attacker can figure out the polynomial or even the secret itself, just by analyzing a few shares.

weakened Security,even if we have more shares than needed, the randomness fails to provide the expected level of security, as the key entropy could be easily guessed or reproduced.

entropy check,before generating any randomness, ensure that the system has enough entropy. We could add a quick check to verify that the entropy pool is sufficiently populated before generating random values. If it’s not, maybe we need to delay or even use another source of entropy.My advice is to avoid anything that has to do with /dev/urandom in cryptography.

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

1 participant