Hi all,

I encounter a weird problem when I try to encrypt a file

What I did was to actually split the plaintext up into equal-sized
blocks, and then encrypt each block. Each encrypted block is then
placed into an array for later use.

However, I encountered this weird problem.

Two print-outs of the first encrypted block are done:

The first print-out is when the processor finishes encrypting the
first block; The second print-out is when the processor finishes
encrypting the second block (note: I am still printing the first
encrypted block).

In other words,
-> encrypt first block, store into array[0]
-> retrieve first block from array[0], print to screen
-> encrypt second block, store into array[1]
-> retrieve first block from array[0], print to screen

However, the two displayed blocks are different.

Can anyone tell me what's wrong?

Cipher used is AES and the mode used is CTR

StreamTransformationFilter ab( encryptor,  new
CryptoPP::StringSink( CipherText ) );
ab.Put( (const byte*)data, data_size );
ab.MessageEnd();
enqueue(data);

encryptor is initialized at the start of program once.
--~--~---------~--~----~------------~-------~--~----~
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