I'm looking for some PRNGs and as I have been using Java for a long period of time I thought that the BitInteger class together with the Random class could both generate some large pseudo random numbers. Are the algorithms behind those generations cryptographically secure? Or is it just some sort of a + (b - c) mod d or similiar operation.
Tell me more
×
Cryptography Stack Exchange is a question and answer site for
software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.
|
Presuming this documentation is correct, the answer is no, these numbers are not cryptographically secure. The Random class uses a linear congruential formula with a 48 bit seed. For most purposes it is not enough even if you only require 48 bit security. Given a fairly low number of outputs from a LCG, it is possible to derive the seed, even if only a few bits of each seed iteration are used. That question has been answered here. |
||||
|
|
SecureRandomclass. – CodesInChaos Mar 24 '12 at 9:49