AVT Working Group
Internet Engineering Task Force (IETF)                           S. Yoon
Internet Draft
Request for Comments: 5669                                        J. Kim
Expires: December 15, 2009
Category: Informational                                          H. Park
ISSN: 2070-1721                                                 H. Jeong
                                                                  Y. Won
                                        Korea Information Internet & Security Agency
                                                         June 15, 2009
                                                            January 2010

                 The SEED Cipher Algorithm and Its Use
          with the Secure Real-time Real-Time Transport Protocol (SRTP)
                        draft-ietf-avt-seed-srtp-14

Abstract

   This document describes the use of the SEED block cipher algorithm in
   the Secure Real-time Transport Protocol (SRTP) for providing
   confidentiality for the Real-time Transport Protocol (RTP) traffic and
   for the control traffic for RTP, the Real-time Transport Control
   Protocol (RTCP).

Status of this This Memo

   This Internet-Draft document is submitted to IETF in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents not an Internet Standards Track specification; it is
   published for informational purposes.

   This document is a product of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other
   groups may also distribute working documents as Internet-Drafts.

   Internet-Drafts are draft documents valid for a maximum
   (IETF).  It represents the consensus of six months the IETF community.  It has
   received public review and may be updated, replaced, or obsoleted has been approved for publication by other the
   Internet Engineering Steering Group (IESG).  Not all documents at
   approved by the IESG are a candidate for any
   time. It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   The list level of Internet
   Standard; see Section 2 of RFC 5741.

   Information about the current Internet-Drafts can be accessed at
   http://www.ietf.org/ietf/1id-abstracts.txt.

   The list status of Internet-Draft Shadow Directories can this document, any errata,
   and how to provide feedback on it may be accessed obtained at
   http://www.ietf.org/shadow.html.

   This Internet-Draft will expire on December 15, 2009.
   http://www.rfc-editor.org/info/rfc5669.

