We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

State Ciphers

Stream ciphers are also referred to as "state ciphers" because the encryption and decryption of each character depends on the current state of the cipher.

"Current state" just means the "current progress", that is, how many bytes we've already encrypted or decrypted so far.

For example, let's take the following data for a one-time pad cipher:

plaintext = "010011"
key       = "101001"

When the "state" of the cipher is at index 0, we will only have encrypted the first digit:

plaintext = "010011"
key       = "101001"

state     = index 0
result    = "1"

state     = index 1
result    = "11"

state     = index 2
result    = "111"

state     = index 3
result    = "1110"

state     = index 4
result    = "11101"

state     = index 5
result    = "111010"