ELI5: Explain Like I'm 5

Stream cipher

A stream cipher is a way of scrambling information so that it stays secret. To understand how it works, imagine you want to send a secret message to your friend. You both have a secret code that you've agreed on beforehand. Let's say the code is to replace every letter

with the one that comes after it in the alphabet (example: A becomes B, B becomes C, etc.).

Now, you write your message in plain English, but before you send it, you use the code to scramble it up. So, "HELLO THERE" becomes "IFMMP UIFSF." This is called encryption.

But, what if someone intercepts your message before it gets to your friend? They could easily see the scrambled message and figure out what code you used to make it. Then they could unscramble it and read your secret message.

This is where a stream cipher comes in. Instead of using a code that stays the same for the entire message, a stream cipher uses a changing code that is generated on the spot. It's like giving your friend a brand new code for every letter of the message.

For example, let's say the first letter of your message is "H". Your stream cipher generates a random number, let's say "3". Then it uses this number to shift the letter three places down the alphabet. So, "H" becomes "K". The next letter is "E", and the stream cipher generates a new number, let's say "5". This makes "E" become "J", and so on for every letter of the message.

The idea is that no one who intercepts your message can unscramble it because they don't have access to the secret random numbers generated by the stream cipher. Only you and your friend know how the stream cipher works and can use it to encrypt and decrypt messages.

So, in short, a stream cipher is a secret code that changes every time you use it, making it much harder for anyone to read your secret messages.