Roland Bock wrote:
Hi,

I want to use AES encryption in CFB mode. For experiments, I am using the attached program. It generates a random key and an initialization vector. It then encrypts all command line arguments and displays the HEX encoded encrypted strings. Here is what it looks like:

The encrypted results are almost identical.

I am aware that I am using the same IV for all arguments, but still I would have expected similar input would NOT result in similar output. I meam, the four input values differ in just one Byte and same is true for their encrypted version? Somehow it seems that encryption is done Byte by Byte. Can I change that?

Look up the specs of CFB mode. Quoting from http://crypto-systems.com/modes.html :

"the previous ciphertext block is encrypted and the output produced is combined with the plaintext block using exclusive-OR to produce the current ciphertext block."

So, yes, if the IV (which is used in place of the "previous ciphertext block" for the first message block) and message blocks up to a certain point are identical, the ciphertext will be to that point as well, and the XOR output for the next block will differ exactly where the bits of the next message block differ. This is why you need to pick different IV values per message.

Ken

--
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