DES
Data Encryption Standard: structure, DES function, key generation, analysis and Triple DES.
Feistel Cipher - ComputerphileComputerphile · the Feistel structure that S-DES and DES use, 8 min
The Data Encryption Standard (DES) Cipher Explained – How Does it Work?Cryptography for Everybody · long: DES rounds, f-function, S-boxes and key schedule, 34 min
DES Algorithm Explained: Data Encryption Standard Step-by-StepPM Expert · short DES overview: 64-bit blocks and the Feistel rounds, 4 min
Data Encryption Standard (DES) - Solved QuestionsNeso Academy · five solved DES questions, 7 minIntroductionSearch on YouTube
HistorySearch on YouTube
DES came from a public request for proposals:
- In 1973, NIST published a request for proposals for a national symmetric-key cryptosystem.
- A proposal from IBM, a modification of a project called Lucifer, was accepted as DES.
- DES was published in the Federal Register in March 1975 as a draft of the Federal Information Processing Standard (FIPS).
DES is the historical reference block cipher. Its structure is a larger version of S-DES, so many steps look familiar.
OverviewSearch on YouTube
DES is a block cipher. It encrypts 64-bit blocks with a 56-bit key (deck Figure 6.1):
| Flow | Input | Output |
|---|---|---|
| Encryption (DES cipher) | 64-bit plaintext, 56-bit key | 64-bit ciphertext |
| Decryption (DES reverse cipher) | 64-bit ciphertext, 56-bit key | 64-bit plaintext |
The key enters the key generator as 64 bits with parity bits. The parity drop removes 8 bits, so the real key has 56 bits. The key space is:
Exams mix two 64-bit values. One is the 64-bit plaintext block. The other is the 64-bit key with parity bits, which reduces to 56 key bits. Write both correctly.
DES structureSearch on YouTube
General structureSearch on YouTube
DES uses 16 rounds. Each round is a Feistel cipher. The full pipeline:
- The 64-bit plaintext goes through the initial permutation (IP).
- The key goes through Permuted Choice 1 (PC-1), the parity drop, which gives 56 bits.
- For each round, the key generator does a left circular shift on the two 28-bit key halves. Then Permuted Choice 2 (PC-2) compresses the 56 bits to the 48-bit round key .
- Each of the 16 rounds uses one round key .
- A 32-bit swap and the inverse initial permutation (), also called the final permutation, give the 64-bit ciphertext.
The deck shows two equal views of the end of the cipher. The Stallings figure has 16 rounds with a swap in each round, then one extra 32-bit swap. The Forouzan figure has no swapper in round 16. The two views give the same ciphertext.
Structure order: IP, 16 Feistel rounds (with ), swap, . Key bits arrive as 64, lose 8 parity bits, shift in two 28-bit halves, then compress to 48. The data stays as two 32-bit halves through all rounds.
Initial and final permutationsSearch on YouTube
The initial permutation moves each of the 64 bits to a new position. For example, input bit 1 goes to output position 40, and input bit 2 goes to output position 8. The final permutation is the exact inverse of the IP. Read each table left to right, row by row. Entry gives the input bit that goes to output position .
Initial permutation:
| IP | 58 | 50 | 42 | 34 | 26 | 18 | 10 | 02 |
|---|---|---|---|---|---|---|---|---|
| Row 2 | 60 | 52 | 44 | 36 | 28 | 20 | 12 | 04 |
| Row 3 | 62 | 54 | 46 | 38 | 30 | 22 | 14 | 06 |
| Row 4 | 64 | 56 | 48 | 40 | 32 | 24 | 16 | 08 |
| Row 5 | 57 | 49 | 41 | 33 | 25 | 17 | 09 | 01 |
| Row 6 | 59 | 51 | 43 | 35 | 27 | 19 | 11 | 03 |
| Row 7 | 61 | 53 | 45 | 37 | 29 | 21 | 13 | 05 |
| Row 8 | 63 | 55 | 47 | 39 | 31 | 23 | 15 | 07 |
Final permutation:
| FP | 40 | 08 | 48 | 16 | 56 | 24 | 64 | 32 |
|---|---|---|---|---|---|---|---|---|
| Row 2 | 39 | 07 | 47 | 15 | 55 | 23 | 63 | 31 |
| Row 3 | 38 | 06 | 46 | 14 | 54 | 22 | 62 | 30 |
| Row 4 | 37 | 05 | 45 | 13 | 53 | 21 | 61 | 29 |
| Row 5 | 36 | 04 | 44 | 12 | 52 | 20 | 60 | 28 |
| Row 6 | 35 | 03 | 43 | 11 | 51 | 19 | 59 | 27 |
| Row 7 | 34 | 02 | 42 | 10 | 50 | 18 | 58 | 26 |
| Row 8 | 33 | 01 | 41 | 09 | 49 | 17 | 57 | 25 |
Permutation examplesSearch on YouTube
Example 1. Find the output of the final permutation when the input is:
Only bits 25 and 63 are 1s. The final permutation sends input bit 25 to output bit 64 and input bit 63 to output bit 15. The result is:
Example 2. Prove that the IP and the final permutation are inverses. Find the IP output when the input is .
The input has only two 1s, so the output also has only two 1s. From the IP table, input bit 15 becomes output bit 63, and input bit 64 becomes output bit 25. The output has 1s at bits 25 and 63:
The round trip gives the start value again. Thus the two permutations are inverses, as IP and IP are in S-DES.
A roundSearch on YouTube
Each round takes and (32 bits each) and has two parts:
- Mixer: XORs with .
- Swapper: the two halves change places.
The DES functionSearch on YouTube
Function overviewSearch on YouTube
The heart of DES is the DES function. It applies a 48-bit key to the rightmost 32 bits and produces a 32-bit output.
The DES function has four parts:
- Expansion P-box: expands from 32 bits to 48 bits.
- XOR: the expanded XORs with the 48-bit round key .
- S-boxes: 8 substitution boxes change the 48 bits back to 32 bits.
- Straight P-box: a 32-bit permutation gives the 32-bit output.
Expansion P-boxSearch on YouTube
has 32 bits and has 48 bits, so DES first expands to 48 bits. The input splits into eight 4-bit sections. Each section becomes 6 bits: it gets one bit from each neighbor section. Thus 16 of the 32 input bits appear twice. At the ends, the bits wrap around: output bit 1 takes input bit 32, and the last output bit takes input bit 1.
| E | 32 | 01 | 02 | 03 | 04 | 05 |
|---|---|---|---|---|---|---|
| Row 2 | 04 | 05 | 06 | 07 | 08 | 09 |
| Row 3 | 08 | 09 | 10 | 11 | 12 | 13 |
| Row 4 | 12 | 13 | 14 | 15 | 16 | 17 |
| Row 5 | 16 | 17 | 18 | 19 | 20 | 21 |
| Row 6 | 20 | 21 | 22 | 23 | 24 | 25 |
| Row 7 | 24 | 25 | 26 | 27 | 28 | 29 |
| Row 8 | 28 | 29 | 30 | 31 | 32 | 01 |
The relation between input and output can be written as a formula, but DES uses this table to define the P-box. Compare it with E/P in S-DES, which expands 4 bits to 8 bits for the same reason.
XOR with the round keySearch on YouTube
After the expansion permutation, DES XORs the expanded right section with the round key. Both inputs have 48 bits. DES uses the round key only in this operation.
S-boxesSearch on YouTube
The S-boxes do the real mixing (confusion). DES uses 8 S-boxes, each with a 6-bit input and a 4-bit output:
Each 6-bit chunk selects one row and one column of its S-box:
| bit position | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| Use | row bit 1 | column | column | column | column | row bit 2 |
- Bit 1 and bit 6 together give a 2-bit row (0..3).
- Bits 2..5 (the middle 4) give a 4-bit column (0..15).
- The table entry (0..15) is the 4-bit output.
Each S-box table has 4 rows and 16 columns, so it has entries. This is the DES version of the S-DES rule, where the outer bits also give the row.
S-box examplesSearch on YouTube
Example 1. The input to S-box 1 is . The first and sixth bits give , which is row 3. The remaining bits give column 1. Row 3, column 1 of S-box 1 holds , which is :
Example 2. The input to S-box 8 is . The first and sixth bits give , which is row 0. The remaining bits give column 0. Row 0, column 0 of S-box 8 holds , which is :
S-box tablesSearch on YouTube
The deck shows only S-box 1. For the other seven boxes, it refers to the textbook. All eight tables are here for reference.
S-box 1:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 14 | 4 | 13 | 1 | 2 | 15 | 11 | 8 | 3 | 10 | 6 | 12 | 5 | 9 | 0 | 7 |
| 1 | 0 | 15 | 7 | 4 | 14 | 2 | 13 | 1 | 10 | 6 | 12 | 11 | 9 | 5 | 3 | 8 |
| 2 | 4 | 1 | 14 | 8 | 13 | 6 | 2 | 11 | 15 | 12 | 9 | 7 | 3 | 10 | 5 | 0 |
| 3 | 15 | 12 | 8 | 2 | 4 | 9 | 1 | 7 | 5 | 11 | 3 | 14 | 10 | 0 | 6 | 13 |
S-box 2:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 15 | 1 | 8 | 14 | 6 | 11 | 3 | 4 | 9 | 7 | 2 | 13 | 12 | 0 | 5 | 10 |
| 1 | 3 | 13 | 4 | 7 | 15 | 2 | 8 | 14 | 12 | 0 | 1 | 10 | 6 | 9 | 11 | 5 |
| 2 | 0 | 14 | 7 | 11 | 10 | 4 | 13 | 1 | 5 | 8 | 12 | 6 | 9 | 3 | 2 | 15 |
| 3 | 13 | 8 | 10 | 1 | 3 | 15 | 4 | 2 | 11 | 6 | 7 | 12 | 0 | 5 | 14 | 9 |
S-box 3:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 10 | 0 | 9 | 14 | 6 | 3 | 15 | 5 | 1 | 13 | 12 | 7 | 11 | 4 | 2 | 8 |
| 1 | 13 | 7 | 0 | 9 | 3 | 4 | 6 | 10 | 2 | 8 | 5 | 14 | 12 | 11 | 15 | 1 |
| 2 | 13 | 6 | 4 | 9 | 8 | 15 | 3 | 0 | 11 | 1 | 2 | 12 | 5 | 10 | 14 | 7 |
| 3 | 1 | 10 | 13 | 0 | 6 | 9 | 8 | 7 | 4 | 15 | 14 | 3 | 11 | 5 | 2 | 12 |
S-box 4:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 7 | 13 | 14 | 3 | 0 | 6 | 9 | 10 | 1 | 2 | 8 | 5 | 11 | 12 | 4 | 15 |
| 1 | 13 | 8 | 11 | 5 | 6 | 15 | 0 | 3 | 4 | 7 | 2 | 12 | 1 | 10 | 14 | 9 |
| 2 | 10 | 6 | 9 | 0 | 12 | 11 | 7 | 13 | 15 | 1 | 3 | 14 | 5 | 2 | 8 | 4 |
| 3 | 3 | 15 | 0 | 6 | 10 | 1 | 13 | 8 | 9 | 4 | 5 | 11 | 12 | 7 | 2 | 14 |
S-box 5:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 2 | 12 | 4 | 1 | 7 | 10 | 11 | 6 | 8 | 5 | 3 | 15 | 13 | 0 | 14 | 9 |
| 1 | 14 | 11 | 2 | 12 | 4 | 7 | 13 | 1 | 5 | 0 | 15 | 10 | 3 | 9 | 8 | 6 |
| 2 | 4 | 2 | 1 | 11 | 10 | 13 | 7 | 8 | 15 | 9 | 12 | 5 | 6 | 3 | 0 | 14 |
| 3 | 11 | 8 | 12 | 7 | 1 | 14 | 2 | 13 | 6 | 15 | 0 | 9 | 10 | 4 | 5 | 3 |
S-box 6:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 12 | 1 | 10 | 15 | 9 | 2 | 6 | 8 | 0 | 13 | 3 | 4 | 14 | 7 | 5 | 11 |
| 1 | 10 | 15 | 4 | 2 | 7 | 12 | 9 | 5 | 6 | 1 | 13 | 14 | 0 | 11 | 3 | 8 |
| 2 | 9 | 14 | 15 | 5 | 2 | 8 | 12 | 3 | 7 | 0 | 4 | 10 | 1 | 13 | 11 | 6 |
| 3 | 4 | 3 | 2 | 12 | 9 | 5 | 15 | 10 | 11 | 14 | 1 | 7 | 6 | 0 | 8 | 13 |
S-box 7:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 4 | 11 | 2 | 14 | 15 | 0 | 8 | 13 | 3 | 12 | 9 | 7 | 5 | 10 | 6 | 1 |
| 1 | 13 | 0 | 11 | 7 | 4 | 9 | 1 | 10 | 14 | 3 | 5 | 12 | 2 | 15 | 8 | 6 |
| 2 | 1 | 4 | 11 | 13 | 12 | 3 | 7 | 14 | 10 | 15 | 6 | 8 | 0 | 5 | 9 | 2 |
| 3 | 6 | 11 | 13 | 8 | 1 | 4 | 10 | 7 | 9 | 5 | 0 | 15 | 14 | 2 | 3 | 12 |
S-box 8:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 13 | 2 | 8 | 4 | 6 | 15 | 11 | 1 | 10 | 9 | 3 | 14 | 5 | 0 | 12 | 7 |
| 1 | 1 | 15 | 13 | 8 | 10 | 3 | 7 | 4 | 12 | 5 | 6 | 11 | 0 | 14 | 9 | 2 |
| 2 | 7 | 11 | 4 | 1 | 9 | 12 | 14 | 2 | 0 | 6 | 10 | 13 | 15 | 3 | 5 | 8 |
| 3 | 2 | 1 | 14 | 7 | 4 | 10 | 8 | 13 | 15 | 12 | 9 | 0 | 3 | 5 | 6 | 11 |
The deck's S-box 1 slide has a typing error in row 1 (columns 7 to 9 read 10, 03, 06). The correct DES values are 01, 10, 06, as in the table above. Each row of an S-box holds every value 0..15 once.
S-box rule: outer bits pick the row, inner four bits pick the column, and the output has 4 bits. For the exam, learn the lookup rule and the two deck examples: input gives , and input gives . Do not learn all eight tables by heart.
Straight permutationSearch on YouTube
The straight permutation keeps the size at 32 bits and changes the bit order:
| P | 16 | 07 | 20 | 21 | 29 | 12 | 28 | 17 |
|---|---|---|---|---|---|---|---|---|
| Row 2 | 01 | 15 | 23 | 26 | 05 | 18 | 31 | 10 |
| Row 3 | 02 | 08 | 24 | 14 | 32 | 27 | 03 | 09 |
| Row 4 | 19 | 13 | 30 | 06 | 22 | 11 | 04 | 25 |
After this P-box, the DES function returns 32 bits for the Feistel XOR.
Key generationSearch on YouTube
Parity-bit dropSearch on YouTube
The round-key generator receives a 64-bit key with parity bits. It drops the 8 parity bits (bits 8, 16, ..., 64) and permutes the other 56 bits. The deck's parity-bit drop table (PC-1):
| PC-1 | 57 | 49 | 41 | 33 | 25 | 17 | 09 | 01 |
|---|---|---|---|---|---|---|---|---|
| Row 2 | 58 | 50 | 42 | 34 | 26 | 18 | 10 | 02 |
| Row 3 | 59 | 51 | 43 | 35 | 27 | 19 | 11 | 03 |
| Row 4 | 60 | 52 | 44 | 36 | 63 | 55 | 47 | 39 |
| Row 5 | 31 | 23 | 15 | 07 | 62 | 54 | 46 | 38 |
| Row 6 | 30 | 22 | 14 | 06 | 61 | 53 | 45 | 37 |
| Row 7 | 29 | 21 | 13 | 05 | 28 | 20 | 12 | 04 |
The output splits into two halves of 28 bits. The left half is the first 28 entries (up to 36 in row 4). The right half is the last 28 entries (from 63 in row 4).
Shift scheduleSearch on YouTube
In each round, the two halves do a left circular shift:
| Rounds | Shift |
|---|---|
| 1, 2, 9, 16 | one bit |
| Others | two bits |
| Round | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Bit shifts | 1 | 1 | 2 | 2 | 2 | 2 | 2 | 2 | 1 | 2 | 2 | 2 | 2 | 2 | 2 | 1 |
The total shift over the 16 rounds is bits. That is one full cycle of a 28-bit half, so each half is back at its start position after round 16.
Shift hook: rounds 1, 2, 9 and 16 shift one bit; the other rounds shift two bits. Think "1 1 at the start, 1 in the middle (9), 1 at the end (16)". The 28 shifts close one full cycle.
Key compressionSearch on YouTube
After the shift in each round, the 56 bits go through the compression P-box (PC-2). It drops 8 bits and gives the 48-bit round key. The deck's key-compression table:
| PC-2 | 14 | 17 | 11 | 24 | 01 | 05 | 03 | 28 |
|---|---|---|---|---|---|---|---|---|
| Row 2 | 15 | 06 | 21 | 10 | 23 | 19 | 12 | 04 |
| Row 3 | 26 | 08 | 16 | 07 | 27 | 20 | 13 | 02 |
| Row 4 | 41 | 52 | 31 | 37 | 47 | 55 | 30 | 40 |
| Row 5 | 51 | 45 | 33 | 48 | 44 | 49 | 39 | 56 |
| Row 6 | 34 | 53 | 46 | 42 | 50 | 36 | 29 | 32 |
Key generation summarySearch on YouTube
The shifts accumulate round by round, with 1 or 2 bits in each round. Each round key is used once, in the XOR of the DES function.
Sizes at a glance:
Worked exampleSearch on YouTube
Encryption traceSearch on YouTube
The deck runs one full encryption. All values are hexadecimal. Key: . Plaintext: . Ciphertext: .
| Step | Value |
|---|---|
| Plaintext | |
| After initial permutation | |
| After splitting | , |
The Left column shows and the Right column shows after each round. Each equals from the round before. Round 16 has no swap, so .
| Round | Left | Right | Round key |
|---|---|---|---|
| 1 | |||
| 2 | |||
| 3 | |||
| 4 | |||
| 5 | |||
| 6 | |||
| 7 | |||
| 8 | |||
| 9 | |||
| 10 | |||
| 11 | |||
| 12 | |||
| 13 | |||
| 14 | |||
| 15 | |||
| 16 |
After combination: . After the final permutation:
Decryption traceSearch on YouTube
Bob, at the destination, decrypts the ciphertext from Alice with the same key. Decryption uses the same algorithm with the round keys in reverse order. Bob applies the IP, then 16 rounds with first and last, then the final permutation.
| Step | Value |
|---|---|
| Ciphertext | |
| After initial permutation | |
| After splitting | , |
| Round | Left | Right | Round key |
|---|---|---|---|
| 1 | () | ||
| 2 | () | ||
| ... | ... | ... | ... |
| 15 | () | ||
| 16 | () |
After combination: . After the final permutation:
The values in the decryption trace are the encryption values in reverse order. The Feistel structure lets decryption use the same rounds; only the key order changes.
Exam trap: DES encryption and decryption use the same rounds. The only change is the key order, which runs backwards. When a question asks how Bob decrypts, write "round keys to ".
DES analysisSearch on YouTube
Avalanche effectSearch on YouTube
Critics have analyzed DES in detail. Tests measure how strong DES is in some properties that a block cipher must have. Two of these properties are the avalanche effect and completeness.
To check the avalanche effect, the deck encrypts two plaintext blocks with the same key, . The plaintexts differ only in the rightmost bit:
| Plaintext | Ciphertext | |
|---|---|---|
| Block 1 | ||
| Block 2 |
The two ciphertext blocks differ in 29 bits. Thus a change of about 1.5 percent of the plaintext () gives a change of about 45 percent of the ciphertext ().
Number of bit differences after each round:
| Rounds | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Bit differences | 1 | 6 | 20 | 29 | 30 | 33 | 32 | 29 | 32 | 39 | 33 | 28 | 30 | 31 | 30 | 29 |
The difference spreads fast. From round 4 on, it stays between 28 and 39 of the 64 bits.
Avalanche means: if one plaintext bit changes, the ciphertext must look completely different. Without it, an attacker can make small plaintext changes and match the ciphertext changes bit by bit.
Completeness effectSearch on YouTube
Completeness effect means that each bit of the ciphertext must depend on many bits of the plaintext.
Key sizeSearch on YouTube
- A 56-bit key gives values.
- A brute-force search looked hard, but advances have made it possible:
- 1997: broken on the Internet in a few months.
- 1998: broken on dedicated hardware (EFF) in a few days.
- 1999: broken by the two methods together in 22 hours.
- The attacker must still recognize the plaintext when a test key is correct.
- These results forced users to consider alternatives to DES.
Timing attacksSearch on YouTube
Timing attacks attack the actual implementation of the cipher, not the algorithm:
- They use knowledge of the effects of an implementation to find some or all subkey bits.
- They use the fact that calculations can take different times, which depend on the input values.
The main practical weakness of DES is the short 56-bit key. Timing attacks show that an implementation can also leak secret data.
Triple DESSearch on YouTube
AlgorithmSearch on YouTube
Triple DES (3DES) is the practical answer to the short DES key.
- 3DES uses a block of 64 bits.
- It uses three DES keys , , , each of 56 bits.
- The encryption follows an EDE sequence:
- In words: DES encrypt with , DES decrypt with , then DES encrypt with .
DecryptionSearch on YouTube
Decryption does the reverse steps. It uses the keys in reverse order, and each cipher becomes its reverse cipher:
The deck figure shows encryption as DES cipher (), DES reverse cipher (), DES cipher (). Decryption runs from the ciphertext: DES reverse cipher (), DES cipher (), DES reverse cipher ().
ApplicationsSearch on YouTube
- The electronic payment industry uses Triple DES and continues to develop and publish standards based on it.
- Microsoft OneNote and Microsoft Outlook 2007 use Triple DES to password-protect user content.
BenefitsSearch on YouTube
- With a 168-bit key length, 3DES is not open to brute-force attack.
- 3DES is based on the DES algorithm, so it is easy to change existing software to use Triple DES.
DrawbacksSearch on YouTube
- It has three times as many rounds as DES, so it is slower.
- It uses a 64-bit block size. For both efficiency and security, a larger block size is better.
- Thus NIST issued a call for proposals for the Advanced Encryption Standard (AES) to replace DES.
3DES reasoning chain for the exam. Brute force breaks DES: the keys fell in 22 hours in 1999. 3DES increases the key to 168 bits and reuses DES code. But 3DES is slow and keeps the 64-bit block. Thus NIST called for AES.
Quick self-testSearch on YouTube
What are the input and output sizes in DES, and what happens to the key bits?
The input is a 64-bit plaintext and the output is a 64-bit ciphertext. The key has 56 bits. The key generator receives 64 bits with 8 parity bits, and the parity drop (PC-1) removes the parity bits first.
How many rounds does DES use and what cipher type is each round?
DES uses 16 rounds, and each round is a Feistel cipher. The round splits the 64-bit state into two 32-bit halves. It applies the DES function to the right half with the round key. It XORs the result into the left half, then swaps the halves.
Show that the IP and the final permutation are inverses, with the deck example.
Input has bits 25 and 63 set. The final permutation sends bit 25 to output 64 and bit 63 to output 15, which gives . The IP sends bit 15 to 63 and bit 64 to 25, which gives again.
List the four parts of the DES function and their sizes.
Expansion P-box: 32 to 48 bits. XOR with the 48-bit round key. Eight S-boxes: eight 6-bit inputs give eight 4-bit outputs, so 48 bits become 32 bits. Straight P-box: 32 to 32 bits.
How does an S-box change a 6-bit input into 4 bits?
Bit 1 and bit 6 give a 2-bit row index (0..3). Bits 2 to 5 give a 4-bit column index (0..15). The table entry at that row and column is the 4-bit output. Example: S-box 1, input , row 3 and column 1 give 12, so the output is .
Give the DES key schedule sizes and the shift schedule.
PC-1 keeps 56 of the 64 key bits and splits them into two 28-bit halves. In each round, the halves do a left circular shift. The shift is 1 bit in rounds 1, 2, 9 and 16, and 2 bits in the other 12 rounds. The total is 28 bits, one full cycle. PC-2 then compresses 56 bits to the 48-bit .
Trace the deck's worked encryption example.
Key , plaintext . After the IP: , so and . After 16 rounds with keys to , and . The combination is , and the final permutation gives .
How does Bob decrypt, with the deck trace?
Bob uses the same rounds with the keys in reverse order. After the IP, ciphertext gives and . Round 1 uses and round 16 uses . The combination is , and the final permutation gives .
Define the avalanche effect and the completeness effect with the deck numbers.
Avalanche: with key , the plaintexts and give ciphertexts that differ in 29 bits. A 1.5 percent change in the plaintext gives a 45 percent change in the ciphertext. Completeness: each ciphertext bit must depend on many plaintext bits.
Give the strength record of DES and describe timing attacks.
DES has keys. It was broken in 1997 on the Internet in a few months. In 1998, the EFF's dedicated hardware broke it in a few days. In 1999, the two methods together broke it in 22 hours. Timing attacks use the different calculation times of an implementation to find some or all subkey bits.
Give the 3DES formula, its benefits and its drawbacks.
with three 56-bit keys, and . Benefits: the 168-bit key stops brute force, and existing DES software is easy to change. Drawbacks: three times the rounds makes it slower, and the 64-bit block is small. Thus NIST called for AES as the replacement.
- DES: block cipher, 64-bit blocks, 56-bit key ( values), 16 Feistel rounds. IBM based it on Lucifer, and it was published as a draft FIPS in March 1975.
- Data path: IP, then 16 rounds, then the final permutation (). The DES function expands 32 to 48 bits, XORs , uses eight S-boxes to get 32 bits, then does a straight permutation.
- S-boxes: the outer bits give the row and the middle four bits give the column. input gives , and input gives .
- Key schedule: PC-1 drops the parity bits (64 to 56). The halves shift 1 bit in rounds 1, 2, 9 and 16 and 2 bits in the other rounds. PC-2 compresses 56 to 48 bits. Decryption uses the round keys in reverse order.
- Analysis: avalanche (one plaintext bit changes about 45 percent of the ciphertext bits) and completeness (each ciphertext bit depends on many plaintext bits).
- Brute force broke the 56-bit key in 22 hours by 1999. 3DES (EDE, , 168-bit key) replaced DES for a time. It is slow and has a 64-bit block, so NIST called for AES.