Chapter 7: Network Security
Chapter 7: Network Security
Chapter goals:
understand principles of network security:
Chapter 7
Network Security
security in practice:
firewalls
security in application, transport, network, link layers
see ref books (not covered in class)
Note: Some figures in this slides are taken from the book Computer Networking by Kurose and Ross
Outline
Authentication Protocols
Key Distribution
Firewalls
Bob
messages
data
secure
sender
secure
receiver
data
Trudy
Alices
plaintext
B key
encryption
algorithm
ciphertext
decryption plaintext
algorithm
K decryption
key
Bobs
K encryption
A
10
Transposition Ciphers
Substitution Ciphers
A transposition cipher
plaintext:
abcdefghijklmnopqrstuvwxyz
ciphertext:
mnbvcxzasdfghjklpoiuytrewq
Key: MEGABUCK
One-Time Pads
Message 1: I love you. in 7-bit ASCII
Pad 1 = Pad 2 ?
Fundamental principles
Redundancy: Messages must contain some
redundancy
Freshness: Some method is needed to foil replay
attacks
The algorithm should be public, only the key
should be secret.
14
Symmetric-Key Algorithms
Product Ciphers
P-box. Permutation
S-box. Substitution
(c) Product cipher box. k inputs to k outputs.
(b)
15
16
Plaintext
Plaintext
Encrypt with
secret key
Decrypt with
secret key
Ciphertext
18
Triple DES
1.
2.
5.
19
20
Cipher Modes
21
22
(a) Encryption.
(b) Decryption.
(b) Decryption.
Require an entire 64-bit (8-byte) block to arrive before decryption can begin
23
24
Counter Mode
A stream cipher.
(a) Encryption.
(b) Decryption.
25
26
plaintext
message, P
encryption ciphertext
algorithm
C = EB(P)
decryption plaintext
algorithm message
27
28
P = DB(EB(P))
Requirements
D(E(P))=P
It is exceedingly difficult to deduce D from E
29
30
Integer variables
Def: a=b (mod n)
(a-b) is divisible by n
Properties:
a=b (mod n)
b=a (mod n)
a=c (mod n)
ap = bp (mod n)
ECE/CSC 570, Fall 2014
EB
32
DB
RSA: Example
p=3 and q=11, this gives us n=33 and z=20. A good value
for d is d=7 since 7 and 20 have no common factors. Now
7e =1 mod(20) and this gives us e=3.
d
P = (P e mod n) mod n
C
33
d
P = (P emod n)
mod n
y
y mod (p-1)(q-1)
x mod n = x
mod n
D (E (P)) = P = E (D (P))
B
ed mod (p-1)(q-1)
1
= P mod n
(since we chose ed to be divisible by
(p-1)(q-1) with remainder 1 )
= P
mod n
35
34
36
Digital Signatures
37
39
long
message
P
H: Hash
Function
H(P)
One-way
function
40
Authentication
H: Hash
function
Bobs
private
key
DB
H(P)
digital
signature
(encrypt)
encrypted
msg digest
DB(H(P))
H: Hash
function
public
key
DB(H(P))
large
message
Bobs
P
EB
I am Alice
digital
signature
(decrypt)
equal
?
42
43
Authentication
I am Alice
Failure scenario??
H(P)
H(P)
No secrecy here.
anyone can see Bobs message.
41
in a network,
Bob can not see
Alice, so Trudy simply
declares
herself to be Alice
Alices
I am Alice
IP address
Failure scenario??
44
Alices
IP address
45
Alices
Alices
Im Alice
IP addr password
Alices
IP addr
46
Alices
IP addr
OK
Alices encrypted
Im Alice
IP addr password
Alices
IP addr
OK
Alices
Alices
Im Alice
IP addr password
47
Failure scenario??
Alices
Alices
Im Alice
IP addr password
OK
48
Failure scenario??
Alices encrypted
Im Alice
IP addr password
Alices
IP addr
I am Alice
record
and
playback
still works!
OK
R
KA-B(R)
Alices encrypted
Im Alice
IP addr password
Failures, drawbacks?
49
50
Authentication: ap5.0
Bob computes
+ -
K A (R)
KA
+: public -: private
51
I am Alice
I am Alice
I am Alice
R
K (R)
A
Send me your public key
+
K
A
KA(KA (R)) = R
K (R)
T
Send me your public key
+
K
T
Trudy gets
- +
m = K (K (m))
A A
52
+
K (m)
A
- +
m = K (K (m))
T T
+
K (m)
T
Solution:
Difficult to detect:
Solution:
trusted certification
authority (CA)
53
54
KB-KDC
KA-KDC
55
KDC
generates
R1 (random
number)
KA-KDC(A,B)
Alice
knows
R1
KA-KDC KP-KDC
KX-KDC
KA-KDC(R1, KB-KDC(A,R1) )
KB-KDC(A,R1)
KY-KDC
KB-KDC
KZ-KDC
Certification Authorities
digital
signature
(decrypt)
Bobs
public
+
key K B
Bobs
identifying
information
57
digital
signature
(encrypt)
CA
private K key CA
KB
KB
CA
public
key
certificate for
Bobs public key,
signed by CA
58
+
KB
+
K CA
Firewalls
A certificate contains:
firewall
isolates organizations internal net from larger
Internet, allowing some packets to pass,
blocking others.
info about
certificate
issuer
valid dates
digital
signature by
issuer
public
Internet
administered
network
firewall
59
60
Bobs
public
key
Firewalls: Why ?
Should arriving
packet be allowed
in? Departing packet
let out?
61
The first segment in every TCP connection has the ACK bit set to 0,
whereas all other segments in the connection have the ACK bit set to 1
Firewall Setting
Policy
63
62
64
source
address
222.22/16
dest
address
outside of
222.22/16
allow
outside of
222.22/16
222.22/16
allow
222.22/16
allow
outside of
222.22/16
222.22/16
deny
all
all
outside of
222.22/16
protocol
TCP
admits packets that make no sense, e.g., dest port = 80, ACK bit
set, even though no TCP connection established:
source
port
dest
port
> 1023
flag
bit
action
any
80
allow
TCP
80
> 1023
ACK
UDP
> 1023
53
---
UDP
53
> 1023
----
all
all
all
all
allow
source
dest
address
outside of
outside of
222.22/16
222.22/16
222.22/16
allow
allow
222.22/16
outside of
outside of
222.22/16
222.22/16
222.22/16
deny
67
all
dest
flag
port
port
bit
80
> 1023
ACK
TCP
address
222.22/16
222.22/16
source
66
all
source
dest
flag
port
port
bit
TCP
> 1023
80
TCP
80
> 1023
ACK
UDP
> 1023
53
---
UDP
53
> 1023
----
all
all
all
all
proto
Application Gateway
Application gateway look beyond the IP/TCP/UDP headers and make
policy decisions based on application data.
allow
outside of
protocol
action
dest
address
222.22/16
65
source
address
check
connection
any
host-to-gateway
telnet session
application
gateway
tradeoff: degree of
communication with
outside world, level of
security
many highly protected
sites still suffer from
attacks.
69
70
Other Issues
Wireless Security
802.11 Security
WEP (Wired Equivalent Privacy) Protocol
IEEE announced that 802.11 WEB1.0 was completely
broken (Sept. 7, 2001)
Social Issues
71
72