CBC stands for Cipher Block Chaining.
Under this mode the outcome of encrypting earlier blocks flow into the encryption of the current block. Every block of the encrypted text thus depends not only on the associated plaintext block but also on all the previous plaintext blocks. In addition, an initialisation block is required for the first plaintext block.
Encryption proceeds as follows:
Decryption proceeds in analogous fashion:
However, this method still has the disadvantage that two messages produce the same encrypted text up to the first difference. In particular, identical messages produce the same encrypted text. To prevent this, "initialisation vectors" are used. An initialisation vector is a random value which can be transmitted unencrypted with the message. Prior to encryption (or decryption, as the case may be) of the first block, this block is combined with the initialisation vector by means of an Exclusive-OR. The procedure then continues as described above.
In the ECB mode, every block is encrypted independently of the other blocks.