Meet-in-the-Middle attack on 3DES How can I apply the Meet-in-the-Middle attack to the 3DES algorithm, and why does the literature say that 3DES is more secure than DES?
The meet-in-the-middle attack on ciphers like $C=E^2_K(P)=E_{K1}(E_{K2}(P))$ works as follows.

Let's assume you're given a known-plaintext pair $(P_1,C_1)$ and a known-plaintext pair $(P_2,C_2)$
You now build a list (by brute-force) containing the pairs $(I,K1)$ for every possible value of $K1$ ($2^{56}$ for DES) with $I=E_{K1}(P_1)$.
Constructing this list takes you $2^n$ blocks of storage with $n$ being the keysize.
You now simply call the decryption function $D_{K2}(C)$ until you obtain a value of $I$ you already stored in your table. If you find this one, which takes you at most $2^n$ operations, you simply counter-check with your second pair, using the relation: $C_2=E_{K1}(E_{K2}(P_2))$. If this holds, you can be pretty sure to have found the correct key. As you have to perform $2^n$ operations to obtain the table and $2^n$ operations to find the correct key you need $2^n+2^n=2*2^n=2^{n+1}$ operations and $2^n$ storage.

Let's see, how can I use that on 3DES (3-key)?
For the meet-in-the-middle attack to work, it is not required for the $E_K()$ to be the same. So you simply define the second one to be $E_{K2}=D_{K2}(E_{K3}(P))$. Then, in the first paragraph you'll need $2^{56}$ operations to construct the table containing $2^{56}$ entries. Now you simply perform the third paragraph of the above attack and need another $2^n$ operations with $n$ being 112 in this case as it is a double-application of DES which can't be attacked by meet-in-the-middle by itself as it is part of such an attack. The attack thus requires $2^{56}+2^{112}\approx 2^{112}$ operations and $2^{56}$ storage.

Now, how's the relation with 3DES (2-key)?
3DES is defined as $C=E_{K1}(D_{K2}(E_{K1}(P)))$. You can't apply the above attack to 3DES, as you now have three encryption / decryption operations.
The best attack to 3DES is due to van Oorschot and Wiener and goes as follows.


Guess the first intermediate value, $a$.
Tabulate, for each possible value of $K1$, the second intermediate value, $b$, when the first intermediate value is $a$ using known plaintext $b=D_{K1}(C)$, for all $p$ given plaintext-ciphertext pairs.
Look up, for each possible $K2$, elements with a matching second intermediate value, b: $b=E_{K2}(a)$.
The probability of a match is $p/{2^m}$ with $m$ being the block size.


The whole attacks requires $2^{n+m}/p$ time and $p$ storage.

(the attacks can also be found in Schneier's Applied Cryptography)

Why is 3DES more secure than DES?
Because the keyspace is larger. 3DES has a keyspace with 112-bits in size whereas DES has only $2^{56}$ keys, which is brute-force-able.