Hi,
I am new to cryptography and I inherited the code from someone else.
We are doing AES-CBC encryption in pieces and after each piece I was
told that IV vector needs to change.

Initially the code was
e_CBC.SetKeyWithIV( m_crypto_encryption_packet_h.encr_key, key_size /
8, m_crypto_encryption_packet_h.encr_cntr_iv );

 
StringSource( m_crypto_encryption_packet_h.encr_data_in,
crypto_encr_seg_size, true, new StreamTransformationFilter( e_CBC, new
ArraySink( m_crypto_encryption_packet_h.encr_data_out,
crypto_encr_seg_size), StreamTransformationFilter::NO_PADDING));

I tried to the add  the following lines for IV vector update
e_CBC.GetNextIV(NullRNG(), m_crypto_encryption_packet_h.encr_cntr_iv);
This doesn't change the IV vector

e_CBC.GetNextIV(RandomPool(),
m_crypto_encryption_packet_h.encr_cntr_iv);
This changes the vector but the encryption output is not what I expect

Can someone provide me a sample code on what I should be doing.

Thanks a lot
Paul

-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.

Reply via email to