Generating Pns for Secret Key Cryptography Using Cellular Automaton

The paper presents new results concerning application of cellular automata (CAs) to the secret key using vernam cipher cryptography.CA are applied to generate pseudo-random numbers sequence (PNS) which is used during the encryption process. One dimensional, non-uniform CAs is considered as a generator of pseudorandom number sequences (PNSs) used in cryptography with the secret key. The quality of PNSs highly depends on a set of applied CA rules. Rules of radius r = 1 and 2 for non-uniform one dimensional CAs have been considered. The search of rules is performed with use of evolutionary technique called cellular programming. As the result of collective behavior of discovered set of CA rules very high quality PNSs are generated. The quality of PNSs outperforms the quality of known one dimensional CA-based PNS generators used in the secret key cryptography. The extended set of CA rules which was found makes the cryptography system much more resistant on breaking a cryptography key.


INTRODUCTION
Confidentiality is mandatory for a majority of network applications for example commercial uses of the internet.Two classes of algorithms exist on the market for Data encryption: secret key systems and public key systems.An emerging cryptography techniques used in both types of system.One of such a promising cryptography techniques are cellular automata.Cellular automata are highly parallel and distributed systems which are able to perform complex computations.New perspectives in this area have been opened when evolutionary techniques appeared and have been used to design automatically CA based system.
CAs were proposed for public key cryptosystems by Guan [15] and Kari [9] .In such systems two keys are required: one key is used for encryption and other is used for decryption, and one of them is held in private, other is published.However the main concern of this paper is secret key cryptosystems.In such system the same key is used for encryption and decryption.The encryption process is based on the generation of pseudorandom bit sequences, and CA is used for this purpose.In the context of secret key systems, CA were first studied by wolfram [17], and later by Nandi et al. [20] and Gutowitz [8].Recently they were a subject of study by Tomassini and his colleagues [12].This paper extends these recent studies and describes the application of one-dimensional (1D) CAs for the secret key cryptography.
The paper is organized as follows.The following section presents the idea of an encryption process based on Vernam cipher and used in CA-based secret key cryptosystems.Section 3 outlines the main concepts of CAs, overviews current state of applications of CAs in secret key cryptography and states the problem considered In this paper Section IV outlines evolutionary technique called cellular programming and shows how this technique is used to discover new CA rules suitable for encryption process.Section V contains the analysis of results and Section VI concludes the paper.

II. VERNAM CIPHER AND SECRET KEY CRYPTOGRAPHY
Let P be a plain-text message consisting of m bits P 1 P 2 ... P m, and k 1 k 2 ... k m be a bit stream of a key K. Let C i be the ith bit of a cipher-text obtained by applying a  (exclusive-or) enciphering operation: The original bit P i of a message can be recovered by applying the same operation  on c i with use of the same bit stream key k: The enciphering algorithm called Vernam cipher is known to be [5,9] perfectly safe if the key stream is truly unpredictable and is used only one time.

III. CELLULAR AUTOMATA AND CRYPTOGRAPHY
One-dimensional CA is in a simplest case a collection of two-state elementary automata arranged in a lattice of the length N, and locally interacted in a discrete time t.For each cell i called a central cell, a neighborhood of a radius r is defined, consisting of n i = 2r + 1 cells, including the cell i.When considering a finite size of CAs a cyclic boundary condition is applied, resulting in a circle grid as shown in Figure 1.
It is assumed that a state q i t+1 of a cell i at the time t + 1 depends only on states of its neighborhood at the time t, i.e. q i t+1 = f (q i t , q i1 t , q i2 t ,. . ., q in t ), and a transition function f , called a rule, which defines a rule of updating a cell i.A length L of a rule and a number of neighborhood states for a binary uniform CAs is L = 2 n , where n = n i is a number of cells of a given neighborhood, and a number of such rules can be expressed as 2 L .For CAs with e.g.r = 2 the length of a rule is equal to L = 32, and a number of such rules is 2 32 and grows www.ijacsa.thesai.orgvery fast with L. When the same rule is applied to update cells of CAs, such CAs are called uniform CAs, in contrast with non uniform CAs when different rules are assigned to cells and used to update them.
Wolfram was the first to apply CAs to generate PNSs.He used uniform, 1D CAs with r = 1, and rule 30.Hortensius and Nandi et al. [20] used nonuniform CAs with two rules 90 and 150, and it was found that the quality of generated PNSs was better than the quality of the Wolfram system.Recently Tomassini and Perrenoud [12] proposed to use nonuniform, 1D CAs with r = 1 and four rules.In this study we continue this line of research.We will use finite, 1D, non uniform CAs.However, we extend the potential space of rules by consideration of two sizes of rule neighborhood, namely neighborhood of radius r = 1 and 2. To discover appropriate rules in this huge space of rules we will use CP.

