# A Novel Hybrid Elementary Cellular Automata and Its Application in a Stream Cipher
## 1 Introduction
Hence, they can be used not only for designing the stream cipher based on the LFSR but also to crack the stream cipher [2]. Currently, the stream ciphers without the LFSR sprang up. This kind of stream ciphers can be available against the traditional cryptanalysis for the LFSR. The stream cipher Trivium is based on three nonlinear feedback shift registers (NFSRs) [19]. The linear cryptanalysis is difficult to break the Trivium. However, some novel methods, such as guess-and-determine attacks (GDAs) [15] and cube attacks [20], can easily acquire the internal states of the NFSR or distinguish the keystream generated by the NFSR from the true random sequence. Moreover, the stream cipher Espresso for 5G wireless communication systems is also based on the NFSR [21]. Subsequently, [PERSON] [22] reduces the complexities of the time-memory-data tradeoff (TMDTO) attack for Espresso based on the conditional BSW-sampling resistance of Espresso. The stream cipher based on the mode of block cipher was also proposed by the researchers, such as the ciphertext feedback (CFB) [23] mode and output feedback (OFB) mode [24]. The security of the block cipher in this stream cipher can be proved theoretically. However, the time and space consumption of it is too much. In addition, the widely used stream cipher RC4 is based on the state table driver and permutation. [PERSON] has proved that RC4 possesses a secure flaw [25]. Hence, lots of improved stream ciphers based on RC4 are proposed [26; 27], such as combining with chaotic mapping or other ciphers. However, the inherent security flaw always exists in RC4 [28]. In general, the emergence of the novel attacks, such as GDA, TMDTO, deep learning [29], etc., creates enormous challenges for the stream cipher. Accordingly, a more secure and efficient stream cipher is urgently needed. The elementary cellular automaton (ECA) is the simplest cellular automaton (CA), which was proposed by [PERSON] et al. in 1948 [30]. The ECA with the chaotic transition rule can be considered a nonlinear dynamical system [31]. It possesses some special properties, including long periods, parallel computing, etc. Thus, the ECA is widely utilized to build a random number generator [32; 33; 34]. However, the period of the ECA is limited by the number of cells. Meanwhile, the randomness of the sequences generated by the ECA directly is unqualified. It cannot pass the randomness test proposed by the National Institute of Standards and Technology (NIST) [35]. In addition, the diffusion of the ECA is weak. Hence, relatively few studies use the ECA to construct the stream cipher. Although the stream ciphers combining the chaotic system and CA are proposed [36; 37], the keystream is generated by the chaotic system, not the ECA. The computation complexity of these schemes increases significantly because of the nonlinearity in the chaotic system. Our previous work also proposed a stream cipher based on the spatiotemporal chaotic system and ECA [38]. However, in this scheme, the ECA is only utilized to provide perturbation and is used in coupling. Moreover, only one ECA with a certain chaotic rule is employed in this scheme, and the period is limited. Subsequently, we design a hybrid ECA (HECA) with two different chaotic rules in image encryption [39], which consists of two different ECAs in series. The period is extended significantly in the HECA, but the number of cells always limits its period. The HECA is also only used in perturbation and coupling. The keystream is not generated by the HECA directly because the randomness of the sequences generated by it is weak. Based on the above research, we designed a novel structure based on the HECA, the HECA with dynamic mask (HECA-M), which means that the mask can effectually hide the ECA's iteration patterns of the driving part and change with the iteration of the ECA. Then, we combined the HECA-M with the HASH function to construct a stream cipher. Our main contributions in this paper are listed as follows:  
Firstly, the HECA-M consisting of the driving and mask part is designed.