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

The world is now behind technology transforming every terminology in daily life, like banking, cash, paper, shopping, communication and so on into, e-world terminologies. In this fast growing e-world efficiency of cryptographic algorithms that ensure security of data is of primary concern. Randomness plays an important role in improving the efficiency of cryptographic algorithms. Compared to pseudo Random number generators true random number generators produce random series that exhibit randomness more. But it is better to combine the advantages of both true random number generators and pseudo random number generators. In this work a non-recurring random number generator is being experimented and proved to better generator when compared to the existing systems. In this system it is ensured that a sequence of numbers never repeats within the generated series and also every number occurs with same frequency. Both these qualities of the generated series prove itself to be better than the existing systems.


Introduction
Random series refers to a series of numbers where the numbers are independent and cannot reliably be reproduced.Random number generation techniques are used in cryptographic systems where randomness plays an important and major role.Natural phenomena like radioactive decay, tossing of coin are all examples of ideal random number generators also called true random number generators.That is true random number generators are those generators that uses physical entropy sources for their processing.Another type of random number generators called pseudo random number generators uses computational algorithms for their generation.Since pseudo random number generators uses computational algorithms for generation, generated series though seems to be truly random are not truly random [1][2] [3].True random number generators also called hardware random number generator, since hardware is required to extract entropy values from true physical sources.But this type of generator produce limited number of random bits per second.In order to increase the bit rate we usually go for pseudo random number generator algorithms.Linear Congruential Generator, Blum Blum Shub Generator, Linear Feedback Shift Register, XORShift Generators are some of the traditional pseudo random number generators [4].Though there are limitations for true random number generators the random series generated by them are perfectly random.Thus we cannot neglect its perfect performance.In order to get over the disadvantages of true random number generators it is better to combine true random number generator and pseudo random number generator.
True random number generators are used for generating seed values for pseudo random number generators [5].
In the proposed algorithm true random number generator is combined with pseudo random number generator.Concept of nesting is also used while generation so that a sequence of numbers never repeats in the generated series.
Along with nesting recurrence tests are done so that it is ensured that every number occurs with equal frequency in the generated series.

Related works
A true random number generator generates series of numbers that are unpredictable, independent and uniform.Source of entropy is some real world events such as flipping coin and rolling of dice.Real world events have a high degree of entropy, because it is almost impossible to predict accurately what the final result will be.Thus it is the source of entropy that helps a true random number generator to generate a perfectly random series [6].
Random.org which is a website created in 1998 by Mads Haahr produces "true" random numbers based on atmospheric noise captured by several radios tuned between stations [8].
HotBits uses inherent uncertainty in the quantum mechanical laws of nature, for generation of series.
Broadband measurements of the vacuum field contained in the radio-frequency sidebands of a singlemode laser can also be exploited for random number generation [9].
Using physical chaos in semiconductor lasers or sampling phase jitter in oscillator rings good quality random bit sequence can be generated [10] [11].
Random number generators that use computational algorithms for series generation is called pseudo random number generator.There are varieties of pseudo random number generators.Linear Congruential method, Middlesquare method, Linear Feedback Shift Registers, Xorshift generators are some of the early Pseudo Random Number Generator [12][13][14] [17].

Proposed System
The proposed system called Non-Recurring Improved Random Number Generator produces a random number series that promises unpredictability and uniformity.Fact that prime factorization is difficult is exploited in this algorithm.The true random source used during seed generation and series generation further increases system's efficiency.Since nesting is done generated series not only depends on its previous value but also a nested random series value.Nesting ensures that sequence is never repeated within the final series being generated The generated random series then goes through recurrence test.After this step occurrence of every numbers in the series are ensured to be uniformly distributed.
From the above discussion it is clear that the proposed system though it uses a computational algorithm for generation produces a series that will be independent, unpredictable and uniformly distributed.

Methodology
The proposed system consist of three steps 1.Getting the seed value 2. Generating the series 3. Refining the series

Getting the seed value
For generating the seed value first the system clock value is read.Based on the read clock value pixel value of the current picture captured by system camera is read.Thus here two true random values are used for seed generation system clock value and pixel value of the image.
Based on the pixel value read two prime numbers p10 and p20 are generated.Here p10 is the greatest prime number less than the read pixel value and p20 is the smallest prime number greater than the read pixel value.Now seed value is given by, x0=p10*p20 mod m (1) Thus seed value x0 is the product of two prime numbers.
The complexity of the seed is thus due to two factors 1.
Difficulty in factorizing product of two prime numbers.

2.
True randomness introduced, clock value and pixel value The above mentioned complexity increases the efficiency of the system and makes the job of cryptanalyst difficult or rather impossible.
The next element in the generated random sequence 'xi' not only depends on previous value xi-1 but also on ai and bi which are next elements of two other random series generated by the equations ( 3) and (4).
Thus two random series values contribute for final random series generation.That is two random series is nested within another series.
Nesting ensures that sequence is never repeated within the final series being generated.

