InnocentZero's Treasure Chest

HomeFeedAbout MeList of interesting people

24 Oct 2025

Encryption Modes

encryption modes

Modes of encryption

ECB mode

  • Each plaintext block is independently encrypted.

CBC mode

  • Input to the algorithm is the XOR of the next block of plaintext and the preceding block of ciphertext.

Cipher Feedback (CFB)

  • Input is processed s < b bits at a time.
  • Preceding ciphertext is used as input to the algo.
  • XORed with the current plaintext to produce the next block of ciphertext.

Output Feedback (OFB)

  • Input to the algorithm is the preceding enc output, not the XORed ciphertext.
  • Full blocks are used.

Counter (CTR)

  • Each block of plaintext is XORed with an increasing counter.

Metrics for modes

  • Encryption in parallel?
  • Decryption in parallel?
  • One plaintext block influencing multiple ciphertext blocks?
  • Repeating a block leading to same ciphertext?
  • Is only encryption needed for both enc and dec?
  • Any other secret info needed to be shared?

ECB

Advantages:

  • Parallel computation

Disadvantages:

  • Same plaintext blocks lead to same ciphertext blocks
  • Both algorithms needed

CBC

Advantages:

  • Parallel decryption
  • Plaintext blocks affect the succeeding blocks as well

Disadvantages:

  • IV must be securely transmitted and be unpredictable
  • Enc can only be serial
  • Both algorithms needed

CFB

Advantages:

  • Parallel decryption
  • Only encryption is needed
  • Plaintext blocks affect the succeeding blocks as well

Disadvantages:

  • IV must be securely transmitted and be unpredictable
  • Enc can only be serial

OFB

Advantages:

  • Parallel encrpytion/decryption
  • Only encryption is needed
  • Precomputation using IV/enc is possible.

Disadvantages:

  • A plaintext block cannot affect multiple ciphertext blocks
  • IV/nonce must be securely transmitted and be unpredictable

CTR

Advantages:

  • Parallel encrpytion/decryption
  • Only encryption is needed
  • Precomputation using IV/enc is possible.

Disadvantages:

  • A plaintext block cannot affect multiple ciphertext blocks
  • IV/nonce must be securely transmitted and be unpredictable

Other posts
Creative Commons License
This website by innocentzer0 is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.