Difference between Block Cipher and Stream Cipher | Stream Cipher vs Block Cipher

Symmetric encryption ciphers consist of two main categories: block ciphers and stream ciphers. Block and stream ciphers are two ways that you can encrypt data.


Stream Cipher:

A stream cipher is an encryption algorithm that encrypts 1 bit or byte of plaintext at a time. A stream cipher breaks a plaintext message down into single bits, which then are converted individually into ciphertext using key bits.

Stream ciphers fall under the symmetric encryption category. Thus, using stream ciphers the sender and the recipient of the data use the same key to encrypt and decrypt the data. 


Encryption Steps:


1. For encryption, plain text and keystream are required.

2. The plain text and keystream produce ciphertext using XOR Operation.

3. Plain text is XOR’ed with keystream bit by bit to produce CipherText.


Example:


Plain Text: 10110110        

Keystream:01010101       

            ———————

Ciphertext: 11100011



Decryption Steps:

1. For decryption, ciphertext and the same keystream are required which was used for encryption.

2. The ciphertext and the keystream produce plain text using XOR Operation.

3. The ciphertext is XOR’ed with keystream bit by bit to produce PlainText.


Example:


Ciphertext: 11100011

Keystream: 01010101

———————- 

Plain Text: 10110110






Popular Stream Ciphers:

RC4:

RC4, which stands for Rivest Cipher 4, is the most widely used of all stream ciphers, particularly in software. It's also known as ARCFOUR or ARC4. RC4 steam chiphers have been used in various protocols like WEP and WPA (both security protocols for wireless networks) as well as in TLS. Unfortunately, recent studies have revealed vulnerabilities in RC4, prompting Mozilla and Microsoft to recommend that it be disabled where possible. In fact, RFC 7465 prohibits the use of RC4 in all versions of TLS.

These recent findings will surely allow other stream ciphers (e.g. SALSA, SOSEMANUK, PANAMA, and many others, which already exist but never gained the same popularity as RC4) to emerge and possibly take its place.



Block Cipher:

Block cipher is an encryption and decryption method which operates on the blocks of plain text, instead of operating on each bit of plain text separately. Each block is of equal size and has fixed number of bits. The generated ciphertext has blocks equal to the number of blocks in plaintext and also has the same number of bits in each block as of plain text. Block cipher uses the same key for encryption and decryption. The usual sizes of each block are 64 bits, 128 bits, and 256 bits. So for example, a 64-bit block cipher will take in 64 bits of plaintext and encrypt it into 64 bits of ciphertext. A block cipher breaks down plaintext messages into fixed-size blocks before converting them into ciphertext using a key.

In cases where bits of plaintext is shorter than the block size, padding schemes are called into play. Majority of the symmetric ciphers used today are actually block ciphers. DES, Triple DES, AES, IDEA, and Blowfish are some of the commonly used encryption algorithms that fall under this group.




Popular Block Ciphers:

DES:

DES, which stands for Data Encryption Standard, used to be the most popular block cipher in the world and was used in several industries. It's still popular today, but only because it's usually included in historical discussions of encryption algorithms. The DES algorithm became a standard in the US in 1977. However, it's already been proven to be vulnerable to brute force attacks and other cryptanalytic methods. DES is a 64-bit cipher that works with a 64-bit key. Actually, 8 of the 64 bits in the key are parity bits, so the key size is technically 56 bits long.


3DES:

As its name implies, 3DES is a cipher based on DES. It's practically DES that's run three times. Each DES operation can use a different key, with each key being 56 bits long. Like DES, 3DES has a block size of 64 bits. Although 3DES is many times stronger than DES, it is also much slower (about 3x slower). Because many organizations found 3DES to be too slow for many applications, it never became the ultimate successor of DES.


AES:


A US Federal Government standard since 2002, AES or Advanced Encryption Standard is arguably the most widely used block cipher in the world. It has a block size of 128 bits and supports three possible key sizes - 128, 192, and 256 bits. The longer the key size, the stronger the encryption. However, longer keys also result in longer processes of encryption.

Block Cipher and Stream Cipher Differences:


Block Cipher

Stream Cipher

Block Ciphers converts plain text to cipher text by taking a block at a time

Stream Ciphers converts plain text to cipher text by taking 1 byte of plain text at a time

Block Ciphers encrypt 64 bits or more at a time

Stream Ciphers encrypt 8 bits at a time.

It is more simple than Stream Ciphers

It is more complex than Block Ciphers

It uses confusion as well as diffusion.

It uses only confusion.

Reverse Encryption is harder

Reverse Encryption is very simple

Slower than stream cipher

Faster than block cipher

It works on transposition techniques like Caesar cipher, polygram substitution cipher etc.

It works on substitution techniques like rail-fence technique, columnar transposition technique etc.

 


Block Cipher Design Principles:

Block ciphers are built in the Feistel Cipher Structure. Block cipher has a specific number of rounds and keys for generating ciphertext. A block cipher is designed on the following three principles:

  • Number of Rounds
  • Design of Function F
  • Key Schedule Algorithm

 

Number of Rounds: This block cipher design principle indicates the overall strength of the ciphering algorithm.  the more the number of rounds, the greater is the strength of the block cipher It is considered that more is the number of rounds, difficult is for cryptanalysis to break the algorithm.

It is considered that even if the function F is relatively weak, the number of rounds would make the algorithm tough to break.

Simultaneously, a higher number of rounds can also make the encryption and decryption process slow and inefficient.

 

Design of Function F: The core part of the Feistel Block cipher structure is the Round Function. The complexity of cryptanalysis can be derived from the Round function i.e. the increasing level of complexity for the round function would be greatly contributing to an increase in complexity.

To increase the complexity of the round function, the avalanche effect is also included in the round function, as the change of a single bit in plain text would produce a mischievous output due to the presence of avalanche effect.


Key Schedule Algorithm: The key schedule algorithm calculates the round keys.  In Feistel Block cipher structure, each round would generate a sub-key for increasing the complexity of cryptanalysis. The Avalanche effect makes it more complex in deriving sub-key. Decryption must be done very carefully to get the actual output as the avalanche effect is present in it.



Avalanche Effect:

In cryptography, the avalanche effect is a desirable property of any encryption algorithms wherein a small change in either the plaintext or the key should produce a significant change in the ciphertext. In particular, a change in one bit of the plaintext or one bit of the key should produce a change in many bits of the ciphertext.

In simple words, it quantifies the effect on the cipher-text with respect to the small change made in plain text or the key. 




Post a Comment

0 Comments