Just a quick note on CBC vs ECB. When you encrypt using ECB, every 128 bit (depending on the block size) of data gets encrypted with the same key. If there is any pattern in the plaintext, the resulting encrypted text will also be predictable, no matter how good the encryption algorithm is.
ECB:
Plain text: aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaa
---------------- ---------------- ----------------
Encrypted: bdefjakjapqeiowp bdefjakjapqeiowp bdefjakjapqeiowp
If you use CBC, the first block gets XOR'd with the IV (initialization vector) and encrypted with the key and the second block gets XOR'd with the first block and then encrypted with the key, the third with the second. The resulting cipher is then less vulnerable to frequency analysis.

This image is taken from Wikimedia Commons, the free media repository
The disadvantage is that you cannot parallelize the encryption/decryption since you need the result of the previous block, so it may be slower. But in practice, it makes no real difference.