In cryptography, Triple DES (3DES or TDES), officially the Triple Data Encryption Algorithm (TDEA or Triple DEA), is a symmetric-key block cipher, which applies the DES cipher algorithm three times to each data block. The 56-bit key of the Data Encryption Standard (DES) is no longer considered adequate in the face of modern cryptanalytic techniques and supercomputing power; Triple DES increases the effective security to 112 bits. A CVE released in 2016, CVE-2016-2183, disclosed a major security vulnerability in the DES and 3DES encryption algorithms. This CVE, combined with the inadequate key size of 3DES, led to NIST deprecating 3DES in 2019 and disallowing all uses (except processing already encrypted data) by the end of 2023. It has been replaced with the more secure, more robust AES.
While US government and industry standards abbreviate the algorithm's name as TDES (Triple DES) and TDEA (Triple Data Encryption Algorithm), RFC 1851 referred to it as 3DES from the time it first promulgated the idea, and this namesake has since come into wide use by most vendors, users, and cryptographers.
History
In 1978, a triple encryption method using DES with two 56-bit keys was proposed by Walter Tuchman; in 1981, Merkle and Hellman proposed a more secure triple-key version of 3DES with 112 bits of security.
Standards
The Triple Data Encryption Algorithm is variously defined in several standards documents:
- RFC 1851, The ESP Triple DES Transform (approved in 1995)
- ANSI ANS X9.52-1998 Triple Data Encryption Algorithm Modes of Operation (approved in 1998, withdrawn in 2008)
- FIPS PUB 46-3 Data Encryption Standard (DES) (approved in 1999, withdrawn in 2005)
- NIST Special Publication 800-67 Revision 2 Recommendation for the Triple Data Encryption Algorithm (TDEA) Block Cipher (approved in 2017, withdrawn in 2024)
- ISO/IEC 18033-3:2010: Part 3: Block ciphers (approved in 2005)
Algorithm
The original DES cipher's key size of 56 bits was considered generally sufficient when it was designed, but the availability of increasing computational power made brute-force attacks feasible. Triple DES provides a relatively simple method of increasing the key size of DES to protect against such attacks, without the need to design a completely new block cipher algorithm.
A naive approach to increase the strength of a block encryption algorithm with a short key length (like DES) would be to use two keys <math>(K1, K2)</math> instead of one, and encrypt each block twice: <math>E_{K2}(E_{K1}(\textrm{plaintext}))</math>. If the original key length is <math>n</math> bits, one would hope this scheme provides security equivalent to using a key <math>2n</math> bits long. Unfortunately, this approach is vulnerable to the meet-in-the-middle attack: given a known plaintext pair <math>(x, y)</math>, such that <math>y = E_{K2}(E_{K1}(x))</math>, one can recover the key pair <math>(K1, K2)</math> in <math>2^{n+1}</math> steps, instead of the <math>2^{2n}</math> steps one would expect from an ideally secure algorithm with <math>2n</math> bits of key.
Therefore, Triple DES uses a "key bundle" that comprises three DES keys, <math>K1</math>, <math>K2</math> and <math>K3</math>, each of 56 bits (excluding parity bits). The encryption algorithm is:
: <math>\textrm{ciphertext} = E_{K3}(D_{K2}(E_{K1}(\textrm{plaintext}))).</math>
That is, encrypt with <math>K1</math>, <em>decrypt</em> with <math>K2</math>, then encrypt with <math>K3</math>.
Decryption is the reverse:
: <math>\textrm{plaintext} = D_{K1}(E_{K2}(D_{K3}(\textrm{ciphertext}))).</math>
That is, decrypt with <math>K3</math>, <em>encrypt</em> with <math>K2</math>, then decrypt with <math>K1</math>.
Each triple encryption encrypts one block of 64 bits of data.
In each case, the middle operation is the reverse of the first and last. This improves the strength of the algorithm when using keying option 2 and provides backward compatibility with DES with keying option 3.
EEE operation
The text above describes the mode common and standardized EDE (encrypt-decrypt-encrypt) sequence. There is a separate "EEE" (encrypt-encrypt-encrypt) sequence supported by some libraries in two-key or three-key setups.
Keying options
The standards define three keying options:
; Keying option 1
: All three keys are independent. Sometimes known as 3TDEA or triple-length keys.<!--
--><p>This is the strongest, with 3 × 56 = 168 independent key bits. It is still vulnerable to the meet-in-the-middle attack, but the attack requires 2<sup>2 × 56</sup> steps.</p>
; Keying option 2
: K<sub>1</sub> and K<sub>2</sub> are independent, and K<sub>3</sub> = K<sub>1</sub>. Sometimes known as 2TDEA This is an improvement over "double DES" which only requires 2<sup>56</sup> steps to attack. NIST disallowed this option in 2015. that some modes shall only be used with certain constraints on them that do not necessarily apply to general specifications of those modes. For example, ANS X9.52 specifies that for cipher block chaining, the initialization vector shall be different each time, whereas ISO/IEC 10116 does not. FIPS PUB 46-3 and ISO/IEC 18033-3 define only the single-block algorithm, and do not place any restrictions on the modes of operation for multiple blocks.
Security
In general, Triple DES with three independent keys (keying option 1) has a key length of 168 bits (three 56-bit DES keys), but due to the meet-in-the-middle attack, the effective security it provides is only 112 bits. and thus it is designated by NIST to have only 80 bits of security.
The short block size of 64 bits makes 3DES vulnerable to block collision attacks if it is used to encrypt large amounts of data with the same key. The Sweet32 attack shows how this can be exploited in TLS and OpenVPN. Practical Sweet32 attack on 3DES-based cipher-suites in TLS required <math>2^{36.6}</math> blocks (785 GB) for a full attack, but researchers were lucky to get a collision just after around <math>2^{20}</math> blocks, which took only 25 minutes.
