I am trying some experiments by expanding the AES code snippet provided by Denis Bider's guide. I am wondering how the length of cipher text changes with plain text length?
For instance, with 128 bit key and iv;
 - If  48 bytes <=PlainTextLength< 63 bytes then CipherTextLength is 64 bytes
 - starting from 63 bytes , CipherTextLength suddenly changes to 80 bytes.

I guess there is a padding mechanism, in below there is my code for dumping cipher text in hex format.

// Dump Cipher Text
std::cout << "Cipher Text (" << ciphertext.size() << " bytes)" << std::endl;
for( int i = 0; i < ciphertext.size(); i++ )
 std::cout << "0x" << std::hex << (0xFF & static_cast<byte>(ciphertext[i])) << " ";
std::cout << std::endl << std::endl;

Thanks in advance,

-MERT

View this message in context: AES Cipher Text Length
Sent from the Crypto++ forum at Nabble.com.

Reply via email to