Stream ciphers work by using a combination of plaintext data, an encryption key, and a nonce. It is usually just a random number, but it can also come from plaintext data or another source that is typically outside the scope of what is being encrypted. Encryption algorithms operate on a bit-by-bit or block-by-block basis; however, stream ciphers use a variable amount of bits at any given time. This allows for the encryption to continue bit by bit as each new plaintext byte comes in.