CSE4213W08 Lect10
CSE4213W08 Lect10
Chapter 8
Network Security
Course page:
http://www.cs.yorku.ca/course/4213
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
There are bad guys (and girls) out
there!
Q: What can a “bad guy” do?
A: a lot!
eavesdrop: intercept messages
actively insert messages into connection
impersonation: can fake (spoof) source
address in packet (or any field in packet)
hijacking: “take over” ongoing connection
by removing sender or receiver, inserting
himself in place
denial of service: prevent service from being
used by others (e.g., by overloading
resources)
more on this later ……
8: Network Security 8-6
Network Stack
physical
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
c(i)
8: Network Security 8-19
Public key cryptography
- Bob’s private
K
B key
Requirements:
+ . .
1 need KB ( ) and -K ( ) such that
B
- +
K (K (m)) = m
B B
+ be impossible
given public key K , it should
2 to compute private keyB K
-
B
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 d mod n = ed
m
n) mod n
ed mod (p-1)(q-
= m
1) number theory result above)
(using
mod n
1
= m mod n
(since we chose ed to be divisible by
(p-1)(q-1) with remainder 1 )
= m
8: Network Security 8-26
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-36
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) KB key
CA
public K+
CA
key
“I am Alice”
Failure scenario??
in a network,
Bob can not “see”
Alice, so Trudy
“I am Alice” simply 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:
Alice’s Trudy records Alice’s
OK
IP addr packet
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
Failures, drawbacks? must be Alice!
8: Network Security 8-50
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(K A(R)) = R
K A (R) and knows only Alice
“send me your public key”
could have the
+ private key, that
KA encrypted R 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 m
sends T to
A
- + Alice encrypted
m = K (K (m))
A A with Alice’s
public key 8: Network Security 8-52
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 (.)
KS(m KS(m
KS( ) . m
S ) )
+ Internet - KS
KS
+.
K ()
B + +
-
KB( )
.
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-55
Secure e-mail
Alice wants to send confidential e-mail, m, to Bob.
KS
m K (.)
KS(m KS(m
KS( ) . m
S ) )
+ Internet - KS
KS
+.
K ()
B + +
-
KB( )
.
KB(KS ) KB(KS )
+ -
KB
KB
Bob:
uses his private key to decrypt and
recover KS
uses K to decrypt K (m) to recover m
S S
8: Network Security 8-56
Secure e-mail (continued)
• Alice wants to provide sender authentication
message integrity.
- 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
+
KB( )
. +
KB(KS )
+
KB
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 d H(d)
Len
unencryptedencrypted using EB
8: Network Security 8-64
Chapter 8 roadmap
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-77
Chapter 8 roadmap
administered public
network Internet
firewall
Prevent your network from Drop all outgoing ICMP TTL expired
being tracerouted traffic
outside of
allow 222.22/16 UDP > 1023 53 ---
222.22/16
as 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-90
Network Security (summary)
Basic techniques…...
cryptography (symmetric and public)
message integrity
end-point authentication