Introduction to Secure Prngs

Pseudo-Random Number Generators (PRNGs) are required for generating secret keys in cryptographic algorithms , generating sequences of packet in Network simulations (workload generators) and other applications in various fields. In this paper we will discuss a list of some requirements for generating a reliable random sequence and then will present some PRNG methods which are based on combinational chaotic logistic map. In the final section after a brief introduction to two statistical test packets, TestU01 and NIST suite tests, the PRNG methods which are presented in the fourth section will be appraised under these test packets and the results will be reported.


Introduction
Pseudo-random number generators (PRNGs) are useful in many applications such as the crypto-system in network communication [1] also one of the important methods in simulation is Mont Carlo [2] which needs to generate very high quality pseudo-random sequence and calculation of numerical integration which is not solved by regular methods [3][4][5].
Regarding the threats to the security [3][4][5][6][7][8][9][10][11][12][13][14][15][16], the statistical quality of PRNGs is becoming more important than before.For example a super computer might generate 10 9 random numbers per second and the cryptography algorithm needs 10 16 random numbers to create a secure channel in a very important communications, thus small correlation or other weaknesses in the generated sequence could easily lead to the critical leak in several network layers.
The distributions should be prepared based on their commercial applications such as "normal", "exponential", "poisson" and so on.But in this paper we consider only the generation of uniformly distributed numbers.In more details, we will focus on the real number sequence which is uniformly distributed on the interval (0…1).
The basic point in generating pseudo-random number is that these generators are deterministic because the digital computers are not able to generate truly random numbers.So the statistical test needs to be presented and the PRNGs should pass a number of important statistical tests, before being released for security usage in commu-nication networks.
In this paper, in Section 2, overview of using of chaotic maps as the reliable PRNG will be presented.Then in Section 3 some requirements for generating a high quality PRNG will be discussed.In Section 4 some class of improving PRNGs will be presented and finally in Section 5 two strong statistical test packages (i.e.NIST suite tests and TestU01) will be introduced and all PRNG methods which are tested by author, will be purposed and the results will be reported into various tables.

Overview
Generation random numbers by combinational chaotic maps is one of the best methods to improve statistical properties.For example, in 2006, Wang et al. proposed a pseudorandom number generator based on a z-logistic map [4].In 2007, Ergun and Ozogur proposed the novel random bit sequence of a non-autonomous chaotic electronic circuit [5].Then, Hu et al. proposed a true random number generator by computer mouse movement [6].In 2009 Patidar et al. designed a random bit generator based on two chaotic logistic maps which is generated by comparing the outputs of the both chaotic logistic maps [7].Recently in B. Fechner and A. Osterloh presented a meta-level true random number generator [8].

Uniformity of Distribution
Uniformity of distribution is the main concern in the statistical tests of random sequences.It means that at all points in the generation of a sequence of random or pseudo-random bits, the probability of Zero or One is as much as the probability of nine [9].

Independence
Each part of a random sequence should be independent from other parts.In the sample sequence ( 0 1 ), random numbers generate in the d-dimensional space so the sample part of this sequence: , , , Which is uniformity distribution should be independent in the d-dimensional cube [0,1] d .for example in Halton sequence [10] which is the low discrepancy method [10] to generate random numbers.Figure 1 decreased independence by increasing dimension and become totally dependent in Figure 2. Also this multidimensional clustering is clear in high dimensional in the Sobol sequence [11] (Figures 3-4).

Efficient Length of Period
Some classic algorithms for PRNGs such as Middle Square method and middle product method, although have the unique characteristics to generate pseudo-random numbers, but not enough length of periods.

Unpredictability
Unpredictability is one of the important points in cryptography, because the random sequence with these advantages (i.e.efficient length of period, good independency and uniformity of distribution) could be predictable thus existing a lot of threats in the Secret communication, we need to generate the sequence unpredictable.
In the sample sequence ( 0 1 1 n ), in the best conditions if a group of hackers have the largest part of this sequence (i.e.0 1 1 ) they may guess the other parts.But in the unpredictable PRNG They are not able to guess with probability more than 50%.
, , , , The chaotic maps in combination with predictable PRNG methods such as LFSR (which is implemented m by a small number of registers) are able to solve the    problem of predictability by using Exclusive-OR operation between LFSR's system and chaotic logistic map, this Theorem was proved by M. Babaei in 2011 [13].

