{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

applied cryptography - protocols, algorithms, and source code in c

# This sounds impossible to me too but i assure you it

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ent the S-boxes in software as 64-entry arrays. It takes some rearranging of the entries to do this, but that’s not hard. (Don’t just change the indexing without rearranging the entries. The S-boxes are designed very carefully.) However, this way of describing the S-boxes helps visualize how they work. Each S-box can be viewed as a substitution function on a 4-bit entry: b2 through b5 go in, and a 4-bit result comes out. Bits b1 and b6 come from neighboring blocks; they select one out of four substitution functions available in the particular S-box. The S-box substitution is the critical step in DES. The algorithm’s other operations are linear and easy to analyze. The S-boxes are nonlinear and, more than anything else, give DES its security. The result of this substitution phase is eight 4-bit blocks which are recombined into a single 32-bit block. This block moves to the next step: the P-box permutation. The P-Box Permutation The 32-bit output of the S-box substitution is permuted according to a P-box. This permutation maps each input bit to an output position; no bits are used twice and no bits are ignored. This is called a straight permutation or just a permutation. Table 12.7 shows the position to which each bit moves. For example, bit 21 moves to bit 4, while bit 4 moves to bit 31. Figure 12.4 S-box substitution. Table 12.6 S-Boxes S-box 1: 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13, S-box 2: 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5, 14, 0, 4, 15, 15, 3, 0, 14, 7, 13, 8, 10, S-box 3: 10, 0, 9, 13, 7, 0, 13, 6, 4, 1, 10, 13, S-box 4: 7, 13, 14, 13, 8, 11, 10, 6, 9, 3, 15, 0, S-box 5: 2, 12, 4, 14, 11, 2, 4, 2, 1, 11, 8, 12, S-box 6: 12, 1, 10, 10, 15, 4, 9, 14, 15, 4, 3, 2, S-box 7: 4, 11, 2, 13, 0, 11, 1, 4, 11, 6, 11, 13, S-box 8: 13, 2, 8, 1, 15, 13, 7, 11, 4, 2, 1, 14, 11, 10, 4, 13, 1, 3, 15, 4, 14, 9, 9, 0, 1, 5, 2, 11, 8, 12, 6, 6, 7, 12, 9, 0, 3, 2, 15, 5, 14, 9, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8, 3...
View Full Document

{[ snackBarMessage ]}