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)));