A New Random Keys Generator Depend on Multi Techniques

A stream cipher is a symmetric cipher which operates with a time-varying transformation on Individual plaintext digits. By contrast, block ciphers operate with a fixed transformation on large blocks of plaintext digits. Where in operation of Key generator using the LFSR to generate random keys where the shift register is controlled by an external clock. At each time unit, each digit is shifted one stage to the right. The content of the rightmost stage st is output. The new content of the leftmost stage is the feedback bit, st+L. this paper present design and implementation system of keys generator with nonlinear random of output keys and large moment bits, this system consist of three part from registers , logical circuits and search algorithm using AI work in parallel time to find the result, the LFSRs in registers part (left and right of system)can generate huge moment of bits and pass in randomness test, those bits by the logical circuit and search algorithm convert from linear to nonlinear to get more difficult in break secret keys, finally the keys can used in stream cipher or in block cipher methods.


INTRODUCTION TO CRYPTOGRAPHY
ryptography is the science and study of methods of protecting data in computer and communication systems from unauthorized disclosure and modification. The type of cryptography include two type, the Secret key cryptography involves the use of a single key. Given a message (called plaintext) and the key, encryption produces unintelligible data which is about the same length as the plaintext was. Decryption is the reverse of encryption, and uses the same key as encryption.
Public key cryptography is sometimes also referred to as asymmetric cryptography. Public key cryptography is a relatively new field, invented in 1975 unlike secret key cryptography, keys are not shared. Instead, each individual has two keys: a private key that need not be revealed to anyone, and a public key that is preferably known to the entire world.[2] [5] Stream ciphers encrypt bits individually. This is achieved by adding a bit from a key stream to a plaintext bit. There are synchronous stream ciphers where the key stream depends only on the key, and asynchronous ones where the key stream also depends on the ciphertext.see figure (1)

Type of stream cipher:
A synchronous stream cipher is one in which the key stream is generated independently of the plaintext message and of the cipher text. The encryption process of a synchronous stream cipher can be described by the equations: [2]

Figure (1) synchronous stream cipher
Where is the initial state and may be determined from the key k, f is the next-state function, g is the function which produces the key stream zi, and h is the output function which combines the key stream and plaintext mi to produce cipher text ci. The encryption and decryption processes are depicted in following figure. The OFB mode of a block cipher [4]

Figure (2) encryption and decryption in stream cipher
A self-synchronizing or asynchronous stream cipher is one in which the key stream is generated as a function of the key and a fixed number of previous ciphertext digits. The encryption function of a self-synchronizing stream cipher can be described by the equations:

Figure (3) asynchronous stream cipher
where = (c−t; c−t+1; …. ; c−1) is the (non-secret) initial state, k is the key, g is the function which produces the key stream zi, and h is the output function which combines the key stream and plaintext mi to produce ciphertext ci. The encryption and decryption processes are depicted in following Figure. The most common presently-used self-synchronizing stream ciphers are based on block ciphers in 1-bit cipher feedback mode [4][5] [6]

Figure (4) asynchronous encryption and decryption in stream cipher key generator
The actual encryption and decryption of stream ciphers is extremely simple. The security of stream ciphers hinges entirely on a "Suitable" key stream s0, s1, s2 ... Since randomness plays a major role, we will first learn about the two types of random number generators (RNG) that are important for us [9].

Trng (True Random Number Generator)
True random number generators (TRNGs) are characterized by the fact that their output cannot be reproduced. TRNGs are based on physical processes. Examples include coin flipping, rolling of dice, semiconductor noise, clock jitter in digital circuits and radioactive decay. In cryptography, TRNGs are often needed for generating session keys, which are then distributed between Alice and Bob, and for other purposes. [10] (General) Pseudorandom Number Generators (PRNG) Pseudorandom number generators (PRNGs) generate sequences which are computed from an initial seed value. Often they are computed recursively in the following way: see figure (5)

LFSR & NLFSR (linear feedback shift register and nonlinear feedback shift register)
LFSRs are easily implemented in hardware and many, but certainly not all, stream ciphers make use of LFSRs. A prominent example is the A5/1 cipher, which is standardized for voice encryption in GSM.
As we will see, even though a plain LFSR produces a sequence with good statistical properties, it is cryptographically weak. However, combinations of LFSRs, an LFSR consists of clocked storage elements (flip-flops) and a feedback path. The number of storage elements gives us the degree of the LFSR. In other words, an LFSR with m flip-flops is said to be of degree m. The feedback network computes the input for the last flip-flop as XOR-sum of certain flip-flops in the shift register. See figure (6).
A non-linear feedback shift register can be easily implemented in hardware or software and is used to create a pseudo-random sequence of numbers for many different applications. [9][10] [12]  Let's assume the LFSR is initially loaded with the values s0, . . . , sm−1. The next output bit of the LFSR sm, which is also the input to the leftmost flip-flop, can be computed by the XOR-sum of the products of flip-flop outputs and corresponding feedback coefficient.
Nonlinear feedback shift registers (NLFSR) have received much attention in designing numerous cryptographic algorithms such as stream ciphers and lightweight block ciphers to provide security in communication systems. In most cases, NLFSRs which the key stream generator is a shift register with non-linear feedback function .as illustrated in following figure. Function. The simplest nonlinear function is "AND" functions, for example:

