Lesson 01
Lesson 01
Chapter goals:
understand principles of network security:
cryptography and its many uses beyond
“confidentiality”
authentication
message integrity
security in practice:
firewalls and intrusion detection systems
security in application, transport, network, link
layers
Alice Bob
data, control
channel
messages
Trudy
8: Network Security 8-5
Who might Bob, Alice be?
… well, real-life Bobs and Alices!
Web browser/server for electronic
transactions (e.g., on-line purchases)
on-line banking client/server
DNS servers
routers exchanging routing table updates
other examples?
plaintext: abcdefghijklmnopqrstuvwxyz
ciphertext: mnbvcxzasdfghjklpoiuytrewq
KA-B KA-B
one pass
64-bit scrambler
through: one
input bit
affects eight 64-bit output
output bits
multiple passes: each input bit afects all output bits
block ciphers: DES, 3DES, AES
+
clear
what happens in “HTTP/1.1” c(i-1)
scenario from above?
block
cipher
c(i)
8: Network Security 8-16
Public key cryptography
- Bob’s private
K
B key
Requirements:
+ . .
1 need K B( ) and K - ( ) such that
B
- +
K (K (m)) = m
B B
-
B
m = (m e mod n) d mod n
Magic
happens!
c
letter m me c = me mod n
encrypt:
l 12 1524832 17
d
decrypt:
c c m = cd mod n letter
17 481968572106750915091411825223071697 12 l
e
(m mod n) d mod n = med mod n
ed mod (p-1)(q-1)
= m mod n
(using number theory result above)
1
= m mod n
(since we chose ed to be divisible by
(p-1)(q-1) with remainder 1 )
= m
8: Network Security 8-23
RSA: another important property
The following property will be very useful later:
- + + -
K (K (m)) = m = K (K (m))
B B B B
Cryptographic Hash:
takes input m, produces fixed length value, H(m)
e.g., as in Internet checksum
(message) H(.)
m H(m+s) m
public
m append compare
Internet
H(m+s)
H(m+s)
H(.)
s
(shared secret)
non-repudiation:
Alice can take m, and signature K (m) to court and
B
prove that Bob signed m. -
equal
?
8: Network Security 8-33
Public Key Certification
public key problem:
When Alice obtains Bob’s public key (from web site,
e-mail, diskette), how does she know it is Bob’s
public key, not Trudy’s?
solution:
trusted certification authority (CA)
+
- +
K CA(KB ) digital Bob’s
KB signature public
+
(decrypt) K B key
CA
public +
K CA
key
“I am Alice”
Failure scenario??
in a network,
Bob can not “see”
Alice, so Trudy simply
“I am Alice” declares
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!
8: Network Security 8-47
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 + -
- KA(KA (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)
A sends T T Alice
m to
- + encrypted with
m = K (K (m))
A A Alice’s public key
8: Network Security 8-49
ap5.0: security hole
Man (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!
m K (.)
S
KS(m ) KS(m )
KS( ) . m
+ Internet - KS
KS
+.
K ()
B + +
- .
K B( )
KB(KS ) KB(KS )
+ -
KB
KB
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. 8: Network Security 8-52
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
+.
K ()
B + +
- .
K B( )
KB(KS ) KB(KS )
+ -
KB
KB
Bob:
uses his private key to decrypt and recover KS
uses KS to decrypt KS(m) to recover m
- KA
+
KA
- -
m .
H( )
-.
K ()
A
KA(H(m)) KA(H(m)) +
KA( )
. H(m )
+ Internet - compare
m H( ). H(m )
m
+ KS( ) .
m + Internet
KS
+
K B( )
. +
KB(KS )
+
KB
Application
Application
SSL sublayer SSL
TCP TCP TCP socket
socket
IP IP
TCP API TCP enhanced with SSL
2. Key Derivation:
Alice, Bob use shared secret (MS) to generate 4
keys:
EB: Bob->Alice data encryption key
EA: Alice->Bob data encryption key
MB: Bob->Alice MAC key
MA: Alice->Bob MAC key
encryption and MAC algorithms negotiable between
Bob, Alice
why 4 keys?
d H(d) EB
.
H( ) SSL
encrypt d,
MAC, SSL
seq. #
seq. #
d H(d)
SSL record
format Type Ver Len d H(d)
authenticated
encrypted
ESP ESP ESP
IP header TCP/UDP segment
header trailer authent.
ci = di XOR kiIV
IV and encrypted bytes, ci sent in frame
1 Discovery of
security capabilities
wired
network
EAP TLS
EAP
EAP over LAN (EAPoL) RADIUS
IEEE 802.11 UDP/IP
8: Network Security 8-74
Chapter 8 roadmap
administered public
network Internet
firewall
Prevent Web-radios from eating Drop all incoming UDP packets - except
up the available bandwidth. DNS and router broadcasts.
Prevent your network from being Drop all ICMP packets going to a
used for a smurf DoS attack. “broadcast” address (eg
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.
application firewall
gateway
Internet
internal
network Web
IDS server DNS
sensors server
FTP
server demilitarized
zone
8: Network Security 8-87
Network Security (summary)
Basic techniques…...
cryptography (symmetric and public)
message integrity
end-point authentication