views:

10

answers:

1

Hello, I am trying to get the hang of encryption diagrams and TDEA (Triple DES). I understand TDEA looks something like this:

ciphertext = EK3(DK2(EK1(plaintext)))

I also know a chain block cipher uses an IV to seed the encryption and the plain text before encrypting, and then the output is a block that is ciphered and the new IV is formed from the output of the first block's cipher text. Correct?

This means a TDEA in CBC mode would flow something like this:

Plain Text --> IV --> TDEA encryption --> NEW IV --> Cipher Text

The next block is:

Plain Text --> NEW IV --> TDEA encryption --> NEW NEW IV --> Cipher Text

This continues on for n number of blocks. Is this correct or am I not getting how it works?

+1  A: 

Your conception of how CBC works seems to be flawed (or at least I don't understand how you're saying you believe things work). In particular, you're showing Plain Text -> IV, but the IV does not depend (in any way) on the plain text.

The cipher algorithm you use is basically orthogonal to how CBC itself works (beyond the fact that it's for block ciphers, not stream ciphers). In pseudo-code, CBC looks something like this:

block_t xor_block = IV;
write(xor_block);
for (int i=0; i<message_size; i++) {
    block_t data = xor(xor_block, message[i]);
    xor_block = encrypt(data);
    write(xor_block);
}
Jerry Coffin
I was getting a lot of my information from here: http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Cipher-block_chaining_.28CBC.29 I figure those graphs are how TDEA would work but TDEA would be using 3 keys instead of one and the encryption would be TDEA?
Google
Hmm...nice diagrams! Yes, in this case you could think of 3DES as a "single" block encryption algorithm with a 168-bit key and 64-bit blocks.
Jerry Coffin
Thanks, it's very interesting!
Google