8 .ds RF FORMFEED[Page %]
17 Network Working Group P. Riikonen
19 draft-riikonen-silc-pp-03.txt XXX
26 <draft-riikonen-silc-pp-03.txt>
31 This document is an Internet-Draft and is in full conformance with
32 all provisions of Section 10 of RFC 2026. Internet-Drafts are
33 working documents of the Internet Engineering Task Force (IETF), its
34 areas, and its working groups. Note that other groups may also
35 distribute working documents as Internet-Drafts.
37 Internet-Drafts are draft documents valid for a maximum of six months
38 and may be updated, replaced, or obsoleted by other documents at any
39 time. It is inappropriate to use Internet-Drafts as reference
40 material or to cite them other than as "work in progress."
42 The list of current Internet-Drafts can be accessed at
43 http://www.ietf.org/ietf/1id-abstracts.txt
45 The list of Internet-Draft Shadow Directories can be accessed at
46 http://www.ietf.org/shadow.html
48 The distribution of this memo is unlimited.
54 This memo describes a Packet Protocol used in the Secure Internet Live
55 Conferencing (SILC) protocol, specified in the Secure Internet Live
56 Conferencing, Protocol Specification Internet Draft [SILC1]. This
57 protocol describes the packet types and packet payloads which defines
58 the contents of the packets. The protocol provides secure binary packet
59 protocol that assures that the contents of the packets are secured and
74 1 Introduction .................................................. 3
75 1.1 Requirements Terminology .................................. 4
76 2 SILC Packet Protocol .......................................... 4
77 2.1 SILC Packet ............................................... 4
78 2.2 SILC Packet Header ........................................ 5
79 2.3 SILC Packet Types ......................................... 7
80 2.3.1 SILC Packet Payloads ................................ 16
81 2.3.2 Generic payloads .................................... 16
82 2.3.2.1 ID Payload .................................. 16
83 2.3.2.2 Argument Payload ............................ 17
84 2.3.2.3 Channel Payload ............................. 18
85 2.3.2.4 Public Key Payload .......................... 19
86 2.3.3 Disconnect Payload .................................. 19
87 2.3.4 Success Payload ..................................... 19
88 2.3.5 Failure Payload ..................................... 20
89 2.3.6 Reject Payload ...................................... 21
90 2.3.7 Notify Payload ...................................... 22
91 2.3.8 Error Payload ....................................... 21
92 2.3.9 Channel Message Payload ............................. 28
93 2.3.10 Channel Key Payload ................................ 31
94 2.3.11 Private Message Payload ............................ 33
95 2.3.12 Private Message Key Payload ........................ 34
96 2.3.13 Command Payload .................................... 36
97 2.3.14 Command Reply Payload .............................. 37
98 2.3.15 Connection Auth Request Payload .................... 37
99 2.3.16 New ID Payload ..................................... 38
100 2.3.17 New Client Payload ................................. 39
101 2.3.18 New Server Payload ................................. 40
102 2.3.19 New Channel Payload ................................ 41
103 2.3.20 Key Agreement Payload .............................. 42
104 2.3.21 Cell Routers Payload ............................... 43
105 2.4 SILC ID Types ............................................. 44
106 2.5 Packet Encryption And Decryption .......................... 44
107 2.5.1 Normal Packet Encryption And Decryption ............. 45
108 2.5.2 Channel Message Encryption And Decryption ........... 45
109 2.5.3 Private Message Encryption And Decryption ........... 46
110 2.6 Packet MAC Generation ..................................... 47
111 2.7 Packet Padding Generation ................................. 47
112 2.8 Packet Compression ........................................ 48
113 2.9 Packet Sending ............................................ 48
114 2.10 Packet Reception ......................................... 49
115 2.11 Packet Routing ........................................... 49
116 2.12 Packet Broadcasting ...................................... 50
117 3 Security Considerations ....................................... 50
118 4 References .................................................... 50
119 5 Author's Address .............................................. 52
125 Figure 1: Typical SILC Packet
126 Figure 2: SILC Packet Header
128 Figure 4: Argument Payload
129 Figure 5: Channel Payload
130 Figure 6: Public Key Payload
131 Figure 7: Disconnect Payload
132 Figure 8: Success Payload
133 Figure 9: Failure Payload
134 Figure 10: Reject Payload
135 Figure 11: Notify Payload
136 Figure 12: Error Payload
137 Figure 13: Channel Message Payload
138 Figure 14: Channel Key Payload
139 Figure 15: Private Message Payload
140 Figure 16: Private Message Key Payload
141 Figure 17: Command Payload
142 Figure 18: Connection Auth Request Payload
143 Figure 19: New Client Payload
144 Figure 20: New Server Payload
145 Figure 21: Key Agreement Payload
146 Figure 22: Cell Routers Payload
152 This document describes a Packet Protocol used in the Secure Internet
153 Live Conferencing (SILC) protocol specified in the Secure Internet Live
154 Conferencing, Protocol Specification Internet Draft [SILC1]. This
155 protocol describes the packet types and packet payloads which defines
156 the contents of the packets. The protocol provides secure binary packet
157 protocol that assures that the contents of the packets are secured and
160 The basis of SILC protocol relies in the SILC packets and it is with
161 out a doubt the most important part of the protocol. It is also probably
162 the most complicated part of the protocol. Packets are used all the
163 time in the SILC network to send messages, commands and other information.
164 All packets in SILC network are always encrypted and their integrity
165 is assured by computed MACs. The protocol defines several packet types
166 and packet payloads. Each packet type usually has a specific packet
167 payload that actually defines the contents of the packet. Each packet
168 also includes a default SILC Packet Header that provides sufficient
169 information about the origin of the packet and destination of the
174 1.1 Requirements Terminology
176 The keywords MUST, MUST NOT, REQUIRED, SHOULD, SHOULD NOT, RECOMMENDED,
177 MAY, and OPTIONAL, when they appear in this document, are to be
178 interpreted as described in [RFC2119].
182 2 SILC Packet Protocol
187 SILC packets deliver messages from sender to receiver securely by
188 encrypting important fields of the packet. The packet consists of
189 default SILC Packet Header, Padding, Packet Payload data, and, packet
192 The following diagram illustrates typical SILC packet.
197 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
198 | n bytes | 1 - n bytes | n bytes | n bytes
199 | SILC Header | Padding | Data Payload | MAC
200 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
204 Figure 1: Typical SILC Packet
207 SILC Header is always the first part of the packet and its purpose
208 is to provide information about the packet. It provides for example
209 the packet type, origin of the packet and the destination of the packet.
210 The header is variable in length and first two (2) bytes of the
211 header (thus first two bytes of the packet) are not encrypted. The
212 first two (2) bytes are the length of the packet which is not encrypted.
213 See the following section for description of SILC Packet header. Packets
214 without SILC header or with malformed SILC header MUST be dropped.
216 Padding follows the packet header. The purpose of the padding is to
217 make the packet multiple by eight (8) or by the block size of the
218 cipher used in the encryption, which ever is larger. The maximum
219 length of padding is currently 16 bytes. The padding is always
222 Data payload area follows padding and it is the actual data of the
223 packet. The packet data is the packet payloads defined in this
224 protocol. The data payload area is always encrypted.
226 The last part of SILC packet is the packet MAC that assures the
227 integrity of the packet. The MAC is always computed from the packet
228 before the encryption is applied to the packet. If compression is used
229 in the packet the MAC is computed after the compression has been
230 applied. The compression, on the other hand, is always applied before
233 All fields in all packet payloads are always in MSB (most significant
238 2.2 SILC Packet Header
240 The SILC packet header is applied to all SILC packets and it is
241 variable in length. The purpose of SILC Packet header is to provide
242 detailed information about the packet. The receiver of the packet
243 uses the packet header to parse the packet and gain other relevant
244 parameters of the packet.
246 The following diagram represents the SILC packet header. (*) indicates
247 that this field is never encrypted. Other fields are always encrypted.
252 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
253 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
254 | Payload Length * | Flags | Packet Type |
255 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
256 | Source ID Length | Destination ID Length |
257 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
263 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
269 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
273 Figure 2: SILC Packet Header
277 o Payload Length (2 bytes) - Is the length of the packet
278 not including the padding of the packet. This field must
279 not be encrypted but must always be authenticated.
281 o Flags (1 byte) - Indicates flags to be used in packet
282 processing. Several flags may be set by ORing the flags
285 The following flags are reserved for this field:
290 In this case the field is ignored.
293 Private Message Key 0x01
295 Indicates that the packet must include private
296 message that is encrypted using private key set by
297 client. Servers does not know anything about this
298 key and this causes that the private message is
299 not handled by the server at all, it is just
300 passed along. See section 2.5.3 Private Message
301 Encryption And Decryption for more information.
306 Indicates that the packet consists of list of
307 packet payloads indicated by the Packet Type field.
308 The payloads are added one after the other. Note that
309 there are packet types that must not be used as
310 list. Parsing of list packet is done by calculating
311 the length of each payload and parsing them one by
317 Marks the packet to be broadcasted. Client cannot
318 send broadcast packet and normal server cannot send
319 broadcast packet. Only router server may send broadcast
320 packet. The router receiving of packet with this flag
321 set MUST send (broadcast) the packet to its primary
322 route. If router has several router connections the
323 packet may be sent only to the primary route. See
324 section 2.12 Packet Broadcasting for description of
332 o Packet Type (1 byte) - Is the type of the packet. Receiver
333 uses this field to parse the packet. See section 2.3
334 SILC Packets for list of defined packet types.
336 o Source ID Length (2 bytes) - Indicates the length of the
337 Source ID field in the header, not including this or any
340 o Destination ID Length (2 bytes) - Indicates the length of the
341 Destination ID field in the header, not including this or
344 o Src ID Type (1 byte) - Indicates the type of ID in the
345 Source ID field. See section 2.4 SILC ID Types for
348 o Source ID (variable length) - The actual source ID that
349 indicates which is the original sender of the packet.
351 o Dst ID Type (1 byte) - Indicates the type of ID in the
352 Destination ID field. See section 2.4 SILC ID Types for
355 o Destination ID (variable length) - The actual destination
356 ID that indicates which is the end receiver of the packet.
360 2.3 SILC Packet Types
362 SILC packet types defines the contents of the packet and it is used by
363 the receiver to parse the packet. The packet type is 8 bits, as a one
364 byte, in length. The range for the packet types are from 0 - 255,
365 where 0 is never sent and 255 is currently reserved for future
366 extensions and MUST NOT be defined to any other purpose. Every SILC
367 specification compliant implementation SHOULD support all of these packet
370 The below list of the SILC Packet types includes reference to the packet
371 payload as well. Packet payloads are the actual packet, that is, the data
372 that the packet consists of. Each packet type defines packet payload
373 which usually may only be sent with the specific packet type.
375 Most of the packets are packets that must be destined directly to entity
376 that is connected to the sender. It is not allowed, for example, for
377 router to send disconnect packet to client that is not directly connected
378 to the router. However, there are some special packet types that may
379 be destined to some entity that the sender has not direct connection
380 with. These packets are for example private message packets, channel
381 message packets, command packets and some other packets that may be
382 broadcasted in the SILC network. If the packet is allowed to be sent to
383 indirectly connected entity it is mentioned separately in the packet
384 description (unless it is obvious as in private and channel message
385 packets). Other packets MUST NOT be sent or accepted, if sent, to
386 indirectly connected entities.
388 List of SILC Packet types are defined as follows.
393 This type is reserved and it is never sent.
396 1 SILC_PACKET_DISCONNECT
398 This packet is sent to disconnect the remote end. Reason of
399 the disconnection is sent inside the packet payload. Client
400 usually does not send this packet.
402 This packet MUST NOT be sent as list and the List flag MUST
405 Payload of the packet: See section 2.3.3 Disconnect Payload
408 2 SILC_PACKET_SUCCESS
410 This packet is sent upon successful execution of some protocol.
411 The status of the success is sent in the packet.
413 This packet MUST NOT be sent as list and the List flag MUST
416 Payload of the packet: See section 2.3.4 Success Payload
419 3 SILC_PACKET_FAILURE
421 This packet is sent upon failure of some protocol. The status
422 of the failure is sent in the packet.
424 This packet MUST NOT be sent as list and the List flag MUST
427 Payload of the packet: See section 2.3.5 Failure Payload
432 This packet MAY be sent upon rejection of some protocol.
433 The status of the rejection is sent in the packet.
435 This packet MUST NOT be sent as list and the List flag MUST
438 Payload of the packet: See section 2.3.6 Reject Payload
443 This packet is used to send notify message, usually from
444 server to client, although it MAY be sent from server to another
445 server as well. Client MUST NOT send this packet. Server MAY
446 send this packet to channel as well when the packet is
447 distributed to all clients on the channel.
449 Payload of the packet: See section 2.3.7 Notify Payload.
454 This packet is sent when an error occurs. Server MAY
455 send this packet. Client MUST NOT send this packet. The
456 client MAY entirely ignore the packet, however, server is
457 most likely to take action anyway. This packet MAY be sent
458 to entity that is indirectly connected to the sender.
460 This packet MUST NOT be sent as list and the List flag MUST
463 Payload of the packet: See section 2.3.8 Error Payload.
466 7 SILC_PACKET_CHANNEL_MESSAGE
468 This packet is used to send messages to channels. The packet
469 includes Channel ID of the channel and the actual message to
470 the channel. Messages sent to the channel are always protected
471 by channel specific keys. Channel Keys are distributed by
472 SILC_PACKET_CHANNEL_KEY packet.
474 This packet MUST NOT be sent as list and the List flag MUST
477 Payload of the packet: See section 2.3.9 Channel Message
481 8 SILC_PACKET_CHANNEL_KEY
483 This packet is used to distribute new key for particular
484 channel. Each channel has their own independent keys that
485 is used to protect the traffic on the channel. Only server
486 may send this packet. This packet MAY be sent to entity
487 that is indirectly connected to the sender.
489 This packet MUST NOT be sent as list and the List flag MUST
492 Payload of the packet: See section 2.3.10 Channel Key Payload
495 9 SILC_PACKET_PRIVATE_MESSAGE
497 This packet is used to send private messages from client
498 to another client. By default, private messages are protected
499 by session keys established by normal key exchange protocol.
500 However, it is possible to use specific key to protect private
501 messages. SILC_PACKET_PRIVATE_MESSAGE_KEY packet is used to
502 agree the key with the remote client. Pre-shared key MAY be
503 used as well if both of the client knows it, however, it needs
504 to be agreed outside SILC. See more of this in [SILC1].
506 This packet MUST NOT be sent as list and the List flag MUST
509 Payload of the packet: See section 2.3.11 Private Message
513 10 SILC_PACKET_PRIVATE_MESSAGE_KEY
515 This packet is used to agree about a key to be used to protect
516 the private messages between two clients. If this is not sent
517 the normal session key is used to protect the private messages
518 inside SILC network. Agreeing to use specific key to protect
519 private messages adds security, as no server between the two
520 clients will be able to decrypt the private message. However,
521 servers inside SILC network are considered to be trusted, thus
522 using normal session key to protect private messages does not
523 degrade security. Whether to agree to use specific keys by
524 default or to use normal session keys by default, is
525 implementation specific issue. See more of this in [SILC1].
527 This packet MUST NOT be sent as list and the List flag MUST
530 Payload of the packet: See section 2.3.12 Private Message
534 11 SILC_PACKET_COMMAND
536 This packet is used to send commands from client to server.
537 Server MAY send this packet to other servers as well. All
538 commands are listed in their own section SILC Command Types
539 in [SILC4]. The contents of this packet is command specific.
540 This packet MAY be sent to entity that is indirectly connected
543 This packet MUST NOT be sent as list and the List flag MUST
546 Payload of the packet: See section 2.3.13 Command Payload
549 12 SILC_PACKET_COMMAND_REPLY
551 This packet is sent as reply to the SILC_PACKET_COMMAND packet.
552 The contents of this packet is command specific. This packet
553 MAY be sent to entity that is indirectly connected to the
556 This packet MUST NOT be sent as list and the List flag MUST
559 Payload of the packet: See section 2.3.14 Command Reply
560 Payload and section 2.3.13 Command
564 13 SILC_PACKET_KEY_EXCHANGE
566 This packet is used to start SILC Key Exchange Protocol,
567 described in detail in [SILC3].
569 This packet MUST NOT be sent as list and the List flag MUST
572 Payload of the packet: Payload of this packet is described
573 in the section SILC Key Exchange
574 Protocol and its sub sections in
578 14 SILC_PACKET_KEY_EXCHANGE_1
580 This packet is used as part of the SILC Key Exchange Protocol.
582 This packet MUST NOT be sent as list and the List flag MUST
585 Payload of the packet: Payload of this packet is described
586 in the section SILC Key Exchange
587 Protocol and its sub sections in
591 15 SILC_PACKET_KEY_EXCHANGE_2
593 This packet is used as part of the SILC Key Exchange Protocol.
595 This packet MUST NOT be sent as list and the List flag MUST
598 Payload of the packet: Payload of this packet is described
599 in the section SILC Key Exchange
600 Protocol and its sub sections in
604 16 SILC_PACKET_CONNECTION_AUTH_REQUEST
606 This packet is used to request the authentication method to
607 be used in the SILC Connection Authentication Protocol. If
608 initiator of the protocol does not know the mandatory
609 authentication method this packet MAY be used to determine it.
611 The party receiving this payload MUST respond with the same
612 packet including the mandatory authentication method.
614 This packet MUST NOT be sent as list and the List flag MUST
617 Payload of the packet: See section 2.3.15 Connection Auth
623 17 SILC_PACKET_CONNECTION_AUTH
625 This packet is used to start and perform the SILC Connection
626 Authentication Protocol. This protocol is used to authenticate
627 the connecting party. The protocol is described in detail in
630 This packet MUST NOT be sent as list and the List flag MUST
633 Payload of the packet: Payload of this packet is described
634 in the section SILC Authentication
635 Protocol and it sub sections in [SILC].
638 18 SILC_PACKET_NEW_ID
640 This packet is used to distribute new ID's from server to
641 router and from router to all routers in the SILC network.
642 This is used when for example new client is registered to
643 SILC network. The newly created ID's of these operations are
644 distributed by this packet. Only server may send this packet,
645 however, client MUST be able to receive this packet. This
646 packet MAY be sent to entity that is indirectly connected
649 Payload of the packet: See section 2.3.16 New ID Payload
652 19 SILC_PACKET_NEW_CLIENT
654 This packet is used by client to register itself to the
655 SILC network. This is sent after key exchange and
656 authentication protocols has been completed. Client sends
657 various information about itself in this packet.
659 This packet MUST NOT be sent as list and the List flag MUST
662 Payload of the packet: See section 2.3.17 New Client Payload
665 20 SILC_PACKET_NEW_SERVER
667 This packet is used by server to register itself to the
668 SILC network. This is sent after key exchange and
669 authentication protocols has been completed. Server sends
670 this to the router it connected to, or, if router was
671 connecting, to the connected router. Server sends its
672 Server ID and other information in this packet. The client
673 MUST NOT send or receive this packet.
675 This packet MUST NOT be sent as list and the List flag MUST
678 Payload of the packet: See section 2.3.18 New Server Payload
681 21 SILC_PACKET_NEW_CHANNEL
683 This packet is used to notify routers about newly created
684 channel. Channels are always created by the router and it MUST
685 notify other routers about the created channel. Router sends
686 this packet to its primary route. Client MUST NOT send this
687 packet. This packet MAY be sent to entity that is indirectly
688 connected to the sender.
690 Payload of the packet: See section 2.3.19 New Channel Payload
695 This packet is used to indicate that re-key must be performed
696 for session keys. See section Session Key Regeneration in
697 [SILC1] for more information. This packet does not have
700 This packet MUST NOT be sent as list and the List flag MUST
704 23 SILC_PACKET_REKEY_DONE
706 This packet is used to indicate that re-key is performed and
707 new keys must be used hereafter.
709 This packet MUST NOT be sent as list and the List flag MUST
713 24 SILC_PACKET_HEARTBEAT
715 This packet is used by clients, servers and routers to keep the
716 connection alive. It is recommended that all servers implement
717 keepalive actions and perform it to both direction in a link.
718 This packet does not have a payload.
720 This packet MUST NOT be sent as list and the List flag MUST
724 25 SILC_PACKET_KEY_AGREEMENT
726 This packet is used by clients to request key negotiation
727 between another client in the SILC network. If the negotiation
728 is started it is performed using the SKE protocol. The result of
729 the negotiation, the secret key material, can be used for
730 example as private message key. The server and router MUST NOT
733 This packet MUST NOT be sent as list and the List flag MUST
736 Payload of the packet: See section 2.3.20 Key Agreement Payload
739 26 SILC_PACKET_CELL_ROUTERS
741 This packet is used by primary router in the cell to notify its
742 primary router what other routers (backup routers) exist in the
743 cell. In case of failure of the primary router in the cell the
744 first router in the list will act as primary router of the cell.
745 This packet MAY be sent at anytime after connection has been
746 registered to the primary router. The client MUST NOT send this
749 This packet MUST NOT be sent as list and the List flag MUST
752 Payload of the packet: See section 2.3.21 Cell Routers Payload
757 Currently undefined commands.
762 These packet types are reserved for private use and they will
763 not be defined by this document.
770 This type is reserved for future extensions and currently it
776 2.3.1 SILC Packet Payloads
778 All payloads resides in the main data area of the SILC packet. However
779 all payloads MUST be at the start of the data area after the SILC
780 packet header and padding. All fields in the packet payload are always
781 encrypted, as they reside in the data area of the packet which is
784 Payloads described in this section are common payloads that MUST be
785 accepted anytime during SILC session. Most of the payloads may only
786 be sent with specific packet type which is defined in the description
789 There are a lot of other payloads in the SILC as well. However, they
790 are not common in the sense that they could be sent at any time.
791 These payloads are not described in this section. These are payloads
792 such as SILC Key Exchange payloads and so on. These are described
793 in [SILC1], [SILC3] and [SILC4].
797 2.3.2 Generic payloads
799 This section describes generic payloads that are not associated to any
800 specific packet type. They can be used for example inside some other
807 This payload can be used to send an ID. ID's are variable in length
808 thus this payload provides a way to send variable length ID's.
821 The following diagram represents the ID Payload.
826 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
827 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
828 | ID Type | ID Length |
829 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
833 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
841 o ID Type (2 bytes) - Indicates the type of the ID. See
842 section 2.4 SILC ID Types for list of defined ID types.
844 o ID Length (2 bytes) - Length of the ID Data area not
845 including the length of any other fields in the payload.
847 o ID Data (variable length) - The actual ID data.
852 2.3.2.2 Argument Payload
854 Argument Payload is used to set arguments for any packet payload that
855 needs and supports arguments, such as commands. Number of arguments
856 associated with a packet MUST be indicated by the packet payload which
857 needs the arguments. Argument Payloads MUST always reside right after
858 the packet payload needing the arguments. Incorrect amount of argument
859 payloads MUST cause rejection of the packet. The following diagram
860 represents the Argument Payload.
862 The following diagram represents the Argument Payload.
867 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
868 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
869 | Payload Length | Argument Type | |
870 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
874 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
878 Figure 4: Argument Payload
882 o Payload Length (2 bytes) - Length of the argument payload data
883 area not including the length of any other fields in the
886 o Argument Type (1 byte) - Indicates the type of the argument.
887 Every argument may have a specific type that MUST be defined
888 by the packet payload needing the argument. For example
889 every command specify a number for each argument that maybe
890 associated with the command. By using this number the receiver
891 of the packet knows what type of argument this is. If there is
892 no specific argument type this field is set to zero (0).
894 o Argument Data (variable length) - Argument data.
899 2.3.2.3 Channel Payload
901 Generic Channel Payload may be used to send information about channel,
902 its name, the Channel ID and a mode.
904 The following diagram represents the Channel Payload.
910 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
911 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
912 | Channel Name Length | |
913 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
917 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
918 | Channel ID Length | |
919 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
923 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
925 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
929 Figure 5: New Channel Payload
933 o Channel Name Length (2 bytes) - Length of the channel name
936 o Channel Name (variable length) - The name of the channel.
938 o Channel ID Length (2 bytes) - Length of the Channel ID field.
940 o Channel ID (variable length) - The Channel ID.
942 o Mode Mask (4 bytes) - A mode. This can be the mode of the
943 channel but it can also be the mode of the client on the
944 channel. The contents of this field is dependent of the
945 usage of this payload. The usage is defined separately
946 when this payload is used. This is a 32 bit MSB first value.
951 2.3.2.4 Public Key Payload
953 Generic Public Key Payload may be used to send different types of
954 public keys and certificates.
956 The following diagram represents the Public Key Payload.
962 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
963 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
964 | Public Key Length | Public Key Type |
965 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
967 ~ Public Key of the party (or certificate) ~
969 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
973 Figure 6: Public Key Payload
977 o Public Key Length (2 bytes) - The length of the Public Key
978 (or certificate) field, not including any other field.
980 o Public Key Type (2 bytes) - The public key (or certificate)
981 type. This field indicates the type of the public key in
982 the packet. See the [SILC3] for defined public key types.
984 o Public Key (or certificate) (variable length) - The
985 public key or certificate.
990 2.3.3 Disconnect Payload
992 Disconnect payload is sent upon disconnection. The payload is simple;
993 reason of disconnection is sent to the disconnected party.
995 The payload may only be sent with SILC_PACKET_DISCONNECT packet. It
996 MUST NOT be sent in any other packet type. The following diagram
997 represents the Disconnect Payload.
1003 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1004 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1006 ~ Disconnect Message ~
1008 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1012 Figure 7: Disconnect Payload
1018 o Disconnect Message (variable length) - Human readable
1019 reason of the disconnection.
1024 2.3.4 Success Payload
1026 Success payload is sent when some protocol execution is successfully
1027 completed. The payload is simple; indication of the success is sent.
1028 This may be any data, including binary or human readable data.
1033 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1034 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1036 ~ Success Indication ~
1038 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1042 Figure 8: Success Payload
1046 o Success Indication (variable length) - Indication of
1047 the success. This may be for example some flag that
1048 indicates the protocol and the success status or human
1049 readable success message. The true length of this
1050 payload is available by calculating it from the SILC
1057 2.3.5 Failure Payload
1059 This is opposite of Success Payload. Indication of failure of
1060 some protocol is sent in the payload.
1066 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1067 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1069 ~ Failure Indication ~
1071 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1075 Figure 9: Failure Payload
1079 o Failure Indication (variable length) - Indication of
1080 the failure. This may be for example some flag that
1081 indicates the protocol and the failure status or human
1082 readable failure message. The true length of this
1083 payload is available by calculating it from the SILC
1089 2.3.6 Reject Payload
1091 This payload is sent when some protocol is rejected to be executed.
1092 Other operations MAY send this as well that was rejected. The
1093 indication of the rejection is sent in the payload. The indication
1094 may be binary or human readable data.
1100 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1101 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1103 ~ Reject Indication ~
1105 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1109 Figure 10: Reject Payload
1113 o Reject Indication (variable length) - Indication of
1114 the rejection. This maybe for example some flag that
1115 indicates the protocol and the rejection status or human
1116 readable rejection message. The true length of this
1117 payload is available by calculating it from the SILC
1123 2.3.7 Notify Payload
1125 Notify payload is used to send notify messages. The payload is usually
1126 sent from server to client, however, server MAY send it to another
1127 server as well. This payload MAY also be sent to a channel. Client
1128 MUST NOT send this payload. The receiver of this payload MAY ignore
1129 the contents of the payload, however, notify message SHOULD be audited.
1131 The payload may only be sent with SILC_PACKET_NOTIFY packet. It MUST
1132 not be sent in any other packet type. The following diagram represents
1138 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1139 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1140 | Notify Type | Payload Length |
1141 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1147 Figure 11: Notify Payload
1151 o Notify Type (2 bytes) - Indicates the type of the notify
1154 o Payload Length (2 bytes) - Length of the entire Notify Payload
1155 including any associated Argument Payloads.
1157 o Argument Nums (2 bytes) - Indicates the number of Argument
1158 Payloads associated to this payload. Notify types may define
1159 arguments to be send along the notify message.
1162 The following list of currently defined notify types. The format for
1163 notify arguments is same as in SILC commands described in [SILC4].
1164 Also, all ID's sent in arguments are sent inside ID Payload.
1167 0 SILC_NOTIFY_TYPE_NONE
1169 If no specific notify type apply for the notify message this type
1173 Arguments: (1) <message>
1175 The <message> is implementation specific free text string.
1176 Receiver MAY ignore this message.
1179 1 SILC_NOTIFY_TYPE_INVITE
1181 Sent when an client is invited to a channel. This is also sent
1182 when the invite list of the channel is changed. This notify type
1183 is sent between routers and if an client was invited, to the
1184 client as well. In this case the packet is destined to the client.
1187 Arguments: (1) <Channel ID> (2) <channel name>
1188 (3) [<sender Client ID>] (4) [<adding client>]
1189 (5) [<removing client>]
1191 The <Channel ID> is the channel. The <channel name> is the name
1192 of the channel and is provided because the client which receives
1193 this notify packet may not have a way to resolve the name of the
1194 channel from the <Channel ID>. The <sender Client ID> is the
1195 Client ID which invited the client to the channel. The <adding
1196 client> and the <removing client> indicates the added or removed
1197 client from the channel's invite list. The format of the <adding
1198 client> and the <removing client> is defined in the [SILC4] with
1199 SILC_COMMAND_INVITE command.
1201 The <adding client> and <removing client> MUST NOT be sent when
1202 the packet is destined to a client.
1205 2 SILC_NOTIFY_TYPE_JOIN
1207 Sent when client has joined to a channel. The server MUST
1208 distribute this type only to the local clients on the channel
1209 and then send it to its primary router. The router or server
1210 receiving the packet distributes this type to the local clients
1211 on the channel and broadcast it to the network.
1214 Arguments: (1) [<Client ID>] (2) <Channel ID>
1216 The <Client ID> is the client that joined to the channel indicated
1217 by the <Channel ID>.
1220 3 SILC_NOTIFY_TYPE_LEAVE
1222 Sent when client has left a channel. The server must distribute
1223 this type only to the local clients on the channel and then send
1224 it to its primary router. The router or server receiving the
1225 packet distributes this type to the local clients on the channel
1226 and broadcast it to the network.
1229 Arguments: (1) <Client ID>
1231 The <Client ID> is the client which left the channel.
1234 4 SILC_NOTIFY_TYPE_SIGNOFF
1236 Sent when client signoff from SILC network. The server MUST
1237 distribute this type only to the local clients on the channel and
1238 then send it to its primary router. The router or server receiving
1239 the packet distributes this type to the local clients on the
1240 channel and broadcast it to the network.
1243 Arguments: (1) <Client ID> (2) <message>
1245 The <Client ID> is the client which left SILC network. The
1246 <message> is free text string indicating the reason of the signoff.
1249 5 SILC_NOTIFY_TYPE_TOPIC_SET
1251 Sent when topic is set/changed on a channel. This type must be
1252 sent only to the clients which is joined on the channel which
1253 topic was set or changed.
1256 Arguments: (1) <Client ID> (2) <topic>
1258 The <Client ID> is the client which set or changed the <topic>.
1261 6 SILC_NOTIFY_TYPE_NICK_CHANGE
1263 Sent when client changes nick on a channel. The server MUST
1264 distribute this type only to the local clients on the channel
1265 and then send it to its primary router. The router or server
1266 receiving the packet distributes this type to the local clients
1267 on the channel and broadcast it to the network.
1270 Arguments: (1) <Old Client ID> (2) <New Client ID>
1272 The <Old Client ID> is the old ID of the client which changed
1273 the nickname. The <New Client ID> is the new ID generated by
1274 the change of the nickname.
1277 7 SILC_NOTIFY_TYPE_CMODE_CHANGE
1279 Sent when channel mode has changed. This type MUST be sent only
1280 to the clients which is joined on the channel which mode was
1284 Arguments: (1) <ID Payload> (2) <mode mask>
1285 (3) [<cipher>] (4) <[hmac>]
1287 The <ID Payload> is the ID (usually Client ID but it can be
1288 Server ID as well when the router is enforcing channel mode
1289 change) of the entity which changed the mode. The <mode mask>
1290 is the new mode mask of the channel. The client can safely
1291 ignore the <cipher> argument since the SILC_PACKET_CHANNEL_KEY
1292 packet will force the new channel key change anyway. The <hmac>
1293 argument is important since the client is responsible of setting
1294 the new HMAC and the hmac key into use.
1297 8 SILC_NOTIFY_TYPE_CUMODE_CHANGE
1299 Sent when user mode on channel has changed. This type MUST be
1300 sent only to the clients which is joined on the channel where
1301 the target client is on.
1304 Arguments: (1) <ID Payload> (2) <mode mask>
1305 (3) <Target Client ID>
1307 The <ID Payload> is the ID (usually Client ID but it can be
1308 Server ID as well when the router is enforcing user's mode
1309 change) of the entity which changed the mode. The <mode mask>
1310 is the new mode mask of the channel. The <Target Client ID>
1311 is the client which mode was changed.
1314 9 SILC_NOTIFY_TYPE_MOTD
1316 Sent when Message of the Day (motd) is sent to a client.
1319 Arguments: (1) <motd>
1321 The <motd> is the Message of the Day.
1324 10 SILC_NOTIFY_TYPE_CHANNEL_CHANGE
1326 Sent when channel's ID has changed for a reason or another.
1327 This is sent by normal server to the client. This can also be
1328 sent by router to other server to force the Channel ID change.
1329 The Channel ID MUST be changed to use the new one. When sent
1330 to clients, this type MUST be sent only to the clients which is
1331 joined on the channel.
1334 Arguments: (1) <Old Channel ID> (2) <New Channel ID>
1336 The <Old Channel ID> is the channel's old ID and the <New
1337 Channel ID> is the new one that MUST replace the old one.
1340 11 SILC_NOTIFY_TYPE_SERVER_SIGNOFF
1342 Sent when server quits SILC network. Those clients from this
1343 server that are on channels must be removed from the channel.
1346 Arguments: (1) <Server ID> (n) [<Client ID> [...]
1348 The <Server ID> is the server's ID. The rest of the arguments
1349 are the Client ID's of the client's which are coming from this
1350 server and are thus quitting the SILC network also. If the
1351 maximum number of arguments are reached another
1352 SILC_NOTIFY_TYPE_SERVER_SIGNOFF notify packet MUST be sent.
1353 When this notify packet is sent between routers the Client ID's
1357 12 SILC_NOTIFY_TYPE_KICKED
1359 Sent when a client has been kicked from a channel. This is
1360 sent also to the client which was kicked from the channel.
1361 The client which was kicked from the channel MUST be removed
1362 from the channel. This notify type is always destined to the
1363 channel. The router or server receiving the packet distributes
1364 this type to the local clients on the channel and broadcast it
1368 Arguments: (1) <Client ID> (2) [<comment>]
1370 The <Client ID> is the client which was kicked from the channel.
1371 The kicker may have set the <comment> to indicate the reason for
1375 13 SILC_NOTIFY_TYPE_KILLED
1377 Sent when a client has been killed from the network. This is sent
1378 also to the client which was killed from the network. The client
1379 which was killed from the network MUST be removed from the network.
1380 This notify type is destined directly to the client which was
1381 killed and to channel if the client is on any channel. The router
1382 or server receiving the packet distributes this type to the local
1383 clients on the channel and broadcast it to the network.
1386 Arguments: (1) <Client ID> (2) [<comment>]
1388 The <Client ID> is the client which was killed from the network.
1389 The killer may have set the <comment> to indicate the reason for
1393 14 SILC_NOTIFY_TYPE_UMODE_CHANGE
1395 Sent when user's mode in the SILC changes. This type is sent
1396 only between routers as broadcast packet.
1399 Arguments: (1) <Client ID> (2) <mode mask>
1401 The <Client ID> is the client which mode was changed. The
1402 <mode mask> is the new mode mask.
1405 15 SILC_NOTIFY_TYPE_BAN
1407 Sent when the ban list of the channel is changed. This type is
1408 sent only between routers as broadcast packet.
1411 Arguments: (1) <Channel ID> (2) [<adding client>]
1412 (3) [<removing client>]
1414 The <Channel ID> is the channel which ban list was changed. The
1415 <adding client> is used to indicate that a ban was added and the
1416 <removing client> is used to indicate that a ban was removed from
1417 the ban list. The format of the <adding client> and the
1418 <removing client> is defined in the [SILC4] with SILC_COMMAND_BAN
1423 Notify types starting from 16384 are reserved for private notify
1430 Error payload is sent upon error. Error may occur in various
1431 conditions when server sends this packet. Client MUST NOT send this
1432 payload but MUST be able to accept it. However, client MAY
1433 totally ignore the contents of the packet as server is going to
1434 take action on the error anyway. However, it is recommended
1435 that the client takes error packet seriously.
1441 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1442 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1446 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1450 Figure 12: Error Payload
1454 o Error Message (variable length) - Human readable error
1460 2.3.9 Channel Message Payload
1462 Channel messages are the most common messages sent in the SILC.
1463 Channel Message Payload is used to send message to channels. These
1464 messages can only be sent if client has joined to some channel.
1465 Even though this packet is the most common in SILC it is still
1466 special packet. Some special handling on sending and reception
1467 of channel message is required.
1469 Padding MUST be applied into this payload since the payload is
1470 encrypted separately from other parts of the packet with the
1471 channel specific key. Hence the requirement of the padding.
1472 The padding SHOULD be random data. The packet MUST be made
1473 multiple by eight (8) or by the block size of the cipher, which
1476 The SILC header in this packet is encrypted with the session key
1477 of the next receiver of the packet. Nothing else is encrypted
1478 with that key. Thus, the actual packet and padding to be
1479 encrypted with the session key is SILC Header plus padding to it
1480 to make it multiple by eight (8) or multiple by the block size
1481 of the cipher, which ever is larger.
1483 Receiver of the the channel message packet is able to determine
1484 the channel the message is destined to by checking the destination
1485 ID from the SILC Packet header which tells the destination channel.
1486 The original sender of the packet is also determined by checking
1487 the source ID from the header which tells the client which sent
1490 The payload may only be sent with SILC_PACKET_CHANNEL_MESSAGE packet.
1491 It MUST NOT be sent in any other packet type. The following diagram
1492 represents the Channel Message Payload.
1494 (*) indicates that the field is not encrypted.
1500 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1501 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1502 | Flags | Message Length |
1503 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1507 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1508 | Padding Length | |
1509 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1513 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1517 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1519 ~ Initial Vector * ~
1521 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1525 Figure 13: Channel Message Payload
1529 o Flags (2 bytes) - Includes the flags of the channel
1530 messages. The flags can indicate a reason or purpose
1531 for the channel message. Note that the Private Message
1532 Payload use these same flags for the same purpose. The
1533 following flags are defined:
1535 0x0000 SILC_MESSAGE_FLAG_NONE
1537 No specific flags set.
1539 0x0001 SILC_MESSAGE_FLAG_AUTOREPLY
1541 This message is an automatic reply to an earlier
1544 0x0002 SILC_MESSAGE_FLAG_NOREPLY
1546 There should not be reply messages to this
1549 0x0004 SILC_MESSAGE_FLAG_ACTION
1551 The sender is performing an action and the message
1552 is the indication of the action.
1554 0x0008 SILC_MESSAGE_FLAG_NOTICE
1556 The message is for example an informational notice
1559 0x0010 SILC_MESSAGE_FLAG_REQUEST
1561 This is a generic request flag to send request
1562 messages. A separate document should define any
1563 payloads associated to this flag.
1565 0x0020 SILC_MESSAGE_FLAG_SIGNED
1567 This flag indicates that the message is signed
1568 with sender's private key and thus can be verified
1569 by the receiver using the sender's public key. A
1570 separate document should define the detailed procedure
1571 of the signing process and any associated payloads
1574 0x0040 - 0x0200 RESERVED
1576 Reserved for future flags
1578 0x0400 - 0x8000 PRIVATE RANGE
1580 Private range for free use.
1582 o Message Length (2 bytes) - Indicates the length of the
1583 the Message Data field in the payload, not including any
1586 o Message Data (variable length) - The actual message to
1589 o Padding Length (2 bytes) - Indicates the length of the
1590 Padding field in the payload, not including any other
1593 o Padding (variable length) - The padding that MUST be
1594 applied because this payload is encrypted separately from
1595 other parts of the packet.
1597 o MAC (variable length) - The MAC computed from the
1598 Message Length, Message Data, Padding Length and Padding
1599 fields. This protects the integrity of the plaintext
1600 channel message. The receiver can verify from the MAC
1601 whether the message decrypted correctly. Also, if more than
1602 one private key has been set for the channel, the receiver
1603 can verify which of the keys decrypted the message
1604 correctly. Note that, this field is encrypted and MUST
1605 be added to the padding calculation.
1607 o Initial Vector (variable length) - The initial vector
1608 that has been used in packet encryption. It needs to be
1609 used in the packet decryption as well. What this field
1610 includes is implementation issue. However, it is
1611 RECOMMENDED that it would be random data or, perhaps,
1612 a timestamp. It is NOT RECOMMENDED to use zero (0) as an
1613 initial vector. This field is not encrypted. This field
1614 is not included into the padding calculation. Length
1615 of this field equals the cipher's block size. This field
1616 is, however, authenticated.
1621 2.3.10 Channel Key Payload
1623 All traffic in channels are protected by channel specific keys.
1624 Channel Key Payload is used to distribute channel keys to all
1625 clients on the particular channel. Channel keys are sent when
1626 the channel is created, when new user joins to the channel and
1627 whenever a user has left a channel. Server creates the new
1628 channel key and distributes it to the clients by encrypting this
1629 payload with the session key shared between the server and
1630 the client. After that, client starts using the key received
1631 in this payload to protect the traffic on the channel.
1633 The client which is joining to the channel receives its key in the
1634 SILC_COMMAND_JOIN command reply message thus it is not necessary to
1635 send this payload to the entity which sent the SILC_COMMAND_JOIN
1638 Channel keys are cell specific thus every router in the cell have
1639 to create a channel key and distribute it if any client in the
1640 cell has joined to a channel. Channel traffic between cell's
1641 are not encrypted using channel keys, they are encrypted using
1642 normal session keys between two routers. Inside a cell, all
1643 channel traffic is encrypted with the specified channel key.
1644 Channel key should expire periodically, say, in one hour, in
1645 which case new channel key is created and distributed.
1647 The payload may only be sent with SILC_PACKET_CHANNEL_KEY packet.
1648 It MUST NOT be sent in any other packet type. The following diagram
1649 represents the Channel Key Payload.
1655 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1656 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1657 | Channel ID Length | |
1658 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1662 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1663 | Cipher Name Length | |
1664 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1668 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1669 | Channel Key Length | |
1670 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1674 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1678 Figure 14: Channel Key Payload
1683 o Channel ID Length (2 bytes) - Indicates the length of the
1684 Channel ID field in the payload, not including any other
1687 o Channel ID (variable length) - The Channel ID of the
1688 channel this key is meant for.
1690 o Cipher Name Length (2 bytes) - Indicates the length of the
1691 Cipher name field in the payload, not including any other
1694 o Cipher Name (variable length) - Name of the cipher used
1695 in the protection of channel traffic. This name is
1696 initially decided by the creator of the channel but it
1697 MAY change during the life time of the channel as well.
1699 o Channel Key Length (2 bytes) - Indicates the length of the
1700 Channel Key field in the payload, not including any other
1703 o Channel Key (variable length) - The actual channel key
1709 2.3.11 Private Message Payload
1711 Private Message Payload is used to send private message between
1712 two clients (or users for that matter). The messages are sent only
1713 to the specified user and no other user inside SILC network is
1714 able to see the message. The message is protected by the session
1715 key established by the SILC Key Exchange Protocol. However,
1716 it is also possible to agree to use a private key to protect
1717 just the private messages. See section 2.3.11 Private Message
1718 Key Payload for detailed description of how to agree to use
1721 If normal session key is used to protect the message, every server
1722 between the sender client and the receiving client MUST decrypt the
1723 packet and always re-encrypt it with the session key of the next
1724 receiver of the packet. See section Client To Client in [SILC1].
1726 When private key is used to protect the message, servers between
1727 the sender and the receiver needs not to decrypt/re-encrypt the
1728 packet. Section Client To Client in [SILC1] gives example of this
1731 The payload may only be sent with SILC_PACKET_PRIVATE_MESSAGE
1732 packet. It MUST NOT be sent in any other packet type. The following
1733 diagram represents the Private Message Payload.
1747 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1748 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1749 | Flags | Message Data Length |
1750 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1754 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1758 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1762 Figure 15: Private Message Payload
1766 o Flags (2 bytes) - This field includes the flags of the
1767 private message. They can indicate a different reason or
1768 purpose for the private message. See the section 2.3.9
1769 Channel Message Payload for defined flags. Note that
1770 the Channel Message Payload use the same flags for the
1773 o Message Data Length (2 bytes) - Indicates the length of the
1774 Message Data field, not includes any other field.
1776 o Message Data (variable length) - The actual message to
1777 the client. Rest of the packet is reserved for the message
1780 o Padding (variable length) - This field is present only
1781 when the private message payload is encrypted with private
1782 message key. In this case the padding is applied to make
1783 the payload multiple by eight (8), or by the block size of
1784 the cipher, which ever is larger. When encrypted with
1785 normal session keys, this field MUST NOT be included.
1790 2.3.12 Private Message Key Payload
1792 This payload is used to send key from client to another client that
1793 is going to be used to protect the private messages between these
1794 two clients. If this payload is not sent normal session key
1795 established by the SILC Key Exchange Protocol is used to protect
1796 the private messages.
1798 This payload may only be sent by client to another client. Server
1799 MUST NOT send this payload at any time. After sending this payload
1800 the sender of private messages must set the Private Message Key
1801 flag into SILC Packet Header.
1803 The payload may only be sent with SILC_PACKET_PRIVATE_MESSAGE_KEY
1804 packet. It MUST NOT be sent in any other packet type. The following
1805 diagram represents the Private Message Key Payload.
1811 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1812 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1813 | Private Message Key Length | |
1814 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1816 ~ Private Message Key ~
1818 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1819 | Cipher Name Length | |
1820 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1824 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1828 Figure 16: Private Message Key Payload
1834 o Private Message Key Length (2 bytes) - Indicates the length
1835 of the Private Message Key field in the payload, not including
1838 o Private Message Key (variable length) - The actual private
1839 message key material.
1841 o Cipher Name Length (2 bytes) - Indicates the length of the
1842 Cipher Name field in the payload, not including any other
1845 o Cipher Name (variable length) - Name of the cipher to use
1846 in the private message encryption. If this field does not
1847 exist then the default cipher of the SILC protocol is used.
1848 See the [SILC1] for defined ciphers.
1854 2.3.13 Command Payload
1856 Command Payload is used to send SILC commands from client to server.
1857 Also server MAY send commands to other servers. The following diagram
1858 represents the Command Payload.
1864 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1865 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1866 | Payload Length | SILC Command | Arguments Num |
1867 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1868 | Command Identifier |
1869 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1873 Figure 17: Command Payload
1877 o Payload Length (2 bytes) - Length of the entire command
1878 payload including any command argument payloads associated
1881 o SILC Command (1 byte) - Indicates the SILC command. This MUST
1882 be set to non-zero value. If zero (0) value is found in this
1883 field the packet MUST be discarded.
1885 o Arguments Num (1 byte) - Indicates the number of arguments
1886 associated with the command. If there are no arguments this
1887 field is set to zero (0). The arguments MUST follow the
1888 command payload. See section 2.3.2.2 for definition of the
1891 o Command Identifier (2 bytes) - Identifies this command at the
1892 sender's end. The entity which replies to this command MUST
1893 set the value found from this field into the Command Payload
1894 used to send the reply to the sender. This way the sender
1895 can identify which command reply belongs to which originally
1896 sent command. What this field includes is implementation
1897 issue but it is RECOMMENDED that wrapping counter value is
1898 used in the field. Value zero (0) in this field means that
1899 no specific value is set.
1902 See [SILC4] for detailed description of different SILC commands,
1903 their arguments and their reply messages.
1909 2.3.14 Command Reply Payload
1911 Command Reply Payload is used to send replies to the commands. The
1912 Command Reply Payload is identical to the Command Payload thus see
1913 the upper section for the Command Payload specification.
1915 The entity which sends the reply packet MUST set the Command Identifier
1916 field in the reply packet's Command Payload to the value it received
1917 in the original command packet.
1919 See SILC Commands in [SILC4] for detailed description of different
1920 SILC commands, their arguments and their reply messages.
1924 2.3.15 Connection Auth Request Payload
1926 Client MAY send this payload to server to request the authentication
1927 method that must be used in authentication protocol. If client knows
1928 this information beforehand this payload is not necessary to be sent.
1929 Server performing authentication with another server MAY also send
1930 this payload to request the authentication method. If the connecting
1931 server already knows this information this payload is not necessary
1934 Server receiving this request MUST reply with same payload sending
1935 the mandatory authentication method. Algorithms that may be required
1936 to be used by the authentication method are the ones already
1937 established by the SILC Key Exchange protocol. See section Key
1938 Exchange Start Payload in [SILC3] for detailed information.
1940 The payload may only be sent with SILC_PACKET_CONNECTION_AUTH_REQUEST
1941 packet. It MUST NOT be sent in any other packet type. The following
1942 diagram represents the Connection Auth Request Payload.
1948 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1949 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1950 | Connection Type | Authentication Method |
1951 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1955 Figure 18: Connection Auth Request Payload
1959 o Connection Type (2 bytes) - Indicates the type of the
1960 connection. The following connection types are defined:
1967 If any other type is found in this field the packet MUST be
1968 discarded and the authentication MUST be failed.
1970 o Authentication Method (2 bytes) - Indicates the authentication
1971 method to be used in the authentication protocol. The following
1972 authentication methods are defined:
1975 1 password (mandatory)
1976 2 public key (mandatory)
1978 If any other type is found in this field the packet MUST be
1979 discarded and the authentication MUST be failed. If this
1980 payload is sent as request to receive the mandatory
1981 authentication method this field MUST be set to zero (0),
1982 indicating that receiver should send the mandatory
1983 authentication method. The receiver sending this payload
1984 to the requesting party, MAY also set this field to zero (0)
1985 to indicate that authentication is not required. In this
1986 case authentication protocol still MUST be started but
1987 server is most likely to respond with SILC_PACKET_SUCCESS
1993 2.3.16 New ID Payload
1995 New ID Payload is a multipurpose payload. It is used to send newly
1996 created ID's from clients and servers. When client connects to server
1997 and registers itself to the server by sending SILC_PACKET_NEW_CLIENT
1998 packet, server replies with this packet by sending the created ID for
1999 the client. Server always creates the ID for the client.
2001 This payload is also used when server tells its router that new client
2002 has registered to the SILC network. In this case the server sends
2003 the Client ID of the client to the router. Similarly when router
2004 distributes information to other routers about the client in the SILC
2005 network this payload is used.
2007 Also, when server connects to router, router uses this payload to inform
2008 other routers about new server in the SILC network. However, every
2009 server (or router) creates their own ID's thus the ID distributed by
2010 this payload is not created by the distributor in this case. Servers
2011 create their own ID's. Server registers itself to the network by sending
2012 SILC_PACKET_NEW_SERVER to the router it connected to. The case is same
2013 when router connects to another router.
2015 However, this payload MUST NOT be used to send information about new
2016 channels. New channels are always distributed by sending the dedicated
2017 SILC_PACKET_NEW_CHANNEL packet.
2019 Thus, this payload is very important and used every time when some
2020 new entity is registered to the SILC network. Client MUST NOT send this
2021 payload. Both client and server (and router) MAY receive this payload.
2023 The packet uses generic ID Payload as New ID Payload. See section
2024 2.3.2.1 for generic ID Payload.
2028 2.3.17 New Client Payload
2030 When client is connected to the server, keys has been exchanged and
2031 connection has been authenticated client MUST register itself to the
2032 server. Client's first packet after key exchange and authentication
2033 protocols must be SILC_PACKET_NEW_CLIENT. This payload tells server all
2034 the relevant information about the connected user. Server creates a new
2035 client ID for the client when received this payload and sends it to the
2036 client in New ID Payload.
2038 This payload sends username and real name of the user on the remote host
2039 which is connected to the SILC server with SILC client. The server
2040 creates the client ID according the information sent in this payload.
2041 The nickname of the user becomes the username sent in this payload.
2042 However, client should call NICK command after sending this payload to
2043 set the real nickname of the user which is then used to create new
2046 The payload may only be sent with SILC_PACKET_NEW_CLIENT packet. It
2047 MUST NOT be sent in any other packet type. The following diagram
2048 represents the New Client Payload.
2065 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
2066 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2067 | Username Length | |
2068 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2072 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2073 | Real Name Length | |
2074 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2078 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2082 Figure 19: New Client Payload
2086 o Username Length (2 bytes) - Length of the Username field.
2088 o Username (variable length) - The username of the user on
2089 the host where connecting to the SILC server.
2091 o Real Name Length (2 bytes) - Length of the Real Name field.
2093 o Real Name (variable length) - The real name of the user
2094 on the host where connecting to the SILC server.
2099 2.3.18 New Server Payload
2101 This payload is sent by server when it has completed successfully both
2102 key exchange and connection authentication protocols. The server
2103 MUST register itself to the SILC Network by sending this payload.
2104 The first packet after these key exchange and authentication protocols
2105 is SILC_PACKET_NEW_SERVER packet. The payload includes the Server ID
2106 of the server that it has created by itself. It also includes a
2107 name of the server that is associated to the Server ID.
2109 The payload may only be sent with SILC_PACKET_NEW_SERVER packet. It
2110 MUST NOT be sent in any other packet type. The following diagram
2111 represents the New Server Payload.
2120 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
2121 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2122 | Server ID Length | |
2123 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2127 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2128 | Server Name Length | |
2129 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2133 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2137 Figure 20: New Server Payload
2141 o Server ID Length (2 bytes) - Length of the Server ID Data
2144 o Server ID Data (variable length) - The actual Server ID
2147 o Server Name Length (2 bytes) - Length of the server name
2150 o Server Name (variable length) - The server name.
2155 2.3.19 New Channel Payload
2157 Information about newly created channel is broadcasted to all routers
2158 in the SILC network by sending this packet payload. Channels are
2159 created by router of the cell. Server never creates channels unless
2160 it is a standalone server and it does not have router connection,
2161 in this case server acts as router. Normal server send JOIN command
2162 to the router (after it has received JOIN command from client) which
2163 then processes the command and creates the channel. Client MUST NOT
2166 The packet uses generic Channel Payload as New Channel Payload. See
2167 section 2.3.2.3 for generic Channel Payload. The Mode Mask field in the
2168 Channel Payload is the mode of the channel.
2174 2.3.20 Key Agreement Payload
2176 This payload is used by clients to request key negotiation between
2177 another client in the SILC Network. The key agreement protocol used
2178 is the SKE protocol. The result of the protocol, the secret key
2179 material, can be used for example as private message key between the
2180 two clients. This significantly adds security as the key agreement
2181 is performed outside the SILC network. The server and router MUST NOT
2184 The sender MAY tell the receiver of this payload the hostname and the
2185 port where the SKE protocol is running in the sender's end. The
2186 receiver MAY then initiate the SKE negotiation with the sender. The
2187 sender MAY also optionally not to include the hostname and the port
2188 of its SKE protocol. In this case the receiver MAY reply to the
2189 request by sending the same payload filled with the receiver's hostname
2190 and the port where the SKE protocol is running. The sender MAY then
2191 initiate the SKE negotiation with the receiver.
2193 The payload may only be sent with SILC_PACKET_KEY_AGREEMENT packet.
2194 It MUST NOT be sent in any other packet type. The following diagram
2195 represents the Key Agreement Payload.
2201 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
2202 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2203 | Hostname Length | |
2204 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2208 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2210 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2214 Figure 21: Key Agreement Payload
2218 o Hostname Length (2 bytes) - Indicates the length of the
2221 o Hostname (variable length) - The hostname or IP address where
2222 the SKE protocol is running. The sender MAY fill this field
2223 when sending the payload. If the receiver sends this payload
2224 as reply to the request it MUST fill this field.
2226 o Port (4 bytes) - The port where the SKE protocol is bound.
2227 The sender MAY fill this field when sending the payload. If
2228 the receiver sends this payload as reply to the request it
2229 MUST fill this field. This is a 32 bit MSB first order value.
2233 After the key material has been received from the SKE protocol it is
2234 processed as the [SILC3] describes. If the key material is used as
2235 channel private key then the Sending Encryption Key, as defined in
2236 [SILC3] is used as the channel private key. Other key material must
2237 be discarded. The [SILC1] defines the way to use the key material if
2238 it is intended to be used as private message keys. Any other use for
2239 the key material is undefined.
2243 2.3.21 Cell Routers Payload
2245 Cell Routers payload is used by router to notify its primary router what
2246 other routers exist in the cell. The other routers are considered to be
2247 backup routers and one of them will come active only in the case of
2248 failure of the primary router. Normal server MAY send this packet if it
2249 is acting as backup router. Client MUST NOT send this packet. To send
2250 more than one backup router set the List flag and assemble the payloads
2253 The payload may only be sent with SILC_PACKET_CELL_ROUTERS packet. It
2254 MUST NOT be sent in any other packet type. The Following diagram
2255 represents the Cell Routers Payload.
2261 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
2262 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2263 | Hostname Length | |
2264 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2268 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2270 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2271 | Server ID Length | |
2272 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2276 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2280 Figure 22: Cell Routers Payload
2284 o Hostname Length (2 bytes) - Indicates the length of the Hostname
2287 o Hostname (variable length) - The hostname or IP address of
2290 o Port (4 bytes) - The port of the backup router it currently uses.
2291 This is a 32 bit MSB first order value.
2293 o Server ID Length (2 bytes) - Indicates the length of the Server
2296 o Server ID (variable length) - Consists of the Server ID of the
2304 ID's are extensively used in the SILC network to associate different
2305 entities. The following ID's has been defined to be used in the SILC
2311 When ever specific ID cannot be used this is used.
2315 Server ID to associate servers. See the format of
2320 Client ID to associate clients. See the format of
2325 Channel ID to associate channels. See the format of
2331 2.5 Packet Encryption And Decryption
2333 SILC packets are encrypted almost entirely. Only small part of SILC
2334 header is not encrypted as described in section 5.2 SILC Packet Header.
2335 The SILC Packet header is the first part of a packet to be encrypted
2336 and it is always encrypted with the key of the next receiver of the
2337 packet. The data payload area of the packet is always entirely
2338 encrypted and it is usually encrypted with the next receiver's key.
2339 However, there are some special packet types and packet payloads
2340 that require special encryption process. These special cases are
2341 described in the next sections. First is described the normal packet
2346 2.5.1 Normal Packet Encryption And Decryption
2348 Normal SILC packets are encrypted with the session key of the next
2349 receiver of the packet. The entire SILC Packet header and the packet
2350 data payload is is also encrypted with the same key. Padding of the
2351 packet is also encrypted always with the session key, also in special
2352 cases. Computed MAC of the packet must not be encrypted.
2354 Decryption process in these cases are straightforward. The receiver
2355 of the packet MUST first decrypt the SILC Packet header, or some parts
2356 of it, usually first 16 bytes of it. Then the receiver checks the
2357 packet type from the decrypted part of the header and can determine
2358 how the rest of the packet must be decrypted. If the packet type is
2359 any of the special cases described in the following sections the packet
2360 decryption is special. If the packet type is not among those special
2361 packet types rest of the packet can be decrypted with the same key.
2363 Also, note that two bytes of the SILC Packet header are not encrypted
2364 thus it must be noticed in the decryption process by starting the
2365 decryption from the second byte of the header. This sets some rules
2366 to padding generation as well, see the section 2.7 Packet Padding
2369 With out a doubt, this sort of decryption processing causes some
2370 overhead to packet decryption, but never the less, is required.
2374 2.5.2 Channel Message Encryption And Decryption
2376 Channel Messages (Channel Message Payload) are always encrypted with
2377 the channel specific key. However, the SILC Packet header is not
2378 encrypted with that key. As in normal case, the header is encrypted
2379 with the key of the next receiver of the packet, who ever that might
2380 be. Note that in this case the encrypted data area is not touched
2381 at all; it MUST NOT be re-encrypted with the session key.
2383 Receiver of a channel message, who ever that is, is REQUIRED to decrypt
2384 the SILC Packet header to be able to even recognize the packet to be as
2385 channel message. This is same procedure as for normal SILC packets.
2386 As the receiver founds the packet to be channel message, rest of the
2387 packet processing is special. Rest of the SILC Packet header is
2388 decrypted with the same session key along with the padding of the
2389 packet. After that the packet is protected with the channel specific
2390 key and thus can be decrypted only if the receiver is the client on
2391 the channel. See section 2.7 Packet Padding Generation for more
2392 information about padding on special packets.
2394 If the receiver of the channel message is router which is routing the
2395 message to another router then it MUST decrypt the Channel Message
2396 payload. Between routers (that is, between cells) channel messages
2397 are protected with session keys shared between the routers. This
2398 causes another special packet processing for channel messages. If
2399 the channel message is received from another router then the entire
2400 packet, including Channel Message payload, MUST be encrypted with the
2401 session key shared between the routers. In this case the packet
2402 decryption process is as with normal SILC packets. Hence, if the
2403 router is sending channel message to another router the Channel
2404 Message payload MUST have been decrypted and MUST be re-encrypted
2405 with the session key shared between the another router. In this
2406 case the packet encryption is as with any normal SILC packet.
2408 It must be noted that this is only when the channel messages are sent
2409 from router to another router. In all other cases the channel
2410 message encryption and decryption is as described above. This
2411 different processing of channel messages with router to router
2412 connection is because channel keys are cell specific. All cells has
2413 their own channel keys thus the channel message traveling from one
2414 cell to another MUST be protected as it would be any normal SILC
2417 If the SILC_CMODE_PRIVKEY channel mode has been set for the channel
2418 then the router cannot decrypt the packet as it does not know the
2419 private key. In this case the entire packet MUST be encrypted with
2420 the session key and sent to the router. The router receiving the
2421 packet MUST check the channel mode and decrypt the packet accordingly.
2425 2.5.3 Private Message Encryption And Decryption
2427 By default, private message in SILC are protected by session keys.
2428 In this case the private message encryption and decryption process is
2429 equivalent to normal packet encryption and decryption.
2431 However, private messages MAY be protected with private message key
2432 which causes the packet to be special packet. The procedure in this
2433 case is very much alike to channel packets. The actual private message
2434 is encrypted with the private message key and other parts of the
2435 packet is encrypted with the session key. See 2.7 Packet Padding
2436 Generation for more information about padding on special packets.
2438 The difference from channel message processing is that server or router
2439 en route never decrypts the actual private message, as it does not
2440 have the key to do that. Thus, when sending packets between router
2441 the processing is same as in any other case as well; the packet's header
2442 and padding is protected by the session key and the data area is not
2445 The true receiver of the private message, client, that is, is able
2446 to decrypt the private message as it shares the key with the sender
2451 2.6 Packet MAC Generation
2453 Data integrity of a packet is protected by including a message
2454 authentication code (MAC) at the end of the packet. The MAC is computed
2455 from shared secret MAC key, that is established by the SILC Key Exchange
2456 protocol, and from the original contents of the packet. The MAC is
2457 always computed before the packet is encrypted, although after it is
2458 compressed if compression is used.
2460 The MAC is computed from entire packet. Every bit of data in the packet,
2461 including SILC Packet Header is used in the MAC computing. This way
2462 the entire packet becomes authenticated.
2464 If the packet is special packet MAC is computed from the entire packet
2465 but part of the packet may be encrypted before the MAC is computed.
2466 This is case, for example, with channel messages where the message data
2467 is encrypted with key that server may not now. In this case the MAC
2468 has been computed from the encrypted data.
2470 See [SILC1] for defined and allowed MAC algorithms.
2474 2.7 Packet Padding Generation
2476 Padding is needed in the packet because the packet is encrypted. It
2477 MUST always be multiple by eight (8) or multiple by the block size
2478 of the cipher, which ever is larger. The padding is always encrypted.
2480 For normal packets the padding is added after the SILC Packet Header
2481 and between the Data Payload area. The padding for normal packets
2482 are calculated as follows:
2485 padding length = 16 - ((packet length - 2) mod 16)
2488 The 16 is the maximum padding allowed in SILC packet. Two (2) is
2489 subtracted from the true length of the packet because two (2) bytes
2490 is not encrypted in SILC Packet Header, see section 2.2 SILC Packet
2491 Header. Those two bytes that are not encrypted MUST NOT be calculated
2492 to the padding length.
2494 For special packets the padding calculation MAY be different as special
2495 packets may be encrypted differently. In these cases the encrypted
2496 data area MUST already be multiple by the block size thus in this case
2497 the padding is calculated only for SILC Packet Header, not for any
2498 other area of the packet. The same algorithm works in this case as
2499 well, except that the `packet length' is now the SILC Packet Header
2500 length. In this case, as well, two (2) is subtracted from the
2503 The padding MUST be random data, preferably, generated by
2504 cryptographically strong random number generator.
2508 2.8 Packet Compression
2510 SILC Packets MAY be compressed. In this case the data payload area
2511 is compressed and all other areas of the packet MUST remain as they
2512 are. After compression is performed for the data area, the length
2513 field of Packet Header MUST be set to the compressed length of the
2516 The compression MUST always be applied before encryption. When
2517 the packet is received and decrypted the data area MUST be decompressed.
2518 Note that the true sender of the packet MUST apply the compression and
2519 the true receiver of the packet MUST apply the decompression. Any
2520 server or router en route MUST NOT decompress the packet.
2526 The sender of the packet MUST assemble the SILC Packet Header with
2527 correct values. It MUST set the Source ID of the header as its own
2528 ID, unless it is forwarding the packet. It MUST also set the Destination
2529 ID of the header to the true destination. If the destination is client
2530 it will be Client ID, if it is server it will be Server ID and if it is
2531 channel it will be Channel ID.
2533 If the sender wants to compress the packet it MUST apply the
2534 compression now. Sender MUST also compute the padding as described
2535 in above sections. Then sender MUST compute the MAC of the packet.
2537 Then sender MUST encrypt the packet as has been described in above
2538 sections according whether the packet is normal packet or special
2539 packet. The computed MAC MUST NOT be encrypted.
2543 2.10 Packet Reception
2545 On packet reception the receiver MUST check that all fields in the
2546 SILC Packet Header are valid. It MUST check the flags of the
2547 header and act accordingly. It MUST also check the MAC of the packet
2548 and if it is to be failed the packet MUST be discarded. Also if the
2549 header of the packet includes any bad fields the packet MUST be
2552 See above sections on the decryption process of the received packet.
2554 The receiver MUST also check that the ID's in the header are valid
2555 ID's. Unsupported ID types or malformed ID's MUST cause packet
2556 rejection. The padding on the reception is always ignored.
2558 The receiver MUST also check the packet type and start parsing the
2559 packet according to the type. However, note the above sections on
2560 special packet types and their parsing.
2566 Routers are the primary entities in the SILC network that takes care
2567 of packet routing. However, normal servers routes packets as well, for
2568 example, when they are routing channel message to the local clients.
2569 Routing is quite simple as every packet tells the true origin and the
2570 true destination of the packet.
2572 It is still RECOMMENDED for routers that has several routing connections
2573 to create route cache for those destinations that has faster route than
2574 the router's primary route. This information is available for the router
2575 when other router connects to the router. The connecting party then
2576 sends all of its locally connected clients, servers and channels. These
2577 informations helps to create the route cache. Also, when new channels
2578 are created to a cell its information is broadcasted to all routers
2579 in the network. Channel ID's are based on router's ID thus it is easy
2580 to create route cache based on these informations. If faster route for
2581 destination does not exist in router's route cache the packet MUST be
2582 routed to the primary route (default route).
2584 For server which receives a packet to be routed to its locally connected
2585 client the server MUST check whether the particular packet type is
2586 allowed to be routed to the client. Not all packets may be sent by
2587 some odd entity to client that is indirectly connected to the sender.
2588 See section 2.3 SILC Packet Types and paragraph about indirectly connected
2589 entities and sending packets to them. The section mentions the packets
2590 that may be sent to indirectly connected entities. It is clear that some
2591 server cannot send, for example, disconnect packet to client that is not
2592 directly connected to the server.
2596 2.12 Packet Broadcasting
2598 SILC packets MAY be broadcasted in SILC network. However, only router
2599 server may send or receive broadcast packets. Client and normal server
2600 MUST NOT send broadcast packets and they MUST ignore broadcast packets
2601 if they receive them. Broadcast packets are sent by setting Broadcast
2602 flag to the SILC packet header.
2604 Broadcasting packets means that the packet is sent to all routers in
2605 the SILC network, except to the router that sent the packet. The router
2606 receiving broadcast packet MUST send the packet to its primary route.
2607 The fact that SILC routers may have several router connections can
2608 cause problems, such as race conditions inside the SILC network, if
2609 care is not taken when broadcasting packets. Router MUST NOT send
2610 the broadcast packet to any other route except to its primary route.
2612 If the primary route of the router is the original sender of the packet
2613 the packet MUST NOT be sent to the primary route. This may happen
2614 if router has several router connections and some other router uses
2615 the router as its primary route.
2617 Routers use broadcast packets to broadcast for example information
2618 about newly registered clients, servers, channels etc. so that all the
2619 routers may keep these informations up to date.
2623 3 Security Considerations
2625 Security is central to the design of this protocol, and these security
2626 considerations permeate the specification. Common security considerations
2627 such as keeping private keys truly private and using adequate lengths for
2628 symmetric and asymmetric keys must be followed in order to maintain the
2629 security of this protocol.
2635 [SILC1] Riikonen, P., "Secure Internet Live Conferencing (SILC),
2636 Protocol Specification", Internet Draft, April 2001.
2638 [SILC3] Riikonen, P., "SILC Key Exchange and Authentication
2639 Protocols", Internet Draft, April 2001.
2641 [SILC4] Riikonen, P., "SILC Commands", Internet Draft, April 2001.
2643 [IRC] Oikarinen, J., and Reed D., "Internet Relay Chat Protocol",
2646 [IRC-ARCH] Kalt, C., "Internet Relay Chat: Architecture", RFC 2810,
2649 [IRC-CHAN] Kalt, C., "Internet Relay Chat: Channel Management", RFC
2652 [IRC-CLIENT] Kalt, C., "Internet Relay Chat: Client Protocol", RFC
2655 [IRC-SERVER] Kalt, C., "Internet Relay Chat: Server Protocol", RFC
2658 [SSH-TRANS] Ylonen, T., et al, "SSH Transport Layer Protocol",
2661 [PGP] Callas, J., et al, "OpenPGP Message Format", RFC 2440,
2664 [SPKI] Ellison C., et al, "SPKI Certificate Theory", RFC 2693,
2667 [PKIX-Part1] Housley, R., et al, "Internet X.509 Public Key
2668 Infrastructure, Certificate and CRL Profile", RFC 2459,
2671 [Schneier] Schneier, B., "Applied Cryptography Second Edition",
2672 John Wiley & Sons, New York, NY, 1996.
2674 [Menezes] Menezes, A., et al, "Handbook of Applied Cryptography",
2677 [OAKLEY] Orman, H., "The OAKLEY Key Determination Protocol",
2678 RFC 2412, November 1998.
2680 [ISAKMP] Maughan D., et al, "Internet Security Association and
2681 Key Management Protocol (ISAKMP)", RFC 2408, November
2684 [IKE] Harkins D., and Carrel D., "The Internet Key Exchange
2685 (IKE)", RFC 2409, November 1998.
2687 [HMAC] Krawczyk, H., "HMAC: Keyed-Hashing for Message
2688 Authentication", RFC 2104, February 1997.
2690 [PKCS1] Kalinski, B., and Staddon, J., "PKCS #1 RSA Cryptography
2691 Specifications, Version 2.0", RFC 2437, October 1998.
2693 [RFC2119] Bradner, S., "Key Words for use in RFCs to Indicate
2694 Requirement Levels", BCP 14, RFC 2119, March 1997.
2706 EMail: priikone@poseidon.pspt.fi
2708 This Internet-Draft expires XXX