Week 2
Week 2
Network Security
Eighth Edition
by William Stallings
Lecture slides prepared for “Cryptography and Network Security”, 8/e, by William
Stallings, Chapter 4 – “Block Ciphers and the Data Encryption Standard”.
1
Chapter 3
Classical Encryption
Techniques
© 2020 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
2
Definitions
Plaintext Ciphertext Enciphering/encryption
•The process of converting
•An original message •The coded message from plaintext to ciphertext
Cryptanalysis Cryptology
•Techniques used for •The areas of cryptography
deciphering a message and cryptanalysis
without any knowledge of
the enciphering details
3
© 2020 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
■ Plaintext: This is the original intelligible message or data that is fed into the
algorithm as input.
■ Secret key: The secret key is also input to the encryption algorithm. The key is
a value independent of the plaintext and of the algorithm. The algorithm will
produce a different output depending on the specific key being used at the
time. The exact substitutions and transformations performed by the algorithm
depend on the key.
4
Symmetric Cipher Model
• There are two requirements for secure use of
conventional encryption:
• A strong encryption algorithm
2. Sender and receiver must have obtained copies of the secret key in a
secure
fashion and must keep the key secure. If someone can discover the key and
knows the algorithm, all communication using this key is readable.
5
We assume that it is impractical to decrypt a message on the basis of the
ciphertext plus knowledge of the encryption/decryption algorithm. In other
words,
we do not need to keep the algorithm secret; we need to keep only the key
secret.
This feature of symmetric encryption is what makes it feasible for widespread
use.
The fact that the algorithm need not be kept secret means that manufacturers
can
and have developed low-cost chip implementations of data encryption
algorithms.
These chips are widely available and incorporated into a number of products.
With
the use of symmetric encryption, the principal security problem is maintaining
the
secrecy of the key.
5
© 2020 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
6
Cryptographic Systems
• Characterized along three independent dimensions:
Symmetric,
single-key, secret-
Substitution Block cipher
key, conventional
encryption
Asymmetric, two-
Transposition key, or public-key Stream cipher
encryption
2. The number of keys used. If both sender and receiver use the same
key, the
system is referred to as symmetric, single-key, secret-key, or conventional
encryption. If the sender and receiver use different keys, the system is
referred
7
to as asymmetric, two-key, or public-key encryption.
7
Cryptanalysis and
Brute-Force Attack
8
If either type of attack succeeds in deducing the key, the effect is catastrophic:
All future and past messages encrypted with that key are compromised.
8
he choose some plaintext and
asks to encrypt it
with the cipher text and the
original plaintext that he knows
he can figure the algorithm
3 & 4 together
(Table is on page 68
© 2020 Pearson Education, Inc., Hoboken, NJ. All rights reserved. in the textbook)
9
is concealed, such as English or French text, an EXE file, a Java source
listing, an
accounting file, and so on.
9
If the analyst is able somehow to get the source system to insert into the
system
a message chosen by the analyst, then a chosen-plaintext attack is possible.
In general,
if the analyst is able to choose the messages to encrypt, the analyst may
deliberately
pick patterns that can be expected to reveal the structure of the key.
Table 3.1 lists two other types of attack: chosen ciphertext and chosen text.
These are less commonly employed as cryptanalytic techniques but are
nevertheless
possible avenues of attack.
9
Encryption Scheme Security
• Unconditionally secure
• No matter how much time an opponent has, it
is impossible for him or her to decrypt the
ciphertext simply because the required
information is not there
• Computationally secure
• The cost of breaking the cipher exceeds the
value of the encrypted information
• The time required to break the cipher
exceeds the useful lifetime of the
information
© 2020 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
• The cost of breaking the cipher exceeds the value of the encrypted
information.
10
• The time required to break the cipher exceeds the useful lifetime of the
information.
10
Brute-Force Attack
Involves trying every possible key until an intelligible means good and understandable text
11
numerical
file, and this has been compressed, the problem becomes even more difficult
to
automate. Thus, to supplement the brute-force approach, some degree of
knowledge
about the expected plaintext is needed, and some means of automatically
distinguishing plaintext from garble is also needed.
11
Strong Encryption
• The term strong encryption refers to encryption
schemes that make it impractically difficult for
unauthorized persons or systems to gain access to
plaintext that has been encrypted
• Properties that make an encryption algorithm
strong are:
• Appropriate choice of cryptographic algorithm
• Use of sufficiently long key lengths
• Appropriate choice of protocols
• A well-engineered implementation
• Absence of deliberately introduced hidden flaws
12
Substitution Technique
• 𝑐 = 𝑝 + 𝑘 𝑀𝑜𝑑𝑢𝑙𝑜 𝑀.
The two basic building blocks of all encryption techniques are substitution
and transposition. We examine these in the next two sections. Finally, we
discuss a
system that combines both substitution and transposition.
13
Caesar Cipher
• Simplest and earliest known use of a substitution cipher
The earliest known, and the simplest, use of a substitution cipher was by
Julius
Caesar. The Caesar cipher involves replacing each letter of the alphabet with
the
letter standing three places further down the alphabet.
14
Caesar Cipher Algorithm
• Can define transformation as:
a b c d e f g h i j k l m n o p q r s t u v w x y z
D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
• A shift may be of any amount, so that the general Caesar algorithm is:
C = E(k , p ) = (p + k ) mod 26
p = D(k , C ) = (C - k ) mod 26
© 2020 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Note that the alphabet is wrapped around, so that the letter following Z is A.
15
Figure 3.3
Brute-Force
Cryptanalysis
of
Caesar Cipher
(This chart can be found on page 71 in the
textbook)
16
Transposition Technique
• Is one in which the letters of a plaintext are permuted in a way to
preserve the block elements. Expansion Permutation and Permutation
Choice are also possible. by other letters or by numbers or symbols
• 𝑐 =𝑝 𝑀𝑜𝑑𝑢𝑙𝑜 𝑀.
• Key: 4 3 1 2 5 6 7
• Plaintext: a t t a c k p
• o s t p o n e
• d u n t i l t
• w o a m x y z
• Ciphertext: TTNAAPTMTSUOAODWCOIXKNLYPETZ
The two basic building blocks of all encryption techniques are substitution
and transposition. We examine these in the next two sections. Finally, we
discuss a
system that combines both substitution and transposition.
17