DES and 3DES
DES's parameters and the keyspace arithmetic that made it obsolete, worked from the lecture's own break-time figures, then 3DES as the encrypt-decrypt-encrypt fix and what the unit's 168-bit strength figure actually means.
- State DES's block size, key size, round count and S-box count from memory.
- Work through the DES brute-force time at a given attack rate, including the average-case halving.
- Explain why 3DES runs encrypt-decrypt-encrypt rather than three encryptions, and with how many keys.
- Distinguish 3DES's nominal key length from its NIST-rated effective strength.
16 min read
Intuition
DES was the first widely deployed standard block cipher, and for a long time it worked. What eventually broke it was not a flaw in its structure but simple arithmetic: a 56-bit key means a fixed, countable number of keys to try, and computers kept getting faster while that number stayed the same. 3DES was the industry’s stopgap while its replacement, AES, was still being chosen — the same DES machinery, run three times, to buy more key length without designing a new cipher from scratch.
Mechanism
DES accepts 64-bit blocks of plaintext and uses a 56-bit key. Its round-key generator derives sixteen 48-bit round keys from that one key, one for each of DES’s 16 rounds. Inside each round, the 64-bit input splits into two 32-bit halves in the Feistel structure covered on the previous page; the right half goes through the round function . expands the 32-bit half to 48 bits so it matches the round key’s size, XORs it with that round key, splits the 48-bit result into eight 6-bit chunks — one per S-box — and passes the resulting 32 bits through a single P-box before the round’s XOR and swap. Every S-box’s output is spread by that P-box across as many of the next round’s S-boxes as possible, which is what keeps the diffusion going round after round.
Sixteen rounds is not an arbitrary number: it can be shown that 16 rounds is what DES actually needs to reach its intended level of security, even though the round function on its own is not especially strong. This is the general design principle behind rounds in any block cipher — a higher round count increases the difficulty of cryptanalysis and adds confusion, particularly in a Feistel cipher, even when no individual round is doing very much work by itself. The function itself is expected to be nonlinear and to satisfy the strict avalanche criterion (SAC) — flipping one input bit should flip each output bit with 50% probability — and the bit independence criterion (BIC), so that output bits change independently of each other when an input bit flips.
Worked example
Answer≈ 1.14 years at 10^9 keys/sec; ≈ 1 hour at 10^13 keys/sec
DES’s weakness is its key length, not its structure. The keyspace is , and the lecture works through what that means at two attack rates: keys per second for a multicore machine, for a supercomputer.
- Keyspace: possible keys.
- A brute-force attacker does not need the worst case. On average, a hit comes after trying half the keyspace: keys.
- At keys/sec: seconds.
- Converting to years: years — about 417 days.
- At keys/sec: seconds, which is about one hour.
The lecture’s own figure for the first case rounds up to “1.2 years”; recomputing the same division gives 1.14 years instead, a real (if small) rounding overstatement rather than a stylistic choice (docs/FACTS.md S6). The 10¹³-keys/sec case matches the lecture’s “about an hour” exactly.
Exam detail
A DES key search does not need to check every one of the keys — the average case, half the keyspace, is the figure both the lecture and the exam use for “how long does it take.” Keep the two rates straight: keys/sec models a multicore desktop machine, giving roughly a year; keys/sec models dedicated supercomputer hardware, giving roughly an hour. AES was adopted specifically because it offers 128, 192 and 256 bit keys against exactly this kind of arithmetic — the next topic covers it in full.
Aside
The lecture also states DES was “published in 1977 and standardized in 1979.” The 1977 date holds up: NBS approved DES as a federal standard in November 1976 and published it as FIPS PUB 46 in January 1977. No 1979 standardization event is documented anywhere, however — the next real milestone was ANSI adopting DES as ANSI X3.92, in 1981 (docs/FACTS.md D2). “Published in 1977” is what the exam is safe to mark; treat “standardized in 1979” as a figure the unit gets wrong rather than a fact to repeat.
Mechanism
3DES was introduced as an intermediate fix once DES’s key length became the obvious weak point, without designing an entirely new cipher. It runs DES three times, but not as three plain encryptions in a row. Given plaintext and three keys : First is encrypted with . Then the decryption function, not encryption, is applied with — this does not recover any real plaintext, since , it just runs the DES machinery in reverse with a different key. Finally the result is encrypted again with .
The reason for encrypt-decrypt-encrypt rather than encrypt-encrypt-encrypt is backward compatibility. If all three keys are set equal, , so the middle step cancels out and the whole construction collapses to a single — plain DES. That equivalence only holds because the middle operation is a decryption; three encryptions in a row would not reduce to single DES the same way. This lets 3DES hardware still interoperate with systems that only speak DES.
3DES comes in two variants: two independent keys, reusing as , or three fully independent keys. The two options trade off performance against security. The unit teaches the resulting effective key sizes as bits for the two-key variant and bits for the three-key variant.
Aside
The unit teaches 3DES’s three-key variant as giving “168-bit” effective strength with “no brute-force attack.” NIST rates it differently. SP 800-57 Part 1 Rev. 5 and SP 800-131A Rev. 2 give three-key 3DES (3TDEA) a security strength of only 112 bits, not 168 — a meet-in-the-middle attack on the raw 168-bit key reduces its effective resistance well below the nominal key length. NIST has since disallowed 3TDEA for new use after 2023 entirely. Two-key 3DES (2TDEA) fares worse still, rated at only 80 bits and disallowed earlier (docs/FACTS.md D1). The 168-bit figure is the nominal key length; it is not the same number as attack resistance. The exam marks the unit’s own figure — this is context for why 3DES is no longer recommended in practice, not a correction to write into an exam answer.
Threat
A meet-in-the-middle attack is what drives NIST’s lower rating above. Against a two-key double-DES construction, an attacker does not need to search the full combined keyspace. They precompute for every candidate and store the results, then compute for every candidate against the real ciphertext , looking for a match against the stored table. A match recovers both keys using roughly time and storage — only marginally harder than breaking single DES, and nowhere near the the raw key length would suggest.
Control
Three independent keys close the two-key gap: the meet-in-the-middle table would need to span two of the three key stages at once, which is far more expensive to build and search. That is the whole reason three-key 3DES exists as a distinct option from two-key. It is still not the final answer — NIST’s own 112-bit rating and its 2023 disallowance of 3TDEA for new use show that even three-key 3DES is now considered a stopgap rather than a destination. AES, covered next, is the actual long-term replacement.
Pitfall
Do not write “3DES has 168-bit security.” The unit’s own figure is a nominal key length, not an attack-resistance number, and even the unit frames it as “effective key size” rather than “security strength.” If a question asks for NIST’s rating specifically, the answer is 112 bits for three-key 3DES, not 168.
Source
Week 4 notes PDF