Increasing the quality of pseudo-random number generator based on fuzzy logic

We consider previously suggested by authors pseudo-random number generator based on fuzzy logic (FRNG) to increase its quality by increasing the period of generated series. To increase the period of FRNG we include more LFSRs in its structure. At the beginning we will study the case of combining four LFSRs in constructing the FRNG then the case of using eight LFSRs considering the randomness and security of the generated sequences. The resulted new versions of FRNG generate pseudo-random numbers which are more close to true random series that make it more suitable and attractive for many applications such as data security and cryptography.


Introduction
Nowadays, it is well known that pseudorandom number generations have a concept of fundamental importance in many different areas of computer science and digital communications. A good pseudorandom sequence should have a good statistical properties and should satisfy number of important requirements as unpredictability, nonlinearity, Golomb's three randomness postulates for binary sequences, high immunity against correlation attacks, and its period should be long enough since randomness is meaningless for short sequences.
Due to high speed of operations, simplicity and very good statistical properties of the generated pseudorandom sequences, pseudorandom number generators (PRNGs) based on combining the outputs of linear feedback shift registers (LFSRs) using a nonlinear function, are the most common long-period generators available at the present time [1]. In [2,3] authors proposed pseudorandom number generator based on fuzzy logic techniques [2] (FRNG), where a new non-linear function created to combine number of LFSRs as depicted in 'figure e-mail: anikinigor777@mail.ru, khkazan@mail.ru  (32bits), where an estimation of two fuzzy statistical variables over them takes place. These two linguistic variables are f 0 (number of one in the buffer) and |f 1 -f 2 | (the difference between the number of runs consisting of two consecutive ones f 1 and the number of runs consisting of two zeros f 2 ). These variables were accurately selected depending on Golomb's postulates [4]. Then a group of fuzzy If-Then rules evaluates the statistical state in every buffer at the moment and selects the LFSR with the best statistical properties and passes its LSB to the output of the system at the moment. Then a new iteration to produce a new bit begins after shifting the LFSRs one bit to the right and updating the contents of buffers respectively and evaluation the statistical situation of them and so on.
In [3,5] we investigated the parameters of FRNG and proved that the suggested generator produces a pseudorandom series with good statistical properties by testing them using the most powerful randomness tests packets (NIST, DIEHARD) [5]. In our previous researches we used only two LFSRs in constructing the suggested FRNG in order to simplify studying of its parameters.
In this paper we aim to introduce a new versions of FRNG that has high quality and more secure against algebraic attacks by increasing the period of generated series via using more LFSRs that makes the generated series very close to true random streams. At the beginning we will show through a simple example that the suggested FRNG generates a sequences with a maximum period that is defined by multiplying the periods of LFSRs used in constructing it. Then we will study the case of combining four LFSRs then the case of using eight LFSRs. The new versions of FRNG have larger periods and produce pseudorandom sequences with high level of randomness that makes it more suitable and attractive for many applications related to data security and cryptography.

Studying the period a very simple version of FRNG
It's necessary at first to explain the principle of work of FRNG using very short two LFSRs with a following simple characteristic primitive polynomials with small degrees (2,5): Then fined the period of the output sequence and how it's related to the periods of used polynomials (T 1 , T 2 ). After initiating the LFSRs with ([1 0], [0 1 0]) respectively, we will get the following periodic sequences: For LFSR1: 1011011011011011011011011011… For LFSR2: 0101110010111001011100101110… Then after filling the related buffers (here they are taken with 8 bits size for simplicity) the suggested system evaluates the statistical situation of every buffer applying the functions f 0 and |f 1 -f 2 |, then the resulted sequences fuzzificated and then a group of fuzzy If-Then rules applied to the output fuzzy sequences as showed in table 1. Bad Bad Then the system compares the results and decide which LSB of buffers will be selected as the output of the generator at this moment and so on. If the results of estimations is equal for the two 3 buffers the system will pass the LSB of the buffer that is associated with the shorter LFSR (in our case the LFSR1). Applying previously described process repeatedly we will get the following sequence of bits: The output sequence of FRNG: 011011001011000111010011011001011000111010… As seen from the resulted sequence that it repeats itself ever 21 bits. So the output is periodic with a period T s =21. It's clear that this period is equal the product of T 1 =3 and T 2 =7 which is the maximum period that could be gotten from combining LFSR1 and LFSR2. So the period of the output stream is defined by 12 s T T T  (2) Also in [3] we proved that the period of the generated sequence by FRNG is equal to the product of periods of used LFSRs, when a characteristic polynomials of LFSRs are selected as primitive polynomials and the degrees are mutual primitive numbers. So the period of the output stream (T S ) of the general structure of FRNG depicted in 'figure 1' is defined by the following formula: represent the degrees of characteristic primitive polynomials of used LFSRs respectively.

