Initial import from FreeBSD RELENG_4:
[dragonfly.git] / crypto / kerberosIV / doc / whatis.texi
1 @node What is Kerberos?, Installing programs, Introduction, Top
2 @chapter What is Kerberos?
3
4 @quotation
5 @flushleft
6         Now this Cerberus had three heads of dogs,
7         the tail of a dragon, and on his back the
8         heads of all sorts of snakes.
9         --- Pseudo-Apollodorus Library 2.5.12
10 @end flushleft
11 @end quotation
12
13 Kerberos is a system for authenticating users and services on a network.
14 It is built upon the assumption that the network is ``unsafe''.  For
15 example, data sent over the network can be eavesdropped and altered, and
16 addresses can also be faked.  Therefore they cannot be used for
17 authentication purposes.
18 @cindex authentication
19
20 Kerberos is a trusted third-party service.  That means that there is a
21 third party (the kerberos server) that is trusted by all the entities on
22 the network (users and services, usually called @dfn{principals}).  All
23 principals share a secret password (or key) with the kerberos server and
24 this enables principals to verify that the messages from the kerberos
25 server are authentic.  Thus trusting the kerberos server, users and
26 services can authenticate each other.
27
28 @section Basic mechanism
29
30 @ifinfo
31 @macro sub{arg}
32 <\arg\>
33 @end macro
34 @end ifinfo
35
36 @tex
37 @def@xsub#1{$_{#1}$}
38 @global@let@sub=@xsub
39 @end tex
40
41 In Kerberos, principals use @dfn{tickets} to prove that they are who
42 they claim to be. In the following example, @var{A} is the initiator of
43 the authentication exchange, usually a user, and @var{B} is the service
44 that @var{A} wishes to use.
45
46 To obtain a ticket for a specific service, @var{A} sends a ticket
47 request to the kerberos server. The request basically contains @var{A}'s
48 and @var{B}'s names. The kerberos server checks that both @var{A} and
49 @var{B} are valid principals.
50
51 Having verified the validity of the principals, it creates a packet
52 containing @var{A}'s and @var{B}'s names, @var{A}'s network address
53 (@var{A@sub{addr}}), the current time (@var{t@sub{issue}}), the lifetime
54 of the ticket (@var{life}), and a secret @dfn{session key}
55 @cindex session key
56 (@var{K@sub{AB}}). This packet is encrypted with @var{B}'s secret key
57 (@var{K@sub{B}}).  The actual ticket (@var{T@sub{AB}}) looks like this:
58 (@{@var{A}, @var{B}, @var{A@sub{addr}}, @var{t@sub{issue}}, @var{life},
59 @var{K@sub{AB}}@}@var{K@sub{B}}).
60
61 The reply to @var{A} consists of the ticket (@var{T@sub{AB}}), @var{B}'s
62 name, the current time, the lifetime of the ticket, and the session key, all
63 encrypted in @var{A}'s secret key (@{@var{B}, @var{t@sub{issue}},
64 @var{life}, @var{K@sub{AB}}, @var{T@sub{AB}}@}@var{K@sub{A}}). @var{A}
65 decrypts the reply and retains it for later use.
66
67 @sp 1
68
69 Before sending a message to @var{B}, @var{A} creates an authenticator
70 consisting of @var{A}'s name, @var{A}'s address, the current time, and a
71 ``checksum'' chosen by @var{A}, all encrypted with the secret session
72 key (@{@var{A}, @var{A@sub{addr}}, @var{t@sub{current}},
73 @var{checksum}@}@var{K@sub{AB}}). This is sent together with the ticket
74 received from the kerberos server to @var{B}.  Upon reception, @var{B}
75 decrypts the ticket using @var{B}'s secret key.  Since the ticket
76 contains the session key that the authenticator was encrypted with,
77 @var{B} can now also decrypt the authenticator. To verify that @var{A}
78 really is @var{A}, @var{B} now has to compare the contents of the ticket
79 with that of the authenticator. If everything matches, @var{B} now
80 considers @var{A} as properly authenticated.
81
82 @c (here we should have some more explanations)
83
84 @section Different attacks
85
86 @subheading Impersonating A
87
88 An impostor, @var{C} could steal the authenticator and the ticket as it
89 is transmitted across the network, and use them to impersonate
90 @var{A}. The address in the ticket and the authenticator was added to
91 make it more difficult to perform this attack.  To succeed @var{C} will
92 have to either use the same machine as @var{A} or fake the source
93 addresses of the packets. By including the time stamp in the
94 authenticator, @var{C} does not have much time in which to mount the
95 attack.
96
97 @subheading Impersonating B
98
99 @var{C} can masquerade @var{B}'s network address, and when @var{A} sends
100 her credentials, @var{C} just pretend to verify them. @var{C} can't
101 be sure that she is talking to @var{A}.
102
103 @section Defense strategies
104
105 It would be possible to add a @dfn{replay cache}
106 @cindex replay cache
107 to the server side.  The idea is to save the authenticators sent during
108 the last few minutes, so that @var{B} can detect when someone is trying
109 to retransmit an already used message. This is somewhat impractical
110 (mostly regarding efficiency), and is not part of Kerberos 4; MIT
111 Kerberos 5 contains it.
112
113 To authenticate @var{B}, @var{A} might request that @var{B} sends
114 something back that proves that @var{B} has access to the session
115 key. An example of this is the checksum that @var{A} sent as part of the
116 authenticator. One typical procedure is to add one to the checksum,
117 encrypt it with the session key and send it back to @var{A}.  This is
118 called @dfn{mutual authentication}.
119
120 The session key can also be used to add cryptographic checksums to the
121 messages sent between @var{A} and @var{B} (known as @dfn{message
122 integrity}).  Encryption can also be added (@dfn{message
123 confidentiality}). This is probably the best approach in all cases.
124 @cindex integrity
125 @cindex confidentiality
126
127 @section Further reading
128
129 The original paper on Kerberos from 1988 is @cite{Kerberos: An
130 Authentication Service for Open Network Systems}, by Jennifer Steiner,
131 Clifford Neuman and Jeffrey I. Schiller.
132
133 A less technical description can be found in @cite{Designing an
134 Authentication System: a Dialogue in Four Scenes} by Bill Bryant, also
135 from 1988.
136
137 These and several other documents can be found on our web-page.