Cryptography in Information Security
Cryptography in Information Security
Cryptography
Academic Year 2024-25
(Even)
Semester/ Section : 8th A & B
By:
Mrs. Kavya M S
Assistant Professor
Dept. of AIML
BNMIT
1
Background
• Information Security requirements have changed in recent times
• Computer use requires automated tools to protect files and other stored
information
• Use of networks and communications links requires measures to protect
data during transmission
• Computer Security - generic name for the collection of tools designed
to protect data and to thwart hackers
• Network Security - measures to protect data during their transmission
• Internet Security - measures to protect data during their transmission
over a collection of interconnected networks
2
Security Attack
• Any action that compromises the security of information owned by an
organization
• Information security is about how to prevent attacks, or failing that, to
detect attacks on information-based systems
• Threat & attack used to mean same thing
• Generic types of attacks
• Passive
• Active
3
Passive Attack
4
Active Attack
5
Recent Cyber Attack
Top Cybersecurity Breaches
Thousands of cyber attacks were recorded through 2021, including ransomware,
cryptocurrency theft, data loss, and supply chain attacks. Insight from the
Identity Theft Research Center (ITRC) shows that recorded data breaches increased
by 17% in 2021 compared to 2020.
Tether Attack
In March 2021, cyber criminals threatened to leak documents from the Tether cryptocurrency. The
attackers claimed the data would “harm the Bitcoin ecosystem” and demanded a settlement fee
of around 500 Bitcoin ($24 million), but Tether refused to pay.
CNA Financial Breach
A ransomware attack on insurance firm CNA Financial left employees locked out of their systems
and blocked from accessing corporate resources. The attack in March 2021 also involved
company data being stolen, which led CNA Financial to reportedly pay the $40 million settlement
fee.
Facebook Cyberattack
Data of more than 530 million Facebook users, including their names, Facebook IDs, dates of
birth, and relationship status, was published online in April 2021. Facebook, now Meta, said the
6
Security Services & Mechanism
• Services :
• Enhance security of data processing systems and information
transfers of an organization
• Intended to counter security attacks
• Using one or more security mechanisms
• Mechanism:
• Feature designed to detect, prevent, or recover from a security attack
• No single mechanism that will support all services required
• One particular element underlies many of the security mechanisms in
use:
• cryptographic techniques
• Hence our focus on this topic
7
Why Cryptography?
The Importance of Cryptography:
Individuals and organizations use
cryptography on a daily basis to
protect and keep their
conversations and data
confidential.
9
Why Cryptography?
Integrity: Information integrity includes the accuracy, relevance, precision, timeliness and
completeness of the information
Authentication: It is the process of determining whether someone or something is, in fact, who
or what it says it is.
Data availability: It means that information is accessible to authorized users. It provides an
assurance that your system and data can be accessed by authenticated users whenever they're
needed.
Non-repudiation: It means that someone cannot falsely deny that they created, altered,
observed, or transmitted data.
10
Why Cryptography?
11
Why Cryptography?
12
Why Cryptography?
National Institute of Standards & Technology (NIST)
Internet Society (ISOC)
International Telecommunication Union Telecommunication
Standardization Sector (ITU-T)
International Organization for Standardization (ISO)
RSA Labs (de facto)
13
Overview of Syllabus
Module 1: Classical Encryption Techniques
Chapter 2: Symmetric Cipher Model, Cryptography, Cryptanalysis and
Brute-Force Attack, Substitution Techniques, Caesar Cipher,
Monoalphabetic Cipher, Playfair Cipher, Hill Cipher, Polyalphabetic
Cipher, One Time Pad.
Chapter 3: Block Ciphers and the data encryption standard: Traditional
block Cipher structure, stream Ciphers and block Ciphers, Motivation for
the feistel Cipher structure, the feistel Cipher, The data encryption
standard, DES encryption, DES decryption, A DES example, results, the
avalanche effect, the strength of DES, the use of 56-Bit Keys, the nature
of the DES algorithm, timing attacks, Block cipher design principles,
number of rounds, design of function F, key schedule algorithm
Textbook 1: Ch. 2.1,2.2, Ch. 3
14
Chapter 2
2.1 Symmetric Cipher Model
• Cryptography
• Cryptanalysis and Brute-Force Attack
2.2 Substitution Techniques
• Caesar Cipher
• Monoalphabetic Ciphers
• Playfair Cipher
• Hill Cipher
• Polyalphabetic Ciphers
• One-Time Pad
15
2.1 Symmetric Cipher Model
16
Basic Terminologies
• Plaintext - original message
• Ciphertext - coded message
• Cipher - algorithm for transforming plaintext to ciphertext
• Key - info used in cipher known only to sender/receiver
• Encipher (encrypt) - converting plaintext to ciphertext
• Decipher (decrypt) - recovering ciphertext from plaintext
• Cryptography - study of encryption principles/methods
• Cryptanalysis (code breaking) - study of principles/ methods of
deciphering ciphertext without knowing key
• Cryptology - field of both cryptography and cryptanalysis
17
Requirement
• Two requirements for secure use of conventional
encryption:
• Need of a strong encryption algorithm.
• Secret key known only to sender and receiver.
• Kerckhoff’s principle: Kerckhoff's principle is the
concept that a Cryptographic system should be designed
to be secure, even if all its details, except for the key, are
publicly known.
• Do not need to keep the algorithm secret; need to keep
only the key secret.
18
Requirement
• Plaintext: X = [X1, X2,..., XM].
• The M elements of X are letters in
finite alphabet of the 26 capital
letters.
• Binary alphabet {0, 1} is typically
used.
• Key : K = [K1, K2,..., KJ] is
generated.
• If the key is generated at the
source,
• Provided to the destination by
means of some secure channel.
• A third party could generate the
key deliver it to both source and
destination. 19
Cryptography
Cryptographic systems are characterized along three
independent dimensions:
[Link] type of operations used for transforming plaintext to
ciphertext.
• Substitution: Each element in the plaintext (bit, letter, group of bits
or letters) is mapped into another element
20
Cryptography
23
Cryptanalysis and Brute-Force Attack
The are two general approaches to attacking a conventional
encryption scheme:
• Cryptanalysis: Cryptanalytic attacks rely
• Algorithm
• Some knowledge of the plaintext
• sample plaintext–ciphertext pairs.
24
Cryptanalytic Techniques
ciphertext only
only know algorithm & ciphertext, is statistical,
know or can identify plaintext
known plaintext
know/suspect plaintext & ciphertext
chosen plaintext
select plaintext and obtain ciphertext
chosen ciphertext
select ciphertext and obtain plaintext
chosen text
select plaintext or ciphertext to en/decrypt
25
Cryptanalytic Techniques
26
Cryptanalytic Techniques
• Ciphertext-only attack is the easiest to defend.
• Known Plaintext:
• The analyst may be able to capture one or more plaintext
messages as well as their encryptions.
• The analyst may know that certain plaintext patterns will appear
in a message.
• For example:
• A file that is encoded in the Postscript format always begins with
the same pattern
• A standardized header or banner to an electronic funds transfer
message.
• In an accounting file the opponent may know the placement of
certain key words.
• The source code for a program
• chosen-plaintext attack If the analyst is able somehow to get the
27
Cryptanalytic Techniques
Two more definitions:
1. unconditional security
no matter how much computer power or time is available, the
cipher cannot be broken since the ciphertext provides
insufficient information to uniquely determine the
corresponding plaintext
2. computational security
An encryption algorithm can strive if it meets one or both of the
following criteria:
• 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 28
Brute-Force Attack
• Involves trying every possible key until an intelligible translation of
the ciphertext into plaintext is obtained.
• On average, half of all possible keys must be tried to achieve
success.
• That is, if there are X different keys, on average an attacker would
discover the actual key after X/2 tries.
• If the message is just plain text in English, then the result pops out
easily, although the task of recognizing English would have to be
automated.
• If the text message has been compressed before encryption, then
recognition is more difficult.
29
2.2 Substitution Techniques
• A substitution technique is one in which the letters of
plaintext are replaced by other letters or by numbers
or symbols.
• If the plaintext is viewed as a sequence of bits, then
substitution involves replacing plaintext bit patterns
with ciphertext bit patterns.
1. Caesar Cipher
• Substitution Techniques:2. Monoalphabetic Ciphers
3. Playfair Cipher
4. Hill Cipher
5. Polyalphabetic Ciphers
6. One-Time Pad
30
[Link] Cipher
• Earliest known and easy to use substitution cipher
• By Julius Caesar
• First attested use in military affairs
• Replaces each letter by 3rd letter on example:
meet me after the toga party
PHHW PH DIWHU WKH WRJD SDUWB
• Alphabet is wrapped around, so that the letter following Z is A.
31
[Link] Cipher
32
[Link] Cipher
Plain : 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
cipher: 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
34
[Link] Cipher
Figure 2.3 shows the results of applying this strategy
to the example ciphertext. In this case, the plaintext
leaps out as occupying the third line.
What generally makes brute-force cryptanalysis
impractical is the use of an algorithm that employs a
large number of keys. For example, the triple DES
algorithm, makes use of a 168-bit key, giving a key
space of 2168 or greater than 3.7 * 1050 possible keys
35
1. Caesar Cipher
• What generally makes brute-force cryptanalysis impractical
• An algorithm that employs a large number of keys.
• For example, the triple DES algorithm, makes use of a 168-bit
key
• If the language of the plaintext is unknown, then plaintext
output may not be recognizable.
36
2. Monoalphabetic Cipher
• With only 25 possible keys, the Caesar cipher is far from secure.
• A increase in the key space can be achieved by allowing an arbitrary
substitution.
• In monoalphabetic substitution cipher, because a single cipher alphabet
(mapping from plain alphabet to cipher alphabet) is used per message.
• Shuffle the alphabet arbitrarily
• Each plain text letter maps to different random cipher text letter.
• Thus key is 26 letters long.
37
2. Monoalphabetic Cipher
As a first step, the
relative frequency
of the letters can be
determined and
compared to a
standard frequency
distribution for
English, such as is
shown inFigure 2.5
38
2. Monoalphabetic Cipher
The ciphertext to be solved is
UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ
VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX
EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ
If the message were long enough, this technique alone might be sufficient, but because this is a
relatively short message, we cannot expect an exact [Link] relative frequencies of the letters
in the ciphertext (in percentages) are as follows:
41
2. Monoalphabetic Cipher
44
3. Playfair Cipher
45
3. Playfair Cipher
If both the letters are in the same column: Take the letter below each one
(going back to the top if at the bottom). For example:
Diagraph: "me"
Encrypted Text: cl
Encryption: m -> c e -> l
If both the letters are in the same row: Take the letter to the right of each one (going back to the leftmost
if at the rightmost position). For example:
Diagraph: "st"
Encrypted Text: tl
Encryption: s -> t t -> l
If neither of the above rules is true: Form a rectangle with the two letters and take the letters on the
horizontal opposite corner of the rectangle. For example:
Diagraph: "nt"
Encrypted Text: rq
Encryption: n -> r t -> q
46
3. Playfair Cipher
Plain Text: "instrumentsz“
After Split: 'in' 'st' 'ru' 'me' 'nt' 'sz'
Encrypted Text:
Encryption:
47
3. Playfair Cipher
Plain Text: "instrumentsz"
After Split: 'in' 'st' 'ru' 'me' 'nt' 'sz'
Encrypted Text:
Encryption:
i -> g
n -> a
s -> t
t -> l
r -> m
u -> z
m -> c
e -> l
n -> r
t -> q
s -> t
z -> x
48
3. Playfair Cipher
Plain Text: "instrumentsz"
After Split: 'in' 'st' 'ru' 'me' 'nt' 'sz’
Encrypted Text: gatlmzclrqtx
Encryption:
i -> g
n -> a
s -> t
t -> l
r -> m
u -> z
m -> c
e -> l
n -> r
t -> q
s -> t
z -> x
49
3. Playfair Cipher
• Analysis of Playfair:
• Security much improved over monoalphabetic
• Since have 26 x 26 = 676 digrams
• Need a 676 entry frequency table to analyse (verses 26 for a
monoalphabetic)
• Widely used for many years eg. by US & British military
• It can be broken, given a few hundred letters since still has much
of plaintext structure
50
4. Hill Cipher
• Another interesting Multiletter cipher is the Hill cipher, developed by the
mathematician Lester Hill in 1929.
51
4. Hill Cipher
This encryption algorithm takes m successive plaintext letters and
substitutes for them m ciphertext letters. The substitution is
determined by m linear equations in which each character is
assigned a numerical value (a = 0, b = 1, c, z = 25).
52
4. Hill Cipher Encryption
53
4. Hill Cipher Encryption Example
54
4. Hill Cipher Encryption Example
55
4. Hill Cipher Encryption Example
56
4. Hill Cipher Encryption Example
57
4. Hill Cipher Encryption Example
58
4. Hill Cipher Encryption Example
59
4. Hill Cipher Encryption Example
60
4. Hill Cipher Encryption Example
61
4. Hill Cipher Decryption
62
4. Hill Cipher Decryption
63
4. Hill Cipher Decryption Example
64
4. Hill Cipher Decryption Example
65
4. Hill Cipher Decryption Example
66
4. Hill Cipher Decryption Example
67
4. Hill Cipher Decryption Example
68
4. Hill Cipher Decryption Example
69
4. Hill Cipher Decryption Example
70
4. Hill Cipher Decryption Example
71
4. Hill Cipher Decryption Example
72
4. Hill Cipher Decryption Example
73
4. Hill Cipher Decryption Example
74
4. Hill Cipher Practice Problem
75
5. Polyalphabetic Ciphers
• Use different monoalphabetic substitutions as one proceeds through
the plaintext message.
• The general name for this approach is polyalphabetic substitution
cipher. All these techniques have the following features in
common:
1. A set of related monoalphabetic substitution rules is used.
2. A key determines which particular rule is chosen for a given
transformation.
76
5. Polyalphabetic-Vigenere Ciphers
1. Vigenère cipher
Assume a sequence of plaintext letters P = p0, p1, p2, c, pn-1
and a key consisting of the sequence of letters K = k0, k1, k2, c, km-1, where
typically m < n.
The sequence of ciphertext letters C = C0, C1, C2, c, Cn-1 is calculated as
follows:
C = C0, C1, C2, c, Cn-1 = E(K, P) = E[(k0, k1, k2, c, km-1), (p0, p1, p2, c, pn-1)]
= (p0 + k0) mod 26, (p1 + k1) mod 26, c, (pm-1 + km-1) mod 26,
(pm + k0) mod 26, (pm+1 + k1) mod 26, c, (p2m-1 + km-1) mod 26, c
77
5. Polyalphabetic-Vigenere Ciphers
Encryption: C = (p + k ) mod
i i i mod m
26
Decryption: p = (C - k ) mod 26
i i i mod m
78
5. Polyalphabetic-Vigenere Ciphers
key: deceptivedeceptivedeceptive
plaintext: wearediscoveredsaveyourself
ciphertext: ZICVTWQNGRZGVTWAVZHCQYGLMGJ
79
5. Polyalphabetic-Vigenere Ciphers
key: deceptivedeceptivedeceptive
plaintext: wearediscoveredsaveyourself
ciphertext: ZICVTWQNGRZGVTWAVZHCQYGLMGJ
80
5. Polyalphabetic-Vigenere Ciphers
81
5. Polyalphabetic-Vigenere Ciphers
• The strength of this cipher is that there are multiple
ciphertext letters for each plaintext letter, one for each
unique letter of the keyword.
• An improvement is achieved over the Playfair cipher, but
considerable frequency information remains.
• If Vigenère cipher is suspected, then progress depends on
determining the length of the keyword.
• How the keyword length can be determined.
• If two identical sequences of plaintext letters occur at a
distance that is an integer multiple of the keyword length,
key:
they will deceptivedeceptivedeceptive
generate identical ciphertext sequences.
plaintext: wearediscoveredsaveyourself
ciphertext: ZICVTWQNGRZGVTWAVZHCQYGLMGJ 82
5. Polyalphabetic-Vigenere Ciphers
• The periodic nature of the keyword can be eliminated by
using a nonrepeating keyword that is as long as the
message itself.
• Vigenère proposed what is referred to as an autokey
system, in which a keyword is concatenated with the
plaintext itself to provide a running key.
For our example,
key: deceptivewearediscoveredsav
plaintext: wearediscoveredsaveyourself
ciphertext: ZICVTWQNGKZEIIGASXSTSLVVWLA
83
5. Polyalphabetic-Vigenere Ciphers
Practice Problem
1. Encrypt and Decrypt the following plaintext to Ciphertext using Vigenere
Cipher method
Plain Text: ALL IS WELL
KEYWORD: CAKE
2. Encrypt and Decrypt the following plaintext to Ciphertext using Vigenere
Cipher method
Plain Text: MICHIGAN TECHNOLOGICAL UNIVERSITY
keyword : HOUGHTON
84
5. Polyalphabetic -Vernam Cipher
• The ultimate defense against such a cryptanalysis is to
choose a keyword that is as long as the plaintext and has
no statistical relationship to it.
• Such a system was introduced by an AT&T engineer
named Gilbert Vernam in 1918.
85
5. Polyalphabetic -Vernam Cipher
His system works on binary data (bits) rather than letters. The
system can be expressed
ci = pi XOR ki, Where
pi = ith binary digit of plaintext, ki = ith binary digit of key, ci
= ith binary digit of ciphertext
pi = ci XOR ki 86
5. Polyalphabetic -Vernam Cipher
Plain-Text: O A K
Key: SON
O ==> 14 = 0 1 1 1 0
S ==> 18 = 1 0 0 1 0
Bitwise XOR Result: 1 1 1 0 0 = 28
Since the resulting number is greater than 26, subtract 26
from it.
Then convert the Cipher-Text character number to the Cipher-
Text character.
28 - 26 = 2 ==> C
CIPHER-TEXT: C
Similarly, do the same for the other corresponding 87
5. Polyalphabetic -Vernam Cipher
PT: O A K
No: 14 00 10
KEY: S O N
No: 18 14 13
New Cipher-Text is after getting the corresponding character
from the resulting number.
CT-No: 02 14 07
CT: C O H
88
5. Polyalphabetic -Vernam Cipher
Practice Problem
1. Encrypt and Decrypt the following plaintext to Ciphertext using Vernam
Cipher method
Plain-Text: RAMSWARUPK
Key: RANCHOBABA
89
6. One-Time Pad
• An Army Signal Corp officer, Joseph Mauborgne, proposed an
improvement to the Vernam cipher that yields the ultimate in
security.
• Use random key that is as long as the message, so that the
key need not be repeated.
• Key is to be used to encrypt and decrypt a single message, and
then is discarded.
• Each new message requires a new key of the same length as
the new message.
• Such a scheme is known as a one-time pad, is unbreakable.
• It produces random output that bears no statistical
relationship to the plaintext.
90
6. One-Time Pad
91
6. One-Time Pad
93
6. One-Time Pad
94
Chapter 3
Block Ciphers and Data Encryption Standards
95
3.1 Traditional Block Cipher Structure
96
3.1 Traditional Block Cipher Structure
97
Motivation for the Feistel Cipher Structure
99
Motivation for the Feistel Cipher Structure
100
Motivation for the Feistel Cipher Structure
101
The Feistel Cipher
102
The Feistel Cipher
In particular, Feistel proposed the use of a cipher that alternates
substitutions
and permutations, where these terms are defined as follows:
• Substitution: Each plaintext element or group of elements is
uniquely replaced by a corresponding ciphertext element or
group of elements.
• Permutation: A sequence of plaintext elements is replaced
by a permutation
of that sequence. That is, no elements are added or deleted or
replaced in the
sequence, rather the order in which the elements appear in the
sequence is
changed. 103
The Feistel Cipher
104
The Feistel Cipher
• Confusion seeks to make the relationship
between the statistics of the ciphertext and the
value of the encryption key complex. This is
achieved by the use of a complex substitution
algorithm. In contrast, a simple linear
substitution function would add little confusion.
105
Feistel Cipher Structure
• The left-hand side of Figure 3.3 depicts the structure proposed by
Feistel.
• The inputs to the encryption algorithm are a plaintext block of length
2w bits and a key K.
• The plaintext block is divided into two halves, L0 and R0.
• The two halves of the data pass through n rounds of processing and
then combine to produce the ciphertext block.
• Each round i has as inputs Li-1 and Ri-1 derived from the previous
round, as well as a subkey Ki derived from the overall K.
• In general, the subkeys Ki are different from K and from each other.
• For clarity, we use the notation LEi and REi for data traveling through
the encryption algorithm and LDi and RDi for data traveling through the
decryption algorithm. 106
Feistel Cipher Structure
• A substitution is performed on the left half of the data. This is done by
applying a round function F to the right half of the data and then taking
the exclusive-OR of the output of that function and the left half of the
data.
• The round function has the same general structure for each round but
is parameterized by the round subkey Ki.
• Another way to express this is to say that F is a function of right-half
block of w bits and a subkey of y bits, which produces an output value
of length w bits: F(REi, Ki+1).
• Following this substitution, a permutation is performed that consists of
the interchange of the two halves of the data. This structure is a
particular form of the substitution-permutation network (SPN) proposed
by Shannon. 107
Feistel Cipher Structure- Encryption
108
Feistel Cipher Structure- Decryption
109
Feistel Cipher Structure
110
Feistel Decryption Algorithm
• The process of decryption with a Feistel cipher is essentially the same
as the encryption process.
• The rule is as follows:
• Use the ciphertext as input to the algorithm, but use the subkeys Ki in
reverse order.
• That is, use Kn in the first round, Kn-1 in the second round, and so on,
until K1 is used in the last round.
• This is a nice feature, because it means we need not implement two
different algorithms; one for encryption and one for decryption.
111
Feistel Cipher Structure
The exact realization of a Feistel network depends on the choice of the following
parameters and design features:
• Block size:
• Larger block sizes mean greater security. but reduce encryption/decryption
speed for a given algorithm
• Traditionally, a block size of 64 bits has been considered a reasonable
tradeoff and was nearly universal in block cipher design.
• However, the new AES uses a 128-bit block size.
• Key size:
• Larger key size means greater security but may decrease encryption/
decryption speed.
• Key sizes of 64 bits or less are now widely considered to be inadequate, and
128 bits has become a common size. 112
Feistel Cipher Structure
113
Feistel Cipher Structure
There are two other considerations in the design of a
Feistel cipher:
• Fast software encryption/decryption:
In many cases, encryption is embedded in applications
or utility functions as the speed of execution of the
algorithm becomes a concern.
• Ease of analysis:
Goal is to make our algorithm as difficult as possible to
cryptanalyze.
If the algorithm can be concisely and clearly
explained, it is easier to analyze that algorithm for114
Feistel Cipher Structure
115
Feistel Example
116
3.2 Data Encryption Standard
• Until the introduction of the Advanced Encryption Standard (AES)
in 2001, the Data Encryption Standard (DES) was the most widely
used encryption scheme.
• DES was issued in 1977 by the National Bureau of Standards, now
the National Institute of Standards and Technology (NIST),
• The algorithm itself is referred to as the Data Encryption Algorithm
(DEA).
• For DEA, data are encrypted in 64-bit blocks using a 56-bit key. The
algorithm transforms 64-bit input in a series of steps into a 64-bit
output.
• The same steps, with the same key, are used to reverse the
encryption.
117
3.2 Data Encryption Standard
118
3.2 Data Encryption Standard
119
3.2 Data Encryption
120
3.2 Data Encryption
121
3.2 Data Encryption
• The plaintext must be 64 bits in length and the key is
56 bits in length.
• Processing of the plaintext proceeds in three
phases.
1. 64-bit plaintext passes through an initial
permutation (IP) that rearranges the bits to
produce the permuted input.
2. A phase consisting of sixteen rounds of the same
function, which involves both permutation and
substitution functions. The output of the last
(sixteenth) round consists of 64 bits. The left and
122
right halves of the output are swapped to
3.2 Data Encryption
3. Finally, the preoutput is passed through a permutation [IP -1]
that is the inverse of the initial permutation function, to produce the
64-bit ciphertext.
• With the exception of the initial and final permutations, DES has
the exact structure of a Feistel cipher.
• The 56-bit key is used.
• Initially, the key is passed through a permutation function.
• Then, for each of the sixteen rounds, a subkey (Ki) is produced
by the combination of a left circular shift and a permutation.
• The permutation function is the same for each round, but a
different subkey is produced because of the repeated shifts of
the key bits.
123
3.2 Data Decryption
124
3.3 A DES Example
• Results
• Table 3.2 shows the progression of the algorithm.
• The first row shows the 32-bit values of the left and right halves of
data after the initial permutation generated for each round.
• Note that Li = Ri-1. The final row shows the left- and right-hand values
after the inverse initial permutation.
• These two values combined form the ciphertext. 125
3.3 A DES Example
126
3.3 A DES Example
• Using the example from Table 3.2, Table 3.3 shows the result when
the fourth bit of the plaintext is changed, so that the plaintext is
12468aceeca86420.
• The second column of the table shows the intermediate 64-bit
values at the end of each round for the two plaintexts.
• The third column shows the number of bits that differ between the
two intermediate values.
• The table shows that, after just three rounds, 18 bits differ between
the two blocks.
• On completion, the two ciphertexts differ in 32 bit positions.
128
3.3 A DES Example
129
3.3 A DES Example
130
3.3 A DES Example
131
3.4 The Strength of DES
132
3.4 The Strength of DES
1. The Use of 56-Bit Key
• With a key length of 56 bits, there are 2 56 possible keys, which is
approximately 7.2 * 1016 keys.
• A brute-force attack appears impractical.
• On average, half the key space has to be searched, a single machine
performing one DES encryption per microsecond would take more than
a thousand years to break the cipher.
• One encryption per microsecond.
• In1977, Diffie and Hellman postulated that the technology existed to
build a parallel machine with 1 million encryption devices, each of
which could perform one encryption per microsecond.
• This would bring the average search time down to about 10 hours.
• The cost would be about $20 million in 1977 dollars.
133
3.4 The Strength of DES
1. The Use of 56-Bit Key
• With current technology, it is not even necessary to use special,
purpose-built hardware.
• A rate of 1 billion (109) key combinations per second is reasonable
for today’s multicore computers.
• Both Intel and AMD now offer hardware-based instructions to
accelerate the use of AES.
• Single PC can break DES in about a year; if multiple PCs work in
parallel, the time is drastically shortened.
• And today’s supercomputers should be able to find a key in about an
hour.
• Fortunately, there are a number of alternatives to DES, the most
important of which are AES and triple DES
134
3.4 The Strength of DES
Table 3.5 shows how much time is required for a brute-force attack for
various key sizes
135
3.4 The Strength of DES
2. The Nature of the DES Algorithm
Another concern is the possibility that cryptanalysis is
possible by exploiting the characteristics of the DES
algorithm.
The focus of concern has been on the eight substitution
tables, or S-boxes, that are used in each iteration.
Because the design criteria for these boxes, and indeed for
the entire algorithm, were not made public, there is a
suspicion that the boxes were constructed in such a way
that cryptanalysis is possible for an opponent who knows
the weaknesses in the S-boxes. 136
3.4 The Strength of DES
Timing Attacks
137
3.5 Block Cipher Design Principles
138
3.5 Block Cipher Design Principles
• Number of Rounds
• The greater the number of rounds, the more difficult it is to perform
cryptanalysis, even for a relatively weak F.
• In general, the criterion should be that the number of rounds is chosen so
that known cryptanalytic efforts require greater effort than a simple brute-
force key search attack.
• This criterion observes that for 16-round DES, a cryptanalysis attack is
slightly less efficient than brute force.
• If DES had 15 or fewer rounds, differential cryptanalysis would require less
effort than a brute-force key search.
139
3.5 Block Cipher Design Principles
Design of Function F
The heart of a Feistel block cipher is the function F, which provides the
element of confusion in a Feistel cipher.
Thus, it must be difficult to “unscramble” the substitution performed by F.
The more nonlinear F, the more difficult any type of cryptanalysis will be.
More difficult it is to approximate F by a set of linear equations, the more
nonlinear F is.
140
3.5 Block Cipher Design Principles
141
3.5 Block Cipher Design Principles
• With any Feistel block cipher, the key is used to generate one
subkey for each round.
• In general, we would like to select subkeys to maximize the
difficulty of deducing individual subkeys and the difficulty of
working back to the main key.
142