8 .ds RF FORMFEED[Page %]
17 Network Working Group P. Riikonen
19 draft-riikonen-silc-pp-04.txt XXX
26 <draft-riikonen-silc-pp-04.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 Resume Router Payload .............................. 43
105 2.3.22 File Transfer Payload .............................. 43
106 2.4 SILC ID Types ............................................. 44
107 2.5 Packet Encryption And Decryption .......................... 44
108 2.5.1 Normal Packet Encryption And Decryption ............. 45
109 2.5.2 Channel Message Encryption And Decryption ........... 45
110 2.5.3 Private Message Encryption And Decryption ........... 46
111 2.6 Packet MAC Generation ..................................... 47
112 2.7 Packet Padding Generation ................................. 47
113 2.8 Packet Compression ........................................ 48
114 2.9 Packet Sending ............................................ 48
115 2.10 Packet Reception ......................................... 49
116 2.11 Packet Routing ........................................... 49
117 2.12 Packet Broadcasting ...................................... 50
118 3 Security Considerations ....................................... 50
119 4 References .................................................... 50
120 5 Author's Address .............................................. 52
126 Figure 1: Typical SILC Packet
127 Figure 2: SILC Packet Header
129 Figure 4: Argument Payload
130 Figure 5: Channel Payload
131 Figure 6: Public Key Payload
132 Figure 7: Disconnect Payload
133 Figure 8: Success Payload
134 Figure 9: Failure Payload
135 Figure 10: Reject Payload
136 Figure 11: Notify Payload
137 Figure 12: Error Payload
138 Figure 13: Channel Message Payload
139 Figure 14: Channel Key Payload
140 Figure 15: Private Message Payload
141 Figure 16: Private Message Key Payload
142 Figure 17: Command Payload
143 Figure 18: Connection Auth Request Payload
144 Figure 19: New Client Payload
145 Figure 20: New Server Payload
146 Figure 21: Key Agreement Payload
147 Figure 22: Resume Router Payload
148 Figure 23: File Transfer Payload
154 This document describes a Packet Protocol used in the Secure Internet
155 Live Conferencing (SILC) protocol specified in the Secure Internet Live
156 Conferencing, Protocol Specification Internet Draft [SILC1]. This
157 protocol describes the packet types and packet payloads which defines
158 the contents of the packets. The protocol provides secure binary packet
159 protocol that assures that the contents of the packets are secured and
162 The basis of SILC protocol relies in the SILC packets and it is with
163 out a doubt the most important part of the protocol. It is also probably
164 the most complicated part of the protocol. Packets are used all the
165 time in the SILC network to send messages, commands and other information.
166 All packets in SILC network are always encrypted and their integrity
167 is assured by computed MACs. The protocol defines several packet types
168 and packet payloads. Each packet type usually has a specific packet
169 payload that actually defines the contents of the packet. Each packet
170 also includes a default SILC Packet Header that provides sufficient
171 information about the origin of the packet and destination of the
176 1.1 Requirements Terminology
178 The keywords MUST, MUST NOT, REQUIRED, SHOULD, SHOULD NOT, RECOMMENDED,
179 MAY, and OPTIONAL, when they appear in this document, are to be
180 interpreted as described in [RFC2119].
184 2 SILC Packet Protocol
189 SILC packets deliver messages from sender to receiver securely by
190 encrypting important fields of the packet. The packet consists of
191 default SILC Packet Header, Padding, Packet Payload data, and, packet
194 The following diagram illustrates typical SILC packet.
199 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
200 | n bytes | 1 - n bytes | n bytes | n bytes
201 | SILC Header | Padding | Data Payload | MAC
202 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
206 Figure 1: Typical SILC Packet
209 SILC Header is always the first part of the packet and its purpose
210 is to provide information about the packet. It provides for example
211 the packet type, origin of the packet and the destination of the packet.
212 The header is variable in length and first two (2) bytes of the
213 header (thus first two bytes of the packet) are not encrypted. The
214 first two (2) bytes are the length of the packet which is not encrypted.
215 See the following section for description of SILC Packet header. Packets
216 without SILC header or with malformed SILC header MUST be dropped.
218 Padding follows the packet header. The purpose of the padding is to
219 make the packet multiple by eight (8) or by the block size of the
220 cipher used in the encryption, which ever is larger. The maximum
221 length of padding is currently 16 bytes. The padding is always
224 Data payload area follows padding and it is the actual data of the
225 packet. The packet data is the packet payloads defined in this
226 protocol. The data payload area is always encrypted.
228 The last part of SILC packet is the packet MAC that assures the
229 integrity of the packet. The MAC is always computed from the packet
230 before the encryption is applied to the packet. If compression is used
231 in the packet the MAC is computed after the compression has been
232 applied. The compression, on the other hand, is always applied before
233 encryption. See more details in the section 2.6 Packet MAC Generation.
235 All fields in all packet payloads are always in MSB (most significant
240 2.2 SILC Packet Header
242 The SILC packet header is applied to all SILC packets and it is
243 variable in length. The purpose of SILC Packet header is to provide
244 detailed information about the packet. The receiver of the packet
245 uses the packet header to parse the packet and gain other relevant
246 parameters of the packet.
248 The following diagram represents the SILC packet header. (*) indicates
249 that this field is never encrypted. Other fields are always encrypted.
254 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
255 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
256 | Payload Length * | Flags | Packet Type |
257 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
258 | Source ID Length | Destination ID Length |
259 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
265 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
271 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
275 Figure 2: SILC Packet Header
279 o Payload Length (2 bytes) - Is the length of the packet
280 not including the padding of the packet. This field must
281 not be encrypted but must always be authenticated.
283 o Flags (1 byte) - Indicates flags to be used in packet
284 processing. Several flags may be set by ORing the flags
287 The following flags are reserved for this field:
292 In this case the field is ignored.
295 Private Message Key 0x01
297 Indicates that the packet must include private
298 message that is encrypted using private key set by
299 client. Servers does not know anything about this
300 key and this causes that the private message is
301 not handled by the server at all, it is just
302 passed along. See section 2.5.3 Private Message
303 Encryption And Decryption for more information.
308 Indicates that the packet consists of list of
309 packet payloads indicated by the Packet Type field.
310 The payloads are added one after the other. Note that
311 there are packet types that must not be used as
312 list. Parsing of list packet is done by calculating
313 the length of each payload and parsing them one by
319 Marks the packet to be broadcasted. Client cannot
320 send broadcast packet and normal server cannot send
321 broadcast packet. Only router server may send broadcast
322 packet. The router receiving of packet with this flag
323 set MUST send (broadcast) the packet to its primary
324 route. If router has several router connections the
325 packet may be sent only to the primary route. See
326 section 2.12 Packet Broadcasting for description of
334 o Packet Type (1 byte) - Is the type of the packet. Receiver
335 uses this field to parse the packet. See section 2.3
336 SILC Packets for list of defined packet types.
338 o Source ID Length (2 bytes) - Indicates the length of the
339 Source ID field in the header, not including this or any
342 o Destination ID Length (2 bytes) - Indicates the length of the
343 Destination ID field in the header, not including this or
346 o Src ID Type (1 byte) - Indicates the type of ID in the
347 Source ID field. See section 2.4 SILC ID Types for
350 o Source ID (variable length) - The actual source ID that
351 indicates which is the original sender of the packet.
353 o Dst ID Type (1 byte) - Indicates the type of ID in the
354 Destination ID field. See section 2.4 SILC ID Types for
357 o Destination ID (variable length) - The actual destination
358 ID that indicates which is the end receiver of the packet.
362 2.3 SILC Packet Types
364 SILC packet types defines the contents of the packet and it is used by
365 the receiver to parse the packet. The packet type is 8 bits, as a one
366 byte, in length. The range for the packet types are from 0 - 255,
367 where 0 is never sent and 255 is currently reserved for future
368 extensions and MUST NOT be defined to any other purpose. Every SILC
369 specification compliant implementation SHOULD support all of these packet
372 The below list of the SILC Packet types includes reference to the packet
373 payload as well. Packet payloads are the actual packet, that is, the data
374 that the packet consists of. Each packet type defines packet payload
375 which usually may only be sent with the specific packet type.
377 Most of the packets are packets that must be destined directly to entity
378 that is connected to the sender. It is not allowed, for example, for
379 router to send disconnect packet to client that is not directly connected
380 to the router. However, there are some special packet types that may
381 be destined to some entity that the sender has not direct connection
382 with. These packets are for example private message packets, channel
383 message packets, command packets and some other packets that may be
384 broadcasted in the SILC network. If the packet is allowed to be sent to
385 indirectly connected entity it is mentioned separately in the packet
386 description (unless it is obvious as in private and channel message
387 packets). Other packets MUST NOT be sent or accepted, if sent, to
388 indirectly connected entities.
390 List of SILC Packet types are defined as follows.
395 This type is reserved and it is never sent.
398 1 SILC_PACKET_DISCONNECT
400 This packet is sent to disconnect the remote end. Reason of
401 the disconnection is sent inside the packet payload. Client
402 usually does not send this packet.
404 This packet MUST NOT be sent as list and the List flag MUST
407 Payload of the packet: See section 2.3.3 Disconnect Payload
410 2 SILC_PACKET_SUCCESS
412 This packet is sent upon successful execution of some protocol.
413 The status of the success is sent in the packet.
415 This packet MUST NOT be sent as list and the List flag MUST
418 Payload of the packet: See section 2.3.4 Success Payload
421 3 SILC_PACKET_FAILURE
423 This packet is sent upon failure of some protocol. The status
424 of the failure is sent in the packet.
426 This packet MUST NOT be sent as list and the List flag MUST
429 Payload of the packet: See section 2.3.5 Failure Payload
434 This packet MAY be sent upon rejection of some protocol.
435 The status of the rejection is sent in the packet.
437 This packet MUST NOT be sent as list and the List flag MUST
440 Payload of the packet: See section 2.3.6 Reject Payload
445 This packet is used to send notify message, usually from
446 server to client, although it MAY be sent from server to another
447 server as well. Client MUST NOT send this packet. Server MAY
448 send this packet to channel as well when the packet is
449 distributed to all clients on the channel.
451 Payload of the packet: See section 2.3.7 Notify Payload.
456 This packet is sent when an error occurs. Server MAY
457 send this packet. Client MUST NOT send this packet. The
458 client MAY entirely ignore the packet, however, server is
459 most likely to take action anyway. This packet MAY be sent
460 to entity that is indirectly connected to the sender.
462 This packet MUST NOT be sent as list and the List flag MUST
465 Payload of the packet: See section 2.3.8 Error Payload.
468 7 SILC_PACKET_CHANNEL_MESSAGE
470 This packet is used to send messages to channels. The packet
471 includes Channel ID of the channel and the actual message to
472 the channel. Messages sent to the channel are always protected
473 by channel specific keys. Channel Keys are distributed by
474 SILC_PACKET_CHANNEL_KEY packet.
476 This packet MUST NOT be sent as list and the List flag MUST
479 Payload of the packet: See section 2.3.9 Channel Message
483 8 SILC_PACKET_CHANNEL_KEY
485 This packet is used to distribute new key for particular
486 channel. Each channel has their own independent keys that
487 is used to protect the traffic on the channel. Only server
488 may send this packet. This packet MAY be sent to entity
489 that is indirectly connected to the sender.
491 This packet MUST NOT be sent as list and the List flag MUST
494 Payload of the packet: See section 2.3.10 Channel Key Payload
497 9 SILC_PACKET_PRIVATE_MESSAGE
499 This packet is used to send private messages from client
500 to another client. By default, private messages are protected
501 by session keys established by normal key exchange protocol.
502 However, it is possible to use specific key to protect private
503 messages. SILC_PACKET_PRIVATE_MESSAGE_KEY packet is used to
504 agree the key with the remote client. Pre-shared key MAY be
505 used as well if both of the client knows it, however, it needs
506 to be agreed outside SILC. See more of this in [SILC1].
508 This packet MUST NOT be sent as list and the List flag MUST
511 Payload of the packet: See section 2.3.11 Private Message
515 10 SILC_PACKET_PRIVATE_MESSAGE_KEY
517 This packet is used to agree about a key to be used to protect
518 the private messages between two clients. If this is not sent
519 the normal session key is used to protect the private messages
520 inside SILC network. Agreeing to use specific key to protect
521 private messages adds security, as no server between the two
522 clients will be able to decrypt the private message. However,
523 servers inside SILC network are considered to be trusted, thus
524 using normal session key to protect private messages does not
525 degrade security. Whether to agree to use specific keys by
526 default or to use normal session keys by default, is
527 implementation specific issue. See more of this in [SILC1].
529 This packet MUST NOT be sent as list and the List flag MUST
532 Payload of the packet: See section 2.3.12 Private Message
536 11 SILC_PACKET_COMMAND
538 This packet is used to send commands from client to server.
539 Server MAY send this packet to other servers as well. All
540 commands are listed in their own section SILC Command Types
541 in [SILC4]. The contents of this packet is command specific.
542 This packet MAY be sent to entity that is indirectly connected
545 This packet MUST NOT be sent as list and the List flag MUST
548 Payload of the packet: See section 2.3.13 Command Payload
551 12 SILC_PACKET_COMMAND_REPLY
553 This packet is sent as reply to the SILC_PACKET_COMMAND packet.
554 The contents of this packet is command specific. This packet
555 MAY be sent to entity that is indirectly connected to the
558 This packet MUST NOT be sent as list and the List flag MUST
561 Payload of the packet: See section 2.3.14 Command Reply
562 Payload and section 2.3.13 Command
566 13 SILC_PACKET_KEY_EXCHANGE
568 This packet is used to start SILC Key Exchange Protocol,
569 described in detail in [SILC3].
571 This packet MUST NOT be sent as list and the List flag MUST
574 Payload of the packet: Payload of this packet is described
575 in the section SILC Key Exchange
576 Protocol and its sub sections in
580 14 SILC_PACKET_KEY_EXCHANGE_1
582 This packet is used as part of the SILC Key Exchange Protocol.
584 This packet MUST NOT be sent as list and the List flag MUST
587 Payload of the packet: Payload of this packet is described
588 in the section SILC Key Exchange
589 Protocol and its sub sections in
593 15 SILC_PACKET_KEY_EXCHANGE_2
595 This packet is used as part of the SILC Key Exchange Protocol.
597 This packet MUST NOT be sent as list and the List flag MUST
600 Payload of the packet: Payload of this packet is described
601 in the section SILC Key Exchange
602 Protocol and its sub sections in
606 16 SILC_PACKET_CONNECTION_AUTH_REQUEST
608 This packet is used to request the authentication method to
609 be used in the SILC Connection Authentication Protocol. If
610 initiator of the protocol does not know the mandatory
611 authentication method this packet MAY be used to determine it.
613 The party receiving this payload MUST respond with the same
614 packet including the mandatory authentication method.
616 This packet MUST NOT be sent as list and the List flag MUST
619 Payload of the packet: See section 2.3.15 Connection Auth
625 17 SILC_PACKET_CONNECTION_AUTH
627 This packet is used to start and perform the SILC Connection
628 Authentication Protocol. This protocol is used to authenticate
629 the connecting party. The protocol is described in detail in
632 This packet MUST NOT be sent as list and the List flag MUST
635 Payload of the packet: Payload of this packet is described
636 in the section SILC Authentication
637 Protocol and it sub sections in [SILC].
640 18 SILC_PACKET_NEW_ID
642 This packet is used to distribute new ID's from server to
643 router and from router to all routers in the SILC network.
644 This is used when for example new client is registered to
645 SILC network. The newly created ID's of these operations are
646 distributed by this packet. Only server may send this packet,
647 however, client MUST be able to receive this packet. This
648 packet MAY be sent to entity that is indirectly connected
651 Payload of the packet: See section 2.3.16 New ID Payload
654 19 SILC_PACKET_NEW_CLIENT
656 This packet is used by client to register itself to the
657 SILC network. This is sent after key exchange and
658 authentication protocols has been completed. Client sends
659 various information about itself in this packet.
661 This packet MUST NOT be sent as list and the List flag MUST
664 Payload of the packet: See section 2.3.17 New Client Payload
667 20 SILC_PACKET_NEW_SERVER
669 This packet is used by server to register itself to the
670 SILC network. This is sent after key exchange and
671 authentication protocols has been completed. Server sends
672 this to the router it connected to, or, if router was
673 connecting, to the connected router. Server sends its
674 Server ID and other information in this packet. The client
675 MUST NOT send or receive this packet.
677 This packet MUST NOT be sent as list and the List flag MUST
680 Payload of the packet: See section 2.3.18 New Server Payload
683 21 SILC_PACKET_NEW_CHANNEL
685 This packet is used to notify routers about newly created
686 channel. Channels are always created by the router and it MUST
687 notify other routers about the created channel. Router sends
688 this packet to its primary route. Client MUST NOT send this
689 packet. This packet MAY be sent to entity that is indirectly
690 connected to the sender.
692 Payload of the packet: See section 2.3.19 New Channel Payload
697 This packet is used to indicate that re-key must be performed
698 for session keys. See section Session Key Regeneration in
699 [SILC1] for more information. This packet does not have
702 This packet MUST NOT be sent as list and the List flag MUST
706 23 SILC_PACKET_REKEY_DONE
708 This packet is used to indicate that re-key is performed and
709 new keys must be used hereafter.
711 This packet MUST NOT be sent as list and the List flag MUST
715 24 SILC_PACKET_HEARTBEAT
717 This packet is used by clients, servers and routers to keep the
718 connection alive. It is recommended that all servers implement
719 keepalive actions and perform it to both direction in a link.
720 This packet does not have a payload.
722 This packet MUST NOT be sent as list and the List flag MUST
726 25 SILC_PACKET_KEY_AGREEMENT
728 This packet is used by clients to request key negotiation
729 between another client in the SILC network. If the negotiation
730 is started it is performed using the SKE protocol. The result of
731 the negotiation, the secret key material, can be used for
732 example as private message key. The server and router MUST NOT
735 This packet MUST NOT be sent as list and the List flag MUST
738 Payload of the packet: See section 2.3.20 Key Agreement Payload
741 26 SILC_PACKET_RESUME_ROUTER
743 This packet is used during backup router protocol when the
744 original primary router of the cell comes back online and wishes
745 to resume the position as being the primary router of the cell.
747 Payload of the packet: See section 2.3.21 Resume Router Payload
752 This packet is used to perform an file transfer protocol in the
753 SILC session with some entity in the network. The packet is
754 multi purpose. The packet is used to tell other entity in the
755 network that the sender wishes to perform an file transfer
756 protocol. The packet is also used to actually tunnel the
757 file transfer protocol stream. The file transfer protocol
758 stream is always protected with the SILC packet.
760 This packet MUST NOT be sent as list and the List flag MUST
763 Payload of the packet: See section 2.3.22 File Transfer Payload
768 Currently undefined commands.
773 These packet types are reserved for private use and they will
774 not be defined by this document.
781 This type is reserved for future extensions and currently it
787 2.3.1 SILC Packet Payloads
789 All payloads resides in the main data area of the SILC packet. However
790 all payloads MUST be at the start of the data area after the SILC
791 packet header and padding. All fields in the packet payload are always
792 encrypted, as they reside in the data area of the packet which is
795 Payloads described in this section are common payloads that MUST be
796 accepted anytime during SILC session. Most of the payloads may only
797 be sent with specific packet type which is defined in the description
800 There are a lot of other payloads in the SILC as well. However, they
801 are not common in the sense that they could be sent at any time.
802 These payloads are not described in this section. These are payloads
803 such as SILC Key Exchange payloads and so on. These are described
804 in [SILC1], [SILC3] and [SILC4].
808 2.3.2 Generic payloads
810 This section describes generic payloads that are not associated to any
811 specific packet type. They can be used for example inside some other
818 This payload can be used to send an ID. ID's are variable in length
819 thus this payload provides a way to send variable length ID's.
832 The following diagram represents the ID Payload.
837 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
838 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
839 | ID Type | ID Length |
840 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
844 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
852 o ID Type (2 bytes) - Indicates the type of the ID. See
853 section 2.4 SILC ID Types for list of defined ID types.
855 o ID Length (2 bytes) - Length of the ID Data area not
856 including the length of any other fields in the payload.
858 o ID Data (variable length) - The actual ID data.
863 2.3.2.2 Argument Payload
865 Argument Payload is used to set arguments for any packet payload that
866 needs and supports arguments, such as commands. Number of arguments
867 associated with a packet MUST be indicated by the packet payload which
868 needs the arguments. Argument Payloads MUST always reside right after
869 the packet payload needing the arguments. Incorrect amount of argument
870 payloads MUST cause rejection of the packet.
872 The following diagram represents the Argument Payload.
877 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
878 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
879 | Payload Length | Argument Type | |
880 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
884 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
888 Figure 4: Argument Payload
892 o Payload Length (2 bytes) - Length of the argument payload data
893 area not including the length of any other fields in the
896 o Argument Type (1 byte) - Indicates the type of the argument.
897 Every argument may have a specific type that MUST be defined
898 by the packet payload needing the argument. For example
899 every command specify a number for each argument that maybe
900 associated with the command. By using this number the receiver
901 of the packet knows what type of argument this is. If there is
902 no specific argument type this field is set to zero (0).
904 o Argument Data (variable length) - Argument data.
909 2.3.2.3 Channel Payload
911 Generic Channel Payload may be used to send information about channel,
912 its name, the Channel ID and a mode.
914 The following diagram represents the Channel Payload.
920 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
921 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
922 | Channel Name Length | |
923 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
927 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
928 | Channel ID Length | |
929 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
933 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
935 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
939 Figure 5: New Channel Payload
943 o Channel Name Length (2 bytes) - Length of the channel name
946 o Channel Name (variable length) - The name of the channel.
948 o Channel ID Length (2 bytes) - Length of the Channel ID field.
950 o Channel ID (variable length) - The Channel ID.
952 o Mode Mask (4 bytes) - A mode. This can be the mode of the
953 channel but it can also be the mode of the client on the
954 channel. The contents of this field is dependent of the
955 usage of this payload. The usage is defined separately
956 when this payload is used. This is a 32 bit MSB first value.
961 2.3.2.4 Public Key Payload
963 Generic Public Key Payload may be used to send different types of
964 public keys and certificates.
966 The following diagram represents the Public Key Payload.
972 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
973 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
974 | Public Key Length | Public Key Type |
975 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
977 ~ Public Key of the party (or certificate) ~
979 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
983 Figure 6: Public Key Payload
987 o Public Key Length (2 bytes) - The length of the Public Key
988 (or certificate) field, not including any other field.
990 o Public Key Type (2 bytes) - The public key (or certificate)
991 type. This field indicates the type of the public key in
992 the packet. See the [SILC3] for defined public key types.
994 o Public Key (or certificate) (variable length) - The
995 public key or certificate.
1000 2.3.3 Disconnect Payload
1002 Disconnect payload is sent upon disconnection. The payload is simple;
1003 reason of disconnection is sent to the disconnected party.
1005 The payload may only be sent with SILC_PACKET_DISCONNECT packet. It
1006 MUST NOT be sent in any other packet type. The following diagram
1007 represents the Disconnect Payload.
1013 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
1014 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1016 ~ Disconnect Message ~
1018 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1022 Figure 7: Disconnect Payload
1028 o Disconnect Message (variable length) - Human readable
1029 reason of the disconnection.
1034 2.3.4 Success Payload
1036 Success payload is sent when some protocol execution is successfully
1037 completed. The payload is simple; indication of the success is sent.
1038 This may be any data, including binary or human readable data.
1043 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
1044 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1046 ~ Success Indication ~
1048 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1052 Figure 8: Success Payload
1056 o Success Indication (variable length) - Indication of
1057 the success. This may be for example some flag that
1058 indicates the protocol and the success status or human
1059 readable success message. The true length of this
1060 payload is available by calculating it from the SILC
1067 2.3.5 Failure Payload
1069 This is opposite of Success Payload. Indication of failure of
1070 some protocol is sent in the payload.
1076 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
1077 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1079 ~ Failure Indication ~
1081 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1085 Figure 9: Failure Payload
1089 o Failure Indication (variable length) - Indication of
1090 the failure. This may be for example some flag that
1091 indicates the protocol and the failure status or human
1092 readable failure message. The true length of this
1093 payload is available by calculating it from the SILC
1099 2.3.6 Reject Payload
1101 This payload is sent when some protocol is rejected to be executed.
1102 Other operations MAY send this as well that was rejected. The
1103 indication of the rejection is sent in the payload. The indication
1104 may be binary or human readable data.
1110 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
1111 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1113 ~ Reject Indication ~
1115 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1119 Figure 10: Reject Payload
1123 o Reject Indication (variable length) - Indication of
1124 the rejection. This maybe for example some flag that
1125 indicates the protocol and the rejection status or human
1126 readable rejection message. The true length of this
1127 payload is available by calculating it from the SILC
1133 2.3.7 Notify Payload
1135 Notify payload is used to send notify messages. The payload is usually
1136 sent from server to client, however, server MAY send it to another
1137 server as well. This payload MAY also be sent to a channel. Client
1138 MUST NOT send this payload. The receiver of this payload MAY ignore
1139 the contents of the payload, however, notify message SHOULD be audited.
1141 The payload may only be sent with SILC_PACKET_NOTIFY packet. It MUST
1142 not be sent in any other packet type. The following diagram represents
1148 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
1149 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1150 | Notify Type | Payload Length |
1151 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1157 Figure 11: Notify Payload
1161 o Notify Type (2 bytes) - Indicates the type of the notify
1164 o Payload Length (2 bytes) - Length of the entire Notify Payload
1165 including any associated Argument Payloads.
1167 o Argument Nums (2 bytes) - Indicates the number of Argument
1168 Payloads associated to this payload. Notify types may define
1169 arguments to be send along the notify message.
1172 The following list of currently defined notify types. The format for
1173 notify arguments is same as in SILC commands described in [SILC4].
1174 Also, all ID's sent in arguments are sent inside ID Payload.
1177 0 SILC_NOTIFY_TYPE_NONE
1179 If no specific notify type apply for the notify message this type
1183 Arguments: (1) <message>
1185 The <message> is implementation specific free text string.
1186 Receiver MAY ignore this message.
1189 1 SILC_NOTIFY_TYPE_INVITE
1191 Sent when an client is invited to a channel. This is also sent
1192 when the invite list of the channel is changed. This notify type
1193 is sent between routers and if an client was invited, to the
1194 client as well. In this case the packet is destined to the client.
1197 Arguments: (1) <Channel ID> (2) <channel name>
1198 (3) [<sender Client ID>] (4) [<adding client>]
1199 (5) [<removing client>]
1201 The <Channel ID> is the channel. The <channel name> is the name
1202 of the channel and is provided because the client which receives
1203 this notify packet may not have a way to resolve the name of the
1204 channel from the <Channel ID>. The <sender Client ID> is the
1205 Client ID which invited the client to the channel. The <adding
1206 client> and the <removing client> indicates the added or removed
1207 client from the channel's invite list. The format of the <adding
1208 client> and the <removing client> is defined in the [SILC4] with
1209 SILC_COMMAND_INVITE command.
1211 The <adding client> and <removing client> MUST NOT be sent when
1212 the packet is destined to a client.
1215 2 SILC_NOTIFY_TYPE_JOIN
1217 Sent when client has joined to a channel. The server MUST
1218 distribute this type only to the local clients on the channel
1219 and then send it to its primary router. The router or server
1220 receiving the packet distributes this type to the local clients
1221 on the channel and broadcast it to the network.
1224 Arguments: (1) [<Client ID>] (2) <Channel ID>
1226 The <Client ID> is the client that joined to the channel indicated
1227 by the <Channel ID>.
1230 3 SILC_NOTIFY_TYPE_LEAVE
1232 Sent when client has left a channel. The server must distribute
1233 this type only to the local clients on the channel and then send
1234 it to its primary router. The router or server receiving the
1235 packet distributes this type to the local clients on the channel
1236 and broadcast it to the network.
1239 Arguments: (1) <Client ID>
1241 The <Client ID> is the client which left the channel.
1244 4 SILC_NOTIFY_TYPE_SIGNOFF
1246 Sent when client signoff from SILC network. The server MUST
1247 distribute this type only to the local clients on the channel and
1248 then send it to its primary router. The router or server receiving
1249 the packet distributes this type to the local clients on the
1250 channel and broadcast it to the network.
1253 Arguments: (1) <Client ID> (2) <message>
1255 The <Client ID> is the client which left SILC network. The
1256 <message> is free text string indicating the reason of the signoff.
1259 5 SILC_NOTIFY_TYPE_TOPIC_SET
1261 Sent when topic is set/changed on a channel. This type must be
1262 sent only to the clients which is joined on the channel which
1263 topic was set or changed.
1266 Arguments: (1) <Client ID> (2) <topic>
1268 The <Client ID> is the client which set or changed the <topic>.
1271 6 SILC_NOTIFY_TYPE_NICK_CHANGE
1273 Sent when client changes nick on a channel. The server MUST
1274 distribute this type only to the local clients on the channel
1275 and then send it to its primary router. The router or server
1276 receiving the packet distributes this type to the local clients
1277 on the channel and broadcast it to the network.
1280 Arguments: (1) <Old Client ID> (2) <New Client ID>
1282 The <Old Client ID> is the old ID of the client which changed
1283 the nickname. The <New Client ID> is the new ID generated by
1284 the change of the nickname.
1287 7 SILC_NOTIFY_TYPE_CMODE_CHANGE
1289 Sent when channel mode has changed. This type MUST be sent only
1290 to the clients which is joined on the channel which mode was
1294 Arguments: (1) <ID Payload> (2) <mode mask>
1295 (3) [<cipher>] (4) <[hmac>]
1297 The <ID Payload> is the ID (usually Client ID but it can be
1298 Server ID as well when the router is enforcing channel mode
1299 change) of the entity which changed the mode. The <mode mask>
1300 is the new mode mask of the channel. The client can safely
1301 ignore the <cipher> argument since the SILC_PACKET_CHANNEL_KEY
1302 packet will force the new channel key change anyway. The <hmac>
1303 argument is important since the client is responsible of setting
1304 the new HMAC and the hmac key into use.
1307 8 SILC_NOTIFY_TYPE_CUMODE_CHANGE
1309 Sent when user mode on channel has changed. This type MUST be
1310 sent only to the clients which is joined on the channel where
1311 the target client is on.
1314 Arguments: (1) <ID Payload> (2) <mode mask>
1315 (3) <Target Client ID>
1317 The <ID Payload> is the ID (usually Client ID but it can be
1318 Server ID as well when the router is enforcing user's mode
1319 change) of the entity which changed the mode. The <mode mask>
1320 is the new mode mask of the channel. The <Target Client ID>
1321 is the client which mode was changed.
1324 9 SILC_NOTIFY_TYPE_MOTD
1326 Sent when Message of the Day (motd) is sent to a client.
1329 Arguments: (1) <motd>
1331 The <motd> is the Message of the Day.
1334 10 SILC_NOTIFY_TYPE_CHANNEL_CHANGE
1336 Sent when channel's ID has changed for a reason or another.
1337 This is sent by normal server to the client. This can also be
1338 sent by router to other server to force the Channel ID change.
1339 The Channel ID MUST be changed to use the new one. When sent
1340 to clients, this type MUST be sent only to the clients which is
1341 joined on the channel.
1344 Arguments: (1) <Old Channel ID> (2) <New Channel ID>
1346 The <Old Channel ID> is the channel's old ID and the <New
1347 Channel ID> is the new one that MUST replace the old one.
1350 11 SILC_NOTIFY_TYPE_SERVER_SIGNOFF
1352 Sent when server quits SILC network. Those clients from this
1353 server that are on channels must be removed from the channel.
1356 Arguments: (1) <Server ID> (n) [<Client ID> [...]
1358 The <Server ID> is the server's ID. The rest of the arguments
1359 are the Client ID's of the client's which are coming from this
1360 server and are thus quitting the SILC network also. If the
1361 maximum number of arguments are reached another
1362 SILC_NOTIFY_TYPE_SERVER_SIGNOFF notify packet MUST be sent.
1363 When this notify packet is sent between routers the Client ID's
1367 12 SILC_NOTIFY_TYPE_KICKED
1369 Sent when a client has been kicked from a channel. This is
1370 sent also to the client which was kicked from the channel.
1371 The client which was kicked from the channel MUST be removed
1372 from the channel. This notify type is always destined to the
1373 channel. The router or server receiving the packet distributes
1374 this type to the local clients on the channel and broadcast it
1378 Arguments: (1) <Client ID> (2) [<comment>]
1380 The <Client ID> is the client which was kicked from the channel.
1381 The kicker may have set the <comment> to indicate the reason for
1385 13 SILC_NOTIFY_TYPE_KILLED
1387 Sent when a client has been killed from the network. This is sent
1388 also to the client which was killed from the network. The client
1389 which was killed from the network MUST be removed from the network.
1390 This notify type is destined directly to the client which was
1391 killed and to channel if the client is on any channel. The router
1392 or server receiving the packet distributes this type to the local
1393 clients on the channel and broadcast it to the network.
1396 Arguments: (1) <Client ID> (2) [<comment>]
1398 The <Client ID> is the client which was killed from the network.
1399 The killer may have set the <comment> to indicate the reason for
1403 14 SILC_NOTIFY_TYPE_UMODE_CHANGE
1405 Sent when user's mode in the SILC changes. This type is sent
1406 only between routers as broadcast packet.
1409 Arguments: (1) <Client ID> (2) <mode mask>
1411 The <Client ID> is the client which mode was changed. The
1412 <mode mask> is the new mode mask.
1415 15 SILC_NOTIFY_TYPE_BAN
1417 Sent when the ban list of the channel is changed. This type is
1418 sent only between routers as broadcast packet.
1421 Arguments: (1) <Channel ID> (2) [<adding client>]
1422 (3) [<removing client>]
1424 The <Channel ID> is the channel which ban list was changed. The
1425 <adding client> is used to indicate that a ban was added and the
1426 <removing client> is used to indicate that a ban was removed from
1427 the ban list. The format of the <adding client> and the
1428 <removing client> is defined in the [SILC4] with SILC_COMMAND_BAN
1433 Notify types starting from 16384 are reserved for private notify
1440 Error payload is sent upon error. Error may occur in various
1441 conditions when server sends this packet. Client MUST NOT send this
1442 payload but MUST be able to accept it. However, client MAY
1443 totally ignore the contents of the packet as server is going to
1444 take action on the error anyway. However, it is recommended
1445 that the client takes error packet seriously.
1451 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
1452 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1456 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1460 Figure 12: Error Payload
1464 o Error Message (variable length) - Human readable error
1470 2.3.9 Channel Message Payload
1472 Channel messages are the most common messages sent in the SILC.
1473 Channel Message Payload is used to send message to channels. These
1474 messages can only be sent if client has joined to some channel.
1475 Even though this packet is the most common in SILC it is still
1476 special packet. Some special handling on sending and reception
1477 of channel message is required.
1479 Padding MUST be applied into this payload since the payload is
1480 encrypted separately from other parts of the packet with the
1481 channel specific key. Hence the requirement of the padding.
1482 The padding SHOULD be random data. The packet MUST be made
1483 multiple by eight (8) or by the block size of the cipher, which
1486 The SILC header in this packet is encrypted with the session key
1487 of the next receiver of the packet. Nothing else is encrypted
1488 with that key. Thus, the actual packet and padding to be
1489 encrypted with the session key is SILC Header plus padding to it
1490 to make it multiple by eight (8) or multiple by the block size
1491 of the cipher, which ever is larger.
1493 Receiver of the the channel message packet is able to determine
1494 the channel the message is destined to by checking the destination
1495 ID from the SILC Packet header which tells the destination channel.
1496 The original sender of the packet is also determined by checking
1497 the source ID from the header which tells the client which sent
1500 The payload may only be sent with SILC_PACKET_CHANNEL_MESSAGE packet.
1501 It MUST NOT be sent in any other packet type. The following diagram
1502 represents the Channel Message Payload.
1504 (*) indicates that the field is not encrypted.
1510 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
1511 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1512 | Flags | Message Length |
1513 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1517 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1518 | Padding Length | |
1519 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1523 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1527 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1529 ~ Initial Vector * ~
1531 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1535 Figure 13: Channel Message Payload
1539 o Flags (2 bytes) - Includes the flags of the channel
1540 messages. The flags can indicate a reason or purpose
1541 for the channel message. Note that the Private Message
1542 Payload use these same flags for the same purpose. The
1543 following flags are defined:
1545 0x0000 SILC_MESSAGE_FLAG_NONE
1547 No specific flags set.
1549 0x0001 SILC_MESSAGE_FLAG_AUTOREPLY
1551 This message is an automatic reply to an earlier
1554 0x0002 SILC_MESSAGE_FLAG_NOREPLY
1556 There should not be reply messages to this
1559 0x0004 SILC_MESSAGE_FLAG_ACTION
1561 The sender is performing an action and the message
1562 is the indication of the action.
1564 0x0008 SILC_MESSAGE_FLAG_NOTICE
1566 The message is for example an informational notice
1569 0x0010 SILC_MESSAGE_FLAG_REQUEST
1571 This is a generic request flag to send request
1572 messages. A separate document should define any
1573 payloads associated to this flag.
1575 0x0020 SILC_MESSAGE_FLAG_SIGNED
1577 This flag indicates that the message is signed
1578 with sender's private key and thus can be verified
1579 by the receiver using the sender's public key. A
1580 separate document should define the detailed procedure
1581 of the signing process and any associated payloads
1584 0x0040 - 0x0200 RESERVED
1586 Reserved for future flags
1588 0x0400 - 0x8000 PRIVATE RANGE
1590 Private range for free use.
1592 o Message Length (2 bytes) - Indicates the length of the
1593 the Message Data field in the payload, not including any
1596 o Message Data (variable length) - The actual message to
1599 o Padding Length (2 bytes) - Indicates the length of the
1600 Padding field in the payload, not including any other
1603 o Padding (variable length) - The padding that MUST be
1604 applied because this payload is encrypted separately from
1605 other parts of the packet.
1607 o MAC (variable length) - The MAC computed from the
1608 Message Length, Message Data, Padding Length and Padding
1609 fields. This protects the integrity of the plaintext
1610 channel message. The receiver can verify from the MAC
1611 whether the message decrypted correctly. Also, if more than
1612 one private key has been set for the channel, the receiver
1613 can verify which of the keys decrypted the message
1614 correctly. Note that, this field is encrypted and MUST
1615 be added to the padding calculation.
1617 o Initial Vector (variable length) - The initial vector
1618 that has been used in packet encryption. It needs to be
1619 used in the packet decryption as well. What this field
1620 includes is implementation issue. However, it is
1621 RECOMMENDED that it would be random data or, perhaps,
1622 a timestamp. It is NOT RECOMMENDED to use zero (0) as an
1623 initial vector. This field is not encrypted. This field
1624 is not included into the padding calculation. Length
1625 of this field equals the cipher's block size. This field
1626 is, however, authenticated.
1631 2.3.10 Channel Key Payload
1633 All traffic in channels are protected by channel specific keys.
1634 Channel Key Payload is used to distribute channel keys to all
1635 clients on the particular channel. Channel keys are sent when
1636 the channel is created, when new user joins to the channel and
1637 whenever a user has left a channel. Server creates the new
1638 channel key and distributes it to the clients by encrypting this
1639 payload with the session key shared between the server and
1640 the client. After that, client starts using the key received
1641 in this payload to protect the traffic on the channel.
1643 The client which is joining to the channel receives its key in the
1644 SILC_COMMAND_JOIN command reply message thus it is not necessary to
1645 send this payload to the entity which sent the SILC_COMMAND_JOIN
1648 Channel keys are cell specific thus every router in the cell have
1649 to create a channel key and distribute it if any client in the
1650 cell has joined to a channel. Channel traffic between cell's
1651 are not encrypted using channel keys, they are encrypted using
1652 normal session keys between two routers. Inside a cell, all
1653 channel traffic is encrypted with the specified channel key.
1654 Channel key should expire periodically, say, in one hour, in
1655 which case new channel key is created and distributed.
1657 The payload may only be sent with SILC_PACKET_CHANNEL_KEY packet.
1658 It MUST NOT be sent in any other packet type. The following diagram
1659 represents the Channel Key Payload.
1665 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
1666 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1667 | Channel ID Length | |
1668 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1672 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1673 | Cipher Name Length | |
1674 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1678 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1679 | Channel Key Length | |
1680 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1684 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1688 Figure 14: Channel Key Payload
1693 o Channel ID Length (2 bytes) - Indicates the length of the
1694 Channel ID field in the payload, not including any other
1697 o Channel ID (variable length) - The Channel ID of the
1698 channel this key is meant for.
1700 o Cipher Name Length (2 bytes) - Indicates the length of the
1701 Cipher name field in the payload, not including any other
1704 o Cipher Name (variable length) - Name of the cipher used
1705 in the protection of channel traffic. This name is
1706 initially decided by the creator of the channel but it
1707 MAY change during the life time of the channel as well.
1709 o Channel Key Length (2 bytes) - Indicates the length of the
1710 Channel Key field in the payload, not including any other
1713 o Channel Key (variable length) - The actual channel key
1719 2.3.11 Private Message Payload
1721 Private Message Payload is used to send private message between
1722 two clients (or users for that matter). The messages are sent only
1723 to the specified user and no other user inside SILC network is
1724 able to see the message. The message is protected by the session
1725 key established by the SILC Key Exchange Protocol. However,
1726 it is also possible to agree to use a private key to protect
1727 just the private messages. See section 2.3.11 Private Message
1728 Key Payload for detailed description of how to agree to use
1731 If normal session key is used to protect the message, every server
1732 between the sender client and the receiving client MUST decrypt the
1733 packet and always re-encrypt it with the session key of the next
1734 receiver of the packet. See section Client To Client in [SILC1].
1736 When private key is used to protect the message, servers between
1737 the sender and the receiver needs not to decrypt/re-encrypt the
1738 packet. Section Client To Client in [SILC1] gives example of this
1741 The payload may only be sent with SILC_PACKET_PRIVATE_MESSAGE
1742 packet. It MUST NOT be sent in any other packet type. The following
1743 diagram represents the Private Message Payload.
1749 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
1750 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1751 | Flags | Message Data Length |
1752 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1756 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1760 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1764 Figure 15: Private Message Payload
1768 o Flags (2 bytes) - This field includes the flags of the
1769 private message. They can indicate a different reason or
1770 purpose for the private message. See the section 2.3.9
1771 Channel Message Payload for defined flags. Note that
1772 the Channel Message Payload use the same flags for the
1775 o Message Data Length (2 bytes) - Indicates the length of the
1776 Message Data field, not includes any other field.
1778 o Message Data (variable length) - The actual message to
1779 the client. Rest of the packet is reserved for the message
1782 o Padding (variable length) - This field is present only
1783 when the private message payload is encrypted with private
1784 message key. In this case the padding is applied to make
1785 the payload multiple by eight (8), or by the block size of
1786 the cipher, which ever is larger. When encrypted with
1787 normal session keys, this field MUST NOT be included.
1792 2.3.12 Private Message Key Payload
1794 This payload is used to send key from client to another client that
1795 is going to be used to protect the private messages between these
1796 two clients. If this payload is not sent normal session key
1797 established by the SILC Key Exchange Protocol is used to protect
1798 the private messages.
1800 This payload may only be sent by client to another client. Server
1801 MUST NOT send this payload at any time. After sending this payload
1802 the sender of private messages must set the Private Message Key
1803 flag into SILC Packet Header.
1805 The payload may only be sent with SILC_PACKET_PRIVATE_MESSAGE_KEY
1806 packet. It MUST NOT be sent in any other packet type. The following
1807 diagram represents the Private Message Key Payload.
1813 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
1814 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1815 | Private Message Key Length | |
1816 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1818 ~ Private Message Key ~
1820 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1821 | Cipher Name Length | |
1822 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1826 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1830 Figure 16: Private Message Key Payload
1836 o Private Message Key Length (2 bytes) - Indicates the length
1837 of the Private Message Key field in the payload, not including
1840 o Private Message Key (variable length) - The actual private
1841 message key material.
1843 o Cipher Name Length (2 bytes) - Indicates the length of the
1844 Cipher Name field in the payload, not including any other
1847 o Cipher Name (variable length) - Name of the cipher to use
1848 in the private message encryption. If this field does not
1849 exist then the default cipher of the SILC protocol is used.
1850 See the [SILC1] for defined ciphers.
1856 2.3.13 Command Payload
1858 Command Payload is used to send SILC commands from client to server.
1859 Also server MAY send commands to other servers. The following diagram
1860 represents the Command Payload.
1866 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
1867 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1868 | Payload Length | SILC Command | Arguments Num |
1869 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1870 | Command Identifier |
1871 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1875 Figure 17: Command Payload
1879 o Payload Length (2 bytes) - Length of the entire command
1880 payload including any command argument payloads associated
1883 o SILC Command (1 byte) - Indicates the SILC command. This MUST
1884 be set to non-zero value. If zero (0) value is found in this
1885 field the packet MUST be discarded.
1887 o Arguments Num (1 byte) - Indicates the number of arguments
1888 associated with the command. If there are no arguments this
1889 field is set to zero (0). The arguments MUST follow the
1890 command payload. See section 2.3.2.2 for definition of the
1893 o Command Identifier (2 bytes) - Identifies this command at the
1894 sender's end. The entity which replies to this command MUST
1895 set the value found from this field into the Command Payload
1896 used to send the reply to the sender. This way the sender
1897 can identify which command reply belongs to which originally
1898 sent command. What this field includes is implementation
1899 issue but it is RECOMMENDED that wrapping counter value is
1900 used in the field. Value zero (0) in this field means that
1901 no specific value is set.
1904 See [SILC4] for detailed description of different SILC commands,
1905 their arguments and their reply messages.
1911 2.3.14 Command Reply Payload
1913 Command Reply Payload is used to send replies to the commands. The
1914 Command Reply Payload is identical to the Command Payload thus see
1915 the upper section for the Command Payload specification.
1917 The entity which sends the reply packet MUST set the Command Identifier
1918 field in the reply packet's Command Payload to the value it received
1919 in the original command packet.
1921 See SILC Commands in [SILC4] for detailed description of different
1922 SILC commands, their arguments and their reply messages.
1926 2.3.15 Connection Auth Request Payload
1928 Client MAY send this payload to server to request the authentication
1929 method that must be used in authentication protocol. If client knows
1930 this information beforehand this payload is not necessary to be sent.
1931 Server performing authentication with another server MAY also send
1932 this payload to request the authentication method. If the connecting
1933 server already knows this information this payload is not necessary
1936 Server receiving this request MUST reply with same payload sending
1937 the mandatory authentication method. Algorithms that may be required
1938 to be used by the authentication method are the ones already
1939 established by the SILC Key Exchange protocol. See section Key
1940 Exchange Start Payload in [SILC3] for detailed information.
1942 The payload may only be sent with SILC_PACKET_CONNECTION_AUTH_REQUEST
1943 packet. It MUST NOT be sent in any other packet type. The following
1944 diagram represents the Connection Auth Request Payload.
1950 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
1951 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1952 | Connection Type | Authentication Method |
1953 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1957 Figure 18: Connection Auth Request Payload
1961 o Connection Type (2 bytes) - Indicates the type of the
1962 connection. The following connection types are defined:
1969 If any other type is found in this field the packet MUST be
1970 discarded and the authentication MUST be failed.
1972 o Authentication Method (2 bytes) - Indicates the authentication
1973 method to be used in the authentication protocol. The following
1974 authentication methods are defined:
1977 1 password (mandatory)
1978 2 public key (mandatory)
1980 If any other type is found in this field the packet MUST be
1981 discarded and the authentication MUST be failed. If this
1982 payload is sent as request to receive the mandatory
1983 authentication method this field MUST be set to zero (0),
1984 indicating that receiver should send the mandatory
1985 authentication method. The receiver sending this payload
1986 to the requesting party, MAY also set this field to zero (0)
1987 to indicate that authentication is not required. In this
1988 case authentication protocol still MUST be started but
1989 server is most likely to respond with SILC_PACKET_SUCCESS
1995 2.3.16 New ID Payload
1997 New ID Payload is a multipurpose payload. It is used to send newly
1998 created ID's from clients and servers. When client connects to server
1999 and registers itself to the server by sending SILC_PACKET_NEW_CLIENT
2000 packet, server replies with this packet by sending the created ID for
2001 the client. Server always creates the ID for the client.
2003 This payload is also used when server tells its router that new client
2004 has registered to the SILC network. In this case the server sends
2005 the Client ID of the client to the router. Similarly when router
2006 distributes information to other routers about the client in the SILC
2007 network this payload is used.
2009 Also, when server connects to router, router uses this payload to inform
2010 other routers about new server in the SILC network. However, every
2011 server (or router) creates their own ID's thus the ID distributed by
2012 this payload is not created by the distributor in this case. Servers
2013 create their own ID's. Server registers itself to the network by
2014 sending SILC_PACKET_NEW_SERVER to the router it connected to. The case
2015 is same when router connects to another router.
2017 However, this payload MUST NOT be used to send information about new
2018 channels. New channels are always distributed by sending the dedicated
2019 SILC_PACKET_NEW_CHANNEL packet.
2021 Thus, this payload is very important and used every time when some
2022 new entity is registered to the SILC network. Client MUST NOT send this
2023 payload. Both client and server (and router) MAY receive this payload.
2025 The packet uses generic ID Payload as New ID Payload. See section
2026 2.3.2.1 for generic ID Payload.
2030 2.3.17 New Client Payload
2032 When client is connected to the server, keys has been exchanged and
2033 connection has been authenticated client MUST register itself to the
2034 server. Client's first packet after key exchange and authentication
2035 protocols must be SILC_PACKET_NEW_CLIENT. This payload tells server all
2036 the relevant information about the connected user. Server creates a new
2037 client ID for the client when received this payload and sends it to the
2038 client in New ID Payload.
2040 This payload sends username and real name of the user on the remote host
2041 which is connected to the SILC server with SILC client. The server
2042 creates the client ID according the information sent in this payload.
2043 The nickname of the user becomes the username sent in this payload.
2044 However, client should call NICK command after sending this payload to
2045 set the real nickname of the user which is then used to create new
2048 The payload may only be sent with SILC_PACKET_NEW_CLIENT packet. It
2049 MUST NOT be sent in any other packet type. The following diagram
2050 represents the New Client Payload.
2067 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
2068 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2069 | Username Length | |
2070 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2074 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2075 | Real Name Length | |
2076 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2080 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2084 Figure 19: New Client Payload
2088 o Username Length (2 bytes) - Length of the Username field.
2090 o Username (variable length) - The username of the user on
2091 the host where connecting to the SILC server.
2093 o Real Name Length (2 bytes) - Length of the Real Name field.
2095 o Real Name (variable length) - The real name of the user
2096 on the host where connecting to the SILC server.
2101 2.3.18 New Server Payload
2103 This payload is sent by server when it has completed successfully both
2104 key exchange and connection authentication protocols. The server
2105 MUST register itself to the SILC Network by sending this payload.
2106 The first packet after these key exchange and authentication protocols
2107 is SILC_PACKET_NEW_SERVER packet. The payload includes the Server ID
2108 of the server that it has created by itself. It also includes a
2109 name of the server that is associated to the Server ID.
2111 The payload may only be sent with SILC_PACKET_NEW_SERVER packet. It
2112 MUST NOT be sent in any other packet type. The following diagram
2113 represents the New Server Payload.
2122 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
2123 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2124 | Server ID Length | |
2125 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2129 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2130 | Server Name Length | |
2131 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2135 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2139 Figure 20: New Server Payload
2143 o Server ID Length (2 bytes) - Length of the Server ID Data
2146 o Server ID Data (variable length) - The actual Server ID
2149 o Server Name Length (2 bytes) - Length of the server name
2152 o Server Name (variable length) - The server name.
2157 2.3.19 New Channel Payload
2159 Information about newly created channel is broadcasted to all routers
2160 in the SILC network by sending this packet payload. Channels are
2161 created by router of the cell. Server never creates channels unless
2162 it is a standalone server and it does not have router connection,
2163 in this case server acts as router. Normal server send JOIN command
2164 to the router (after it has received JOIN command from client) which
2165 then processes the command and creates the channel. Client MUST NOT
2168 The packet uses generic Channel Payload as New Channel Payload. See
2169 section 2.3.2.3 for generic Channel Payload. The Mode Mask field in the
2170 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 This payload may be sent with SILC_PACKET_KEY_AGREEMENT and
2194 SILC_PACKET_FTP packet types. It MUST NOT be sent in any other packet
2195 types. The following diagram 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 Resume Router Payload
2245 The payload may only be sent with SILC_PACKET_RESUME_ROUTER packet. It
2246 MUST NOT be sent in any other packet type. The Following diagram
2247 represents the Resume Router Payload.
2253 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
2254 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2255 | Opcode | Session ID |
2256 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2260 Figure 22: Resume Router Payload
2264 o Opcode (1 byte) - Indicates the opcode for the backup resume
2267 o Session ID (1 bytes) - Indicates the session ID for the
2268 backup resume protocol. The sender of the packet sets this
2269 value and the receiver MUST set the same value in subsequent
2275 2.3.22 File Transfer Payload
2277 File Transfer Payload is used to perform file transfer protocol
2278 between two entities in the network. The actual file transfer
2279 protocol is always encapsulated inside the SILC Packet. The actual
2280 data stream is also sent peer to peer outside SILC network.
2282 When an entity, usually a client wishes to perform file transfer
2283 protocol with another client in the network, they perform Key Agreement
2284 protocol as described in the section 2.3.20 Key Agreement Payload and
2285 in [SILC3], inside File Transfer Payload. After the Key Agreement
2286 protocol has been performed the subsequent packets in the data stream
2287 will be protected using the new key material. The actual file transfer
2288 protocol is also initialized in this stage. All file transfer protocol
2289 packets are always encapsulated in the File Transfer Payload and
2290 protected with the negotiated key material.
2292 The payload may only be sent with SILC_PACKET_FTP packet. It MUST NOT
2293 be sent in any other packet type. The following diagram represents the
2294 File Transfer Payload
2299 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
2300 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2306 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2310 Figure 23: File Transfer Payload
2314 o Type (1 byte) - Indicates the type of the file transfer
2315 protocol. The following file transfer protocols has been
2318 1 SSH File Transfer Protocol (SFTP) (mandatory)
2320 If zero (0) value or any unsupported file transfer protocol
2321 type is found in this field the packet must be discarded.
2322 The currently mandatory file transfer protocol is SFTP.
2323 The SFTP protocol is defined in [SFTP].
2325 o Data (variable length) - Arbitrary file transfer data. The
2326 contents and encoding of this field is dependent of the usage
2327 of this payload and the type of the file transfer protocol.
2328 When this payload is used to perform the Key Agreement
2329 protocol, this field include the Key Agreement Payload,
2330 as defined in the section 2.3.20 Key Agreement Payload.
2331 When this payload is used to send the actual file transfer
2332 protocol data, the encoding is defined in the corresponding
2333 file transfer protocol.
2340 ID's are extensively used in the SILC network to associate different
2341 entities. The following ID's has been defined to be used in the SILC
2347 When ever specific ID cannot be used this is used.
2351 Server ID to associate servers. See the format of
2356 Client ID to associate clients. See the format of
2361 Channel ID to associate channels. See the format of
2367 2.5 Packet Encryption And Decryption
2369 SILC packets are encrypted almost entirely. Only small part of SILC
2370 header is not encrypted as described in section 5.2 SILC Packet Header.
2371 The SILC Packet header is the first part of a packet to be encrypted
2372 and it is always encrypted with the key of the next receiver of the
2373 packet. The data payload area of the packet is always entirely
2374 encrypted and it is usually encrypted with the next receiver's key.
2375 However, there are some special packet types and packet payloads
2376 that require special encryption process. These special cases are
2377 described in the next sections. First is described the normal packet
2382 2.5.1 Normal Packet Encryption And Decryption
2384 Normal SILC packets are encrypted with the session key of the next
2385 receiver of the packet. The entire SILC Packet header and the packet
2386 data payload is is also encrypted with the same key. Padding of the
2387 packet is also encrypted always with the session key, also in special
2388 cases. Computed MAC of the packet must not be encrypted.
2390 Decryption process in these cases are straightforward. The receiver
2391 of the packet MUST first decrypt the SILC Packet header, or some parts
2392 of it, usually first 16 bytes of it. Then the receiver checks the
2393 packet type from the decrypted part of the header and can determine
2394 how the rest of the packet must be decrypted. If the packet type is
2395 any of the special cases described in the following sections the packet
2396 decryption is special. If the packet type is not among those special
2397 packet types rest of the packet can be decrypted with the same key.
2399 Also, note that two bytes of the SILC Packet header are not encrypted
2400 thus it must be noticed in the decryption process by starting the
2401 decryption from the second byte of the header. This sets some rules
2402 to padding generation as well, see the section 2.7 Packet Padding
2405 With out a doubt, this sort of decryption processing causes some
2406 overhead to packet decryption, but never the less, is required.
2410 2.5.2 Channel Message Encryption And Decryption
2412 Channel Messages (Channel Message Payload) are always encrypted with
2413 the channel specific key. However, the SILC Packet header is not
2414 encrypted with that key. As in normal case, the header is encrypted
2415 with the key of the next receiver of the packet, who ever that might
2416 be. Note that in this case the encrypted data area is not touched
2417 at all; it MUST NOT be re-encrypted with the session key.
2419 Receiver of a channel message, who ever that is, is REQUIRED to decrypt
2420 the SILC Packet header to be able to even recognize the packet to be as
2421 channel message. This is same procedure as for normal SILC packets.
2422 As the receiver founds the packet to be channel message, rest of the
2423 packet processing is special. Rest of the SILC Packet header is
2424 decrypted with the same session key along with the padding of the
2425 packet. After that the packet is protected with the channel specific
2426 key and thus can be decrypted only if the receiver is the client on
2427 the channel. See section 2.7 Packet Padding Generation for more
2428 information about padding on special packets.
2430 If the receiver of the channel message is router which is routing the
2431 message to another router then it MUST decrypt the Channel Message
2432 payload. Between routers (that is, between cells) channel messages
2433 are protected with session keys shared between the routers. This
2434 causes another special packet processing for channel messages. If
2435 the channel message is received from another router then the entire
2436 packet, including Channel Message payload, MUST be encrypted with the
2437 session key shared between the routers. In this case the packet
2438 decryption process is as with normal SILC packets. Hence, if the
2439 router is sending channel message to another router the Channel
2440 Message payload MUST have been decrypted and MUST be re-encrypted
2441 with the session key shared between the another router. In this
2442 case the packet encryption is as with any normal SILC packet.
2444 It must be noted that this is only when the channel messages are sent
2445 from router to another router. In all other cases the channel
2446 message encryption and decryption is as described above. This
2447 different processing of channel messages with router to router
2448 connection is because channel keys are cell specific. All cells has
2449 their own channel keys thus the channel message traveling from one
2450 cell to another MUST be protected as it would be any normal SILC
2453 If the SILC_CMODE_PRIVKEY channel mode has been set for the channel
2454 then the router cannot decrypt the packet as it does not know the
2455 private key. In this case the entire packet MUST be encrypted with
2456 the session key and sent to the router. The router receiving the
2457 packet MUST check the channel mode and decrypt the packet accordingly.
2461 2.5.3 Private Message Encryption And Decryption
2463 By default, private message in SILC are protected by session keys.
2464 In this case the private message encryption and decryption process is
2465 equivalent to normal packet encryption and decryption.
2467 However, private messages MAY be protected with private message key
2468 which causes the packet to be special packet. The procedure in this
2469 case is very much alike to channel packets. The actual private message
2470 is encrypted with the private message key and other parts of the
2471 packet is encrypted with the session key. See 2.7 Packet Padding
2472 Generation for more information about padding on special packets.
2474 The difference from channel message processing is that server or router
2475 en route never decrypts the actual private message, as it does not
2476 have the key to do that. Thus, when sending packets between router
2477 the processing is same as in any other case as well; the packet's header
2478 and padding is protected by the session key and the data area is not
2481 The true receiver of the private message, client, that is, is able
2482 to decrypt the private message as it shares the key with the sender
2487 2.6 Packet MAC Generation
2489 Data integrity of a packet is protected by including a message
2490 authentication code (MAC) at the end of the packet. The MAC is computed
2491 from shared secret MAC key, that is established by the SILC Key Exchange
2492 protocol, from packet sequence number, and from the original contents
2493 of the packet. The MAC is always computed before the packet is
2494 encrypted, although after it is compressed if compression is used.
2496 The MAC is computed from entire packet. Every bit of data in the packet,
2497 including SILC Packet Header is used in the MAC computing. This way
2498 the entire packet becomes authenticated.
2500 If the packet is special packet MAC is computed from the entire packet
2501 but part of the packet may be encrypted before the MAC is computed.
2502 This is case, for example, with channel messages where the message data
2503 is encrypted with key that server may not now. In this case the MAC
2504 has been computed from the encrypted data.
2506 Hence, packet's MAC generation is as follows:
2508 mac = MAC(key, sequence number | SILC packet)
2510 The MAC key is negotiated during the SKE protocol. The sequence number
2511 is a 32 bit MSB first value starting from zero for first packet and
2512 increasing for subsequent packets, finally wrapping after 2^32 packets.
2513 The value is never reset, not even after rekey has been performed.
2515 See [SILC1] for defined and allowed MAC algorithms.
2519 2.7 Packet Padding Generation
2521 Padding is needed in the packet because the packet is encrypted. It
2522 MUST always be multiple by eight (8) or multiple by the block size
2523 of the cipher, which ever is larger. The padding is always encrypted.
2525 For normal packets the padding is added after the SILC Packet Header
2526 and between the Data Payload area. The padding for normal packets
2527 are calculated as follows:
2530 padding length = 16 - ((packet length - 2) mod 16)
2533 The 16 is the maximum padding allowed in SILC packet. Two (2) is
2534 subtracted from the true length of the packet because two (2) bytes
2535 is not encrypted in SILC Packet Header, see section 2.2 SILC Packet
2536 Header. Those two bytes that are not encrypted MUST NOT be calculated
2537 to the padding length.
2539 For special packets the padding calculation MAY be different as special
2540 packets may be encrypted differently. In these cases the encrypted
2541 data area MUST already be multiple by the block size thus in this case
2542 the padding is calculated only for SILC Packet Header, not for any
2543 other area of the packet. The same algorithm works in this case as
2544 well, except that the `packet length' is now the SILC Packet Header
2545 length. In this case, as well, two (2) is subtracted from the
2548 The padding MUST be random data, preferably, generated by
2549 cryptographically strong random number generator.
2553 2.8 Packet Compression
2555 SILC Packets MAY be compressed. In this case the data payload area
2556 is compressed and all other areas of the packet MUST remain as they
2557 are. After compression is performed for the data area, the length
2558 field of Packet Header MUST be set to the compressed length of the
2561 The compression MUST always be applied before encryption. When
2562 the packet is received and decrypted the data area MUST be decompressed.
2563 Note that the true sender of the packet MUST apply the compression and
2564 the true receiver of the packet MUST apply the decompression. Any
2565 server or router en route MUST NOT decompress the packet.
2571 The sender of the packet MUST assemble the SILC Packet Header with
2572 correct values. It MUST set the Source ID of the header as its own
2573 ID, unless it is forwarding the packet. It MUST also set the Destination
2574 ID of the header to the true destination. If the destination is client
2575 it will be Client ID, if it is server it will be Server ID and if it is
2576 channel it will be Channel ID.
2578 If the sender wants to compress the packet it MUST apply the
2579 compression now. Sender MUST also compute the padding as described
2580 in above sections. Then sender MUST compute the MAC of the packet.
2582 Then sender MUST encrypt the packet as has been described in above
2583 sections according whether the packet is normal packet or special
2584 packet. The computed MAC MUST NOT be encrypted.
2588 2.10 Packet Reception
2590 On packet reception the receiver MUST check that all fields in the
2591 SILC Packet Header are valid. It MUST check the flags of the
2592 header and act accordingly. It MUST also check the MAC of the packet
2593 and if it is to be failed the packet MUST be discarded. Also if the
2594 header of the packet includes any bad fields the packet MUST be
2597 See above sections on the decryption process of the received packet.
2599 The receiver MUST also check that the ID's in the header are valid
2600 ID's. Unsupported ID types or malformed ID's MUST cause packet
2601 rejection. The padding on the reception is always ignored.
2603 The receiver MUST also check the packet type and start parsing the
2604 packet according to the type. However, note the above sections on
2605 special packet types and their parsing.
2611 Routers are the primary entities in the SILC network that takes care
2612 of packet routing. However, normal servers routes packets as well, for
2613 example, when they are routing channel message to the local clients.
2614 Routing is quite simple as every packet tells the true origin and the
2615 true destination of the packet.
2617 It is still RECOMMENDED for routers that has several routing connections
2618 to create route cache for those destinations that has faster route than
2619 the router's primary route. This information is available for the router
2620 when other router connects to the router. The connecting party then
2621 sends all of its locally connected clients, servers and channels. These
2622 informations helps to create the route cache. Also, when new channels
2623 are created to a cell its information is broadcasted to all routers
2624 in the network. Channel ID's are based on router's ID thus it is easy
2625 to create route cache based on these informations. If faster route for
2626 destination does not exist in router's route cache the packet MUST be
2627 routed to the primary route (default route).
2629 For server which receives a packet to be routed to its locally connected
2630 client the server MUST check whether the particular packet type is
2631 allowed to be routed to the client. Not all packets may be sent by
2632 some odd entity to client that is indirectly connected to the sender.
2633 See section 2.3 SILC Packet Types and paragraph about indirectly connected
2634 entities and sending packets to them. The section mentions the packets
2635 that may be sent to indirectly connected entities. It is clear that
2636 server cannot send, for example, disconnect packet to client that is not
2637 directly connected to the server.
2641 2.12 Packet Broadcasting
2643 SILC packets MAY be broadcasted in SILC network. However, only router
2644 server may send or receive broadcast packets. Client and normal server
2645 MUST NOT send broadcast packets and they MUST ignore broadcast packets
2646 if they receive them. Broadcast packets are sent by setting Broadcast
2647 flag to the SILC packet header.
2649 Broadcasting packets means that the packet is sent to all routers in
2650 the SILC network, except to the router that sent the packet. The router
2651 receiving broadcast packet MUST send the packet to its primary route.
2652 The fact that SILC routers may have several router connections can
2653 cause problems, such as race conditions inside the SILC network, if
2654 care is not taken when broadcasting packets. Router MUST NOT send
2655 the broadcast packet to any other route except to its primary route.
2657 If the primary route of the router is the original sender of the packet
2658 the packet MUST NOT be sent to the primary route. This may happen
2659 if router has several router connections and some other router uses
2660 the router as its primary route.
2662 Routers use broadcast packets to broadcast for example information
2663 about newly registered clients, servers, channels etc. so that all the
2664 routers may keep these informations up to date.
2668 3 Security Considerations
2670 Security is central to the design of this protocol, and these security
2671 considerations permeate the specification. Common security considerations
2672 such as keeping private keys truly private and using adequate lengths for
2673 symmetric and asymmetric keys must be followed in order to maintain the
2674 security of this protocol.
2680 [SILC1] Riikonen, P., "Secure Internet Live Conferencing (SILC),
2681 Protocol Specification", Internet Draft, April 2001.
2683 [SILC3] Riikonen, P., "SILC Key Exchange and Authentication
2684 Protocols", Internet Draft, April 2001.
2686 [SILC4] Riikonen, P., "SILC Commands", Internet Draft, April 2001.
2688 [IRC] Oikarinen, J., and Reed D., "Internet Relay Chat Protocol",
2691 [IRC-ARCH] Kalt, C., "Internet Relay Chat: Architecture", RFC 2810,
2694 [IRC-CHAN] Kalt, C., "Internet Relay Chat: Channel Management", RFC
2697 [IRC-CLIENT] Kalt, C., "Internet Relay Chat: Client Protocol", RFC
2700 [IRC-SERVER] Kalt, C., "Internet Relay Chat: Server Protocol", RFC
2703 [SSH-TRANS] Ylonen, T., et al, "SSH Transport Layer Protocol",
2706 [PGP] Callas, J., et al, "OpenPGP Message Format", RFC 2440,
2709 [SPKI] Ellison C., et al, "SPKI Certificate Theory", RFC 2693,
2712 [PKIX-Part1] Housley, R., et al, "Internet X.509 Public Key
2713 Infrastructure, Certificate and CRL Profile", RFC 2459,
2716 [Schneier] Schneier, B., "Applied Cryptography Second Edition",
2717 John Wiley & Sons, New York, NY, 1996.
2719 [Menezes] Menezes, A., et al, "Handbook of Applied Cryptography",
2722 [OAKLEY] Orman, H., "The OAKLEY Key Determination Protocol",
2723 RFC 2412, November 1998.
2725 [ISAKMP] Maughan D., et al, "Internet Security Association and
2726 Key Management Protocol (ISAKMP)", RFC 2408, November
2729 [IKE] Harkins D., and Carrel D., "The Internet Key Exchange
2730 (IKE)", RFC 2409, November 1998.
2732 [HMAC] Krawczyk, H., "HMAC: Keyed-Hashing for Message
2733 Authentication", RFC 2104, February 1997.
2735 [PKCS1] Kalinski, B., and Staddon, J., "PKCS #1 RSA Cryptography
2736 Specifications, Version 2.0", RFC 2437, October 1998.
2738 [RFC2119] Bradner, S., "Key Words for use in RFCs to Indicate
2739 Requirement Levels", BCP 14, RFC 2119, March 1997.
2747 Snellmanninkatu 34 A 15
2751 EMail: priikone@silcnet.org
2753 This Internet-Draft expires XXX