Lecture12-6p
Lecture12-6p
Friends and enemies: Alice, Bob, Trudy Who might Bob, Alice be?
well-known in network security world
Bob, Alice (lovers!) want to communicate “securely” … well, real-life Bobs and Alices!
Trudy (intruder) may intercept, delete, add messages Web browser/server for electronic transactions
(e.g., on-line purchases)
Alice Bob on-line banking client/server
channel data, control DNS servers
messages
routers exchanging routing table updates
secure
data
sender
secure
receiver
data other examples?
Trudy
Network Security
Network Security
There are bad guys (and girls) out there! The language of cryptography
Q: What can a “bad guy” do? Alice’s Bob’s
A: A lot! K encryption
A K decryption
key Bkey
eavesdrop: intercept messages
actively insert messages into connection plaintext encryption ciphertext decryption plaintext
algorithm algorithm
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 m plaintext message
denial of service: prevent service from being used KA(m) ciphertext, encrypted with key KA
by others (e.g., by overloading resources) m = KB(KA(m))
Network Security Network Security
1
Breaking an encryption scheme Symmetric key cryptography
2
AES: Advanced Encryption Standard Public Key Cryptography
symmetric-key NIST standard, replacied DES symmetric key crypto public key crypto
(Nov 2001) requires sender & receiver radically different
processes data in 128 bit blocks know shared secret key
approach [Diffie-
128, 192, or 256 bit keys Q: how to agree on key in Hellman76, RSA78]
first place (particularly if
brute force decryption (try each key) taking 1 sec never “met”)? Sender & receiver do not
on DES, takes 149 trillion years for AES share secret key
public encryption key
known to all
private decryption key
known only to receiver
Network Security
Network Security
K
- Bob’s private
+ . .
1 need KB( ) and K - ( ) such that
B key B
- +
K (K (m)) = m
B B
plaintext encryption ciphertext decryption plaintext 2 given public key K +, it should be
message, m algorithm +
K (m) algorithm message B
B - +
m = KB (K (m)) impossible to compute private
B -
key K
B
3
RSA: Creating public/private key pair RSA: encryption, decryption
1. choose two large prime numbers p, q. 0. given (n,e) and (n,d) as computed above
(e.g., 1024 bits each)
1. to encrypt message m (<n), compute
2. compute n = pq, z = (p-1)(q-1)
c = m e mod n
3. choose e (with e<n) that has no common factors
with z (e, z are “relatively prime”). 2. to decrypt received bit pattern, c, compute
4. choose d such that ed-1 is exactly divisible by z. m = c d mod n
(in other words: ed mod z = 1 ).
magic m = (me mod n) d mod n
5. public key is (n,e). private key is (n,d).
happens!
+ - c
KB KB
Network Security Network Security
2-19 2-20
4
Why is RSA secure? RSA in practice: session keys
suppose you know Bob’s public key (n,e). How exponentiation in RSA is computationally
hard is it to determine d? intensive
essentially need to find factors of n without DES is at least 100 times faster than RSA
knowing the two factors p and q use public key crypto to establish secure
fact: factoring a big number is hard connection, then establish second key –
symmetric session key – for encrypting data
session key, KS
Bob and Alice use RSA to exchange a symmetric key KS
once both have KS, they use symmetric key cryptography
Alice’s
IP address “I am Alice”
in a network,
Bob can not “see” Alice, Failure scenario??
so Trudy simply declares
“I am Alice” herself to be Alice
5
Authentication: another try Authentication: another try
Protocol ap2.0: Alice says “I am Alice” in an IP packet Protocol ap3.0: Alice says “I am Alice” and sends her
containing her source IP address secret password to “prove” it.
Alice’s Alice’s
“I’m Alice”
IP addr password
Alice’s
“spoofing”
IP address “I am Alice” Alice’s address
Alice’s Alice’s
“I’m Alice”
IP addr password
Alice’s encrypted
“I’m Alice”
IP addr password record “I am Alice”
and
Alice’s
OK playback R
IP addr
still works! Alice is live, and
KA-B(R)
only Alice knows
Alice’s encrypted key to encrypt
“I’m Alice”
IP addr password nonce, so it must
Failures, drawbacks? be Alice!
Network Security Network Security
2-35 2-36
6
Authentication: ap5.0 ap5.0: security hole
man (or woman) in the middle attack: Trudy poses as Alice
ap4.0 requires shared symmetric key (to Bob) and as Bob (to Alice)
can we authenticate using public key techniques?
ap5.0: use nonce, public key cryptography I am Alice I am Alice
R -
K (R)
T
“I am Alice” R Send me your public key
Bob computes - +
K (R)
R + - A K
K A(K A(R)) = R T
- Send me your public key
K A (R) K
+
and knows only Alice A +
“send me your public key” could have the private K (m)
Trudy gets T
+ key, that encrypted R - +
KA such that + m = K (K (m))
K (m) T T
+ - - + A sends m to Alice
K (K (R)) = R m = K (K (m)) encrypted with
A A
A A Alice’s public key
Network Security
2-37 Network Security
7
Message digests Internet checksum: poor crypto hash function
large H: Hash
message
m
Function Internet checksum has some properties of hash function:
computationally expensive to produces fixed length digest (16-bit sum) of message
public-key-encrypt long is many-to-one
messages H(m)
goal: fixed-length, easy- to- Hash function properties: But given message with given hash value, it is easy to find another
compute digital message with same hash value:
“fingerprint” many-to-1
equal
? Network Security
Network Security 2-46
8
Certification authorities Chapter 8 roadmap
certification authority (CA): binds public key to particular
entity, E. 8.1 What is network security?
E (person, router) registers its public key with CA. 8.2 Principles of cryptography
E provides “proof of identity” to CA.
CA creates certificate binding E to its public key.
8.3 Message integrity, authentication
certificate containing E’s public key digitally signed by CA – CA says 8.4 Securing e-mail
“this is E’s public key”
8.5 Securing TCP connections: SSL
8.6 Network layer security: IPsec
digital
Bob’s
public signature
+
KB 8.7 Securing wireless LANs
+
key KB (encrypt) 8.8 Operational security: firewalls and IDS
CA
private - certificate for
Bob’s K CA
identifying key Bob’s public key,
information signed by CA
Network Security
Network Security
+ Internet
- KS + Internet
- KS
KS KB( )
+ . + +
-
KB( ). KS
+
KB( ) . + +
-
KB( ).
KB(KS ) KB(KS ) KB(KS ) KB(KS )
K+ B K-
B K+B K-
B
Alice: Bob:
generates random symmetric private key, KS uses his private key to decrypt and recover K S
encrypts message with KS (for efficiency) uses KS to decrypt KS(m) to recover m
also encrypts KS with Bob’s public key
sends both KS(m) and KB(KS) to Bob Network Security
+ Internet
- compare + KS( ).
m H(.) H(m ) m +
m Internet
KS
+
KB( ). +
Alice digitally signs message KB(KS )
K+
sends both message (in the clear) and digital signature B
Alice uses three keys: her private key, Bob’s public key, newly
Network Security
created symmetric key
Network Security
9
Chapter 8 roadmap SSL: Secure Sockets Layer
widelydeployed security
goals: original
protocol
8.1 What is network security? supported by almost all Web e-commerce
8.2 Principles of cryptography browsers, web servers transactions
8.3 Message integrity https encryption (especially
billions $/year over SSL credit-card numbers)
8.4 Securing e-mail mechanisms: [Woo 1994], Web-server authentication
8.5 Securing TCP connections: SSL implementation: Netscape optional client
variation -TLS: transport layer
8.6 Network layer security: IPsec authentication
security, RFC 2246 minimum hassle in doing
8.7 Securing wireless LANs provides business with new
8.8 Operational security: firewalls and IDS confidentiality merchant
integrity available to all TCP
authentication applications
Network Security Network Security
secure socket interface
SSL provides application programming interface but want to send byte streams & interactive data
(API) to applications want set of secret keys for entire connection
C and Java SSL libraries/classes readily available want certificate exchange as part of protocol: handshake phase
Network Security Network Security
10
Big Picture: key derivation Big Picture: data records
why not encrypt data in constant stream as we write it to
considered bad to use same key for more than one TCP?
cryptographic operation where would we put the MAC? If at end, no message integrity
until all data processed.
use different keys for message authentication code (MAC) and
encryption e.g., with instant messaging, how can we do integrity check over
all bytes sent before displaying?
four keys: instead, break stream in series of records
Kc = encryption key for data sent from client to server each record carries a MAC
Mc = MAC key for data sent from client to server receiver can act on each record as it arrives
Ks = encryption key for data sent from server to client issue: in record, receiver needs to distinguish MAC from
Ms = MAC key for data sent from server to client data
want to use variable-length records
keys derived from key derivation function (KDF)
takes master secret and (possibly) some additional random data
and creates the keys length data MAC
bob.com
Final Exam Prep
encrypted
Network Security
11
Final exam: questions distribution
Final exam: cover page
12