Week 12
Week 12
Reflection
Cause one non-compromised host to attack another
E.g., host A sends DNS request or TCP SYN with source V to
server R. R sends reply to V
Internet
Victim (V)
432
Denial-of-Service Attacks: Reflection
Reflection
Cause one non-compromised host to attack another
E.g., host A sends DNS request or TCP SYN with source V to
server R. R sends reply to V
Internet
V R DATA
Victim (V)
433
IP Traceback
Routers probabilistically tag packets
with an identifier
Destination can infer path to true
source after receiving enough
packets
434
Firewalls
firewall
isolates organization’s internal net from larger Internet,
allowing some packets to pass, blocking others.
administered public
network Internet
firewall
435
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)
two types of firewalls:
• packet-filtering: stateless vs stateful
• application-level
436
Stateless packet filtering Should arriving
packet be allowed in?
Departing packet let
out?
438
Stateful packet filtering
stateless packet filter: heavy handed tool
admits packets that “make no sense,” e.g., source port = 80, ACK
bit set, even though no TCP connection established:
439
Stateful packet filtering
v Access control list (ACL) augmented to indicate need to check
connection state table before admitting packet
outside of
allow 222.22/16 UDP > 1023 53 ---
222.22/16
5-440
Application gateways host-to-gateway
gateway-to-remote
host telnet session
telnet session
fields.
example: allow selected internal
users to telnet outside.
442
Outline
Attacks and counter measures
Security primer
Security in different layers
443
Friends and enemies: Alice, Bob, Trudy
well-known in network security world
Bob, Alice (lovers!) want to communicate “securely”
Trudy (intruder) may intercept, delete, add messages, etc.
Alice Bob
channel data, control
messages
secure secure
data data
sender receiver
Trudy
1-444
There are bad guys (and girls) out there!
Q:What can a “bad guy” do?
A: a lot!
eavesdrop: intercept messages
actively insert/modify 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)
445
The language of cryptography
Alice’s Bob’s
KA encryption KB decryption
key key
446
Symmetric key cryptography
substitution cipher: substituting one thing for another
monoalphabetic cipher: substitute one letter for another
plaintext: abcdefghijklmnopqrstuvwxyz
ciphertext: mnbvcxzasdfghjklpoiuytrewq
447
Symmetric key cryptography
K K
A-B A-B
symmetric key crypto: Bob and Alice share the same (symmetric) key: KA-B
e.g., key is knowing substitution pattern in mono alphabetic substitution
cipher
Q: how do Bob and Alice agree on key value?
448
Symmetric key crypto: DES
DES: Data Encryption Standard
US encryption standard [NIST 1993]
56-bit symmetric key, 64-bit plaintext input
How secure is DES?
DES Challenge III was a joint effort between distributed.net and
Deep Crack. The key was found in just 22 hours 15 minutes in
January 1999, and the plaintext was "See you in Rome (second AES
Conference, March 22-23, 1999)”
making DES more secure:
use three keys sequentially (3-DES) on each datum
use cipher-block chaining
449
AES: Advanced Encryption Standard
new (Nov. 2001) symmetric-key NIST standard, replacing
DES
processes data in 128 bit blocks
128, 192, or 256 bit keys
If brute force decryption (try each key) taking 1 sec on DES,
takes 149 trillion years for AES
KA-KDC KP-KDC
KX-KDC
KP-KDC KB-KDC
KY-KDC
KZ-KDC
KA-KDC KB-KDC
8-451
Key Distribution Center (KDC)
Q: How does KDC allow Bob, Alice to determine shared symmetric secret
key to communicate with each other?
KDC
KA-KDC(A,B) generates
R1
KA-KDC(R1, KB-KDC(A,R1) )
Alice Bob knows to
knows use R1 to
R1 KB-KDC(A,R1)
communicate
with Alice
452
Diffie-Hellman Key Agreement Protocol
Allow Alice and Bob to agree on a shared secret in a public channel
(against passive, i.e., eavesdropping only adversaries)
Setup: a prime p and a base g, both public.
ga mod p
gb mod p
453 K = (ga mod p)b mod p= gab mod p = (gb mod p)a mod p
Diffie-Hellman Example
Alice and Bob agree on p = 23 and g = 5.
Alice chooses a = 6 and sends 56 mod 23 = 8
Bob chooses b = 15 and sends 515 mod 23 = 19
Alice computes 196 mod 23 = 2.
Bob computes 815 mod 23 = 2.
Then 2 is the shared secret.
454
Public Key Cryptography
public key cryptography
public encryption key known to all
private decryption key known only to receiver
1-455
Public key cryptography
+ Bob’s public
K
B key
- Bob’s private
K
B key
456
Public key encryption algorithms
Requirements:
457
RSA: Choosing keys
1. Choose two large prime numbers p, q.
(e.g., 1024 bits each)
K+ K-
B B
458
RSA: Encryption, decryption
0. Given (n,e) and (n,d) as computed above
+ -
K K
B B
1.To encrypt bit pattern, m, compute
c = me mod n (i.e., remainder when me is divided by n)
Magic
m = (me mod n)d mod n
happens!
c
459
RSA example:
Bob chooses p=5, q=7. Then n=35, z=24.
e=5 (so e, z relatively prime).
d=29 (so ed-1 exactly divisible by z)
e e
letter m m c = m mod n
encrypt:
L 12 1524832 17
d d
c c m = c mod n letter
decrypt:
17 481968572106750915091411825223071697 12 L
460
RSA: another important property
The following property will be very useful later:
- + + -
K B (KB (m)) = m = K B (K B (m))
462
Digital Signatures
Application of public key crypto
Cryptographic technique analogous to hand-written
signatures.
sender (Bob) digitally signs document, establishing he is
document owner/creator.
verifiable, nonforgeable: recipient (Alice) can prove to someone
that Bob, and no one else (including Alice), must have signed
document
463
Digital Signatures
Simple digital signature for message m:
Bob signs m by encrypting with his private key KB-, creating
-
“signed” message, KB(m)
- Bob’s private -
Bob’s message, m KB K B(m)
key
Dear Alice
Bob’s message,
Oh, how I have missed Public key m, signed
you. I think of you all the
time! …(blah blah blah) encryption (encrypted) with
algorithm his private key
Bob
464
Digital Signatures (more)
-
Suppose Alice receives msg m, digital signature KB(m)
Alice verifies m signed by Bob by applying Bob’s public key K+B to
- + -
KB(m) then checks KB(KB(m) ) = m.
+ -
If KB(KB(m) ) = m, whoever signed m must have used Bob’s private
key.
Alice thus verifies that:
Bob signed m.
No one else signed m.
Bob signed m and not m’.
Non-repudiation:
-
ü Alice can take m, and signature KB(m) to court and prove that
Bob signed m.
465
Message Digests large
message
H: Hash
Function
m
Computationally expensive to
public-key-encrypt long
H(m)
messages
Goal: fixed-length, easy- to- Hash function properties:
compute digital “fingerprint” many-to-1
apply hash function H to m, get
produces fixed-size msg digest
fixed size message digest, H(m). (fingerprint)
given message digest x,
computationally infeasible to
find m such that x = H(m)
466
Digital signature = signed message digest
Alice verifies signature and integrity of
Bob sends digitally signed digitally signed message:
message:
large
message H: Hash encrypted
m function H(m)
msg digest
-
KB(H(m))
Bob’s digital large
private signature message
- Bob’s
key KB (encrypt) m digital
public
+ signature
key KB
encrypted H: Hash (decrypt)
msg digest function
-
+ KB(H(m))
H(m) H(m)
equal
?
8-467
8-468
Hash Function Algorithms
MD5 hash function widely used (RFC 1321)
computes 128-bit message digest in 4-step process.
In 1996 a flaw was found in the design of MD5 L -- “should
be considered cryptographically broken and unsuitable for
further use”
SHA-2, SHA-3
224, 256, 384 or 512 bits in digests
469
Certification for Public Key
Symmetric key problem: Public key problem:
How do two entities establish When Alice obtains Bob’s
shared secret key over network? public key (from web site, e-
Solution: mail, diskette), how does she
know it is Bob’s public key, not
trusted key distribution center
Trudy’s?
(KDC) acting as intermediary
between entities Solution:
DH trusted certification authority
(CA)
470
Certification Authorities
Certification authority (CA): binds public key to particular entity,
E.
E (person, server) registers its public key with CA.
E provides “proof of identity” to CA.
CA creates certificate binding E to its public key.
certificate containing E’s public key digitally signed by CA – CA says “this is
E’s public key”
Bob’s encrypt
+
public + KB
key KB
CA
private - certificate for
Bob’s K CA
identifying key Bob’s public key,
information signed by CA
8-471
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
Agree or not?
+ Decrypt Bob’s
KB public
+
KB key
CA
public +
K CA
key
8-472
What we learned so far?
Message confidentiality: shared key or public key crypto
Message integrity: hash
Authenticity of a digital message: digital signature
473
Authentication
Goal: Bob wants Alice to “prove” her identity to him
“I am Alice”
Failure scenario??
474
Authentication
Goal: Bob wants Alice to “prove” her identity to him
in a network,
Bob can not “see” Alice, so
Trudy simply declares
herself to be Alice
“I am Alice”
475
Authentication: another try
Protocol ap2.0: Alice says “I am Alice” in an IP packet
containing her source IP address
Alice’s
IP address
“I am Alice”
Failure scenario??
476
Authentication: another try
Protocol ap2.0: Alice says “I am Alice” in an IP packet
containing her source IP address
477
Authentication: another try
Protocol ap3.0: Alice says “I am Alice” and sends her
secret password to “prove” it.
Alice’s Alice’s
“I’m Alice”
IP addr password
Failure scenario??
Alice’s
OK
IP addr
478
Authentication: another try
Protocol ap3.0: Alice says “I am Alice” and sends her
secret password to “prove” it.
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
479
Authentication: yet another try
Protocol ap3.1: Alice says “I am Alice” and sends her
encrypted secret password to “prove” it.
Alice’s encrypted
“I’m Alice”
IP addr password
Failure scenario??
Alice’s
OK
IP addr
480
Authentication: another try
Protocol ap3.1: Alice says “I am Alice” and sends her
encrypted secret password to “prove” it.
Alice’s encrypted
“I’m Alice” record
IP addr password
and
playback
Alice’s
OK still works!
IP addr
Alice’s encrypted
“I’m Alice”
IP addr password
481
Authentication: yet another try
Goal: avoid playback attack
“I am Alice”