# Triple DES

Triple Data Encryption Algorithm
General
First published 1998 (ANS X9.52)
Derived from DES
Cipher detail
Key sizes 168, 112 or 56 bits (keying option 1, 2, 3 respectively)
Block sizes 64 bits
Structure Feistel network
Rounds 48 DES-equivalent rounds
Best public cryptanalysis
Lucks: 232 known plaintexts, 2113 operations including 290 DES encryptions, 288 memory; Biham: find one of 228 target keys with a handful of chosen plaintexts per key and 284 encryptions

In cryptography, Triple DES (3DES), 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.

While the government and industry standards abbreviate the algorithm's name as TDES (Triple DES) and TDEA (Triple Data Encryption Algorithm),[1] RFC 1851 called it 3DES from the time it first promulgated the idea, and this namesake has since come into wide use by most vendors, users, and cryptographers.[2][3][4][5]

## Standards

The Triple Data Encryption Algorithm is variously defined in several standards documents:

• RFC 1851, The ESP Triple DES Transform[6] (approved in 1995)
• ANSI ANS X9.52-1998 Triple Data Encryption Algorithm Modes of Operation[7] (approved in 1998, withdrawn in 2008[8])
• FIPS PUB 46-3 Data Encryption Standard (DES)[9] (approved in 1999, withdrawn in 2005[10])
• NIST Special Publication 800-67 Revision 2 Recommendation for the Triple Data Encryption Algorithm (TDEA) Block Cipher[11] (approved in 2017)
• ISO/IEC 18033-3:2010: Part 3: Block ciphers[12] (approved in 2005)

## Algorithm

The original DES cipher's key size of 56 bits was generally sufficient when that algorithm 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 strength of a block encryption algorithm with short key length (like DES) would be to use two keys (K1, K2) instead of one, and encrypt each block twice: EK2(EK1(plaintext)). If the original key length is n bits, one would hope this scheme provides security equivalent to using key 2n bits long. Unfortunately, this approach is vulnerable to meet-in-the-middle attack: given a known plaintext pair (x, y), such that y = EK2(EK1(x)), one can recover the key pair (K1, K2) in ~2n steps, instead of ~22n steps one would expect from algorithm with 2n bits of key.

Therefore, Triple DES uses a "key bundle" that comprises three DES keys, K1, K2 and K3, each of 56 bits (excluding parity bits). The encryption algorithm is:

ciphertext = EK3(DK2(EK1(plaintext)))

I.e., DES encrypt with K1, DES decrypt with K2, then DES encrypt with K3.

Decryption is the reverse:

plaintext = DK1(EK2(DK3(ciphertext)))

I.e., decrypt with K3, encrypt with K2, then decrypt with K1.

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.

## Keying options

The standards define three keying options:

Keying option 1
All three keys are independent. Sometimes known as 3TDEA[13] or triple-length keys.[14]
This is the strongest, with 3 × 56 = 168 independent key bits. It is still vulnerable to meet-in-the-middle attack, but the attack requires 22 × 56 steps.
Keying option 2
K1 and K2 are independent, and K3 = K1. Sometimes known as 2TDEA[13] or double-length keys.[14]
This provides a shorter key length of 112 bits and a reasonable compromise between DES and Keying option 1, with the same caveat as above.[15] This is an improvement over "double DES" which only requires 256 steps to attack. NIST has deprecated this option.[13]
Keying option 3
All three keys are identical, i.e. K1 = K2 = K3.
This is backward compatible with DES, since two operations cancel out. ISO/IEC 18033-3 never allowed this option, and NIST no longer allows it.[13][11]

Each DES key is 8 odd-parity bytes, with 56 bits of key and 8 bits of error-detection.[7] A key bundle requires 24 bytes for option 1, 16 for option 2, or 8 for option 3.

## Encryption of more than one block

As with all block ciphers, encryption and decryption of multiple blocks of data may be performed using a variety of modes of operation, which can generally be defined independently of the block cipher algorithm. However, ANS X9.52 specifies directly, and NIST SP 800-67 specifies via SP 800-38A[16] 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[17] 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.[13] Keying option 2 reduces the effective key size to 112 bits (because the third key is the same as the first). However, this option is susceptible to certain chosen-plaintext or known-plaintext attacks,[18][19] and thus, it is designated by NIST to have only 80 bits of security.[13] This can be considered broken, as the whole 3des keyspace can be searched thoroughly by affordable consumer hardware as of 2017.[citation needed]

Practical Sweet32 attack on 3DES-based cipher-suites in TLS required ${\displaystyle 2^{36.6}}$blocks (785 GB) for a full attack, but researchers were lucky to get a collision just after around ${\displaystyle 2^{20}}$blocks which took only 25 minutes.[20]

The security of TDEA is affected by the number of blocks processed with one key bundle. One key bundle shall not be used to apply cryptographic protection (e.g., encrypt) more than ${\displaystyle 2^{20}}$ 64-bit data blocks.

— Recommendation for Triple Data Encryption Algorithm (TDEA) Block Cipher (SP 800-67 Rev2)[11]

OpenSSL does not include 3DES per default since version 1.1.0 (August 2016), and considers it a "weak cipher".[21]

## Usage

The electronic payment industry uses Triple DES and continues to develop and promulgate standards based upon it (e.g. EMV).[22]

Microsoft OneNote,[23] Microsoft Outlook 2007[24] and Microsoft System Center Configuration Manager 2012[25] use Triple DES to password protect user content and system data.

Firefox and Mozilla Thunderbird[26] use Triple DES in CBC mode to encrypt website authentication login credentials when using a master password.

## References and notes

1. ^ "Triple DES Encryption". IBM. Retrieved 2010-05-17.
2. ^ "New Comparative Study Between DES, 3DES and AES within Nine Factors". Journal of Computing. 2 (3). March 2010. arXiv:. Bibcode:2010arXiv1003.4085A. ISSN 2151-9617.
3. ^ "Cisco PIX 515E Security Appliance Getting Started Guide: Obtaining a DES License or a 3DES-AES License" (PDF). Cisco. 2006. Retrieved 2017-09-05.
4. ^ "3DES Update: Most Banks Are Done, But..." ATM & Debit News. 2007-03-29. Retrieved 2017-09-05.
5. ^
6. ^ Karn, P.; Metzger, P.; Simpson, W. (September 1995). The ESP Triple DES Transform. doi:10.17487/RFC1851. RFC 1851.
7. ^ a b "ANSI X9.52-1998 Triple Data Encryption Algorithm Modes of Operation". Retrieved 2017-09-05. Extends ANSI X3.92-1981 Data Encryption Algorithm.
8. ^ "ANSI Standards Action" (PDF). Vol. 39 no. 46. ANSI. 2008-11-14. Retrieved 2017-09-05.
9. ^ "FIPS PUB 46-3: Data Encryption Standard (DES)" (PDF). United States Department of Commerce. Oct 25, 1999. Retrieved 2017-09-05.
10. ^ "Announcing Approval of the Withdrawal of Federal Information Processing Standard (FIPS) 46–3..." (PDF). Federal Register. 70 (96). 2005-05-19. Retrieved 2017-09-05.
11. ^ a b c Barker, Elaine; Mouha, Nicky (November 2017). "NIST Special Publication 800-67 Revision 2: Recommendation for the Triple Data Encryption Algorithm (TDEA) Block Cipher". NIST. Retrieved 2017-11-21.
12. ^ "ISO/IEC 18033-3:2010 Information technology -- Security techniques -- Encryption algorithms -- Part 3: Block ciphers". ISO. December 2010. Retrieved 2017-09-05.
13. Barker, Elaine (January 2016). "NIST Special Publication 800-57: Recommendation for Key Management Part 1: General" (PDF) (4 ed.). NIST. Retrieved 2017-09-05.
14. ^ a b "The Cryptography Guide: Triple DES". Cryptography World. Archived from the original on 2017-03-12. Retrieved 2017-09-05.
15. ^ Katz, Jonathan; Lindell, Yehuda (2015). Introduction to Modern Cryptography. Chapman and Hall/CRC. p. 223. ISBN 9781466570269.
16. ^
17. ^ "ISO/IEC 10116:2006 Information technology -- Security techniques -- Modes of operation for an n-bit block cipher" (3 ed.). February 2006. Retrieved 2017-09-05.
18. ^ Merkle, Ralph; Hellman, Martin (July 1981). "On the Security of Multiple Encryption" (PDF). Communications of the ACM. 24 (7): 465–467. doi:10.1145/358699.358718.
19. ^ van Oorschot, Paul; Wiener, Michael J. (1990). A known-plaintext attack on two-key triple encryption. EUROCRYPT'90, LNCS 473. pp. 318–325. CiteSeerX .
20. ^ "Sweet32: Birthday attacks on 64-bit block ciphers in TLS and OpenVPN". sweet32.info. Retrieved 2017-09-05.
21. ^ Salz, Rich (2016-08-24). "The SWEET32 Issue, CVE-2016-2183". OpenSSL. Retrieved 2017-09-05.
22. ^ "Annex B Approved Cryptographic Algorithms – B1.1 Data Encryption Standard (DES)". EMV 4.2: Book 2 - Security and Key Management (4.2 ed.). EMVCo. June 2008. p. 137. The double-length key triple DES encipherment algorithm (see ISO/IEC 18033-3) is the approved cryptographic algorithm to be used in the encipherment and MAC mechanisms specified in Annex A1. The algorithm is based on the (single) DES algorithm standardised in ISO 16609.
23. ^ Daniel Escapa's OneNote Blog - Encryption for Password Protected Sections, November 2006
24. ^ "Encrypt e-mail messages - Outlook - Microsoft Office Online". office.microsoft.com. Archived from the original on 2008-12-25. Applies to: Microsoft Office Outlook 2007
25. ^ Microsoft TechNet product documentation - Technical Reference for Cryptographic Controls Used in Configuration Manager, October 2012
26. ^ Mozilla NSS source code. cf. Explanation of directory structure (especially the introductory and "security" sections) for background information