views:

38

answers:

2

Does it make the encryption stronger? I thought it was used to make sure the ciphertext is more "random." It doesn't really make it any stronger, or so I think.

+1  A: 

See this link: http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Electronic_codebook_.28ECB.29

Check out the images just below. ECB (no feedback) may give an "echo" of the plaintext in the ciphertext. A feedback loop fixes this.

Jörgen Sigvardsson
So without feedback a plaintext will always produce the same cipher text. The feedback loop ensures a plaintext will produce a different cipher text. Wiki also said, "The disadvantage of this method is that identical plaintext blocks are encrypted into identical ciphertext blocks; thus, it does not hide data patterns well." I can assume feed back loops prevent this and that's their purpose?
Google
That's how I understand it.
Jörgen Sigvardsson
Thanks that helps!
Google
+1  A: 

The DES operation encrypts 64 bits (8 bytes) of data, using a 56-bit key. That's it.

Most files are longer than 8 bytes though, so we need to break the file up into blocks and process each one somehow. Naively we could do this by just encrypting each block with the same key, in isolation from the rest (so-called "electronic code book", or ECB mode).

However, many file formats contain common sequences of bytes (to pick a familiar example - HTML documents often contain many links starting with <a href=). Using ECB mode, every occurrence of these sequences would encrypt to the same ciphertext, giving an attacker clues about the plaintext structure. Furthermore, the original text can often be guessed from the context (chances are fairly good that an HTTPS request contains some HTML, for instance) so the attacker could construct new messages without knowing the original key - and trick the recipient into accepting those messages as genuine.

There are several ways to fix this; one being "cipher-block chaining" (CBC mode) where the ciphertext from each block is "mixed" with the subsequent block, disguising these repeated sequences. Additionally a strong initialisation vector (IV) is used - this is a random value used to 'seed' the encryption, ensuring that even if the same file is encrypted twice with the same key, the ciphertexts will differ - leaving the attacker with fewer clues about the content.

SimonJ
An IV is a "random" value that seeds the encryption? I was going to ask about that as well, thanks that clears up the next question I was going to ask.
Google
Yup - the IV is included alongside the ciphertext. One of the problems with the old WEP wifi standard was that the IVs were only 16 bits long, so it was trivial to replay packets and wait for two near-identical responses with the same IV. Statistical properties of the cipher (RC4) were then used to break the key (or more precisely, properties of the *way RC4 was being used* - but that's another story!).
SimonJ
Thanks that makes a lot of sense!
Google