Initialization vector -> where do I put it?
Posted: Tue Jul 19, 2005 2:42 pm
This is my first time using encryption, so I'm trying to do it right. In the examples, they strongly advise the use of initialization vectors.
Or is there a better way? Or am I missing something here?
So, that means once I create an IV, I need to know it in order to decrypt the data fully (otherwise, the first few bits will be garbled). So where do I put the IV to retrieve it later? The Wikipedia article says that it's sent with the ciphertext, but does that mean I:In cryptography, an initialization vector (IV) is a block of bits that is combined with the first block of data in any of several modes of a block cipher. In some cryptosystems it is random and is sent with the ciphertext; in others, such as a disk encryption subsystem, it is based on some info, such as the file's inode, that does not have to be put in the ciphertext.
Code: Select all
$cookie = base64_encode(serialize(array($ciphertext,$iv)));