From DES to 3-DES
For a very brief theory of Data Encryption Standard and their analysis, click here
The Data Encryption Standard (DES) is a symmetric-key block cipher published by the U.S. National Bureau of Standards as FIPS PUB 46 in 1977. Following the generic symmetric-key scheme (Gen, Enc, Dec) described in the Aim, DES instantiates Gen as the generation of a 64-bit key, Enc as the DES encryption algorithm, and Dec as its inverse. DES encrypts data in 64-bit blocks using a 56-bit effective key (stored as a 64-bit key with 8 parity bits). As computing power increased, exhaustive key search against this 56-bit key space became practical, which led to the development of Triple DES (3DES) and, eventually, to the replacement of both by the Advanced Encryption Standard (AES).
How DES Works
- Block Size: DES operates on 64-bit blocks of plaintext, producing 64-bit blocks of ciphertext.
- Key Size: Uses a 64-bit key of which only 56 bits are effective; the remaining 8 bits are parity bits (1 per byte) used for error detection, not security.
- Rounds: Performs 16 rounds of identical Feistel operations on the data, each round using a distinct 48-bit round key.
- Structure (Feistel Network): Each 64-bit block is split into two 32-bit halves, and . For round :
where is the round (Feistel) function, is the -th round key, and denotes bitwise XOR. Because of this structure, DES decryption uses the exact same algorithm as encryption, only with the round keys applied in reverse order — a key practical advantage of Feistel ciphers over Substitution-Permutation Networks (SPNs).
Round (Feistel) Function :
- Expansion (E): The 32-bit half-block is expanded to 48 bits by duplicating and permuting bits.
- Key Mixing: The 48-bit expanded value is XORed with the 48-bit round key .
- Substitution (S-boxes): The 48-bit result is split into eight 6-bit chunks; each chunk passes through one of eight fixed, non-linear substitution boxes (), each mapping 6 input bits to 4 output bits, giving a 32-bit result. The S-boxes are the sole source of non-linearity in DES and are critical to its resistance against simple algebraic attacks.
- Permutation (P): A fixed permutation is applied to the 32-bit S-box output before it is XORed into the next round.
Key Schedule: The 64-bit key is first reduced to 56 bits by Permuted Choice 1 (PC-1), which discards the 8 parity bits and permutes the rest. The 56 bits are split into two 28-bit halves, and . In each of the 16 rounds, both halves are left-circularly shifted by 1 or 2 bits (1 bit in rounds 1, 2, 9, 16; 2 bits in all other rounds), and Permuted Choice 2 (PC-2) selects and permutes 48 of the resulting 56 bits to form that round's key .
Triple DES (3DES) Enhancement
Triple DES was introduced (standardized in FIPS 46-3 and ANSI X9.52) to reuse the well-analyzed DES algorithm while defeating brute-force attacks, by chaining DES together in an Encrypt–Decrypt–Encrypt (EDE) sequence rather than three plain encryptions:
First Stage: Encrypt the plaintext with Key 1 ().
Second Stage: Decrypt the result with Key 2 ().
Third Stage: Encrypt the result with Key 3 ().
Keying Options: Three standard variants exist, depending on how the keys relate:
- Option 1 (three independent keys, ): 168-bit key material, the strongest variant.
- Option 2 (two keys, ): 112-bit key material; the most widely deployed variant historically.
- Option 3 (): mathematically collapses to single DES, since encrypting and then decrypting with the same key cancels out — this gives 3DES hardware/software full backward compatibility with legacy DES systems.
The decrypt-in-the-middle step is what makes Option 3 backward-compatible; a plain Encrypt–Encrypt–Encrypt scheme would not have this property.
Mathematical Representation
Single DES:
Triple DES (general form, three keys):
Where:
- is the plaintext block (64 bits)
- is the ciphertext block (64 bits)
- and denote DES encryption and decryption under key
- are the (56-bit effective) keys used in 3DES; setting gives 2-key 3DES, and setting reduces the scheme to single DES
Security Analysis
DES Vulnerabilities:
- Key Size: The 56-bit effective key gives only possible keys, small enough for exhaustive (brute-force) search with dedicated hardware.
- Demonstrated Breaks: In 1998, the EFF's purpose-built "Deep Crack" machine recovered a DES key in about 56 hours; in 1999, a combined effort with distributed.net reduced this to about 22 hours. These public demonstrations were a major factor in DES being deprecated for new use.
- Cryptanalysis: DES is also studied against differential and linear cryptanalysis; while these academic attacks require large amounts of chosen/known plaintext and are less practical than brute force, they show DES's security margin is thinner than its key size alone suggests.
- Formal Withdrawal: NIST formally withdrew DES as a FIPS-approved algorithm in 2005 (withdrawal of FIPS 46-3), after which it was retained only for legacy/compatibility use via 3DES.
Triple DES Advantages:
- Effective Key Length: 2-key 3DES offers only about effective security, not , because of a meet-in-the-middle attack (see below) — this is still far stronger than DES's .
- Backward Compatibility: Setting all three keys equal () makes 3DES hardware/software behave as plain DES, easing migration from legacy systems.
- Proven Security: As a direct extension of a heavily analyzed cipher, 3DES inherited decades of DES cryptanalysis without needing a new, less-studied design.
- Modern Status: Despite its strength, NIST's SP 800-67 disallowed 3DES for new applications and set 2023 as the end date for its use in protocols such as TLS, in favor of AES, which offers both stronger security and much better performance.
Breaking and Security Considerations
DES can be broken using:
- Brute Force Attack: All possible keys can be tested; this is the primary practical threat and the one demonstrated by the EFF Deep Crack.
- Differential Cryptanalysis: Exploits how differences in plaintext pairs propagate through the round function to recover key bits.
- Linear Cryptanalysis: Constructs linear approximations of the S-boxes to statistically recover key bits from large amounts of known plaintext.
Triple DES Security:
- Why Not Double DES? A naive Double DES () does not give security. A meet-in-the-middle attack — computing and storing for all , and separately for all , then matching — reduces its effective strength to roughly , barely better than single DES. This is precisely why three stages (not two) are used.
- Meet-in-the-Middle on 3DES: The same style of attack against 3DES reduces its effective security to about operations (for 2-key 3DES), which remains computationally infeasible today.
- Sweet32 (2016): Because DES/3DES still uses a 64-bit block size, birthday-bound collision attacks (e.g., the Sweet32 attack, CVE-2016-2183) become practical against very long-lived encrypted connections (such as long TLS or VPN sessions), independent of key length. This 64-bit block size limitation — not brute force — is the main reason modern protocols moved away from 3DES entirely.
- Performance Trade-off: 3DES is roughly three times slower than single DES, since it performs three full DES operations per block; combined with its Sweet32 exposure, this is why AES (128-bit block, comparable or better speed) is now preferred for all new designs.