Introducing block chaining

With ECB, we were at the mercy of our plaintext because each block has its own thing going on. Enter Cipher Block Chaining (CBC), where we encrypt a block just like before – except before we encrypt the next block, we XOR the plaintext of the next block with the encrypted output of the previous block, creating a logical chain of blocks. I know what the hacker in you is thinking now: if we XOR the plaintext block with the encrypted output of the previous block, what's the XOR input for the first block? Nothing gets past you. Yes, we need an initial value – appropriately called the initialization vector (IV):  

The concept of an IV reminds me of when clients would ask me, what do you think of those password vault apps? I tell them, they're pretty great if you need help remembering passwords, and certainly better than using the same password for everything – but I just can't shake that creepy feeling I get about the whole kit and caboodle depending on that one initial password. With CBC, security is highly reliant on that IV.

Before moving on, we'll do one more openssl demonstration with CBC, but we'll repeat the IV. Using xxd, we'll see if we can find a pattern in the plaintext blocks:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.161.222