Symmetric ciphers are divided into two types: stream ciphers and block ciphers.
Stream ciphers are a pair of encryption and decryption algorithms that encrypt/decrypt every bit (or byte) separately. That is, the result of the encryption of one bit won't affect the manner in which the next bit is encrypted.
This type of a cipher is most suitable for the encryption of plaintext that is generated 'on the fly', such as media streams.
Stream ciphers work as follows:
Notation: for (i = 0, i < n, i++) ciphertext[i] = plaintext[i] ⊕ key[i];