开发者

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

开发者 https://www.devze.com 2023-02-04 22:13 出处:网络
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 ?

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号