Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

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

The concepts of Cipher Block Chaining (CBC) and Output Feedback (OFB) modes in cryptography. CBC is a method of linking together encryption operations, where each plaintext block is chained with the previous ciphertext block. OFB, on the other hand, treats the message as a stream of bits and adds the output of the cipher to the message, which is then fed back as input. Both modes have their advantages and limitations, such as the need for an Initial Vector (IV) in CBC and the vulnerability to message stream modification in OFB.

Typology: Lecture notes

2020/2021

Uploaded on 04/28/2021

jugal-shah
jugal-shah 🇮🇳

1 document

1 / 13

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf3
pf4
pf5
pf8
pf9
pfa
pfd

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)