Take the tour ×  If I have received an AES encrypted message,
and if I do know the key with which it was encrypted, do I also
need to know the mode of operation with which it was encrypted
in order to decrypt it? My understanding is that this is indeed
the case.  If so, how is the mode of operation transmitted along
with the encrypted file?  share|improve this question add
comment  2 Answers  up vote 4 down vote accepted  Yes, of course
you need to know the mode of operation in order to decrypt.  On
the other hand, the mode of operation isn't usually explicitly
transmitted in the ciphertext. Using the same key with different
modes of operation may cause unexpected weaknesses. For example,
consider one message encrypted with CFB mode with IV=2 (which is
perfectly secure) and another message encrypted with CTR mode
with IV=0 (also secure). If we give the attacker both
ciphertexts, he knows a relationship between the first block of
the CFB mode plaintext and the third block of the CTR mode
plaintext; this is a l