Cryptography - Stream Cipher vs Block Cipher



Stream ciphers and Block ciphers are variants of symmetric key ciphers and are essentially used for encryption. It is converting (plaintext to ciphertext) more direct services must be used most of the time.

Understanding this chapter would enable you knows what stream ciphers are made of and why they do not resemble block ciphers.

What is Stream Cipher?

A stream cipher is an encryption method that combines a pseudorandom cipher digit stream with plain text digits. This pseudorandom encryption digit stream is applied one bit at a time to each binary digit. This encryption method employs an endless amount of pseudorandom cipher digits for each key.

  • A stream cipher employs a key-based algorithm to encrypt an arbitrary amount of plain text one bit at a time.
  • The pseudorandom cipher numbers should be unpredictable, and the key should never be used more than once for this type of encryption to be secure.
  • The pseudorandom cipher digits are created using digital shift registers and several random seed values.
  • Stream cipher is also known as State cipher. The name "state cipher" comes from the fact that each number's encryption depends on the current state of the cipher.
  • The RC4 stream cipher is widely used in the software.

With a properly designed pseudorandom number generator, a stream cipher can be as safe as a block cipher of equal key length. The main advantage of a stream cipher is that it uses far less code and it is faster than block ciphers.

What is Block Cipher?

A block cipher is a symmetric cryptographic method that encrypts a fixed-size data block using a shared, secret key. Plaintext is used during the encryption process, and the encrypted text that comes is called ciphertext. The same key is used to encrypt both the plaintext and the ciphertext.

Data blocks of a fixed size are processed by a block cipher. A message's size usually is greater than the block size. As a result, the long message is split up into a number of consecutive message blocks, each of which is processed separately by the cipher.

A block cipher encrypts and decrypts its input one block at a time, rather than one bit at a time, using a shared secret key. Padding is unnecessary because the block's size is set. This algorithm is symmetric. Encryption uses a common key to convert textual input into cyphertext (encrypted text). During decryption, it uses the same key to transmit the cyphertext back into the original plaintext. The length of the input and the output are identical.

  • The block cipher algorithm (AES) is commonly known under the names Data Encryption Standard (DES), TripleDES, and Advanced Encryption standard.
  • A stream cipher is the inverse of a block cipher working on its input bit by bit using a shared key.
  • Asymmetric or public-key cryptography are alternatives to block ciphers. This approach encrypts the plaintext with a public key and decrypts the ciphertext using a private key.

There are different modes of operation of a block cipher −

  • Electronic Code Book (ECB) Mode
  • Cipher Block Chaining (CBC) Mode
  • Cipher Feedback (CFB) Mode
  • Output Feedback (OFB) Mode
  • Counter (CTR) Mode

These modes are a general block cipher's rules of operation. It is interesting to note that the various modes create different features that increase the block cipher's overall security.

Difference between Block Cipher and Stream Cipher

The below table shows the major differences between a block cipher and a stream cipher −

Key Block Cipher Stream Cipher
Definition Block Cipher is the type of encryption where the conversion of plaintext is performed by taking its block at a time. Stream Cipher is the type of encryption where the conversion of plaintext is performed by taking one byte of the plaintext at a time.
Conversion of Bits Since Block Cipher converts blocks at a time, it converts a more significant number of bits than Stream Cipher, which can convert 64 bits or more. In the case of Stream Cipher, however, only 8 bits can be transformed at a time.
Principle Block Cipher uses both "confusion" and "diffusion" principle for the conversion required for encryption. Stream Cipher uses only confusion principle for the conversion.
Algorithm For encryption of plain text Block Cipher uses Electronic Code Book (ECB) and Cipher Block Chaining (CBC) algorithm. Stream Cipher uses CFB (Cipher Feedback) and OFB (Output Feedback) algorithm.
Decryption As a combination of more bits get encrypted in case of Block Cipher, so the reverse encryption or decryption is comparatively complex as compared to that of Stream Cipher. Stream Cipher uses XOR for the encryption which can be easily reversed to the plain text.
Implementation Feistel Cipher is the most common Block Cipher implementation. The main implementation of Stream Cipher is Vernam Cipher.

Summary

Block ciphers are used to encrypt and decrypt data which operates in pre defined and fixed sizes using one key unlike the stream cipher that does so bit by bit. In confusion and diffusion, block ciphers use techniques such as ECB and CBC. On the other hand, Stream ciphers operate on fewer bits, and they only rely on confusion; they generally use XOR-operation for the encryption.

Advertisements