Learn about Centmin Mod LEMP Stack today
Become a Member

Sysadmin Random Sanity Project

Discussion in 'System Administration' started by Jimmy, Jun 4, 2017.

  1. Jimmy

    Jimmy Premium Member Premium Member

    1,165
    256
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +626
    Local Time:
    7:11 PM
    1.13.x
    MariaDB 10.1.x
    The Random Sanity Project is a free, open source service that helps secure the Internet by sanity-checking sources of randomness. If you are a CTO or system administrator responsible for a security-critical web server or application running on the Internet you should consider using this service to alert you of catastrophic hardware or software failures that could completely compromise the security of your website or application.

    http://www.randomsanity.org/
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,968
    6,919
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,422
    Local Time:
    10:11 AM
    Nginx 1.13.x
    MariaDB 5.5
    Moved to more appropriate forum. Looks interesting and more at about how it came about and relationship with bitcoin http://dailycoin.info/andresen-back-one-man-security-project-inspired-bitcoin-mishaps/

    FYI, Centmin Mod installs and uses haveged to boost the level of Entropy servers have out of the box for non-OpenVZ systems. Details at http://www.issihosts.com/haveged/

    on my OVH MC-32 server for random sanity project check http://www.randomsanity.org/details
    Code (Text):
    BYTES=$(openssl rand -hex 64)
    curl https://rest.randomsanity.org/v1/q/$BYTES
    true
    curl https://rest.randomsanity.org/v1/q/$BYTES
    false
    


    interesting for RHEL 7 & CentOS 7 https://github.com/lmacken/randomsanity_redhat actual bash shell script https://github.com/lmacken/randomsanity_redhat/blob/master/randomsanity

    testing randomness of the generated data with dieharder test suite

    On OVH MC-32 server with Centmin Mod 123.09beta01
    Code (Text):
    yum -y install dieharder rng-utils
    cat /proc/sys/kernel/random/entropy_avail
    cat /dev/random | rngtest -c 1000
    haveged -n 0 | dieharder -g 200 -a
    

    Entropy available never drops below 4067 during dieharder test. Closer to 4096 bits = better randomness and SSL related performance vs closer to 0 kernel block at generating random data = poorer SSL performance
    Code (Text):
    cat /proc/sys/kernel/random/entropy_avail
    4067
    

    output from rngtest to check the randomness of data https://access.redhat.com/documenta...yption-Using_the_Random_Number_Generator.html
    Code (Text):
    cat /dev/random | rngtest -c 1000
    rngtest 5
    Copyright (c) 2004 by Henrique de Moraes Holschuh
    This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    rngtest: starting FIPS tests...
    rngtest: bits received from input: 20000032
    rngtest: FIPS 140-2 successes: 999
    rngtest: FIPS 140-2 failures: 1
    rngtest: FIPS 140-2(2001-10-10) Monobit: 1
    rngtest: FIPS 140-2(2001-10-10) Poker: 0
    rngtest: FIPS 140-2(2001-10-10) Runs: 0
    rngtest: FIPS 140-2(2001-10-10) Long run: 0
    rngtest: FIPS 140-2(2001-10-10) Continuous run: 0
    rngtest: input channel speed: (min=3.325; avg=21.557; max=31.423)Mibits/s
    rngtest: FIPS tests speed: (min=131.541; avg=192.172; max=211.928)Mibits/s
    rngtest: Program run time: 984153 microseconds
    

    output from dieharder all PASSED as opposed to listing as WEAK which means entropy being supplied isn't completely random. Click spoiler link to expand results
    Code (Text):
    haveged -n 0 | dieharder -g 200 -a
    Writing unlimited bytes to stdout
    #=============================================================================#
    #            dieharder version 3.31.1 Copyright 2003 Robert G. Brown          #
    #=============================================================================#
       rng_name    |rands/second|   Seed   |
    stdin_input_raw|  4.11e+07  |2555998644|
    #=============================================================================#
            test_name   |ntup| tsamples |psamples|  p-value |Assessment
    #=============================================================================#
       diehard_birthdays|   0|       100|     100|0.58466400|  PASSED 
          diehard_operm5|   0|   1000000|     100|0.34741491|  PASSED 
      diehard_rank_32x32|   0|     40000|     100|0.58924299|  PASSED 
        diehard_rank_6x8|   0|    100000|     100|0.73616445|  PASSED 
       diehard_bitstream|   0|   2097152|     100|0.74486962|  PASSED 
            diehard_opso|   0|   2097152|     100|0.69833033|  PASSED 
            diehard_oqso|   0|   2097152|     100|0.95739780|  PASSED 
             diehard_dna|   0|   2097152|     100|0.15888544|  PASSED 
    diehard_count_1s_str|   0|    256000|     100|0.49224258|  PASSED 
    diehard_count_1s_byt|   0|    256000|     100|0.94721478|  PASSED 
     diehard_parking_lot|   0|     12000|     100|0.37605494|  PASSED 
        diehard_2dsphere|   2|      8000|     100|0.42252561|  PASSED 
        diehard_3dsphere|   3|      4000|     100|0.54756912|  PASSED 
         diehard_squeeze|   0|    100000|     100|0.70081215|  PASSED 
            diehard_sums|   0|       100|     100|0.03207225|  PASSED 
            diehard_runs|   0|    100000|     100|0.98345098|  PASSED 
            diehard_runs|   0|    100000|     100|0.48667985|  PASSED 
           diehard_craps|   0|    200000|     100|0.97647211|  PASSED 
           diehard_craps|   0|    200000|     100|0.84142025|  PASSED 
     marsaglia_tsang_gcd|   0|  10000000|     100|0.93260709|  PASSED 
     marsaglia_tsang_gcd|   0|  10000000|     100|0.65510932|  PASSED 
             sts_monobit|   1|    100000|     100|0.37642452|  PASSED 
                sts_runs|   2|    100000|     100|0.72907473|  PASSED 
              sts_serial|   1|    100000|     100|0.56484065|  PASSED 
              sts_serial|   2|    100000|     100|0.78245002|  PASSED 
              sts_serial|   3|    100000|     100|0.75464262|  PASSED 
              sts_serial|   3|    100000|     100|0.93411292|  PASSED 
              sts_serial|   4|    100000|     100|0.43683705|  PASSED 
              sts_serial|   4|    100000|     100|0.31600703|  PASSED 
              sts_serial|   5|    100000|     100|0.90585806|  PASSED 
              sts_serial|   5|    100000|     100|0.95413919|  PASSED 
              sts_serial|   6|    100000|     100|0.61627529|  PASSED 
              sts_serial|   6|    100000|     100|0.48429656|  PASSED 
              sts_serial|   7|    100000|     100|0.16817216|  PASSED 
              sts_serial|   7|    100000|     100|0.15561448|  PASSED 
              sts_serial|   8|    100000|     100|0.01516734|  PASSED 
              sts_serial|   8|    100000|     100|0.10012547|  PASSED 
              sts_serial|   9|    100000|     100|0.03920821|  PASSED 
              sts_serial|   9|    100000|     100|0.33063611|  PASSED 
              sts_serial|  10|    100000|     100|0.01733869|  PASSED 
              sts_serial|  10|    100000|     100|0.05875474|  PASSED 
              sts_serial|  11|    100000|     100|0.05293556|  PASSED 
              sts_serial|  11|    100000|     100|0.98119654|  PASSED 
              sts_serial|  12|    100000|     100|0.09514860|  PASSED 
              sts_serial|  12|    100000|     100|0.69278435|  PASSED 
              sts_serial|  13|    100000|     100|0.28010951|  PASSED 
              sts_serial|  13|    100000|     100|0.60023662|  PASSED 
              sts_serial|  14|    100000|     100|0.29961227|  PASSED 
              sts_serial|  14|    100000|     100|0.42328548|  PASSED 
              sts_serial|  15|    100000|     100|0.14600592|  PASSED 
              sts_serial|  15|    100000|     100|0.60146485|  PASSED 
              sts_serial|  16|    100000|     100|0.12137347|  PASSED 
              sts_serial|  16|    100000|     100|0.97444505|  PASSED 
             rgb_bitdist|   1|    100000|     100|0.37052849|  PASSED 
             rgb_bitdist|   2|    100000|     100|0.83575017|  PASSED 
             rgb_bitdist|   3|    100000|     100|0.30034690|  PASSED 
             rgb_bitdist|   4|    100000|     100|0.70184743|  PASSED 
             rgb_bitdist|   5|    100000|     100|0.91389874|  PASSED 
             rgb_bitdist|   6|    100000|     100|0.71450474|  PASSED 
             rgb_bitdist|   7|    100000|     100|0.51110178|  PASSED 
             rgb_bitdist|   8|    100000|     100|0.31148799|  PASSED 
             rgb_bitdist|   9|    100000|     100|0.69787661|  PASSED 
             rgb_bitdist|  10|    100000|     100|0.60763156|  PASSED 
             rgb_bitdist|  11|    100000|     100|0.37104923|  PASSED 
             rgb_bitdist|  12|    100000|     100|0.03615341|  PASSED 
    rgb_minimum_distance|   2|     10000|    1000|0.74809078|  PASSED 
    rgb_minimum_distance|   3|     10000|    1000|0.21609783|  PASSED 
    rgb_minimum_distance|   4|     10000|    1000|0.71609594|  PASSED 
    rgb_minimum_distance|   5|     10000|    1000|0.85874785|  PASSED 
        rgb_permutations|   2|    100000|     100|0.78737303|  PASSED 
        rgb_permutations|   3|    100000|     100|0.61896838|  PASSED 
        rgb_permutations|   4|    100000|     100|0.02561445|  PASSED 
        rgb_permutations|   5|    100000|     100|0.28153360|  PASSED 
          rgb_lagged_sum|   0|   1000000|     100|0.68613613|  PASSED 
          rgb_lagged_sum|   1|   1000000|     100|0.55712141|  PASSED 
          rgb_lagged_sum|   2|   1000000|     100|0.81716761|  PASSED 
          rgb_lagged_sum|   3|   1000000|     100|0.93693052|  PASSED 
          rgb_lagged_sum|   4|   1000000|     100|0.63680500|  PASSED 
          rgb_lagged_sum|   5|   1000000|     100|0.97482845|  PASSED 
          rgb_lagged_sum|   6|   1000000|     100|0.46970603|  PASSED 
          rgb_lagged_sum|   7|   1000000|     100|0.78321335|  PASSED 
          rgb_lagged_sum|   8|   1000000|     100|0.21592473|  PASSED 
          rgb_lagged_sum|   9|   1000000|     100|0.63013875|  PASSED 
          rgb_lagged_sum|  10|   1000000|     100|0.96707651|  PASSED 
          rgb_lagged_sum|  11|   1000000|     100|0.05556949|  PASSED 
          rgb_lagged_sum|  12|   1000000|     100|0.93387628|  PASSED 
          rgb_lagged_sum|  13|   1000000|     100|0.26417530|  PASSED 
          rgb_lagged_sum|  14|   1000000|     100|0.40688115|  PASSED 
          rgb_lagged_sum|  15|   1000000|     100|0.67391425|  PASSED 
          rgb_lagged_sum|  16|   1000000|     100|0.75166577|  PASSED 
          rgb_lagged_sum|  17|   1000000|     100|0.07421644|  PASSED 
          rgb_lagged_sum|  18|   1000000|     100|0.89115827|  PASSED 
          rgb_lagged_sum|  19|   1000000|     100|0.63754741|  PASSED 
          rgb_lagged_sum|  20|   1000000|     100|0.19772907|  PASSED 
          rgb_lagged_sum|  21|   1000000|     100|0.07741357|  PASSED 
          rgb_lagged_sum|  22|   1000000|     100|0.07929148|  PASSED 
          rgb_lagged_sum|  23|   1000000|     100|0.35269016|  PASSED 
          rgb_lagged_sum|  24|   1000000|     100|0.58477945|  PASSED 
          rgb_lagged_sum|  25|   1000000|     100|0.80145591|  PASSED 
          rgb_lagged_sum|  26|   1000000|     100|0.58836258|  PASSED 
          rgb_lagged_sum|  27|   1000000|     100|0.21149789|  PASSED 
          rgb_lagged_sum|  28|   1000000|     100|0.97520376|  PASSED 
          rgb_lagged_sum|  29|   1000000|     100|0.31053275|  PASSED 
          rgb_lagged_sum|  30|   1000000|     100|0.21627329|  PASSED 
          rgb_lagged_sum|  31|   1000000|     100|0.21344191|  PASSED 
          rgb_lagged_sum|  32|   1000000|     100|0.85708927|  PASSED 
         rgb_kstest_test|   0|     10000|    1000|0.66413543|  PASSED 
         dab_bytedistrib|   0|  51200000|       1|0.25151904|  PASSED 
                 dab_dct| 256|     50000|       1|0.35925012|  PASSED 
    Preparing to run test 207.  ntuple = 0
            dab_filltree|  32|  15000000|       1|0.38070121|  PASSED 
            dab_filltree|  32|  15000000|       1|0.95650990|  PASSED 
    Preparing to run test 208.  ntuple = 0
           dab_filltree2|   0|   5000000|       1|0.01486836|  PASSED 
           dab_filltree2|   1|   5000000|       1|0.05904405|  PASSED 
    Preparing to run test 209.  ntuple = 0
            dab_monobit2|  12|  65000000|       1|0.03673123|  PASSED
    
    and more info https://blog.cryptographyengineering.com/2014/03/19/how-do-you-know-if-rng-is-working/
     
    Last edited: Jun 4, 2017
    • Like Like x 1
  3. Jimmy

    Jimmy Premium Member Premium Member

    1,165
    256
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +626
    Local Time:
    7:11 PM
    1.13.x
    MariaDB 10.1.x
    Yup. Thought it might useful for other applications.
     
    • Like Like x 1
  4. eva2000

    eva2000 Administrator Staff Member

    30,968
    6,919
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,422
    Local Time:
    10:11 AM
    Nginx 1.13.x
    MariaDB 5.5
    updated my 2nd post above with more info and example tests of randomness to better frame this discussion :D
     
    • Like Like x 1
  5. eva2000

    eva2000 Administrator Staff Member

    30,968
    6,919
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,422
    Local Time:
    10:11 AM
    Nginx 1.13.x
    MariaDB 5.5
    More on randomness https://blog.cloudflare.com/ensuring-randomness-with-linuxs-random-number-generator/

     
    • Like Like x 2