Re: Please help!
John Ersatznom wrote:
Cute, considering I took only ten minutes the other day to implement a
bignum binary gcd for some project where there was no
decently-performing gcd implementation in the bignum library used. (Now
I wonder if Java's BigInteger's is any better...system libraries have a
I believe it has improved since the original version.
tendency towards having at least one shoddy algo. Actually, two, since
the RNG invariably blows. I don't know of a single exception to that
rule -- most system library RNGs don't even seem to be uniform. Java's
is, but independence? Forgeddaboudit. Pairs or trios of successive
values tend to clump on lines and planes, which tells me that someone at
Sun thought using a linear congruential RNG was clever. (And they use it
for cryptography! One random number leaking clues about the next one can
open up all kinds of attack opportunities for session-ID spoofing and
things like that.) I ended up implementing the MT in Java just to get
decent random numbers.)
java.util.Random may not be the best designed class, but it is not used
for crypto (not by anyone with half a brain, anyway). Perhaps you were
looking for this:
http://java.sun.com/javase/6/docs/api/java/security/SecureRandom.html
"A cryptographically strong random number minimally complies with the
statistical random number generator tests specified in FIPS 140-2,
Security Requirements for Cryptographic Modules, section 4.9.1.
Additionally, SecureRandom must produce non-deterministic output.
Therefore any seed material passed to a SecureRandom object must be
unpredictable, and all SecureRandom output sequences must be
cryptographically strong, as described in RFC 1750: Randomness
Recommendations for Security."
Tom Hawtin