CH 05
CH 05
Introduction to
Modern Symmetric-key
Ciphers
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
5.1
Chapter 5
Objectives
5.2
Chapter 5
Objectives (Contnuied)
5.3
5-1 MODERN BLOCK CIPHERS
5.4
5.1 Continued
5.5
5.1 Continued
Example 5.1
How many padding bits must be added to a message of 100
characters if 8-bit ASCII is used for encoding and the block
cipher accepts blocks of 64 bits?
Solution
Encoding 100 characters using 8-bit ASCII results in an 800-
bit message. The plaintext must be divisible by 64. If | M | and
|Pad| are the length of the message and the length of the
padding,
5.6
5.1.1 Substitution or Transposition
Note
5.7
5.1.1 Continued
Example 5.2
Suppose that we have a block cipher where n = 64. If there
are 10 1’s in the ciphertext, how many trial-and-error tests
does Eve need to do to recover the plaintext from the
intercepted ciphertext in each of the following cases?
a. The cipher is designed as a substitution cipher.
b. The cipher is designed as a transposition cipher.
Solution
a. In the first case, Eve has no idea how many 1’s are in the
plaintext. Eve needs to try all possible 264 64-bit blocks to
find one that makes sense.
b. In the second case, Eve knows that there are exactly 10 1’s
in the plaintext. Eve can launch an exhaustive-search
attack using only those 64-bit blocks that have exactly 10
5.8
1’s.
5.1.3 Continued
P-Boxes: Invertibility
Note
A straight P-box is invertible, but compression and
expansion P-boxes are not.
5.9
5.1.3 Continued
Example 5.7
Figure 5.6 shows how to invert a permutation table
represented as a one-dimensional table.
Figure 5.6 Inverting a permutation table
5.10
5.1.3 Continued
5.11
5.1.3 Continued
S-Box
An S-box (substitution box) can be thought of as a
miniature substitution cipher. The input to an S-box
could be an n-bit word, but the output can be an m-bit
word, where m and n are not necessarily the same.
5.12
5.1.3 Continued
Example 5.8
In an S-box with three inputs and two outputs, we have
5.13
5.1.3 Continued
Example 5.9
In an S-box with three inputs and two outputs, we have
5.14
5.1.3 Continued
Example 5.10
The following table defines the input/output relationship for
an S-box of size 3 × 2. The leftmost bit of the input defines the
row; the two rightmost bits of the input define the column.
The two output bits are values on the cross section of the
selected row and column.
5.16
5.1.3 Continued
Example 5.11
Figure 5.8 shows an example of an invertible S-box. For
example, if the input to the left box is 001, the output is 101.
The input 101 in the right table creates the output 001, which
shows that the two tables are inverses of each other.
5.17
5.1.3 Continued
Exclusive-Or
An important component in most block ciphers is the
exclusive-or operation.
5.18
5.1.3 Continued
Exclusive-Or (Continued)
5.19
5.1.1 Continued
Figure 5.9 Invertibility of the exclusive-or operation
5.20
5.1.3 Continued
Circular Shift
Another component found in some modern block ciphers
is the circular shift operation.
5.21
5.1.3 Continued
Swap
The swap operation is a special case of the circular shift
operation where k = n/2.
5.22
5.1.3 Continued
Split and Combine
5.23
5.1.3 Continued
Figure 5.12 Split and combine operations on an 8-bit word
5.24
5.1.4 Product Ciphers
5.25
5.1.4 Continued
Diffusion
The idea of diffusion is to hide the relationship between
the ciphertext and the plaintext.
Note
Diffusion hides the relationship between the
ciphertext and the plaintext.
5.26
5.1.4 Continued
Confusion
The idea of confusion is to hide the relationship between
the ciphertext and the key.
Note
Confusion hides the relationship between the
ciphertext and the key.
5.27
5.1.4 Continued
Rounds
Diffusion and confusion can be achieved using iterated
product ciphers where each iteration is a combination of
S-boxes, P-boxes, and other components. Each iteration
is referred to as a round. The block cipher uses a key
schedule or key generator that creates different keys for
each round from the cipher key.
5.28
5.1.5 Two Classes of Product Ciphers
1. Feistel ciphers
2. Non-Feistel ciphers
5.29
5.1.5 Continued
Feistel Ciphers
Feistel designed a very intelligent and interesting cipher
that has been used for decades. A Feistel cipher can have
three types of components: self-invertible, invertible, and
noninvertible.
Example: DES
5.30
5.1.5 Continued
Note
Diffusion hides the relationship between the
ciphertext and the plaintext.
5.31
5.1.3 Continued
Example 5.12
This is a trivial example. The plaintext and ciphertext are
each 4 bits long and the key is 3 bits long. Assume that the
function takes the first and third bits of the key, interprets
these two bits as a decimal number, squares the number, and
interprets the result as a 4-bit binary pattern. Show the
results of encryption and decryption if the original plaintext
is 0111 and the key is 101.
Solution
The function extracts the first and second bits to get 11 in
binary or 3 in decimal. The result of squaring is 9, which is
1001 in binary.
5.32
5.1.5 Continued
Figure 5.16 Improvement of the previous Feistel design
5.33
5.1.5 Continued
Figure 5.17 Final design of a Feistel cipher with two rounds
5.34
5.1.5 Continued
Non-Feistel Ciphers
A non-Feistel cipher uses only invertible components. A
component in the encryption cipher has the
corresponding component in the decryption cipher.
Example: AES
5.35