-
Notifications
You must be signed in to change notification settings - Fork 125
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 numbers appear not to be random #139
Comments
BouncyCastle's SecureRandom implementation calls This patch only kicks in if ALG_SECURE_RANDOM is present; ALG_PSEUDO_RANDOM should still function the same, if someone wants to have deterministic "randomness" in their test suites. |
With my patch, behaviour is as expected:
|
Bouncycastle only provides PRNGs, if you want secure random numbers, you should use |
I was trying to keep compatibility with the existing code, and it good enough to test. I guess it really depends on the likelihood of someone doing something silly, like virtualizing their smart card using jcardsim and using it for web-based applications. From an IT standpoint, I can think of plenty of reasons to do that, and from a security standpoint, I can think of many reasons not to. |
PR updated per feedback from @frankmorgner . |
Hello,
I seem to be getting deterministic "randomness" when calling random.generateData that's been initialized for SecureRandom.
I started working from the template found here:
https://github.com/ph4r05/javacard-gradle-template
Every time I run it, I get the same output (51373E8B6FDEC284DB569204CA13D2CAA23BD1D85DCAB02A0E3D50461E73F1BB).
In an attempt to isolate the issue, I changed the code to be a bit more specific:
It changed the value that I received, but did not change the deterministic nature of the output.
Should the output of random.generateData() be random?
The text was updated successfully, but these errors were encountered: