SlideShare a Scribd company logo
●Diffusion : to hide the relationship between the
cipher text and the plain text.
●Diffusion implies that each symbol in the cipher
text is dependent on some or all symbols in the
plain text.
●This will frustrate the opponent who use cipher
text statistics to find the plain text.
●Confusion: to hide the relationship between the
cipher text and the key.
●If a single bit in the key is changed most or all bits
in the cipher text will also be changed.
●This will frustrate the opponent who use cipher
text statistics to find the key
Confusion and Diffusion
10-Feb-21
5.2
5-1 MODERN BLOCK
CIPHERS
A symmetric-key modern block cipher encrypts an
n-bit block of plaintext or decrypts an n-bit block of
ciphertext. The encryption or decryption algorithm
uses a k-bit key.
5.1.1 Substitution or Transposition
5.1.2 Block Ciphers as Permutation Groups
5.1.3 Components of a Modern Block Cipher
5.1.4 Product Ciphers
5.1.5 Two Classes of Product Ciphers
5.1.6 Attacks on Block Ciphers
Topics discussed in this section:
5.3
Figure 5.1 A modern block cipher
5.1
Continued
5.4
Modern block ciphers normally are keyed substitution
ciphers in which the key allows only partial mappings
from the possible inputs to the possible outputs.
5.1.3 Components of a Modern Block
Cipher
A P-box (permutation box) parallels the traditional
transposition cipher for characters. It transposes bits.
P-Boxes
5.5
Figure 5.4 Three types of P-
boxes
5.1.3
Continued
5.6
Example 5.5
5.1.3
Continued
Figure 5.5 The possible mappings of a 3 × 3 P-
box
Figure 5.5 shows all 6 possible mappings of a 3 × 3 P-box.
5.7
5.1.3
Continued
Table 5.1 Example of a permutation table for a straight P-
box
Straight P-
Boxes
5.8
Example 5.6
5.1.2
Continued
Design an 8 × 8 permutation table for a straight P-box that
moves the two middle bits (bits 4 and 5) in the input word to
the two ends (bits 1 and 8) in the output words. Relative
positions of other bits should not be changed.
Solution
We need a straight P-box with the table [4 1 2 3 6 7 8 5].
The relative positions of input bits 1, 2, 3, 6, 7, and 8 have not
been changed, but the first output takes the fourth input and
the eighth output takes the fifth input.
5.9
Compression P-Boxes
5.1.3
A compression P-box is a P-box with n inputs and m
outputs where m < n.
Table 5.2 Example of a 32 × 24 permutation table
5.10
5.1.3
Continued
Table 5.2 Example of a 32 × 24 permutation table
Compression P-Box
5.11
Expansion P-Boxes
5.1.3
Continued
An expansion P-box is a P-box with n inputs and m
outputs where m > n.
Table 5.3 Example of a 12 × 16 permutation table
5.12
5.1.3
Continued
P-Boxes:
Invertibility
A straight P-box is invertible, but compression and
expansion P-boxes are not.
Note
5.13
Example 5.7
5.1.3
Continued
Figure 5.6 shows how to invert a permutation table
represented as a one-dimensional table.
Figure 5.6 Inverting a permutation
table
5.14
Figure 5.7 Compression and expansion P-boxes are non-
invertible
5.1.3
Continued
5.15
5.1.3
Continued
S-Box
An S-box (substitution box) can be thought of as a
miniature substitution cipher.
An S-box is an m × n substitution unit, where m and
n are not necessarily the same.
Note
5.16
Example 5.8
5.1.3
Continued
In an S-box with three inputs and two outputs, we have
The S-box is linear because a1,1 = a1,2 = a1,3 = a2,1 = 1 and
a2,2 = a2,3 = 0. The relationship can be represented by matrices,
as shown below:
5.17
Example 5.9
5.1.3
Continued
In an S-box with three inputs and two outputs, we have
where multiplication and addition is in GF(2). The S-box is
nonlinear because there is no linear relationship between the
inputs and the outputs.
5.18
Example 5.10
5.1.3
Continued
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.
Based on the table, an input of 010 yields the output 01. An
input of 101 yields the output of 00.
5.20
Example 5.11
5.1.3
Continued
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.
Figure 5.8 S-box tables for Example 5.11
5.21
5.1.3
Continued
Exclusive-
Or
An important component in most block ciphers is the
exclusive-or operation.
Figure 5.9 Invertibility of the exclusive-or
operation
5.22
5.1.3
Continued
Exclusive-Or (Continued)
An important component in most block ciphers is the
exclusive-or operation. As we discussed in Chapter 4,
addition and subtraction operations in the GF(2n
) field
are performed by a single operation called the exclusive-
or (XOR).
The five properties of the exclusive-or operation in the
GF(2n) field makes this operation a very interesting
component for use in a block cipher: closure,
associativity, commutativity, existence of identity, and
existence of inverse.
5.24
Figure 5.9 Invertibility of the exclusive-or
operation
5.1.1
Continued
5.25
5.1.3
Continued
Circular Shift
Another component found in some modern block ciphers
is the circular shift operation.
Figure 5.10 Circular shifting an 8-bit word to the left or
right
5.26
5.1.3
Continued
Swap
The swap operation is a special case of the circular shift
operation where k = n/2.
Figure 5.11 Swap operation on an 8-bit word
5.27
5.1.3
Continued
Split and Combine
Two other operations found in some block ciphers are
split and combine.
Figure 5.12 Split and combine operations on an 8-bit
word
5.28
Figure 5.12 Split and combine operations on an 8-bit
word
5.1.3
Continued
5.29
Shannon introduced the concept of a product cipher. A
product cipher is a complex cipher combining
substitution, permutation, and other components
discussed in previous sections.
5.1.4 Product
Ciphers
5.30
Diffusion
The idea of diffusion is to hide the relationship between
the ciphertext and the plaintext.
5.1.4
Continued
Diffusion hides the relationship between the
ciphertext and the plaintext.
Note
5.31
Confusion
The idea of confusion is to hide the relationship between
the ciphertext and the key.
5.1.4
Continued
Confusion hides the relationship between the
ciphertext and the key.
Note
5.32
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.
5.1.4
Continued
5.33
Figure 5.13 A product cipher made of two
rounds
5.1.4
Continued
5.34
Figure 5.14 Diffusion and confusion in a block
cipher
5.1.4
Continued
5.35
Modern block ciphers are all product ciphers, but they
are divided into two classes.
1. Feistel ciphers
2. Non-Feistel ciphers
5.1.5 Two Classes of Product Ciphers
5.36
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.
5.1.5
Continued
5.37
Figure 5.15 The first thought in Feistel cipher
design
5.1.5
Continued
Diffusion hides the relationship between the
ciphertext and the plaintext.
Note
5.38
Example 5.12
5.1.3
Continued
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.
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.
Solution
5.39
Figure 5.16 Improvement of the previous Feistel
design
5.1.5
Continued
5.40
Figure 5.17 Final design of a Feistel cipher with two
rounds
5.1.5
Continued
5.41
5.1.5 Blowfish with one round
5.42
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.
5.1.5
Continued
5.43
Attacks on traditional ciphers can also be used on
modern block ciphers, but today’s block ciphers resist
most of the attacks discussed in Chapter 3.
5.1.6 Attacks on Block Ciphers
5.44
Differential Cryptanalysis
Eli Biham and Adi Shamir introduced the idea of
differential cryptanalysis. This is a chosen-plaintext
attack.
5.1.5
Continued
5.45
Example 5.13
5.1.6
Continued
Assume that the cipher is made only of one exclusive-or
operation, as shown in Figure 5.18. Without knowing the
value of the key, Eve can easily find the relationship between
plaintext differences and ciphertext differences if by plaintext
difference we mean P1 ⊕ P2 and by ciphertext difference, we
mean C1⊕ C2. The following proves that C1 ⊕ C2 = P1 ⊕
P2:
Figure 5.18 Diagram for Example
5.13
5.46
Example 5.14
5.1.6
Continued
We add one S-box to Example 5.13, as shown in Figure 5.19.
Figure 5.19 Diagram for Example
5.14
5.47
Example 5.14 Continued
5.1.6
Continued
Eve now can create a probabilistic relationship as shone in
Table 5.4.
Table 5.4 Differential input/output
5.48
Example 5.15
5.1.6
Continued
The heuristic result of Example 5.14 can create probabilistic
information for Eve as shown in Table 5.5.
Table 5.5 Differential distribution table
5.49
Example 5.16
5.1.6
Continued
Looking at Table 5.5, Eve knows that if P1 ⊕ P2 = 001, then C1
⊕ C2 = 11 with the probability of 0.50 (50 percent). She tries
C1 = 00 and gets P1 = 010 (chosen-ciphertext attack). She also
tries C2 = 11 and gets P2 = 011 (another chosen-ciphertext
attack). Now she tries to work backward, based on the first
pair, P1 and C1,
The two tests confirm that K = 011 or K =101.
5.50
5.1.6
Continued
A more detailed differential cryptanalysis is given
in Appendix N.
Note
Differential cryptanalysis is based on a nonuniform
differential distribution table of the S-boxes in a
block cipher.
Note
5.51
Linear Cryptanalysis
Linear cryptanalysis was presented by Mitsuru Matsui in
1993. The analysis uses known plaintext attacks.
5.1.6
Continued
5.52
Figure 5.20 A simple cipher with a linear S-box
5.1.6
Continued
5.53
5.1.6
Continued
Solving for three unknowns, we get.
This means that three known-plaintext attacks can find
the values of k0, k1, and k2 .
5.54
5.1.6
Continued
In some modern block ciphers, it may happen that some
S-boxes are not totally nonlinear; they can be
approximated, probabilistically, by some linear functions.
where 1 ≤ x ≤ m, 1 ≤ y ≤ n, and 1 ≤ z ≤ n.
A more detailed linear cryptanalysis is given in
Appendix N.
Note
5.55
5-2 MODERN STREAM
CIPHERS
In a modern stream cipher, encryption and decryption
are done r bits at a time. We have a plaintext bit stream
P = pn…p2 p1, a ciphertext bit stream
C = cn…c2 c1, and a key bit stream K = kn…k2 k1, in
which pi , ci , and ki are r-bit words.
5.2.1 Synchronous Stream Ciphers
5.2.2 Nonsynchronous Stream Ciphers
Topics discussed in this section:
5.56
5.2
Continued
In a modern stream cipher, each r-bit word in the
plaintext stream is enciphered using an r-bit word
in the key stream to create the corresponding r-bit
word in the ciphertext stream.
Note
Figure 5.20 Stream
cipher
5.57
5.2.1 Synchronous Stream
Ciphers
In a synchronous stream cipher the key is
independent of the plaintext or ciphertext.
Note
Figure 5.22 One-time
pad
5.58
Example 5.17
5.2.1
Continued
What is the pattern in the ciphertext of a one-time pad cipher
in each of the following cases?
a. The plaintext is made of n 0’s.
b. The plaintext is made of n 1’s.
c. The plaintext is made of alternating 0’s and 1’s.
d. The plaintext is a random string of bits.
Solution
a. Because 0 ⊕ ki = ki , the ciphertext stream is the same as
the key stream. If the key stream is random, the
ciphertext is also random. The patterns in the plaintext
are not preserved in the ciphertext.
5.59
Example 5.7
5.2.1
Continued
b. Because 1 ⊕ ki = ki where ki is the complement of ki , the
ciphertext stream is the complement of the key stream. If
the key stream is random, the ciphertext is also random.
Again the patterns in the plaintext are not preserved in
the ciphertext.
c. In this case, each bit in the ciphertext stream is either the
same as the corresponding bit in the key stream or the
complement of it. Therefore, the result is also a random
string if the key stream is random.
d. In this case, the ciphertext is definitely random because
the exclusive-or of two random bits results in a random
bit.
(Continued)
5.60
Figure 5.23 Feedback shift register
(FSR)
5.2.1
Continued
5.61
Example 5.18
5.2.1
Continued
Create a linear feedback shift register with 5 cells in which
b5 = b4 ⊕ b2 ⊕ b0 .
Solution
If ci = 0, bi has no role in calculation of bm. This means that bi
is not connected to the feedback function. If ci = 1, bi is
involved in calculation of bm. In this example, c1 and c3 are
0’s, which means that we have only three connections. Figure
5.24 shows the design.
5.62
Figure 5.24 LSFR for Example
5.18
5.2.1
Confidentiality
5.63
Example 5.19
5.2.1
Continued
Create a linear feedback shift register with 4 cells in which
b4 = b1 ⊕ b0. Show the value of output for 20 transitions
(shifts) if the seed is (0001)2.
Solution
Figure 5.25 LFSR for Example
5.19
5.64
Table 4.6 Cell values and key sequence for Example 5.19
5.2.1
Continued
Example 5.19 (Continued)
5.65
Table 4.6 Continued
5.2.1
Continued
Example 5.19 (Continued)
5.66
5.2.1
Continued
Note that the key stream is 100010011010111 10001…. This
looks like a random sequence at first glance, but if we go
through more transitions, we see that the sequence is
periodic. It is a repetition of 15 bits as shown below:
The key stream generated from a LFSR is a pseudorandom
sequence in which the the sequence is repeated after N bits.
The maximum period of an LFSR is to 2m
− 1.
Note
Example 5.19 (Continued)
5.67
Example 5.20
5.2.1
Continued
The characteristic polynomial for the LFSR in Example 5.19
is (x4
+ x + 1), which is a primitive polynomial. Table 4.4
(Chapter 4) shows that it is an irreducible polynomial. This
polynomial also divides (x7
+ 1) = (x4
+ x + 1) (x3
+ 1), which
means e = 23
− 1 = 7.
5.68
In a nonsynchronous stream cipher, each key in the key
stream depends on previous plaintext or ciphertext.
5.2.2 Nonsynchronous Stream
Ciphers
In a nonsynchronous stream cipher, the key
depends on either the plaintext or ciphertext.
Note

