Why does applying 56-bit DES twice only give 57 bits of security? [duplicate]

Given two 56-bit keys, $k_1$ and $k_2$, why does $E_{k_1}(E_{k_2}(M))$ only give 57 bits of security?

So basically I'm unsure why it only gives 57 bits of security; I understand that one key will provide 56 bits. Only thing I can think of is that when adding another 56 bit it will cycle through all the bits and realize they are the same so it just adds 1 extra bit, for the second keyblock instead of another 56 bits?

If I'm wrong, could someone please explain it simply and step-by-step?

• This basic question is NOT a duplicate of these questions. In fact I do not find it either asked or answered anywhere on CSE. We have a closely related but more complex question, with good answers: Attacking 2DES efficiently. – fgrieu Apr 19 '15 at 9:27
• I looked closer, and indeed we have a close match for that question, though asked in more precise and quantitative terms: Meet-in-the-middle with checking complexity, with a good answer. – fgrieu Apr 19 '15 at 9:57
• I ask in meta if we should have closed this question, or should reopen it so as not to loose its simple and useful answer. – fgrieu Apr 19 '15 at 14:41

Decrypt the ciphertext with every possible key and store the result: $2^{56}$ decryptions. Now encrypt the (known) plaintext of the ciphertext with every possible key: $2^{56}$ encryptions. Now you have to check every entry, which is in both lists and try it with another plaintext-ciphertext pair. If you can successfully decrypt that, you are very likely to have found the correct key. All in all $2^{56} + 2^{56} = 2^{57}$ DES operations (encryptions and decryptions), much less than $2^{112}$. You need some work to search inside the list and check every possible key, but for DES this is not really much work.
• Note that an actual attacker wouldn't create a table with $2^{56}$. They'd use distinguished points/cycle finding to reduce the memory use. – CodesInChaos Apr 18 '15 at 18:49
• @CodesInChaos: I would be surprised that distinguished points/cycle finding can work with known plaintext (which seems to be the context of the question, since it is said that DES has 56-bit security, when it has only 55-bit security under chosen-plaintext attack due to DES's complementation property, with $\operatorname{DES}_{k_1}(\operatorname{DES}_{k_2}(M))$ only about 56-bit security, not 57-bit). $\;$ More generally, I'm not sure that I understand what you are thinking about. – fgrieu Apr 19 '15 at 9:16
• @fgrieu I guess we could build the table with only one block of plaintext-ciphertext, and for each of the $2^{48}$ found matches check the second block. This would have work of $2^{57} + 2^{49}$, which I would still consider as 57-bit security. – Paŭlo Ebermann Apr 19 '15 at 9:44