A. Cellular programming
CP is an evolutionary computation technique similar to the diffusion model of parallel genetic algorithms and introduced [13] to discover rules for non uniform CAs.Fig. 2 shows a CP system implemented [2] to discover such rules.In contrast with the CP used in [12] the system has a possibility to evaluate non uniform rules of two types.The system consists of a population of N rules (left) and each rule is assigned to a single cell of CAs (right).After initiating states of each cell, i.e. setting an initial configuration, the CAs start to evolve according to assigned rules during a predefined number of time steps.Each cell produces a stream of bits, creating this way a PNS.
After stopping evolving CAs all PNSs are evaluated.The entropy E h is used to evaluate the statistical quality of each PNS.To calculate a value of the entropy each PNS is divided into subsequences of a size h.In all experiments the value h = 4 was used.Let l be the number of values which can take each element of a sequence (in our case of binary values of all elements l = 2) and l h a number of possible states of each sequence (l h = 16).E h can be calculated in the following way:  where P hj is a measured probability of occurrence of a sequence h j in a PNS.The entropy achieves its maximal value E h = h when the probabilities of the k h possible sequences of the length h are equal to 1/l h .The entropy will be used as a fitness function of CP.
A single PNS is produced by a CA cell according to assigned rules and depends on a configuration ci of states of CAs.To evaluate statistically reliable value of the entropy, CAs run with the same set of rules C times for different configurations ci, and finally the average value of entropy is calculated and serves as a fitness function of each rule from the population of rules.
After evaluation of a fitness function of all rules of the population genetic operators of selection, crossover and mutation are locally performed on rules.The evolutionary algorithm stops after some predefined number of generations of CP.
The algorithm can be summarized in the following way:

B. Discovery of rules in 1D, non uniform CAs
In all conducted experiments a population of CP and the size of non uniform CAs were equal to 50 and the population was processing during 50 generations.The CAs with initial random configuration of states and a set of assigned rules evolved during M = 4096 time steps.Running CAs with a given set of rules was repeated for C = 300 initial configurations.Fig. 3 shows an example of running CP for the evolutionary neighborhood i -3, i -2, i, i + 2, i + 3.One can see that whole CAs is able to produce very good PNSs after about 40 generations (see, the average value avg of the entropy close to 4).A typical result of a single run of an evolutionary process starting with a random rules assigned to cells of CAs is discovering by CP a small set of good rules which divide the cellular space of CAs into domains-areas where the same rules, short (r = 1) or long (r = 2), live together (see Table 1).Evolutionary process is continued on borders of domains where different rules live.This process may result in increasing domains of rules which are only slightly better than neighboring rules, which domains will decrease and finally disappear.
This happens in particular when two neighboring domains are occupied respectively by the same short rules and the same long rules.The search space of short rules is much smaller than the search space of the long rules.Therefore better short rules are discovered faster than better long rules, and for this reason long rules are gradually replaced by short rules.To limit this premature convergence of short rules, the short and long rules are initially randomly assigned to cells in the proportion of 1:3 in all subsequent experiments.The purpose of the experiments which followed was to discover an enlarged set of rules (to enlarge the key space of cryptography system) which working collectively would produce very high quality PNSs.It was noticed that in a single run of CP the evolutionary algorithm produces typically a small set of rules with a very high value of the entropy.In the result of evolutionary searching process a set of 8 short rules (including 5 rules found by [16]) and a set of 39 long rules was found.

