# Chaos Based Cryptographic Pseudo-Random Number Generator Template with Dynamic State Change +
## 2 New Generator Design  
As a modification to the first version of the generator [16] which only used one chaotic map, the generalized Henon map, and never altered the internal states other than by simply computing the map's formula, the second version [32] added a block that accumulates the values of all intermediate states, gathering entropy. This block was named _entropy builder_. Once every \(n\) iterations (where \(n\) is a parameter of the generator called the _parameter change interval_ in the rest of the paper) the accumulator was used to change the map's parameters according to (2). In the current paper we introduce the third version of the generator along with a C++ implementation, where the generator map as well as the entropy builder are configurable. An advantage of this approach is that the system is modular and flexible, allowing configuration with any chaotic map and with several algorithms for building entropy. Also, selecting particular configurations will yield high throughput performance, as other configurations will increase the quality of the random sequence. The block diagram is presented in Figure 5 where the green blocks are parameterized and the byte generator block is depicted in Figure 1.  
\[a = E\mod 2.0\] \[b = E\mod 0.6-0.3 \tag{2}\]  
Figure 4: The largest Lapunov exponents for \(b=0.1\), \(a\in[1.35;1.8]\). \(\lambda_{1}\) in blue, \(\lambda_{2}\) in red, for different computation steps. Each chaotic map (see Figure 5) has a number of parameters, \(||P||\), and a number of states \(||S||\). As an example, the 3D generalized Henon has two parameters denoted by \(P=(a;b)\) and three states denoted by \(S=(x;y;z)\). Every iteration, the entropy builder takes tuples of \(||S||\) values (the current state values) and accumulates entropy. Every \(n\) iterations it also provides a tuple of \(||P||\) values that replaces the current parameter set of the map. The entropy builder and the chaotic map have to match the same \(||P||\) and \(||S||\) to obtain a valid configuration. A general form for a three-dimensional map is given in (4). \[x^{+} = y\] \[y^{+} = z \tag{3}\] \[z^{+} = f(x,y,z)\]  
The maps tested in this paper include the 3D Henon and all maps presented in [34] and given in Table 2. The formula in row 13 is the generic form of the chaotic map used. As entropy builders, besides the initial sum approach, named \(E_{1}\), one more design was added, \(E_{2}\), both given in (4). Since there are two parameters involved in the computation of the 3D generalized Henon map, a third approach was to use a combination of both \(E_{1}\) and \(E_{2}\), one for each of the parameters, with good results. \[E_{1} = E_{1}+x_{k}+y_{k}+z_{k}\] \[E_{2} = E_{2}+sin((z_{k}-y_{k})/2) \tag{4}\] \begin{table}
\begin{tabular}{l c c} \hline \hline
**ID** & **Maps** & **Cases** \\ \hline
1 & \(x_{k}-x_{k}\cdot y_{k}+x_{k}\cdot z_{k}+0.5\) & \(NFI_{1}\) \\
2 & \(x_{k}+x_{k}{}^{2}+z_{k}{}^{2}-2\cdot x_{k}\cdot y_{k}-0.2\) & \(NFI_{2}\) \\
3 & \(1.7\cdot x_{k}-0.7\cdot z_{k}+z_{k}{}^{2}-x_{k}\cdot y_{k}-0.3\) & \(NFI_{3}\) \\
4 & \(1.07\cdot x_{k}-0.07\cdot z_{k}-x_{k}\cdot y_{k}+x_{k}\cdot z_{k}+0.28\) & \(NFI_{4}\) \\
5 & \(x_{k}+0.2\cdot x_{k}{}^{2}+0.8\cdot y_{k}{}^{2}-x_{k}\cdot z_{k}-0.1\) & \(NFI_{5}\) \\
6 & \(x_{k}+0.19\cdot x_{k}{}^{2}-0.22\cdot z_{k}{}^{2}+0.03\cdot y_{k}\cdot z_{k}+0.03\) & \(NFI_{6}\) \\
7 & \(-z_{k}+x_{k}\cdot y_{k}+y_{k}\cdot z_{k}+1\) & \(NFII_{1}\) \\
8 & \(x_{k}-0.2\cdot z_{k}{}^{2}+0.3\cdot x_{k}\cdot y_{k}+1\) & \(NFII_{2}\) \\
9 & \(-z_{k}{}^{2}+0.7\cdot x_{k}\cdot y_{k}+x_{k}\cdot z_{k}+0.7\) & \(NFII_{3}\) \\
10 & \(-y_{k}-0.1\cdot x_{k}\cdot y_{k}+x_{k}\cdot z_{k}+1.2\) & \(NFII_{4}\) \\
11 & \(0.9\cdot x_{k}-z_{k}+0.7\cdot x_{k}\cdot y_{k}+0.9\) & \(NFII_{5}\) \\
12 & \(0.35\cdot z_{k}{}^{2}-0.57\cdot x_{k}\cdot y_{k}-1.27\) & \(NFII_{6}\) \\
13 & \(a_{0}x_{k}+a_{1}y_{k}+a_{2}z_{k}+a_{3}x_{k}^{2}+a_{4}y_{k}^{2}+a_{5}z_{k}^{2}+ a_{6}x_{k}y_{k}+a_{7}x_{k}z_{k}+a_{8}y_{k}z_{k}+a_{9}\) & \(NF_{\text{\it\_GEN}}\) \\ \hline \hline \end{tabular}
\end{table}