More Related Content

PPT
ch-05.ppt
PPTX
Introduction to modern_symmetric-key_ciphers
PPT
ch-05.ppt
PDF
Forouzan cryptography and Network Security Ch-5
PPTX
Modern Cryptography.pptx
PPTX
Modern Block Cipher- Modern Symmetric-Key Cipher
PPTX
AC-Unit2 AC-Unit1.pptx CRYPTOGRAPHIC NOTES FOR ALL1).pptx
PPT
Data encryption standard
ch-05.ppt
Introduction to modern_symmetric-key_ciphers
ch-05.ppt
Forouzan cryptography and Network Security Ch-5
Modern Cryptography.pptx
Modern Block Cipher- Modern Symmetric-Key Cipher
AC-Unit2 AC-Unit1.pptx CRYPTOGRAPHIC NOTES FOR ALL1).pptx
Data encryption standard

Similar to DES Algorithm (DataEncryptionStandard) PPT (20)

PDF
DES Simplified
PPTX
information security lecture 7 & 8 .pptx
PPT
Computer Networks-5-A computer network is a set of computers sharing resource...
PDF
2 DES.pdf
PDF
Chapter 3-block-cipher-des1
DOCX
TCN  5080  -­‐‑  Project  1  Description  C.docx
PDF
Network security R.Rathna Deepa 2nd M.sc.,Computer Science
PPT
Chapter5-mikroprocessor
PPT
PDF
A NEW ALGORITHM TO CONSTRUCT S-BOXES WITH HIGH DIFFUSION
PPTX
Code Converters & Parity Checker
PDF
A NEW ALGORITHM TO CONSTRUCT S-BOXES WITH HIGH DIFFUSION
PDF
CFA based SBOX and Modified Mixcolumn Implementation of 8 Bit Datapath for AES
PDF
This assignment is using Logism to create circuits. I have been tryi.pdf
PDF
An odd even block cipher based cryptosystem through modulo arithmatic techniq...
PDF
An odd even block cipher based cryptosystem through
PDF
Synthesized report on the comparison of lut and splitting method for decrypti...
PDF
128 Bit Parallel Prefix Tree Structure Comparator
DES Simplified
information security lecture 7 & 8 .pptx
Computer Networks-5-A computer network is a set of computers sharing resource...
2 DES.pdf
Chapter 3-block-cipher-des1
TCN  5080  -­‐‑  Project  1  Description  C.docx
Network security R.Rathna Deepa 2nd M.sc.,Computer Science
Chapter5-mikroprocessor
A NEW ALGORITHM TO CONSTRUCT S-BOXES WITH HIGH DIFFUSION
Code Converters & Parity Checker
A NEW ALGORITHM TO CONSTRUCT S-BOXES WITH HIGH DIFFUSION
CFA based SBOX and Modified Mixcolumn Implementation of 8 Bit Datapath for AES
This assignment is using Logism to create circuits. I have been tryi.pdf
An odd even block cipher based cryptosystem through modulo arithmatic techniq...
An odd even block cipher based cryptosystem through
Synthesized report on the comparison of lut and splitting method for decrypti...
128 Bit Parallel Prefix Tree Structure Comparator
Ad

