Bob
Bob

Reputation: 13

Please comment on data size of cipher block chaining (CBC) in symmetric encryption

I am considering to use CBC to encrypt a block of data. Dose it make a sense to use CBC if the data to be encrypted is smaller than 2 blocks ? For example data block size for AES is 128 bits, and total data to be encrypted is less than 256 bits.

I appreciate your inputs.

Upvotes: 1

Views: 274

Answers (1)

rook
rook

Reputation: 67039

Yes, even if it is 1 block in size it makes sense. This is because the IV is XOR'ed with the first block. This means that even if you encrypt 2 identical plain text segments the resulting cipher text will be distinct.

Don't forget about CWE-329.

Upvotes: 2

Related Questions