# 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
It means that only two states in {\(S_{x,y-1}\), \(S_{x,y}\), \(S_{x,y+1}\), \(S_{x+1,y}\)}, such as (\(S_{x,y-1}\), \(S_{x,y+1}\)) or (\(S_{x,y}\), \(S_{x+1,y}\)), can be determined. Hence, Table 10 cannot be acquired by the enemy. The enemy has to guess the states of other columns, and the states of {\(S_{x,y-1}\), \(S_{x,y}\), \(S_{x,y+1}\)} must cover the states in Table 10 after the guess. As for any row in \(S\), half of the cells have to be guessed. In other words, there are \(2^{128}\) possibilities in a row. However, more than one row should be guessed to derive Table 10. The difficulty is unacceptable for the enemy. To sum up, the proposed stream cipher can resist the GDA. ### Time and Space Consumption

The time and space consumption is essential for estimating the feasibility and efficiency of a stream cipher. We implement the proposed stream cipher in MATLAB R2018a with CPU AMD Ryzen 7 5800H (3.20 GHz) under Windows 11. Meanwhile, no matter how \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \(S_{x,y-1}\), \(S_{x,y}\), \(S_{x,y+1}\) & **111** & **110** & **101** & **100** & **011** & **010** & **000** \\ \hline \(S_{x+1,y}\) & \(b_{7}\) & \(b_{6}\) & \(b_{5}\) & \(b_{4}\) & \(b_{3}\) & \(b_{2}\) & \(b_{1}\) & \(b_{0}\) \\ \(S_{x+1,y}^{*}\) & \(b_{7}^{*}\) & \(b_{6}^{*}\) & \(b_{5}^{*}\) & \(b_{4}^{*}\) & \(b_{3}^{*}\) & \(b_{2}^{*}\) & \(b_{1}^{*}\) & \(b_{0}^{*}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 10: The state transition table acquired by the enemy according to the internal state of the driving part. Figure 13: The process of recovering the internal states of the driving part. KS indicates the keystream, and S denotes the state values of the driving part. A green lattice represents one bit in the keystream, and a blue cycle is one cell in the driving part. long the secret key is (256 bits or 512 bits), the number of the cells in the driving or mask part of HECA-M is always 256. Thus, the time and space consumption of the keystream generators under the secret keys with 256 bits and 512 bits are the same as each other. We utilize the proposed stream cipher to generate the keystream with a length of 1 MB. The average time consumption of one iteration in HECA-M is 2.3966 \(\times\) 10\({}^{-5}\) s. Owing to the parallel iteration of the cells in the HECA-M, one iteration can generate the keystream with 128 bits (16 bytes). Furthermore, the maximum length of the secret key is 512 bits. It is a very small amount of data for the HASH function to process, so the time consumption of this process is negligible. Moreover, the initial value of the HECA-M can be pre-generated by the HASH function before the start of the keystream generation. Hence, the efficiency of the proposed stream cipher is acceptable for the user. In addition to the low time consumption, the space consumption of the proposed scheme is also light. As the core of the keystream generator, the HECA-M consists of the driving and mask parts. These two parts include 256 cells, and each one occupies one bit. Meanwhile, each part requires two storage spaces. One is used in storing the current states of the cells. Another is utilized to store the next states of the cells. Thus, the size of the required space of the HECA-M is 128 bytes. Additionally, the LUT of the chaotic rule groups only needs 27 \(\times\) 3 (81) bytes. This means the keystream generator only occupies 209 bytes, which is smaller than the size of the noted stream cipher RC4 (256 bytes). ## 5 Conclusions

We utilized three elementary cellular automata (ECAs) with different global chaotic rules to construct hybrid elementary cellular automata with the mask (HECA-M). The HECA-M consists of two parts: the driving and mask parts. The number of cells in these two parts is equal to each other. Moreover, the driving part possesses two ECAs with different rules, \(r0\) and \(r1\). Additionally, the rule of the cell in the driving part is determined by the state value of the corresponding cell in the mask part with the rule \(rm\).