Selecting the characteristic primitive polynomials for FRNG
A good PRNG are required to have characteristic polynomials, whose number of nonzero coefficients is not too far from half of the degrees [6]. On other hand, selecting primitive polynomials with such a big number of terms leads to high hardware cost. So we should find a compromised solution. Very good solution to this problem suggested in [7], it guides us to a good method for finding polynomials with minimum-cost in hardware implementation and with suitable number of terms. The suggested method can be summarized in finding a primitive polynomial, satisfying the following formula: Then a minimum-cost LFSR that implements the same P(x) can be constructed using (m) 2-input XOR gates, where the parameters of this type of polynomials (b 1 ,b 2 ,…,b m ,n) should satisfy the following conditions [7]: In addition to the primitivity tests, that the selected polynomial should pass to be used in constructing the FRNG.
It's worth to note that number of non-zeros coefficients of such type of polynomials (4) defined by t=2 m +1, so with m=5 we will get polynomials having high diffusion capacity due to the Hamming weight t=33 which is very good when the degree of polynomial is between 67 and 131.
In the following paragraphs of this paper we will refer briefly to the selected characteristic primitive polynomials using their parameters (b 1 ,b 2 ,…,b m ,n). For example, the tuple (1,4,7,20,53,97) refers to the following primitive polynomial: 4 7 20 53 97 Due to the high Hamming weight (number of non-zero coefficients of the polynomial) and low power consumption (very few of XOR gates are needed in hardware implementation) using such type of polynomials will definitely increase efficiency and the security of the designed generator.

Constructing the FRNG using four LFSRs
Firstly we will construct our new FRNG with using four LFSRs concerning the correlation immunity of the generated series, which means that the output stream of FRNG should be balanced. So the probability of appearing of the output bits of each used LFSR in the output series should be approximately equal to each other [6]. In our case, with using four LFSRs in constructing the FRNG, 4 the probability of appearing bits of each one of them in the out stream should be as close as possible to 0.5 : P(out sys =out LSFRx )0.5 where x differ from 1 to 4.
Balancing the output series can be achieved via tuning the membership functions of the fuzzy linguistic variables f 0 and |f 1 -f 2 |, for each LFSR separately. As we found in [5] the probability of appearing of the output bits of each used LFSR mainly depends on the degree of characteristic primitive polynomial and the configurations of membership functions MFs that are associated with the related linguistic variables f 0 and |f 1 -f 2 |. So in practice we should make some changes in the configurations of MFs of every LFSR in order to get the desired balanced version of FRNG. As described in [5] every linguistic variable has three membership functions (Low, Medium, High) for the first variable f 0 and (Excellent, Good, Bad) for the second |f 1 -f 2 |, but there are two MFs that have more sufficient influence on probability of appearing of related LFSR' bits, they are the Medium MF of first variable f 0 and the Excellent MF of the second linguistic variable |f 1 -f 2 |. Other MFs of both linguistic variables affect the calculated value of probability but their effect is smaller and it's very useful when the resulting value of probability P is not too far from 0.5 (fine tuning). So if we want to increase the probability of appearing LFSRx' bits (x=1,..,4) in the output stream we should increase the width of (Medium) MF of the first variable f 0 and/or increase the width of (Excellent) MF of the second variable |f 1 -f 2 | that are associated with LFSRx. Then we evaluate the balance of the output series by generating a new series with a size of 1024000 bits and compute the new value of probability P(out sys =out LFSRx ), after that according to the obtained value the process will continue repeatedly until reaching P within the margin of the predefined acceptance value ε ≥|P-0.5| that defined by 0.05 . ' Figure 2' shows algorithm of tuning the MFs. The process of tuning should be applied on every LFSR separately until reaching the relatively accepted results for all of them. As an example, we selected four primitive polynomials that have previously defined type by formula (4) and satisfy the related conditions (5) with the degrees (89,97,113,127) these polynomials are represented in (7), then the new FRNG constructed and initiated then we started the process of tuning of the MFs of linguistic variables f 0 and |f 1 -f 2 | for each LFSR separately according 'figure 2' to get the balanced version of FRNG.  Table 2 contains the obtained results with ε=0.050. All the numerical experiments have been made using MATLAB environment (version 7.14.0.739 (R2012a)) [8].

Constructing the FRNG using eight LFSRs
Another interesting example is a version of FRNG that constructed with eight LFSRs. It's more complicated than the previous one because of the time complexity of the process of tuning the MFs till getting the balanced FRNG. But the resulting generator will be very secure and very close to the true random number generator due to its huge period.
Firstly we selected eight characteristic primitive polynomials of the defined type (4) and that satisfy the related conditions (5) with degrees (61,71,79,89,97,103,113,127), these polynomials are described by (8) Configurations of MFs of (|f 1 -f 2 |) P(out sys = out LFSRx ) LFSR1 (2,3,15,39,61) 0.52 With such period the proposed FRNG became very close to real RNG and more secure against most known attacks. It can be used safely and for a long time in the field of data protection especially with the big progress of data base storing techniques and appearing the big data bases projects with increasing of the necessity of securing it.

Conclusion
In this paper we have introduced a new versions of the FRNG that emphasized its security and made the generated sequences have very high immunity against correlation attacks, with a very high linear complexity due to using larger number of LFSRs that makes them more secure against most known