updates.
[silc.git] / doc / whitepaper / silc_protocol.html
1 <html>
2 <head>
3 <title>SILC Protocol White Paper</title>
4 <link rev=made href="mailto:priikone@silcnet.org">
5 <meta name="Author" content="Pekka Riikonen - SILC Project">
6 <meta name="Description"
7  content="SILC - Secure Internet Live Conferencing Protocol">
8 <meta name="Created" content="Version 1.0 / 04 Aug 2001">
9 </head>
10 <body bgcolor="#ffffff">
11
12 <font face="Helvetica">
13
14 <font size="6"><b>SILC Protocol White Paper</b></font><br>
15 <font size="2">Version 1.0 / 04 Aug 2001</font>
16
17 <p>
18 <h1>Introduction</h1>
19
20 Chat protocols are very popular on the Internet.  They have actually
21 been very popular since the very first chat protocols appeared on the net.
22 The Internet Relay Chat (IRC) was one of the first chat protocols, and quickly
23 gained the status of being the most popular chat on the net.  Today, IRC
24 has several competitors from various other so called Instant Messaging (IM)
25 protocols, such as ICQ.  However, all of these different chat protocols
26 have something in common; they are all insecure.
27 <p>
28
29 The security is important feature in applications and protocols in 
30 contemporary network environment.  The older chat protocols, however have
31 failed to meet the growing security requirements on the Internet.
32 It is not anymore enough to just provide services, like for example
33 chat services. Now, they need to be secure services.
34 <p>
35
36 The Secure Internet Live Conferencing (SILC) protocol is a new generation
37 chat protocol which provides full featured conferencing services, just
38 like any other contemporary chat protocol provides.  In addition, it
39 provides security by encrypting and authenticating the messages in
40 the network.  The security has been the primary goal of the SILC protocol
41 and the protocol has been designed from the day one security in mind.
42 All packets and messages travelling in the SILC Network are always
43 encrypted and authenticated.  The network topology is also different
44 from for example IRC network.  The SILC network topology attempts to be
45 more powerful and scalable than the IRC network.  The basic purpose
46 of the SILC protocol is to provide secure conferencing services.
47 <p>
48
49 The SILC Protocol have been developed as Open Source project.  The
50 protocol specifications are freely available and they have been submitted to
51 the IETF.  The very first implementations of the protocol are also already
52 available.
53
54 <p><br>
55 <h1>About This White Paper</h1>
56 <p>
57 The purpose of this white paper is to give short but deep enough introduction
58 to the SILC Protocol.  The document describes the purpose of the protocol
59 and how the protocol works in practice.  This document is intended for all
60 audience.  This document should be easy to understand for non-technical
61 person and still be detailed enough for technically oriented person.  See
62 the section <a href="#terms">Terms and Abbreviations</a> for terms used
63 in this documents.
64 <p>
65
66 <p>
67 (c) Copyright 2001 Pekka Riikonen 
68 (<a href="mailto:priikone at silcnet.org">priikone at silcnet.org</a>)
69 <p>
70 This document is free document; you can redistribute it and/or modify
71 it under the terms of the GNU General Public License as published by
72 the Free Software Foundation; either version 2 of the License, or
73 (at your option) any later version.  This document is distributed in
74 the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
75 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
76 See the GNU General Public License for more details.
77
78
79 <p><br>
80 <h1>SILC Protocol</h1>
81 <p>
82
83 The Secure Internet Live Conferencing (SILC) protocol provides secure
84 conferencing services over insecure network channel.  The SILC is IRC
85 like protocol, however it does not support IRC.  Strong cryptographic
86 methods are used to protect SILC packets inside the SILC network.  SILC
87 provides all the common conferencing services like channels, channel
88 messages, private messages, nicknames and various commands.  Difference
89 to other chat protocol is in the design of the protocol.  The SILC 
90 protocol has been designed from the day one security in mind and it
91 shows in the protocol design.
92 <p>
93
94 The network topology is also different to various other chat protocol,
95 like for example IRC.  IRC has tree style network where SILC has so
96 called cellular network.  A cell consists of a router, servers and clients.
97 The cell can also have backup routers in case the private router becomes
98 unresponsive.
99
100 <p><br>
101 <img src="silc_network.gif" alt="SILC Network" align="center" border"0">
102 <p><br>
103
104 The diagram above illustrates a portion of the SILC network.  It shows
105 two cells that both has several servers, and backup routers and several
106 clients.  Clients can connect to server and routers if they want to.
107 The following sections will describe the entities of the SILC Network
108 in greater detail.
109
110
111 <p><br>
112 <h2>Clients</h2>
113 <p>
114
115 A client is a piece of software connecting to SILC server.  The software
116 is usually run by the end user, a real person that is.  The purpose of the
117 clients is to provide the end user an interface to the SILC services.
118 They are used to actually engage the conversations on the SILC Network,
119 and they can be used to execute various SILC commands.
120 <p>
121
122 The clients are distinquished from other clients by unique Client ID.
123 There cannot be multiple same Client IDs in the SILC Network at the same time.
124 The end user, however does not use Client IDs.  The end users usually selects
125 a perferred nickname they want to use, and identifies themself with that
126 nickname to other users on the network.  The nicknames are not unique in
127 the SILC Network.  There can be multiple same nicknames at the same time
128 on the network.  The maximum length for the nickname is 128 characters.
129 <p>
130
131 Most of the other chat protocols have unique nicknames.  This is where SILC
132 differs from most of the other chat protocols.  The purpose of this
133 feature is to make IRC style nickname wars obsolete, as no one owns their
134 nickname; there can always be somene else with the same nickname.
135 <p>
136
137 When client connects to the server the SILC Key Exchange (SKE) protocol and
138 SILC Connection Authentication protocol are executed.  The result of the
139 SKE protocol is the session key that the client and server use to secure
140 their communication.  All commands, for example, that the client sends
141 to the server are secured with the session key.  The session key expires
142 periodically and the rekey process can be executed with or without the
143 Perfect Forward Secrecy (PFS).  The connection authentication protocol is
144 used to authenticate the client to the server.  The server may allow the
145 client to connect without authentication, or it may require a passphrase or
146 public key based authentication.
147
148
149 <p><br>
150 <h2>Servers</h2>
151 <p>
152
153 Servers forms the basis for the SILC Network, by providing a point to which
154 clients may connect.  There are two kinds of servers in SILC; normal servers
155 and router servers.  The next section describes the function of router
156 server.
157 <p>
158
159 Normal servers connect to router server.  Normal servers cannot directly
160 connect to other normal servers.  Messages that are destined outside the
161 local server are always sent to the router for further routing.
162 The clients usually connect to the normal server, however, clients may
163 connect to router servers as well.  The SILC Network diagram above
164 illustrates how normal servers connects to the router server.
165 <p>
166
167 The servers are distinquished by other servers in the network by unique
168 Server ID.  There cannot be multiple same Server IDs in the SILC Network
169 at the same time.  The servers keep track of local information.  It knows
170 all locally connected clients and it knows all channels that its clients
171 have joined.  However, it does not know any global information.  It
172 usually does not keep track of global clients, however, it may cache
173 that information if it was queried.  The reason for this is that the
174 server does not need to keep global information up to date and thus
175 makes the server faster (and in the end the entire network faster).
176 They can always query the information from the router.
177 <p>
178
179 When server connects to its router the SILC Key Exchange (SKE) protocol
180 and the SILC Connection Authentication protocol are executed, just like
181 when client connects to server.  The SKE results in to the session key
182 that is used to secure the communication between the server and the
183 router.  The connection authentication protocol is used to authenticate
184 the server to the router.  The authentication is always based in either 
185 passphrase or public key.
186
187
188 <p><br>
189 <h2>Routers</h2>
190 <p>
191
192 The router servers are servers that actually handles the message routing
193 in the network.  They are, however also normal servers and they do accept
194 client connections.  Each of the router in the network is called a cell.
195 A cell can have only one active router and it may have several servers
196 and several clients.  The cell, however may have backup routers that can
197 take over the tasks of the primary router if it becomes unresponsive.
198 The switch to the backup router should be transparent and only local
199 connections to the primary router are lost.  Other connections in the
200 cell are intact, and clients and servers merely experience some lag in
201 the network connection during the switch to the backup router.
202 <p>
203
204 The normal server knows only local information.  Router server on the
205 other hand knows local information and global information.  It considers
206 the cell as local and outside cells as global.  It knows all the clients
207 connected to the network, all created channels, and all routers and servers
208 in the network.  The server may query the global information if it is needed.
209 For example, when client sends WHOIS command, the server may query the
210 information from the router.  If the router does not know all the details
211 that the WHOIS command requires it can query the information from a router
212 or a server which knows all the details.  It may then cache that information.
213 <p>
214
215 The primary purpose of the router server is to route the messages to
216 local servers and local clients, and messages that are destined to outside
217 the cell are routed to the primary route or some other secondary
218 route if it is a faster route.  The routers in the network forms a ring.
219 Each router has a primary route to other router in the network.  Finally
220 the ring is closed by the last router using the first router in the
221 network as its primary route.
222
223 <p><br>
224 <img src="silc_routers.png" alt="SILC Routers" align="center" border"0">
225 <p><br>
226
227 The diagram above illustrates how the routers forms a ring in the network.
228 A router may have several secondary routes which it may use when it
229 routes the packets.
230 <p>
231
232 When routers connect to its primary router the SKE and the SILC Connection
233 Authentication protocols are executed just like when normal server connects
234 to its router.  The session key is used to secure the communication between
235 the routers.  All the secondary routes also have their own session keys.
236
237
238 <p><br>
239 <h1>SILC Packet Protocol</h1>
240 <p>
241
242 The basis of SILC protocol relies in the SILC packets and they are with
243 out a doubt the most important part of the protocol.  The SILC Packet 
244 protocol is a binary packet protocol.  The protocol provides secure
245 binary packets and assures that the contents of the packets are secured
246 and authenticated.
247 <p>
248
249 Packets are used in the SILC protocol all the time to send for example
250 channel messages, private messages, commands and other information.  All
251 packets in SILC network are always encrypted and their integrity is
252 assured by computed Message Authentication Codes (MAC).  The protocol
253 defines several packet types and packet payloads.  Each packet type
254 usually has a specific packet payload that actually defines the contents
255 of the packet.  Hence, the actual data in the packet is the packet payload 
256 defined in the protocol.
257
258 <p><br>
259 <img src="silc_packet.png" alt="Typical SILC Packet" align="center" border"0">
260 <p><br>
261
262 As the diagram above illustrates the SILC packet is constructed from the
263 SILC Packet Header that is included in all SILC packets, data area that
264 includes the packet payloads, and MAC area which assures the integrity of the
265 packet.  Entire SILC packet is always encrypted, except for the MAC area
266 which is never encrypted.  The encryption process and the key used,
267 however depends on the packet payload.  Some of the payloads are encrypted
268 with the session key and some are encrypted with other keys, for example
269 with channel message keys.  The SILC Packet Header is always encrypted with
270 the session key.  The MAC is computed from the SILC Packet Header and the
271 data area before encrypting the packet.
272
273
274 <p><br>
275 <h1>SILC Key Exchange Protocol</h1>
276 <p>
277
278 SILC Key Exchange Protocol (SKE) is used to exchange shared secret
279 between connecting entities.  The result of this protocol is a key material
280 used to secure the communication channel.  This protocol is executed when,
281 for example client connects to server.  It is also executed when server
282 connects to router.  And, there is no reason why it could not be executed
283 between two clients too, if two clients would need to create secret key.
284 The purpose of the SKE protocol is to create session keys to be used
285 in current SILC session.  The SKE is based on the Diffie-Hellman key
286 exchange algorithm, and is immune to man-in-the-middle attack.
287 <p>
288
289 This is the first protocol that is executed when creating connection to,
290 for example SILC server.  All the other protocols are always executed
291 after this protocol.  This way all the other protocols are secured since
292 the SKE creates the session key that is used to secure all subsequent
293 packets.  The session keys created in the SKE are valid only for some
294 period of time (usually an hour) or at most until the session ends.
295 The rekey process can be executed with or without the Perfect Forward
296 Secrecy (PFS).
297 <p>
298
299 The security properties that are used in the SILC session are also
300 negotiated during the SKE.  The protocol has initiator and responder.
301 The initator is the one who starts the SKE negotiation and responder is
302 the one who receives the SKE negotiation.  When the protocol is started
303 initiator sends a list of security properties that it supports.  The
304 responder then selects the security properties it supports and sends
305 its reply to the initiator.  The security properties includes ciphers,
306 hash functions, public key algorithms, HMAC functions and other
307 security properties.  The responder can always choose the properties
308 it supports.
309 <p>
310
311 After the security properties are selected the protocol continues
312 by performing the Diffie-Hellman key exchange algorithm.  At the same
313 time the intiator and responder also sends their public keys or
314 certificates to each other.  The responder also computes a signature
315 that the initiator will verify.  It is also possible to perform a
316 mutual authentication when both of the parties computes a signature
317 which are verified by each other independently.  If any of the phases
318 of the protocol are to fail the connection is closed immeadiately.
319 <p>
320
321 The public key or certificate that is received during the SKE protocol
322 must be verified.  If it is not verified it would be possible to 
323 execute a man-in-the-middle attack against the SKE protocol.  If
324 certificates are used they can be verified by a third party Certification
325 Authority (CA).  Verifying a public key requires either confirming
326 a fingerprint of the public key over phone or email, or the server
327 can for example publish the fingerprint (and the public key) on some 
328 website.  In real life systems accepting the public key without
329 verification, however is often desired.  In many security protocols,
330 such as in SSH2, the public key is accepted without verification
331 in the first time when the connection is created.  The public key is
332 then cached on local hard disk.  When connecting next time to the
333 server the public key on local cache is verified against the public
334 key server sent.  In real life this works most of the time.  However,
335 if client (or server) cannot trust this, it must find some other way
336 to verify the received public key or certificate.
337
338
339 <p><br>
340 <h1>SILC Connection Authentication Protocol</h1>
341 <p>
342
343 Purpose of SILC Connection Authentication protocol is to authenticate the
344 connecting party with server or router.  This protocol is executed when
345 for example client connects to server.  It is also executed when server
346 connects to router.  Its other purpose is to provide information for the
347 server about which type of connection it is.  The type of the connection
348 defines whether it is client, server or router.  If it is client then
349 the server will create a new Client ID for the client.  If it is server
350 then it will except the server to send its Server ID.  Server IDs are
351 created by the servers and routers itself.
352 <p>
353
354 Since the SILC Connection Authentication protocol is always executed after
355 the SKE protocol, session keys has been established already.  This means
356 that all packets sent in the connection authentication protocol are encrypted 
357 and authenticated.
358 <p>
359
360 The authentication may be based either in passphrase or public key
361 encryption.  It is also possible to not require authentication at all.
362 If the authentication is based to passphrase the passphrase is sent
363 to the server.  As the packet sent by, for example client, is entirely
364 encrypted it is safe to send the passphrase inside the packet.
365 <p>
366
367 If the authentication is based to public key then, for example the client, 
368 signs data with its private key and sends it to the server.  The server
369 then verifies this signature by using the client's public key.  The
370 packet is also encrypted in the case of public key authentication.
371 <p>
372
373 If the authentication is to fail the connection to the server or router
374 will be refused.  If it is succesful the connection is granted.  After
375 this the client is ready to communicate in the SILC Network.
376
377
378 <p><br>
379 <h1>Channels</h1>
380 <p>
381
382 A channel is a named group of one or more clients which will all receive
383 messages addressed to that channel.  The channel is created when first
384 client joins to it, and the channel ceases to exist when the last client
385 leaves it.  When channel exists, any client can reference it using the 
386 name of the channel.  Channel is a place where group of people can engage
387 conversation.
388 <p>
389
390 Channel names are unique in the SILC Network.  There cannot be multiple
391 same channels in the network at the same time.  However, channel has also
392 a Channel ID which is actually used to reference the channel in the
393 SILC Network.  The maximum length for the channel name is 256 characters.
394 <p>
395
396 Channels can have operators that can administrate the channel and operate
397 all of its modes.  There are two types of operators on the channel:
398 channel founder and channel operator.
399 <p>
400
401 The channel founder is the client which created the channel.  Channel
402 founder is channel operator with some more privileges.  Channel founder
403 can operate all of the channel's modes.  Furthermore, channel founder
404 privileges cannot be removed by any other operator on channel and channel
405 founder cannot be removed from the channel by force.  It is also possible
406 for the channel founder to regain its privileges at later time, even if
407 they have left the channel.
408 <p>
409
410 Channel operator is operator that can operate most of the channel's
411 modes and administrate the channel.  However, it cannot operate all
412 modes which are strictly reserved for channel founder.  Channel operator
413 is, however able to adminstrate the channel, set some modes on the
414 channel, remove a badly behaving client from the channel, and promote
415 other clients to become channel operator.
416
417
418 <p><br>
419 <h2>Channel Message Delivery</h2>
420 <p>
421
422 All clients that have joined the channel can send messages to the channel.
423 All channel messages are secured and authenticated by channel key.  The
424 channel key is generated by the server when the channel is created,
425 a client joins the channel, or a client leaves the channel.  The channel
426 key is also regenerated periodically.  The reason for the regeneration
427 of channel key everytime someone joins or leaves the channel is that
428 it prevents new clients joining the channel, and old clients leaving the
429 channel, to encrypt or decrypt old or new messages.  They can encrypt
430 and decrypt channel messages only when they have joined on the channel.
431 <p>
432
433 Channel keys are cell specific in the SILC Network.  Each cell that
434 have clients joined on a particular channel have also own key for the
435 channel.  That key is not shared by other cells in the network.  Inside
436 the cell the channel key is known by the router and all servers that
437 have clients on the channel and all clients that have joined the channel.
438
439 <p><br>
440 <img src="silc_channel.png" alt="Channel Message Delivery" align="center" border"0">
441 <p><br>
442
443 The diagram above illustrates typical delivery of channel messages inside
444 a cell and between two cells.  Both of the cells have their own channel
445 key.  Both cells knows all clients joined on the channel.  When message
446 is sent to the channel by an client, it is encrypted with the current
447 channel key in that cell.  The servers and the router in the local cell
448 then routes the message to all local clients who have joined the channel.
449 If the channel has clients that belong to other cell in the network the
450 router will route the channel message to that cell.  When channel
451 messages are sent between routers they are first decrypted with the
452 current channel key, and then re-encrypted with the session key shared
453 between the two routers.  The router who receives the channel message
454 then decrypts it with the session and re-encrypts it with the
455 current channel key in that cell.  It then distributes the channel message
456 to all clients on the channel.  The clients who have joined the channel
457 always knows the current channel key and can decrypt all channel messages
458 they receive.  Note that normal servers in the SILC network never decrypt
459 the channel messages even though the have the key.  There is no reason
460 for servers to decrypt the message.  The router decrypts the message
461 only when sending it between two routers.
462 <p>
463
464 This method of channel message delivery is the the default way to send
465 channel messages in the SILC Network.  However, this is not perfect
466 solution on all circumstances.  If the clients joined on a particular
467 channel cannot trust, or do not want to trust the servers and routers
468 in the SILC Network they can consider the fact, that servers and routers
469 knows the channel key is actually a breach of security.
470 <p>
471
472 If the clients on the other hand can trust their servers and routers
473 in the SILC Network this is the recommended way of sending channel
474 messages.  This method is the simplest method for end user since it
475 does not require any special settings before engaging the conversation
476 on the channel.  The client merely joins the channel, receives the
477 channel key from the server and can start the conversation on the
478 channel.
479 <p>
480
481 In addition of encrypting channel messages it also possible to digitally
482 sign all sent channel messages.  The receiver could the verify the
483 signature of each of the message using the sender's public key.
484
485
486 <p><br>
487 <h2>Channel Message Delivery With Channel Private Key</h2>
488 <p>
489
490 If the clients cannot trust the servers and routers in the SILC Network
491 they should not use the default way of sending the channel messages.
492 Instead, they should use channel private keys to encrypt and decrypt
493 the channel messages.  Channel private keys are keys that are known
494 only by the clients who have joined the channel.  All servers and
495 routers do not know the key and cannot decrypt the messages.  When
496 message is sent between two routers they are merely re-encrypted with
497 the session key but not decrypted since the router do not have the
498 key to do that.
499 <p>
500
501 The clients who have joined the channel must first agree on the channel
502 private key they are going to use.  The key may generally be anything.
503 It may be a passphrase or a random string, or the key may negotiated
504 using some key exchange protocol which provides negotiating the
505 key for multiple clients at the same time.
506 <p>
507
508 As the channel private key is actually entirely local setting in the
509 client, it is possible to set several channel private keys for one
510 channel.  It is possible to have multiple channel private keys that
511 are not known by all channel members.  When encrypting messages with
512 one channel private key only the clients who have that key can decrypt
513 the message.  The other key could be shared for example by all clients
514 on the channel and thus all clients can decrypt messages encrypted with
515 that key.  In this way it is actually possible to have a private group
516 conversation inside the channel while having global conversation at the
517 same time.
518
519
520 <p><br>
521 <h1>Private Messages</h1>
522 <p>
523 Private messages are messages that are sent from one client to another 
524 through the SILC Network.  They are private because they are not sent to
525 anyone else except to the true receiver of the message.  Private messages
526 can be used to engage private conversation with another client if channels
527 are not desired.
528 <p>
529
530 As all messages in SILC the private message are also encrypted and
531 authenticated.  There are several ways to secure private messages.  By
532 default private messages are encrypted using the session keys established
533 in the SKE protocol.  It is also possible to negotiate a private message
534 key between the two clients and encrypt the messages with that key.  It
535 is even possible to encrypt the messages with public key cryptosystem,
536 if desired.  The next sections will describe all these private message
537 delivery methods.
538
539 <p>
540 The SILC protocol provides these three methods of delivering private messages
541 because none of the methods alone can satisfy the security requirements
542 of all people.  The end user should decide the acceptable level of risk,
543 the required level of security and other security and usability aspects when
544 deciding what way of sending private message suites for them.
545 <p>
546
547 In addition of encrypting private messages it also possible to digitally
548 sign all sent private messages.  The receiver could the verify the
549 signature of each of the message using the sender's public key.
550
551
552 <p><br>
553 <h2>Private Message Delivery With Session Keys</h2>
554 <p>
555 Sending private messages are by default secured with session keys established
556 in the SKE protocol.  This means that the private message is always encrypted
557 with the session key of the next receiver of the message enroute to the 
558 receiving client.  This also means that the message is decrypted and
559 re-encrypted everytime it is sent further to the receiving client.
560
561 <p><br>
562 <img src="silc_priv1.png" alt="Basic Private Message Delivery" align="center" border"0">
563 <p><br>
564
565 As the above diagram shows the private messages sent by Client A to the
566 Client B travels through the SILC Network and is always decrypted and
567 re-encrypted with the session key of the next receiver.  The Client B then
568 finally decrypts the private messages that is encrypted with the session
569 key shared between the Client B and the Server Y.
570 <p>
571
572 This way of securing private messages is not perfect and cannot be used
573 in all circumstances.  If the clients having the conversation cannot trust
574 the servers and routers in the SILC Network they should not send private
575 messages that are secured in this manner.  Messages secured in this manner
576 can be decrypted by the servers and routers that the clients may consider
577 to be untrusted.
578 <p>
579
580 If the clients on the other hand trust the servers and routers in their 
581 SILC Network, or they do not care that servers can decrypt their messages,
582 sending private messages in this way is very simple from client's point
583 of view.  For servers and routers this of course means that they need
584 to decrypt and re-encrypt each private message.  Since this way of securing
585 private message cannot be used at all times the SILC protocol provides
586 other ways of securing private messages.
587
588
589 <p><br>
590 <h2>Private Message Delivery With Private Message Key</h2>
591 <p>
592 Private messages can be secured with private message key as well.  This
593 key is known only by the sender of the message and the receiver of the
594 message.  This way no one else except the sender and the receiver can encrypt
595 and decrypt the private messages.  The message is encrypted by the sender
596 with the private message key and all the servers and routers pass the message
597 through enroute to the receiver.  They cannot decrypt the message since
598 they do not have the key.  When sending private messages in this way it
599 does not matter whether the clients trust or do not trust the servers and
600 routers in the SILC network.
601
602 <p><br>
603 <img src="silc_priv2.png" alt="Private Messages with Private Message Key" align="center" border"0">
604 <p><br>
605
606 As the above diagram shows the Client A encrypts the message with private
607 message key and sends the message to the SILC Network.  All servers and
608 routers merely pass the message through since they cannot decrypt it.
609 The Client B then receives the message and decrypts it with the private
610 message key.
611 <p>
612
613 Sending private messages in this manner is always secure since the key is
614 shared only by the sender and the receiver.  The problem of this method
615 is that the sender and the receiver must somehow agree about the key
616 they are going to use.  The private message key can generally be anything.
617 It can be a passphrase that only the sender and the receiver knows.  They
618 could have been agreed to use some word or phrase as the key sometime
619 earlier before they started the conversation.  Or the key maybe from some
620 random string from a code book that only the sender and the receiver poses.
621 Or it can be a key that is negotiated using some key exchange protocol.
622 <p>
623
624 The problem however is fundamental.  How to agree to use some key when
625 you cannot reach the other person over secure channel?  The SILC protocol
626 solves this problem by providing a possiblity to negotiate the key
627 between two clients using the SKE protocol.  One or both of the clients
628 can set up the SKE server running in their host and ask the other client
629 to connect to it.  As a result of the SKE protocol the clients have
630 now shared secret that they can use as private message key.  The key
631 is known only by the two clients that exexcuted the SKE protocol.  They
632 can then use that key to secure all subsequent private messages.
633 <p>
634
635 Using this method of private messages delivery is recommended if the
636 clients cannot trust the servers and routers in the SILC Network.  The 
637 drawback is the extra phase of setting the private message key before
638 starting the conversation.  However, using the SKE protocol is the
639 recommended way to negotiate the private message key since it can be
640 automatized and does not cause any extra tasks for end user.
641
642
643 <p><br>
644 <h2>Private Message Delivery With Public Key Encryption</h2>
645 <p>
646 If the clients cannot trust the servers and routers in the SILC Network
647 they can use the private message key.  As described in the previous section
648 it is easy to set up with the SKE protocol.  However, sometimes the two
649 clients do not want to use any passphrases as private message key or
650 negotiate the key with SKE, or perhaps they are unable to negotiate the
651 key because of some other external problem.  The SILC protocol provides
652 yet another way of securing the private messages.  This way does not
653 require setting or negotiating private message key.  And, in this method
654 also it does not matter whether the clients trust or do not trust the
655 servers and routers in the SILC Network.  The method is public key
656 encryption.  The clients can encrypt the private messages with the
657 receiver's public key and send the message to the network.  The servers
658 and routers cannot decrypt the messages since they do not have the
659 receiver's private key.  The receiver on the other hand has the private
660 key which it uses to decrypt the message.
661
662 <p><br>
663 <img src="silc_priv3.png" alt="Private Messges with Public Key Cryptosystem" align="center" border"0">
664 <p><br>
665
666 As the above diagram shows the Client A has the Client B's public key.
667 It will encrypt the message with that key and sends the message to the
668 SILC Network.  All servers and routers pass the message through since
669 they cannot decrypt it.  The Client B then uses its private key to
670 decrypt the message.  The Client B has also the Client A's public key 
671 that it can use to encrypt messages that it will send to Client A.
672 <p>
673
674 Even this method of private message delivery is not perfect.  The drawbacks
675 of this method is that the public key encryption process, as being
676 asymmetric cryptosystem, is much slower than encryption process with
677 symmetric cryptosystems.  This is not probably problem with short messages
678 but may be inconvenient with long messages.  The other drawback is that the
679 sender must first assure that the public key it is using in the encryption
680 is actually the receiver's public key.  This is a absolute requirement
681 in this method.  If the sender cannot authenticate the receiver's public
682 key this method of private message delivery should not be used.  In SILC
683 protocol clients can fetch other clients public keys from servers. 
684 However, the servers may not have authenticated the fetched public key so
685 that should not be fully trusted.  Use of certificates can solve the
686 problem.  The receiver's certificate could be authenticated by a third
687 party Certification Authority (CA).
688
689 <p>
690 Usually verifying the public key is not a problem since the receiver
691 can provide the public key on some website, or verify the fingerprint of
692 the key over email, or phone call.  The clients can also fetch the
693 public keys from SILC servers if they trust that the keys are authentic.
694 If both of the clients trust that the public keys are authentic using this
695 method of private message delivery is very simple and recommended.
696
697
698 <p><br>
699 <h1>Conclusions</h1>
700
701 The Secure Internet Live Conferencing (SILC) protocol is a new generation
702 chat protocol that provides all the common conferencing services with
703 strong support for security.  It has wide range of security properties
704 that should meet the highest levels of security requirements, while not
705 forgetting easy of use.  The network topology offers new architectural
706 solution with better scalability over traditional chat protocols.
707
708
709 <p><br>
710 <h1>Further Information</h1>
711 <p>
712 More detailed information about the SILC protocol is available in the
713 SILC protocol specification documents.  There exists currently four
714 Internet Drafts that defines the protocol in great detail.  The Internet
715 Drafts are available from the following sources but also from the
716 <a href="http://www.ietf.org">IETF website</a>.
717 <p>
718
719 - <a href="http://silcnet.org/docs/draft-riikonen-silc-spec-03.txt">
720 Secure Internet Live Conferencing (SILC), Protocol Specification</a>
721 <br>
722
723 - <a href="http://silcnet.org/docs/draft-riikonen-silc-pp-03.txt">
724 SILC Packet Protocol</a>
725 <br>
726
727 - <a href="http://silcnet.org/docs/draft-riikonen-silc-ke-auth-03.txt">
728 SILC Key Exchange and Authentication Protocols</a>
729 <br>
730
731 - <a href="http://silcnet.org/docs/draft-riikonen-silc-commands-01.txt">
732 SILC Commands</a>
733 <p>
734
735 For comprehensive introduction to cryptography refer to the
736 <a href="http://www.ssh.com/tech/crypto/">Cryptography A-2-Z document</a>.
737
738 <p><br>
739 <a name="terms"></a>
740 <h1>Terms and Abbreviations</h1>
741 <p>
742
743 - Asymmetric cryptosystem
744 <p>
745 Asymmetric cryptosystem provides public encryption.  It has two keys,
746 one public key and one private key (also called as secret key).  The public
747 key is publicly available allowing anyone to encrypt messages with the
748 public key.  Only the posessor of the private key can decrypt those messages.
749 Difference to symmetric cryptosystem is that symmetric cryptosystem use only
750 one key, and the key is usually used to both encryption and decryption.  The
751 asymmetric cryptosystem is also called as public key encryption, public key
752 cryptosystem or public key algorithm.  SILC supports RSA and DSS asymmetric
753 cryptosystems.
754 <p>
755
756 - Authentication
757 <p>
758 The verification of the identity of a person, host or process in order
759 to gain access to a service or prove identity.  In data communications
760 it also means verifying the origin of a message.
761 <p>
762
763 - Certificate
764 <p>
765 Certificate is a digital document which can be used to verify the 
766 identity of a person or host.  In SILC certificates can be used to prove
767 identity of clients, servers and routers.  Basically certificate is a public
768 key with subject name.  SILC supports X.509, OpenPGP and SPKI certificates.
769 Supported public keys are SILC style public key and SSH2 style public
770 key.
771 <p>
772
773 - Certification Authority (CA)
774 <p>
775 A third party entity that can verify identity of a person or host.  CA
776 is usually external company that provides certificates and their
777 verification services.
778 <p>
779
780 - Diffie-Hellman key exchange
781 <p>
782 First public key algorithm ever invented.  It is used to generate a secret
783 key between two or more parties.  It gets its security from the difficulty
784 of calculating discrete lograrithms.
785 <p>
786
787 - Encryption
788 <p>
789 A mechanism (usually mathematical) to transfer plaintext (or cleartext)
790 to ciphertext to provide confidentiality.  A process to transfer
791 the ciphertext back to plaintext is called decryption.
792 <p>
793
794 - Integrity
795 <p>
796 The verification of data to detect any modifications.  If data is
797 modified enroute from the sender to the receiver, the modification will
798 be detected.
799 <p>
800
801 - HMAC
802 <p>
803 Hash Message Authentication Code.  Also called as keyed hash function.
804 It is a secret key authentication algorithm which proves that the message
805 is not modified and that the HMAC was computed by the sender of the
806 message.
807 <p>
808
809 - Man-in-the-middle attack
810 <p>
811 An attack against two connecting entities where the attacker executes
812 key exchange protocol with both of the parties indepently without
813 their knowledge.  Both of the connecting entities will end up having secret
814 key with the attacker, and the attacker can encrypt and decrypt all the
815 messages that goes between the two entities.
816 <p>
817
818 - Message Authentication Code (MAC)
819 <p>
820 MAC provides message integrity by computing the MAC using a secret
821 key authentication algorithm (HMAC).
822 <p>
823
824 - Perfect Forward Secrecy (PFS)
825 <p>
826 A property of rekey (or key re-generation) which defines whether the
827 new key is derived from the old key.  If Perfect Forward Secrecy is
828 selected the new key is never dependent of the old key which means
829 that if the old key would get compromised at later time it will not
830 compromise the new key.  In SILC setting PFS in the SKE protocol means
831 executing the SKE protocol again.  If PFS is not selected the new key
832 is always derived from the old key.
833 <p>
834
835 - Rekey
836 <p>
837 A key re-generation process where the old key has expired or is not
838 secure anymore to use.  In this case rekey is performed and new key
839 is generated.
840 <p>
841
842 - Symmetric cryptosystem
843 <p>
844 Symmetric cryptosystem is one key cryptosystem where one key is used
845 usually to both encryption and decryption process.  The symmetric
846 cryptosystems are usually significantly faster than asymmetric cryptosystems.
847 DES, AES, Twofish and Blowfish are examples of symmetric cryptosystems.
848 SILC supports all the common symmetric cryptosystems including AES.
849 SILC does not support DES as it is insecure and 3DES as it is too slow.
850
851
852 </font>
853
854 </body>
855 </html>