Skip to content

D4VOS/true-random-number-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

True Random Number Generator

Based on Non-Recurring Improved Random Number Generator - a new step to improve cryptographic algorithms

Implementation of DOI: 10.4108/eai.12-6-2018.154813 article in Python 3.9.

The quality of the generated numbers depends mainly on the video file. Ideally, it should be as dynamic as possible. The generator generates a million numbers in a maximum of 10 seconds (depending on your CPU, of course)

Numbers are saved as raw binary so a million 8-bit numbers will take up exactly 1,000,000 bytes

Executing:

python main.py --new [range of numbers]

python main.py --append [range of numbers]

python main.py --hist

Notes

The generator output file is called binaryout.bin, it is created in the main folder. Diehard tests also use it.

Histogram of generated 50M 8bit numbers


Diehard's tests

All tests need at least 38 million 32-bit numbers = 152 million 8-bit numbers. All tests are described here

The implementation of each of the tests is carried out by the Kolmogorov-Smirnov test with a uniform distribution in the range from 0 to 1 of the obtained p_value of each unit test.

Implemented

  • Count-the-1's test
  • Parking Lot test
  • Squeeze test

Executing:

python main.py --test


Who knows, he knows

Jeśli znalazłeś to repozytorium szukając kodu na BST, daj chociaż gwiazdkę 😄