Chapter - 8 - V6.0. Security
Chapter - 8 - V6.0. Security
Security
8-1
Course Description
This course will introduce students to
advanced topics in network security. Topics
will include encryption and authentication
techniques, detection and analysis of
intrusions, and the security of electronic mail
and web access.
Restricted to Computer Science students or
permission of instructor.
Prerequisite: 60-367.
Introduction
2-2
8-2
Basis for Evaluation -
Requirements
Component Date Location Weight
Midterm Exam Thursday November ER 2137 (regular 20%
#1 12 - in lecture room classroom)
Research Essay Sunday November 22 Email submission 20%
(Individual) (23:59:59ET) to:
[email protected]
Alice Bob
channel data, control
messages
Trudy
Alice’s Bob’s
K encryption K decryption
A
key Bkey
m plaintext message
KA(m) ciphertext, encrypted with key KA
m = KB(KA(m))
KS KS
plaintext: abcdefghijklmnopqrstuvwxyz
ciphertext: mnbvcxzasdfghjklpoiuytrewq
DES operation
initial permutation
16 identical “rounds” of
function application,
each using different
48 bits of key
final permutation
- Bob’s private
K
B key
1 need KB
(
+
) .
and K -
( ).such that
B
- +
K (K (m)) = m
B B
d
c c m = cd mod n
decrypt:
17 481968572106750915091411825223071697 12
- + + -
K (K (m)) = m = K (K (m))
B B B B
result is the
same!
Network Security 8-29
- + + -
Why K (K (m)) = m = K (K (m))
B B B B
?
“I am Alice”
Failure scenario??
in a network,
Bob can not “see” Alice,
so Trudy simply declares
“I am Alice” herself to be Alice
Alice’s
IP address “I am Alice”
Failure scenario??
Alice’s Alice’s
“I’m Alice”
IP addr password
Alice’s Alice’s
“I’m Alice”
IP addr password
playback attack: Trudy
Alice’s records Alice’s packet
OK
IP addr and later
plays it back to Bob
Alice’s Alice’s
“I’m Alice”
IP addr password
Alice’s encrypted
“I’m Alice”
IP addr password
Alice’s encrypted
“I’m Alice” record
IP addr password
and
Alice’s
OK playback
IP addr
still works!
Alice’s encrypted
“I’m Alice”
IP addr password
R
KA-B(R) Alice is live, and
only Alice knows
key to encrypt
nonce, so it must
Failures, drawbacks? be Alice!
Network Security 8-42
Authentication: ap5.0
ap4.0 requires shared symmetric key
can we authenticate using public key techniques?
ap5.0: use nonce, public key cryptography
“I am Alice”
Bob computes
R + -
- K A(K A(R)) = R
K A (R)
and knows only Alice
“send me your public key” could have the private
+ key, that encrypted R
KA such that
+ -
K (K (R)) = R
A A
I am Alice I am Alice
R -
K (R)
T
R - Send me your public key
K (R) +
A K
T
Send me your public key
+
K
A +
K (m)
Trudy gets T
- +
+ m = K (K (m))
K (m) T T
A sends m to Alice
- +
m = K (K (m)) encrypted with
A A Alice’s public key
Network Security 8-44
ap5.0: security
hole
man (or woman) in the middle attack: Trudy poses as
Alice (to Bob) and as Bob (to Alice)
difficult to detect:
Bob receives everything that Alice sends, and vice
versa. (e.g., so Bob, Alice can meet one week later
and recall conversation!)
problem is that Trudy receives all messages as well!
- Bob’s private -
Bob’s message, m KB m,K B(m)
key
Dear Alice
Bob’s message,
Oh, how I have missed Public key
you. I think of you all the
m, signed
time! …(blah blah blah) encryption (encrypted) with
algorithm his private key
Bob
is many-to-one
equal
?
Network Security 8-52
Hash function algorithms
MD5 hash function widely used (RFC 1321)
computes 128-bit message digest in 4-step process.
arbitrary 128-bit string x, appears difficult to construct
msg m whose MD5 hash is equal to x
SHA-1 is also used
US standard [NIST, FIPS PUB 180-1]
160-bit message digest
I am Alice I am Alice
R -
K (R)
T
R - Send me your public key
K (R) +
A K
T
Send me your public key
+
K
A +
K (m)
Trudy gets T
- +
+ m = K (K (m))
K (m) T T
A sends m to Alice
- +
m = K (K (m)) encrypted with
A A Alice’s public key
Network Security 8-54
Public-key certification
motivation: Trudy plays pizza prank on Bob
Trudy creates e-mail order:
Dear Pizza Store, Please deliver to me four
pepperoni pizzas. Thank you, Bob
Trudy signs order with her private key
Trudy sends order to Pizza Store
Trudy sends to Pizza Store her public key, but
says it’s Bob’s public key
Pizza Store verifies signature; then delivers four
pepperoni pizzas to Bob
Bob doesn’t even like pepperoni
Bob’s digital
+
public signature KB
+
key KB (encrypt)
CA
private - certificate for
Bob’s K
identifying key CA Bob’s public key,
information signed by CA
Network Security 8-56
Certification authorities
when Alice wants Bob’s public key:
gets Bob’s certificate (Bob or elsewhere).
apply CA’s public key to Bob’s certificate, get
Bob’s public key
+ digital Bob’s
KB signature public
+
(decrypt) K B key
CA
public K+
CA
key
m K ( .)
S
KS(m ) KS(m )
KS( ) . m
+ Internet
- KS
KS
+
KB( ). + +
-
KB( ) .
KB(KS ) KB(KS )
K+
B K-B
Alice:
generates random symmetric private key, KS
encrypts message with KS (for efficiency)
also encrypts KS with Bob’s public key
sends both KS(m) and KB(KS) to Bob
Network Security 8-59
Secure e-mail
Alice wants to send confidential e-mail, m, to Bob.
KS
m K ( .)
S
KS(m ) KS(m )
KS( ) . m
+ Internet
- KS
KS
+
KB( ). + +
-
KB( ) .
KB(KS ) KB(KS )
K+
B K-B
Bob:
uses his private key to decrypt and recover
KS
uses KS to decrypt KS(m) to recover m
Network Security 8-60
Secure e-mail (continued)
Alice wants to provide sender authentication message
integrity
KA- K+
A
- -
m .
H( )
-
KA( ) . KA(H(m)) KA(H(m)) +
KA( ). H(m )
+ Internet
- compare
m H( ). H(m )
m
+ KS( ) .
m + Internet
KS
+
KB( ) . +
KB(KS )
K+
B
Application Application
SSL
TCP
TCP
IP IP
+ .
KS ( )
m + Internet
KS
+
KB( ). +
KB(KS )
+
KB
bob.com
encrypted
3. establish keys
data data
MAC MAC
fragment fragment
data
MAC
everything
henceforth
is encrypted
salesperson
in hotel
router w/ router w/
IPv4 and IPsec IPv4 and IPsec
branch office
headquarters Network Security 8-87
IPsec services
data integrity
origin authentication
replay attack prevention
confidentiality
IPsec IPsec
IPsec IPsec
IPsec IPsec
200.168.1.100 193.68.2.23
R1 security association
172.16.1/24
R2
172.16.2/24
“enchilada” authenticated
encrypted
new IP ESP original Original IP ESP ESP
header hdr IP hdr datagram payload trl auth
200.168.1.100 193.68.2.23
R1 security association
172.16.1/24
R2
172.16.2/24
“enchilada” authenticated
encrypted
new IP ESP original Original IP ESP ESP
header hdr IP hdr datagram payload trl auth
keystream
Key+IVpacket keystreampacket
generator
Key
IV data ICV
ID
MAC payload
Network Security 8-111
WEP encryption (2)
IV
(per frame)
KS: 104-bit key sequence generator
secret ( for given KS, IV)
symmetric
k1IV k2IV k3IV … kNIV kN+1IV… kN+1IV 802.11 WEP-encrypted data
key IV
header plus ICV
plaintext &
frame data d1 d2 d3 … dN CRC1 … CRC4
plus CRC
c1 c2 c3 … cN cN+1 … cN+4
frame
Key
IV data ICV
ID
MAC payload
receiver extracts IV
inputs IV, shared secret key into pseudo random
generator, gets keystream
XORs keystream with encrypted data to decrypt data
+ ICV
verifies integrity of data with ICV
note: message integrity approach used here is
different from MAC (message authentication code)
and signatures (using PKI).
Network Security 8-113
End-point authentication w/
nonce
Nonce: number (R) used only once –in-a-lifetime
How to prove Alice “live”: Bob sends Alice nonce, R.
Alice
must return R, encrypted with shared secret key
“I am Alice”
R
KA-B (R) Alice is live, and
only Alice knows
key to encrypt
nonce, so it must
be Alice!
Network Security 8-114
WEP authentication
authentication request
Notes:
not all APs do it, even if WEP is being used
AP indicates if authentication is necessary in beacon
frame
done before association Network Security 8-115
Breaking 802.11 WEP
encryption
security hole:
24-bit IV, one IV per frame, -> IV’s eventually reused
IV transmitted in plaintext -> IV reuse detected
attack:
Trudy causes Alice to encrypt known plaintext d1 d2 d3
d4 …
Trudy sees: ci = di XOR kiIV
Trudy knows ci di, so can compute kiIV
Trudy knows encrypting key sequence k1IV k2IV k3IV …
Next time IV is used, Trudy can decrypt!
1 Discovery of
security capabilities
3 STA derives
Pairwise Master 3 AS derives
same PMK,
Key (PMK)
sends to AP
wired
network
EAP TLS
EAP
EAP over LAN (EAPoL) RADIUS
IEEE 802.11 UDP/IP
Network Security 8-119
WEP's Major Weakness
Static encryption keys.
When you set up a router with a WEP encryption key, that
one key is used by every device on your network to encrypt
every packet that's transmitted.
But the fact that packets are encrypted doesn't prevent them
from being intercepted, and due to technical flaws it's
entirely possible for an eavesdropper to intercept enough
WEP-encrypted packets to eventually deduce what the key
is.
Can mitigate by periodically changing the WEP key
Routers generally allow you to store up to four keys.
But few bother to do this because changing WEP keys is
inconvenient and time-consuming because it has to be done
not just on the router, but on every device that connects to it.
As a result, most people just set up a single key and then
continue using it ad infinitum.
Network Security 8-120
Wi-Fi Protected Access
(WPA)
WPA aims to provide stronger wireless data
encryption than WEP.
In order to use WPA all devices on the network must be
configured for WPA. Can mitigate by periodically changing
the WEP key
Improved data encryption through the temporal key integrity
protocol (TKIP). TKIP scrambles the keys using a hashing
algorithm and, by adding an integrity-checking feature,
ensures that the keys haven't been tampered with.
User authentication, which is generally missing in WEP,
through the extensible authentication protocol (EAP). WEP
regulates access to a wireless network based on a
computer's hardware-specific MAC address, which is
relatively simple to be sniffed out and stolen.
administered public
network Internet
trusted “good guys” untrusted “bad guys”
firewall
Network Security 8-123
Firewalls: why
prevent denial of service attacks:
SYN flooding: attacker establishes many bogus TCP
connections, no resources left for “real” connections
prevent illegal modification/access of internal data
e.g., attacker replaces CIA’s homepage with
something else
allow only authorized access to inside network
set of authenticated users/hosts
three types of firewalls:
stateless packet filters
stateful packet filters
application gateways
Network Security 8-124
Stateless packet filtering
Should arriving
packet be allowed in?
Departing packet let
out?
Prevent your network from being Drop all ICMP packets going to a
used for a smurf DoS attack. “broadcast” address (e.g.
130.207.255.255).
Prevent your network from being Drop all outgoing ICMP TTL expired
tracerouted traffic
outside of
allow 222.22/16 UDP > 1023 53 ---
222.22/16
on IP/TCP/UDP fields.
example: allow select
internal users to telnet
outside.
1. require all telnet users to telnet through gateway.
2. for authorized users, gateway sets up telnet
connection to dest host. Gateway relays data
between 2 connections
3. router filter blocks all telnet connections not
originating from gateway.
Network Security 8-131
Application gateways
filter packets on host-to-gateway
application
telnet session
application data as well gateway
router and filter
as on IP/TCP/UDP
fields.
example: allow select gateway-to-remote
internal users to telnet host telnet session
outside
1. require all telnet users to telnet through gateway.
2. for authorized users, gateway sets up telnet
connection to dest host. Gateway relays data
between 2 connections
3. router filter blocks all telnet connections not
originating from gateway. Network Security 8-132
Limitations of firewalls,
gateways
IP spoofing: router can’t filters often use all or
know if data “really” nothing policy for UDP
comes from claimed tradeoff: degree of
source communication with
if multiple app’s. need outside world, level of
special treatment, each security
has own app. gateway many highly protected
client software must sites still suffer from
know how to contact attacks
gateway.
e.g., must set IP
address of proxy in
Web browser
Network Security 8-133
Intrusion detection systems
packet filtering:
operates on TCP/IP headers only
no correlation check among sessions
IDS: intrusion detection system
deep packet inspection: look at packet contents
(e.g., check character strings in packet against
database of known virus, attack strings)
examine correlation among multiple packets
• port scanning
• network mapping
• DoS attack
Network Security 8-134
Intrusion detection systems
multiple IDSs: different types of checking at
different locations
firewall
internal
network
Internet