block cipher
modes of operation

Modes of Operation in Block Cipher

Block cipher is a structure which considers block of plaintext as a whole and produces a ciphertext of equal length. Typically, it uses block size of 64 bit or 128 bits.

For instance, DES or AES, Triple DES, Feistel Cipher are examples of block cipher.

block cipher

Moreover, to apply a block cipher to a variety of applications, it uses five modes of operations. Let’s take a look at these modes.

  1. Electronic Code Book (ECB)
  2. Cipher Block Chaining (CBC)
  3. Cipher Feedback (CFB)
  4. Output Feedback (OFB)
  5. Counter (CTR)

Working of Block Cipher Modes

Electronic Code Book

Firstly, in ECB Mode plaintext handles one block at a time and same key is used to encrypt each block of plaintext. In addition, the term code book means for given key, there is unique ciphertext for every b bit block of plaintext.

It is useful in secure transmission of short pieces of information. For instance, temporary encryption key.

Moreover, this mode has some weaknesses. If repetitive elements are there, analyst can easily identify them.

Cipher Block Chaining

CBC is a technique in which if plaintext block repeats itself, it produces different ciphertext blocks. In addition, in this technique, input to the encryption algorithms is XOR of current plaintext block and preceding ciphertext block.

Each block uses same key. Moreover, to produce first block of ciphertext, an Initialization Vector (IV) is XOR with first block of plaintext.

On decryption, this IV is XOR’ed with output of decryption algorithm to recover plaintext block.

It is useful in authentication and general purpose block oriented transmission. Similarly, because of chaining mechanism, it is appropriate for larger length of messages.

Cipher Feedback Mode

In CFB, the leftmost significant s bits of output of encryption function are XOR with the first segment of plaintext. It produces plaintext P1 to produce the first unit of ciphertext C1.

Moreover, the b bit shift register is initially set to some value of IV.

For decryption, resultant ciphertext unit is XOR with output of encryption function to produce plaintext unit.

Output Feedback Mode

In OFB, the output of the encryption function passes to input for encryption of the next block of plaintext. Moreover, OFB mode operates on full blocks of plaintext and ciphertext.

In OFB encryption, each bit in ciphertext is independent of the previous bits. This avoids error propagation.

Nonce : A time varying value that has at most a negligible chance of repeating. For instance, a random value, a time stamp etc.

Counter Mode

Firstly, CTR uses a counter equal to the length of plaintext block. The counter value is different for each plaintext block. Typically, counter is set to some value and then incremented by 1 for each subsequent block.

Moreover, one main advantage of using CTR is that encryption and decryption can be done in parallel. It is also fastest.

Comparision table of block cipher modes

Operation ModeDescriptionType of Result
ECBEach n-bit encryption independently with same keyBlock Cipher
CBCSimilar to ECB but each block XOR with previous ciphertextBlock Cipher
CFBEach s-bit block XOR with s-bit key that is part of previous ciphertextStream Cipher
OFBSimilar to CFB but shift register is updated by previous s-bit keyStream Cipher
CTRSimilar to OFB but a counter is used instead of nonceStream Cipher


In conclusion, we have seen all five modes of operation in block cipher. Moreover, we have learnt about its application and its comparision.

About the author

Drishti Patel

View all posts
0 0 vote
Article Rating
Notify of
Inline Feedbacks
View all comments