Copyright Notice

   Copyright (c) 2009 2010 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (http://trustee.ietf.org/license-info) in effect on the date of
   publication of this document (http://trustee.ietf.org/license-info). document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1. Introduction..................................................3 Introduction ....................................................2
      1.1. SEED.....................................................3 SEED .......................................................2
      1.2. Terminology..............................................3 Terminology ................................................3
      1.3. Definitions..............................................3 Definitions ................................................3
   2. Cryptographic Transforms......................................4 Transforms ........................................3
      2.1. Counter..................................................4 Counter ....................................................3
           2.1.1. Message Authentication/Integrity: HMAC-SHA1.........4 HMAC-SHA1 .........3
      2.2. Counter with CBC-MAC (CCM)...............................4 (CCM) .................................4
      2.3. Galois/Counter Mode (GCM)................................6 (GCM) ..................................5
   3. Nonce Format for CCM and GCM..................................6 GCM ....................................5
      3.1. Nonce for SRTP...........................................6 SRTP .............................................5
      3.2. Nonce for SRTCP..........................................6 SRTCP ............................................6
   4. Key Derivation: SEED-CTR PRF..................................7 PRF ....................................6
   5. Mandatory-to-implement Transforms.............................7 Mandatory-to-Implement Transforms ...............................6
   6. Security Considerations.......................................7 Considerations .........................................7
   7. IANA Considerations...........................................8 Considerations .............................................7
   8. References....................................................8
      8.1. Acknowledgements ................................................7
   9. References ......................................................7
      9.1. Normative References.....................................8
      8.2. References .......................................7
      9.2. Informative References...................................9
   APPENDIX A: References .....................................8
   Appendix A. Test Vectors........................................10 Vectors ...........................................9
      A.1. SEED-CTR Test Vectors...................................10 Vectors ......................................9
      A.2. SEED-CCM Test Vectors...................................11 Vectors .....................................10
      A.3. SEED-GCM Test Vectors...................................12
   Author's Addresses..............................................13 Vectors .....................................11

1.  Introduction

   This document describes the use of the SEED [RFC4269] block cipher
   algorithm in the Secure Real-time Transport Protocol (SRTP) [RFC3711]
   for providing confidentiality for the Real-time Transport Protocol (RTP)
   [RFC3550] traffic and for the control traffic for RTP, the Real-time
   Transport Control Protocol (RTCP) [RFC3550].

1.1.  SEED

   SEED is a Korean National Industrial Association standard and is
   widely used in South Korea for electronic commerce and financial
   services that are operated on wired and wireless communications.

   SEED is a 128-bit symmetric key 128-bit, symmetric-key block cipher that has been developed
   by KISA (Korea
   Information Security Agency) and a group of experts have been
   developing since 1998.  The input/output block size of SEED is 128-bit 128
   bits and the key length is also 128-bit. 128 bits.  SEED has a 16-round
   Feistel structure.

1.2.  Terminology

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in [RFC2119].

1.3.  Definitions

   ||   concatenation
   XOR  exclusive or

2.  Cryptographic Transforms

   All symmetric block cipher algorithms share common characteristics characteristics,
   including mode, key size, weak keys, and block size.  The following
   sections contain descriptions of the relevant characteristics of
   SEED.

   SEED does not have any restrictions for modes of operation that are
   used with this block cipher.  We define three modes of running SEED, SEED:
   (1) SEED in Counter Mode, counter mode, (2) SEED in Counter counter mode with CBC-MAC (CCM) Mode
   (CCM), and (3) SEED in Galois/Counter Mode (GCM) Mode. (GCM).

2.1.  Counter

   Section 4.1.1 of [RFC3711] defines AES counter mode encryption, which
   it
   that document refers to as AES-CM.  SEED counter mode is defined in a
   similar
   manner, manner and is denoted as SEED-CTR.  The plaintext inputs to
   the block cipher are formed as in AES-CM, and the block cipher
   outputs are processed as in AES-CM.  The only difference in the
   processing is that SEED-CTR uses SEED as the underlying encryption
   primitive.  When SEED-
   CTR SEED-CTR is used, it MUST be used only in
   conjunction with an authentication function.

2.1.1.  Message Authentication/Integrity: HMAC-SHA1

   HMAC-SHA1 [RFC2104], as defined in section Section 4.2.1 of [RFC3711], SHALL
   be the default message authentication message-authentication code to be used with SEED-CTR.
   The default session authentication key-length session-authentication key length SHALL be 160 bits, the
   default authentication tag length SHALL be 80 bits, and the
   SRTP_PREFIX_LENGTH SHALL be zero for HMAC-SHA1.  For SRTP, smaller
   values are NOT RECOMMENDED, RECOMMENDED but MAY be used after careful
   consideration of the issues discussed in section Sections 7.5 and 9.5 of
   [RFC3711].

2.2.  Counter with CBC-MAC (CCM)

   CCM [RFC3610] is a generic authenticate-and-encrypt block cipher mode
   [RFC3610].
   mode.  In this specification, CCM used with the SEED block cipher is
   denoted as SEED-CCM.

   Section 3.3 of [RFC3711] defines procedures to construct or to
   authenticate and decrypt SRTP packets.  For SEED-CCM SEED-CCM, however, the
   sender performs Step 7 before Step 5 and the receiver performs the
   second half of Step 5 (performs verification) (verification) after Step 6.  This means that
   authentication is performed on the plaintext rather than the
   ciphertext.  This applies equally to SRTCP.

   All SRTP packets MUST be authenticated and encrypted.  Unlike SRTP,
   SRTCP
   Secure Real-time Transport Control Protocol (SRTCP) packet encryption
   is optional (but authentication is mandatory).  A sender can select
   which packets to encrypt, encrypt and indicates this choice with a 1-bit
   encryption flag (located in the leftmost bit of the 32-bit word that
   contains the SRTCP index).

   SEED-CCM has two parameters:

      M   M indicates the size of the authentication tag.  In SRTP, a
          full 80-bit authentication-tag authentication tag SHOULD be used and
          implementation of this specification MUST support M values of
          10 octets.

      L   L indicates the size of the length field in octets.  The
          number of octets in the nonce MUST be 12, i.e., L is 3.

   SEED-CCM has four inputs:

      Key

          A single key is used to calculate the authentication tag using
         CBC-MAC
          (using CBC-MAC) and to perform payload encryption using
          counter mode.  SEED only supports a key size of 128 bits.

      Nonce

          The size of the nonce depends on the value selected for the
          parameter L.  It is 15-L octets.  L equals 3 3, and hence the
          nonce size equals 12 octets.

      Plaintext

          In the case of SRTP, the payload of the RTP packet and packet, the RTP
         padding
          padding, and the RTP pad count field (if the latter two fields
          are
         present). present) are treated as plaintext.

          In the case of SRTCP, when the encryption flag is set to 1,
          the Encrypted Portion described in Fig.2 of [RFC3711] is
          treated as plaintext.  When the encryption flag is set to 0,
          the plaintext is zero-length.

      Additional Authentication Data (AAD)

          In the case of SRTP, the header of the RTP packet packet, including
          the contributing source (CSRC) identifier (if present) and the
          RTP header extension (if present). present), is considered AAD.

          In the case of SRTCP, when the encryption flag is set to 0,
          the Authentication Portion described in Fig.2 of [RFC3711] is
          treated as AAD.  When the encryption flag is set to 1, the
          first
         8-octets, 8 octets, the encryption flag flag, and the SRTCP index are
          treated as AAD.

   SEED-CCM accepts these four inputs and returns a ciphertext field.

