Open In App

Stream Ciphers

Improve
Improve
Like Article
Like
Save
Share
Report

In stream cipher, one byte is encrypted at a time while in block cipher ~128 bits are encrypted at a time. Initially, a key(k) will be supplied as input to pseudorandom bit generator and then it produces a random 8-bit output which is treated as keystream. The resulted keystream will be of size 1 byte, i.e., 8 bits. Stream ciphers are fast because they encrypt data bit by bit or byte by byte, which makes them efficient for encrypting large amounts of data quickly.Stream ciphers work well for real-time communication, such as video streaming or online gaming, because they can encrypt and decrypt data as it’s being transmitted.

Key Points of Stream Cipher

  1. Stream Cipher follows the sequence of pseudorandom number stream.
  2. One of the benefits of following stream cipher is to make cryptanalysis more difficult, so the number of bits chosen in the Keystream must be long in order to make cryptanalysis more difficult.
  3. By making the key more longer it is also safe against brute force attacks.
  4. The longer the key the stronger security is achieved, preventing any attack.
  5. Keystream can be designed more efficiently by including more number of 1s and 0s, for making cryptanalysis more difficult.
  6. Considerable benefit of a stream cipher is, it requires few lines of code compared to block cipher.

Encryption

For Encryption,

  • Plain Text and Keystream produces Cipher Text (Same keystream will be used for decryption.).
  • The Plaintext will undergo XOR operation with keystream bit-by-bit and produces the Cipher Text.

Example:

Plain Text : 10011001

Keystream : 11000011

““““““““““`

Cipher Text : 01011010

Decryption

For Decryption,

  • Cipher Text and Keystream gives the original Plain Text (Same keystream will be used for encryption.).
  • The Ciphertext will undergo XOR operation with keystream bit-by-bit and produces the actual Plain Text.

Example:

Cipher Text : 01011010

Keystream : 11000011

“““““““““““

Plain Text : 10011001

Decryption is just the reverse process of Encryption i.e. performing XOR with Cipher Text.

Diagram of Stream Cipher

Diagram of Stream Cipher

Common Stream Ciphers

When someone analyzes stream ciphers in general, they frequently bring up RC4. Thoroughly used, this is the most extensively used stream cipher.

The RC4 cipher operates as follows:

There are many of alternative choices. Wikipedia provides a list of 25 distinct kinds of stream ciphers with a range of costs, speeds, and complexity.

Creating a strong security system involves more than just selecting the appropriate encryption technique. In addition, firewalls, appropriate keyword storage, and staff training are necessary for data protection.

Advantages of Stream Ciphers

Stream ciphers have many advantages, such as:

  • Speed: Generally, this type of encryption is quicker than others, such as block ciphers.
  • Low complexity: Stream ciphers are simple to implement into contemporary software, and developers don’t require sophisticated hardware to do so.
  • Sequential in nature: Certain companies handle communications written in a continuous manner. Stream ciphers enable them to transmit data when it’s ready instead of waiting for everything to be finished because of their bit-by-bit processing.
  • Accessibility: Using symmetrical encryption methods like stream ciphers saves businesses from having to deal with public and private keys. Additionally, computers are able to select the appropriate decryption key to utilize thanks to mathematical concepts behind current stream ciphers.

Disadvantages of Stream Ciphers

  • If an error occurs during transmission, it can affect subsequent bits, potentially corrupting the entire message because stream ciphers rely on previously stored cipher bits for decryption
  • Maintaining and properly distributing keys to stream ciphers can be difficult, especially in large systems or networks.
  • Some stream ciphers may be predictable or vulnerable to attack if their key stream is not properly designed, potentially compromising the security of the encrypted data.

Difference between Stream Cipher and Block Cipher

The symmetric key cipher family includes block ciphers and stream ciphers. The techniques used to transform plaintext in ciphertext are both of these block ciphers and stream cipher. A Block Cipher and a Stream Cipher vary primarily in that a Block Cipher takes one block of plain text at a time and transforms it into ciphertext. While the stream cipher takes one byte of normal text at a time and converts it into cipher text.

Stream Cipher

Block Cipher

By taking one bit of ordinary text at a time, the stream cipher transforms plain text into cipher text.

Block Ciphers Encrypts data in fixed-size blocks.

Used for data-in-transit encryption.

It is basically used for data-at-rest encryption.

It requires low processing power.

It needs high processing power.

It has low computational load.

It requires high computational load.

Stream Cipher cannot operate as a block cipher.

Block ciphers can operate as a stream cipher.

In short, stream ciphers encrypt data bit by byte as it is transmitted, while block ciphers encrypt data of a fixed size at a time.


Last Updated : 29 Mar, 2024
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads