The cryptography is known as one of most essential ways for protecting information against threats. Among all encryption algorithms, stream ciphering can be indicated as a sample of swift ways for this purpose, in which, a generator is applied to produce a sequence of bits as the key stream. Although this sequence is seems to be random, severely, it contains a pattern that repeats periodically. Linear Feedback Shift Registers and cellular automata have been used as pseudo-random number generator. Some challenges such as error propagation and pattern dependability have motivated the designers to use CA for this purpose. The most important issue in using cellular automata includes determining an optimal set of rules for cells. This paper focuses on selecting optimal rules set for such this generator with using an open cellular learning automata, which is a cellular automata with learning capability and interacts with local and global environments.