We are independent & ad-supported. We may earn a commission for purchases made through our links.
Advertiser Disclosure
Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.
How We Make Money
We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently of our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.
Security

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

What is a Stream Cipher?

By S.A. Keel
Updated: May 16, 2024

A stream cipher is a type of algorithm used in data encryption where the source that needs to be encrypted is processed against a key sequence that appears random. This type of cipher is somewhat flexible in the sense that it may vary the encryption as the text is being processed. They are also sometimes referred to as a state cipher because encryption also depends on the current state of the operation. In contrast to block ciphers, which work on chunks of data 64 bits at a time, a stream cipher can operate on a single bit. For this reason, a stream can be processed at high speeds with very little processing power.

The first stream cipher was devised by Gilbert Vernam in 1917. Vernam later also helped create a cipher known as the one-time pad, which is a form of stream cipher that uses a one-time key to encrypt the data. In a one-time pad, the key generated is the same length as the data that needs to be encrypted, is completely random, and is never used again anywhere else, hence the name.

When processed against the data to be encrypted, typically referred to as plaintext, the resultant ciphertext is impossible to decrypt without the key. The one-time pad is difficult to deal with in most scenarios, and is, therefore, only used for very exclusive situations. Still, a stream cipher is usually considered useful, so the keys were shortened and made pseudorandom, meaning they are statistically random but in reality are not.

Stream cipher has the ability to encrypt on the fly. In this way, it is even easy for simple stream ciphers to be performed by people on pen and paper, whereas a block cipher typically requires the use of a computer to process. The plaintext flows through the encryption process along with the keystream, the pseudorandom sequence that makes up the key, where it is converted and comes out the other end as ciphertext.

Usually, this encryption happens via an exclusive-or (XOR) operation on the individual bits as they pass through the cipher. A simple XOR cipher uses a type of logical disjunction as its basis, which essentially says that the result can be true if either operand is true, but not both. For example, if a bit moving through the encryption process is a zero or a one, and the paired keystream bit doesn't match, the resultant output is a one. If the bit and paired keystream bit do match, where both are a one, or both are a zero, the result is a zero. The encrypted stream of ones and zeros are then decrypted on the other end of the transmission using the same keystream to convert the bits back into their original plaintext.

There are two types of stream cipher. Using a synchronous method, the keystream is created separate from the plaintext or the ciphertext and then merged to provide the encryption or decryption. With this method, both the sending and receiving ends of the transmission must remain synchronized where they are operating on the same key and the same position in the key. Should a problem occur, the decryption either needs to start over, or there may be flags placed intermittently throughout the ciphertext that indicate new starting points. A self-synchronizing cipher, on the other hand, will update the keystream based on some number of previous digits in the ciphertext.

One of the most frequently used stream cipher, called RC4, was created by RSA Data Security®. It is licensed for and used in a number of software products, as well as the secure socket layer (SSL) protocol used in secure Internet communications and the wired equivalent privacy (WEP) encryption used with wireless devices. Another often used cipher is known as ORYX, which has found use in cellular telephone data transmissions that need to be encrypted. IBM® has also developed an stream encryption method known as SEAL, which has found use in hard disk encryption.

EasyTechJunkie is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.
Discussion Comments
By Logicfest — On Dec 08, 2014

@Markerrag -- Encryption was a major problem because of the issues you mentioned before the advent of computers. Thanks to computers, it is much easier to encrypt and decode things.

Ever heard banks brag about 128-bit encryption to keep your data safe when you are banking online? That 128-bit method is just a very complex form of encryption that can be encoded and decoded quickly by a computer that has the proper information.

Of course, things are not foolproof. It is still very possible for someone to grab information not meant for them and decrypt it. Still, it is harder to break codes than it was before computers become dominant.

By Markerrag — On Dec 07, 2014

This whole article points out the problem with encryption in general. In the example where you have the "one key, one time" system, dealing with that can be difficult. How do you get the key to the person who is supposed to decrypt it?

Otherwise, it can be far too easy for someone to intercept a key and encrypt messages all day long. We saw the Allies do just that during World War II and that kept them ahead of the Axis powers (of course, the Axis may have intercepted some Allied keys but we don't hear much about that).

Share
https://www.easytechjunkie.com/what-is-a-stream-cipher.htm
EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.

EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.