I am using SecureRandom class in java with default constructor and after i run it four times and each times i will take back 4 "supposed highly secured random numbers" .

First run : -35 -43 -127 12

Second run:-123 114 4 55

Third run:39 -19 3 -51

Fourth run: 111 -48 -50 55

Now i want to know is there any statistical analysis which i can decide if these generator provide me "good" random numbers . Or i just simply can decide it by eye just seeing that in each run we will not take let say the same value twice or three times . According to Scott Adams and others is impossible to proof how good a generator of random numbers is but if it produce you let say for numbers in range 0-15 and you roll this four times and get 4 nine than it probably is not so good. Anyway i am not sure how to determine if my generator is good or not and i will appreciate any feedback,

Thanks in advance

  • $\begingroup$ Note: Statistical tests are insufficient to properly assess the quality of a cryptographically secure PRNG as they usually pass such tests (after some deterministic post-processing) and still can be vulnerable. $\endgroup$
    – SEJPM
    May 27 '16 at 14:46
  • 3
    $\begingroup$ Anyone can write an awful random number generator that will be able to pass any statistical test you throw at it. Statistical tests can only detect really, really bad random number generators that were not designed to thwart statistical tests. $\endgroup$
    – mikeazo
    May 27 '16 at 14:51
  • $\begingroup$ See this post: stackoverflow.com/questions/2130621/… $\endgroup$
    – Raoul722
    May 27 '16 at 15:06
  • $\begingroup$ That one might be missing out on the BSI AIS30 tests (hope I remembered that acronym right). Anyway, until I can check out if there are any new tests / requirements in there, you now at least know there are some German requirements on RNG's as well. $\endgroup$
    – Maarten Bodewes
    May 27 '16 at 15:57
  • $\begingroup$ one can paste digits into the output box of my random number generator's demo page, and it will perform several tests on the pasted data to see if there's any major issues: pagedemos.com/rndmelibdemo it's not super exhaustive, and i recommend at least 5k worth of randomness (10 is better), but it can alert you that something is awry. lastly, if it's true random, some stat tests will fail since random has patterns sometimes, but if the same test fails 5 times in a row, that probably indicates an issue. $\endgroup$
    – dandavis
    May 27 '16 at 18:49