XOR and cipher stream I am new to cryptography and I am very confused. In fact, I am so confused that I have trouble providing a suitable title for my thread...

I know that a Substitution Cipher is designed to substitute one letter or character for another, to produce a ciphertext as shown in the picture below



With most symmetric cipher, the final step is to combine the cipher stream with the plaintext to create a ciphertext using XOR binary logic encryption. 

My question is


why is the plain text, cipher stream and cipher text all in binary?
In the first picture, it is all in letters, now in the second picture, it is all in binary.
Where does the single key from the symmetric cryptography take place?
For #1, binary is used for a number of reasons. First, XOR is a logical operator, so it only operates on bits. Modern computers store everything as bits, too, so that makes XOR convenient.

As for why the first picture is not in bits, that is because no one uses (or at least should) use substitution ciphers such as the one proposed on modern computers. That substitution cipher is extremely insecure. Those sorts of ciphers were typically seen in the pre-computing age, so showing it with an alphabet instead of in bits makes sense. You could, however, show the same graphic with binary text. You'd first have to break up the binary into groups of values (maybe 4 or 5 bits per group) and show a substitution table for the 4 bit values.

For #2, the key is used to produce the cipher stream. That is not shown in the picture.