8

CFB, OFB and other modes are meant for streaming and don't require padding. Are there still limitations such as the text needs to be greater than key length?

Patriot
  • 3,162
  • 3
  • 20
  • 66
m33lky
  • 255
  • 2
  • 6

2 Answers2

5

CFB does require padding unless you use a segment size of 1 bit (or 8 bits if your message is byte oriented). Check Section 5.2 in NIST 800-38A:

For the CFB mode, the total number of bits in the plaintext must
be a multiple of a parameter, denoted s, that does not exceed the
block size

OFB indeed does not require any padding.

There are no other limitations on the plaintext (but read very well the requirements about Initialization Vectors!).

3

These modes do indeed turn a block cipher into a stream cipher. The output will always be a multiple of the block size, but you can easily truncate the last block of output to match the plaintext size, but any size plaintext will work. In that manner, no padding is required.

mikeazo
  • 39,117
  • 9
  • 118
  • 183