Safekipedia

Stream cipher

Explorer · ages 7 and underAdapted from Wikipedia
A Lorenz Cipher Machine, an historic encryption device used during World War II, now on display in a museum.

Stream Cipher

A stream cipher is a special way to keep messages secret. It uses a secret key to hide what we say or write.

It works by mixing each tiny part of the message, called plaintext, with a changing series of numbers. These numbers are known as the keystream. The mixing happens one part at a time, using a process called exclusive-or, or XOR for short.

The keystream looks random. It starts from a seed value, which acts like the secret key. This seed helps make the numbers needed to hide the message.

Stream ciphers are often faster and simpler to use, especially in small devices that don’t have much power. They are different from another way of hiding messages called block ciphers. Block ciphers work on bigger chunks of data all at once.

Stream ciphers are based on a very strong way to hide messages called the one-time pad. The one-time pad was proven safe by Claude E. Shannon in 1949. But it is hard to use because the random numbers must be as long as the message and can only be used once.

Stream ciphers use a smaller key, like 128 bits, to make a pattern of numbers that looks random. This pattern is mixed with the message, like the one-time pad. Because the pattern is not truly random, it might not be as safe and can sometimes be figured out.

Stream ciphers are great for secure wireless connections where the amount of data isn’t known ahead of time. They work quickly and are easy to build, especially in small devices. They can start protecting the data right away, without waiting to see the whole message first.

Pictures

Diagram showing a nonlinear combination generator used in cryptography and engineering.

This article is a child-friendly adaptation of the Wikipedia article on Stream cipher, available under CC BY-SA 4.0.

Images from Wikimedia Commons. Tap any image to view credits and license.