intro. A stream cipher encrypts bits individually
For the th bit:
encrypt:
decrypt:
why it works, because mod(2) addition and substraction are the same operation! (it is also the same as XOR (see Modulo 2 arithmetic)
how do we generate the key, which has to be shared between sender and receiver (Symmetric cryptosystem). They should be random, using a Random number generator
The One time pad is an Unconditionally secure stream cipher