Improving PRNGs
In the main part of this section we discuss about how the PRNG weaknesses could be improved.Nowadays a lot of scientists are working on this subject and could prepare reliable methods to improve these defects in generators, especially the applications of PRNGs in cryptography need to be more efficient than other applications.

Decimation Method
In this method two PRNGs generate random numbers in two different sequences, (the type of PRNGs may be the same or different).Combination based on this method is able to generate more efficient random sequence.
Based on this method if a PRNG generated a sequence such as: , , , n p p p  By using of Decimation method generated a sequence like this: , , , m q q q  By defining that: where chose as a constant efficient value.), so Decimation method generates the final sequence as below: Many papers proved that generating random sequence by this method is more efficient than discrete sequences [19], meaning that: Distribution (SeqDecimation) > distribution (PRNG1) and Distribution (SeqDecimation) > distribution (PRNG2).

XOR Operation and Combination PRNGs
One of the popular models to improve PRNG's defects is combining k numbers of generator by Xor operation.For example, if each of the generators is defined by a primitive trinomial such as: This is the main structure of Fibonacci LFSR generators which is distinct primitive degrees, then proved that the combination of these k generators has a rk period of at least .
In this case, we present various PRNGs with different efficiencies, which can be classified into three main groups. Class 1: Classic Generator XOR Classic Generator  Class 2: Classic Generator XOR Modern Generator  Class 3: Modern Generator XOR Modern Generator Based on the classification classic generators (e.g.Low discrepancy methods [10], High discrepancy methods [10], LFSR methods [13] and …) and modern generators contain any type of discrete chaotic maps (e.g.Henon map [14], Logistic map [14], Gauss map [14] …).

Shuffling Method
In this method two PRNGs generate two different random sequences like the Decimation method, one of the sequences stores in the buffer area and the other chooses from buffer side.
Suppose that, there are two PRNGs such as: where P is a PRNG's function.: ( , ,..., ) where Q is a PRNG's function, and m < n.By using of buffer B (minimum size n), storing sequence P in the buffer B then, by using of sequence Q chooses, m values of buffer B and put them in the final result sequence.
Shuffling algorithm is described below:

Statistical Tests
Reliable and secure PRNGs are implemented based on strong mathematical analysis of their properties.After that the sample sequences will be generated and submitted to empirical statistical tests.These statistical tests disclose varied defects in the sample sequences, so to achieve this goal, in the source code of these tests the sub-function is responsible for mapping the sequence of random numbers into interval (0,1) as a real variable number X, because in this interval it has a better approximation than the other intervals.For random variable X passing approximation distribution tests is so important to generate secure PRNGs, but it's not enough.

NIST
One of the most powerful statistical tests is NIST tests suite.It contains 15 tests which are based on null hypothesis testing.This package focuses on large types of general non-randomness on the target sequences [18].In order to confide a PRNG, especially as a part of cryptography algorithms, it should be tested as an input parameter in the software system test.The best systems are briefly introduced in the next sub-sections.
All of the tests are standard normal and the amount of the chi-square as reference distribution.So if the current sequence which is under test is non-random, the software calculates an unacceptable value for sequence distribution.The results of eight NIST tests are shown in Tables 2-3.
In the following tables the results of well-known or widely used PRNGs beside proposed PRNGs by M. Babaei et al. [12,13] are shown.

Conclusions
In this paper we discussed about some important factors to generate Pseudo-Random Numbers such as uniformity of distribution, independence, efficient length of period and unpredictability.Then we proved that chaotic logistic map is able to promote the performance of classic PRNGs which are not independent generators or do not have a long reliable period to generate random numbers.Finally the statistical tests (i.e.TestU01 and NIST suite tests) supported the main idea of the paper.

3 )
float *finalSeq; 4) boolean continueGenerating = True; 5) int count PRNG = 0; 6) char ans; 7) finalSeq = new float [100]; 8) while (Continue Generating); 9) { 10) int loop Length = PRNG1(); 11) for(int i=1; I loopLength; i++);  12) flooat random Number = PRNG2(); The column t-32 shows the CPU time which is required to generate a sample sequence with length 10 8 of random numbers on a 32 bit computer.This computer has Intel Pentium processor of clock speed 2.8 Giga Hertz which the Ubuntu 8.10 as OS is running on it.Also the small dash (-) indicates that the test was not applied to this particular PRNG, usually because the PRNG was already failed into smaller battery.The results of TestU01 are shown in Table1.