Xceed Encryption Library Documentation
Initialization vector
Glossary topics > Initialization vector

An initialization vector is a block of data, usually random, which is used by some encryption techniques in order to create encrypted data which is different every time even when encrypting the same plain text. With the Xceed Encryption Library, an initialization vector can also be explicitly specified by setting the InitVector property for some encryption methods.

Technically, when the library uses an Initialization vector, the first block the encryption engine will output is the unencrypted initialization vector itself. The initialization vector block is then XORed with the first block of plain text before it is encrypted, and then this new encrypted block is outputted and then XORed with the next block of plain text before it is encrypted, and so on. Thus, the same plain text encrypted twice with the same key will produce different encrypted data, which helps prevent certain types of crypto-attacks.