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

Questionable nonce generation #16

Open
NotAFile opened this issue Oct 28, 2017 · 1 comment
Open

Questionable nonce generation #16

NotAFile opened this issue Oct 28, 2017 · 1 comment

Comments

@NotAFile
Copy link

The generate_nonce function uses a very questionable method for random number generation.

The schema is hmac(math.random() + "random" + os.time(), "keyyy").

I am not familiar with the security requirements for an oauth nonce, but all parts of this are trivially guessable or constant. If the goal is simply to have a unique number, just using e.g. socket.gettime() and/or a counter should be enough, so the complexity of the nonce generation makes me think this might be a poor attempt at generating a secret nonce.

@NotAFile
Copy link
Author

some research has shown that the nonce can be public, the requirement is only for the nonce to be unique per second. As such, a simple counter should be enough and actually reduce the chance of a collision.

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