# A Novel Hybrid Elementary Cellular Automata and Its Application in a Stream Cipher
## 4 Stream Cipher Based on HECA-M
### Description of Proposed Stream Cipher

Table 7: NIST SP800-22 test results of different stream ciphers (the red number is below 0.01). quent sequence (\(s_{t}\), \(s_{t+1}\), \(s_{t+2}\), \(s_{t+3}\),...) in the keystream. The sequence's linear complexity and minimal polynomial with \(n\) bits can be expressed as \(<\!\!l_{n},f_{n}\!\!>\). Compare the derived sequence from Equation (8) and the practical sequence. If the forecast accuracy of the derived sequence is far from 0.5, the distinguishing attack is successful. It means that the keystream generated by the stream cipher is significantly different from the randomness sequence, and the stream cipher possesses the concealed defect. The keystreams with length \(n=1\), 2, 3,..., 2000 bits generated by the proposed stream ciphers under different chaotic rule groups are analyzed by the B-M synthesis. Then, the pairs \(<\!\!l_{1},\!\!l_{1}\!\!>\), \(<\!\!l_{2},\!\!f_{2}\!\!>\), \(<\!\!l_{3},\!\!f_{3}\!\!>\),..., \(<\!\!l_{2000},\!\!f_{2000}\!\!>\) are acquired. The minimal polynomial \(f_{4}\), \(f_{8},f_{12}\),...,\(f_{2000}\) is utilized to predict subsequent keystreams. The forecast accuracy for the keystream is shown in Figure 8.

In Figure 8, the \(X\)-axis indicates the keystream length from which a minimal polynomial is deduced. The \(Y\)-axis represents the forecast accuracy under the above minimal polynomial. As shown in Figure 8, the accuracy is close to 0.5 under any chaotic rule group, no matter how long the keystream for the B-M synthesis is. Thus, it can be preliminarily judged that the proposed cipher can resist the distinguishing attack. In order to confirm this judgment, the \(t\)-test is introduced to determine whether the randomness of the keystream generated by the proposed scheme can be distinguished from the true random sequence. We assign the mathematical expectation equal to the ideal value 0.5, and the significance level \(\alpha\) is 0.01. If \(p\)-value \(>\) 0.01, the \(t\)-test does not reject the null hypothesis that the accuracy comes from a normal distribution with a mean of 0.5 at the 1% significance level. The test results are listed in Table 8.

In Table 8, no matter what the chaotic rule group is, the forecast accuracy is regarded as the data come from a normal distribution with a mean of 0.5, which is an ideal value for a truly random sequence. Thus, the distinguishing attack proves ineffective in analyzing the proposed stream cipher. Figure 7: The linear complexity of keystreams generated by the proposed stream ciphers under different HECA-Ms. The lines with different colors denote the ciphers with varying chaotic rule groups. The numbers in the legend represent the indexes of the chaotic rule groups in LUT (Table 5). Figure 8: The forecast accuracy for the keystreams generated by the proposed stream ciphers. The lines with different colors denote the ciphers with different chaotic rule groups. The numbers in the legend represent the indexes of the chaotic rule groups in LUT (Table 5). \begin{table}
\begin{tabular}{c c c} \hline \hline
**Index of the Chaotic Rule Group** & \(\mathbf{p}\)**-Value (>0.01)** & **PASS or NOT** \\ \hline



\hline \hline \end{tabular}
\end{table} 
Table 8: \(t\)-test results of the forecast accuracy under the minimal polynomial acquired by the B–M synthesis. 4. Key space and period

The length of a secret key given by the user is 256 or 512 bits. Furthermore, the SHA-512 possesses good diffusion. Specifically, if one bit of the input is flipped, close to 50% bits of the output will change in the SHA-512. Hence, the existence of the constant vector can avoid the weak initial value of the HECA-M. In other words, if a weak initial value is acquired by the secret key, we can flip any bit of the constant vector \(\mathbf{IV}\) to change the output of the SHA-512, which is the initial value of the HECA-M. In summary, there is no weak key in the proposed stream cipher. Thus, the key space of it is \(2^{256}\) or \(2^{512}\). It means that the proposed stream cipher can resist the brute force attack.