You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The rndstr() function is used in various places to generate nonces, session ids, etc. Internally, it relies on the Python random module that uses a deterministic pseudorandom number generator.
Warning The pseudo-random generators of this module should not be used for security purposes. Use os.urandom() or SystemRandom if you require a cryptographically secure pseudo-random number generator.
Would it be better for rndstr() to use random = SystemRandom()? I'm not enough of an expert to say whether a CSPRNG is strictly necessary for all the places where rndstr is used, but maybe better safe than sorry?
The text was updated successfully, but these errors were encountered:
In most if not all places it's used a cryptographically secure pseudo-random number is necessary but I agree that it's better to be safe then sorry so I'll change it.
The rndstr() function is used in various places to generate nonces, session ids, etc. Internally, it relies on the Python
random
module that uses a deterministic pseudorandom number generator.The documentation for random includes a vague but stern warning:
Would it be better for
rndstr()
to userandom = SystemRandom()
? I'm not enough of an expert to say whether a CSPRNG is strictly necessary for all the places where rndstr is used, but maybe better safe than sorry?The text was updated successfully, but these errors were encountered: