AVT Working Group W. Kim Internet Draft J. Lee Intended status: Standard Track D. Kim Expires: June 20, 2011 D. Kwon C. Kim NSRI December 22, 2010 The ARIA Algorithm and Its Use with the Secure Real-time Transport Protocol(SRTP) draft-nsri-avt-aria-srtp-01.txt Status of this Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents 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 of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html This Internet-Draft will expire on June 20, 2011. Copyright Notice Copyright (c) 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. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Kim et al. Expires June 20, 2011 [Page 1] Internet-Draft ARIA-SRTP December 22, 2010 Abstract This document describes the use of the ARIA 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). 1. Introduction This document describes the use of the ARIA [RFC5794] 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. ARIA ARIA is a general-purpose block cipher algorithm developed by Korean cryptographers in 2003. It is an iterated block cipher with 128-, 192-, and 256-bit keys and encrypts 128-bit blocks in 12, 14, and 16 rounds, depending on the key size. It is secure and suitable for most software and hardware implementations on 32-bit and 8-bit processors. It was established as a Korean standard block cipher algorithm in 2004 [ARIAKS] and has been widely used in Korea, especially for government-to-public services. It was included in PKCS #11 in 2007 [ARIAPKCS]. The algorithm specification and object identifiers are described in [RFC5794]. 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 Kim et al. Expires June 20, 2011 [Page 2] Internet-Draft ARIA-SRTP December 22, 2010 2. Cryptographic Transforms All symmetric block cipher algorithms share common characteristics including mode, key size, weak keys, and block size. The following sections contain descriptions of the relevant characteristics of ARIA. ARIA does not have any restrictions for modes of operation that are used with this block cipher. We define three modes of running ARIA, (1) ARIA in Counter Mode, (2) ARIA in Counter with CBC-MAC (CCM) Mode and (3) ARIA in Galois/Counter Mode (GCM) Mode. 2.1. Counter Section 4.1.1 of [RFC3711] defines AES counter mode encryption, which it refers to as AES-CM. ARIA counter mode is defined in a similar manner, and is denoted as ARIA-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 ARIA-CTR uses ARIA as the underlying encryption primitive. When ARIA-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 4.2.1 of [RFC3711], SHALL be the default message authentication code to be used with ARIA-CTR. The default 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, but MAY be used after careful consideration of the issues in section 7.5 and 9.5 of [RFC3711]. 2.2. Counter with CBC-MAC (CCM) CCM is a generic authenticate-and-encrypt block cipher mode [RFC3610]. In this specification, CCM used with the ARIA block cipher is denoted as ARIA-CCM. Section 3.3 of [RFC3711] defines procedures to construct or to authenticate and decrypt SRTP packets. For ARIA-CCM however, the sender performs Step 7 before Step 5 and the receiver performs the second half of Step 5 (performs 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 packet encryption is optional (but authentication is Kim et al. Expires June 20, 2011 [Page 3] Internet-Draft ARIA-SRTP December 22, 2010 mandatory). A sender can select which packets to 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). ARIA-CCM has two parameters: M M indicates the size of the authentication tag. In SRTP, a full 80-bit 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. ARIA-CCM has four inputs: Key A single key is used to calculate the authentication tag using CBC-MAC and to perform payload encryption using counter mode. ARIA 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 and hence the nonce size equals 12 octets. Plaintext In case of SRTP, the payload of the RTP packet and the RTP padding and RTP pad count field (if the latter two fields are present). In 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 case of SRTP, the header of the RTP packet including contributing source (CSRC) identifier (if present) and the RTP header extension (if present). In case of SRTCP, when the encryption flag is set to 0, the Authentication Portion described in Fig.2 of [RFC3711] is Kim et al. Expires June 20, 2011 [Page 4] Internet-Draft ARIA-SRTP December 22, 2010 treated as AAD. When the encryption flag is set to 1, the first 8-octets, the encryption flag and SRTCP index are treated as AAD. ARIA-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 ARIA block cipher is denoted as ARIA-GCM. ARIA-GCM has four inputs: a key, a plaintext, a nonce and the additional authenticated data (AAD) all described in 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. 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 31-bit SRTCP index (packed zero-filled, right justified into a 4-octet field) is from each packet. The 12-octet Salt SHALL be produced by the SRTP Key Derivation Function. 4. Key Derivation: ARIA-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 ARIA- Kim et al. Expires June 20, 2011 [Page 5] Internet-Draft ARIA-SRTP December 22, 2010 CTR PRF is defined in a similar manner, but with each invocation of AES replaced with an invocation of ARIA. 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. ARIA-PRF_n(k_master, x) SHALL be ARIA in Counter Mode as described in section 2.1, applied to key k_master, and IV equal to (x*2^16), and with the output keystream truncated to the n first (left-most) bits. 5. Mandatory-to-implement Transforms "Mandatory-to-implement" means conformance to this specification, and that Table 1 does not supersede a similar table in section 5 of [RFC3711]. An RTP implementation that supports ARIA MUST implement the modes listed in Table 1. mandatory-to-implement optional encryption ARIA-CTR ARIA-CCM,ARIA-GCM message integrity HMAC-SHA1 ARIA-CCM,ARIA-GCM key derivation (PRF) ARIA-CTR - Table 1: Mandatory-to-implement and optional transforms in SRTP and SRTCP. 6. Security Considerations At the time of writing this document no security problem has been found on ARIA (see [YWL]). The security considerations in [RFC3711] apply to this document as well. See [RFC3610] and [GCM] for security considerations regarding the CCM and GCM modes of operations, respectively. 7. IANA Considerations [RFC4568] defines SRTP "crypto suites". In order to allow SDP to signal the use of the algorithms defined in this document, IANA will register the following crypto suites into the subregistry for SRTP crypto suites under the SRTP transport of the SDP Security Descriptions: srtp-crypto-suite-ext = "ARIA_CTR_128_HMAC_SHA1_80"/ "ARIA_128_CCM_80"/ Kim et al. Expires June 20, 2011 [Page 6] Internet-Draft ARIA-SRTP December 22, 2010 "ARIA_128_GCM_96"/ srtp-crypto-suite-ext 8. References 8.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 [RFC2104] Krawczyk, H.,Bellare, M. and Canetti, R., "HMAC: 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. and Jacobson, V. "RTP: A Transport Protocol for Real-time Applications" , RFC3550, July 2003. [RFC3610] Whiting, D., Housley, R., and N. Ferguson, "Counter with CBC-MAC (CCM)", RFC 3610, September 2003. [RFC3711] Baugher, M., McGrew, D., Naslund, M., Carrara, E., Norrman, K., "The Secure Real-time Transport Protocol (SRTP)", RFC 3711, March 2004. [RFC4568] Andreasen, F., Baugher, M., Wing, D., "Session Description Protocol (SDP) Security Descriptions for Media Streams", RFC 4568, July 2006. [RFC5794] Lee, J., Lee, J., Kim, J., Kwon, D. and Kim, C., "A Description of the ARIA Encryption Algorithm", RFC 5794, March 2010. 8.2. Informative References [YWL] Li, Y., Wu, W. and Zhang, L., "Integral attacks on reduced-round ARIA block cipher", ISPEC 2010, LNCS, vol.6047, pp.19-29, 2010. Kim et al. Expires June 20, 2011 [Page 7] Internet-Draft ARIA-SRTP December 22, 2010 [ARIAKS] Korean Agency for Technology and Standards (KATS), "128 bit block encryption algorithm ARIA ?Part 1: General", KS X 1213-1:2009, December 2009 (In Korean). [ARIAPKCS] RSA Laboratories, PKCS #11 v2.20 Amendment 3 Revision 1: Additional PKCS #11 Mechanisms, January 2007. APPENDIX A: Test Vectors All Values are in hexadecimal. A.1. ARIA-CTR Test Vectors Session Key: 0c5ffd37a11edc42c325287fc0604f2e Rollover Counter: 00000000 Sequence Number: 315e SSRC: 20e8f5eb Authentication Key: f93563311b354748c97891379553063116452309 Session Salt: cd3a7c42c671e0067a2a2639b43a Initialization Vector: cd3a7c42e69915ed7a2a263985640000 RTP header: 8008315ebf2e6fe020e8f5eb RTP Payload: f57af5fd4ae19562976ec57a5a7ad55a 5af5c5e5c5fdf5c55ad57a4a7272d572 62e9729566ed66e97ac54a4a5a7ad5e1 5ae5fdd5fd5ac5d56ae56ad5c572d54a e54ac55a956afd6aed5a4ac562957a95 16991691d572fd14e97ae962ed7a9f4a 955af572e162f57a956666e17ae1f54a 95f566d54a66e16e4afd6a9f7ae1c5c5 5ae5d56afde916c5e94a6ec56695e14a fde1148416e94ad57ac5146ed59d1cc5 Encrypted RTP Payload: 1bf753f412e6f35058cc398dc851aae3 a6ccdcb463fbed9cfb3de2fb76fdffa9 e481f5efb64c92487f59dabbc7cc72da 092485f3fbad87888820b86037311fa4 4330e18a59a1e1338ba2c21458493a57 463475c54691f91cec785429119e0dfc Kim et al. Expires June 20, 2011 [Page 8] Internet-Draft ARIA-SRTP December 22, 2010 d9048f90e07fecd50b528e8c62ee6e71 445de5d7f659405135aff3604c2ca4ff 4aaca40809cb9eee42cc4ad232307570 81ca289f2851d3315e9568b501fdce6d Authenticated portion || Rollover Counter: 8008315ebf2e6fe020e8f5eb1bf753f4 12e6f35058cc398dc851aae3a6ccdcb4 63fbed9cfb3de2fb76fdffa9e481f5ef b64c92487f59dabbc7cc72da092485f3 fbad87888820b86037311fa44330e18a 59a1e1338ba2c21458493a57463475c5 4691f91cec785429119e0dfcd9048f90 e07fecd50b528e8c62ee6e71445de5d7 f659405135aff3604c2ca4ff4aaca408 09cb9eee42cc4ad23230757081ca289f 2851d3315e9568b501fdce6d00000000 Tag: f9de4e729054672b0e35 A.2. ARIA-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: 621e408a2e455505b39f704dcbac4307 daabbd6d670abc4e42f2fd2fca263f09 Kim et al. Expires June 20, 2011 [Page 9] Internet-Draft ARIA-SRTP December 22, 2010 4f4683e6fb0b10c5093d42b69dce0ba5 46520e7c4400975713f3bde93e13116 0b9cbcd6df78a1502be7c6ea8d395b9e d0078819c3105c0ab92cb67b16ba51bb 1f53508738bf7a37c9a905439b88b7af 9d51a407916fdfea8d43bf253721846d c1671391225fc58d9d0693c8ade6a4ff b034ee6543dd4e651b7a084eae60f855 Authentication Tag: 0ed04a301790ad92955d A.3. ARIA-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: 4d8a9a0675550c704b17d8c9ddc81a5c d6f7da34f2fe1b3db7cb3dfb9697102e a0f3c1fc2dbc873d44bceeae8e444297 4ba21ff6789d3272613fb9631a7cf3f1 4bacbeb421633a90ffbe58c2fa6bdca5 34f10d0de0502ce1d531b6336e588782 78531e5c22bc6c85bbd784d78d9e680a a19031aaf89101d669d7a3965c1f7e16 229d7463e0535f4e253f5d18187d40b8 ae0f564bd970b5e7e2adfb211e89a953 Kim et al. Expires June 20, 2011 [Page 10] Internet-Draft ARIA-SRTP December 22, 2010 Authentication Tag: 5abace3f37f5a736f4be984b A.4. Key Derivation Test Vector This section provides data for the default key derivation function, which uses ARIA-128 in Counter Mode. In the following, we walk through the initial key derivation for the ARIA-128 Counter Mode cipher, which requires a 16 octet session encryption key and a 14 octet session salt, and an authentication function which requires a 94 octet session authentication key. These values are called the cipher key, the cipher salt, and the auth key in the following. The test vectors are generated in a similar way with the test vector of key derivation function in [RFC3711] but with each invocation of AES replaced with an invocation of ARIA. The inputs to the key derivation function are the 16 octet master key and the 14 octet master salt: master key: e1f97a0d3e018be0d64fa32c06de4139 master salt: 0ec675ad498afeebb6960b3aabe6 index DIV kdr: 000000000000 label: 00 master salt: 0ec675ad498afeebb6960b3aabe6 ----------------------------------------------- xor: 0ec675ad498afeebb6960b3aabe6 (x, PRF input) x*2^16: 0ec675ad498afeebb6960b3aabe60000 (ARIA-CTR input) cipher key: dbd85a3c4d9219b3e81f7d942e299de4 (ARIA-CTR output) ARIA-CTR cipher suite requires 14 octet cipher salt while ARIA-CCM and ARIA-GCM cipher suites require 12 octet cipher salt. index DIV kdr: 000000000000 label: 02 master salt: 0ec675ad498afeebb6960b3aabe6 ---------------------------------------------- xor: 0ec675ad498afee9b6960b3aabe6 (x, PRF input) x*2^16: 0ec675ad498afee9b6960b3aabe60000 (ARIA-CTR input) 9700657f5f34161830d7d85f5dc8be7f (ARIA-CTR output) cipher salt: 9700657f5f34161830d7d85f5dc8 (ARIA-CTR cipher suite) 9700657f5f34161830d7d85f (ARIA-CCM or Kim et al. Expires June 20, 2011 [Page 11] Internet-Draft ARIA-SRTP December 22, 2010 ARIA-GCM cipher suite) index DIV kdr: 000000000000 label: 01 master salt: 0ec675ad498afeebb6960b3aabe6 ----------------------------------------------- xor: 0ec675ad498afeeab6960b3aabe6 (x, PRF input) x*2^16: 0ec675ad498afeeab6960b3aabe60000 (ARIA-CTR input) Below, the auth key is shown on the left, while the corresponding ARIA input blocks are shown on the right. auth key ARIA input blocks d021877bd3eaf92d581ed70ddc050e03 0ec675ad498afeeab6960b3aabe60000 f11257032676f2a29f57b21abd3a1423 0ec675ad498afeeab6960b3aabe60001 769749bdc5dd9ca5b43ca6b6c1f3a7de 0ec675ad498afeeab6960b3aabe60002 4047904bcf811f601cc03eaa5d7af6db 0ec675ad498afeeab6960b3aabe60003 9f88efa2e51ca832fc2a15b126fa7be2 0ec675ad498afeeab6960b3aabe60004 469af896acb1852c31d822c45799 0ec675ad498afeeab6960b3aabe60005 Authors' Addresses Woo-Hwan Kim National Security Research Institute P.O.Box 1, Yuseong, Daejeon, 305-350, Korea Email: whkim5@ensec.re.kr Jungkeun Lee National Security Research Institute P.O.Box 1, Yuseong, Daejeon, 305-350, Korea Email: jklee@ensec.re.kr Dong-Chan Kim National Security Research Institute P.O.Box 1, Yuseong, Daejeon, 305-350, Korea Email: dongchan@ensec.re.kr Kim et al. Expires June 20, 2011 [Page 12] Internet-Draft ARIA-SRTP December 22, 2010 Daesung Kwon National Security Research Institute P.O.Box 1, Yuseong, Daejeon, 305-350, Korea Email: ds_kwon@ensec.re.kr Choonsoo Kim National Security Research Institute P.O.Box 1, Yuseong, Daejeon, 305-350, Korea Email: jbr@ensec.re.kr Kim et al. Expires June 20, 2011 [Page 13]