Networking / Beginners

Stream Ciphers vs. Block Ciphers

Stream ciphers are a special class of ciphers in which the encryption and decryption algorithm is applied to the individual bits or bytes of the plain-text. The algorithm works by combining the plain-text bits or bytes with a pseudo-random bit stream, one bit or byte at a time.

Stream ciphers are especially well suited for encrypting and decrypting the type of data that is used in network communication systems-data in transit. Some examples of a stream cipher algorithm are the RC4 cipher and the A5 algorithm that is used in cellular-based Global System for Mobile (GSM) communications.

Block ciphers are another special class of ciphers that perform their magic on blocks of plain-text instead of individual bits. When necessary, the plain-text can be divided into blocks and the algorithm is applied to the individual blocks.

Block ciphers define different "operating modes." These operating modes serve as a sort of blueprint for the algorithm to perform the actual encryption or decryption. Following are some popular operating modes for block ciphers:

  • Electronic codebook mode (ECB) This mode is quite simple and is also prone to several weaknesses. It relies on the use of a fixed "code" book for encrypting data blocks. The fact that a given plain-text and key combination will always yield the same cipher-text is one of its weaknesses.
  • Cipher-block chaining mode (CBC) This mode operates by using (or chaining) the cipher-text extracted from the preceding block to encrypt the next block of data. This is probably the most popular and widely used mode of operation for block ciphers.
  • Counter mode (CM) This mode operates by using an initialization vector (IV) counter that increments for every block of plain-text to be converted to cipher-text. Block ciphers that operate in this mode are generally very fast in executing.
  • Output feedback mode (OFB) This mode is best suited for encrypting smaller chunks of plain-text at a time, because it can emulate the behavior of stream ciphers.
[Previous] [Contents] [Next]