encrypt-decrypt single block with AES and Crypto++

十年热恋 提交于 2019-12-01 22:27:55

AES in ECB mode is identical to single block encryption, except that you can feed it multiple blocks.

If you've got only CBC mode encryption available you can use the first block of a CBC encrypt using a (block sized) IV containing bytes all valued zero. The same goes for counter (CTR) mode encryption and a nonce containing bytes all valued zero (the counter only increases after the first block encrypt).

Crypto++ seems to be a higher level Crypto API, so it is better not to directly call the AES implementation directly.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!