8 .ds RF FORMFEED[Page %]
11 .ds RH 15 January 2007
17 Network Working Group P. Riikonen
19 draft-riikonen-silc-ke-auth-09.txt 15 January 2007
25 SILC Key Exchange and Authentication Protocols
26 <draft-riikonen-silc-ke-auth-09.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 two protocols used in the Secure Internet Live
55 Conferencing (SILC) protocol, specified in the Secure Internet Live
56 Conferencing, Protocol Specification [SILC1]. The SILC Key Exchange
57 (SKE) protocol provides secure key exchange between two parties
58 resulting into shared secret key material. The protocol is based
59 on Diffie-Hellman key exchange algorithm and its functionality is
60 derived from several key exchange protocols.
62 The second protocol, SILC Connection Authentication protocol provides
63 user level authentication used when creating connections in SILC
64 network. The protocol supports passphrase (pre-shared secret)
65 authentication and public key (and certificate) authentication based
66 on digital signatures.
74 1 Introduction .................................................. 2
75 1.1 Requirements Terminology .................................. 3
76 2 SILC Key Exchange Protocol .................................... 3
77 2.1 Key Exchange Payloads ..................................... 4
78 2.1.1 Key Exchange Start Payload .......................... 4
79 2.1.2 Key Exchange Payload ................................ 9
80 2.2 Key Exchange Procedure .................................... 11
81 2.3 Processing the Key Material ............................... 13
82 2.4 SILC Key Exchange Groups .................................. 15
83 2.4.1 diffie-hellman-group1 ............................... 15
84 2.4.2 diffie-hellman-group2 ............................... 15
85 2.4.3 diffie-hellman-group3 ............................... 16
86 2.5 Key Exchange Status Types ................................. 16
87 3 SILC Connection Authentication Protocol ....................... 18
88 3.1 Connection Auth Payload ................................... 19
89 3.2 Connection Authentication Types ........................... 20
90 3.2.1 Passphrase Authentication ........................... 20
91 3.2.2 Public Key Authentication ........................... 21
92 3.3 Connection Authentication Status Types .................... 21
93 4 Security Considerations ....................................... 22
94 5 References .................................................... 22
95 6 Author's Address .............................................. 23
96 7 Full Copyright Statement ...................................... 24
103 Figure 1: Key Exchange Start Payload
104 Figure 2: Key Exchange Payload
105 Figure 3: Connection Auth Payload
111 This memo describes two protocols used in the Secure Internet Live
112 Conferencing (SILC) protocol specified in the Secure Internet Live
113 Conferencing, Protocol Specification [SILC1]. The SILC Key Exchange
114 (SKE) protocol provides secure key exchange between two parties
115 resulting into shared secret key material. The protocol is based on
116 Diffie-Hellman key exchange algorithm and its functionality is derived
117 from several key exchange protocols, such as SSH2 Key Exchange protocol,
118 Station-To-Station (STS) protocol and the OAKLEY Key Determination
121 The second protocol, SILC Connection Authentication protocol provides
122 user level authentication used when creating connections in SILC
123 network. The protocol supports passphrase (pre-shared secret)
124 authentication and public key (and certificate) authentication based
125 on digital signatures.
127 The basis of secure SILC session requires strong and secure key exchange
128 protocol and authentication. The authentication protocol is secured and
129 no authentication data is ever sent in the network without encrypting
130 and authenticating it first. Thus, authentication protocol may be used
131 only after the key exchange protocol has been successfully completed.
133 This document constantly refers to other SILC protocol specifications
134 that should be read to be able to fully understand the functionality
135 and purpose of these protocols. The most important references are
136 the Secure Internet Live Conferencing, Protocol Specification [SILC1]
137 and the SILC Packet Protocol [SILC2].
139 The protocol is intended to be used with the SILC protocol thus it
140 does not define own framework that could be used. The framework is
141 provided by the SILC protocol.
145 1.1 Requirements Terminology
147 The keywords MUST, MUST NOT, REQUIRED, SHOULD, SHOULD NOT, RECOMMENDED,
148 MAY, and OPTIONAL, when they appear in this document, are to be
149 interpreted as described in [RFC2119].
153 2 SILC Key Exchange Protocol
155 SILC Key Exchange Protocol (SKE) is used to exchange shared secret
156 material used to secure the communication channel. The protocol use
157 Diffie-Hellman key exchange algorithm and its functionality is derived
158 from several key exchange protocols, such as SSH2 Key Exchange protocol,
159 Station-To-Station (STS) protocol and the OAKLEY Key Determination
160 protocol [OAKLEY]. The protocol does not claim any conformance
161 to any of these protocols, they were only used as a reference when
162 designing this protocol. The protocol can mutually authenticate the
163 negotiating parties during the key exchange.
165 The purpose of SILC Key Exchange protocol is to create session keys to
166 be used in current SILC session. The keys are valid only for some period
167 of time (usually an hour) or at most until the session ends. These keys
168 are used to protect packets traveling between the two entities.
169 Usually all traffic is secured with the key material derived from this
172 The Diffie-Hellman implementation used in the SILC SHOULD be compliant
177 2.1 Key Exchange Payloads
179 During the key exchange procedure public data is sent between initiator
180 and responder. This data is later used in the key exchange procedure.
181 There are several payloads used in the key exchange. As for all SILC
182 packets, SILC Packet Header, described in [SILC2], is at the beginning
183 of all packets sent in during this protocol. All the fields in the
184 following payloads are in MSB (most significant byte first) order.
188 2.1.1 Key Exchange Start Payload
190 The key exchange between two entities MUST be started by sending the
191 SILC_PACKET_KEY_EXCHANGE packet containing Key Exchange Start Payload.
192 Initiator sends the Key Exchange Start Payload to the responder filled
193 with all security properties it supports. The responder then checks
194 whether it supports the security properties.
196 It then sends a Key Exchange Start Payload to the initiator filled with
197 security properties it selected from the original payload. The payload
198 sent by responder MUST include only one chosen property per list. The
199 character encoding for the security property values as defined in [SILC1]
200 SHOULD be UTF-8 [RFC2279] in Key Exchange Start Payload.
202 The Key Exchange Start Payload is used to tell connecting entities what
203 security properties and algorithms should be used in the communication.
204 The Key Exchange Start Payload is sent only once per session. Even if
205 the PFS (Perfect Forward Secrecy) flag is set the Key Exchange Start
206 Payload is not re-sent. When PFS is desired the Key Exchange Payloads
207 are sent to negotiate new key material. The procedure is equivalent to
208 the very first negotiation except that the Key Exchange Start Payload
211 As this payload is used only with the very first key exchange the payload
212 is never encrypted, as there are no keys to encrypt it with.
214 A cookie is also sent in this payload. A cookie is used to randomize the
215 payload so that none of the key exchange parties can determine this
216 payload before the key exchange procedure starts. The cookie MUST be
217 returned to the original sender unmodified by the responder.
219 Following diagram represents the Key Exchange Start Payload. The lists
220 mentioned below are always comma (`,') separated and the list MUST NOT
221 include white spaces (` ').
227 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
228 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
229 | RESERVED | Flags | Payload Length |
230 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
238 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
239 | Version String Length | |
240 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
244 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
245 | Key Exchange Grp Length | |
246 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
248 ~ Key Exchange Groups ~
250 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
251 | PKCS Alg Length | |
252 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
256 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
257 | Encryption Alg Length | |
258 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
260 ~ Encryption Algorithms ~
262 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
263 | Hash Alg Length | |
264 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
268 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
270 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
274 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
275 | Compression Alg Length | |
276 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
278 ~ Compression Algorithms ~
280 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
284 Figure 1: Key Exchange Start Payload
288 o RESERVED (1 byte) - Reserved field. Sender fills this with
291 o Flags (1 byte) - Indicates flags to be used in the key
292 exchange. Several flags can be set at once by ORing the
293 flags together. The following flags are reserved for this
298 In this case the field is ignored.
302 This flag is used to indicate that Initialization
303 Vector (IV) in encryption will be included in the
304 ciphertext which the recipient must use in decryption.
305 At the beginning of the SILC packet, before the SILC
306 Packet header an 8-bit Security ID (SID) MUST be
307 placed. After the SID, the IV MUST be placed. After
308 the IV, a 32-bit MSB first ordered packet sequence
309 number MUST be placed. The SID and IV MUST NOT be
310 encrypted, but the sequence number MUST be included
311 in encryption. The recipient MUST use the sequence
312 number during MAC verification [SILC2]. All fields
313 however are authenticated with MAC.
315 The Security ID is set to value 0 when the key
316 exchange is performed for the first time. It is
317 monotonically increased after each re-key, wrapping
318 eventually. The SID in combination with the current
319 session can be used to identify which key has been
320 used to encrypt an incoming packet. This is especially
321 important after rekey when using UDP/IP protocol,
322 where packets may be lost or reordered. A packet with
323 unknown SID will result into discarding the packet as
324 it cannot be decrypted. After rekey, implementation
325 should understand that it may still receive packets
326 with old SID and be prepared to decrypt them with the
329 With this flag it is possible to use SILC protocol on
330 unreliable transport such as UDP/IP which may cause
331 packet reordering and packet losses. By default,
332 this flag is not set and thus IV is not included
333 in the ciphertext. Setting this flag increases the
334 packet length by one ciphertext block plus 1 byte for
335 the Security ID and 32 bits for the sequence number.
336 Responder MAY override this flag for the initiator,
337 however without this flag UDP connection cannot be
338 used. The flag MAY also be used in TCP connection.
340 When using with UDP/IP implementations SHOULD use
341 anti-replay methods where an anti-replay window
342 defines what packets are replays. An example of
343 anti-window protocol is in [RFC2406] Section 3.4.2
344 with example source code in [RFC2401] Appendix C.
345 While [RFC2401] and [RFC2406] does not relate to SILC,
346 the anti-replay method used is applicable in SILC.
350 Perfect Forward Secrecy (PFS) to be used in the
351 key exchange protocol. If not set, re-keying
352 is performed using the old key. See the [SILC1]
353 for more information on this issue. When PFS is
354 used, re-keying and creating new keys for any
355 particular purpose MUST cause new key exchange with
356 new Diffie-Hellman exponent values. In this key
357 exchange only the Key Exchange Payload is sent and
358 the Key Exchange Start Payload MUST NOT be sent.
359 When doing PFS the Key Exchange Payloads are
360 encrypted with the old keys.
362 Mutual Authentication 0x04
364 Both of the parties will perform authentication
365 by providing signed data for the other party to
366 verify. By default, only responder will provide
367 the signature data. If this is set then the
368 initiator must also provide it. Initiator MAY
369 set this but also responder MAY set this even if
370 initiator did not set it.
372 Rest of the flags are reserved for the future and
375 o Payload Length (2 bytes) - Length of the entire Key Exchange
376 Start payload, not including any other field.
378 o Cookie (16 bytes) - Cookie that randomize this payload so
379 that each of the party cannot determine the payload before
380 hand. This field MUST be present.
382 o Version String Length (2 bytes) - The length of the Version
383 String field, not including any other field.
385 o Version String (variable length) - Indicates the version of
386 the sender of this payload. Initiator sets this when sending
387 the payload and responder sets this when it replies by sending
388 this payload. See [SILC1] for definition for the version
389 string format. This field MUST be present and include valid
392 o Key Exchange Grp Length (2 bytes) - The length of the
393 key exchange group list, not including any other field.
395 o Key Exchange Group (variable length) - The list of
396 key exchange groups. See the section 2.4 SILC Key Exchange
397 Groups for definitions of these groups. This field MUST
400 o PKCS Alg Length (2 bytes) - The length of the PKCS algorithms
401 list, not including any other field.
403 o PKCS Algorithms (variable length) - The list of PKCS
404 algorithms. This field MUST be present.
406 o Encryption Alg Length (2 bytes) - The length of the encryption
407 algorithms list, not including any other field.
409 o Encryption Algorithms (variable length) - The list of
410 encryption algorithms. This field MUST be present.
412 o Hash Alg Length (2 bytes) - The length of the Hash algorithm
413 list, not including any other field.
415 o Hash Algorithms (variable length) - The list of Hash
416 algorithms. The hash algorithms are mainly used in the
417 SKE protocol. This field MUST be present.
419 o HMAC Length (2 bytes) - The length of the HMAC list, not
420 including any other field.
422 o HMACs (variable length) - The list of HMACs. The HMAC's
423 are used to compute the Message Authentication Code (MAC)
424 of the SILC packets. This field MUST be present.
426 o Compression Alg Length (2 bytes) - The length of the
427 compression algorithms list, not including any other field.
429 o Compression Algorithms (variable length) - The list of
430 compression algorithms. This field MAY be omitted.
435 2.1.2 Key Exchange Payload
437 Key Exchange payload is used to deliver the public key (or certificate),
438 the computed Diffie-Hellman public value and possibly signature data
439 from one party to the other. When initiator is using this payload
440 and the Mutual Authentication flag is not set then the initiator MUST
441 NOT provide the signature data. If the flag is set then the initiator
442 MUST provide the signature data so that the responder can verify it.
444 The Mutual Authentication flag is usually used when a separate
445 authentication protocol will not be executed for the initiator of the
446 protocol. This is case for example when the SKE is performed between
447 two SILC clients. In normal case, where client is connecting to a
448 server, or server is connecting to a router the Mutual Authentication
449 flag MAY be omitted. However, if the connection authentication protocol
450 for the connecting entity is not based on digital signatures (it is
451 based on pre-shared key or there is no authentication) then the Mutual
452 Authentication flag SHOULD be enabled. This way the connecting entity
453 has to provide proof of possession of the private key for the public key
454 it will provide in this protocol.
456 When performing re-key with PFS selected this is the only payload that
457 is sent in the SKE protocol. The Key Exchange Start Payload MUST NOT
458 be sent at all. However, this payload does not have all the fields
459 present. In the re-key with PFS the public key and a possible signature
460 data SHOULD NOT be present. If they are present they MUST be ignored.
461 The only field that is present is the Public Data that is used to create
462 the new key material. In the re-key the Mutual Authentication flag, that
463 may be set in the initial negotiation, MUST also be ignored.
465 This payload is sent inside SILC_PACKET_KEY_EXCHANGE_1 and inside
466 SILC_PACKET_KEY_EXCHANGE_2 packet types. The initiator uses the
467 SILC_PACKET_KEY_EXCHANGE_1 and the responder the latter.
469 The following diagram represent the Key Exchange Payload.
475 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
476 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
477 | Public Key Length | Public Key Type |
478 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
480 ~ Public Key of the party (or certificate) ~
482 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
483 | Public Data Length | |
484 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
488 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
489 | Signature Length | |
490 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
494 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
498 Figure 2: Key Exchange Payload
502 o Public Key Length (2 bytes) - The length of the Public Key
503 (or certificate) field, not including any other field.
505 o Public Key Type (2 bytes) - The public key (or certificate)
506 type. This field indicates the type of the public key in
507 the packet. Following types are defined:
509 1 SILC style public key (mandatory)
510 2 SSH2 style public key (optional)
511 3 X.509 Version 3 certificate (optional)
512 4 OpenPGP certificate (optional)
513 5 SPKI certificate (optional)
515 The only required type to support is type number 1. See
516 [SILC1] for the SILC public key specification. See
517 SSH2 public key specification in [SSH-TRANS]. See X.509v3
518 certificate specification in [PKIX-Part1]. See OpenPGP
519 certificate specification in [PGP]. See SPKI certificate
520 specification in [SPKI]. If this field includes zero (0)
521 or unsupported type number the protocol MUST be aborted
522 sending SILC_PACKET_FAILURE message and the connection SHOULD
523 be closed immediately.
525 o Public Key (or certificate) (variable length) - The
526 public key or certificate of the party. This public key
527 may be used to verify the digital signature. The public key
528 or certificate in this field is encoded in the manner as
529 defined in their respective definitions; see previous field.
531 o Public Data Length (2 bytes) - The length of the Public Data
532 field, not including any other field.
534 o Public Data (variable length) - The public data to be
535 sent to the receiver (computed Diffie-Hellman public values).
536 See section 2.2 Key Exchange Procedure for detailed description
537 how this field is computed. This field is MP integer and is
538 encoded as defined in [SILC1].
540 o Signature Length (2 bytes) - The length of the signature,
541 not including any other field.
543 o Signature Data (variable length) - The signature signed
544 by the sender. The receiver of this signature MUST
545 verify it. The verification is done using the sender's
546 public key. See section 2.2 Key Exchange Procedure for
547 detailed description how to produce the signature. If
548 the Mutual Authentication flag is not set then initiator
549 MUST NOT provide this field and the Signature Length field
550 MUST be set to zero (0) value. If the flag is set then
551 also the initiator MUST provide this field. The responder
552 always MUST provide this field. The encoding for signature
553 is defined in [SILC1].
559 2.2 Key Exchange Procedure
561 The key exchange begins by sending SILC_PACKET_KEY_EXCHANGE packet with
562 Key Exchange Start Payload to select the security properties to be used
563 in the key exchange and later in the communication.
565 After Key Exchange Start Payload has been processed by both of the
566 parties the protocol proceeds as follows:
569 Setup: p is a large and public safe prime. This is one of the
570 Diffie Hellman groups. q is order of subgroup (largest
571 prime factor of p). g is a generator and is defined
572 along with the Diffie Hellman group.
574 1. Initiator generates a random number x, where 1 < x < q,
575 and computes e = g ^ x mod p. The result e is then
576 encoded into Key Exchange Payload, with the public key
577 (or certificate) and sent to the responder.
579 If the Mutual Authentication flag is set then initiator
580 MUST also produce signature data SIGN_i which the responder
581 will verify. The initiator MUST compute a hash value
582 HASH_i = hash(Initiator's Key Exchange Start Payload |
583 public key (or certificate) | e). The '|' stands for
584 concatenation. It then signs the HASH_i value with its
585 private key resulting a signature SIGN_i.
587 2. Responder generates a random number y, where 1 < y < q,
588 and computes f = g ^ y mod p. It then computes the
589 shared secret KEY = e ^ y mod p, and, a hash value
590 HASH = hash(Initiator's Key Exchange Start Payload |
591 public key (or certificate) | Initiator's public key
592 (or certificate) | e | f | KEY). It then signs
593 the HASH value with its private key resulting a signature
596 It then encodes its public key (or certificate), f and
597 SIGN into Key Exchange Payload and sends it to the
600 If the Mutual Authentication flag is set then the responder
601 SHOULD verify that the public key provided in the payload
602 is authentic, or if certificates are used it verifies the
603 certificate. The responder MAY accept the public key without
604 verifying it, however, doing so may result to insecure key
605 exchange (accepting the public key without verifying may be
606 desirable for practical reasons on many environments. For
607 long term use this is never desirable, in which case
608 certificates would be the preferred method to use). It then
609 computes the HASH_i value the same way initiator did in the
610 phase 1. It then verifies the signature SIGN_i from the
611 payload with the hash value HASH_i using the received public
614 3. Initiator verifies that the public key provided in
615 the payload is authentic, or if certificates are used
616 it verifies the certificate. The initiator MAY accept
617 the public key without verifying it, however, doing
618 so may result to insecure key exchange (accepting the
619 public key without verifying may be desirable for
620 practical reasons on many environments. For long term
621 use this is never desirable, in which case certificates
622 would be the preferred method to use).
624 Initiator then computes the shared secret KEY =
625 f ^ x mod p, and, a hash value HASH in the same way as
626 responder did in phase 2. It then verifies the
627 signature SIGN from the payload with the hash value
628 HASH using the received public key.
631 If any of these phases is to fail the SILC_PACKET_FAILURE MUST be sent
632 to indicate that the key exchange protocol has failed, and the connection
633 SHOULD be closed immediately. Any other packets MUST NOT be sent or
634 accepted during the key exchange except the SILC_PACKET_KEY_EXCHANGE_*,
635 SILC_PACKET_FAILURE and SILC_PACKET_SUCCESS packets.
637 The result of this protocol is a shared secret key material KEY and
638 a hash value HASH. The key material itself is not fit to be used as
639 a key, it needs to be processed further to derive the actual keys to be
640 used. The key material is also used to produce other security parameters
641 later used in the communication. See section 2.3 Processing the Key
642 Material for detailed description how to process the key material.
644 If the Mutual Authentication flag was set the protocol produces also
645 a hash value HASH_i. This value, however, must be discarded.
647 After the keys are processed the protocol is ended by sending the
648 SILC_PACKET_SUCCESS packet. Both entities send this packet to
649 each other. After this both parties MUST start using the new keys.
653 2.3 Processing the Key Material
655 Key Exchange protocol produces secret shared key material KEY. This
656 key material is used to derive the actual keys used in the encryption
657 of the communication channel. The key material is also used to derive
658 other security parameters used in the communication. Key Exchange
659 protocol produces a hash value HASH as well.
661 The keys MUST be derived from the key material as follows:
664 Sending Initial Vector (IV) = hash(0x0 | KEY | HASH)
665 Receiving Initial Vector (IV) = hash(0x1 | KEY | HASH)
666 Sending Encryption Key = hash(0x2 | KEY | HASH)
667 Receiving Encryption Key = hash(0x3 | KEY | HASH)
668 Sending HMAC Key = hash(0x4 | KEY | HASH)
669 Receiving HMAC Key = hash(0x5 | KEY | HASH)
673 The Initial Vector (IV) is used in the encryption when doing for
674 example CBC mode. As many bytes as needed are taken from the start of
675 the hash output for IV. Sending IV is for sending key and receiving IV
676 is for receiving key. For receiving party, the receiving IV is actually
677 sender's sending IV, and, the sending IV is actually sender's receiving
678 IV. Initiator uses IV's as they are (sending IV for sending and
679 receiving IV for receiving).
681 The Encryption Keys are derived as well from the hash(). If the hash()
682 output is too short for the encryption algorithm more key material MUST
683 be produced in the following manner:
686 K1 = hash(0x2 | KEY | HASH)
687 K2 = hash(KEY | HASH | K1)
688 K3 = hash(KEY | HASH | K1 | K2) ...
690 Sending Encryption Key = K1 | K2 | K3 ...
693 K1 = hash(0x3 | KEY | HASH)
694 K2 = hash(KEY | HASH | K1)
695 K3 = hash(KEY | HASH | K1 | K2) ...
697 Receiving Encryption Key = K1 | K2 | K3 ...
701 The key is distributed by hashing the previous hash with the original
702 key material. The final key is a concatenation of the hash values.
703 For Receiving Encryption Key the procedure is equivalent. Sending key
704 is used only for encrypting data to be sent. The receiving key is used
705 only to decrypt received data. For receiving party, the receive key is
706 actually sender's sending key, and, the sending key is actually sender's
707 receiving key. Initiator uses generated keys as they are (sending key
708 for sending and receiving key for receiving).
710 The HMAC keys are used to create MAC values to packets in the
711 communication channel. As many bytes as needed are taken from the start
712 of the hash output to generate the MAC keys.
714 These procedures are performed by all parties of the key exchange
715 protocol. This MUST be done before the protocol has been ended by
716 sending the SILC_PACKET_SUCCESS packet, to assure that parties can
717 successfully process the key material.
719 This same key processing procedure MAY be used in the SILC in some
720 other circumstances as well. Any changes to this procedure is defined
721 separately when this procedure is needed. See the [SILC1] and the
722 [SILC2] for these circumstances.
726 2.4 SILC Key Exchange Groups
728 The Following groups may be used in the SILC Key Exchange protocol.
729 The first group diffie-hellman-group1 is REQUIRED, other groups MAY be
730 negotiated to be used in the connection with Key Exchange Start Payload
731 and SILC_PACKET_KEY_EXCHANGE packet. However, the first group MUST be
732 proposed in the Key Exchange Start Payload regardless of any other
733 requested group (however, it does not have to be the first in the list).
737 2.4.1 diffie-hellman-group1
739 The length of this group is 1024 bits. This is REQUIRED group.
740 The prime is 2^1024 - 2^960 - 1 + 2^64 * { [2^894 pi] + 129093 }.
742 Its hexadecimal value is
745 FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1
746 29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD
747 EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245
748 E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED
749 EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE65381
754 The generator used with this prime is g = 2. The group order q is
757 This group was taken from RFC 2412.
761 2.4.2 diffie-hellman-group2
763 The length of this group is 1536 bits. This is OPTIONAL group.
764 The prime is 2^1536 - 2^1472 - 1 + 2^64 * { [2^1406 pi] + 741804 }.
766 Its hexadecimal value is
769 FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1
770 29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD
771 EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245
772 E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED
773 EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE45B3D
774 C2007CB8 A163BF05 98DA4836 1C55D39A 69163FA8 FD24CF5F
775 83655D23 DCA3AD96 1C62F356 208552BB 9ED52907 7096966D
776 670C354E 4ABC9804 F1746C08 CA237327 FFFFFFFF FFFFFFFF
779 The generator used with this prime is g = 2. The group order q is
782 This group was taken from RFC 3526.
786 2.4.3 diffie-hellman-group3
788 The length of this group is 2048 bits. This is OPTIONAL group.
789 This prime is: 2^2048 - 2^1984 - 1 + 2^64 * { [2^1918 pi] + 124476 }.
791 Its hexadecimal value is
794 FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1
795 29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD
796 EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245
797 E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED
798 EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE45B3D
799 C2007CB8 A163BF05 98DA4836 1C55D39A 69163FA8 FD24CF5F
800 83655D23 DCA3AD96 1C62F356 208552BB 9ED52907 7096966D
801 670C354E 4ABC9804 F1746C08 CA18217C 32905E46 2E36CE3B
802 E39E772C 180E8603 9B2783A2 EC07A28F B5C55DF0 6F4C52C9
803 DE2BCBF6 95581718 3995497C EA956AE5 15D22618 98FA0510
804 15728E5A 8AACAA68 FFFFFFFF FFFFFFFF
807 The generator used with this prime is g = 2. The group order q is
810 This group was taken from RFC 3526.
812 Additional larger groups are defined in RFC 3526 and may be used in SKE
813 by defining name for them using the above name format.
817 2.5 Key Exchange Status Types
819 This section defines all key exchange protocol status types that may
820 be returned in the SILC_PACKET_SUCCESS or SILC_PACKET_FAILURE packets
821 to indicate the status of the protocol. Implementations may map the
822 status types to human readable error message. All types except the
823 SILC_SKE_STATUS_OK type MUST be sent in SILC_PACKET_FAILURE packet.
824 The length of status is 32 bits (4 bytes). The following status types
830 Protocol were executed successfully.
833 1 SILC_SKE_STATUS_ERROR
835 Unknown error occurred. No specific error type is defined.
838 2 SILC_SKE_STATUS_BAD_PAYLOAD
840 Provided KE payload were malformed or included bad fields.
843 3 SILC_SKE_STATUS_UNSUPPORTED_GROUP
845 None of the provided groups were supported.
848 4 SILC_SKE_STATUS_UNSUPPORTED_CIPHER
850 None of the provided ciphers were supported.
853 5 SILC_SKE_STATUS_UNSUPPORTED_PKCS
855 None of the provided public key algorithms were supported.
858 6 SILC_SKE_STATUS_UNSUPPORTED_HASH_FUNCTION
860 None of the provided hash functions were supported.
863 7 SILC_SKE_STATUS_UNSUPPORTED_HMAC
865 None of the provided HMACs were supported.
868 8 SILC_SKE_STATUS_UNSUPPORTED_PUBLIC_KEY
870 Provided public key type is not supported.
873 9 SILC_SKE_STATUS_INCORRECT_SIGNATURE
875 Provided signature was incorrect.
878 10 SILC_SKE_STATUS_BAD_VERSION
880 Provided version string was not acceptable.
883 11 SILC_SKE_STATUS_INVALID_COOKIE
885 The cookie in the Key Exchange Start Payload was malformed,
886 because responder modified the cookie.
891 3 SILC Connection Authentication Protocol
893 Purpose of Connection Authentication protocol is to authenticate the
894 connecting party with server. Usually connecting party is client but
895 server may connect to router server as well. Its other purpose is to
896 provide information for the server about which type of entity the
897 connection is. The type defines whether the connection is client,
898 server or router connection. Server use this information to create the
899 ID for the connection.
901 Server MUST verify the authentication data received and if it is to fail
902 the authentication MUST be failed by sending SILC_PACKET_FAILURE packet.
903 If authentication is successful the protocol is ended by server by sending
904 SILC_PACKET_SUCCESS packet.
906 The protocol is executed after the SILC Key Exchange protocol. It MUST
907 NOT be executed in any other time. As it is performed after key exchange
908 protocol all traffic in the connection authentication protocol is
909 encrypted with the exchanged keys.
911 The protocol MUST be started by the connecting party by sending the
912 SILC_PACKET_CONNECTION_AUTH packet with Connection Auth Payload,
913 described in the next section. This payload MUST include the
914 authentication data. The authentication data is set according
915 authentication method that MUST be known by both parties. If connecting
916 party does not know what is the mandatory authentication method it MAY
917 request it from the server by sending SILC_PACKET_CONNECTION_AUTH_REQUEST
918 packet. This packet is not part of this protocol and is described in
919 section Connection Auth Request Payload in [SILC2]. However, if
920 connecting party already knows the mandatory authentication method
921 sending the request is not necessary.
923 See [SILC1] and section Connection Auth Request Payload in [SILC2] also
924 for the list of different authentication methods. Authentication method
925 MAY also be NONE, in which case the server does not require
926 authentication. However, in this case the protocol still MUST be
927 executed; the authentication data is empty indicating no authentication
930 If authentication method is passphrase the authentication data is
931 plaintext passphrase. As the payload is encrypted it is safe to have
932 plaintext passphrase. It is also provided as plaintext passphrase
933 because the receiver may need to pass the entire passphrase into a
934 passphrase verifier, and a message digest of the passphrase would
935 prevent this. See the section 3.2.1 Passphrase Authentication for
938 If authentication method is public key authentication the authentication
939 data is a digital signature of the hash value of hash HASH and Key
940 Exchange Start Payload, established by the SILC Key Exchange protocol.
941 This signature MUST then be verified by the server. See the section
942 3.2.2 Public Key Authentication for more information.
944 See the section 4 SILC Procedures in [SILC1] for more information about
945 client creating connection to server, and server creating connection
946 to router, and how to register the session in the SILC Network after
947 successful Connection Authentication protocol.
951 3.1 Connection Auth Payload
953 Client sends this payload to authenticate itself to the server. Server
954 connecting to another server also sends this payload. Server receiving
955 this payload MUST verify all the data in it and if something is to fail
956 the authentication MUST be failed by sending SILC_PACKET_FAILURE packet.
958 The payload may only be sent with SILC_PACKET_CONNECTION_AUTH packet.
959 It MUST NOT be sent in any other packet type. The following diagram
960 represent the Connection Auth Payload.
971 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
972 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
973 | Payload Length | Connection Type |
974 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
976 ~ Authentication Data ~
978 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
982 Figure 3: Connection Auth Payload
986 o Payload Length (2 bytes) - Length of the entire Connection
989 o Connection Type (2 bytes) - Indicates the type of the
990 connection. See section Connection Auth Request Payload
991 in [SILC2] for the list of connection types. This field MUST
992 include valid connection type or the packet MUST be discarded
993 and authentication MUST be failed.
995 o Authentication Data (variable length) - The actual
996 authentication data. Contents of this depends on the
997 authentication method known by both parties. If no
998 authentication is required this field does not exist.
1003 3.2 Connection Authentication Types
1005 SILC supports two authentication types to be used in the connection
1006 authentication protocol; passphrase authentication or public key
1007 authentication based on digital signatures. The following sections
1008 defines the authentication methods. See [SILC2] for defined numerical
1009 authentication method types.
1013 3.2.1 Passphrase Authentication
1015 Passphrase authentication or pre-shared key based authentication is
1016 simply an authentication where the party that wants to authenticate
1017 itself to the other end sends the passphrase that is required by
1018 the other end, for example server. The plaintext passphrase is put
1019 to the payload, that is then encrypted. The plaintext passphrase
1020 MUST be in UTF-8 [RFC2279] encoding. If the passphrase is in the
1021 sender's system in some other encoding it MUST be UTF-8 encoded
1022 before transmitted. The receiver MAY change the encoding of the
1023 passphrase to its system's default character encoding before verifying
1026 If the passphrase matches with the one in the server's end the
1027 authentication is successful. Otherwise SILC_PACKET_FAILURE MUST be
1028 sent to the sender and the protocol execution fails.
1030 This is REQUIRED authentication method to be supported by all SILC
1033 When password authentication is used it is RECOMMENDED that maximum
1034 amount of padding is applied to the SILC packet. This way it is not
1035 possible to approximate the length of the password from the encrypted
1041 3.2.2 Public Key Authentication
1043 Public key authentication may be used if passphrase based authentication
1044 is not desired. The public key authentication works by sending a
1045 digital signature as authentication data to the other end, say, server.
1046 The server MUST then verify the signature by the public key of the sender,
1047 which the server has received earlier in SKE protocol, or which the
1048 server has cached locally at some previous time.
1050 The signature is computed using the private key of the sender by signing
1051 the HASH value provided by the SKE protocol previously, and the Key
1052 Exchange Start Payload from SKE protocol that was sent to the server.
1053 These are concatenated and hash function is used to compute a hash value
1054 which is then signed.
1056 auth_hash = hash(HASH | Key Exchange Start Payload);
1057 signature = sign(auth_hash);
1059 The hash() function used to compute the value is the hash function
1060 negotiated in the SKE protocol. The server MUST verify the data, thus
1061 it must keep the HASH and the Key Exchange Start Payload saved during
1062 SKE and authentication protocols. These values can be discarded after
1063 Connection Authentication protocol is completed.
1065 If the verified signature matches the sent signature, the authentication
1066 were successful and SILC_PACKET_SUCCESS is sent. If it failed the
1067 protocol execution is stopped and SILC_PACKET_FAILURE is sent.
1069 This is REQUIRED authentication method to be supported by all SILC
1075 3.3 Connection Authentication Status Types
1077 This section defines all connection authentication status types that
1078 may be returned in the SILC_PACKET_SUCCESS or SILC_PACKET_FAILURE packets
1079 to indicate the status of the protocol. Implementations may map the
1080 status types to human readable error message. All types except the
1081 SILC_AUTH_STATUS_OK type MUST be sent in SILC_PACKET_FAILURE packet.
1082 The length of status is 32 bits (4 bytes). The following status types
1087 Protocol was executed successfully.
1092 Authentication failed.
1096 4 Security Considerations
1098 Security is central to the design of this protocol, and these security
1099 considerations permeate the specification. Common security considerations
1100 such as keeping private keys truly private and using adequate lengths for
1101 symmetric and asymmetric keys must be followed in order to maintain the
1102 security of this protocol.
1108 [SILC1] Riikonen, P., "Secure Internet Live Conferencing (SILC),
1109 Protocol Specification", Internet Draft, January 2007.
1111 [SILC2] Riikonen, P., "SILC Packet Protocol", Internet Draft,
1114 [SILC4] Riikonen, P., "SILC Commands", Internet Draft, January 2007.
1116 [IRC] Oikarinen, J., and Reed D., "Internet Relay Chat Protocol",
1119 [IRC-ARCH] Kalt, C., "Internet Relay Chat: Architecture", RFC 2810,
1122 [IRC-CHAN] Kalt, C., "Internet Relay Chat: Channel Management", RFC
1125 [IRC-CLIENT] Kalt, C., "Internet Relay Chat: Client Protocol", RFC
1128 [IRC-SERVER] Kalt, C., "Internet Relay Chat: Server Protocol", RFC
1131 [SSH-TRANS] Ylonen, T., et al, "SSH Transport Layer Protocol",
1134 [PGP] Callas, J., et al, "OpenPGP Message Format", RFC 2440,
1137 [SPKI] Ellison C., et al, "SPKI Certificate Theory", RFC 2693,
1140 [PKIX-Part1] Housley, R., et al, "Internet X.509 Public Key
1141 Infrastructure, Certificate and CRL Profile", RFC 2459,
1144 [Schneier] Schneier, B., "Applied Cryptography Second Edition",
1145 John Wiley & Sons, New York, NY, 1996.
1147 [Menezes] Menezes, A., et al, "Handbook of Applied Cryptography",
1150 [OAKLEY] Orman, H., "The OAKLEY Key Determination Protocol",
1151 RFC 2412, November 1998.
1153 [ISAKMP] Maughan D., et al, "Internet Security Association and
1154 Key Management Protocol (ISAKMP)", RFC 2408, November
1157 [IKE] Harkins D., and Carrel D., "The Internet Key Exchange
1158 (IKE)", RFC 2409, November 1998.
1160 [HMAC] Krawczyk, H., "HMAC: Keyed-Hashing for Message
1161 Authentication", RFC 2104, February 1997.
1163 [PKCS1] Kalinski, B., and Staddon, J., "PKCS #1 RSA Cryptography
1164 Specifications, Version 2.0", RFC 2437, October 1998.
1166 [RFC2119] Bradner, S., "Key Words for use in RFCs to Indicate
1167 Requirement Levels", BCP 14, RFC 2119, March 1997.
1169 [RFC2279] Yergeau, F., "UTF-8, a transformation format of ISO
1170 10646", RFC 2279, January 1998.
1172 [RFC2401] Kent, S., et al, "Security Architecture for the Internet
1173 Protocol", RFC 2401, November 1998.
1175 [RFC2406] Kent, S., et al, "Security Architecture for the Internet
1176 Protocol", RFC 2406, November 1998.
1187 EMail: priikone@iki.fi
1191 7 Full Copyright Statement
1193 Copyright (C) The Internet Society (2003). All Rights Reserved.
1195 This document and translations of it may be copied and furnished to
1196 others, and derivative works that comment on or otherwise explain it
1197 or assist in its implementation may be prepared, copied, published
1198 and distributed, in whole or in part, without restriction of any
1199 kind, provided that the above copyright notice and this paragraph are
1200 included on all such copies and derivative works. However, this
1201 document itself may not be modified in any way, such as by removing
1202 the copyright notice or references to the Internet Society or other
1203 Internet organizations, except as needed for the purpose of
1204 developing Internet standards in which case the procedures for
1205 copyrights defined in the Internet Standards process must be
1206 followed, or as required to translate it into languages other than
1209 The limited permissions granted above are perpetual and will not be
1210 revoked by the Internet Society or its successors or assigns.
1212 This document and the information contained herein is provided on an
1213 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
1214 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
1215 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
1216 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
1217 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.