Testing randomness number generator (five test) -Frequency test:
The purpose of this test is to determine whether the number of 0's and 1's in s are approximately the same, as would be expected for a random sequence. Let n0, n1 denote the number of 0's and 1's in s, respectively. The statistic used is. Where the equation  X1 = (n0 − n1)2 /n

-Serial test (two-bit test)
The purpose of this test is to determine whether the number of occurrences of 00, 01, 10, and 11 as subsequences of s are approximately the same, as would be expected for a random sequence. Let n0, n1 denote the number of 0's and 1's in s, respectively, and let n00, n01, n10, n11 denote the number of occurrences of 00, 01, 10, 11 in s, respectively. Note that n00 + n01 + n10 + n11 = (n − 1) since the subsequences are allowed to overlap. The statistic used is -Run test:

-Runs test
The purpose of the runs test is to determine whether the number of runs (of either zeros or ones) of various lengths in the sequence s is as expected for a random sequence. The expected number of gaps (or blocks) of length i in a random sequence of length n is ei = (n−i+3)/2i+2. Let k be equal to the largest integer i for which ei ≥ 5. Let Bi, Gi be the number of blocks and gaps, respectively, of length i in s for each Which approximately follows an N(0,1) distribution if n − d ≥ 10. Since small values of A(d) are as unexpected as large values of A(d), a two-sided test should be used.

Proposal system (first propose)
The first key generator is building used four stages of logic gate called (system gate 1) that generates in each stage different string of bit. Used the degree of polynomials with 8, 7, and 6.
Six polynomials used with right and left with three register on the left and the right at each side register referred to the polynomial degree. This explain with figure (8)  The register side: The system used six register with three on the left and three on right the system consist of multifunction that can be explained with following:

First register (left)
The first register is polynomials with degree 8 where the initial value is (1, 1, 0, 0, 0, 0, 1, 1) that register gives the polynomial (x 8 +x 7 +x 2 +x 1 + 1) as (LFSR) is used to generate 255 value string of bit where (2 8 =265-1)as max period table 1 show the value of the first register.

Third register (left)
The third register is polynomials with degree 6 where (x 6 +x 5 +x 4 +x 1 +1) the result is (1, 1, 0, 0, 1, 1, 1) as (LFSR) that register is used to generate 255 value string of bit where (2 6 =64-1)as max period. Table 3 show the value of the third register. The right register is the same register of the left except that the Xor between shows the table 4 is different in position between the registers.

Function side
In system gate design the gate used different stages at each stage used different gates that change the value of the initial array in the reg1 to reg6. Six register go through different stages of gate to gets more permutation of the bits where the last stage give the result of the six register this can be explained in the following: In this stage used different gate that is (XNOR, NOT GATE) where the gate connected in different way to produce 8 bit where accept six bits at each time from the six register. Where the reg1 and reg6 connect with xnor, gate reg2 and reg5 connect with xnor , reg3 and reg4 connect with xnor, the result of reg1 and reg6 then go through not gate,and then the result from the reg3, 4 and 5, 2 go through xnor and then all value then store in array.

Figure (9): first stage connect logic gate
Where the result from the stage seen in the following table (5)

Function 2:
In this stage used the gates that are (NOR, AND GATE) that connected in different way to produce 4 bit where accept 8 bits from the stage one at each time. The connect between the gates seen in the figure (10) Output function 1 Eng. &Tech.Journal, Vol.33,Part (B), No.3 &Tech.Journal, Vol.33,Part (B), No.3, 2015 A New Random Keys Generator Depend on Multi Techniques

348
The result of the stage three seen in the table (7)

Function 4:
In this stage used different gate that is (XNOR, AND, NOT GATE) where the gate are connected in different way to produce 8 bit where accept 2 bits from the stage 3 at each time. The connect between the gate is seen in the figure

System proposal (second propose)
this system use also four stages to produce different values that is used to generate key using different gate (logic gate that connected in different way in different stage).this system is similar to the first system where the different from the first system in the design of the logic gate of each stage .this can be explain in the following

Function 1:
In this stage used gate like (AND GATE , XOR GATE ) to produced 6 bits each time from 6 polynomial registry , the input of the first function is 6 bit from the six register where the output of the first function go to next stage . figure(15) explain the connected logic gate of the first function. Where the result seen in the table   Where the result can be seen in table (11)   Where the result can be seen in table (12)

Graph technique
At the last stage in proposal 2 use another function to add more permutation on the bits by using the graph technique on the bits to gets more permutation on the bits this can be explain in the following figure (18) The equation of the permutation the bits depend on the rule that every number (subtraction) between the two number where if the result = 2 or number the result mod 2 = 0 this result rearrange depending on the number that not the result = 2 or mod 2 where the result form the first 8 bits = (1,4) , ( 2,3) , (6,5) ,( 8,1) ,(6,3) . (7, 4), (8,5)… Then the first bits in permutation as the result= 1, 4,2,3,8,6,7,5.

1-
The LFSR generator have max period of bits after that the value is repeated. So by using new technique to initial new value from the circuit and search algorithm (binary search) to get new initial value.

2-
When used the logical gate, AI, and graph technique this get new value of the bits so the max period of register is validate for the randomness test level .

3-
Depend on the class testing to generate the bits can easy break but when used another principle for graph theory or search A.I that help to get more coefficient and diffusion .