3 Protocols
3 Protocols
Part 3
Protocols
Protocol
Part 3
Protocols
Protocols
Protocol
Implementation
Not
Part 3
Protocols
Efficient
Robust
Easy
Protocols
Chapter 9:
Simple Security Protocols
I quite agree with you, said the Duchess; and the moral of that is
Be what you would seem to be or
if you'd like it put more simply Never imagine yourself not to be
otherwise than what it might appear to others that what you were
or might have been was not otherwise than what you
had been would have appeared to them to be otherwise.
Lewis Carroll, Alice in Wonderland
Access Control
Yes? Enter
No? Get shot by security guard
Part 3
Protocols
Part 3
Protocols
Angola
2.
SAAF
Impala
Part 3
1.
Protocols
E(N,K)
Namibia
K
8
4.
E(N,K)
2.
5.
6.
Russian
MiG
Part 3
1.
Protocols
Angola
N
E(N,K)
E(N,K)
Namibia
K
9
Authentication Protocols
Part 3
Protocols
10
Authentication
o
o
o
o
Part 3
11
Authentication
Part 3
Protocols
12
Simple Authentication
Im Alice
Prove it
My password is frank
Alice
Bob
Part 3
Protocols
13
Authentication Attack
Im Alice
Prove it
My password is frank
Bob
Alice
Trudy
Part 3
Protocols
14
Authentication Attack
Im Alice
Prove it
My password is frank
Trudy
Bob
Part 3
Protocols
15
Simple Authentication
Im Alice, my password is frank
Alice
Bob
Part 3
Protocols
16
Better Authentication
Im Alice
Prove it
h(Alices password)
Alice
Bob
Part 3
Protocols
17
Challenge-Response
Part 3
Protocols
18
Nonce
Part 3
Protocols
19
Challenge-Response
Im Alice
Nonce
h(Alices password, Nonce)
Alice
Bob
Part 3
Protocols
20
Generic Challenge-Response
Im Alice
Nonce
Alice
Bob
Part 3
Protocols
21
Part 3
Protocols
22
Part 3
Protocols
23
Authentication with
Symmetric Key
Im Alice
R
Alice, K
E(R,K)
Bob, K
Part 3
Protocols
24
Mutual Authentication?
Im Alice, R
E(R,K)
Alice, K
E(R,K)
Bob, K
Part 3
Protocols
25
Mutual Authentication
Since
This
Part 3
Protocols
26
Mutual Authentication
Im Alice, RA
RB, E(RA, K)
Alice, K
E(RB, K)
Bob, K
Part 3
Protocols
27
5. E(RB, K)
Bob, K
3. Im Alice, RB
4. RC, E(RB, K)
Trudy
Part 3
Protocols
Bob, K
28
Mutual Authentication
Part 3
Protocols
29
Bob, K
Part 3
Protocols
30
Then
o [{M}Alice ]Alice = M
o {[M]Alice }Alice = M
Part 3
Protocols
31
Bob
Is this secure?
Trudy can get Alice to decrypt anything!
Part 3
Protocols
32
Alice
Is this secure?
Trudy can get Alice to sign anything!
o Same a previous
Part 3
Protocols
Public Keys
Generally,
signing/verifying signatures
Part 3
Protocols
34
Session Key
Part 3
Protocols
35
{R +1,K}Bob
Bob
Is this secure?
No mutual authentication
Part 3
Protocols
36
Bob
Is this secure?
Part 3
Protocols
37
{[R +1,K]Alice}Bob
Bob
Is this secure?
Seems to be OK
Mutual authentication and session key!
Part 3
Protocols
38
Bob
Is this secure?
Seems to be OK
Part 3
Protocols
39
Is PFS possible?
Part 3
Protocols
40
Part 3
Protocols
41
Bob, K
Part 3
Protocols
42
ga mod p
gb mod p
Alice, a
Bob, b
Part 3
Protocols
43
Bob: K, b
Part 3
Protocols
44
Mutual Authentication,
Session Key and PFS
Im Alice, RA
RB, [{RA, gb mod p}Alice]Bob
[{RB, ga mod p}Bob]Alice
Alice
Bob
Part 3
Protocols
45
Timestamps
A timestamp T is derived from current time
Timestamps used in some security protocols
Part 3
Protocols
46
Bob
Part 3
Protocols
47
Bob
Part 3
Protocols
48
Bob
Part 3
Protocols
49
Part 3
Protocols
50
Bob
Part 3
Protocols
51
Part 3
Protocols
52
TCP-based Authentication
TCP
Part 3
Protocols
53
Bob
Part 3
Protocols
54
Trudy
Bob
5.
5.
5.
5.
Part 3
Protocols
Alice
Y
S
4.
=
K
C
,A
SE
,
1
t+
b2
55
Part 3
Protocols
56
Part 3
Protocols
57
Part 3
Protocols
58
Process is probabilistic
o Bob can verify that Alice knows the secret to
Part 3
Protocols
59
Bobs Cave
Alice knows secret
phrase to open path
between R and S
(open sarsaparilla)
Can she convince
Bob that she knows
the secret without
revealing phrase?
Part 3
Protocols
Q
R
60
Bobs Cave
Alice (quietly):
Open sarsaparilla
Protocols
61
Fiat-Shamir Protocol
Part 3
Protocols
62
Fiat-Shamir
x = r2 mod N
e {0,1}
y = r Se mod N
Alice
secret S
random r
Bob
random e
Part 3
63
Fiat-Shamir: e = 1
x = r2 mod N
e=1
y = r S mod N
Alice
secret S
random r
Bob
random e
Part 3
Protocols
64
Fiat-Shamir: e = 0
x = r2 mod N
e=0
Alice
secret S
random r
y = r mod N
Bob
random e
Part 3
Protocols
65
Fiat-Shamir
Public: modulus N and v = S2 mod N
Secret: Alice knows S
Alice selects random r and commits to r by
sending x = r2 mod N to Bob
Bob sends challenge e {0,1} to Alice
Alice responds with y = r Se mod N
Bob checks whether y2 = x ve mod N
Part 3
Protocols
66
o Public: v = S2 mod N
o Alice to Bob: x = r2 mod N and y = r Se mod N
o Bob verifies: y2 = x ve mod N
Part 3
Protocols
67
Fiat-Shamir Facts
Part 3
Protocols
68
o Public: v = S2 mod N
o Trudy sees r2 mod N in message 1
o Trudy sees r S mod N in message 3 (if e = 1)
Part 3
Protocols
69
Part 3
Protocols
70
It depends on
o The sensitivity of the application/data
o The delay that is tolerable
o The cost (computation) that is tolerable
o What crypto is supported (public key,
symmetric key, )
o Whether mutual authentication is required
o Whether PFS, anonymity, etc., are concern
Part 3
Protocols
71
Chapter 10:
Real-World Protocols
The wire protocol guys don't worry about security because that's really
a network protocol problem. The network protocol guys don't
worry about it because, really, it's an application problem.
The application guys don't worry about it because, after all,
they can just use the IP address and trust the network.
Marcus J. Ranum
In the real world, nothing happens at the right place at the right time.
It is the job of journalists and historians to correct that.
Mark Twain
Part 2
Access Control
72
Real-World Protocols
Next,
Part 3
Protocols
73
Part 3
Protocols
74
SSH
Creates
a secure tunnel
Insecure command sent thru SSH
tunnel are then secure
SSH used with things like rlogin
o Why is rlogin insecure without SSH?
o Why is rlogin secure with SSH?
SSH
Part 3
Protocols
75
SSH
SSH
o Public keys, or
o Digital certificates, or
o Passwords
Here,
We
Part 3
Protocols
76
Simplified SSH
Alice
Alice, CP, RA
CS, RB
ga mod p
gb mod p, certificateB, SB
E(Alice, certificateA, SA, K)
Bob
ab
Part=
3 gProtocols
K
mod p
77
Alice, RA
RB
ga mod p
RB
gt mod p
gt mod p, certB, SB
Alice E(Alice,certA,SA,K)
Trudy
gb mod p, certB, SB
E(Alice,certA,SA,K)
Bob
Protocols
78
Part 3
Protocols
79
Socket layer
Socket layer
lives between
application
and transport
layers
SSL usually
between HTTP
and TCP
Part 3
Protocols
Socket
layer
application
User
transport
OS
network
link
NIC
physical
80
What is SSL?
SSL is the protocol used for majority of
secure transactions on the Internet
For example, if you want to buy a book at
amazon.com
Amazon (authentication)
o Your credit card information must be protected
in transit (confidentiality and/or integrity)
o As long as you have money, Amazon does not
care who you are
o So, no need for mutual authentication
Part 3
Protocols
81
protected HTTP
Bob
Part 3
Protocols
82
h(msgs,SRVR,K)
Data protected with key K
Bob
Part 3
Protocols
83
SSL Keys
6
Protocols
84
SSL Authentication
Part 3
Protocols
85
Trudy
RA
certificateB, RB
{S2}Bob,E(X2,K2)
h(Y2,K2)
E(data,K2)
Bob
Part 3
Protocols
86
Part 3
Protocols
87
SSL Connection
session-ID, cipher list, RA
session-ID, cipher, RB,
h(msgs,SRVR,K)
h(msgs,CLNT,K)
Alice
Protected data
Bob
Part 3
Protocols
88
SSL vs IPSec
IPSec
Part 3
Protocols
89
SSL vs IPSec
IPSec: OS must be aware, but not apps
SSL: Apps must be aware, but not OS
SSL built into Web early-on (Netscape)
IPSec often used in VPNs (secure tunnel)
Reluctance to retrofit applications for SSL
IPSec not widely deployed (complexity, etc.)
The bottom line
Internet less secure than it should be!
Part 3
Protocols
90
IPSec
Part 3
Protocols
91
SSL
IPSec
application
User
transport
OS
network
link
NIC
physical
Part 3
Protocols
92
Flawed
Complex
And, did I mention, its complex?
Part 3
Protocols
93
o Mutual authentication
o Establish session key
o Two phases
like SSL session/connection
ESP/AH
for
encryption and/or integrity of IP packets
o AH: Authentication Header
integrity only
Part 3
Protocols
94
IKE
Part 3
Protocols
95
IKE
Part 3
Protocols
96
IKE Phase 1
Part 3
Protocols
97
IKE Phase 1
Part 3
Protocols
98
IKE Phase 1
Part 3
Protocols
99
Alice
IC,RC, gb mod p, RB
IC,RC, E(Alice, proofA, K)
IC,RC, E(Bob, proofB, K)
Bob
Alice
Bob
Part 3
Protocols
101
Protocols
102
IC,RC, gb mod p, RB
IC,RC, E(Alice, proofA, K)
IC,RC, E(Bob, proofB, K)
Bob
KAB
Part 3
Protocols
p,IC,RC,CP,Alice)
103
Catch-22
Part 3
Protocols
104
Alice
Bob
Part 3
Protocols
105
Alice
IC,RC, E(proofA, K)
IC,RC, E(proofB, K)
Bob
Alice
Bob
Part 3
Protocols
107
o Exponents a and b
o Nonces RA and RB
Part 3
Protocols
108
IC,RC, proofA
Trudy
as Bob
Part 3
Protocols
109
Plausible Deniability
Trudy can create conversation that
appears to be between Alice and Bob
Appears valid, even to Alice and Bob!
A security failure?
In this IPSec key option, it is a feature
Part 3
Protocols
110
Part 3
Protocols
111
o Mutual authentication
o Shared symmetric key
o IKE Security Association (SA)
Part 3
Protocols
112
IKE Phase 2
Phase 1 establishes IKE SA
Phase 2 establishes IPSec SA
Comparison to SSL
Part 3
Protocols
113
IKE Phase 2
IC,RC,CP,E(hash1,SA,RA,K)
IC,RC,CS,E(hash2,SA,RB,K)
IC,RC,E(hash3,K)
Alice
Bob
Protocols
114
IPSec
After IKE Phase 1, we have an IKE SA
After IKE Phase 2, we have an IPSec SA
Both sides have a shared symmetric key
Now what?
Part 3
Protocols
115
IP Review
data
Where IP header is
Part 3
Protocols
116
IP and TCP
Consider
Web traffic
IP header
data
IP header
IP
Part 3
117
IP header ESP/AH
data
Part 3
Protocols
118
IPSec: Host-to-Host
IPSec
transport mode
There
Part 3
Protocols
119
ESP/AH
IP header data
Part 3
Protocols
120
IPSec: Firewall-to-Firewall
IPSec
tunnel mode
Local
Protocols
121
Mode
IP header data
IP header data
new IP hdr
Part 3
ESP/AH
Protocols
Tunnel Mode
o Firewall-to-
data
Mode
Transport Mode
o Host-to-host
IP header ESP/AH
Tunnel
firewall
Transport Mode
not necessary
but its more
efficient
IP header data
122
IPSec Security
What to protect?
o Data?
o Header?
o Both?
Part 3
Protocols
123
AH vs ESP
AH
Authentication Header
ESP
Part 3
Protocols
124
Part 3
Protocols
125
Part 3
Protocols
126
Part 3
Protocols
127
Protocols
128
Kerberos
Part 3
Protocols
129
Kerberos
Part 3
Protocols
130
Part 3
Protocols
131
Kerberos KDC
Part 3
Protocols
132
Kerberos Tickets
KDC issue tickets containing info needed to
access network resources
KDC also issues Ticket-Granting Tickets
or TGTs that are used to obtain tickets
Each TGT contains
o Session key
o Users ID
o Expiration time
Part 3
Protocols
133
Kerberized Login
Alice enters her password
Then Alices computer does following:
Part 3
Protocols
134
Kerberized Login
Alice wants
a TGT
Alices
password
E(SA,TGT,KA)
Computer
Alice
KDC
o Then it forgets KA
Part 3
Protocols
135
Talk to Bob
REPLY
Computer
Alice
KDC
Protocols
136
Bob
Part 3
Protocols
137
Kerberos
Key
SA used in authentication
o For confidentiality/integrity
Timestamps
like a
Protocols
138
Kerberos Questions
Part 3
Protocols
139
Kerberos Alternatives
Part 3
Protocols
140
Kerberos Keys
In Kerberos, KA = h(Alices password)
Could instead generate random KA
Part 3
Protocols
141
WEP
Part 3
Protocols
142
WEP
WEP Wired Equivalent Privacy
The stated goal of WEP is to make
wireless LAN as secure as a wired LAN
According to Tanenbaum:
Part 3
Protocols
143
WEP Authentication
Authentication Request
R
E(R, K)
Alice, K
Bob, K
Part 3
Protocols
144
WEP Issues
Part 3
Protocols
145
Part 3
Protocols
146
Part 3
Protocols
147
WEP Key
Recall WEP uses a long-term secret key: K
RC4 is a stream cipher, so each packet
must be encrypted using a different key
Part 3
Protocols
148
WEP Encryption
IV, E(packet,KIV)
Alice, K
Bob, K
KIV = (IV,K)
o That is, RC4 key is K with 3-byte IV pre-pended
Part 3
Protocols
149
WEP IV Issues
WEP
Long
Part 3
Protocols
150
WEP IV Issues
seconds
seconds
Part 3
Protocols
151
Part 3
Protocols
152
Cryptanalytic Attack
Part 3
Protocols
153
Cryptanalytic Attack
3-byte IV pre-pended to key
Denote the RC4 key bytes
o asK0,K1,K2,K3,K4,K5,
o Where IV = (K0,K1,K2) , which Trudy knows
o Trudy wants to find K = (K3,K4,K5, )
Given enough IVs, Trudy can find key K
o
o
o
o
Part 3
154
WEP Conclusions
Many attacks are practical
Attacks have been used to recover keys
and break real WEP traffic
How to prevent WEP attacks?
Part 3
Protocols
155
GSM (In)Security
Part 3
Protocols
156
Cell Phones
Third generation?
Part 3
Protocols
157
Base
Station
Part 3
land line
Base
Station
Controller
Visited
Network
Protocols
AuC
VLR
PSTN
Internet
etc.
HLR
Home
Network
158
Mobile phone
Identity Module)
Subscriber ID)
o User key: Ki (128 bits)
o Tamper resistant (smart card)
o PIN activated (usually not used)
Part 3
Protocols
SIM
159
Visited network
currently located
Home network
keeps track of
Protocols
160
Part 3
Protocols
161
Anonymity
Authentication
Confidentiality
Part 3
Protocols
162
GSM: Anonymity
IMSI used to initially identify caller
Then TMSI (Temporary Mobile Subscriber
ID) used
Part 3
Protocols
163
GSM: Authentication
Caller is authenticated to base station
Authentication is not mutual
Authentication via challenge-response
Part 3
Protocols
164
GSM: Confidentiality
Data encrypted with stream cipher
Error rate estimated at about 1/1000
Encryption key Kc
where A8 is a hash
o Then Kc sent to base station with (RAND,XRES)
o Mobile computes Kc = A8(RAND, Ki)
o Keystream generated from A5(Kc)
Part 3
Protocols
165
GSM Security
1. IMSI
2. IMSI
4. RAND
Mobile
5. SRES
6. Encrypt with Kc
3. (RAND,XRES,Kc)
Base
Station
Home
Network
Part 3
Protocols
166
Base
Station
VLR
Part 3
Protocols
Base
Station
Controller
167
Part 3
Protocols
168
Mobile
No
encryption
Call to
destination
Fake
Base Station
Base Station
Part 3
Protocols
169
of service is possible
Part 3
Protocols
170
GSM Conclusion
Part 3
Protocols
171
o Mutual authentication
o Integrity-protect signaling (such as start
o
o
o
o
Part 3
encryption command)
Keys (encryption/integrity) cannot be reused
Triples cannot be replayed
Strong encryption algorithm (KASUMI)
Encryption extended to base station controller
Protocols
172
Protocols Summary
Generic
authentication protocols
SSH
SSL
IPSec
Kerberos
Wireless:
Part 3
Protocols
Coming Attractions
Software
o
o
o
o
o
Part 3
and security
Protocols
174