# Difference between Stream Ciphers and Block Ciphers in Cryptography

This article is about a way of classification of the encryption techniques in which the cipher texts are classified into two types: **The Stream cipher and Block cipher**. In this article, we would be understanding what both these terms stand for and will then mention the **key difference between Stream Ciphers and Block Ciphers**.

Submitted by Monika Sharma, on January 17, 2020

The **Stream ciphers and the Block ciphers** both are a type of encryption technology that differs by how the plain text is converted into ciphertext. It should be noted that both the stream ciphers and the block ciphers are a type of symmetric-key cryptography technique.

The main difference between the two is that in Stream cipher, the plain text is taken letter by letter and is encrypted into the corresponding ciphertext (example: Caeser cipher), whereas, in the block ciphers, we divide the plain text into blocks of fixed size. These blocks are considered at once and encrypted into the corresponding ciphertext.

The following table illustrates the differences between the stream cipher and the block cipher in detail,

## Difference between Stream Cipher and Block Cipher

Characteristic | Stream Cipher | Block cipher |
---|---|---|

Method of encryption(Definiton) |
The plain text is converted into ciphertext by considering the plain text letter by letter. | The plain text is divided into blocks of fixed size. For encryption, one block is considered at a time and is encrypted into ciphertext. |

Length of the plain text |
In the stream cipher, the length of the text is not a major issue as the encryption is done letter by letter. | In the block cipher, the length of the text needs to be of a length so that the blocks of fixed length can be formed. If the length of the plain text does not fit in, padding is done. |

Number of Bits used for encryption and decryption |
Uses 8 bits | Can use blocks of following length: 64 bits, 128 bits, 52 bits, etc. |

Complexity of encryption process |
The complexity of encryption is much higher in stream cipher as compared to block cipher. | Compared to that of a stream cipher, the encryption process of block ciphers is easier to perform. |

Complexity of decryption process |
The process of decryption is easy in stream ciphers. | It is comparatively harder to perform decryption in block ciphers. |

Level of security offered |
The security level offered by stream cipher is quite low as the encryption is hard but the decryption is easy. | The security level offered by block cipher is high, because of the encryption being an easy process and the decryption being the hard one. |

Algorithm modes used in encryption |
ECB: Electronic Code Book CBC: Cipher Block Chaining |
CFB: Cipher Feedback OFB: Output Feedback |

Examples(Encryption techniques) |
Caesar cipher, Vernam cipher, One time pad cipher | DES (Data Encryption Standard), AES (Advanced Encryption Standard), Playfair cipher, Hill cipher |

TOP Interview Coding Problems/Challenges

- Run-length encoding (find/print frequency of letters in a string)
- Sort an array of 0's, 1's and 2's in linear time complexity
- Checking Anagrams (check whether two string is anagrams or not)
- Relative sorting algorithm
- Finding subarray with given sum
- Find the level in a binary tree with given sum K
- Check whether a Binary Tree is BST (Binary Search Tree) or not
- 1[0]1 Pattern Count
- Capitalize first and last letter of each word in a line
- Print vertical sum of a binary tree
- Print Boundary Sum of a Binary Tree
- Reverse a single linked list
- Greedy Strategy to solve major algorithm problems
- Job sequencing problem
- Root to leaf Path Sum
- Exit Point in a Matrix
- Find length of loop in a linked list
- Toppers of Class
- Print All Nodes that don't have Sibling
- Transform to Sum Tree
- Shortest Source to Destination Path

Comments and Discussions

**Ad:**
Are you a blogger? Join our Blogging forum.