ANSI standard X3.106 defines four modes of operation for
ciphering, and one of these modes, Cipher Block Chaining (CBC), defines
the basic method for ciphering multiple 8-byte data strings.
Figure 1 and Figure 2 show CBC using the Encipher and Decipher verbs.
A plaintext data string that must be a multiple of eight bytes is
processed as a series of 8-byte blocks. The ciphered result from processing
an 8-byte block is XORed with the next block of 8 input bytes. The
last 8-byte ciphered result is defined as an output chaining value (OCV).
The security server stores the OCV in bytes 0 - 7 of the chaining_vector
variable.
An ICV is XORed with the first block of eight bytes. When you call the Encipher or Decipher verb, specify the
INITIAL or CONTINUE keywords. If you specify the
INITIAL keyword, the default, the initialization vector from the verb
parameter is XORed with the first eight bytes of data. If you specify the
CONTINUE keyword, the OCV identified by the chaining_vector
parameter is XORed with the first eight bytes of data. Figure 1. Enciphering using the ANSI X3.106 CBC methodFigure 2. Deciphering using the CBC method