Cryptography and
Cryptography and
Network Security
Network Security
Chapter 7
Chapter 7
Fourth Edition
Fourth Edition
by William Stallings
by William Stallings
Lecture slides by Lawrie Brown
Lecture slides by Lawrie Brown
Chapter 7 –
Chapter 7 –
Confidentiality Using
Confidentiality Using
Symmetric Encryption
Symmetric Encryption
John wrote the letters of the alphabet under the letters in
John wrote the letters of the alphabet under the letters in
its first lines and tried it against the message.
its first lines and tried it against the message.
Immediately he knew that once more he had broken the
Immediately he knew that once more he had broken the
code. It was extraordinary the feeling of triumph he had.
code. It was extraordinary the feeling of triumph he had.
He felt on top of the world. For not only had he done it,
He felt on top of the world. For not only had he done it,
had he broken the July code, but he now had the key to
had he broken the July code, but he now had the key to
every future coded message, since instructions as to the
every future coded message, since instructions as to the
source of the next one must of necessity appear in the
source of the next one must of necessity appear in the
current one at the end of each month.
current one at the end of each month.
—
—
Talking to Strange Men,
Talking to Strange Men,
Ruth Rendell
Ruth Rendell
Confidentiality using Symmetric
Confidentiality using Symmetric
Encryption
Encryption
traditionally symmetric encryption is used to
traditionally symmetric encryption is used to
provide message confidentiality
provide message confidentiality
Placement of Encryption
Placement of Encryption
have two major placement alternatives
have two major placement alternatives
link encryption
link encryption
encryption occurs independently on every link
encryption occurs independently on every link
implies must decrypt traffic between links
implies must decrypt traffic between links
requires many devices, but paired keys
requires many devices, but paired keys
end-to-end encryption
end-to-end encryption
encryption occurs between original source
encryption occurs between original source
and final destination
and final destination
need devices at each end with shared keys
need devices at each end with shared keys
Placement of Encryption
Placement of Encryption
Placement of Encryption
Placement of Encryption
when using end-to-end encryption must leave
when using end-to-end encryption must leave
headers in clear
headers in clear
so network can correctly route information
so network can correctly route information
hence although contents protected, traffic
hence although contents protected, traffic
pattern flows are not
pattern flows are not
ideally want both at once
ideally want both at once
end-to-end protects data contents over entire
end-to-end protects data contents over entire
path and provides authentication
path and provides authentication
link protects traffic flows from monitoring
link protects traffic flows from monitoring
Placement of Encryption
Placement of Encryption
can place encryption function at various layers in
can place encryption function at various layers in
OSI Reference Model
OSI Reference Model
link encryption occurs at layers 1 or 2
link encryption occurs at layers 1 or 2
end-to-end can occur at layers 3, 4, 6, 7
end-to-end can occur at layers 3, 4, 6, 7
as move higher less information is encrypted
as move higher less information is encrypted
but it is more secure though more complex
but it is more secure though more complex
with more entities and keys
with more entities and keys
Encryption vs Protocol Level
Encryption vs Protocol Level
Traffic Analysis
Traffic Analysis
is monitoring of communications flows between
is monitoring of communications flows between
parties
parties
useful both in military & commercial spheres
useful both in military & commercial spheres
can also be used to create a covert channel
can also be used to create a covert channel
link encryption obscures header details
link encryption obscures header details
but overall traffic volumes in networks and at
but overall traffic volumes in networks and at
end-points is still visible
end-points is still visible
traffic padding can further obscure flows
traffic padding can further obscure flows
but at cost of continuous traffic
but at cost of continuous traffic
Key Distribution
Key Distribution
symmetric schemes require both parties to share
symmetric schemes require both parties to share
a common secret key
a common secret key
issue is how to securely distribute this key
issue is how to securely distribute this key
often secure system failure due to a break in the
often secure system failure due to a break in the
key distribution scheme
key distribution scheme
Key Distribution
Key Distribution
given parties A and B have various
given parties A and B have various
key
key
distribution
distribution
alternatives:
alternatives:
1.
1.
A can select key and physically deliver to B
A can select key and physically deliver to B
2.
2.
third party can select & deliver key to A & B
third party can select & deliver key to A & B
3.
3.
if A & B have communicated previously can
if A & B have communicated previously can
use previous key to encrypt a new key
use previous key to encrypt a new key
4.
4.
if A & B have secure communications with a
if A & B have secure communications with a
third party C, C can relay key between A & B
third party C, C can relay key between A & B
Key Hierarchy
Key Hierarchy
typically have a hierarchy of keys
typically have a hierarchy of keys
session key
session key
temporary key
temporary key
used for encryption of data between users
used for encryption of data between users
for one logical session then discarded
for one logical session then discarded
master key
master key
used to encrypt session keys
used to encrypt session keys
shared by user & key distribution center
shared by user & key distribution center
Key Distribution Scenario
Key Distribution Scenario
Key Distribution Issues
Key Distribution Issues
hierarchies of KDC’s required for large networks,
hierarchies of KDC’s required for large networks,
but must trust each other
but must trust each other
session key lifetimes should be limited for
session key lifetimes should be limited for
greater security
greater security
use of automatic key distribution on behalf of
use of automatic key distribution on behalf of
users, but must trust system
users, but must trust system
use of decentralized key distribution
use of decentralized key distribution
controlling key usage
controlling key usage
Random Numbers
Random Numbers
many uses of
many uses of
random numbers
random numbers
in cryptography
in cryptography
nonces in authentication protocols to prevent replay
nonces in authentication protocols to prevent replay
session keys
session keys
public key generation
public key generation
keystream for a one-time pad
keystream for a one-time pad
in all cases its critical that these values be
in all cases its critical that these values be
statistically random, uniform distribution, independent
statistically random, uniform distribution, independent
unpredictability of future values from
unpredictability of future values from
previous values
previous values
Pseudorandom Number
Pseudorandom Number
Generators (PRNGs)
Generators (PRNGs)
often use deterministic algorithmic techniques to
often use deterministic algorithmic techniques to
create “random numbers”
create “random numbers”
although are not truly random
although are not truly random
can pass many tests of “randomness”
can pass many tests of “randomness”
known as “pseudorandom numbers”
known as “pseudorandom numbers”
created by “
created by “
Pseudorandom Number Generators
Pseudorandom Number Generators
(PRNGs)”
(PRNGs)”
Linear Congruential
Linear Congruential
Generator
Generator
common iterative technique using:
common iterative technique using:
X
X
n
n
+1
+1
= (
= (
aX
aX
n
n
+
+
c
c
) mod
) mod
m
m
given suitable values of parameters can produce a
given suitable values of parameters can produce a
long random-like sequence
long random-like sequence
suitable criteria to have are:
suitable criteria to have are:
function generates a full-period
function generates a full-period
generated sequence should appear random
generated sequence should appear random
efficient implementation with 32-bit arithmetic
efficient implementation with 32-bit arithmetic
note that an attacker can reconstruct sequence
note that an attacker can reconstruct sequence
given a small number of values
given a small number of values
have possibilities for making this harder
have possibilities for making this harder
Using Block Ciphers as PRNGs
Using Block Ciphers as PRNGs
for cryptographic applications, can use a block
for cryptographic applications, can use a block
cipher to generate random numbers
cipher to generate random numbers
often for creating session keys from master key
often for creating session keys from master key
Counter Mode
Counter Mode
X
X
i
i
= E
= E
Km
Km
[i]
[i]
Output Feedback Mode
Output Feedback Mode
X
X
i
i
= E
= E
Km
Km
[
[
X
X
i-1
i-1
]
]
ANSI X9.17 PRG
ANSI X9.17 PRG
Blum Blum Shub Generator
Blum Blum Shub Generator
based on public key algorithms
based on public key algorithms
use least significant bit from iterative equation:
use least significant bit from iterative equation:
x
x
i
i
= x
= x
i-1
i-1
2
2
mod n
mod n
where
where
n=p.q
n=p.q
, and primes
, and primes
p,q=3 mod 4
p,q=3 mod 4
unpredictable, passes
unpredictable, passes
next-bit
next-bit
test
test
security rests on difficulty of factoring N
security rests on difficulty of factoring N
is unpredictable given any run of bits
is unpredictable given any run of bits
slow, since very large numbers must be used
slow, since very large numbers must be used
too slow for cipher use, good for key generation
too slow for cipher use, good for key generation
Natural Random Noise
Natural Random Noise
best source is natural randomness in real world
best source is natural randomness in real world
find a regular but random event and monitor
find a regular but random event and monitor
do generally need special h/w to do this
do generally need special h/w to do this
eg. radiation counters, radio noise, audio noise,
eg. radiation counters, radio noise, audio noise,
thermal noise in diodes, leaky capacitors, mercury
thermal noise in diodes, leaky capacitors, mercury
discharge tubes etc
discharge tubes etc
starting to see such h/w in new CPU's
starting to see such h/w in new CPU's
problems of
problems of
bias
bias
or uneven distribution in signal
or uneven distribution in signal
have to compensate for this when sample and use
have to compensate for this when sample and use
best to only use a few noisiest bits from each sample
best to only use a few noisiest bits from each sample
Published Sources
Published Sources
a few published collections of random numbers
a few published collections of random numbers
Rand Co, in 1955, published 1 million numbers
Rand Co, in 1955, published 1 million numbers
generated using an electronic roulette wheel
generated using an electronic roulette wheel
has been used in some cipher designs cf Khafre
has been used in some cipher designs cf Khafre
earlier Tippett in 1927 published a collection
earlier Tippett in 1927 published a collection
issues are that:
issues are that:
these are limited
these are limited
too well-known for most uses
too well-known for most uses
Summary
Summary
have considered:
have considered:
use and placement of symmetric encryption to
use and placement of symmetric encryption to
protect confidentiality
protect confidentiality
need for good key distribution
need for good key distribution
use of trusted third party KDC’s
use of trusted third party KDC’s
random number generation issues
random number generation issues