Hacker News new | ask | show | jobs
by cromwellian 4836 days ago
Consider that SecureRandom is really a facade around multiple providers that can plug in varying implementations. :)
6 comments

How about this one? http://xkcd.com/221/
Heh, not knowing Java very well, I scoured the BigInteger docs for quirks and loopholes, then gave up and found your comment. I guess "java.security.SecureRandom" sounded too impregnably secure to be worth looking into.
If that's really the answer they are looking for then it's a stupid question.

Trying to write a timing attack sounds much more interesting.

SquareRoot.n is static, so it runs before any code in your main().
Java Service Providers (SPI) trigger before main() is run. You can create a SecureRandom() provider, add it to the classpath with SPI, removing other providers.
ah ha! That might of being too big of a hint, good sir.
...and that you can remove all the existing ones and insert your own.
You can't change Providers while running under the SecurityManager he specifies you must use in the rules.

SecurityManager.checkSecurityAccess(java.lang.String) is called if you try and mess with the Providers.

You're right, looks like a Timing Attack might be the only solution that satisfies the spirit of the test.