Refining the series
The series while being generated goes through another refining step also.Here the generated value is checked and it is ensured that the values occur uniformly.
Nesting together with refining increases the efficiency of the system and makes it truly non-recurring.

Algorithm
Step 1. System clock time is read Step 2. Based on the read system clock a pixel value is read from the current image captured using system camera.
Step 3. p10 and p20 are the first pair of prime numbers generated based on the pixel value read Step 4. Seed value is generated using equation (1) Step 5. Equations ( 2), ( 3) and ( 4) together generate the next value in the series.
Step 6.The generated value undergoes recurrence testing.
Step 7. Step 5 and Step 6 is repeated till required number of random numbers are generated.
Flowchart for the algorithm mentioned above is given below.

Implementation
The algorithm was implemented in Matlab and output was got as expected.System clock value was read and a pixel value was read from the current image captured based on the pixel value read.Then two prime numbers p10 and p20 was generated.Seed value is evaluated based on equation (1).Now the series is generated using the equations ( 2), ( 3) and ( 4).The output got after implementing the algorithm is given below.
'm' was chosen to be 197.

Scatter Diagram Analysis
Scatter diagram of the random series generated are given below.From the diagram analysis it can be seen that the generated series posses good randomness and that there is no linear relationship or correlation between the generated random values.

Bar Graph Analysis
The bar graph plotted for the random values generated are given below.The graph shows that every value occur with same frequency or random series posses the property of uniformity.

Kolmogorov Smirnov Test
KS test can be used to check the randomness of the numbers generated by a RNG that is allowed to take on any value within a certain interval, leading to a continuous cdf [16].H0 = Sequence being tested is random Ha = Sequence being tested is not random From the table given below K+ = 0.071066 K-= 0.208291 From KS test table at n=30 and 1-α=0.9K=0.21756K + < K and K -< K hence sequence is random and pass KS test.

Conclusion
Non-Recurring improved random number generator is a novel approach in random series generation.Concept of nesting and further tuning of the generated series makes cryptanalysis of the series difficult or rather impossible.The graphical and statistical tests proved the system to be efficient.
Complexity of Prime factorization also contributes to the efficiency of the system.The true random sources used in the proposed system are system clock value and random pixel value read from image captured.The efficiency of the system can be further increased by using more complicated hardware for extracting true random numbers and Information Technologies EAI Endorsed Transactions on Energy Web and Information Technologies 04 2018 -06 2018 | Volume 5 | Issue 18 | e3

Figure 1 .
Figure 1.Flowchart of the proposed system

1 .
System clock time is used as the source of true entropy both during seed generation and series generation 2. The pixel value read from the current image being captured based on the system clock value adds to the random behavior of generated series.3. Product of two prime numbers forms the seed value.The seed value is thus difficult to be factorized making cryptanalysis practically impossible.4. Nesting of algorithm increases the randomness of the generated sequence.5. Refining makes the series more uniform.

Figure 2
Figure 2 Output showing the first 99 elements in the random series

Figure 3
Figure 3 Scatter Diagram For analyzing first 30 elements are chosen.Points on the graph are divided into four quadrants.If there are X points on the graph, Count X/2 points from top to bottom and draw a horizontal line.Count X/2 points from left to right and draw a vertical line.Here 30 points are considered so lines are drawn after 15 points and graph divided into four quadrants As in the figure below since the value of Q is greater than the limit given in Trend TestTable it is proved that the pattern has occurred from random chance.

Figure 4
Figure 4 Bar Graph Analysis

Figure 5
Figure 5 Bar Graph

Table 1 .
K S Test Analysis Now all the values greater than 115.5 is denoted as +1 and values less than 115.5 as -1.Number of runs is got as 12. Now, n1 , number of -1, is 15 and n2 , number of +1 is 15.From runs table the test is passed if the number of runs is between and 22.Here number of runs is 12 hence the generated series passes the test and is sufficiently random.
EAI Endorsed Transactions on Energy Web and Information Technologies 04 2018 -06 2018 | Volume 5 | Issue 18 | e3 55.4 Runs TestA series of increasing values or a series of decreasing values is known as a run.Length of the run is the number of increasing, or decreasing, values.For starting the runs test median of first thirty elements are found out.If a value in the series is less than median then it is denoted by -1 otherwise +1.Now runs are counted for this series of +1 and -1 and hypothesis testing is done.Ho : Sequence is random Ha : Sequence is not random From the series generated sequence 30 samples are taken and median is calculated and found to be 115.5.

Table 2
Runs Test Analysis