unit 1 Difference between Block Cipher and Stream Cipher
unit 1 Difference between Block Cipher and Stream Cipher
Block Cipher and Stream Cipher are the types of symmetric key cipher. These two block ciphers
are used to transform plain text into ciphertext. The difference between a Block cipher and a Stream
cipher is that the former transforms the plain text into cipher text by taking the plain text
block by block. On the other hand, a block cipher produces cipher text from plain text by
taking one byte of plain text at a time. In this article, we will see the difference between Block
Cipher and Stream Cipher in detail.
Block Cipher:-
A block cipher encrypts data in fixed-size blocks usually 64 or 128 bits at a time. The
encryption algorithm processes each block of data separately using the cryptographic key to
transform the plaintext into the cipher text. Block ciphers function on complex
mathematical computation and permutation to ensure that the data encrypted is safe. The
choice of block size does not directly affect the strength of the encryption scheme. The
strength of the cipher depends upon the key length. However, any size of the block is
acceptable. The following aspects can be kept in mind while selecting the size of a block:
Avoid very small block sizes, Do not have very large block sizes, and Multiples of 8-bit.
Stream Cipher:-
A stream cipher encrypts data one bit or one byte at a time rather than in fixed-size blocks. It
generates a key stream that is combined with the plaintext to the produce cipher text. Stream
ciphers are made for the scenarios where data needs to be encrypted in the continuous stream
making them suitable for the real-time applications.
It can be categorized into the synchronous, self-synchronizing and one-time pad types. The
Synchronous encryption requires independently generated key stream from both the plaintext
and the cipher text. They have to be in the same state, with the same key, in order to decode the
data properly.
Block cipher uses either 64 bits or more than 64 bits. While stream cipher uses 8 bits.
The complexity of block cipher is simple. While stream cipher is more complex.
Block cipher uses confusion as well as diffusion. While stream cipher uses only confusion.
The algorithm modes which are used in block cipher The algorithm modes which are used in
are ECB (Electronic Code Book) and CBC (Cipher stream cipher are CFB (Cipher Feedback)
Block Chaining). and OFB (Output Feedback).
Suitable for applications that require strong Suitable for applications that require
encryption, such as file storage and internet strong encryption, such as file storage
communications. and internet communications.
Block Cipher Stream Cipher
More secure than stream ciphers when the same key Less secure than block ciphers when the
is used multiple times. same key is used multiple times.
key length is typically 128 or 256 bits. key length is typically 128 or 256 bits.