2.3.  Galois/Counter Mode (GCM)

   GCM is a block cipher mode of operation providing both
   confidentiality and data origin authentication [GCM].  GCM used with
   the SEED block cipher is denoted as SEED-GCM.

   SEED-GCM has four inputs: a key, a plaintext, a nonce nonce, and the
   additional authenticated data (AAD) (AAD), all described in section Section 2.2.

   The bit length of the tag, denoted t, is 12, and an authentication
   tag with a length of 12 octets (96 bits) is used.

3.  Nonce Format for CCM and GCM

3.1.  Nonce for SRTP

   The nonce for SRTP SHALL be formed in the following way:

      Nonce = (16 bits of zeroes || SSRC || ROC || SEQ) XOR Salt

   The 4-octet SSRC and the 2-octet SEQ SHALL be taken from the RTP
   header.  The 4-octet ROC is from the cryptographic context.  The 12-
   octet Salt SHALL be produced by the SRTP Key Derivation Function. key derivation function.

3.2.  Nonce for SRTCP

   The nonce for SRTCP SHALL be formed in the following way:

      Nonce = (16 bits of zeroes || SSRC || 16 bits of zeroes ||
               SRTCP index) XOR Salt

   The 4-octet SSRC SHALL be taken from the RTCP header and The the 31-bit
   SRTCP index (packed zero-filled, right justified zero-filled and right-justified into a 4-octet
   field) is from each packet.  The 12-octet Salt SHALL be produced by
   the SRTP Key Derivation Function. key derivation function.

4.  Key Derivation: SEED-CTR PRF

   Section 4.3.3 of [RFC3711] defines the AES-128 counter mode key
   derivation function, which it refers to as "AES-CM PRF".  The SEED-CTR SEED-
   CTR PRF is defined in a similar manner, but with each invocation of
   AES replaced with an invocation of SEED.

   The currently defined PRF, keyed by the 128-bit master key, has input
   block size m = 128 and can produce n-bit outputs for n up to 2^23.
   SEED-PRF_n(k_master, x) SHALL be SEED in Counter Mode counter mode, as described
   in
   section 2.1, Section 2.1; it SHALL be applied to key k_master, and have IV equal to
   (x*2^16), and
   with have the output keystream truncated to the n first (left-most) n
   (leftmost) bits.

5. Mandatory-to-implement  Mandatory-to-Implement Transforms

   "Mandatory-to-implement" means that conformance to the specification, and
   that specification
   is required.  Table 1 does not supersede a similar table in Section 5
   of [RFC3711].  An RTP implementation that supports SEED MUST
   implement the modes listed in Table 1.

                            mandatory-to-implement      optional

   encryption                     SEED-CTR          SEED-CCM,SEED-GCM
   message integrity              HMAC-SHA1         SEED-CCM,SEED-GCM
   key derivation (PRF)           SEED-CTR                  -

   Table 1: Mandatory-to-implement and optional transforms in SRTP and
   SRTCP.
   SRTCP

6.  Security Considerations

   No security problem has been found on SEED.  SEED is secure against
   all known attacks attacks, including Differential differential cryptanalysis, linear
   cryptanalysis, and related key attacks.  The best known attack is
   only an exhaustive search for the key.  For further security
   considerations, the reader is encouraged to read [SEED-EVAL].

   See [RFC3610] and [GCM] for security considerations regarding the CCM
   and GCM Modes of Operation, respectively.  In the context of SRTP,
   the procedures in [RFC3711] ensure the critical property of non-reuse
   of counter values.

7.  IANA Considerations

   [RFC4568] defines SRTP "crypto suites".  In order to allow SDP the
   Session Description Protocol (SDP) to signal the use of the
   algorithms defined in this document, IANA will
   register has registered the
   following crypto suites into the subregistry for SRTP crypto suites
   under the SRTP transport Media Stream Transports of the SDP Security Descriptions:

      srtp-crypto-suite-ext = "SEED_CTR_128_HMAC_SHA1_80"/
                              "SEED_128_CCM_80"/
                              "SEED_128_GCM_96"/
                              srtp-crypto-suite-ext

         SEED_CTR_128_HMAC_SHA1_80
         SEED_128_CCM_80
         SEED_128_GCM_96