V. ANALYSIS AND COMPARISON OF RESULTS
The entropy used as the fitness function for evolution CA rules producing high quality PNSs is only one of existing statistical tests of PNSs.None of them is enough strong to claim statistical randomness of a PNS in the case of passing a www.ijacsa.thesai.orggiven test.For this purpose uniform CAs consisting of 50 cells evolved during 65536 time steps with each single discovered rule.Each PNS produced by CAs was divided into 4-bit words and tested on general statistical tests such as the entropy, v2 test, serial correlation test [6] (some weaker rules after this testing were removed).The purpose of the last set of experiments was a selection of a small set of short and long rules for non uniform CAs which working collectively would provide a generation of very high quality PNSs suitable for the secret key cryptography.Simple combination of different rules which passed all Marsaglia tests in non uniform CAs have shown that resulting PNSs may have worse statistical characteristic than PNSs obtained using uniform CAs.On the other hand, experiments with Tomassini and Perrenoud rules show that rules that separately are working worse can provide better quality working collectively.For these reasons rules 153 and some long rules which obtained very good results in general tests but not passed all Marsaglia tests were also accepted for the set of rules to search a final set of rules.In the result of combining rules into sets of rules and testing collective behavior of these sets working in no non uniform CAs the following set of rules has been selected: 86, 90, 101, 105, 150, 153, 165 (r = 1), and 1436965290 (r = 2).Among the rules are 4 rules discovered in [16].The set of found rules have been tested again on statistical and cryptographic tests using non uniform CAs with random assignment of rules to CA cells.Table II presents the results of testing this new set of rules and compares the results with ones obtained for Tomassini and Perrenoud rules.One can see that results of testing both sets on general tests and FIPS 140-2 tests are similar.However, the main difference between these results can be observed in passing Marsaglia test.
The secret key K which should be exchanged between two users of considered CA-based cryptosystem consists of a pair of randomly created vectors: the vector R i informing about assigning 8 rules to N cells of CAs and the vector C(0) describing an initial binary state of CA cells.The whole key space has therefore the size 8 N x 2 N .The key space is much larger than the key space (4 N x 2 N ) of 1D CA-based system [16].Therefore the proposed system is much more resistant for cryptographic attacks.

VI. CONCLUSIONS
CA are an attractive approach for cryptographic applications.They are simple, modular logic systems that can generate good quality pseudorandom bit streams as required in robust cryptographic systems.In the paper we have reported results of the study on applying CAs to the secret key cryptography.The purpose of the study was to discover a set of CA rules which produce PNSs of a very high statistical quality for a CA-based cryptosystem which is resistant on breaking a cryptography key.The main assumption of our approach was to consider non uniform 1D CAs operating with two types of rules.Evolutionary approach called CP was used to discover suitable rules.After discovery of a set of rules they were carefully selected using a number of strong statistical and cryptographic tests.Finally, the set consisting of 8 rules has been selected.Results of experiments have shown that discovered rules working collectively are able to produce PNSs of a very high quality outperforming the quality of known 1D CA-based secret key cryptosystems, which also are much more resistant for breaking cryptography keys that know.

Figure 1 .
Figure 1.1D cellular automata with neighbourhood = 1 90, 105, 150 and 165, which provide high quality PNSs and a huge space of possible secret keys which is difficult for cryptanalysis.Instead to design rules for CAs they used evolutionary technique called cellular programming (CP) to search for them.

Figure 2 .
Figure 2. CP environment for evolution of rules of nonuniform CAs.

1 .
Initiate randomly population of N rules of type 1 (r = 1) or type 2 (r = 2), or both types, and create CAs consisting of N cells 2. Assign kith rule from the CP population to kith cell of CAs 3. for i = 1 . . .C do { create randomly configuration c i of CAs evolve CAs during M time steps evaluate entropy of each PNS } 4. Evaluate fitness function of each rule 5. Apply locally to rules in a specified sequence genetic operators of selection, cross-over and mutation 6.If STOP condition is not satisfied return to 2. www.ijacsa.thesai.org

Figure 3 .
Figure 3.A single run of CP evolutionary process The best scores were achieved by rules 30, 86, 101, 153 and by 8 long rules.Rules 90,105,150 and 65 working separately in uniform CA obtained good results in test of entropy and long runs test, quite good results in serial correlation test and monobit test but were week in X2 test ,poker test, runs test.sultweak in v2 test, poker test and runs test.However this set of rules work-ing collectively in non uniform CAs achieves good results (see, Table 2).For this reason only 10 rules were removed from discovered set of rules which have passed the FIPS 140-2 standard testing.These rules were worse than Tomassini and Perrenoud rules.However passing all statistical tests does not exclude a possibility that the PNS is not suitable for cryptographic purposes.Before a PNS is accepted it should pass special cryptographic tests.Therefore rules which passed tests were next submitted to a set of Marsaglia tests [7]--a set of 23 very strong tests of randomness implemented in the Diehard program.Only 11rules passed all 23 Marsaglia tests.These are short rules 30, 86, 101, and long rules 869020563, 1047380370, 1436194405, 1436965290, 1705400746, 1815843780, 2084275140 and 2592765285.

TABLE II .
COMPARISON OF RULES FOUND BY TOMASSINI AND PERRENOUD [12] AND NEW SET OF DISCOVERED RULES