Is there a preferred way on how to transmit the initiliazation vector with witch AES encryption was made? I could imagine that, if the encrypted data is stored to a file, the IV is preppended at the file's beginning before the actual encrypted data (or somehting similar).

Is there such a convention?

  • 3
    $\begingroup$ Note that the initialization vector is not needed for "AES", but for the mode of operation, which also can be used with other block ciphers. (Therefore I'm changing the tags now.) $\endgroup$ Apr 6 '13 at 13:15

The most common way to transmit an initialization vector is, indeed, to prepend it immediately before the ciphertext.

When you look at the original ciphermodes the first used IVs (CBC, CFB, OFB), the IV actually does function as a 'previous ciphertext block' for the very first actual ciphertext block; placing it immediately in front of the very first ciphertext block makes more sense than any other alternative.

Now, for newer modes (such a CTR), the IV is used in other ways internally. However, the convention stuck.

  • 1
    $\begingroup$ Plus, if you put it at the beginning, you can perform decryption as you receive the data, whereas you can't do that if the IV is appended at the end. Though this shouldn't be an issue either way since you need to MAC what you receive (you do use a MAC, right?) $\endgroup$
    – Thomas
    Apr 6 '13 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.