8.  Acknowledgements

   The authors would like to thank David McGrew, Eric Rescorla, Alexey
   Melnikov, Alfred Hoenes, Colin Perkins, Young-Chan Shin, the AVT WG
   (in particular, the chairmen Roni Even and Tom Taylor), and the
   Real-time Applications and Infrastructure Area Directors for their
   reviews and support.

9.  References

8.1.

9.1.  Normative References

   [GCM]       Dworkin, M., "NIST Special Publication 800-38D:
               Recommendation for Block Cipher Modes of Operation:
               Galois/Counter Mode (GCM) and GMAC", U.S. National
               Institute of Standards and Technology
               http://csrc.nist.gov/publications/nistpubs/800-38D/SP-
               800-38D.pdf
               http://csrc.nist.gov/publications/nistpubs/800-38D/
               SP-800-38D.pdf

   [RFC2104]   Krawczyk, H.,Bellare, M. H., Bellare, M., and R. Canetti, "HMAC: keyed- Keyed-
               Hashing for Message Authentication", RFC 2104, February
               1997.

   [RFC2119]   Bradner, S., "Key words for use in RFCs to Indicate
               Requirement Levels", BCP 14, RFC 2119, March 1997.

   [RFC3550]   Schulzrinne, H., Casner, S., Frederick, R. R., and V.
               Jacobson, "RTP: A Transport Protocol for Real-time Real-Time
               Applications", RFC3550, STD 64, RFC 3550, July 2003 2003.

   [RFC3610]   Whiting, D., Housley, R., and N. Ferguson, "Counter with
               CBC-MAC (CCM)", RFC 3610, September 2003.

   [RFC3711]   M.   Baugher, D. M., McGrew, M. D., Naslund, E.Carrara, M., Carrara, E., and K.
               Norrman, "The Secure Real-time Transport Protocol
               (SRTP)", RFC 3711, March 2004.

   [RFC4269]   H.   Lee, S. H., Lee, J. S., Yoon, D. J., Cheon, D., and J. Lee, "The
               SEED Encryption Algorithm", RFC 4269, December 2005.

   [RFC4568]   F.   Andreasen, M. F., Baugher, M., and D. Wing, "Session
               Description Protocol (SDP) Security Descriptions for
               Media Streams", RFC 4568, July 2006.

8.2.

9.2.  Informative References

   [SEED-EVAL] KISA, "Self Evaluation Report",
               http://www.kisa.or.kr/kisa/seed/down/SEED_Evaluation_Repo
               rt_by_CRYPTREC.pdf

APPENDIX A: http://www.kisa.or.kr/
               kisa/seed/down/SEED_Evaluation_Report_by_CRYPTREC.pdf

Appendix A.  Test Vectors

   All values are in hexadecimal.

A.1.  SEED-CTR Test Vectors

   Session Key:               0c5ffd37a11edc42c325287fc0604f2e

   Rollover Counter:          00000000

   Sequence Number:           315e

   SSRC:                      20e8f5eb

   Session Salt:              cd3a7c42c671e0067a2a2639b43a

   Initialization Vector:     cd3a7c42e69915ed7a2a263985640000

   RTP Payload:               f57af5fd4ae19562976ec57a5a7ad55a
                              5af5c5e5c5fdf5c55ad57a4a7272d572
                              62e9729566ed66e97ac54a4a5a7ad5e1
                              5ae5fdd5fd5ac5d56ae56ad5c572d54a
                              e54ac55a956afd6aed5a4ac562957a95
                              16991691d572fd14e97ae962ed7a9f4a
                              955af572e162f57a956666e17ae1f54a
                              95f566d54a66e16e4afd6a9f7ae1c5c5
                              5ae5d56afde916c5e94a6ec56695e14a
                              fde1148416e94ad57ac5146ed59d1cc5

   Encrypted RTP Payload:     df5a89291e7e383e9beff765e691a737
                              70d5b9319162589956544855ce99a71f
                              48c90e413272cbb576447855e691a78c
                              70c58101a9c56889666458ca7999a727
                              cf6ab98ec1f55036e1db78dade7e08f8
                              3cb96a4581ed5048e5fbdb7d5191ed27
                              bf7a89a6b5fd582699e754fec60a8727
                              bfd51a011ef94c32467c5880c60ab7a8
                              70c5a9bea976bb99e5cb5cdada7e9327
                              d7c168504276e7897644267169766ea8

   Authentication Tag:        28b7a194b1e3df3c573d

