Stream Cipher 101: Definition, Usage & Comparisons

Stream Cipher 101: Definition, Usage & Comparisons

Thousands of businesses across the globe save time and money with Okta. Find out what the impact of identity could be for your organisation.

Stream Cipher 101: Definition, Usage & Comparisons

Learn why Top Industry Analysts consistently name Okta and Auth0 as the Identity Leader

A stream cipher is an encryption technique that works byte by byte to transform plain text into code that's unreadable to anyone without the proper key. 

Stream ciphers are linear, so the same key both encrypts and decrypts messages. And while cracking them can be difficult, hackers have managed to do it.

For that reason, experts feel stream ciphers aren't safe for widespread use. Even so, plenty of people still lean on the technology to pass information through the internet. 

How do stream ciphers work?

All cryptographic methods aim to scramble data to hide it from outsiders. But unlike their counterparts, stream ciphers work on each bit of data in a message rather than chunking the message into groups and encrypting them in blocks. 

Stream ciphers rely on:

  • Plaintext. You must have a message you'd like to encode. 
  • Keystreams. A set of random characters replaces those in the plaintext. They could be numbers, letters, or symbols. 
  • Ciphertext. This is the encoded message. 

Generating a key is a complicated mathematical process. Even so, most computers can push through each step in seconds.

Bits of plaintext enter the stream cipher, and the cipher manipulates each bit with the mathematical formula. The resulting text is completely scrambled, and the recipient can't read it without the proper key. 

With the right key, a recipient can push the ciphertext back through the stream cipher and transform the garbled data back to plaintext. 

There are two main types of stream ciphers, and they each work slightly differently.

Stream ciphers aren't the only tools at your disposal. You could also use block ciphers. Block ciphers break messages down into pieces, and then each piece moves through an encryption algorithm.

How are stream ciphers used?

If you've ever watched a movie about World War II, you've probably seen the power of stream ciphers firsthand. German officials used the technology to send directions to their troops, and it took years for English experts to crack the code. 

The Germans used a complicated machine that looked a bit like a typewriter. A set of 26 lights above the keys made the transformation plain. One light represented a converted letter. They changed the keys regularly, and a push of a button updated the Enigma to tap out notes in the new code. 

An online model lets you tinker with the Enigma (complete with authentic sounds). Tapping out the word "Welcome" on that simula