Recently uploaded (20)

PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Big Data Technologies - Introduction.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Empathic Computing: Creating Shared Understanding
PDF
Approach and Philosophy of On baking technology
PDF
Electronic commerce courselecture one. Pdf
PDF
KodekX | Application Modernization Development
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
cuic standard and advanced reporting.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Encapsulation theory and applications.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
MIND Revenue Release Quarter 2 2025 Press Release
Big Data Technologies - Introduction.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Review of recent advances in non-invasive hemoglobin estimation
Empathic Computing: Creating Shared Understanding
Approach and Philosophy of On baking technology
Electronic commerce courselecture one. Pdf
KodekX | Application Modernization Development
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
sap open course for s4hana steps from ECC to s4
Reach Out and Touch Someone: Haptics and Empathic Computing
20250228 LYD VKU AI Blended-Learning.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Programs and apps: productivity, graphics, security and other tools
The Rise and Fall of 3GPP – Time for a Sabbatical?
cuic standard and advanced reporting.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Encapsulation theory and applications.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Ad

DES Algorithm (DataEncryptionStandard) PPT

  • 1. ●Diffusion : to hide the relationship between the cipher text and the plain text. ●Diffusion implies that each symbol in the cipher text is dependent on some or all symbols in the plain text. ●This will frustrate the opponent who use cipher text statistics to find the plain text. ●Confusion: to hide the relationship between the cipher text and the key. ●If a single bit in the key is changed most or all bits in the cipher text will also be changed. ●This will frustrate the opponent who use cipher text statistics to find the key Confusion and Diffusion 10-Feb-21
  • 2. 5.2 5-1 MODERN BLOCK CIPHERS A symmetric-key modern block cipher encrypts an n-bit block of plaintext or decrypts an n-bit block of ciphertext. The encryption or decryption algorithm uses a k-bit key. 5.1.1 Substitution or Transposition 5.1.2 Block Ciphers as Permutation Groups 5.1.3 Components of a Modern Block Cipher 5.1.4 Product Ciphers 5.1.5 Two Classes of Product Ciphers 5.1.6 Attacks on Block Ciphers Topics discussed in this section:
  • 3. 5.3 Figure 5.1 A modern block cipher 5.1 Continued
  • 4. 5.4 Modern block ciphers normally are keyed substitution ciphers in which the key allows only partial mappings from the possible inputs to the possible outputs. 5.1.3 Components of a Modern Block Cipher A P-box (permutation box) parallels the traditional transposition cipher for characters. It transposes bits. P-Boxes
  • 5. 5.5 Figure 5.4 Three types of P- boxes 5.1.3 Continued
  • 6. 5.6 Example 5.5 5.1.3 Continued Figure 5.5 The possible mappings of a 3 × 3 P- box Figure 5.5 shows all 6 possible mappings of a 3 × 3 P-box.
  • 7. 5.7 5.1.3 Continued Table 5.1 Example of a permutation table for a straight P- box Straight P- Boxes
  • 8. 5.8 Example 5.6 5.1.2 Continued Design an 8 × 8 permutation table for a straight P-box that moves the two middle bits (bits 4 and 5) in the input word to the two ends (bits 1 and 8) in the output words. Relative positions of other bits should not be changed. Solution We need a straight P-box with the table [4 1 2 3 6 7 8 5]. The relative positions of input bits 1, 2, 3, 6, 7, and 8 have not been changed, but the first output takes the fourth input and the eighth output takes the fifth input.
  • 9. 5.9 Compression P-Boxes 5.1.3 A compression P-box is a P-box with n inputs and m outputs where m < n. Table 5.2 Example of a 32 × 24 permutation table
  • 10. 5.10 5.1.3 Continued Table 5.2 Example of a 32 × 24 permutation table Compression P-Box
  • 11. 5.11 Expansion P-Boxes 5.1.3 Continued An expansion P-box is a P-box with n inputs and m outputs where m > n. Table 5.3 Example of a 12 × 16 permutation table
  • 12. 5.12 5.1.3 Continued P-Boxes: Invertibility A straight P-box is invertible, but compression and expansion P-boxes are not. Note
  • 13. 5.13 Example 5.7 5.1.3 Continued Figure 5.6 shows how to invert a permutation table represented as a one-dimensional table. Figure 5.6 Inverting a permutation table
  • 14. 5.14 Figure 5.7 Compression and expansion P-boxes are non- invertible 5.1.3 Continued
  • 15. 5.15 5.1.3 Continued S-Box An S-box (substitution box) can be thought of as a miniature substitution cipher. An S-box is an m × n substitution unit, where m and n are not necessarily the same. Note
  • 16. 5.16 Example 5.8 5.1.3 Continued In an S-box with three inputs and two outputs, we have The S-box is linear because a1,1 = a1,2 = a1,3 = a2,1 = 1 and a2,2 = a2,3 = 0. The relationship can be represented by matrices, as shown below:
  • 17. 5.17 Example 5.9 5.1.3 Continued In an S-box with three inputs and two outputs, we have where multiplication and addition is in GF(2). The S-box is nonlinear because there is no linear relationship between the inputs and the outputs.
  • 18. 5.18 Example 5.10 5.1.3 Continued 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. Based on the table, an input of 010 yields the output 01. An input of 101 yields the output of 00.
  • 19. 5.20 Example 5.11 5.1.3 Continued 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. Figure 5.8 S-box tables for Example 5.11
  • 20. 5.21 5.1.3 Continued Exclusive- Or An important component in most block ciphers is the exclusive-or operation. Figure 5.9 Invertibility of the exclusive-or operation
  • 21. 5.22 5.1.3 Continued Exclusive-Or (Continued) An important component in most block ciphers is the exclusive-or operation. As we discussed in Chapter 4, addition and subtraction operations in the GF(2n ) field are performed by a single operation called the exclusive- or (XOR). The five properties of the exclusive-or operation in the GF(2n) field makes this operation a very interesting component for use in a block cipher: closure, associativity, commutativity, existence of identity, and existence of inverse.
  • 22. 5.24 Figure 5.9 Invertibility of the exclusive-or operation 5.1.1 Continued
  • 23. 5.25 5.1.3 Continued Circular Shift Another component found in some modern block ciphers is the circular shift operation. Figure 5.10 Circular shifting an 8-bit word to the left or right
  • 24. 5.26 5.1.3 Continued Swap The swap operation is a special case of the circular shift operation where k = n/2. Figure 5.11 Swap operation on an 8-bit word
  • 25. 5.27 5.1.3 Continued Split and Combine Two other operations found in some block ciphers are split and combine. Figure 5.12 Split and combine operations on an 8-bit word
  • 26. 5.28 Figure 5.12 Split and combine operations on an 8-bit word 5.1.3 Continued
  • 27. 5.29 Shannon introduced the concept of a product cipher. A product cipher is a complex cipher combining substitution, permutation, and other components discussed in previous sections. 5.1.4 Product Ciphers
  • 28. 5.30 Diffusion The idea of diffusion is to hide the relationship between the ciphertext and the plaintext. 5.1.4 Continued Diffusion hides the relationship between the ciphertext and the plaintext. Note
  • 29. 5.31 Confusion The idea of confusion is to hide the relationship between the ciphertext and the key. 5.1.4 Continued Confusion hides the relationship between the ciphertext and the key. Note
  • 30. 5.32 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. 5.1.4 Continued
  • 31. 5.33 Figure 5.13 A product cipher made of two rounds 5.1.4 Continued
  • 32. 5.34 Figure 5.14 Diffusion and confusion in a block cipher 5.1.4 Continued
  • 33. 5.35 Modern block ciphers are all product ciphers, but they are divided into two classes. 1. Feistel ciphers 2. Non-Feistel ciphers 5.1.5 Two Classes of Product Ciphers
  • 34. 5.36 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. 5.1.5 Continued
  • 35. 5.37 Figure 5.15 The first thought in Feistel cipher design 5.1.5 Continued Diffusion hides the relationship between the ciphertext and the plaintext. Note
  • 36. 5.38 Example 5.12 5.1.3 Continued 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. 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. Solution
  • 37. 5.39 Figure 5.16 Improvement of the previous Feistel design 5.1.5 Continued
  • 38. 5.40 Figure 5.17 Final design of a Feistel cipher with two rounds 5.1.5 Continued
  • 40. 5.42 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. 5.1.5 Continued
  • 41. 5.43 Attacks on traditional ciphers can also be used on modern block ciphers, but today’s block ciphers resist most of the attacks discussed in Chapter 3. 5.1.6 Attacks on Block Ciphers
  • 42. 5.44 Differential Cryptanalysis Eli Biham and Adi Shamir introduced the idea of differential cryptanalysis. This is a chosen-plaintext attack. 5.1.5 Continued
  • 43. 5.45 Example 5.13 5.1.6 Continued Assume that the cipher is made only of one exclusive-or operation, as shown in Figure 5.18. Without knowing the value of the key, Eve can easily find the relationship between plaintext differences and ciphertext differences if by plaintext difference we mean P1 ⊕ P2 and by ciphertext difference, we mean C1⊕ C2. The following proves that C1 ⊕ C2 = P1 ⊕ P2: Figure 5.18 Diagram for Example 5.13
  • 44. 5.46 Example 5.14 5.1.6 Continued We add one S-box to Example 5.13, as shown in Figure 5.19. Figure 5.19 Diagram for Example 5.14
  • 45. 5.47 Example 5.14 Continued 5.1.6 Continued Eve now can create a probabilistic relationship as shone in Table 5.4. Table 5.4 Differential input/output
  • 46. 5.48 Example 5.15 5.1.6 Continued The heuristic result of Example 5.14 can create probabilistic information for Eve as shown in Table 5.5. Table 5.5 Differential distribution table
  • 47. 5.49 Example 5.16 5.1.6 Continued Looking at Table 5.5, Eve knows that if P1 ⊕ P2 = 001, then C1 ⊕ C2 = 11 with the probability of 0.50 (50 percent). She tries C1 = 00 and gets P1 = 010 (chosen-ciphertext attack). She also tries C2 = 11 and gets P2 = 011 (another chosen-ciphertext attack). Now she tries to work backward, based on the first pair, P1 and C1, The two tests confirm that K = 011 or K =101.
  • 48. 5.50 5.1.6 Continued A more detailed differential cryptanalysis is given in Appendix N. Note Differential cryptanalysis is based on a nonuniform differential distribution table of the S-boxes in a block cipher. Note
  • 49. 5.51 Linear Cryptanalysis Linear cryptanalysis was presented by Mitsuru Matsui in 1993. The analysis uses known plaintext attacks. 5.1.6 Continued
  • 50. 5.52 Figure 5.20 A simple cipher with a linear S-box 5.1.6 Continued
  • 51. 5.53 5.1.6 Continued Solving for three unknowns, we get. This means that three known-plaintext attacks can find the values of k0, k1, and k2 .
  • 52. 5.54 5.1.6 Continued In some modern block ciphers, it may happen that some S-boxes are not totally nonlinear; they can be approximated, probabilistically, by some linear functions. where 1 ≤ x ≤ m, 1 ≤ y ≤ n, and 1 ≤ z ≤ n. A more detailed linear cryptanalysis is given in Appendix N. Note
  • 53. 5.55 5-2 MODERN STREAM CIPHERS In a modern stream cipher, encryption and decryption are done r bits at a time. We have a plaintext bit stream P = pn…p2 p1, a ciphertext bit stream C = cn…c2 c1, and a key bit stream K = kn…k2 k1, in which pi , ci , and ki are r-bit words. 5.2.1 Synchronous Stream Ciphers 5.2.2 Nonsynchronous Stream Ciphers Topics discussed in this section:
  • 54. 5.56 5.2 Continued In a modern stream cipher, each r-bit word in the plaintext stream is enciphered using an r-bit word in the key stream to create the corresponding r-bit word in the ciphertext stream. Note Figure 5.20 Stream cipher
  • 55. 5.57 5.2.1 Synchronous Stream Ciphers In a synchronous stream cipher the key is independent of the plaintext or ciphertext. Note Figure 5.22 One-time pad
  • 56. 5.58 Example 5.17 5.2.1 Continued What is the pattern in the ciphertext of a one-time pad cipher in each of the following cases? a. The plaintext is made of n 0’s. b. The plaintext is made of n 1’s. c. The plaintext is made of alternating 0’s and 1’s. d. The plaintext is a random string of bits. Solution a. Because 0 ⊕ ki = ki , the ciphertext stream is the same as the key stream. If the key stream is random, the ciphertext is also random. The patterns in the plaintext are not preserved in the ciphertext.
  • 57. 5.59 Example 5.7 5.2.1 Continued b. Because 1 ⊕ ki = ki where ki is the complement of ki , the ciphertext stream is the complement of the key stream. If the key stream is random, the ciphertext is also random. Again the patterns in the plaintext are not preserved in the ciphertext. c. In this case, each bit in the ciphertext stream is either the same as the corresponding bit in the key stream or the complement of it. Therefore, the result is also a random string if the key stream is random. d. In this case, the ciphertext is definitely random because the exclusive-or of two random bits results in a random bit. (Continued)
  • 58. 5.60 Figure 5.23 Feedback shift register (FSR) 5.2.1 Continued
  • 59. 5.61 Example 5.18 5.2.1 Continued Create a linear feedback shift register with 5 cells in which b5 = b4 ⊕ b2 ⊕ b0 . Solution If ci = 0, bi has no role in calculation of bm. This means that bi is not connected to the feedback function. If ci = 1, bi is involved in calculation of bm. In this example, c1 and c3 are 0’s, which means that we have only three connections. Figure 5.24 shows the design.
  • 60. 5.62 Figure 5.24 LSFR for Example 5.18 5.2.1 Confidentiality
  • 61. 5.63 Example 5.19 5.2.1 Continued Create a linear feedback shift register with 4 cells in which b4 = b1 ⊕ b0. Show the value of output for 20 transitions (shifts) if the seed is (0001)2. Solution Figure 5.25 LFSR for Example 5.19
  • 62. 5.64 Table 4.6 Cell values and key sequence for Example 5.19 5.2.1 Continued Example 5.19 (Continued)
  • 64. 5.66 5.2.1 Continued Note that the key stream is 100010011010111 10001…. This looks like a random sequence at first glance, but if we go through more transitions, we see that the sequence is periodic. It is a repetition of 15 bits as shown below: The key stream generated from a LFSR is a pseudorandom sequence in which the the sequence is repeated after N bits. The maximum period of an LFSR is to 2m − 1. Note Example 5.19 (Continued)
  • 65. 5.67 Example 5.20 5.2.1 Continued The characteristic polynomial for the LFSR in Example 5.19 is (x4 + x + 1), which is a primitive polynomial. Table 4.4 (Chapter 4) shows that it is an irreducible polynomial. This polynomial also divides (x7 + 1) = (x4 + x + 1) (x3 + 1), which means e = 23 − 1 = 7.
  • 66. 5.68 In a nonsynchronous stream cipher, each key in the key stream depends on previous plaintext or ciphertext. 5.2.2 Nonsynchronous Stream Ciphers In a nonsynchronous stream cipher, the key depends on either the plaintext or ciphertext. Note