A.2.  SEED-CCM Test Vectors

   Key:                       974bee725d44fc3992267b284c3c6750

   Rollover Counter:          00000000

   Sequence Number:           315e

   SSRC:                      20e8f5eb

   Nonce:                     000020e8f5eb00000000315e

   Payload:                   f57af5fd4ae19562976ec57a5a7ad55a
                              5af5c5e5c5fdf5c55ad57a4a7272d572
                              62e9729566ed66e97ac54a4a5a7ad5e1
                              5ae5fdd5fd5ac5d56ae56ad5c572d54a
                              e54ac55a956afd6aed5a4ac562957a95
                              16991691d572fd14e97ae962ed7a9f4a
                              955af572e162f57a956666e17ae1f54a
                              95f566d54a66e16e4afd6a9f7ae1c5c5
                              5ae5d56afde916c5e94a6ec56695e14a
                              fde1148416e94ad57ac5146ed59d1cc5

   AAD:                       8008315ebf2e6fe020e8f5eb

   Encrypted RTP Payload:     39b63931862d59ae5ba209b696b61996
                              96390929093139099619b686bebe19be
                              ae25be59aa21aa25b609868696b6192d
                              9629311931960919a629a61909be1986
                              2986099659a631a621968609ae59b659
                              da55da5d19be31d825b625ae21b65386
                              599639be2dae39b659aaaa2db62d3986
                              5939aa1986aa2da28631a653b62d0909
                              962919a63125da092586a209aa592d86
                              312dd848da258619b609d8a21951d009

   Authentication Tag:        1eb0e7008c838b19c8fc

A.3.  SEED-GCM Test Vectors

   Key:                       e91e5e75da65554a48181f3846349562

   Rollover Counter:          00000000

   Sequence Number:           315e

   SSRC:                      20e8f5eb

   Nonce:                     000020e8f5eb00000000315e

   Payload:                   f57af5fd4ae19562976ec57a5a7ad55a
                              5af5c5e5c5fdf5c55ad57a4a7272d572
                              62e9729566ed66e97ac54a4a5a7ad5e1
                              5ae5fdd5fd5ac5d56ae56ad5c572d54a
                              e54ac55a956afd6aed5a4ac562957a95
                              16991691d572fd14e97ae962ed7a9f4a
                              955af572e162f57a956666e17ae1f54a
                              95f566d54a66e16e4afd6a9f7ae1c5c5
                              5ae5d56afde916c5e94a6ec56695e14a
                              fde1148416e94ad57ac5146ed59d1cc5

   AAD:                       8008315ebf2e6fe020e8f5eb

   Encrypted RTP Payload:     8a5363682c6b1bbf13c0b09cf747a551
                              2543cb2f129b8bd0e92dfadf735cda8f
                              88c4bbf90288f5e58d20c4f1bb0d5844
                              6ea009103ee57ba99cdeabaaa18d4a9a
                              05ddb46e7e5290a5a2284fe50b1f6fe9
                              ad3f1348c354181e85b24f1a552a1193
                              cf0e13eed5ab95ae854fb4f5b0edb2d3
                              ee5eb238c8f4bfb136b2eb6cd7876042
                              0680ce1879100014f140a15e07e70133
                              ed9cbb6d57b75d574acb0087eefbac99

   Authentication Tag:        36cd9ae602be3ee2cd8d5d9d

Author's

Authors' Addresses

   Seokung Yoon
   Korea Information Internet & Security Agency
   IT Venture Tower, Jungdaero 135, 135
   Songpa-gu, Seoul, Korea 138-950
   Email:
   EMail: seokung@kisa.or.kr

   Joongman Kim
   Korea Information Internet & Security Agency
   IT Venture Tower, Jungdaero 135, 135
   Songpa-gu, Seoul, Korea 138-950
   Email:
   EMail: seopo@kisa.or.kr

   Haeryong Park
   Korea Information Internet & Security Agency
   IT Venture Tower, Jungdaero 135, 135
   Songpa-gu, Seoul, Korea 138-950
   Email:
   EMail: hrpark@kisa.or.kr

   Hyuncheol Jeong
   Korea Information Internet & Security Agency
   IT Venture Tower, Jungdaero 135, 135
   Songpa-gu, Seoul, Korea 138-950
   Email:
   EMail: hcjung@kisa.or.kr

   Yoojae Won
   Korea Information Internet & Security Agency
   IT Venture Tower, Jungdaero 135, 135
   Songpa-gu, Seoul, Korea 138-950
   Email:
   EMail: yjwon@kisa.or.kr