Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

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?

share|improve this question
3  
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.) –  Paŭlo Ebermann Apr 6 '13 at 13:15
add comment

1 Answer 1

up vote 8 down vote accepted

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.

share|improve this answer
1  
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?) –  Thomas Apr 6 '13 at 12:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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