Question

What are the possible ways to attach the iv to the encrypted string. Prepending iv as the first sixteen is the most common approach. Are there any other ways can we able to do it?

Was it helpful?

Solution

You can attach it however you like (at the beginning, or end, or middle if you really feel like it), or send it separately, via smoke signals if you like! As long as your decryption code knows where to find it. At the beginning is certainly the logical place for it though (especially if you want to start decrypting before you've got the entire ciphertext). But from a security point of view, there isn't a reason not to put it elsewhere if you have that need for some reason.

Just remember that you should assume any eavesdropper knows where you've put the IV. You shouldn't consider that to be a secret.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top