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