Docsity

Cipher Block Chaining (CBC) and Output Feedback (OFB) Modes in Cryptography, Lecture notes of Cryptography and System Security

Partial preview of the text

Download Cipher Block Chaining (CBC) and Output Feedback (OFB) Modes in Cryptography and more Lecture notes Cryptography and System Security in PDF only on Docsity!

Cipher Block Chaining (CBC)

  • message is broken into blocks
  • (^) linked together in encryption operation
  • each previous cipher blocks is chained with current plaintext block, hence name
  • use Initial Vector (IV) to start process
  • uses: bulk data encryption, authentication

• at end of message must handle a possible last short blockMessage Padding

  • which is not as large as block size of cipher
  • pad either with known non-data value (e.g. nulls)
  • (^) or pad last block along with count of pad size
    • eg. [ b1 b2 b3 0 0 0 0 5]
    • means have 3 data bytes, then 5 bytes pad+count
  • this may require an extra entire block over those in message
  • there are other, more esoteric modes, which avoid the need for an extra block

Advantages and Limitations of

CBC

  • a ciphertext block depends on^ all^ blocks before it
  • any change to a block affects all following ciphertext blocks
  • need Initialization Vector (IV)
    • which must be known to sender & receiver
    • if sent in clear, attacker can change bits of first block, and change IV to compensate
    • hence IV must either be a fixed value (as in EFTPOS)
    • or must be sent encrypted in ECB mode before rest of message

OFB as a Stream Cipher

Continued

Figure 8.7 Output feedback (OFB) mode as a stream cipher

Output FeedBack (OFB)

  • message is treated as a stream of bits
  • output of cipher is added to message
  • output is then feed back (hence name)
  • feedback is independent of message
  • can be computed in advance Ci = Pi XOR Oi Oi = DESK1(Oi-1) O-1 = IV
  • uses: stream encryption on noisy channels

In the counter (CTR) mode, there is no feedback. The

pseudorandomness in the key stream is achieved using a

counter.

Counter (CTR) Mode

Figure 8.8 Encryption in counter (CTR) mode

Continued

Figure 8.9 Counter (CTR) mode as a stream cipher

Advantages and Limitations of CTR

  • efficiency
    • can do parallel encryptions in hardware or software
    • can preprocess in advance of need
    • good for burst high speed links
  • random access to encrypted data blocks
  • provable security (good as other modes)
  • but must ensure never reuse key/counter values, otherwise could break (cf OFB)