What are the pros and cons of stream vs block cipher?

653    Asked by AndreaBailey in Cyber Security , Asked on Mar 25, 2022

Encryption algorithms such as Blowfish,AES,RC4,DES and Seal are implemented in one of two categories of ciphers. What are the advantages/disadvantages to the type of ciphers?

Answered by Andrea Bailey

Stream vs block cipher

A block cipher is a versatile algorithm which implements a key-dependent permutation of values which are sequences of a fixed number of bits (called "blocks"). It can be used for various roles in many kinds of cryptographic protocols. One such role is bulk encryption of long streams of data; to achieve such a thing, the block cipher must be used with an appropriate mode of operation (aka "chaining mode"), the traditional one being CBC, and the trendy newer mode being CTR. A stream cipher is a specialised algorithm for the purpose of bulk encryption of long streams of data. The idea is that, by forfeiting the versatility of the block cipher, it would be possible to create a more efficient algorithm (i.e. something which encrypts data faster).

Both block ciphers with a stream-oriented encryption mode, and stream ciphers, may run into security issues if the same key is used twice, for two distinct streams, without having an appropriate, unique/random enough Initialization Vector. For CBC encryption, the IV must be a new uniformly random sequence of bits, of the same size as a block, for each new message. Good stream ciphers also accept an IV. A traditional stream cipher called RC4 is IV-less (its specification does not state where or how an IV could be inserted), which led to much mayhem and gave a bad name to the concept of stream ciphers.

For newer, more secure (and faster) stream ciphers, see the eSTREAM portfolio. These algorithms have gone through a rather thorough analysis by many cryptographers and are considered "quite secure". A stream cipher can be converted into a Pseudorandom Number Generator by encrypting a long sequence of bytes of value zero. Actually, many (but not all) stream ciphers internally work by being a PRNG, generating a long sequence of key-dependent pseudo-random bytes, which is subsequently combined (by bitwise XOR) with the data to encrypt (or decrypt), so encrypting zero bytes is then equivalent to omitting the XOR altogether. Therefore, stream ciphers are often used as custom PRNG.



Your Answer

Interviews

Parent Categories