cipher block chaining is a way to nondeterministically encrypt an arbitrary-length message using a block cipher.
- pad your message to a multiple of the block length
- generate a random initial vector (IV) . this is the first ciphertext.
- before encrypting block , XOR it with , i.e.
- and then output the ciphertext .
in diagram form:
note that you expect to see a block cipher input repeated after blocks have been encrypted with the same key , where is the block size in bits (TODO: why? so what?)