rfc3711.txt 131 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139
  1. Network Working Group M. Baugher
  2. Request for Comments: 3711 D. McGrew
  3. Category: Standards Track Cisco Systems, Inc.
  4. M. Naslund
  5. E. Carrara
  6. K. Norrman
  7. Ericsson Research
  8. March 2004
  9. The Secure Real-time Transport Protocol (SRTP)
  10. Status of this Memo
  11. This document specifies an Internet standards track protocol for the
  12. Internet community, and requests discussion and suggestions for
  13. improvements. Please refer to the current edition of the "Internet
  14. Official Protocol Standards" (STD 1) for the standardization state
  15. and status of this protocol. Distribution of this memo is unlimited.
  16. Copyright Notice
  17. Copyright (C) The Internet Society (2004). All Rights Reserved.
  18. Abstract
  19. This document describes the Secure Real-time Transport Protocol
  20. (SRTP), a profile of the Real-time Transport Protocol (RTP), which
  21. can provide confidentiality, message authentication, and replay
  22. protection to the RTP traffic and to the control traffic for RTP, the
  23. Real-time Transport Control Protocol (RTCP).
  24. Table of Contents
  25. 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
  26. 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3
  27. 2. Goals and Features . . . . . . . . . . . . . . . . . . . . . . 4
  28. 2.1. Features . . . . . . . . . . . . . . . . . . . . . . . . 5
  29. 3. SRTP Framework . . . . . . . . . . . . . . . . . . . . . . . . 5
  30. 3.1. Secure RTP . . . . . . . . . . . . . . . . . . . . . . . 6
  31. 3.2. SRTP Cryptographic Contexts. . . . . . . . . . . . . . . 7
  32. 3.2.1. Transform-independent parameters . . . . . . . . 8
  33. 3.2.2. Transform-dependent parameters . . . . . . . . . 10
  34. 3.2.3. Mapping SRTP Packets to Cryptographic Contexts . 10
  35. 3.3. SRTP Packet Processing . . . . . . . . . . . . . . . . . 11
  36. 3.3.1. Packet Index Determination, and ROC, s_l Update. 13
  37. 3.3.2. Replay Protection. . . . . . . . . . . . . . . . 15
  38. 3.4. Secure RTCP . . . . . . . . . . . . . . . . . . . . . . . 15
  39. Baugher, et al. Standards Track [Page 1]
  40. RFC 3711 SRTP March 2004
  41. 4. Pre-Defined Cryptographic Transforms . . . . . . . . . . . . . 19
  42. 4.1. Encryption . . . . . . . . . . . . . . . . . . . . . . . 19
  43. 4.1.1. AES in Counter Mode. . . . . . . . . . . . . . . 21
  44. 4.1.2. AES in f8-mode . . . . . . . . . . . . . . . . . 22
  45. 4.1.3. NULL Cipher. . . . . . . . . . . . . . . . . . . 25
  46. 4.2. Message Authentication and Integrity . . . . . . . . . . 25
  47. 4.2.1. HMAC-SHA1. . . . . . . . . . . . . . . . . . . . 25
  48. 4.3. Key Derivation . . . . . . . . . . . . . . . . . . . . . 26
  49. 4.3.1. Key Derivation Algorithm . . . . . . . . . . . . 26
  50. 4.3.2. SRTCP Key Derivation . . . . . . . . . . . . . . 28
  51. 4.3.3. AES-CM PRF . . . . . . . . . . . . . . . . . . . 28
  52. 5. Default and mandatory-to-implement Transforms. . . . . . . . . 28
  53. 5.1. Encryption: AES-CM and NULL. . . . . . . . . . . . . . . 29
  54. 5.2. Message Authentication/Integrity: HMAC-SHA1. . . . . . . 29
  55. 5.3. Key Derivation: AES-CM PRF . . . . . . . . . . . . . . . 29
  56. 6. Adding SRTP Transforms . . . . . . . . . . . . . . . . . . . . 29
  57. 7. Rationale. . . . . . . . . . . . . . . . . . . . . . . . . . . 30
  58. 7.1. Key derivation . . . . . . . . . . . . . . . . . . . . . 30
  59. 7.2. Salting key. . . . . . . . . . . . . . . . . . . . . . . 30
  60. 7.3. Message Integrity from Universal Hashing . . . . . . . . 31
  61. 7.4. Data Origin Authentication Considerations. . . . . . . . 31
  62. 7.5. Short and Zero-length Message Authentication . . . . . . 32
  63. 8. Key Management Considerations. . . . . . . . . . . . . . . . . 33
  64. 8.1. Re-keying . . . . . . . . . . . . . . . . . . . . . . . 34
  65. 8.1.1. Use of the <From, To> for re-keying. . . . . . . 34
  66. 8.2. Key Management parameters. . . . . . . . . . . . . . . . 35
  67. 9. Security Considerations. . . . . . . . . . . . . . . . . . . . 37
  68. 9.1. SSRC collision and two-time pad. . . . . . . . . . . . . 37
  69. 9.2. Key Usage. . . . . . . . . . . . . . . . . . . . . . . . 38
  70. 9.3. Confidentiality of the RTP Payload . . . . . . . . . . . 39
  71. 9.4. Confidentiality of the RTP Header. . . . . . . . . . . . 40
  72. 9.5. Integrity of the RTP payload and header. . . . . . . . . 40
  73. 9.5.1. Risks of Weak or Null Message Authentication. . . 42
  74. 9.5.2. Implicit Header Authentication . . . . . . . . . 43
  75. 10. Interaction with Forward Error Correction mechanisms. . . . . 43
  76. 11. Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . 43
  77. 11.1. Unicast. . . . . . . . . . . . . . . . . . . . . . . . . 43
  78. 11.2. Multicast (one sender) . . . . . . . . . . . . . . . . . 44
  79. 11.3. Re-keying and access control . . . . . . . . . . . . . . 45
  80. 11.4. Summary of basic scenarios . . . . . . . . . . . . . . . 46
  81. 12. IANA Considerations. . . . . . . . . . . . . . . . . . . . . . 46
  82. 13. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 47
  83. 14. References . . . . . . . . . . . . . . . . . . . . . . . . . . 47
  84. 14.1. Normative References . . . . . . . . . . . . . . . . . . 47
  85. 14.2. Informative References . . . . . . . . . . . . . . . . . 48
  86. Appendix A: Pseudocode for Index Determination . . . . . . . . . . 51
  87. Appendix B: Test Vectors . . . . . . . . . . . . . . . . . . . . . 51
  88. B.1. AES-f8 Test Vectors. . . . . . . . . . . . . . . . . . . 51
  89. Baugher, et al. Standards Track [Page 2]
  90. RFC 3711 SRTP March 2004
  91. B.2. AES-CM Test Vectors. . . . . . . . . . . . . . . . . . . 52
  92. B.3. Key Derivation Test Vectors. . . . . . . . . . . . . . . 53
  93. Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 55
  94. Full Copyright Statement . . . . . . . . . . . . . . . . . . . . . 56
  95. 1. Introduction
  96. This document describes the Secure Real-time Transport Protocol
  97. (SRTP), a profile of the Real-time Transport Protocol (RTP), which
  98. can provide confidentiality, message authentication, and replay
  99. protection to the RTP traffic and to the control traffic for RTP,
  100. RTCP (the Real-time Transport Control Protocol) [RFC3350].
  101. SRTP provides a framework for encryption and message authentication
  102. of RTP and RTCP streams (Section 3). SRTP defines a set of default
  103. cryptographic transforms (Sections 4 and 5), and it allows new
  104. transforms to be introduced in the future (Section 6). With
  105. appropriate key management (Sections 7 and 8), SRTP is secure
  106. (Sections 9) for unicast and multicast RTP applications (Section 11).
  107. SRTP can achieve high throughput and low packet expansion. SRTP
  108. proves to be a suitable protection for heterogeneous environments
  109. (mix of wired and wireless networks). To get such features, default
  110. transforms are described, based on an additive stream cipher for
  111. encryption, a keyed-hash based function for message authentication,
  112. and an "implicit" index for sequencing/synchronization based on the
  113. RTP sequence number for SRTP and an index number for Secure RTCP
  114. (SRTCP).
  115. 1.1. Notational Conventions
  116. The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  117. "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
  118. document are to be interpreted as described in [RFC2119]. The
  119. terminology conforms to [RFC2828] with the following exception. For
  120. simplicity we use the term "random" throughout the document to denote
  121. randomly or pseudo-randomly generated values. Large amounts of
  122. random bits may be difficult to obtain, and for the security of SRTP,
  123. pseudo-randomness is sufficient [RFC1750].
  124. By convention, the adopted representation is the network byte order,
  125. i.e., the left most bit (octet) is the most significant one. By XOR
  126. we mean bitwise addition modulo 2 of binary strings, and || denotes
  127. concatenation. In other words, if C = A || B, then the most
  128. significant bits of C are the bits of A, and the least significant
  129. bits of C equal the bits of B. Hexadecimal numbers are prefixed by
  130. 0x.
  131. Baugher, et al. Standards Track [Page 3]
  132. RFC 3711 SRTP March 2004
  133. The word "encryption" includes also use of the NULL algorithm (which
  134. in practice does leave the data in the clear).
  135. With slight abuse of notation, we use the terms "message
  136. authentication" and "authentication tag" as is common practice, even
  137. though in some circumstances, e.g., group communication, the service
  138. provided is actually only integrity protection and not data origin
  139. authentication.
  140. 2. Goals and Features
  141. The security goals for SRTP are to ensure:
  142. * the confidentiality of the RTP and RTCP payloads, and
  143. * the integrity of the entire RTP and RTCP packets, together with
  144. protection against replayed packets.
  145. These security services are optional and independent from each other,
  146. except that SRTCP integrity protection is mandatory (malicious or
  147. erroneous alteration of RTCP messages could otherwise disrupt the
  148. processing of the RTP stream).
  149. Other, functional, goals for the protocol are:
  150. * a framework that permits upgrading with new cryptographic
  151. transforms,
  152. * low bandwidth cost, i.e., a framework preserving RTP header
  153. compression efficiency,
  154. and, asserted by the pre-defined transforms:
  155. * a low computational cost,
  156. * a small footprint (i.e., small code size and data memory for
  157. keying information and replay lists),
  158. * limited packet expansion to support the bandwidth economy goal,
  159. * independence from the underlying transport, network, and physical
  160. layers used by RTP, in particular high tolerance to packet loss
  161. and re-ordering.
  162. These properties ensure that SRTP is a suitable protection scheme for
  163. RTP/RTCP in both wired and wireless scenarios.
  164. Baugher, et al. Standards Track [Page 4]
  165. RFC 3711 SRTP March 2004
  166. 2.1. Features
  167. Besides the above mentioned direct goals, SRTP provides for some
  168. additional features. They have been introduced to lighten the burden
  169. on key management and to further increase security. They include:
  170. * A single "master key" can provide keying material for
  171. confidentiality and integrity protection, both for the SRTP stream
  172. and the corresponding SRTCP stream. This is achieved with a key
  173. derivation function (see Section 4.3), providing "session keys"
  174. for the respective security primitive, securely derived from the
  175. master key.
  176. * In addition, the key derivation can be configured to periodically
  177. refresh the session keys, which limits the amount of ciphertext
  178. produced by a fixed key, available for an adversary to
  179. cryptanalyze.
  180. * "Salting keys" are used to protect against pre-computation and
  181. time-memory tradeoff attacks [MF00] [BS00].
  182. Detailed rationale for these features can be found in Section 7.
  183. 3. SRTP Framework
  184. RTP is the Real-time Transport Protocol [RFC3550]. We define SRTP as
  185. a profile of RTP. This profile is an extension to the RTP
  186. Audio/Video Profile [RFC3551]. Except where explicitly noted, all
  187. aspects of that profile apply, with the addition of the SRTP security
  188. features. Conceptually, we consider SRTP to be a "bump in the stack"
  189. implementation which resides between the RTP application and the
  190. transport layer. SRTP intercepts RTP packets and then forwards an
  191. equivalent SRTP packet on the sending side, and intercepts SRTP
  192. packets and passes an equivalent RTP packet up the stack on the
  193. receiving side.
  194. Secure RTCP (SRTCP) provides the same security services to RTCP as
  195. SRTP does to RTP. SRTCP message authentication is MANDATORY and
  196. thereby protects the RTCP fields to keep track of membership, provide
  197. feedback to RTP senders, or maintain packet sequence counters. SRTCP
  198. is described in Section 3.4.
  199. Baugher, et al. Standards Track [Page 5]
  200. RFC 3711 SRTP March 2004
  201. 3.1. Secure RTP
  202. The format of an SRTP packet is illustrated in Figure 1.
  203. 0 1 2 3
  204. 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
  205. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<+
  206. |V=2|P|X| CC |M| PT | sequence number | |
  207. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
  208. | timestamp | |
  209. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
  210. | synchronization source (SSRC) identifier | |
  211. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ |
  212. | contributing source (CSRC) identifiers | |
  213. | .... | |
  214. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
  215. | RTP extension (OPTIONAL) | |
  216. +>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
  217. | | payload ... | |
  218. | | +-------------------------------+ |
  219. | | | RTP padding | RTP pad count | |
  220. +>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<+
  221. | ~ SRTP MKI (OPTIONAL) ~ |
  222. | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
  223. | : authentication tag (RECOMMENDED) : |
  224. | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
  225. | |
  226. +- Encrypted Portion* Authenticated Portion ---+
  227. Figure 1. The format of an SRTP packet. *Encrypted Portion is the
  228. same size as the plaintext for the Section 4 pre-defined transforms.
  229. The "Encrypted Portion" of an SRTP packet consists of the encryption
  230. of the RTP payload (including RTP padding when present) of the
  231. equivalent RTP packet. The Encrypted Portion MAY be the exact size
  232. of the plaintext or MAY be larger. Figure 1 shows the RTP payload
  233. including any possible padding for RTP [RFC3550].
  234. None of the pre-defined encryption transforms uses any padding; for
  235. these, the RTP and SRTP payload sizes match exactly. New transforms
  236. added to SRTP (following Section 6) may require padding, and may
  237. hence produce larger payloads. RTP provides its own padding format
  238. (as seen in Fig. 1), which due to the padding indicator in the RTP
  239. header has merits in terms of compactness relative to paddings using
  240. prefix-free codes. This RTP padding SHALL be the default method for
  241. transforms requiring padding. Transforms MAY specify other padding
  242. methods, and MUST then specify the amount, format, and processing of
  243. their padding. It is important to note that encryption transforms
  244. Baugher, et al. Standards Track [Page 6]
  245. RFC 3711 SRTP March 2004
  246. that use padding are vulnerable to subtle attacks, especially when
  247. message authentication is not used [V02]. Each specification for a
  248. new encryption transform needs to carefully consider and describe the
  249. security implications of the padding that it uses. Message
  250. authentication codes define their own padding, so this default does
  251. not apply to authentication transforms.
  252. The OPTIONAL MKI and the RECOMMENDED authentication tag are the only
  253. fields defined by SRTP that are not in RTP. Only 8-bit alignment is
  254. assumed.
  255. MKI (Master Key Identifier): configurable length, OPTIONAL. The
  256. MKI is defined, signaled, and used by key management. The
  257. MKI identifies the master key from which the session
  258. key(s) were derived that authenticate and/or encrypt the
  259. particular packet. Note that the MKI SHALL NOT identify
  260. the SRTP cryptographic context, which is identified
  261. according to Section 3.2.3. The MKI MAY be used by key
  262. management for the purposes of re-keying, identifying a
  263. particular master key within the cryptographic context
  264. (Section 3.2.1).
  265. Authentication tag: configurable length, RECOMMENDED. The
  266. authentication tag is used to carry message authentication
  267. data. The Authenticated Portion of an SRTP packet
  268. consists of the RTP header followed by the Encrypted
  269. Portion of the SRTP packet. Thus, if both encryption and
  270. authentication are applied, encryption SHALL be applied
  271. before authentication on the sender side and conversely on
  272. the receiver side. The authentication tag provides
  273. authentication of the RTP header and payload, and it
  274. indirectly provides replay protection by authenticating
  275. the sequence number. Note that the MKI is not integrity
  276. protected as this does not provide any extra protection.
  277. 3.2. SRTP Cryptographic Contexts
  278. Each SRTP stream requires the sender and receiver to maintain
  279. cryptographic state information. This information is called the
  280. "cryptographic context".
  281. SRTP uses two types of keys: session keys and master keys. By a
  282. "session key", we mean a key which is used directly in a
  283. cryptographic transform (e.g., encryption or message authentication),
  284. and by a "master key", we mean a random bit string (given by the key
  285. management protocol) from which session keys are derived in a
  286. Baugher, et al. Standards Track [Page 7]
  287. RFC 3711 SRTP March 2004
  288. cryptographically secure way. The master key(s) and other parameters
  289. in the cryptographic context are provided by key management
  290. mechanisms external to SRTP, see Section 8.
  291. 3.2.1. Transform-independent parameters
  292. Transform-independent parameters are present in the cryptographic
  293. context independently of the particular encryption or authentication
  294. transforms that are used. The transform-independent parameters of
  295. the cryptographic context for SRTP consist of:
  296. * a 32-bit unsigned rollover counter (ROC), which records how many
  297. times the 16-bit RTP sequence number has been reset to zero after
  298. passing through 65,535. Unlike the sequence number (SEQ), which
  299. SRTP extracts from the RTP packet header, the ROC is maintained by
  300. SRTP as described in Section 3.3.1.
  301. We define the index of the SRTP packet corresponding to a given
  302. ROC and RTP sequence number to be the 48-bit quantity
  303. i = 2^16 * ROC + SEQ.
  304. * for the receiver only, a 16-bit sequence number s_l, which can be
  305. thought of as the highest received RTP sequence number (see
  306. Section 3.3.1 for its handling), which SHOULD be authenticated
  307. since message authentication is RECOMMENDED,
  308. * an identifier for the encryption algorithm, i.e., the cipher and
  309. its mode of operation,
  310. * an identifier for the message authentication algorithm,
  311. * a replay list, maintained by the receiver only (when
  312. authentication and replay protection are provided), containing
  313. indices of recently received and authenticated SRTP packets,
  314. * an MKI indicator (0/1) as to whether an MKI is present in SRTP and
  315. SRTCP packets,
  316. * if the MKI indicator is set to one, the length (in octets) of the
  317. MKI field, and (for the sender) the actual value of the currently
  318. active MKI (the value of the MKI indicator and length MUST be kept
  319. fixed for the lifetime of the context),
  320. * the master key(s), which MUST be random and kept secret,
  321. Baugher, et al. Standards Track [Page 8]
  322. RFC 3711 SRTP March 2004
  323. * for each master key, there is a counter of the number of SRTP
  324. packets that have been processed (sent) with that master key
  325. (essential for security, see Sections 3.3.1 and 9),
  326. * non-negative integers n_e, and n_a, determining the length of the
  327. session keys for encryption, and message authentication.
  328. In addition, for each master key, an SRTP stream MAY use the
  329. following associated values:
  330. * a master salt, to be used in the key derivation of session keys.
  331. This value, when used, MUST be random, but MAY be public. Use of
  332. master salt is strongly RECOMMENDED, see Section 9.2. A "NULL"
  333. salt is treated as 00...0.
  334. * an integer in the set {1,2,4,...,2^24}, the "key_derivation_rate",
  335. where an unspecified value is treated as zero. The constraint to
  336. be a power of 2 simplifies the session-key derivation
  337. implementation, see Section 4.3.
  338. * an MKI value,
  339. * <From, To> values, specifying the lifetime for a master key,
  340. expressed in terms of the two 48-bit index values inside whose
  341. range (including the range end-points) the master key is valid.
  342. For the use of <From, To>, see Section 8.1.1. <From, To> is an
  343. alternative to the MKI and assumes that a master key is in one-
  344. to-one correspondence with the SRTP session key on which the
  345. <From, To> range is defined.
  346. SRTCP SHALL by default share the crypto context with SRTP, except:
  347. * no rollover counter and s_l-value need to be maintained as the
  348. RTCP index is explicitly carried in each SRTCP packet,
  349. * a separate replay list is maintained (when replay protection is
  350. provided),
  351. * SRTCP maintains a separate counter for its master key (even if the
  352. master key is the same as that for SRTP, see below), as a means to
  353. maintain a count of the number of SRTCP packets that have been
  354. processed with that key.
  355. Note in particular that the master key(s) MAY be shared between SRTP
  356. and the corresponding SRTCP, if the pre-defined transforms (including
  357. the key derivation) are used but the session key(s) MUST NOT be so
  358. shared.
  359. Baugher, et al. Standards Track [Page 9]
  360. RFC 3711 SRTP March 2004
  361. In addition, there can be cases (see Sections 8 and 9.1) where
  362. several SRTP streams within a given RTP session, identified by their
  363. synchronization source (SSRCs, which is part of the RTP header),
  364. share most of the crypto context parameters (including possibly
  365. master and session keys). In such cases, just as in the normal
  366. SRTP/SRTCP parameter sharing above, separate replay lists and packet
  367. counters for each stream (SSRC) MUST still be maintained. Also,
  368. separate SRTP indices MUST then be maintained.
  369. A summary of parameters, pre-defined transforms, and default values
  370. for the above parameters (and other SRTP parameters) can be found in
  371. Sections 5 and 8.2.
  372. 3.2.2. Transform-dependent parameters
  373. All encryption, authentication/integrity, and key derivation
  374. parameters are defined in the transforms section (Section 4).
  375. Typical examples of such parameters are block size of ciphers,
  376. session keys, data for the Initialization Vector (IV) formation, etc.
  377. Future SRTP transform specifications MUST include a section to list
  378. the additional cryptographic context's parameters for that transform,
  379. if any.
  380. 3.2.3. Mapping SRTP Packets to Cryptographic Contexts
  381. Recall that an RTP session for each participant is defined [RFC3550]
  382. by a pair of destination transport addresses (one network address
  383. plus a port pair for RTP and RTCP), and that a multimedia session is
  384. defined as a collection of RTP sessions. For example, a particular
  385. multimedia session could include an audio RTP session, a video RTP
  386. session, and a text RTP session.
  387. A cryptographic context SHALL be uniquely identified by the triplet
  388. context identifier:
  389. context id = <SSRC, destination network address, destination
  390. transport port number>
  391. where the destination network address and the destination transport
  392. port are the ones in the SRTP packet. It is assumed that, when
  393. presented with this information, the key management returns a context
  394. with the information as described in Section 3.2.
  395. As noted above, SRTP and SRTCP by default share the bulk of the
  396. parameters in the cryptographic context. Thus, retrieving the crypto
  397. context parameters for an SRTCP stream in practice may imply a
  398. binding to the correspondent SRTP crypto context. It is up to the
  399. implementation to assure such binding, since the RTCP port may not be
  400. Baugher, et al. Standards Track [Page 10]
  401. RFC 3711 SRTP March 2004
  402. directly deducible from the RTP port only. Alternatively, the key
  403. management may choose to provide separate SRTP- and SRTCP- contexts,
  404. duplicating the common parameters (such as master key(s)). The
  405. latter approach then also enables SRTP and SRTCP to use, e.g.,
  406. distinct transforms, if so desired. Similar considerations arise
  407. when multiple SRTP streams, forming part of one single RTP session,
  408. share keys and other parameters.
  409. If no valid context can be found for a packet corresponding to a
  410. certain context identifier, that packet MUST be discarded.
  411. 3.3. SRTP Packet Processing
  412. The following applies to SRTP. SRTCP is described in Section 3.4.
  413. Assuming initialization of the cryptographic context(s) has taken
  414. place via key management, the sender SHALL do the following to
  415. construct an SRTP packet:
  416. 1. Determine which cryptographic context to use as described in
  417. Section 3.2.3.
  418. 2. Determine the index of the SRTP packet using the rollover counter,
  419. the highest sequence number in the cryptographic context, and the
  420. sequence number in the RTP packet, as described in Section 3.3.1.
  421. 3. Determine the master key and master salt. This is done using the
  422. index determined in the previous step or the current MKI in the
  423. cryptographic context, according to Section 8.1.
  424. 4. Determine the session keys and session salt (if they are used by
  425. the transform) as described in Section 4.3, using master key,
  426. master salt, key_derivation_rate, and session key-lengths in the
  427. cryptographic context with the index, determined in Steps 2 and 3.
  428. 5. Encrypt the RTP payload to produce the Encrypted Portion of the
  429. packet (see Section 4.1, for the defined ciphers). This step uses
  430. the encryption algorithm indicated in the cryptographic context,
  431. the session encryption key and the session salt (if used) found in
  432. Step 4 together with the index found in Step 2.
  433. 6. If the MKI indicator is set to one, append the MKI to the packet.
  434. 7. For message authentication, compute the authentication tag for the
  435. Authenticated Portion of the packet, as described in Section 4.2.
  436. This step uses the current rollover counter, the authentication
  437. Baugher, et al. Standards Track [Page 11]
  438. RFC 3711 SRTP March 2004
  439. algorithm indicated in the cryptographic context, and the session
  440. authentication key found in Step 4. Append the authentication tag
  441. to the packet.
  442. 8. If necessary, update the ROC as in Section 3.3.1, using the packet
  443. index determined in Step 2.
  444. To authenticate and decrypt an SRTP packet, the receiver SHALL do the
  445. following:
  446. 1. Determine which cryptographic context to use as described in
  447. Section 3.2.3.
  448. 2. Run the algorithm in Section 3.3.1 to get the index of the SRTP
  449. packet. The algorithm uses the rollover counter and highest
  450. sequence number in the cryptographic context with the sequence
  451. number in the SRTP packet, as described in Section 3.3.1.
  452. 3. Determine the master key and master salt. If the MKI indicator in
  453. the context is set to one, use the MKI in the SRTP packet,
  454. otherwise use the index from the previous step, according to
  455. Section 8.1.
  456. 4. Determine the session keys, and session salt (if used by the
  457. transform) as described in Section 4.3, using master key, master
  458. salt, key_derivation_rate and session key-lengths in the
  459. cryptographic context with the index, determined in Steps 2 and 3.
  460. 5. For message authentication and replay protection, first check if
  461. the packet has been replayed (Section 3.3.2), using the Replay
  462. List and the index as determined in Step 2. If the packet is
  463. judged to be replayed, then the packet MUST be discarded, and the
  464. event SHOULD be logged.
  465. Next, perform verification of the authentication tag, using the
  466. rollover counter from Step 2, the authentication algorithm
  467. indicated in the cryptographic context, and the session
  468. authentication key from Step 4. If the result is "AUTHENTICATION
  469. FAILURE" (see Section 4.2), the packet MUST be discarded from
  470. further processing and the event SHOULD be logged.
  471. 6. Decrypt the Encrypted Portion of the packet (see Section 4.1, for
  472. the defined ciphers), using the decryption algorithm indicated in
  473. the cryptographic context, the session encryption key and salt (if
  474. used) found in Step 4 with the index from Step 2.
  475. Baugher, et al. Standards Track [Page 12]
  476. RFC 3711 SRTP March 2004
  477. 7. Update the rollover counter and highest sequence number, s_l, in
  478. the cryptographic context as in Section 3.3.1, using the packet
  479. index estimated in Step 2. If replay protection is provided, also
  480. update the Replay List as described in Section 3.3.2.
  481. 8. When present, remove the MKI and authentication tag fields from
  482. the packet.
  483. 3.3.1. Packet Index Determination, and ROC, s_l Update
  484. SRTP implementations use an "implicit" packet index for sequencing,
  485. i.e., not all of the index is explicitly carried in the SRTP packet.
  486. For the pre-defined transforms, the index i is used in replay
  487. protection (Section 3.3.2), encryption (Section 4.1), message
  488. authentication (Section 4.2), and for the key derivation (Section
  489. 4.3).
  490. When the session starts, the sender side MUST set the rollover
  491. counter, ROC, to zero. Each time the RTP sequence number, SEQ, wraps
  492. modulo 2^16, the sender side MUST increment ROC by one, modulo 2^32
  493. (see security aspects below). The sender's packet index is then
  494. defined as
  495. i = 2^16 * ROC + SEQ.
  496. Receiver-side implementations use the RTP sequence number to
  497. determine the correct index of a packet, which is the location of the
  498. packet in the sequence of all SRTP packets. A robust approach for
  499. the proper use of a rollover counter requires its handling and use to
  500. be well defined. In particular, out-of-order RTP packets with
  501. sequence numbers close to 2^16 or zero must be properly handled.
  502. The index estimate is based on the receiver's locally maintained ROC
  503. and s_l values. At the setup of the session, the ROC MUST be set to
  504. zero. Receivers joining an on-going session MUST be given the
  505. current ROC value using out-of-band signaling such as key-management
  506. signaling. Furthermore, the receiver SHALL initialize s_l to the RTP
  507. sequence number (SEQ) of the first observed SRTP packet (unless the
  508. initial value is provided by out of band signaling such as key
  509. management).
  510. On consecutive SRTP packets, the receiver SHOULD estimate the index
  511. as
  512. i = 2^16 * v + SEQ,
  513. where v is chosen from the set { ROC-1, ROC, ROC+1 } (modulo 2^32)
  514. such that i is closest (in modulo 2^48 sense) to the value 2^16 * ROC
  515. + s_l (see Appendix A for pseudocode).
  516. Baugher, et al. Standards Track [Page 13]
  517. RFC 3711 SRTP March 2004
  518. After the packet has been processed and authenticated (when enabled
  519. for SRTP packets for the session), the receiver MUST use v to
  520. conditionally update its s_l and ROC variables as follows. If
  521. v=(ROC-1) mod 2^32, then there is no update to s_l or ROC. If v=ROC,
  522. then s_l is set to SEQ if and only if SEQ is larger than the current
  523. s_l; there is no change to ROC. If v=(ROC+1) mod 2^32, then s_l is
  524. set to SEQ and ROC is set to v.
  525. After a re-keying occurs (changing to a new master key), the rollover
  526. counter always maintains its sequence of values, i.e., it MUST NOT be
  527. reset to zero.
  528. As the rollover counter is 32 bits long and the sequence number is 16
  529. bits long, the maximum number of packets belonging to a given SRTP
  530. stream that can be secured with the same key is 2^48 using the pre-
  531. defined transforms. After that number of SRTP packets have been sent
  532. with a given (master or session) key, the sender MUST NOT send any
  533. more packets with that key. (There exists a similar limit for SRTCP,
  534. which in practice may be more restrictive, see Section 9.2.) This
  535. limitation enforces a security benefit by providing an upper bound on
  536. the amount of traffic that can pass before cryptographic keys are
  537. changed. Re-keying (see Section 8.1) MUST be triggered, before this
  538. amount of traffic, and MAY be triggered earlier, e.g., for increased
  539. security and access control to media. Recurring key derivation by
  540. means of a non-zero key_derivation_rate (see Section 4.3), also gives
  541. stronger security but does not change the above absolute maximum
  542. value.
  543. On the receiver side, there is a caveat to updating s_l and ROC: if
  544. message authentication is not present, neither the initialization of
  545. s_l, nor the ROC update can be made completely robust. The
  546. receiver's "implicit index" approach works for the pre-defined
  547. transforms as long as the reorder and loss of the packets are not too
  548. great and bit-errors do not occur in unfortunate ways. In
  549. particular, 2^15 packets would need to be lost, or a packet would
  550. need to be 2^15 packets out of sequence before synchronization is
  551. lost. Such drastic loss or reorder is likely to disrupt the RTP
  552. application itself.
  553. The algorithm for the index estimate and ROC update is a matter of
  554. implementation, and should take into consideration the environment
  555. (e.g., packet loss rate) and the cases when synchronization is likely
  556. to be lost, e.g., when the initial sequence number (randomly chosen
  557. by RTP) is not known in advance (not sent in the key management
  558. protocol) but may be near to wrap modulo 2^16.
  559. Baugher, et al. Standards Track [Page 14]
  560. RFC 3711 SRTP March 2004
  561. A more elaborate and more robust scheme than the one given above is
  562. the handling of RTP's own "rollover counter", see Appendix A.1 of
  563. [RFC3550].
  564. 3.3.2. Replay Protection
  565. Secure replay protection is only possible when integrity protection
  566. is present. It is RECOMMENDED to use replay protection, both for RTP
  567. and RTCP, as integrity protection alone cannot assure security
  568. against replay attacks.
  569. A packet is "replayed" when it is stored by an adversary, and then
  570. re-injected into the network. When message authentication is
  571. provided, SRTP protects against such attacks through a Replay List.
  572. Each SRTP receiver maintains a Replay List, which conceptually
  573. contains the indices of all of the packets which have been received
  574. and authenticated. In practice, the list can use a "sliding window"
  575. approach, so that a fixed amount of storage suffices for replay
  576. protection. Packet indices which lag behind the packet index in the
  577. context by more than SRTP-WINDOW-SIZE can be assumed to have been
  578. received, where SRTP-WINDOW-SIZE is a receiver-side, implementation-
  579. dependent parameter and MUST be at least 64, but which MAY be set to
  580. a higher value.
  581. The receiver checks the index of an incoming packet against the
  582. replay list and the window. Only packets with index ahead of the
  583. window, or, inside the window but not already received, SHALL be
  584. accepted.
  585. After the packet has been authenticated (if necessary the window is
  586. first moved ahead), the replay list SHALL be updated with the new
  587. index.
  588. The Replay List can be efficiently implemented by using a bitmap to
  589. represent which packets have been received, as described in the
  590. Security Architecture for IP [RFC2401].
  591. 3.4. Secure RTCP
  592. Secure RTCP follows the definition of Secure RTP. SRTCP adds three
  593. mandatory new fields (the SRTCP index, an "encrypt-flag", and the
  594. authentication tag) and one optional field (the MKI) to the RTCP
  595. packet definition. The three mandatory fields MUST be appended to an
  596. RTCP packet in order to form an equivalent SRTCP packet. The added
  597. fields follow any other profile-specific extensions.
  598. Baugher, et al. Standards Track [Page 15]
  599. RFC 3711 SRTP March 2004
  600. According to Section 6.1 of [RFC3550], there is a REQUIRED packet
  601. format for compound packets. SRTCP MUST be given packets according
  602. to that requirement in the sense that the first part MUST be a sender
  603. report or a receiver report. However, the RTCP encryption prefix (a
  604. random 32-bit quantity) specified in that Section MUST NOT be used
  605. since, as is stated there, it is only applicable to the encryption
  606. method specified in [RFC3550] and is not needed by the cryptographic
  607. mechanisms used in SRTP.
  608. 0 1 2 3
  609. 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
  610. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<+
  611. |V=2|P| RC | PT=SR or RR | length | |
  612. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
  613. | SSRC of sender | |
  614. +>+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ |
  615. | ~ sender info ~ |
  616. | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
  617. | ~ report block 1 ~ |
  618. | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
  619. | ~ report block 2 ~ |
  620. | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
  621. | ~ ... ~ |
  622. | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
  623. | |V=2|P| SC | PT=SDES=202 | length | |
  624. | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ |
  625. | | SSRC/CSRC_1 | |
  626. | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
  627. | ~ SDES items ~ |
  628. | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ |
  629. | ~ ... ~ |
  630. +>+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ |
  631. | |E| SRTCP index | |
  632. | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<+
  633. | ~ SRTCP MKI (OPTIONAL) ~ |
  634. | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
  635. | : authentication tag : |
  636. | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
  637. | |
  638. +-- Encrypted Portion Authenticated Portion -----+
  639. Figure 2. An example of the format of a Secure RTCP packet,
  640. consisting of an underlying RTCP compound packet with a Sender Report
  641. and SDES packet.
  642. Baugher, et al. Standards Track [Page 16]
  643. RFC 3711 SRTP March 2004
  644. The Encrypted Portion of an SRTCP packet consists of the encryption
  645. (Section 4.1) of the RTCP payload of the equivalent compound RTCP
  646. packet, from the first RTCP packet, i.e., from the ninth (9) octet to
  647. the end of the compound packet. The Authenticated Portion of an
  648. SRTCP packet consists of the entire equivalent (eventually compound)
  649. RTCP packet, the E flag, and the SRTCP index (after any encryption
  650. has been applied to the payload).
  651. The added fields are:
  652. E-flag: 1 bit, REQUIRED
  653. The E-flag indicates if the current SRTCP packet is
  654. encrypted or unencrypted. Section 9.1 of [RFC3550] allows
  655. the split of a compound RTCP packet into two lower-layer
  656. packets, one to be encrypted and one to be sent in the
  657. clear. The E bit set to "1" indicates encrypted packet, and
  658. "0" indicates non-encrypted packet.
  659. SRTCP index: 31 bits, REQUIRED
  660. The SRTCP index is a 31-bit counter for the SRTCP packet.
  661. The index is explicitly included in each packet, in contrast
  662. to the "implicit" index approach used for SRTP. The SRTCP
  663. index MUST be set to zero before the first SRTCP packet is
  664. sent, and MUST be incremented by one, modulo 2^31, after
  665. each SRTCP packet is sent. In particular, after a re-key,
  666. the SRTCP index MUST NOT be reset to zero again.
  667. Authentication Tag: configurable length, REQUIRED
  668. The authentication tag is used to carry message
  669. authentication data.
  670. MKI: configurable length, OPTIONAL
  671. The MKI is the Master Key Indicator, and functions according
  672. to the MKI definition in Section 3.
  673. SRTCP uses the cryptographic context parameters and packet processing
  674. of SRTP by default, with the following changes:
  675. * The receiver does not need to "estimate" the index, as it is
  676. explicitly signaled in the packet.
  677. * Pre-defined SRTCP encryption is as specified in Section 4.1, but
  678. using the definition of the SRTCP Encrypted Portion given in this
  679. section, and using the SRTCP index as the index i. The encryption
  680. transform and related parameters SHALL by default be the same
  681. selected for the protection of the associated SRTP stream(s),
  682. while the NULL algorithm SHALL be applied to the RTCP packets not
  683. to be encrypted. SRTCP may have a different encryption transform
  684. Baugher, et al. Standards Track [Page 17]
  685. RFC 3711 SRTP March 2004
  686. than the one used by the corresponding SRTP. The expected use for
  687. this feature is when the former has NULL-encryption and the latter
  688. has a non NULL-encryption.
  689. The E-flag is assigned a value by the sender depending on whether the
  690. packet was encrypted or not.
  691. * SRTCP decryption is performed as in Section 4, but only if the E
  692. flag is equal to 1. If so, the Encrypted Portion is decrypted,
  693. using the SRTCP index as the index i. In case the E-flag is 0,
  694. the payload is simply left unmodified.
  695. * SRTCP replay protection is as defined in Section 3.3.2, but using
  696. the SRTCP index as the index i and a separate Replay List that is
  697. specific to SRTCP.
  698. * The pre-defined SRTCP authentication tag is specified as in
  699. Section 4.2, but with the Authenticated Portion of the SRTCP
  700. packet given in this section (which includes the index). The
  701. authentication transform and related parameters (e.g., key size)
  702. SHALL by default be the same as selected for the protection of the
  703. associated SRTP stream(s).
  704. * In the last step of the processing, only the sender needs to
  705. update the value of the SRTCP index by incrementing it modulo 2^31
  706. and for security reasons the sender MUST also check the number of
  707. SRTCP packets processed, see Section 9.2.
  708. Message authentication for RTCP is REQUIRED, as it is the control
  709. protocol (e.g., it has a BYE packet) for RTP.
  710. Precautions must be taken so that the packet expansion in SRTCP (due
  711. to the added fields) does not cause SRTCP messages to use more than
  712. their share of RTCP bandwidth. To avoid this, the following two
  713. measures MUST be taken:
  714. 1. When initializing the RTCP variable "avg_rtcp_size" defined in
  715. chapter 6.3 of [RFC3550], it MUST include the size of the fields
  716. that will be added by SRTCP (index, E-bit, authentication tag, and
  717. when present, the MKI).
  718. 2. When updating the "avg_rtcp_size" using the variable "packet_size"
  719. (section 6.3.3 of [RFC3550]), the value of "packet_size" MUST
  720. include the size of the additional fields added by SRTCP.
  721. Baugher, et al. Standards Track [Page 18]
  722. RFC 3711 SRTP March 2004
  723. With these measures in place the SRTCP messages will not use more
  724. than the allotted bandwidth. The effect of the size of the added
  725. fields on the SRTCP traffic will be that messages will be sent with
  726. longer packet intervals. The increase in the intervals will be
  727. directly proportional to size of the added fields. For the pre-
  728. defined transforms, the size of the added fields will be at least 14
  729. octets, and upper bounded depending on MKI and the authentication tag
  730. sizes.
  731. 4. Pre-Defined Cryptographic Transforms
  732. While there are numerous encryption and message authentication
  733. algorithms that can be used in SRTP, below we define default
  734. algorithms in order to avoid the complexity of specifying the
  735. encodings for the signaling of algorithm and parameter identifiers.
  736. The defined algorithms have been chosen as they fulfill the goals
  737. listed in Section 2. Recommendations on how to extend SRTP with new
  738. transforms are given in Section 6.
  739. 4.1. Encryption
  740. The following parameters are common to both pre-defined, non-NULL,
  741. encryption transforms specified in this section.
  742. * BLOCK_CIPHER-MODE indicates the block cipher used and its mode of
  743. operation
  744. * n_b is the bit-size of the block for the block cipher
  745. * k_e is the session encryption key
  746. * n_e is the bit-length of k_e
  747. * k_s is the session salting key
  748. * n_s is the bit-length of k_s
  749. * SRTP_PREFIX_LENGTH is the octet length of the keystream prefix, a
  750. non-negative integer, specified by the message authentication code
  751. in use.
  752. The distinct session keys and salts for SRTP/SRTCP are by default
  753. derived as specified in Section 4.3.
  754. The encryption transforms defined in SRTP map the SRTP packet index
  755. and secret key into a pseudo-random keystream segment. Each
  756. keystream segment encrypts a single RTP packet. The process of
  757. encrypting a packet consists of generating the keystream segment
  758. corresponding to the packet, and then bitwise exclusive-oring that
  759. keystream segment onto the payload of the RTP packet to produce the
  760. Encrypted Portion of the SRTP packet. In case the payload size is
  761. not an integer multiple of n_b bits, the excess (least significant)
  762. bits of the keystream are simply discarded. Decryption is done the
  763. same way, but swapping the roles of the plaintext and ciphertext.
  764. Baugher, et al. Standards Track [Page 19]
  765. RFC 3711 SRTP March 2004
  766. +----+ +------------------+---------------------------------+
  767. | KG |-->| Keystream Prefix | Keystream Suffix |---+
  768. +----+ +------------------+---------------------------------+ |
  769. |
  770. +---------------------------------+ v
  771. | Payload of RTP Packet |->(*)
  772. +---------------------------------+ |
  773. |
  774. +---------------------------------+ |
  775. | Encrypted Portion of SRTP Packet|<--+
  776. +---------------------------------+
  777. Figure 3: Default SRTP Encryption Processing. Here KG denotes the
  778. keystream generator, and (*) denotes bitwise exclusive-or.
  779. The definition of how the keystream is generated, given the index,
  780. depends on the cipher and its mode of operation. Below, two such
  781. keystream generators are defined. The NULL cipher is also defined,
  782. to be used when encryption of RTP is not required.
  783. The SRTP definition of the keystream is illustrated in Figure 3. The
  784. initial octets of each keystream segment MAY be reserved for use in a
  785. message authentication code, in which case the keystream used for
  786. encryption starts immediately after the last reserved octet. The
  787. initial reserved octets are called the "keystream prefix" (not to be
  788. confused with the "encryption prefix" of [RFC3550, Section 6.1]), and
  789. the remaining octets are called the "keystream suffix". The
  790. keystream prefix MUST NOT be used for encryption. The process is
  791. illustrated in Figure 3.
  792. The number of octets in the keystream prefix is denoted as
  793. SRTP_PREFIX_LENGTH. The keystream prefix is indicated by a positive,
  794. non-zero value of SRTP_PREFIX_LENGTH. This means that, even if
  795. confidentiality is not to be provided, the keystream generator output
  796. may still need to be computed for packet authentication, in which
  797. case the default keystream generator (mode) SHALL be used.
  798. The default cipher is the Advanced Encryption Standard (AES) [AES],
  799. and we define two modes of running AES, (1) Segmented Integer Counter
  800. Mode AES and (2) AES in f8-mode. In the remainder of this section,
  801. let E(k,x) be AES applied to key k and input block x.
  802. Baugher, et al. Standards Track [Page 20]
  803. RFC 3711 SRTP March 2004
  804. 4.1.1. AES in Counter Mode
  805. Conceptually, counter mode [AES-CTR] consists of encrypting
  806. successive integers. The actual definition is somewhat more
  807. complicated, in order to randomize the starting point of the integer
  808. sequence. Each packet is encrypted with a distinct keystream
  809. segment, which SHALL be computed as follows.
  810. A keystream segment SHALL be the concatenation of the 128-bit output
  811. blocks of the AES cipher in the encrypt direction, using key k = k_e,
  812. in which the block indices are in increasing order. Symbolically,
  813. each keystream segment looks like
  814. E(k, IV) || E(k, IV + 1 mod 2^128) || E(k, IV + 2 mod 2^128) ...
  815. where the 128-bit integer value IV SHALL be defined by the SSRC, the
  816. SRTP packet index i, and the SRTP session salting key k_s, as below.
  817. IV = (k_s * 2^16) XOR (SSRC * 2^64) XOR (i * 2^16)
  818. Each of the three terms in the XOR-sum above is padded with as many
  819. leading zeros as needed to make the operation well-defined,
  820. considered as a 128-bit value.
  821. The inclusion of the SSRC allows the use of the same key to protect
  822. distinct SRTP streams within the same RTP session, see the security
  823. caveats in Section 9.1.
  824. In the case of SRTCP, the SSRC of the first header of the compound
  825. packet MUST be used, i SHALL be the 31-bit SRTCP index and k_e, k_s
  826. SHALL be replaced by the SRTCP encryption session key and salt.
  827. Note that the initial value, IV, is fixed for each packet and is
  828. formed by "reserving" 16 zeros in the least significant bits for the
  829. purpose of the counter. The number of blocks of keystream generated
  830. for any fixed value of IV MUST NOT exceed 2^16 to avoid keystream
  831. re-use, see below. The AES has a block size of 128 bits, so 2^16
  832. output blocks are sufficient to generate the 2^23 bits of keystream
  833. needed to encrypt the largest possible RTP packet (except for IPv6
  834. "jumbograms" [RFC2675], which are not likely to be used for RTP-based
  835. multimedia traffic). This restriction on the maximum bit-size of the
  836. packet that can be encrypted ensures the security of the encryption
  837. method by limiting the effectiveness of probabilistic attacks [BDJR].
  838. For a particular Counter Mode key, each IV value used as an input
  839. MUST be distinct, in order to avoid the security exposure of a two-
  840. time pad situation (Section 9.1). To satisfy this constraint, an
  841. implementation MUST ensure that the combination of the SRTP packet
  842. Baugher, et al. Standards Track [Page 21]
  843. RFC 3711 SRTP March 2004
  844. index of ROC || SEQ, and the SSRC used in the construction of the IV
  845. are distinct for any particular key. The failure to ensure this
  846. uniqueness could be catastrophic for Secure RTP. This is in contrast
  847. to the situation for RTP itself, which may be able to tolerate such
  848. failures. It is RECOMMENDED that, if a dedicated security module is
  849. present, the RTP sequence numbers and SSRC either be generated or
  850. checked by that module (i.e., sequence-number and SSRC processing in
  851. an SRTP system needs to be protected as well as the key).
  852. 4.1.2. AES in f8-mode
  853. To encrypt UMTS (Universal Mobile Telecommunications System, as 3G
  854. networks) data, a solution (see [f8-a] [f8-b]) known as the f8-
  855. algorithm has been developed. On a high level, the proposed scheme
  856. is a variant of Output Feedback Mode (OFB) [HAC], with a more
  857. elaborate initialization and feedback function. As in normal OFB,
  858. the core consists of a block cipher. We also define here the use of
  859. AES as a block cipher to be used in what we shall call "f8-mode of
  860. operation" RTP encryption. The AES f8-mode SHALL use the same
  861. default sizes for session key and salt as AES counter mode.
  862. Figure 4 shows the structure of block cipher, E, running in f8-mode.
  863. Baugher, et al. Standards Track [Page 22]
  864. RFC 3711 SRTP March 2004
  865. IV
  866. |
  867. v
  868. +------+
  869. | |
  870. +--->| E |
  871. | +------+
  872. | |
  873. m -> (*) +-----------+-------------+-- ... ------+
  874. | IV' | | | |
  875. | | j=1 -> (*) j=2 -> (*) ... j=L-1 ->(*)
  876. | | | | |
  877. | | +-> (*) +-> (*) ... +-> (*)
  878. | | | | | | | |
  879. | v | v | v | v
  880. | +------+ | +------+ | +------+ | +------+
  881. k_e ---+--->| E | | | E | | | E | | | E |
  882. | | | | | | | | | | |
  883. +------+ | +------+ | +------+ | +------+
  884. | | | | | | |
  885. +------+ +--------+ +-- ... ----+ |
  886. | | | |
  887. v v v v
  888. S(0) S(1) S(2) . . . S(L-1)
  889. Figure 4. f8-mode of operation (asterisk, (*), denotes bitwise XOR).
  890. The figure represents the KG in Figure 3, when AES-f8 is used.
  891. 4.1.2.1. f8 Keystream Generation
  892. The Initialization Vector (IV) SHALL be determined as described in
  893. Section 4.1.2.2 (and in Section 4.1.2.3 for SRTCP).
  894. Let IV', S(j), and m denote n_b-bit blocks. The keystream,
  895. S(0) ||... || S(L-1), for an N-bit message SHALL be defined by
  896. setting IV' = E(k_e XOR m, IV), and S(-1) = 00..0. For
  897. j = 0,1,..,L-1 where L = N/n_b (rounded up to nearest integer if it
  898. is not already an integer) compute
  899. S(j) = E(k_e, IV' XOR j XOR S(j-1))
  900. Notice that the IV is not used directly. Instead it is fed through E
  901. under another key to produce an internal, "masked" value (denoted
  902. IV') to prevent an attacker from gaining known input/output pairs.
  903. Baugher, et al. Standards Track [Page 23]
  904. RFC 3711 SRTP March 2004
  905. The role of the internal counter, j, is to prevent short keystream
  906. cycles. The value of the key mask m SHALL be
  907. m = k_s || 0x555..5,
  908. i.e., the session salting key, appended by the binary pattern 0101..
  909. to fill out the entire desired key size, n_e.
  910. The sender SHOULD NOT generate more than 2^32 blocks, which is
  911. sufficient to generate 2^39 bits of keystream. Unlike counter mode,
  912. there is no absolute threshold above (below) which f8 is guaranteed
  913. to be insecure (secure). The above bound has been chosen to limit,
  914. with sufficient security margin, the probability of degenerative
  915. behavior in the f8 keystream generation.
  916. 4.1.2.2. f8 SRTP IV Formation
  917. The purpose of the following IV formation is to provide a feature
  918. which we call implicit header authentication (IHA), see Section 9.5.
  919. The SRTP IV for 128-bit block AES-f8 SHALL be formed in the following
  920. way:
  921. IV = 0x00 || M || PT || SEQ || TS || SSRC || ROC
  922. M, PT, SEQ, TS, SSRC SHALL be taken from the RTP header; ROC is from
  923. the cryptographic context.
  924. The presence of the SSRC as part of the IV allows AES-f8 to be used
  925. when a master key is shared between multiple streams within the same
  926. RTP session, see Section 9.1.
  927. 4.1.2.3. f8 SRTCP IV Formation
  928. The SRTCP IV for 128-bit block AES-f8 SHALL be formed in the
  929. following way:
  930. IV= 0..0 || E || SRTCP index || V || P || RC || PT || length || SSRC
  931. where V, P, RC, PT, length, SSRC SHALL be taken from the first header
  932. in the RTCP compound packet. E and SRTCP index are the 1-bit and
  933. 31-bit fields added to the packet.
  934. Baugher, et al. Standards Track [Page 24]
  935. RFC 3711 SRTP March 2004
  936. 4.1.3. NULL Cipher
  937. The NULL cipher is used when no confidentiality for RTP/RTCP is
  938. requested. The keystream can be thought of as "000..0", i.e., the
  939. encryption SHALL simply copy the plaintext input into the ciphertext
  940. output.
  941. 4.2. Message Authentication and Integrity
  942. Throughout this section, M will denote data to be integrity
  943. protected. In the case of SRTP, M SHALL consist of the Authenticated
  944. Portion of the packet (as specified in Figure 1) concatenated with
  945. the ROC, M = Authenticated Portion || ROC; in the case of SRTCP, M
  946. SHALL consist of the Authenticated Portion (as specified in Figure 2)
  947. only.
  948. Common parameters:
  949. * AUTH_ALG is the authentication algorithm
  950. * k_a is the session message authentication key
  951. * n_a is the bit-length of the authentication key
  952. * n_tag is the bit-length of the output authentication tag
  953. * SRTP_PREFIX_LENGTH is the octet length of the keystream prefix as
  954. defined above, a parameter of AUTH_ALG
  955. The distinct session authentication keys for SRTP/SRTCP are by
  956. default derived as specified in Section 4.3.
  957. The values of n_a, n_tag, and SRTP_PREFIX_LENGTH MUST be fixed for
  958. any particular fixed value of the key.
  959. We describe the process of computing authentication tags as follows.
  960. The sender computes the tag of M and appends it to the packet. The
  961. SRTP receiver verifies a message/authentication tag pair by computing
  962. a new authentication tag over M using the selected algorithm and key,
  963. and then compares it to the tag associated with the received message.
  964. If the two tags are equal, then the message/tag pair is valid;
  965. otherwise, it is invalid and the error audit message "AUTHENTICATION
  966. FAILURE" MUST be returned.
  967. 4.2.1. HMAC-SHA1
  968. The pre-defined authentication transform for SRTP is HMAC-SHA1
  969. [RFC2104]. With HMAC-SHA1, the SRTP_PREFIX_LENGTH (Figure 3) SHALL
  970. be 0. For SRTP (respectively SRTCP), the HMAC SHALL be applied to
  971. the session authentication key and M as specified above, i.e.,
  972. HMAC(k_a, M). The HMAC output SHALL then be truncated to the n_tag
  973. left-most bits.
  974. Baugher, et al. Standards Track [Page 25]
  975. RFC 3711 SRTP March 2004
  976. 4.3. Key Derivation
  977. 4.3.1. Key Derivation Algorithm
  978. Regardless of the encryption or message authentication transform that
  979. is employed (it may be an SRTP pre-defined transform or newly
  980. introduced according to Section 6), interoperable SRTP
  981. implementations MUST use the SRTP key derivation to generate session
  982. keys. Once the key derivation rate is properly signaled at the start
  983. of the session, there is no need for extra communication between the
  984. parties that use SRTP key derivation.
  985. packet index ---+
  986. |
  987. v
  988. +-----------+ master +--------+ session encr_key
  989. | ext | key | |---------->
  990. | key mgmt |-------->| key | session auth_key
  991. | (optional | | deriv |---------->
  992. | rekey) |-------->| | session salt_key
  993. | | master | |---------->
  994. +-----------+ salt +--------+
  995. Figure 5: SRTP key derivation.
  996. At least one initial key derivation SHALL be performed by SRTP, i.e.,
  997. the first key derivation is REQUIRED. Further applications of the
  998. key derivation MAY be performed, according to the
  999. "key_derivation_rate" value in the cryptographic context. The key
  1000. derivation function SHALL initially be invoked before the first
  1001. packet and then, when r > 0, a key derivation is performed whenever
  1002. index mod r equals zero. This can be thought of as "refreshing" the
  1003. session keys. The value of "key_derivation_rate" MUST be kept fixed
  1004. for the lifetime of the associated master key.
  1005. Interoperable SRTP implementations MAY also derive session salting
  1006. keys for encryption transforms, as is done in both of the pre-
  1007. defined transforms.
  1008. Let m and n be positive integers. A pseudo-random function family is
  1009. a set of keyed functions {PRF_n(k,x)} such that for the (secret)
  1010. random key k, given m-bit x, PRF_n(k,x) is an n-bit string,
  1011. computationally indistinguishable from random n-bit strings, see
  1012. [HAC]. For the purpose of key derivation in SRTP, a secure PRF with
  1013. m = 128 (or more) MUST be used, and a default PRF transform is
  1014. defined in Section 4.3.3.
  1015. Baugher, et al. Standards Track [Page 26]
  1016. RFC 3711 SRTP March 2004
  1017. Let "a DIV t" denote integer division of a by t, rounded down, and
  1018. with the convention that "a DIV 0 = 0" for all a. We also make the
  1019. convention of treating "a DIV t" as a bit string of the same length
  1020. as a, and thus "a DIV t" will in general have leading zeros.
  1021. Key derivation SHALL be defined as follows in terms of <label>, an
  1022. 8-bit constant (see below), master_salt and key_derivation_rate, as
  1023. determined in the cryptographic context, and index, the packet index
  1024. (i.e., the 48-bit ROC || SEQ for SRTP):
  1025. * Let r = index DIV key_derivation_rate (with DIV as defined above).
  1026. * Let key_id = <label> || r.
  1027. * Let x = key_id XOR master_salt, where key_id and master_salt are
  1028. aligned so that their least significant bits agree (right-
  1029. alignment).
  1030. <label> MUST be unique for each type of key to be derived. We
  1031. currently define <label> 0x00 to 0x05 (see below), and future
  1032. extensions MAY specify new values in the range 0x06 to 0xff for other
  1033. purposes. The n-bit SRTP key (or salt) for this packet SHALL then be
  1034. derived from the master key, k_master as follows:
  1035. PRF_n(k_master, x).
  1036. (The PRF may internally specify additional formatting and padding of
  1037. x, see e.g., Section 4.3.3 for the default PRF.)
  1038. The session keys and salt SHALL now be derived using:
  1039. - k_e (SRTP encryption): <label> = 0x00, n = n_e.
  1040. - k_a (SRTP message authentication): <label> = 0x01, n = n_a.
  1041. - k_s (SRTP salting key): <label> = 0x02, n = n_s.
  1042. where n_e, n_s, and n_a are from the cryptographic context.
  1043. The master key and master salt MUST be random, but the master salt
  1044. MAY be public.
  1045. Note that for a key_derivation_rate of 0, the application of the key
  1046. derivation SHALL take place exactly once.
  1047. The definition of DIV above is purely for notational convenience.
  1048. For a non-zero t among the set of allowed key derivation rates, "a
  1049. DIV t" can be implemented as a right-shift by the base-2 logarithm of
  1050. Baugher, et al. Standards Track [Page 27]
  1051. RFC 3711 SRTP March 2004
  1052. t. The derivation operation is further facilitated if the rates are
  1053. chosen to be powers of 256, but that granularity was considered too
  1054. coarse to be a requirement of this specification.
  1055. The upper limit on the number of packets that can be secured using
  1056. the same master key (see Section 9.2) is independent of the key
  1057. derivation.
  1058. 4.3.2. SRTCP Key Derivation
  1059. SRTCP SHALL by default use the same master key (and master salt) as
  1060. SRTP. To do this securely, the following changes SHALL be done to
  1061. the definitions in Section 4.3.1 when applying session key derivation
  1062. for SRTCP.
  1063. Replace the SRTP index by the 32-bit quantity: 0 || SRTCP index
  1064. (i.e., excluding the E-bit, replacing it with a fixed 0-bit), and use
  1065. <label> = 0x03 for the SRTCP encryption key, <label> = 0x04 for the
  1066. SRTCP authentication key, and, <label> = 0x05 for the SRTCP salting
  1067. key.
  1068. 4.3.3. AES-CM PRF
  1069. The currently defined PRF, keyed by 128, 192, or 256 bit master key,
  1070. has input block size m = 128 and can produce n-bit outputs for n up
  1071. to 2^23. PRF_n(k_master,x) SHALL be AES in Counter Mode as described
  1072. in Section 4.1.1, applied to key k_master, and IV equal to (x*2^16),
  1073. and with the output keystream truncated to the n first (left-most)
  1074. bits. (Requiring n/128, rounded up, applications of AES.)
  1075. 5. Default and mandatory-to-implement Transforms
  1076. The default transforms also are mandatory-to-implement transforms in
  1077. SRTP. Of course, "mandatory-to-implement" does not imply
  1078. "mandatory-to-use". Table 1 summarizes the pre-defined transforms.
  1079. The default values below are valid for the pre-defined transforms.
  1080. mandatory-to-impl. optional default
  1081. encryption AES-CM, NULL AES-f8 AES-CM
  1082. message integrity HMAC-SHA1 - HMAC-SHA1
  1083. key derivation (PRF) AES-CM - AES-CM
  1084. Table 1: Mandatory-to-implement, optional and default transforms in
  1085. SRTP and SRTCP.
  1086. Baugher, et al. Standards Track [Page 28]
  1087. RFC 3711 SRTP March 2004
  1088. 5.1. Encryption: AES-CM and NULL
  1089. AES running in Segmented Integer Counter Mode, as defined in Section
  1090. 4.1.1, SHALL be the default encryption algorithm. The default key
  1091. lengths SHALL be 128-bit for the session encryption key (n_e). The
  1092. default session salt key-length (n_s) SHALL be 112 bits.
  1093. The NULL cipher SHALL also be mandatory-to-implement.
  1094. 5.2. Message Authentication/Integrity: HMAC-SHA1
  1095. HMAC-SHA1, as defined in Section 4.2.1, SHALL be the default message
  1096. authentication code. The default session authentication key-length
  1097. (n_a) SHALL be 160 bits, the default authentication tag length
  1098. (n_tag) SHALL be 80 bits, and the SRTP_PREFIX_LENGTH SHALL be zero
  1099. for HMAC-SHA1. In addition, for SRTCP, the pre-defined HMAC-SHA1
  1100. MUST NOT be applied with a value of n_tag, nor n_a, that are smaller
  1101. than these defaults. For SRTP, smaller values are NOT RECOMMENDED,
  1102. but MAY be used after careful consideration of the issues in Section
  1103. 7.5 and 9.5.
  1104. 5.3. Key Derivation: AES-CM PRF
  1105. The AES Counter Mode based key derivation and PRF defined in Sections
  1106. 4.3.1 to 4.3.3, using a 128-bit master key, SHALL be the default
  1107. method for generating session keys. The default master salt length
  1108. SHALL be 112 bits and the default key-derivation rate SHALL be zero.
  1109. 6. Adding SRTP Transforms
  1110. Section 4 provides examples of the level of detail needed for
  1111. defining transforms. Whenever a new transform is to be added to
  1112. SRTP, a companion standard track RFC MUST be written to exactly
  1113. define how the new transform can be used with SRTP (and SRTCP). Such
  1114. a companion RFC SHOULD avoid overlap with the SRTP protocol document.
  1115. Note however, that it MAY be necessary to extend the SRTP or SRTCP
  1116. cryptographic context definition with new parameters (including fixed
  1117. or default values), add steps to the packet processing, or even add
  1118. fields to the SRTP/SRTCP packets. The companion RFC SHALL explain
  1119. any known issues regarding interactions between the transform and
  1120. other aspects of SRTP.
  1121. Each new transform document SHOULD specify its key attributes, e.g.,
  1122. size of keys (minimum, maximum, recommended), format of keys,
  1123. recommended/required processing of input keying material,
  1124. requirements/recommendations on key lifetime, re-keying and key
  1125. derivation, whether sharing of keys between SRTP and SRTCP is allowed
  1126. or not, etc.
  1127. Baugher, et al. Standards Track [Page 29]
  1128. RFC 3711 SRTP March 2004
  1129. An added message integrity transform SHOULD define a minimum
  1130. acceptable key/tag size for SRTCP, equivalent in strength to the
  1131. minimum values as defined in Section 5.2.
  1132. 7. Rationale
  1133. This section explains the rationale behind several important features
  1134. of SRTP.
  1135. 7.1. Key derivation
  1136. Key derivation reduces the burden on the key establishment. As many
  1137. as six different keys are needed per crypto context (SRTP and SRTCP
  1138. encryption keys and salts, SRTP and SRTCP authentication keys), but
  1139. these are derived from a single master key in a cryptographically
  1140. secure way. Thus, the key management protocol needs to exchange only
  1141. one master key (plus master salt when required), and then SRTP itself
  1142. derives all the necessary session keys (via the first, mandatory
  1143. application of the key derivation function).
  1144. Multiple applications of the key derivation function are optional,
  1145. but will give security benefits when enabled. They prevent an
  1146. attacker from obtaining large amounts of ciphertext produced by a
  1147. single fixed session key. If the attacker was able to collect a
  1148. large amount of ciphertext for a certain session key, he might be
  1149. helped in mounting certain attacks.
  1150. Multiple applications of the key derivation function provide
  1151. backwards and forward security in the sense that a compromised
  1152. session key does not compromise other session keys derived from the
  1153. same master key. This means that the attacker who is able to recover
  1154. a certain session key, is anyway not able to have access to messages
  1155. secured under previous and later session keys (derived from the same
  1156. master key). (Note that, of course, a leaked master key reveals all
  1157. the session keys derived from it.)
  1158. Considerations arise with high-rate key refresh, especially in large
  1159. multicast settings, see Section 11.
  1160. 7.2. Salting key
  1161. The master salt guarantees security against off-line key-collision
  1162. attacks on the key derivation that might otherwise reduce the
  1163. effective key size [MF00].
  1164. Baugher, et al. Standards Track [Page 30]
  1165. RFC 3711 SRTP March 2004
  1166. The derived session salting key used in the encryption, has been
  1167. introduced to protect against some attacks on additive stream
  1168. ciphers, see Section 9.2. The explicit inclusion method of the salt
  1169. in the IV has been selected for ease of hardware implementation.
  1170. 7.3. Message Integrity from Universal Hashing
  1171. The particular definition of the keystream given in Section 4.1 (the
  1172. keystream prefix) is to give provision for particular universal hash
  1173. functions, suitable for message authentication in the Wegman-Carter
  1174. paradigm [WC81]. Such functions are provably secure, simple, quick,
  1175. and especially appropriate for Digital Signal Processors and other
  1176. processors with a fast multiply operation.
  1177. No authentication transforms are currently provided in SRTP other
  1178. than HMAC-SHA1. Future transforms, like the above mentioned
  1179. universal hash functions, MAY be added following the guidelines in
  1180. Section 6.
  1181. 7.4. Data Origin Authentication Considerations
  1182. Note that in pair-wise communications, integrity and data origin
  1183. authentication are provided together. However, in group scenarios
  1184. where the keys are shared between members, the MAC tag only proves
  1185. that a member of the group sent the packet, but does not prevent
  1186. against a member impersonating another. Data origin authentication
  1187. (DOA) for multicast and group RTP sessions is a hard problem that
  1188. needs a solution; while some promising proposals are being
  1189. investigated [PCST1] [PCST2], more work is needed to rigorously
  1190. specify these technologies. Thus SRTP data origin authentication in
  1191. groups is for further study.
  1192. DOA can be done otherwise using signatures. However, this has high
  1193. impact in terms of bandwidth and processing time, therefore we do not
  1194. offer this form of authentication in the pre-defined packet-integrity
  1195. transform.
  1196. The presence of mixers and translators does not allow data origin
  1197. authentication in case the RTP payload and/or the RTP header are
  1198. manipulated. Note that these types of middle entities also disrupt
  1199. end-to-end confidentiality (as the IV formation depends e.g., on the
  1200. RTP header preservation). A certain trust model may choose to trust
  1201. the mixers/translators to decrypt/re-encrypt the media (this would
  1202. imply breaking the end-to-end security, with related security
  1203. implications).
  1204. Baugher, et al. Standards Track [Page 31]
  1205. RFC 3711 SRTP March 2004
  1206. 7.5. Short and Zero-length Message Authentication
  1207. As shown in Figure 1, the authentication tag is RECOMMENDED in SRTP.
  1208. A full 80-bit authentication-tag SHOULD be used, but a shorter tag or
  1209. even a zero-length tag (i.e., no message authentication) MAY be used
  1210. under certain conditions to support either of the following two
  1211. application environments.
  1212. 1. Strong authentication can be impractical in environments where
  1213. bandwidth preservation is imperative. An important special
  1214. case is wireless communication systems, in which bandwidth is a
  1215. scarce and expensive resource. Studies have shown that for
  1216. certain applications and link technologies, additional bytes
  1217. may result in a significant decrease in spectrum efficiency
  1218. [SWO]. Considerable effort has been made to design IP header
  1219. compression techniques to improve spectrum efficiency
  1220. [RFC3095]. A typical voice application produces 20 byte
  1221. samples, and the RTP, UDP and IP headers need to be jointly
  1222. compressed to one or two bytes on average in order to obtain
  1223. acceptable wireless bandwidth economy [RFC3095]. In this case,
  1224. strong authentication would impose nearly fifty percent
  1225. overhead.
  1226. 2. Authentication is impractical for applications that use data
  1227. links with fixed-width fields that cannot accommodate the
  1228. expansion due to the authentication tag. This is the case for
  1229. some important existing wireless channels. For example, zero-
  1230. byte header compression is used to adapt EVRC/SMV voice with
  1231. the legacy IS-95 bearer channel in CDMA2000 VoIP services. It
  1232. was found that not a single additional octet could be added to
  1233. the data, which motivated the creation of a zero-byte profile
  1234. for ROHC [RFC3242].
  1235. A short tag is secure for a restricted set of applications. Consider
  1236. a voice telephony application, for example, such as a G.729 audio
  1237. codec with a 20-millisecond packetization interval, protected by a
  1238. 32-bit message authentication tag. The likelihood of any given
  1239. packet being successfully forged is only one in 2^32. Thus an
  1240. adversary can control no more than 20 milliseconds of audio output
  1241. during a 994-day period, on average. In contrast, the effect of a
  1242. single forged packet can be much larger if the application is
  1243. stateful. A codec that uses relative or predictive compression
  1244. across packets will propagate the maliciously generated state,
  1245. affecting a longer duration of output.
  1246. Baugher, et al. Standards Track [Page 32]
  1247. RFC 3711 SRTP March 2004
  1248. Certainly not all SRTP or telephony applications meet the criteria
  1249. for short or zero-length authentication tags. Section 9.5.1
  1250. discusses the risks of weak or no message authentication, and section
  1251. 9.5 describes the circumstances when it is acceptable and when it is
  1252. unacceptable.
  1253. 8. Key Management Considerations
  1254. There are emerging key management standards [MIKEY] [KEYMGT] [SDMS]
  1255. for establishing an SRTP cryptographic context (e.g., an SRTP master
  1256. key). Both proprietary and open-standard key management methods are
  1257. likely to be used for telephony applications [MIKEY] [KINK] and
  1258. multicast applications [GDOI]. This section provides guidance for
  1259. key management systems that service SRTP session.
  1260. For initialization, an interoperable SRTP implementation SHOULD be
  1261. given the SSRC and MAY be given the initial RTP sequence number for
  1262. the RTP stream by key management (thus, key management has a
  1263. dependency on RTP operational parameters). Sending the RTP sequence
  1264. number in the key management may be useful e.g., when the initial
  1265. sequence number is close to wrapping (to avoid synchronization
  1266. problems), and to communicate the current sequence number to a
  1267. joining endpoint (to properly initialize its replay list).
  1268. If the pre-defined transforms are used, SRTP allows sharing of the
  1269. same master key between SRTP/SRTCP streams belonging to the same RTP
  1270. session.
  1271. First, sharing between SRTP streams belonging to the same RTP session
  1272. is secure if the design of the synchronization mechanism, i.e., the
  1273. IV, avoids keystream re-use (the two-time pad, Section 9.1). This is
  1274. taken care of by the fact that RTP provides for unique SSRCs for
  1275. streams belonging to the same RTP session. See Section 9.1 for
  1276. further discussion.
  1277. Second, sharing between SRTP and the corresponding SRTCP is secure.
  1278. The fact that an SRTP stream and its associated SRTCP stream both
  1279. carry the same SSRC does not constitute a problem for the two-time
  1280. pad due to the key derivation. Thus, SRTP and SRTCP corresponding to
  1281. one RTP session MAY share master keys (as they do by default).
  1282. Note that message authentication also has a dependency on SSRC
  1283. uniqueness that is unrelated to the problem of keystream reuse: SRTP
  1284. streams authenticated under the same key MUST have a distinct SSRC in
  1285. order to identify the sender of the message. This requirement is
  1286. needed because the SSRC is the cryptographically authenticated field
  1287. Baugher, et al. Standards Track [Page 33]
  1288. RFC 3711 SRTP March 2004
  1289. used to distinguish between different SRTP streams. Were two streams
  1290. to use identical SSRC values, then an adversary could substitute
  1291. messages from one stream into the other without detection.
  1292. SRTP/SRTCP MUST NOT share master keys under any other circumstances
  1293. than the ones given above, i.e., between SRTP and its corresponding
  1294. SRTCP, and, between streams belonging to the same RTP session.
  1295. 8.1. Re-keying
  1296. The recommended way for a particular key management system to provide
  1297. re-key within SRTP is by associating a master key in a crypto context
  1298. with an MKI.
  1299. This provides for easy master key retrieval (see Scenarios in Section
  1300. 11), but has the disadvantage of adding extra bits to each packet.
  1301. As noted in Section 7.5, some wireless links do not cater for added
  1302. bits, therefore SRTP also defines a more economic way of triggering
  1303. re-keying, via use of <From, To>, which works in some specific,
  1304. simple scenarios (see Section 8.1.1).
  1305. SRTP senders SHALL count the amount of SRTP and SRTCP traffic being
  1306. used for a master key and invoke key management to re-key if needed
  1307. (Section 9.2). These interactions are defined by the key management
  1308. interface to SRTP and are not defined by this protocol specification.
  1309. 8.1.1. Use of the <From, To> for re-keying
  1310. In addition to the use of the MKI, SRTP defines another optional
  1311. mechanism for master key retrieval, the <From, To>. The <From, To>
  1312. specifies the range of SRTP indices (a pair of sequence number and
  1313. ROC) within which a certain master key is valid, and is (when used)
  1314. part of the crypto context. By looking at the 48-bit SRTP index of
  1315. the current SRTP packet, the corresponding master key can be found by
  1316. determining which From-To interval it belongs to. For SRTCP, the
  1317. most recently observed/used SRTP index (which can be obtained from
  1318. the cryptographic context) is used for this purpose, even though
  1319. SRTCP has its own (31-bit) index (see caveat below).
  1320. This method, compared to the MKI, has the advantage of identifying
  1321. the master key and defining its lifetime without adding extra bits to
  1322. each packet. This could be useful, as already noted, for some
  1323. wireless links that do not cater for added bits. However, its use
  1324. SHOULD be limited to specific, very simple scenarios. We recommend
  1325. to limit its use when the RTP session is a simple unidirectional or
  1326. bi-directional stream. This is because in case of multiple streams,
  1327. it is difficult to trigger the re-key based on the <From, To> of a
  1328. single RTP stream. For example, if several streams share a master
  1329. Baugher, et al. Standards Track [Page 34]
  1330. RFC 3711 SRTP March 2004
  1331. key, there is no simple one-to-one correspondence between the index
  1332. sequence space of a certain stream, and the index sequence space on
  1333. which the <From, To> values are based. Consequently, when a master
  1334. key is shared between streams, one of these streams MUST be
  1335. designated by key management as the one whose index space defines the
  1336. re-keying points. Also, the re-key triggering on SRTCP is based on
  1337. the correspondent SRTP stream, i.e., when the SRTP stream changes the
  1338. master key, so does the correspondent SRTCP. This becomes obviously
  1339. more and more complex with multiple streams.
  1340. The default values for the <From, To> are "from the first observed
  1341. packet" and "until further notice". However, the maximum limit of
  1342. SRTP/SRTCP packets that are sent under each given master/session key
  1343. (Section 9.2) MUST NOT be exceeded.
  1344. In case the <From, To> is used as key retrieval, then the MKI is not
  1345. inserted in the packet (and its indicator in the crypto context is
  1346. zero). However, using the MKI does not exclude using <From, To> key
  1347. lifetime simultaneously. This can for instance be useful to signal
  1348. at the sender side at which point in time an MKI is to be made
  1349. active.
  1350. 8.2. Key Management parameters
  1351. The table below lists all SRTP parameters that key management can
  1352. supply. For reference, it also provides a summary of the default and
  1353. mandatory-to-support values for an SRTP implementation as described
  1354. in Section 5.
  1355. Baugher, et al. Standards Track [Page 35]
  1356. RFC 3711 SRTP March 2004
  1357. Parameter Mandatory-to-support Default
  1358. --------- -------------------- -------
  1359. SRTP and SRTCP encr transf. AES_CM, NULL AES_CM
  1360. (Other possible values: AES_f8)
  1361. SRTP and SRTCP auth transf. HMAC-SHA1 HMAC-SHA1
  1362. SRTP and SRTCP auth params:
  1363. n_tag (tag length) 80 80
  1364. SRTP prefix_length 0 0
  1365. Key derivation PRF AES_CM AES_CM
  1366. Key material params
  1367. (for each master key):
  1368. master key length 128 128
  1369. n_e (encr session key length) 128 128
  1370. n_a (auth session key length) 160 160
  1371. master salt key
  1372. length of the master salt 112 112
  1373. n_s (session salt key length) 112 112
  1374. key derivation rate 0 0
  1375. key lifetime
  1376. SRTP-packets-max-lifetime 2^48 2^48
  1377. SRTCP-packets-max-lifetime 2^31 2^31
  1378. from-to-lifetime <From, To>
  1379. MKI indicator 0 0
  1380. length of the MKI 0 0
  1381. value of the MKI
  1382. Crypto context index params:
  1383. SSRC value
  1384. ROC
  1385. SEQ
  1386. SRTCP Index
  1387. Transport address
  1388. Port number
  1389. Relation to other RTP profiles:
  1390. sender's order between FEC and SRTP FEC-SRTP FEC-SRTP
  1391. (see Section 10)
  1392. Baugher, et al. Standards Track [Page 36]
  1393. RFC 3711 SRTP March 2004
  1394. 9. Security Considerations
  1395. 9.1. SSRC collision and two-time pad
  1396. Any fixed keystream output, generated from the same key and index
  1397. MUST only be used to encrypt once. Re-using such keystream (jokingly
  1398. called a "two-time pad" system by cryptographers), can seriously
  1399. compromise security. The NSA's VENONA project [C99] provides a
  1400. historical example of such a compromise. It is REQUIRED that
  1401. automatic key management be used for establishing and maintaining
  1402. SRTP and SRTCP keying material; this requirement is to avoid
  1403. keystream reuse, which is more likely to occur with manual key
  1404. management. Furthermore, in SRTP, a "two-time pad" is avoided by
  1405. requiring the key, or some other parameter of cryptographic
  1406. significance, to be unique per RTP/RTCP stream and packet. The pre-
  1407. defined SRTP transforms accomplish packet-uniqueness by including the
  1408. packet index and stream-uniqueness by inclusion of the SSRC.
  1409. The pre-defined transforms (AES-CM and AES-f8) allow master keys to
  1410. be shared across streams belonging to the same RTP session by the
  1411. inclusion of the SSRC in the IV. A master key MUST NOT be shared
  1412. among different RTP sessions.
  1413. Thus, the SSRC MUST be unique between all the RTP streams within the
  1414. same RTP session that share the same master key. RTP itself provides
  1415. an algorithm for detecting SSRC collisions within the same RTP
  1416. session. Thus, temporary collisions could lead to temporary two-time
  1417. pad, in the unfortunate event that SSRCs collide at a point in time
  1418. when the streams also have identical sequence numbers (occurring with
  1419. probability roughly 2^(-48)). Therefore, the key management SHOULD
  1420. take care of avoiding such SSRC collisions by including the SSRCs to
  1421. be used in the session as negotiation parameters, proactively
  1422. assuring their uniqueness. This is a strong requirements in
  1423. scenarios where for example, there are multiple senders that can
  1424. start to transmit simultaneously, before SSRC collision are detected
  1425. at the RTP level.
  1426. Note also that even with distinct SSRCs, extensive use of the same
  1427. key might improve chances of probabilistic collision and time-
  1428. memory-tradeoff attacks succeeding.
  1429. As described, master keys MAY be shared between streams belonging to
  1430. the same RTP session, but it is RECOMMENDED that each SSRC have its
  1431. own master key. When master keys are shared among SSRC participants
  1432. and SSRCs are managed by a key management module as recommended
  1433. above, the RECOMMENDED policy for an SSRC collision error is for the
  1434. participant to leave the SRTP session as it is a sign of malfunction.
  1435. Baugher, et al. Standards Track [Page 37]
  1436. RFC 3711 SRTP March 2004
  1437. 9.2. Key Usage
  1438. The effective key size is determined (upper bounded) by the size of
  1439. the master key and, for encryption, the size of the salting key. Any
  1440. additive stream cipher is vulnerable to attacks that use statistical
  1441. knowledge about the plaintext source to enable key collision and
  1442. time-memory tradeoff attacks [MF00] [H80] [BS00]. These attacks take
  1443. advantage of commonalities among plaintexts, and provide a way for a
  1444. cryptanalyst to amortize the computational effort of decryption over
  1445. many keys, or over many bytes of output, thus reducing the effective
  1446. key size of the cipher. A detailed analysis of these attacks and
  1447. their applicability to the encryption of Internet traffic is provided
  1448. in [MF00]. In summary, the effective key size of SRTP when used in a
  1449. security system in which m distinct keys are used, is equal to the
  1450. key size of the cipher less the logarithm (base two) of m.
  1451. Protection against such attacks can be provided simply by increasing
  1452. the size of the keys used, which here can be accomplished by the use
  1453. of the salting key. Note that the salting key MUST be random but MAY
  1454. be public. A salt size of (the suggested) size 112 bits protects
  1455. against attacks in scenarios where at most 2^112 keys are in use.
  1456. This is sufficient for all practical purposes.
  1457. Implementations SHOULD use keys that are as large as possible.
  1458. Please note that in many cases increasing the key size of a cipher
  1459. does not affect the throughput of that cipher.
  1460. The use of the SRTP and SRTCP indices in the pre-defined transforms
  1461. fixes the maximum number of packets that can be secured with the same
  1462. key. This limit is fixed to 2^48 SRTP packets for an SRTP stream,
  1463. and 2^31 SRTCP packets, when SRTP and SRTCP are considered
  1464. independently. Due to for example re-keying, reaching this limit may
  1465. or may not coincide with wrapping of the indices, and thus the sender
  1466. MUST keep packet counts. However, when the session keys for related
  1467. SRTP and SRTCP streams are derived from the same master key (the
  1468. default behavior, Section 4.3), the upper bound that has to be
  1469. considered is in practice the minimum of the two quantities. That
  1470. is, when 2^48 SRTP packets or 2^31 SRTCP packets have been secured
  1471. with the same key (whichever occurs before), the key management MUST
  1472. be called to provide new master key(s) (previously stored and used
  1473. keys MUST NOT be used again), or the session MUST be terminated. If
  1474. a sender of RTCP discovers that the sender of SRTP (or SRTCP) has not
  1475. updated the master or session key prior to sending 2^48 SRTP (or 2^31
  1476. SRTCP) packets belonging to the same SRTP (SRTCP) stream, it is up to
  1477. the security policy of the RTCP sender how to behave, e.g., whether
  1478. an RTCP BYE-packet should be sent and/or if the event should be
  1479. logged.
  1480. Baugher, et al. Standards Track [Page 38]
  1481. RFC 3711 SRTP March 2004
  1482. Note: in most typical applications (assuming at least one RTCP packet
  1483. for every 128,000 RTP packets), it will be the SRTCP index that first
  1484. reaches the upper limit, although the time until this occurs is very
  1485. long: even at 200 SRTCP packets/sec, the 2^31 index space of SRTCP is
  1486. enough to secure approximately 4 months of communication.
  1487. Note that if the master key is to be shared between SRTP streams
  1488. within the same RTP session (Section 9.1), although the above bounds
  1489. are on a per stream (i.e., per SSRC) basis, the sender MUST base re-
  1490. key decision on the stream whose sequence number space is the first
  1491. to be exhausted.
  1492. Key derivation limits the amount of plaintext that is encrypted with
  1493. a fixed session key, and made available to an attacker for analysis,
  1494. but key derivation does not extend the master key's lifetime. To see
  1495. this, simply consider our requirements to avoid two-time pad: two
  1496. distinct packets MUST either be processed with distinct IVs, or with
  1497. distinct session keys, and both the distinctness of IV and of the
  1498. session keys are (for the pre-defined transforms) dependent on the
  1499. distinctness of the packet indices.
  1500. Note that with the key derivation, the effective key size is at most
  1501. that of the master key, even if the derived session key is
  1502. considerably longer. With the pre-defined authentication transform,
  1503. the session authentication key is 160 bits, but the master key by
  1504. default is only 128 bits. This design choice was made to comply with
  1505. certain recommendations in [RFC2104] so that an existing HMAC
  1506. implementation can be plugged into SRTP without problems. Since the
  1507. default tag size is 80 bits, it is, for the applications in mind,
  1508. also considered acceptable from security point of view. Users having
  1509. concerns about this are RECOMMENDED to instead use a 192 bit master
  1510. key in the key derivation. It was, however, chosen not to mandate
  1511. 192-bit keys since existing AES implementations to be used in the
  1512. key-derivation may not always support key-lengths other than 128
  1513. bits. Since AES is not defined (or properly analyzed) for use with
  1514. 160 bit keys it is NOT RECOMMENDED that ad-hoc key-padding schemes
  1515. are used to pad shorter keys to 192 or 256 bits.
  1516. 9.3. Confidentiality of the RTP Payload
  1517. SRTP's pre-defined ciphers are "seekable" stream ciphers, i.e.,
  1518. ciphers able to efficiently seek to arbitrary locations in their
  1519. keystream (so that the encryption or decryption of one packet does
  1520. not depend on preceding packets). By using seekable stream ciphers,
  1521. SRTP avoids the denial of service attacks that are possible on stream
  1522. ciphers that lack this property. It is important to be aware that,
  1523. as with any stream cipher, the exact length of the payload is
  1524. revealed by the encryption. This means that it may be possible to
  1525. Baugher, et al. Standards Track [Page 39]
  1526. RFC 3711 SRTP March 2004
  1527. deduce certain "formatting bits" of the payload, as the length of the
  1528. codec output might vary due to certain parameter settings etc. This,
  1529. in turn, implies that the corresponding bit of the keystream can be
  1530. deduced. However, if the stream cipher is secure (counter mode and
  1531. f8 are provably secure under certain assumptions [BDJR] [KSYH] [IK]),
  1532. knowledge of a few bits of the keystream will not aid an attacker in
  1533. predicting subsequent keystream bits. Thus, the payload length (and
  1534. information deducible from this) will leak, but nothing else.
  1535. As some RTP packet could contain highly predictable data, e.g., SID,
  1536. it is important to use a cipher designed to resist known plaintext
  1537. attacks (which is the current practice).
  1538. 9.4. Confidentiality of the RTP Header
  1539. In SRTP, RTP headers are sent in the clear to allow for header
  1540. compression. This means that data such as payload type,
  1541. synchronization source identifier, and timestamp are available to an
  1542. eavesdropper. Moreover, since RTP allows for future extensions of
  1543. headers, we cannot foresee what kind of possibly sensitive
  1544. information might also be "leaked".
  1545. SRTP is a low-cost method, which allows header compression to reduce
  1546. bandwidth. It is up to the endpoints' policies to decide about the
  1547. security protocol to employ. If one really needs to protect headers,
  1548. and is allowed to do so by the surrounding environment, then one
  1549. should also look at alternatives, e.g., IPsec [RFC2401].
  1550. 9.5. Integrity of the RTP payload and header
  1551. SRTP messages are subject to attacks on their integrity and source
  1552. identification, and these risks are discussed in Section 9.5.1. To
  1553. protect against these attacks, each SRTP stream SHOULD be protected
  1554. by HMAC-SHA1 [RFC2104] with an 80-bit output tag and a 160-bit key,
  1555. or a message authentication code with equivalent strength. Secure
  1556. RTP SHOULD NOT be used without message authentication, except under
  1557. the circumstances described in this section. It is important to note
  1558. that encryption algorithms, including AES Counter Mode and f8, do not
  1559. provide message authentication. SRTCP MUST NOT be used with weak (or
  1560. NULL) authentication.
  1561. SRTP MAY be used with weak authentication (e.g., a 32-bit
  1562. authentication tag), or with no authentication (the NULL
  1563. authentication algorithm). These options allow SRTP to be used to
  1564. provide confidentiality in situations where
  1565. * weak or null authentication is an acceptable security risk, and
  1566. * it is impractical to provide strong message authentication.
  1567. Baugher, et al. Standards Track [Page 40]
  1568. RFC 3711 SRTP March 2004
  1569. These conditions are described below and in Section 7.5. Note that
  1570. both conditions MUST hold in order for weak or null authentication to
  1571. be used. The risks associated with exercising the weak or null
  1572. authentication options need to be considered by a security audit
  1573. prior to their use for a particular application or environment given
  1574. the risks, which are discussed in Section 9.5.1.
  1575. Weak authentication is acceptable when the RTP application is such
  1576. that the effect of a small fraction of successful forgeries is
  1577. negligible. If the application is stateless, then the effect of a
  1578. single forged RTP packet is limited to the decoding of that
  1579. particular packet. Under this condition, the size of the
  1580. authentication tag MUST ensure that only a negligible fraction of the
  1581. packets passed to the RTP application by the SRTP receiver can be
  1582. forgeries. This fraction is negligible when an adversary, if given
  1583. control of the forged packets, is not able to make a significant
  1584. impact on the output of the RTP application (see the example of
  1585. Section 7.5).
  1586. Weak or null authentication MAY be acceptable when it is unlikely
  1587. that an adversary can modify ciphertext so that it decrypts to an
  1588. intelligible value. One important case is when it is difficult for
  1589. an adversary to acquire the RTP plaintext data, since for many
  1590. codecs, an adversary that does not know the input signal cannot
  1591. manipulate the output signal in a controlled way. In many cases it
  1592. may be difficult for the adversary to determine the actual value of
  1593. the plaintext. For example, a hidden snooping device might be
  1594. required in order to know a live audio or video signal. The
  1595. adversary's signal must have a quality equivalent to or greater than
  1596. that of the signal under attack, since otherwise the adversary would
  1597. not have enough information to encode that signal with the codec used
  1598. by the victim. Plaintext prediction may also be especially difficult
  1599. for an interactive application such as a telephone call.
  1600. Weak or null authentication MUST NOT be used when the RTP application
  1601. makes data forwarding or access control decisions based on the RTP
  1602. data. In such a case, an attacker may be able to subvert
  1603. confidentiality by causing the receiver to forward data to an
  1604. attacker. See Section 3 of [B96] for a real-life example of such
  1605. attacks.
  1606. Null authentication MUST NOT be used when a replay attack, in which
  1607. an adversary stores packets then replays them later in the session,
  1608. could have a non-negligible impact on the receiver. An example of a
  1609. successful replay attack is the storing of the output of a
  1610. surveillance camera for a period of time, later followed by the
  1611. Baugher, et al. Standards Track [Page 41]
  1612. RFC 3711 SRTP March 2004
  1613. injection of that output to the monitoring station to avoid
  1614. surveillance. Encryption does not protect against this attack, and
  1615. non-null authentication is REQUIRED in order to defeat it.
  1616. If existential message forgery is an issue, i.e., when the accuracy
  1617. of the received data is of non-negligible importance, null
  1618. authentication MUST NOT be used.
  1619. 9.5.1. Risks of Weak or Null Message Authentication
  1620. During a security audit considering the use of weak or null
  1621. authentication, it is important to keep in mind the following attacks
  1622. which are possible when no message authentication algorithm is used.
  1623. An attacker who cannot predict the plaintext is still always able to
  1624. modify the message sent between the sender and the receiver so that
  1625. it decrypts to a random plaintext value, or to send a stream of bogus
  1626. packets to the receiver that will decrypt to random plaintext values.
  1627. This attack is essentially a denial of service attack, though in the
  1628. absence of message authentication, the RTP application will have
  1629. inputs that are bit-wise correlated with the true value. Some
  1630. multimedia codecs and common operating systems will crash when such
  1631. data are accepted as valid video data. This denial of service attack
  1632. may be a much larger threat than that due to an attacker dropping,
  1633. delaying, or re-ordering packets.
  1634. An attacker who cannot predict the plaintext can still replay a
  1635. previous message with certainty that the receiver will accept it.
  1636. Applications with stateless codecs might be robust against this type
  1637. of attack, but for other, more complex applications these attacks may
  1638. be far more grave.
  1639. An attacker who can predict the plaintext can modify the ciphertext
  1640. so that it will decrypt to any value of her choosing. With an
  1641. additive stream cipher, an attacker will always be able to change
  1642. individual bits.
  1643. An attacker may be able to subvert confidentiality due to the lack of
  1644. authentication when a data forwarding or access control decision is
  1645. made on decrypted but unauthenticated plaintext. This is because the
  1646. receiver may be fooled into forwarding data to an attacker, leading
  1647. to an indirect breach of confidentiality (see Section 3 of [B96]).
  1648. This is because data-forwarding decisions are made on the decrypted
  1649. plaintext; information in the plaintext will determine to what subnet
  1650. (or process) the plaintext is forwarded in ESP [RFC2401] tunnel mode
  1651. (respectively, transport mode). When Secure RTP is used without
  1652. Baugher, et al. Standards Track [Page 42]
  1653. RFC 3711 SRTP March 2004
  1654. message authentication, it should be verified that the application
  1655. does not make data forwarding or access control decisions based on
  1656. the decrypted plaintext.
  1657. Some cipher modes of operation that require padding, e.g., standard
  1658. cipher block chaining (CBC) are very sensitive to attacks on
  1659. confidentiality if certain padding types are used in the absence of
  1660. integrity. The attack [V02] shows that this is indeed the case for
  1661. the standard RTP padding as discussed in reference to Figure 1, when
  1662. used together with CBC mode. Later transform additions to SRTP MUST
  1663. therefore carefully consider the risk of using this padding without
  1664. proper integrity protection.
  1665. 9.5.2. Implicit Header Authentication
  1666. The IV formation of the f8-mode gives implicit authentication (IHA)
  1667. of the RTP header, even when message authentication is not used.
  1668. When IHA is used, an attacker that modifies the value of the RTP
  1669. header will cause the decryption process at the receiver to produce
  1670. random plaintext values. While this protection is not equivalent to
  1671. message authentication, it may be useful for some applications.
  1672. 10. Interaction with Forward Error Correction mechanisms
  1673. The default processing when using Forward Error Correction (e.g., RFC
  1674. 2733) processing with SRTP SHALL be to perform FEC processing prior
  1675. to SRTP processing on the sender side and to perform SRTP processing
  1676. prior to FEC processing on the receiver side. Any change to this
  1677. ordering (reversing it, or, placing FEC between SRTP encryption and
  1678. SRTP authentication) SHALL be signaled out of band.
  1679. 11. Scenarios
  1680. SRTP can be used as security protocol for the RTP/RTCP traffic in
  1681. many different scenarios. SRTP has a number of configuration
  1682. options, in particular regarding key usage, and can have impact on
  1683. the total performance of the application according to the way it is
  1684. used. Hence, the use of SRTP is dependent on the kind of scenario
  1685. and application it is used with. In the following, we briefly
  1686. illustrate some use cases for SRTP, and give some guidelines for
  1687. recommended setting of its options.
  1688. 11.1. Unicast
  1689. A typical example would be a voice call or video-on-demand
  1690. application.
  1691. Baugher, et al. Standards Track [Page 43]
  1692. RFC 3711 SRTP March 2004
  1693. Consider one bi-directional RTP stream, as one RTP session. It is
  1694. possible for the two parties to share the same master key in the two
  1695. directions according to the principles of Section 9.1. The first
  1696. round of the key derivation splits the master key into any or all of
  1697. the following session keys (according to the provided security
  1698. functions):
  1699. SRTP_encr_key, SRTP_auth_key, SRTCP_encr_key, and SRTCP_auth key.
  1700. (For simplicity, we omit discussion of the salts, which are also
  1701. derived.) In this scenario, it will in most cases suffice to have a
  1702. single master key with the default lifetime. This guarantees
  1703. sufficiently long lifetime of the keys and a minimum set of keys in
  1704. place for most practical purposes. Also, in this case RTCP
  1705. protection can be applied smoothly. Under these assumptions, use of
  1706. the MKI can be omitted. As the key-derivation in combination with
  1707. large difference in the packet rate in the respective directions may
  1708. require simultaneous storage of several session keys, if storage is
  1709. an issue, we recommended to use low-rate key derivation.
  1710. The same considerations can be extended to the unicast scenario with
  1711. multiple RTP sessions, where each session would have a distinct
  1712. master key.
  1713. 11.2. Multicast (one sender)
  1714. Just as with (unprotected) RTP, a scalability issue arises in big
  1715. groups due to the possibly very large amount of SRTCP Receiver
  1716. Reports that the sender might need to process. In SRTP, the sender
  1717. may have to keep state (the cryptographic context) for each receiver,
  1718. or more precisely, for the SRTCP used to protect Receiver Reports.
  1719. The overhead increases proportionally to the size of the group. In
  1720. particular, re-keying requires special concern, see below.
  1721. Consider first a small group of receivers. There are a few possible
  1722. setups with the distribution of master keys among the receivers.
  1723. Given a single RTP session, one possibility is that the receivers
  1724. share the same master key as per Section 9.1 to secure all their
  1725. respective RTCP traffic. This shared master key could then be the
  1726. same one used by the sender to protect its outbound SRTP traffic.
  1727. Alternatively, it could be a master key shared only among the
  1728. receivers and used solely for their SRTCP traffic. Both alternatives
  1729. require the receivers to trust each other.
  1730. Considering SRTCP and key storage, it is recommended to use low-rate
  1731. (or zero) key_derivation (except the mandatory initial one), so that
  1732. the sender does not need to store too many session keys (each SRTCP
  1733. stream might otherwise have a different session key at a given point
  1734. Baugher, et al. Standards Track [Page 44]
  1735. RFC 3711 SRTP March 2004
  1736. in time, as the SRTCP sources send at different times). Thus, in
  1737. case key derivation is wanted for SRTP, the cryptographic context for
  1738. SRTP can be kept separate from the SRTCP crypto context, so that it
  1739. is possible to have a key_derivation_rate of 0 for SRTCP and a non-
  1740. zero value for SRTP.
  1741. Use of the MKI for re-keying is RECOMMENDED for most applications
  1742. (see Section 8.1).
  1743. If there are more than one SRTP/SRTCP stream (within the same RTP
  1744. session) that share the master key, the upper limit of 2^48 SRTP
  1745. packets / 2^31 SRTCP packets means that, before one of the streams
  1746. reaches its maximum number of packets, re-keying MUST be triggered on
  1747. ALL streams sharing the master key. (From strict security point of
  1748. view, only the stream reaching the maximum would need to be re-keyed,
  1749. but then the streams would no longer be sharing master key, which is
  1750. the intention.) A local policy at the sender side should force
  1751. rekeying in a way that the maximum packet limit is not reached on any
  1752. of the streams. Use of the MKI for re-keying is RECOMMENDED.
  1753. In large multicast with one sender, the same considerations as for
  1754. the small group multicast hold. The biggest issue in this scenario
  1755. is the additional load placed at the sender side, due to the state
  1756. (cryptographic contexts) that has to be maintained for each receiver,
  1757. sending back RTCP Receiver Reports. At minimum, a replay window
  1758. might need to be maintained for each RTCP source.
  1759. 11.3. Re-keying and access control
  1760. Re-keying may occur due to access control (e.g., when a member is
  1761. removed during a multicast RTP session), or for pure cryptographic
  1762. reasons (e.g., the key is at the end of its lifetime). When using
  1763. SRTP default transforms, the master key MUST be replaced before any
  1764. of the index spaces are exhausted for any of the streams protected by
  1765. one and the same master key.
  1766. How key management re-keys SRTP implementations is out of scope, but
  1767. it is clear that there are straightforward ways to manage keys for a
  1768. multicast group. In one-sender multicast, for example, it is
  1769. typically the responsibility of the sender to determine when a new
  1770. key is needed. The sender is the one entity that can keep track of
  1771. when the maximum number of packets has been sent, as receivers may
  1772. join and leave the session at any time, there may be packet loss and
  1773. delay etc. In scenarios other than one-sender multicast, other
  1774. methods can be used. Here, one must take into consideration that key
  1775. exchange can be a costly operation, taking several seconds for a
  1776. single exchange. Hence, some time before the master key is
  1777. exhausted/expires, out-of-band key management is initiated, resulting
  1778. Baugher, et al. Standards Track [Page 45]
  1779. RFC 3711 SRTP March 2004
  1780. in a new master key that is shared with the receiver(s). In any
  1781. event, to maintain synchronization when switching to the new key,
  1782. group policy might choose between using the MKI and the <From, To>,
  1783. as described in Section 8.1.
  1784. For access control purposes, the <From, To> periods are set at the
  1785. desired granularity, dependent on the packet rate. High rate re-
  1786. keying can be problematic for SRTCP in some large-group scenarios.
  1787. As mentioned, there are potential problems in using the SRTP index,
  1788. rather than the SRTCP index, for determining the master key. In
  1789. particular, for short periods during switching of master keys, it may
  1790. be the case that SRTCP packets are not under the current master key
  1791. of the correspondent SRTP. Therefore, using the MKI for re-keying in
  1792. such scenarios will produce better results.
  1793. 11.4. Summary of basic scenarios
  1794. The description of these scenarios highlights some recommendations on
  1795. the use of SRTP, mainly related to re-keying and large scale
  1796. multicast:
  1797. - Do not use fast re-keying with the <From, To> feature. It may, in
  1798. particular, give problems in retrieving the correct SRTCP key, if
  1799. an SRTCP packet arrives close to the re-keying time. The MKI
  1800. SHOULD be used in this case.
  1801. - If multiple SRTP streams in the same RTP session share the same
  1802. master key, also moderate rate re-keying MAY have the same
  1803. problems, and the MKI SHOULD be used.
  1804. - Though offering increased security, a non-zero key_derivation_rate
  1805. is NOT RECOMMENDED when trying to minimize the number of keys in
  1806. use with multiple streams.
  1807. 12. IANA Considerations
  1808. The RTP specification establishes a registry of profile names for use
  1809. by higher-level control protocols, such as the Session Description
  1810. Protocol (SDP), to refer to transport methods. This profile
  1811. registers the name "RTP/SAVP".
  1812. SRTP uses cryptographic transforms which a key management protocol
  1813. signals. It is the task of each particular key management protocol
  1814. to register the cryptographic transforms or suites of transforms with
  1815. IANA. The key management protocol conveys these protocol numbers,
  1816. not SRTP, and each key management protocol chooses the numbering
  1817. scheme and syntax that it requires.
  1818. Baugher, et al. Standards Track [Page 46]
  1819. RFC 3711 SRTP March 2004
  1820. Specification of a key management protocol for SRTP is out of scope
  1821. here. Section 8.2, however, provides guidance on the parameters that
  1822. need to be defined for the default and mandatory transforms.
  1823. 13. Acknowledgements
  1824. David Oran (Cisco) and Rolf Blom (Ericsson) are co-authors of this
  1825. document but their valuable contributions are acknowledged here to
  1826. keep the length of the author list down.
  1827. The authors would in addition like to thank Magnus Westerlund, Brian
  1828. Weis, Ghyslain Pelletier, Morgan Lindqvist, Robert Fairlie-
  1829. Cuninghame, Adrian Perrig, the AVT WG and in particular the chairmen
  1830. Colin Perkins and Stephen Casner, the Transport and Security Area
  1831. Directors, and Eric Rescorla for their reviews and support.
  1832. 14. References
  1833. 14.1. Normative References
  1834. [AES] NIST, "Advanced Encryption Standard (AES)", FIPS PUB 197,
  1835. http://www.nist.gov/aes/
  1836. [RFC2104] Krawczyk, H., Bellare, M. and R. Canetti, "HMAC: Keyed-
  1837. Hashing for Message Authentication", RFC 2104, February
  1838. 1997.
  1839. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
  1840. Requirement Levels", BCP 14, RFC 2119, March 1997.
  1841. [RFC2401] Kent, S. and R. Atkinson, "Security Architecture for
  1842. Internet Protocol", RFC 2401, November 1998.
  1843. [RFC2828] Shirey, R., "Internet Security Glossary", FYI 36, RFC 2828,
  1844. May 2000.
  1845. [RFC3550] Schulzrinne, H., Casner, S., Frederick, R. and V. Jacobson,
  1846. "RTP: A Transport Protocol for Real-time Applications", RFC
  1847. 3550, July 2003.
  1848. [RFC3551] Schulzrinne, H. and S. Casner, "RTP Profile for Audio and
  1849. Video Conferences with Minimal Control", RFC 3551, July
  1850. 2003.
  1851. Baugher, et al. Standards Track [Page 47]
  1852. RFC 3711 SRTP March 2004
  1853. 14.2. Informative References
  1854. [AES-CTR] Lipmaa, H., Rogaway, P. and D. Wagner, "CTR-Mode
  1855. Encryption", NIST, http://csrc.nist.gov/encryption/modes/
  1856. workshop1/papers/lipmaa-ctr.pdf
  1857. [B96] Bellovin, S., "Problem Areas for the IP Security
  1858. Protocols," in Proceedings of the Sixth Usenix Unix
  1859. Security Symposium, pp. 1-16, San Jose, CA, July 1996
  1860. (http://www.research.att.com/~smb/papers/index.html).
  1861. [BDJR] Bellare, M., Desai, A., Jokipii, E. and P. Rogaway, "A
  1862. Concrete Treatment of Symmetric Encryption: Analysis of DES
  1863. Modes of Operation", Proceedings 38th IEEE FOCS, pp. 394-
  1864. 403, 1997.
  1865. [BS00] Biryukov, A. and A. Shamir, "Cryptanalytic Time/Memory/Data
  1866. Tradeoffs for Stream Ciphers", Proceedings, ASIACRYPT 2000,
  1867. LNCS 1976, pp. 1-13, Springer Verlag.
  1868. [C99] Crowell, W. P., "Introduction to the VENONA Project",
  1869. http://www.nsa.gov:8080/docs/venona/index.html.
  1870. [CTR] Dworkin, M., NIST Special Publication 800-38A,
  1871. "Recommendation for Block Cipher Modes of Operation:
  1872. Methods and Techniques", 2001.
  1873. http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-
  1874. 38a.pdf.
  1875. [f8-a] 3GPP TS 35.201 V4.1.0 (2001-12) Technical Specification 3rd
  1876. Generation Partnership Project; Technical Specification
  1877. Group Services and System Aspects; 3G Security;
  1878. Specification of the 3GPP Confidentiality and Integrity
  1879. Algorithms; Document 1: f8 and f9 Specification (Release
  1880. 4).
  1881. [f8-b] 3GPP TR 33.908 V4.0.0 (2001-09) Technical Report 3rd
  1882. Generation Partnership Project; Technical Specification
  1883. Group Services and System Aspects; 3G Security; General
  1884. Report on the Design, Specification and Evaluation of 3GPP
  1885. Standard Confidentiality and Integrity Algorithms (Release
  1886. 4).
  1887. [GDOI] Baugher, M., Weis, B., Hardjono, T. and H. Harney, "The
  1888. Group Domain of Interpretation, RFC 3547, July 2003.
  1889. Baugher, et al. Standards Track [Page 48]
  1890. RFC 3711 SRTP March 2004
  1891. [HAC] Menezes, A., Van Oorschot, P. and S. Vanstone, "Handbook
  1892. of Applied Cryptography", CRC Press, 1997, ISBN 0-8493-
  1893. 8523-7.
  1894. [H80] Hellman, M. E., "A cryptanalytic time-memory trade-off",
  1895. IEEE Transactions on Information Theory, July 1980, pp.
  1896. 401-406.
  1897. [IK] T. Iwata and T. Kohno: "New Security Proofs for the 3GPP
  1898. Confidentiality and Integrity Algorithms", Proceedings of
  1899. FSE 2004.
  1900. [KINK] Thomas, M. and J. Vilhuber, "Kerberized Internet
  1901. Negotiation of Keys (KINK)", Work in Progress.
  1902. [KEYMGT] Arrko, J., et al., "Key Management Extensions for Session
  1903. Description Protocol (SDP) and Real Time Streaming Protocol
  1904. (RTSP)", Work in Progress.
  1905. [KSYH] Kang, J-S., Shin, S-U., Hong, D. and O. Yi, "Provable
  1906. Security of KASUMI and 3GPP Encryption Mode f8",
  1907. Proceedings Asiacrypt 2001, Springer Verlag LNCS 2248, pp.
  1908. 255-271, 2001.
  1909. [MIKEY] Arrko, J., et. al., "MIKEY: Multimedia Internet KEYing",
  1910. Work in Progress.
  1911. [MF00] McGrew, D. and S. Fluhrer, "Attacks on Encryption of
  1912. Redundant Plaintext and Implications on Internet Security",
  1913. the Proceedings of the Seventh Annual Workshop on Selected
  1914. Areas in Cryptography (SAC 2000), Springer-Verlag.
  1915. [PCST1] Perrig, A., Canetti, R., Tygar, D. and D. Song, "Efficient
  1916. and Secure Source Authentication for Multicast", in Proc.
  1917. of Network and Distributed System Security Symposium NDSS
  1918. 2001, pp. 35-46, 2001.
  1919. [PCST2] Perrig, A., Canetti, R., Tygar, D. and D. Song, "Efficient
  1920. Authentication and Signing of Multicast Streams over Lossy
  1921. Channels", in Proc. of IEEE Security and Privacy Symposium
  1922. S&P2000, pp. 56-73, 2000.
  1923. [RFC1750] Eastlake, D., Crocker, S. and J. Schiller, "Randomness
  1924. Recommendations for Security", RFC 1750, December 1994.
  1925. [RFC2675] Borman, D., Deering, S. and R. Hinden, "IPv6 Jumbograms",
  1926. RFC 2675, August 1999.
  1927. Baugher, et al. Standards Track [Page 49]
  1928. RFC 3711 SRTP March 2004
  1929. [RFC3095] Bormann, C., Burmeister, C., Degermark, M., Fukuhsima, H.,
  1930. Hannu, H., Jonsson, L-E., Hakenberg, R., Koren, T., Le, K.,
  1931. Liu, Z., Martensson, A., Miyazaki, A., Svanbro, K., Wiebke,
  1932. T., Yoshimura, T. and H. Zheng, "RObust Header Compression:
  1933. Framework and Four Profiles: RTP, UDP, ESP, and
  1934. uncompressed (ROHC)", RFC 3095, July 2001.
  1935. [RFC3242] Jonsson, L-E. and G. Pelletier, "RObust Header Compression
  1936. (ROHC): A Link-Layer Assisted Profile for IP/UDP/RTP ", RFC
  1937. 3242, April 2002.
  1938. [SDMS] Andreasen, F., Baugher, M. and D. Wing, "Session
  1939. Description Protocol Security Descriptions for Media
  1940. Streams", Work in Progress.
  1941. [SWO] Svanbro, K., Wiorek, J. and B. Olin, "Voice-over-IP-over-
  1942. wireless", Proc. PIMRC 2000, London, Sept. 2000.
  1943. [V02] Vaudenay, S., "Security Flaws Induced by CBC Padding -
  1944. Application to SSL, IPsec, WTLS...", Advances in
  1945. Cryptology, EUROCRYPT'02, LNCS 2332, pp. 534-545.
  1946. [WC81] Wegman, M. N., and J.L. Carter, "New Hash Functions and
  1947. Their Use in Authentication and Set Equality", JCSS 22,
  1948. 265-279, 1981.
  1949. Baugher, et al. Standards Track [Page 50]
  1950. RFC 3711 SRTP March 2004
  1951. Appendix A: Pseudocode for Index Determination
  1952. The following is an example of pseudo-code for the algorithm to
  1953. determine the index i of an SRTP packet with sequence number SEQ. In
  1954. the following, signed arithmetic is assumed.
  1955. if (s_l < 32,768)
  1956. if (SEQ - s_l > 32,768)
  1957. set v to (ROC-1) mod 2^32
  1958. else
  1959. set v to ROC
  1960. endif
  1961. else
  1962. if (s_l - 32,768 > SEQ)
  1963. set v to (ROC+1) mod 2^32
  1964. else
  1965. set v to ROC
  1966. endif
  1967. endif
  1968. return SEQ + v*65,536
  1969. Appendix B: Test Vectors
  1970. All values are in hexadecimal.
  1971. B.1. AES-f8 Test Vectors
  1972. SRTP PREFIX LENGTH : 0
  1973. RTP packet header : 806e5cba50681de55c621599
  1974. RTP packet payload : 70736575646f72616e646f6d6e657373
  1975. 20697320746865206e65787420626573
  1976. 74207468696e67
  1977. ROC : d462564a
  1978. key : 234829008467be186c3de14aae72d62c
  1979. salt key : 32f2870d
  1980. key-mask (m) : 32f2870d555555555555555555555555
  1981. key XOR key-mask : 11baae0dd132eb4d3968b41ffb278379
  1982. IV : 006e5cba50681de55c621599d462564a
  1983. IV' : 595b699bbd3bc0df26062093c1ad8f73
  1984. Baugher, et al. Standards Track [Page 51]
  1985. RFC 3711 SRTP March 2004
  1986. j = 0
  1987. IV' xor j : 595b699bbd3bc0df26062093c1ad8f73
  1988. S(-1) : 00000000000000000000000000000000
  1989. IV' xor S(-1) xor j : 595b699bbd3bc0df26062093c1ad8f73
  1990. S(0) : 71ef82d70a172660240709c7fbb19d8e
  1991. plaintext : 70736575646f72616e646f6d6e657373
  1992. ciphertext : 019ce7a26e7854014a6366aa95d4eefd
  1993. j = 1
  1994. IV' xor j : 595b699bbd3bc0df26062093c1ad8f72
  1995. S(0) : 71ef82d70a172660240709c7fbb19d8e
  1996. IV' xor S(0) xor j : 28b4eb4cb72ce6bf020129543a1c12fc
  1997. S(1) : 3abd640a60919fd43bd289a09649b5fc
  1998. plaintext : 20697320746865206e65787420626573
  1999. ciphertext : 1ad4172a14f9faf455b7f1d4b62bd08f
  2000. j = 2
  2001. IV' xor j : 595b699bbd3bc0df26062093c1ad8f71
  2002. S(1) : 3abd640a60919fd43bd289a09649b5fc
  2003. IV' xor S(1) xor j : 63e60d91ddaa5f0b1dd4a93357e43a8d
  2004. S(2) : 220c7a8715266565b09ecc8a2a62b11b
  2005. plaintext : 74207468696e67
  2006. ciphertext : 562c0eef7c4802
  2007. B.2. AES-CM Test Vectors
  2008. Keystream segment length: 1044512 octets (65282 AES blocks)
  2009. Session Key: 2B7E151628AED2A6ABF7158809CF4F3C
  2010. Rollover Counter: 00000000
  2011. Sequence Number: 0000
  2012. SSRC: 00000000
  2013. Session Salt: F0F1F2F3F4F5F6F7F8F9FAFBFCFD0000 (already shifted)
  2014. Offset: F0F1F2F3F4F5F6F7F8F9FAFBFCFD0000
  2015. Counter Keystream
  2016. F0F1F2F3F4F5F6F7F8F9FAFBFCFD0000 E03EAD0935C95E80E166B16DD92B4EB4
  2017. F0F1F2F3F4F5F6F7F8F9FAFBFCFD0001 D23513162B02D0F72A43A2FE4A5F97AB
  2018. F0F1F2F3F4F5F6F7F8F9FAFBFCFD0002 41E95B3BB0A2E8DD477901E4FCA894C0
  2019. ... ...
  2020. F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF EC8CDF7398607CB0F2D21675EA9EA1E4
  2021. F0F1F2F3F4F5F6F7F8F9FAFBFCFDFF00 362B7C3C6773516318A077D7FC5073AE
  2022. F0F1F2F3F4F5F6F7F8F9FAFBFCFDFF01 6A2CC3787889374FBEB4C81B17BA6C44
  2023. Nota Bene: this test case is contrived so that the latter part of the
  2024. keystream segment coincides with the test case in Section F.5.1 of
  2025. [CTR].
  2026. Baugher, et al. Standards Track [Page 52]
  2027. RFC 3711 SRTP March 2004
  2028. B.3. Key Derivation Test Vectors
  2029. This section provides test data for the default key derivation
  2030. function, which uses AES-128 in Counter Mode. In the following, we
  2031. walk through the initial key derivation for the AES-128 Counter Mode
  2032. cipher, which requires a 16 octet session encryption key and a 14
  2033. octet session salt, and an authentication function which requires a
  2034. 94-octet session authentication key. These values are called the
  2035. cipher key, the cipher salt, and the auth key in the following.
  2036. Since this is the initial key derivation and the key derivation rate
  2037. is equal to zero, the value of (index DIV key_derivation_rate) is
  2038. zero (actually, a six-octet string of zeros). In the following, we
  2039. shorten key_derivation_rate to kdr.
  2040. The inputs to the key derivation function are the 16 octet master key
  2041. and the 14 octet master salt:
  2042. master key: E1F97A0D3E018BE0D64FA32C06DE4139
  2043. master salt: 0EC675AD498AFEEBB6960B3AABE6
  2044. We first show how the cipher key is generated. The input block for
  2045. AES-CM is generated by exclusive-oring the master salt with the
  2046. concatenation of the encryption key label 0x00 with (index DIV kdr),
  2047. then padding on the right with two null octets (which implements the
  2048. multiply-by-2^16 operation, see Section 4.3.3). The resulting value
  2049. is then AES-CM- encrypted using the master key to get the cipher key.
  2050. index DIV kdr: 000000000000
  2051. label: 00
  2052. master salt: 0EC675AD498AFEEBB6960B3AABE6
  2053. -----------------------------------------------
  2054. xor: 0EC675AD498AFEEBB6960B3AABE6 (x, PRF input)
  2055. x*2^16: 0EC675AD498AFEEBB6960B3AABE60000 (AES-CM input)
  2056. cipher key: C61E7A93744F39EE10734AFE3FF7A087 (AES-CM output)
  2057. Baugher, et al. Standards Track [Page 53]
  2058. RFC 3711 SRTP March 2004
  2059. Next, we show how the cipher salt is generated. The input block for
  2060. AES-CM is generated by exclusive-oring the master salt with the
  2061. concatenation of the encryption salt label. That value is padded and
  2062. encrypted as above.
  2063. index DIV kdr: 000000000000
  2064. label: 02
  2065. master salt: 0EC675AD498AFEEBB6960B3AABE6
  2066. ----------------------------------------------
  2067. xor: 0EC675AD498AFEE9B6960B3AABE6 (x, PRF input)
  2068. x*2^16: 0EC675AD498AFEE9B6960B3AABE60000 (AES-CM input)
  2069. 30CBBC08863D8C85D49DB34A9AE17AC6 (AES-CM ouptut)
  2070. cipher salt: 30CBBC08863D8C85D49DB34A9AE1
  2071. We now show how the auth key is generated. The input block for AES-
  2072. CM is generated as above, but using the authentication key label.
  2073. index DIV kdr: 000000000000
  2074. label: 01
  2075. master salt: 0EC675AD498AFEEBB6960B3AABE6
  2076. -----------------------------------------------
  2077. xor: 0EC675AD498AFEEAB6960B3AABE6 (x, PRF input)
  2078. x*2^16: 0EC675AD498AFEEAB6960B3AABE60000 (AES-CM input)
  2079. Below, the auth key is shown on the left, while the corresponding AES
  2080. input blocks are shown on the right.
  2081. auth key AES input blocks
  2082. CEBE321F6FF7716B6FD4AB49AF256A15 0EC675AD498AFEEAB6960B3AABE60000
  2083. 6D38BAA48F0A0ACF3C34E2359E6CDBCE 0EC675AD498AFEEAB6960B3AABE60001
  2084. E049646C43D9327AD175578EF7227098 0EC675AD498AFEEAB6960B3AABE60002
  2085. 6371C10C9A369AC2F94A8C5FBCDDDC25 0EC675AD498AFEEAB6960B3AABE60003
  2086. 6D6E919A48B610EF17C2041E47403576 0EC675AD498AFEEAB6960B3AABE60004
  2087. 6B68642C59BBFC2F34DB60DBDFB2 0EC675AD498AFEEAB6960B3AABE60005
  2088. Baugher, et al. Standards Track [Page 54]
  2089. RFC 3711 SRTP March 2004
  2090. Authors' Addresses
  2091. Questions and comments should be directed to the authors and
  2092. avt@ietf.org:
  2093. Mark Baugher
  2094. Cisco Systems, Inc.
  2095. 5510 SW Orchid Street
  2096. Portland, OR 97219 USA
  2097. Phone: +1 408-853-4418
  2098. EMail: mbaugher@cisco.com
  2099. Elisabetta Carrara
  2100. Ericsson Research
  2101. SE-16480 Stockholm
  2102. Sweden
  2103. Phone: +46 8 50877040
  2104. EMail: elisabetta.carrara@ericsson.com
  2105. David A. McGrew
  2106. Cisco Systems, Inc.
  2107. San Jose, CA 95134-1706
  2108. USA
  2109. Phone: +1 301-349-5815
  2110. EMail: mcgrew@cisco.com
  2111. Mats Naslund
  2112. Ericsson Research
  2113. SE-16480 Stockholm
  2114. Sweden
  2115. Phone: +46 8 58533739
  2116. EMail: mats.naslund@ericsson.com
  2117. Karl Norrman
  2118. Ericsson Research
  2119. SE-16480 Stockholm
  2120. Sweden
  2121. Phone: +46 8 4044502
  2122. EMail: karl.norrman@ericsson.com
  2123. Baugher, et al. Standards Track [Page 55]
  2124. RFC 3711 SRTP March 2004
  2125. Full Copyright Statement
  2126. Copyright (C) The Internet Society (2004). This document is subject
  2127. to the rights, licenses and restrictions contained in BCP 78 and
  2128. except as set forth therein, the authors retain all their rights.
  2129. This document and the information contained herein are provided on an
  2130. "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
  2131. OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
  2132. ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
  2133. INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
  2134. INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
  2135. WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  2136. Intellectual Property
  2137. The IETF takes no position regarding the validity or scope of any
  2138. Intellectual Property Rights or other rights that might be claimed to
  2139. pertain to the implementation or use of the technology described in
  2140. this document or the extent to which any license under such rights
  2141. might or might not be available; nor does it represent that it has
  2142. made any independent effort to identify any such rights. Information
  2143. on the procedures with respect to rights in RFC documents can be
  2144. found in BCP 78 and BCP 79.
  2145. Copies of IPR disclosures made to the IETF Secretariat and any
  2146. assurances of licenses to be made available, or the result of an
  2147. attempt made to obtain a general license or permission for the use of
  2148. such proprietary rights by implementers or users of this
  2149. specification can be obtained from the IETF on-line IPR repository at
  2150. http://www.ietf.org/ipr.
  2151. The IETF invites any interested party to bring to its attention any
  2152. copyrights, patents or patent applications, or other proprietary
  2153. rights that may cover technology that may be required to implement
  2154. this standard. Please address the information to the IETF at ietf-
  2155. ipr@ietf.org.
  2156. Acknowledgement
  2157. Funding for the RFC Editor function is currently provided by the
  2158. Internet Society.
  2159. Baugher, et al. Standards Track [Page 56]