# Output of using the same key in all 3 boxes of 3DES

I am trying to figure this one out: What would be the encrypted output for an input x if the same key K is used in all three boxes of 3DES?

The encryption scheme for 3DES with three different keys, and $k_3 = k_1$, is $y=ek_3(ek_2(ek_1(x)))$. So, if the key is the same 3 times, then the encrypted output of x would be $y = k(k(k(x))) = ?$

Can someone let me know if what I have done here is correct?

• Actually, we typically do 3DES in an "EDE" configuration; that is, the middle DES box runs in decrypt mode. So, to encrypt, we would first DES encrypt with $k_1$, we then DES decrypt with $k_2$, and then DES encrypt with $k_3$. My question to you: how would this change the answer? Commented Oct 20, 2015 at 16:06
• Commented Oct 20, 2015 at 18:05

Traditionally, 3DES is configured in a mode called EDE, which means "Encrypt, Decrypt, Encrypt". This means that your encryption operation looks like this: $c = E(D(E(m, k_1), k_2), k_3)$. As it turns out, if all three subkeys are independent, the security of the system is not impacted by the second operation being a decryption.

The reason for this construction is a historic one. When 3DES was being introduced, people wanted a way to fall back to a "legacy" mode which amounted to just plain DES. This is handled through keying modes, of which there are three:

• Keying mode 1: All three subkeys are independent (which implies probabilistic inequality, though some implementations may enforce $k_1 \neq k_2 \neq k_3$ explicitly)
• Keying mode 2: $k_1$ and $k_2$ are independent, but $k_1 = k_3$.
• Keying mode 3: All three subkeys are equal, i.e.e $k_1 = k_2 = k_3$.

In keying mode 1, you get full 3DES with a 168-bit key (3 × 56-bit). In keying mode 2, you get a 112-bit version of 3DES (2 × 56-bit), though this keying mode is less commonly used in practice. In keying mode 3, the first two steps cancel out, leaving you with just DES:

$$\require{cancel}\cancel{a = E(m, k)}$$ $$\cancel{b = D(a, k)}$$ $$c = E(b, k)$$

• I got the impression that the second mode is actually the most commonly used one.. Commented Aug 28, 2019 at 14:04