draft-ietf-avtcore-srtp-aes-gcm-17.txt   rfc7714.txt 
Network Working Group D. McGrew
Internet Draft Cisco Systems, Inc.
Intended Status: Standards Track K. Igoe
Expires: January 01, 2016 National Security Agency
June 30, 2015
AES-GCM Authenticated Encryption in Secure RTP (SRTP) Internet Engineering Task Force (IETF) D. McGrew
draft-ietf-avtcore-srtp-aes-gcm-17 Request for Comments: 7714 Cisco Systems, Inc.
Category: Standards Track K. Igoe
ISSN: 2070-1721 National Security Agency
December 2015
Status of this Memo AES-GCM Authenticated Encryption
in the Secure Real-time Transport Protocol (SRTP)
This Internet-Draft is submitted to IETF in full conformance with the Abstract
provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering This document defines how the AES-GCM Authenticated Encryption with
Task Force (IETF). Note that other groups may also distribute Associated Data family of algorithms can be used to provide
working documents as Internet-Drafts. The list of current Internet- confidentiality and data authentication in the Secure Real-time
Drafts is at http://datatracker.ietf.org/drafts/current. Transport Protocol (SRTP).
Internet-Drafts are draft documents valid for a maximum of six months Status of This Memo
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
This Internet-Draft will expire on January 01, 2016. This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in Section 2 of RFC 5741.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
http://www.rfc-editor.org/info/rfc7714.
Copyright Notice Copyright Notice
Copyright (c) 2015 IETF Trust and the persons identified as the Copyright (c) 2015 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Abstract
This document defines how the AES-GCM Authenticated Encryption with
Associated Data family of algorithms can be used to provide
confidentiality and data authentication in the SRTP protocol.
Table of Contents Table of Contents
1. Introduction.....................................................4 1. Introduction ....................................................3
2. Conventions Used In This Document................................5 2. Conventions Used in This Document ...............................4
3. Overview of the SRTP/SRTCP AEAD security Architecture............5 3. Overview of the SRTP/SRTCP AEAD Security Architecture ...........4
4. Terminology......................................................5 4. Terminology .....................................................5
5. Generic AEAD Processing..........................................6 5. Generic AEAD Processing .........................................6
5.1. Types of Input Data.........................................6 5.1. Types of Input Data ........................................6
5.2. AEAD Invocation Inputs and Outputs..........................6 5.2. AEAD Invocation Inputs and Outputs .........................6
5.2.1. Encrypt Mode...........................................6 5.2.1. Encrypt Mode ........................................6
5.2.2. Decrypt Mode...........................................7 5.2.2. Decrypt Mode ........................................7
5.3. Handling of AEAD Authentication.............................7 5.3. Handling of AEAD Authentication ............................7
6. Counter Mode Encryption..........................................7 6. Counter Mode Encryption .........................................7
7. Unneeded SRTP/SRTCP Fields.......................................8 7. Unneeded SRTP/SRTCP Fields ......................................8
7.1. SRTP/SRTCP Authentication Field.............................8 7.1. SRTP/SRTCP Authentication Tag Field ........................8
7.2. RTP Padding.................................................9 7.2. RTP Padding ................................................9
8. AES-GCM processing for SRTP......................................9 8. AES-GCM Processing for SRTP .....................................9
8.1. SRTP IV formation for AES-GCM...............................9 8.1. SRTP IV Formation for AES-GCM ..............................9
8.2. Data Types in SRTP Packets..................................9 8.2. Data Types in SRTP Packets ................................10
8.3. Handling Header Extensions.................................11 8.3. Handling Header Extensions ................................11
8.4. Prevention of SRTP IV Reuse................................12 8.4. Prevention of SRTP IV Reuse ...............................12
9. AES-GCM Processing of SRTCP Compound Packets....................13 9. AES-GCM Processing of SRTCP Compound Packets ...................13
9.1. SRTCP IV formation for AES-GCM.............................13 9.1. SRTCP IV Formation for AES-GCM ............................13
9.2. Data Types in Encrypted SRTCP Compound Packets.............14 9.2. Data Types in Encrypted SRTCP Compound Packets ............14
9.3. Data Types in Unencrypted SRTCP Compound Packets...........15 9.3. Data Types in Unencrypted SRTCP Compound Packets ..........16
9.4. Prevention of SRTCP IV Reuse...............................16 9.4. Prevention of SRTCP IV Reuse ..............................17
10. Constraints on AEAD for SRTP and SRTCP.........................16 10. Constraints on AEAD for SRTP and SRTCP ........................17
11. Key Derivation Functions.......................................17 11. Key Derivation Functions ......................................18
12. Summary of AES-GCM in SRTP/SRTCP...............................17 12. Summary of AES-GCM in SRTP/SRTCP ..............................19
13. Security Considerations........................................18 13. Security Considerations .......................................20
13.1. Handling of Security Critical Parameters..................18 13.1. Handling of Security-Critical Parameters .................20
13.2. Size of the Authentication Tag............................19 13.2. Size of the Authentication Tag ...........................21
14. IANA Considerations............................................19 14. IANA Considerations ...........................................21
14.1. SDES......................................................19 14.1. SDES .....................................................21
14.2. DTLS-SRTP.................................................19 14.2. DTLS-SRTP ................................................22
14.3. MIKEY.....................................................20 14.3. MIKEY ....................................................23
15. Parameters for use with MIKEY..................................21 15. Parameters for Use with MIKEY .................................23
16. Some RTP Test Vectors..........................................21 16. Some RTP Test Vectors .........................................24
16.1. SRTP AEAD_AES_128_GCM.....................................22 16.1. SRTP AEAD_AES_128_GCM ....................................25
16.1.1. SRTP AEAD_AES_128_GCM Encryption.....................22 16.1.1. SRTP AEAD_AES_128_GCM Encryption ..................25
16.1.2. SRTP AEAD_AES_128_GCM Decryption.....................25 16.1.2. SRTP AEAD_AES_128_GCM Decryption ..................27
16.1.3. SRTP AEAD_AES_128_GCM Authentication Tagging.........27 16.1.3. SRTP AEAD_AES_128_GCM Authentication Tagging ......29
16.1.4. SRTP AEAD_AES_128_GCM Tag Verification...............29 16.1.4. SRTP AEAD_AES_128_GCM Tag Verification ............30
16.2. SRTP AEAD_AES_256_GCM.....................................29 16.2. SRTP AEAD_AES_256_GCM ....................................31
16.2.1. SRTP AEAD_AES_256_GCM Encryption.....................30 16.2.1. SRTP AEAD_AES_256_GCM Encryption ..................31
16.2.2. SRTP AEAD_AES_256_GCM Decryption.....................32 16.2.2. SRTP AEAD_AES_256_GCM Decryption ..................33
16.2.3. SRTP AEAD_AES_256_GCM Authentication Tagging.........34 16.2.3. SRTP AEAD_AES_256_GCM Authentication Tagging ......35
16.2.4. SRTP AEAD_AES_256_GCM Tag Verification...............36 16.2.4. SRTP AEAD_AES_256_GCM Tag Verification ............36
17. RTCP Test Vectors..............................................37
17.1. SRTCP AEAD_AES_128_GCM Encrypt and Tag....................38
17.2. SRTCP AEAD_AES_256_GCM Verify and Decryption..............39
17.3. SRTCP AEAD_AES_128_GCM Tag Only...........................41
17.4. SRTCP AEAD_AES_256_GCM Tag Verification...................42
18. Acknowledgements...............................................43
19. References.....................................................44
19.1. Normative References......................................44
19.2. Informative References....................................44
1. Introduction 17. RTCP Test Vectors .............................................37
17.1. SRTCP AEAD_AES_128_GCM Encryption and Tagging ............39
17.2. SRTCP AEAD_AES_256_GCM Verification and Decryption .......41
17.3. SRTCP AEAD_AES_128_GCM Tagging Only ......................43
17.4. SRTCP AEAD_AES_256_GCM Tag Verification ..................44
18. References ....................................................45
18.1. Normative References .....................................45
18.2. Informative References ...................................47
Acknowledgements ..................................................48
Authors' Addresses ................................................48
1. Introduction
The Secure Real-time Transport Protocol (SRTP) [RFC3711] is a profile The Secure Real-time Transport Protocol (SRTP) [RFC3711] is a profile
of the Real-time Transport Protocol (RTP) [RFC3550], which can of the Real-time Transport Protocol (RTP) [RFC3550], which can
provide confidentiality, message authentication, and replay provide confidentiality, message authentication, and replay
protection to the RTP traffic and to the control traffic for RTP, the protection to the RTP traffic and to the control traffic for RTP, the
Real-time Transport Control Protocol (RTCP). It is important to note Real-time Transport Control Protocol (RTCP). It is important to note
that the outgoing SRTP packets from a single endpoint may be that the outgoing SRTP packets from a single endpoint may be
originating from several independent data sources. originating from several independent data sources.
Authenticated encryption [BN00] is a form of encryption that, in Authenticated Encryption [BN00] is a form of encryption that, in
addition to providing confidentiality for the plaintext that is addition to providing confidentiality for the Plaintext that is
encrypted, provides a way to check its integrity and authenticity. encrypted, provides a way to check its integrity and authenticity.
Authenticated Encryption with Associated Data, or AEAD [R02], adds Authenticated Encryption with Associated Data, or AEAD [R02], adds
the ability to check the integrity and authenticity of some the ability to check the integrity and authenticity of some
Associated Data (AD), also called "additional authenticated data", Associated Data (AD), also called "Additional Authenticated Data"
that is not encrypted. This specification makes use of the interface (AAD), that is not encrypted. This specification makes use of the
to a generic AEAD algorithm as defined in [RFC5116]. interface to a generic AEAD algorithm as defined in [RFC5116].
The Advanced Encryption Standard (AES) is a block cipher that The Advanced Encryption Standard (AES) is a block cipher that
provides a high level of security, and can accept different key provides a high level of security and can accept different key sizes.
sizes. AES Galois/Counter Mode (AES-GCM) [GCM] is a family of AEAD AES Galois/Counter Mode (AES-GCM) [GCM] is a family of AEAD
algorithms based upon AES. This specification makes use of the AES algorithms based upon AES. This specification makes use of the AES
versions that use 128-bit and 256-bit keys, which we call AES-128 and versions that use 128-bit and 256-bit keys, which we call "AES-128"
AES-256, respectively. and "AES-256", respectively.
Any AEAD algorithm provides an intrinsic authentication tag. In many Any AEAD algorithm provides an intrinsic authentication tag. In many
applications the authentication tag is truncated to less than full applications, the authentication tag is truncated to less than full
length. In this specification the authentication tag MUST NOT be length. In this specification, the authentication tag MUST NOT be
truncated. The authentications tags MUST be a full 16 octets in truncated. The authentications tags MUST be a full 16 octets in
length. When used in SRTP/SRTCP AES-GCM will have two length. When used in SRTP/SRTCP, AES-GCM will have two
configurations: configurations:
AEAD_AES_128_GCM AES-128 with a 16 byte authentication tag AEAD_AES_128_GCM AES-128 with a 16-octet authentication tag
AEAD_AES_256_GCM AES-256 with a 16 byte authentication tag AEAD_AES_256_GCM AES-256 with a 16-octet authentication tag
The key size is set when the session is initiated and SHOULD NOT be The key size is set when the session is initiated and SHOULD NOT be
altered. altered.
The Galois/Counter Mode of operation (GCM) is an AEAD mode of The Galois/Counter Mode of operation (GCM) is an AEAD mode of
operation for block ciphers. GCM use counter mode to encrypt the operation for block ciphers. GCM uses Counter Mode to encrypt the
data, an operation that can be efficiently pipelined. Further, GCM data, an operation that can be efficiently pipelined. Further, GCM
authentication uses operations that are particularly well suited to authentication uses operations that are particularly well suited to
efficient implementation in hardware, making it especially appealing efficient implementation in hardware, making it especially appealing
for high-speed implementations, or for implementations in an for high-speed implementations, or for implementations in an
efficient and compact circuit. efficient and compact circuit.
In summary, this document defines how to use an AEAD algorithm, In summary, this document defines how to use an AEAD algorithm,
particularly AES-GCM, to provide confidentiality and message particularly AES-GCM, to provide confidentiality and message
authentication within SRTP and SRTCP packets. authentication within SRTP and SRTCP packets.
2. Conventions Used In This Document 2. Conventions Used in This Document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in "OPTIONAL" in this document are to be interpreted as described in
[RFC2119]. [RFC2119].
3. Overview of the SRTP/SRTCP AEAD security Architecture 3. Overview of the SRTP/SRTCP AEAD Security Architecture
SRTP/SRTCP AEAD security is based upon the following principles: SRTP/SRTCP AEAD security is based upon the following principles:
a) Both privacy and authentication are based upon the use of a) Both privacy and authentication are based upon the use of
symmetric algorithms. An AEAD algorithm such as AES-GCM symmetric algorithms. An AEAD algorithm such as AES-GCM
combines privacy and authentication into a single process. combines privacy and authentication into a single process.
b) A secret master key is shared by all participating endpoints, b) A secret master key is shared by all participating endpoints --
both those originating SRTP/SRTCP packets and those receiving both those originating SRTP/SRTCP packets and those receiving
these packets. Any given master key MAY be used these packets. Any given master key MAY be used simultaneously
simultaneously by several endpoints to originate SRTP/SRTCP by several endpoints to originate SRTP/SRTCP packets (as well
packets (as well one or more endpoints using this master key as one or more endpoints using this master key to process
to process inbound data). inbound data).
c) A Key Derivation Function is applied to the shared master key c) A Key Derivation Function (KDF) is applied to the shared master
value to form separate encryption keys, authentication keys key value to form separate encryption keys, authentication
and salting keys for SRTP and for SRTCP (a total of six keys, and salting keys for SRTP and for SRTCP (a total of six
keys). This process is described in section 4.3 of keys). This process is described in Section 4.3 of [RFC3711].
[RFC3711]. The master key MUST be at least as large as the The master key MUST be at least as large as the encryption key
encryption key derived from it. Since AEAD algorithms such derived from it. Since AEAD algorithms such as AES-GCM combine
as AES-GCM combine encryption and authentication into a encryption and authentication into a single process, AEAD
single process, AEAD algorithms do not make use of separate algorithms do not make use of separate authentication keys.
authentication keys.
d) Aside from making modifications to IANA registries to allow d) Aside from making modifications to IANA registries to allow
AES-GCM to work with SDES, DTLS-SRTP and MIKEY, the details AES-GCM to work with Security Descriptions (SDES), Datagram
of how the master key is established and shared between the Transport Layer Security for Secure RTP (DTLS-SRTP), and
participants are outside the scope of this document. Multimedia Internet KEYing (MIKEY), the details of how the
Similarly any mechanism for rekeying an existing session is master key is established and shared between the participants
outside the scope of the document. are outside the scope of this document. Similarly, any
mechanism for rekeying an existing session is outside the scope
of the document.
e) Each time an instantiation of AES-GCM is invoked to encrypt e) Each time an instantiation of AES-GCM is invoked to encrypt and
and authenticate an SRTP or SRTCP data packet a new IV is authenticate an SRTP or SRTCP data packet, a new Initialization
used. SRTP combines the 4-octet synchronization source Vector (IV) is used. SRTP combines the 4-octet Synchronization
(SSRC) identifier, the 4-octet rollover counter (ROC), and Source (SSRC) identifier, the 4-octet Rollover Counter (ROC),
the 2-octet sequence number (SEQ) with the 12-octet and the 2-octet Sequence Number (SEQ) with the 12-octet
encryption salt to form a 12-octet IV (see section 8.1). encryption salt to form a 12-octet IV (see Section 8.1).
SRTCP combines the SSRC and 31-bit SRTCP index with the SRTCP combines the SSRC and 31-bit SRTCP index with the
encryption salt to form a 12-octet IV (see section 9.1). encryption salt to form a 12-octet IV (see Section 9.1).
4. Terminology
4. Terminology
The following terms have very specific meanings in the context of The following terms have very specific meanings in the context of
this RFC: this RFC:
Instantiation: In AEAD, an instantiation is an (Encryption_key, Instantiation: In AEAD, an instantiation is an (Encryption_key,
salt) pair together with all of the data salt) pair together with all of the data structures
structures (for example, counters) needed for it (for example, counters) needed for it to function
to function properly. In SRTP/SRTCP, each properly. In SRTP/SRTCP, each endpoint will need
endpoint will need two instantiations of the AEAD two instantiations of the AEAD algorithm for each
algorithm for each master key in its possession, master key in its possession: one instantiation for
one instantiation for SRTP traffic and one SRTP traffic and one instantiation for SRTCP
instantiation for SRTCP traffic. traffic.
Invocation: SRTP/SRTCP data streams are broken into packets. Invocation: SRTP/SRTCP data streams are broken into packets.
Each packet is processed by a single invocation Each packet is processed by a single invocation of
of the appropriate instantiation of the AEAD the appropriate instantiation of the AEAD
algorithm. algorithm.
In many applications, each endpoint will have one master key for In many applications, each endpoint will have one master key for
processing outbound data but may have one or more separate master processing outbound data but may have one or more separate master
keys for processing inbound data. keys for processing inbound data.
5. Generic AEAD Processing 5. Generic AEAD Processing
5.1. Types of Input Data 5.1. Types of Input Data
Associated Data: This is data that is to be authenticated Associated Data: Data that is to be authenticated but not
but not encrypted. encrypted.
Plaintext: Data that is to be both encrypted and Plaintext: Data that is to be both encrypted and
authenticated. authenticated.
Raw Data: Data that is to be neither encrypted nor Raw Data: Data that is to be neither encrypted nor
authenticated. authenticated.
Which portions of SRTP/SRTCP packets that are to be treated as Which portions of SRTP/SRTCP packets that are to be treated as
associated data, which are to be treated as plaintext, and which are Associated Data, which are to be treated as Plaintext, and which are
to be treated as raw data are covered in sections 8.2, 9.2 and 9.3. to be treated as Raw Data are covered in Sections 8.2, 9.2, and 9.3.
5.2. AEAD Invocation Inputs and Outputs 5.2. AEAD Invocation Inputs and Outputs
5.2.1. Encrypt Mode 5.2.1. Encrypt Mode
Inputs: Inputs:
Encryption_key Octet string, either 16 or 32 Encryption_key Octet string, either 16 or
octets long 32 octets long
Initialization_Vector Octet string, 12 octets long Initialization_Vector Octet string, 12 octets long
Associated_Data Octet string of variable length Associated_Data Octet string of variable length
Plaintext Octet string of variable length Plaintext Octet string of variable length
Outputs Outputs:
Ciphertext* Octet string, length = Ciphertext* Octet string, length =
length(Plaintext)+tag_length length(Plaintext) + tag_length
(*): In AEAD the authentication tag in embedded in the cipher text. (*): In AEAD, the authentication tag in embedded in the
When GCM is being used the ciphertext consists of the encrypted plain ciphertext. When GCM is being used, the ciphertext
text followed by the authentication tag. consists of the encrypted Plaintext followed by the
authentication tag.
5.2.2. Decrypt Mode 5.2.2. Decrypt Mode
Inputs: Inputs:
Encryption_key Octet string, either 16 or 32 Encryption_key Octet string, either 16 or
octets long 32 octets long
Initialization_Vector Octet string, 12 octets long Initialization_Vector Octet string, 12 octets long
Associated_Data Octet string of variable length Associated_Data Octet string of variable length
Ciphertext Octet string of variable length Ciphertext Octet string of variable length
Outputs Outputs:
Plaintext Octet string, length = Plaintext Octet string, length =
length(Ciphertext)-tag_length length(Ciphertext) - tag_length
Validity_Flag Boolean, TRUE if valid, Validity_Flag Boolean, TRUE if valid,
FALSE otherwise FALSE otherwise
5.3. Handling of AEAD Authentication 5.3. Handling of AEAD Authentication
AEAD requires that all incoming packets MUST pass AEAD authentication AEAD requires that all incoming packets MUST pass AEAD authentication
before any other action takes place. Plaintext and associated data before any other action takes place. Plaintext and Associated Data
MUST NOT be released until the AEAD authentication tag has been MUST NOT be released until the AEAD authentication tag has been
validated. Further the ciphertext MUST NOT be decrypted until the validated. Further, the ciphertext MUST NOT be decrypted until the
AEAD tag has been validated. AEAD tag has been validated.
Should the AEAD tag prove to be invalid, the packet in question is to Should the AEAD tag prove to be invalid, the packet in question is to
be discarded and a Validation Error flag raised. Local policy be discarded and a Validation Error flag raised. Local policy
determines how this flag is to be handled and is outside the scope of determines how this flag is to be handled and is outside the scope of
this document. this document.
6. Counter Mode Encryption 6. Counter Mode Encryption
Each outbound packet uses a 12-octet IV and an encryption key to form Each outbound packet uses a 12-octet IV and an encryption key to form
two outputs, a 16-octet first_key_block which is used in forming the two outputs:
authentication tag and a key stream of octets, formed in blocks of
16-octets each. The first 16-octet block of key is saved for use in o a 16-octet first_key_block, which is used in forming the
forming the authentication tag, and the remainder of the key stream authentication tag, and
is XORed to the plaintext to form cipher. This key stream is formed
one block at a time by inputting the concatenation of a 12-octet IV o a keystream of octets, formed in blocks of 16 octets each
(see sections 8.1 and 9.1) with a 4-octet block to AES. The The first 16-octet block of the key is saved for use in forming the
pseudo-code below illustrates this process: authentication tag, and the remainder of the keystream is XORed to
the Plaintext to form the cipher. This keystream is formed one block
at a time by inputting the concatenation of a 12-octet IV (see
Sections 8.1 and 9.1) with a 4-octet block to AES. The pseudocode
below illustrates this process:
def GCM_keystream( Plaintext_len, IV, Encryption_key ): def GCM_keystream( Plaintext_len, IV, Encryption_key ):
assert Plaintext_len <= (2**36) - 32 ## measured in octets assert Plaintext_len <= (2**36) - 32 ## measured in octets
key_stream = "" key_stream = ""
block_counter = 1 block_counter = 1
first_key_block = AES_ENC( data=IV||block_counter, first_key_block = AES_ENC( data=IV||block_counter,
key=Encryption_key ) key=Encryption_key )
while len(key_stream) < Plaintext_len: while len(key_stream) < Plaintext_len:
block_counter = block_counter + 1 block_counter = block_counter + 1
key_block = AES_ENC( data=IV||block_counter, key_block = AES_ENC( data=IV||block_counter,
key=Encryption_key ) key=Encryption_key )
key_stream = key_stream || key_block key_stream = key_stream||key_block
key_stream = truncate( key_stream, Plaintext_len ) key_stream = truncate( key_stream, Plaintext_len )
return (first_key_block, key_stream ) return( first_key_block, key_stream )
In theory this keystream generation process allows for the encryption In theory, this keystream generation process allows for the
of up to (2^36)-32 octets per invocation (i.e. per packet), far encryption of up to (2^36) - 32 octets per invocation (i.e., per
longer than is actually required. packet), far longer than is actually required.
With any counter mode, if the same (IV, Encryption_key) pair is used With any counter mode, if the same (IV, Encryption_key) pair is used
twice, precisely the same keystream is formed. As explained in twice, precisely the same keystream is formed. As explained in
section 9.1 of RFC 3711, this is a cryptographic disaster. For GCM Section 9.1 of [RFC3711], this is a cryptographic disaster. For GCM,
the consequences are even worse since such a reuse compromises GCM's the consequences are even worse, since such a reuse compromises GCM's
integrity mechanism not only for the current packet stream but for integrity mechanism not only for the current packet stream but for
all future uses of the current encryption_key. all future uses of the current encryption_key.
7. Unneeded SRTP/SRTCP Fields 7. Unneeded SRTP/SRTCP Fields
AEAD counter mode encryption removes the need for certain existing AEAD Counter Mode encryption removes the need for certain existing
SRTP/SRTCP mechanisms. SRTP/SRTCP mechanisms.
7.1. SRTP/SRTCP Authentication Field 7.1. SRTP/SRTCP Authentication Tag Field
The AEAD message authentication mechanism MUST be the primary message The AEAD message authentication mechanism MUST be the primary message
authentication mechanism for AEAD SRTP/SRTCP. Additional SRTP/SRTCP authentication mechanism for AEAD SRTP/SRTCP. Additional SRTP/SRTCP
authentication mechanisms SHOULD NOT be used with any AEAD algorithm authentication mechanisms SHOULD NOT be used with any AEAD algorithm,
and the optional SRTP/SRTCP Authentication Tags are NOT RECOMMENDED and the optional SRTP/SRTCP authentication tags are NOT RECOMMENDED
and SHOULD NOT be present. Note that this contradicts section 3.4 of and SHOULD NOT be present. Note that this contradicts Section 3.4 of
[RFC3711] which makes the use of the SRTCP Authentication field [RFC3711], which makes the use of the SRTCP authentication tag field
mandatory, but the presence of the AEAD authentication renders the mandatory, but the presence of the AEAD authentication renders the
older authentication methods redundant. older authentication methods redundant.
Rationale. Some applications use the SRTP/SRTCP Authentication Rationale: Some applications use the SRTP/SRTCP authentication tag
Tag as a means of conveying additional information, notably as a means of conveying additional information, notably [RFC4771].
This document retains the authentication tag field primarily to
[RFC4771]. This document retains the Authentication Tag field preserve compatibility with these applications.
primarily to preserve compatibility with these applications.
7.2. RTP Padding 7.2. RTP Padding
AES-GCM does not requires that the data be padded out to a specific AES-GCM does not require that the data be padded out to a specific
block size, reducing the need to use the padding mechanism provided block size, reducing the need to use the padding mechanism provided
by RTP. It is RECOMMENDED that the RTP padding mechanism not be used by RTP. It is RECOMMENDED that the RTP padding mechanism not be used
unless it is necessary to disguise the length of the underlying unless it is necessary to disguise the length of the underlying
plaintext. Plaintext.
8. AES-GCM processing for SRTP 8. AES-GCM Processing for SRTP
8.1. SRTP IV formation for AES-GCM 8.1. SRTP IV Formation for AES-GCM
0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 1
0 1 2 3 4 5 6 7 8 9 0 1 0 1 2 3 4 5 6 7 8 9 0 1
+--+--+--+--+--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+--+--+--+--+
|00|00| SSRC | ROC | SEQ |---+ |00|00| SSRC | ROC | SEQ |---+
+--+--+--+--+--+--+--+--+--+--+--+--+ | +--+--+--+--+--+--+--+--+--+--+--+--+ |
| |
+--+--+--+--+--+--+--+--+--+--+--+--+ | +--+--+--+--+--+--+--+--+--+--+--+--+ |
| Encryption Salt |->(+) | Encryption Salt |->(+)
+--+--+--+--+--+--+--+--+--+--+--+--+ | +--+--+--+--+--+--+--+--+--+--+--+--+ |
| |
+--+--+--+--+--+--+--+--+--+--+--+--+ | +--+--+--+--+--+--+--+--+--+--+--+--+ |
| Initialization Vector |<--+ | Initialization Vector |<--+
+--+--+--+--+--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+--+--+--+--+
Figure 1: AES-GCM SRTP Initialization Figure 1: AES-GCM SRTP Initialization Vector Formation
Vector formation.
The 12 octet initialization vector used by AES-GCM SRTP is formed by
first concatenating 2 octets of zeroes, the 4-octet SSRC, the 4-octet
Rollover Counter (ROC) and the 2-octet sequence number SEQ. The
resulting 12-octet value is then XORed to the 12-octet salt to form
the 12-octet IV.
8.2. Data Types in SRTP Packets The 12-octet IV used by AES-GCM SRTP is formed by first concatenating
2 octets of zeroes, the 4-octet SSRC, the 4-octet rollover counter
(ROC), and the 2-octet sequence number (SEQ). The resulting 12-octet
value is then XORed to the 12-octet salt to form the 12-octet IV.
8.2. Data Types in SRTP Packets
All SRTP packets MUST be both authenticated and encrypted. The data All SRTP packets MUST be both authenticated and encrypted. The data
fields within the RTP packets are broken into Associated Data, fields within the RTP packets are broken into Associated Data,
Plaintext and Raw Data as follows (see Figure 2): Plaintext, and Raw Data, as follows (see Figure 2):
Associated Data: The version V (2 bits), padding flag P (1 bit), Associated Data: The version V (2 bits), padding flag P (1 bit),
extension flag X (1 bit), CSRC count CC (4 bits), extension flag X (1 bit), Contributing Source
marker M (1 bit), the Payload Type PT (7 bits), (CSRC) count CC (4 bits), marker M (1 bit),
the sequence number (16 bits), timestamp (32 Payload Type PT (7 bits), sequence number
bits), SSRC (32 bits), optional contributing (16 bits), timestamp (32 bits), SSRC (32 bits),
source identifiers (CSRCs, 32 bits each), and optional CSRC identifiers (32 bits each), and
optional RTP extension (variable length). optional RTP extension (variable length).
Plaintext: The RTP payload (variable length), RTP padding Plaintext: The RTP payload (variable length), RTP padding
(if used, variable length), and RTP pad count ( (if used, variable length), and RTP pad count (if
if used, 1 octet). used, 1 octet).
Raw Data: The optional variable length SRTP MKI and SRTP Raw Data: The optional variable-length SRTP Master Key
authentication tag (whose use is NOT Identifier (MKI) and SRTP authentication tag
RECOMMENDED). These fields are appended after (whose use is NOT RECOMMENDED). These fields are
encryption has been performed. appended after encryption has been performed.
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
A |V=2|P|X| CC |M| PT | sequence number | A |V=2|P|X| CC |M| PT | sequence number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
A | timestamp | A | timestamp |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
A | synchronization source (SSRC) identifier | A | synchronization source (SSRC) identifier |
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
skipping to change at page 10, line 38 skipping to change at page 10, line 50
A | RTP extension (OPTIONAL) | A | RTP extension (OPTIONAL) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
P | payload ... | P | payload ... |
P | +-------------------------------+ P | +-------------------------------+
P | | RTP padding | RTP pad count | P | | RTP padding | RTP pad count |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
P = Plaintext (to be encrypted and authenticated) P = Plaintext (to be encrypted and authenticated)
A = Associated Data (to be authenticated only) A = Associated Data (to be authenticated only)
Figure 2: Structure of an RTP packet before Authenticated Figure 2: Structure of an RTP Packet before Authenticated Encryption
Encryption Since the AEAD ciphertext is larger than the Plaintext by exactly the
length of the AEAD authentication tag, the corresponding
Since the AEAD ciphertext is larger than the plaintext by exactly the SRTP-encrypted packet replaces the Plaintext field with a slightly
length of the AEAD authentication tag, the corresponding SRTP larger field containing the cipher. Even if the Plaintext field is
encrypted packet replaces the plaintext field by a slightly larger empty, AEAD encryption must still be performed, with the resulting
field containing the cipher. Even if the plaintext field is empty, cipher consisting solely of the authentication tag. This tag is to
AEAD encryption must still be performed, with the resulting cipher be placed immediately before the optional variable-length SRTP MKI
consisting solely of the authentication tag. This tag is to be and SRTP authentication tag fields.
placed immediately before the optional variable length SRTP MKI and
SRTP authentication tag fields.
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
A |V=2|P|X| CC |M| PT | sequence number | A |V=2|P|X| CC |M| PT | sequence number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
A | timestamp | A | timestamp |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
A | synchronization source (SSRC) identifier | A | synchronization source (SSRC) identifier |
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
skipping to change at page 11, line 31 skipping to change at page 11, line 39
C | | C | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
R : SRTP MKI (OPTIONAL) : R : SRTP MKI (OPTIONAL) :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
R : SRTP authentication tag (NOT RECOMMENDED) : R : SRTP authentication tag (NOT RECOMMENDED) :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
C = Ciphertext (encrypted and authenticated) C = Ciphertext (encrypted and authenticated)
A = Associated Data (authenticated only) A = Associated Data (authenticated only)
R = neither encrypted nor authenticated, added R = neither encrypted nor authenticated, added
after authenticated encryption completed after Authenticated Encryption completed
Figure 3: Structure of an SRTP packet after Authenticated Figure 3: Structure of an SRTP Packet after Authenticated Encryption
Encryption
8.3. Handling Header Extensions 8.3. Handling Header Extensions
RTP header extensions were first defined in RFC 3550. RFC 6904 RTP header extensions were first defined in [RFC3550]. [RFC6904]
[RFC6904] describes how these header extensions are to be encrypted describes how these header extensions are to be encrypted in SRTP.
in SRTP.
When RFC 6904 is in use, a separate keystream is generated to encrypt When RFC 6904 is in use, a separate keystream is generated to encrypt
selected RTP header extension elements. For the AEAD_AES_128_GCM selected RTP header extension elements. For the AEAD_AES_128_GCM
algorithm, this keystream MUST be generated in the manner defined in algorithm, this keystream MUST be generated in the manner defined in
[RFC6904] using the AES-CM transform. For the AEAD_AES_256_GCM [RFC6904], using the AES Counter Mode (AES-CM) transform. For the
algorithm, the keystream MUST be generated in the manner defined for AEAD_AES_256_GCM algorithm, the keystream MUST be generated in the
the AES_256_CM transform. The originator must perform any required manner defined for the AES_256_CM transform. The originator must
header extension encryption before the AEAD algorithm is invoked. perform any required header extension encryption before the AEAD
algorithm is invoked.
As with the other fields contained within the RTP header, both As with the other fields contained within the RTP header, both
encrypted and unencrypted header extensions are to be treated by the encrypted and unencrypted header extensions are to be treated by the
AEAD algorithm as Associated Data (AD). Thus the AEAD algorithm does AEAD algorithm as Associated Data (AD). Thus, the AEAD algorithm
not provide any additional privacy for the header extensions, but does not provide any additional privacy for the header extensions,
does provide integrity and authentication. but it does provide integrity and authentication.
8.4. Prevention of SRTP IV Reuse 8.4. Prevention of SRTP IV Reuse
In order to prevent IV reuse, we must ensure that the (ROC,SEQ,SSRC) In order to prevent IV reuse, we must ensure that the (ROC,SEQ,SSRC)
triple is never used twice with the same master key. There are two triple is never used twice with the same master key. The following
phases to this issue. two scenarios illustrate this issue:
Counter Management: A rekey MUST be performed to establish a new Counter Management: A rekey MUST be performed to establish a new
master key before the (ROC,SEQ) pair cycles master key before the (ROC,SEQ) pair cycles
back to its original value. Note that back to its original value. Note that this
implicitly assumes that either the outgoing RTP scenario implicitly assumes that either
process is trusted to not attempt to repeat a (1) the outgoing RTP process is trusted to not
(ROC,SEQ) value, or that the encryption process attempt to repeat a (ROC,SEQ) value or (2) the
ensures that the both the SEQ and ROC numbers encryption process ensures that both the SEQ
of the packets presented to it are always and ROC numbers of the packets presented to it
incremented in the proper fashion. This is are always incremented in the proper fashion.
particularly important for GCM since using the This is particularly important for GCM, since
same (ROC,SEQ) value twice compromises the using the same (ROC,SEQ) value twice
authentication mechanism. For GCM, the compromises the authentication mechanism. For
(ROC,SEQ) and SSRC values used MUST either be GCM, the (ROC,SEQ) and SSRC values used MUST
generated or checked by the SRTP be generated or checked by either the SRTP
implementation, or by a module (e.g. the RTP implementation or a module (e.g., the RTP
application) that can be considered equally application) that can be considered equally
trusted as the SRTP implementation. While trustworthy. While [RFC3711] allows the
[RFC3711] allows detecting SSRC collisions detection of SSRC collisions after they
after they happen, SRTP using GCM with shared happen, SRTP using GCM with shared master keys
master keys MUST prevent SSRC collision from MUST prevent an SSRC collision from happening
happening even once. even once.
SSRC Management: For a given master key, the set of all SSRC SSRC Management: For a given master key, the set of all SSRC
values used with that master key must be values used with that master key must be
partitioned into disjoint pools, one pool for partitioned into disjoint pools, one pool for
each endpoint using that master key to each endpoint using that master key to
originate outbound data. Each such originating originate outbound data. Each such
endpoint MUST only issue SSRC values from the originating endpoint MUST only issue SSRC
pool it has been assigned. Further, each values from the pool it has been assigned.
originating endpoint MUST maintain a history of Further, each originating endpoint MUST
outbound SSRC identifiers that it has issued maintain a history of outbound SSRC
within the lifetime of the current master key, identifiers that it has issued within the
and when a new synchronization source requests lifetime of the current master key, and when a
an SSRC identifier it MUST NOT be given an new SSRC requests an SSRC identifier it
identifier that has been previously issued. A MUST NOT be given an identifier that has been
rekey MUST be performed before any of the previously issued. A rekey MUST be performed
originating endpoints using that master key before any of the originating endpoints using
exhausts its pool of SSRC values. Further, the that master key exhaust their pools of SSRC
identity of the entity giving out SSRC values values. Further, the identity of the entity
MUST be verified, and the SSRC signaling MUST giving out SSRC values MUST be verified, and
be integrity protected. the SSRC signaling MUST be integrity
protected.
9. AES-GCM Processing of SRTCP Compound Packets 9. AES-GCM Processing of SRTCP Compound Packets
All SRTCP compound packets MUST be authenticated, but unlike SRTP, All SRTCP compound packets MUST be authenticated, but unlike SRTP,
SRTCP packet encryption is optional. A sender can select which SRTCP packet encryption is optional. A sender can select which
packets to encrypt, and indicates this choice with a 1-bit encryption packets to encrypt and indicates this choice with a 1-bit
flag (located just before the 31-bit SRTCP index) Encryption flag (located just before the 31-bit SRTCP index).
9.1. SRTCP IV formation for AES-GCM 9.1. SRTCP IV Formation for AES-GCM
The 12-octet initialization vector used by AES-GCM SRTCP is formed by The 12-octet IV used by AES-GCM SRTCP is formed by first
first concatenating 2-octets of zeroes, the 4-octet Synchronization concatenating 2 octets of zeroes, the 4-octet SSRC identifier,
Source identifier (SSRC), 2-octets of zeroes, a single zero bit, and 2 octets of zeroes, a single "0" bit, and the 31-bit SRTCP index.
the 31-bit SRTCP Index. The resulting 12-octet value is then XORed The resulting 12-octet value is then XORed to the 12-octet salt to
to the 12-octet salt to form the 12-octet IV. form the 12-octet IV.
0 1 2 3 4 5 6 7 8 9 9 11 0 1 2 3 4 5 6 7 8 9 10 11
+--+--+--+--+--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+--+--+--+--+
|00|00| SSRC |00|00|0+SRTCP Idx|---+ |00|00| SSRC |00|00|0+SRTCP Idx|---+
+--+--+--+--+--+--+--+--+--+--+--+--+ | +--+--+--+--+--+--+--+--+--+--+--+--+ |
| |
+--+--+--+--+--+--+--+--+--+--+--+--+ | +--+--+--+--+--+--+--+--+--+--+--+--+ |
| Encryption Salt |->(+) | Encryption Salt |->(+)
+--+--+--+--+--+--+--+--+--+--+--+--+ | +--+--+--+--+--+--+--+--+--+--+--+--+ |
| |
+--+--+--+--+--+--+--+--+--+--+--+--+ | +--+--+--+--+--+--+--+--+--+--+--+--+ |
| Initialization Vector |<--+ | Initialization Vector |<--+
+--+--+--+--+--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+--+--+--+--+
Figure 4: SRTCP Initialization Vector formation Figure 4: SRTCP Initialization Vector Formation
9.2. Data Types in Encrypted SRTCP Compound Packets 9.2. Data Types in Encrypted SRTCP Compound Packets
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
A |V=2|P| RC | Packet Type | length | A |V=2|P| RC | Packet Type | length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
A | synchronization source (SSRC) of Sender | A | synchronization source (SSRC) of sender |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
P | sender info : P | sender info :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
P | report block 1 : P | report block 1 :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
P | report block 2 : P | report block 2 :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
P | ... : P | ... :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
P |V=2|P| SC | Packet Type | length | P |V=2|P| SC | Packet Type | length |
skipping to change at page 14, line 42 skipping to change at page 14, line 42
R | SRTCP MKI (optional) index : R | SRTCP MKI (optional) index :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
R : SRTCP authentication tag (NOT RECOMMENDED) : R : SRTCP authentication tag (NOT RECOMMENDED) :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
P = Plaintext (to be encrypted and authenticated) P = Plaintext (to be encrypted and authenticated)
A = Associated Data (to be authenticated only) A = Associated Data (to be authenticated only)
R = neither encrypted nor authenticated, added after R = neither encrypted nor authenticated, added after
encryption encryption
Figure 5: AEAD SRTCP inputs when encryption flag = 1. Figure 5: AEAD SRTCP Inputs When Encryption Flag = 1
(The fields are defined in RFC 3550.)
When the encryption flag is set to 1, the SRTCP packet is broken into When the Encryption flag is set to 1, the SRTCP packet is broken into
plaintext, associated data, and raw (untouched) data (as shown above Plaintext, Associated Data, and Raw (untouched) Data (as shown above
in figure 5): in Figure 5):
Associated Data: The packet version V (2 bits), padding flag P (1 Associated Data: The packet version V (2 bits), padding flag P
bit), reception report count RC (5 bits), packet (1 bit), reception report count RC (5 bits),
type (8 bits), length (2 octets), SSRC (4 Packet Type (8 bits), length (2 octets), SSRC
octets), encryption flag (1 bit) and SRTCP index (4 octets), Encryption flag (1 bit), and SRTCP
(31 bits). index (31 bits).
Raw Data: The optional variable length SRTCP MKI and SRTCP Raw Data: The optional variable-length SRTCP MKI and SRTCP
authentication tag (whose use is NOT authentication tag (whose use is
RECOMMENDED). NOT RECOMMENDED).
Plaintext: All other data. Plaintext: All other data.
Note that the plaintext comes in one contiguous field. Since the Note that the Plaintext comes in one contiguous field. Since the
AEAD cipher is larger than the plaintext by exactly the length of the AEAD cipher is larger than the Plaintext by exactly the length of the
AEAD authentication tag, the corresponding SRTCP encrypted packet AEAD authentication tag, the corresponding SRTCP-encrypted packet
replaces the plaintext field with a slightly larger field containing replaces the Plaintext field with a slightly larger field containing
the cipher. Even if the plaintext field is empty, AEAD encryption the cipher. Even if the Plaintext field is empty, AEAD encryption
must still be performed, with the resulting cipher consisting solely must still be performed, with the resulting cipher consisting solely
of the authentication tag. This tag is to be placed immediately of the authentication tag. This tag is to be placed immediately
before the encryption flag and SRTCP index. before the Encryption flag and SRTCP index.
9.3. Data Types in Unencrypted SRTCP Compound Packets 9.3. Data Types in Unencrypted SRTCP Compound Packets
0 1 2 3 0 1 2 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
A |V=2|P| RC | Packet Type | length | A |V=2|P| RC | Packet Type | length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
A | synchronization source (SSRC) of Sender | A | synchronization source (SSRC) of sender |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
A | sender info : A | sender info :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
A | report block 1 : A | report block 1 :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
A | report block 2 : A | report block 2 :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
A | ... : A | ... :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
A |V=2|P| SC | Packet Type | length | A |V=2|P| SC | Packet Type | length |
skipping to change at page 15, line 53 skipping to change at page 16, line 41
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
R | SRTCP MKI (optional) index : R | SRTCP MKI (optional) index :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
R : authentication tag (NOT RECOMMENDED) : R : authentication tag (NOT RECOMMENDED) :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
A = Associated Data (to be authenticated only) A = Associated Data (to be authenticated only)
R = neither encrypted nor authenticated, added after R = neither encrypted nor authenticated, added after
encryption encryption
Figure 6: AEAD SRTCP inputs when encryption flag = 0 Figure 6: AEAD SRTCP Inputs When Encryption Flag = 0
When the encryption flag is set to 0, the SRTCP compound packet is When the Encryption flag is set to 0, the SRTCP compound packet is
broken into plaintext, associated data, and raw (untouched) data as broken into Plaintext, Associated Data, and Raw (untouched) Data, as
follows (see figure 6): follows (see Figure 6):
Plaintext: None. Plaintext: None.
Raw Data: The variable length optional SRTCP MKI and SRTCP Raw Data: The variable-length optional SRTCP MKI and SRTCP
authentication tag (whose use is NOT authentication tag (whose use is
RECOMMENDED). NOT RECOMMENDED).
Associated Data: All other data. Associated Data: All other data.
Even though there is no ciphertext in this RTCP packet, AEAD Even though there is no ciphertext in this RTCP packet, AEAD
encryption returns a cipher field which is precisely the length of encryption returns a cipher field that is precisely the length of the
the AEAD authentication tag. This cipher is to be placed before the AEAD authentication tag. This cipher is to be placed before the
Encryption flag and the SRTCP index in the authenticated SRTCP Encryption flag and the SRTCP index in the authenticated SRTCP
packet. packet.
9.4. Prevention of SRTCP IV Reuse 9.4. Prevention of SRTCP IV Reuse
A new master key MUST be established before the 31-bit SRTCP index A new master key MUST be established before the 31-bit SRTCP index
cycles back to its original value. Ideally, a rekey should be cycles back to its original value. Ideally, a rekey should be
performed and a new master key put in place well before the SRTCP performed and a new master key put in place well before the SRTCP
cycles back to the starting value. index cycles back to the starting value.
The comments on SSRC management in section 8.4 also apply. The comments on SSRC management in Section 8.4 also apply.
10. Constraints on AEAD for SRTP and SRTCP 10. Constraints on AEAD for SRTP and SRTCP
In general, any AEAD algorithm can accept inputs with varying In general, any AEAD algorithm can accept inputs with varying
lengths, but each algorithm can accept only a limited range of lengths, but each algorithm can accept only a limited range of
lengths for a specific parameter. In this section, we describe the lengths for a specific parameter. In this section, we describe the
constraints on the parameter lengths that any AEAD algorithm must constraints on the parameter lengths that any AEAD algorithm must
support to be used in AEAD-SRTP. Additionally, we specify a complete support to be used in AEAD-SRTP. Additionally, we specify a complete
parameter set for one specific family of AEAD algorithms, namely parameter set for one specific family of AEAD algorithms, namely
AES-GCM. AES-GCM.
All AEAD algorithms used with SRTP/SRTCP MUST satisfy the five All AEAD algorithms used with SRTP/SRTCP MUST satisfy the five
constraints listed below: constraints listed below:
PARAMETER Meaning Value Parameter Meaning Value
---------------------------------------------------------------------
A_MAX maximum Associated MUST be at least 12 octets.
Data length
A_MAX maximum associated MUST be at least 12 octets.
data length
N_MIN minimum nonce (IV) MUST be 12 octets. N_MIN minimum nonce (IV) MUST be 12 octets.
length length
N_MAX maximum nonce (IV) MUST be 12 octets. N_MAX maximum nonce (IV) MUST be 12 octets.
length length
P_MAX maximum plaintext GCM: MUST be <= 2^36-32 octets.
P_MAX maximum Plaintext GCM: MUST be <= 2^36 - 32 octets.
length per invocation length per invocation
C_MAX maximum ciphertext GCM: MUST be <= 2^36-16 octets. C_MAX maximum ciphertext GCM: MUST be <= 2^36 - 16 octets.
length per invocation length per invocation
For sake of clarity we specify two additional parameters: For the sake of clarity, we specify three additional parameters:
AEAD Authentication Tag Length MUST be 16 octets, AEAD authentication tag length MUST be 16 octets
Maximum number of invocations SRTP: MUST be at most 2^48,
for a given instantiation SRTCP: MUST be at most 2^31. Maximum number of invocations SRTP: MUST be at most 2^48
Block Counter size GCM: MUST be 32 bits. for a given instantiation SRTCP: MUST be at most 2^31
Block Counter size GCM: MUST be 32 bits
The reader is reminded that the ciphertext is longer than the The reader is reminded that the ciphertext is longer than the
plaintext by exactly the length of the AEAD authentication tag. Plaintext by exactly the length of the AEAD authentication tag.
11. Key Derivation Functions 11. Key Derivation Functions
A Key Derivation Function (KDF) is used to derive all of the required A Key Derivation Function (KDF) is used to derive all of the required
encryption and authentication keys from a secret value shared by the encryption and authentication keys from a secret value shared by the
endpoints. AEAD_AES_128_GCM algorithm MUST use the (128-bit) endpoints. The AEAD_AES_128_GCM algorithm MUST use the (128-bit)
AES_CM_PRF Key Derivation Function described in [RFC3711]. AES_CM PRF KDF described in [RFC3711]. AEAD_AES_256_GCM MUST use the
AEAD_AES_256_GCM MUST use the AES_256_CM_PRF Key Derivation Function AES_256_CM_PRF KDF described in [RFC6188].
described in [RFC6188].
12. Summary of AES-GCM in SRTP/SRTCP 12. Summary of AES-GCM in SRTP/SRTCP
For convenience, much of the information about the use of AES-GCM For convenience, much of the information about the use of the AES-GCM
family of algorithms in SRTP is collected in the tables contained in family of algorithms in SRTP is collected in the tables contained in
this section. this section.
The AES-GCM family of AEAD algorithms is built around the AES block The AES-GCM family of AEAD algorithms is built around the AES block
cipher algorithm. AES-GCM uses AES counter mode for encryption and cipher algorithm. AES-GCM uses AES-CM for encryption and Galois
Galois Message Authentication Code (GMAC) for authentication. A Message Authentication Code (GMAC) for authentication. A detailed
detailed description of the AES-GCM family can be found in description of the AES-GCM family can be found in [RFC5116]. The
[RFC5116]. The following members of the AES-GCM family may be used following members of the AES-GCM family may be used with SRTP/SRTCP:
with SRTP/SRTCP:
Name Key Size AEAD Tag Size Reference Name Key Size AEAD Tag Size Reference
================================================================ ================================================================
AEAD_AES_128_GCM 16 octets 16 octets [RFC5116] AEAD_AES_128_GCM 16 octets 16 octets [RFC5116]
AEAD_AES_256_GCM 32 octets 16 octets [RFC5116] AEAD_AES_256_GCM 32 octets 16 octets [RFC5116]
Table 1: AES-GCM algorithms for SRTP/SRTCP Table 1: AES-GCM Algorithms for SRTP/SRTCP
Any implementation of AES-GCM SRTP MUST support both AEAD_AES_128_GCM Any implementation of AES-GCM SRTP MUST support both AEAD_AES_128_GCM
and AEAD_AES_256_GCM. Below we summarize parameters associated with and AEAD_AES_256_GCM. Below, we summarize parameters associated with
these two GCM algorithms: these two GCM algorithms:
+--------------------------------+------------------------------+ +--------------------------------+------------------------------+
| Parameter | Value | | Parameter | Value |
+--------------------------------+------------------------------+ +--------------------------------+------------------------------+
| Master key length | 128 bits | | Master key length | 128 bits |
| Master salt length | 96 bits | | Master salt length | 96 bits |
| Key Derivation Function | AES_CM_PRF [RFC3711] | | Key Derivation Function | AES_CM PRF [RFC3711] |
| Maximum key lifetime (SRTP) | 2^48 packets | | Maximum key lifetime (SRTP) | 2^48 packets |
| Maximum key lifetime (SRTCP) | 2^31 packets | | Maximum key lifetime (SRTCP) | 2^31 packets |
| Cipher (for SRTP and SRTCP) | AEAD_AES_128_GCM | | Cipher (for SRTP and SRTCP) | AEAD_AES_128_GCM |
| AEAD authentication tag length | 128 bits | | AEAD authentication tag length | 128 bits |
+--------------------------------+------------------------------+ +--------------------------------+------------------------------+
Table 3: The AEAD_AES_128_GCM Crypto Suite Table 2: The AEAD_AES_128_GCM Crypto Suite
+--------------------------------+------------------------------+ +--------------------------------+------------------------------+
| Parameter | Value | | Parameter | Value |
+--------------------------------+------------------------------+ +--------------------------------+------------------------------+
| Master key length | 256 bits | | Master key length | 256 bits |
| Master salt length | 96 bits | | Master salt length | 96 bits |
| Key Derivation Function | AES_256_CM_PRF [RFC6188] | | Key Derivation Function | AES_256_CM_PRF [RFC6188] |
| Maximum key lifetime (SRTP) | 2^48 packets | | Maximum key lifetime (SRTP) | 2^48 packets |
| Maximum key lifetime (SRTCP) | 2^31 packets | | Maximum key lifetime (SRTCP) | 2^31 packets |
| Cipher (for SRTP and SRTCP) | AEAD_AES_256_GCM | | Cipher (for SRTP and SRTCP) | AEAD_AES_256_GCM |
| AEAD authentication tag length | 128 bits | | AEAD authentication tag length | 128 bits |
+--------------------------------+------------------------------+ +--------------------------------+------------------------------+
Table 4: The AEAD_AES_256_GCM Crypto Suite
13. Security Considerations Table 3: The AEAD_AES_256_GCM Crypto Suite
13.1. Handling of Security Critical Parameters 13. Security Considerations
13.1. Handling of Security-Critical Parameters
As with any security process, the implementer must take care to As with any security process, the implementer must take care to
ensure cryptographically sensitive parameters are properly handled. ensure that cryptographically sensitive parameters are properly
Many of these recommendations hold for all SRTP cryptographic handled. Many of these recommendations hold for all SRTP
algorithms, but we include them here to emphasize their importance. cryptographic algorithms, but we include them here to emphasize their
importance.
- If the master salt is to be kept secret, it MUST be properly - If the master salt is to be kept secret, it MUST be properly erased
erased when no longer needed. when no longer needed.
- The secret master key and all keys derived from it MUST be kept
secret. All keys MUST be properly erased when no longer
needed.
- At the start of each packet, the block counter MUST be reset to
1. The block counter is incremented after each block key has
been produced, but it MUST NOT be allowed to exceed 2^32-1 for
GCM. Note that even though the block counter is reset at the
start of each packet, IV uniqueness is ensured by the inclusion
of SSRC/ROC/SEQ or SRTCP Index in the IV. (The reader is
reminded that the first block of key produced is reserved for
use in authenticating the packet and is not used to encrypt
plaintext.)
- Each time a rekey occurs, the initial values of both the 31-bit
SRTCP index and the 48-bit SRTP packet index (ROC||SEQ) MUST be
saved in order to prevent IV reuse.
- Processing MUST cease if either the 31-bit SRTCP index or the
48-bit packet index ROC||SEQ cycles back to its initial value.
Processing MUST NOT resume until a new SRTP/SRTCP session has
been established using a new SRTP master key. Ideally, a rekey
should be done well before any of these counters cycle.
13.2. Size of the Authentication Tag - The secret master key and all keys derived from it MUST be kept
secret. All keys MUST be properly erased when no longer needed.
We require that the AEAD authentication tag to 16 octets, effectively - At the start of each packet, the Block Counter MUST be reset to 1.
eliminating the risk of an adversary successfully introducing The Block Counter is incremented after each block key has been
fraudulent data. Though other protocols may allow the use of produced, but it MUST NOT be allowed to exceed 2^32 - 1 for GCM.
truncated authentication tags, the consenus of the authors and the Note that even though the Block Counter is reset at the start of
working group is that risks associated with using truncated AES-GCM each packet, IV uniqueness is ensured by the inclusion of
tags are deemed to be too high to allow the use of truncated SSRC/ROC/SEQ or the SRTCP index in the IV. (The reader is reminded
authentication tags in STRP/SRTCP. that the first block of key produced is reserved for use in
authenticating the packet and is not used to encrypt Plaintext.)
14. IANA Considerations - Each time a rekey occurs, the initial values of both the 31-bit
SRTCP index and the 48-bit SRTP packet index (ROC||SEQ) MUST be
saved in order to prevent IV reuse.
14.1. SDES - Processing MUST cease if either the 31-bit SRTCP index or the
48-bit SRTP packet index (ROC||SEQ) cycles back to its initial
value. Processing MUST NOT resume until a new SRTP/SRTCP session
has been established using a new SRTP master key. Ideally, a rekey
should be done well before any of these counters cycle.
SDP Security Descriptions [RFC4568] defines SRTP "crypto suites". A 13.2. Size of the Authentication Tag
crypto suite corresponds to a particular AEAD algorithm in SRTP. In
order to allow Security Descriptions to signal the use of the We require that the AEAD authentication tag be 16 octets, in order to
algorithms defined in this document, IANA will register the following effectively eliminate the risk of an adversary successfully
crypto suites into the "SRTP Crypto Suite Registrations" subregistry introducing fraudulent data. Though other protocols may allow the
of the "Session Description Protocol (SDP) Security Descriptions" use of truncated authentication tags, the consensus of the authors
registry. and the working group is that risks associated with using truncated
AES-GCM tags are deemed too high to allow the use of truncated
authentication tags in SRTP/SRTCP.
14. IANA Considerations
14.1. SDES
"Session Description Protocol (SDP) Security Descriptions for Media
Streams" [RFC4568] defines SRTP "crypto suites". A crypto suite
corresponds to a particular AEAD algorithm in SRTP. In order to
allow security descriptions to signal the use of the algorithms
defined in this document, IANA has registered the following crypto
suites in the "SRTP Crypto Suite Registrations" subregistry of the
"Session Description Protocol (SDP) Security Descriptions" registry.
The ABNF [RFC5234] syntax is as follows:
srtp-crypto-suite-ext = "AEAD_AES_128_GCM" / srtp-crypto-suite-ext = "AEAD_AES_128_GCM" /
"AEAD_AES_256_GCM" / "AEAD_AES_256_GCM" /
srtp-crypto-suite-ext srtp-crypto-suite-ext
14.2. DTLS-SRTP 14.2. DTLS-SRTP
DTLS-SRTP [RFC5764] defines a DTLS-SRTP "SRTP Protection Profile". DTLS-SRTP [RFC5764] defines DTLS-SRTP "SRTP protection profiles".
These also correspond to the use of an AEAD algorithm in SRTP. In These profiles also correspond to the use of an AEAD algorithm in
order to allow the use of the algorithms defined in this document in SRTP. In order to allow the use of the algorithms defined in this
DTLS-SRTP, we request IANA register the following SRTP Protection document in DTLS-SRTP, IANA has registered the following SRTP
Profiles: protection profiles:
SRTP_AEAD_AES_128_GCM = {TBD, TBD } SRTP_AEAD_AES_128_GCM = {0x00, 0x07}
SRTP_AEAD_AES_256_GCM = {TBD, TBD } SRTP_AEAD_AES_256_GCM = {0x00, 0x08}
Below we list the SRTP transform parameters for each of these Below, we list the SRTP transform parameters for each of these
protection profile. Unless separate parameters for SRTCP and SRTCP protection profiles. Unless separate parameters for SRTP and SRTCP
are explicitly listed, these parameters apply to both SRTP and are explicitly listed, these parameters apply to both SRTP and SRTCP.
SRTCP.
SRTP_AEAD_AES_128_GCM SRTP_AEAD_AES_128_GCM
cipher: AES_128_GCM cipher: AES_128_GCM
cipher_key_length: 128 bits cipher_key_length: 128 bits
cipher_salt_length: 96 bits cipher_salt_length: 96 bits
aead_auth_tag_length: 16 octets aead_auth_tag_length: 16 octets
auth_function: NULL auth_function: NULL
auth_key_length: N/A auth_key_length: N/A
auth_tag_length: N/A auth_tag_length: N/A
maximum lifetime: at most 2^31 SRTCP packets and maximum lifetime: at most 2^31 SRTCP packets and
at most 2^48 SRTP packets at most 2^48 SRTP packets
SRTP_AEAD_AES_256_GCM
cipher: AES_256_GCM
cipher_key_length: 256 bits
cipher_salt_length: 96 bits
aead_auth_tag_length: 16 octets
auth_function: NULL
auth_key_length: N/A
auth_tag_length: N/A
maximum lifetime: at most 2^31 SRTCP packets and
at most 2^48 SRTP packets
Note that these SRTP Protection Profiles do not specify an SRTP_AEAD_AES_256_GCM
auth_function, auth_key_length, or auth_tag_length because all of cipher: AES_256_GCM
these profiles use AEAD algorithms, and thus do not use a separate cipher_key_length: 256 bits
auth_function, auth_key, or auth_tag. The term aead_auth_tag_length cipher_salt_length: 96 bits
is used to emphasize that this refers to the authentication tag aead_auth_tag_length: 16 octets
provided by the AEAD algorithm and that this tag is not located in auth_function: NULL
the authentication tag field provided by SRTP/SRTCP. auth_key_length: N/A
auth_tag_length: N/A
maximum lifetime: at most 2^31 SRTCP packets and
at most 2^48 SRTP packets
14.3. MIKEY Note that these SRTP protection profiles do not specify an
auth_function, auth_key_length, or auth_tag_length, because all
of these profiles use AEAD algorithms and thus do not use a
separate auth_function, auth_key, or auth_tag. The term
"aead_auth_tag_length" is used to emphasize that this refers to
the authentication tag provided by the AEAD algorithm and that
this tag is not located in the authentication tag field provided by
SRTP/SRTCP.
14.3. MIKEY
In accordance with "MIKEY: Multimedia Internet KEYing" [RFC3830], In accordance with "MIKEY: Multimedia Internet KEYing" [RFC3830],
IANA maintains several subregistries under "Multimedia Internet IANA maintains several subregistries under "Multimedia Internet
KEYing (MIKEY) Payload Name Spaces". This document requires KEYing (MIKEY) Payload Name Spaces". Per this document, additions
additions to two of the MIKEY subregistries. have been made to two of the MIKEY subregistries.
In the "MIKEY Security Protocol Parameters" subregistry we request In the "MIKEY Security Protocol Parameters" subregistry, the
the following addition: following has been added:
Type | Meaning | Possible values Type | Meaning | Possible Values
-------------------------------------------------------- --------------------------------------------------------
TBD | AEAD authentication tag length | 16 octets 20 | AEAD authentication tag length | 16 octets
This list is, of course, intended for use with GCM. It is This list is, of course, intended for use with GCM. It is
conceivable that new AEAD algorithms introduced at some point in the conceivable that new AEAD algorithms introduced at some point in the
future may require a different set of Authentication tag lengths. future may require a different set of authentication tag lengths.
In the "Encryption Algorithm" subregistry (derived from Table In the "Encryption algorithm (Value 0)" subregistry (derived from
6.10.1.b of [RFC3830]) we request the following addition: Table 6.10.1.b of [RFC3830]), the following has been added:
SRTP encr | Value | Default Session | Default Auth. SRTP Encr. | Value | Default Session | Default Auth.
Algorithm | | Encr. Key Length | Tag Length Algorithm | | Encr. Key Length | Tag Length
----------------------------------------------------------- -----------------------------------------------------------
AES-GCM | TBD | 16 octets | 16 octets AES-GCM | 6 | 16 octets | 16 octets
The encryption algorithm, session encryption key length, and AEAD The encryption algorithm, session encryption key length, and AEAD
authentication tag sizes received from MIKEY fully determine the AEAD authentication tag sizes received from MIKEY fully determine the AEAD
algorithm to be used. The exact mapping is described in section 15. algorithm to be used. The exact mapping is described in Section 15.
15. Parameters for use with MIKEY 15. Parameters for Use with MIKEY
MIKEY specifies the algorithm family separately from the key length MIKEY specifies the algorithm family separately from the key length
(which is specified by the Session Encryption key length) and the (which is specified by the Session Encryption key length) and the
authentication tag length (specified by AEAD Auth tag length). authentication tag length (specified by the AEAD authentication tag
length).
+------------+-------------+-------------+ +------------+-------------+-------------+
| Encryption | Encryption | AEAD Auth | | Encryption | Encryption | AEAD Auth. |
| Algorithm | Key Length | Tag Length | | Algorithm | Key Length | Tag Length |
+============+=============+=============+ +============+=============+=============+
AEAD_AES_128_GCM | AES-GCM | 16 octets | 16 octets | AEAD_AES_128_GCM | AES-GCM | 16 octets | 16 octets |
+------------+-------------+-------------+ +------------+-------------+-------------+
AEAD_AES_256_GCM | AES-GCM | 32 octets | 16 octets | AEAD_AES_256_GCM | AES-GCM | 32 octets | 16 octets |
+============+=============+=============+ +============+=============+=============+
Table 6: Mapping MIKEY parameters to AEAD algorithm Table 4: Mapping MIKEY Parameters to AEAD Algorithms
Section 11 in this document restricts the choice of Key Derivation Section 11 of this document restricts the choice of KDF for AEAD
Function for AEAD algorithms. To enforce this restriction in MIKEY, algorithms. To enforce this restriction in MIKEY, we require that
we require that the SRTP PRF has value AES-CM whenever an AEAD the SRTP Pseudorandom Function (PRF) has value AES-CM whenever an
algorithm is used. Note that, according to Section 6.10.1 in AEAD algorithm is used. Note that, according to Section 6.10.1 of
[RFC3830], the input key length of the Key Derivation Function (i.e. [RFC3830], the input key length of the KDF (i.e., the SRTP master key
the SRTP master key length) is always equal to the session encryption length) is always equal to the session encryption key length. This
key length. This means, for example, that AEAD_AES_256_GCM will use means, for example, that AEAD_AES_256_GCM will use AES_256_CM_PRF as
AES_256_CM_PRF as the Key Derivation Function. the KDF.
16. Some RTP Test Vectors
16. Some RTP Test Vectors
The examples in this section are all based upon the same RTP packet The examples in this section are all based upon the same RTP packet
8040f17b 8041f8d3 5501a0b2 47616c6c 8040f17b 8041f8d3 5501a0b2 47616c6c
69612065 7374206f 6d6e6973 20646976 69612065 7374206f 6d6e6973 20646976
69736120 696e2070 61727465 73207472 69736120 696e2070 61727465 73207472
6573 6573
consisting of a 12 octet header (8040f17b 8041f8d3 5501a0b2) and a 38 consisting of a 12-octet header (8040f17b 8041f8d3 5501a0b2) and a
octet payload (47616c6c 69612065 7374206f 6d6e6973 20646976 69736120 38-octet payload (47616c6c 69612065 7374206f 6d6e6973 20646976
696e2070 61727465 73207472 6573) which is just the ASCII string 69736120 696e2070 61727465 73207472 6573), which is just the ASCII
"Gallia est omnis divisa in partes tres". The salt used (51756964 string "Gallia est omnis divisa in partes tres". The salt used
2070726f 2071756f) comes from the ASCII string "Quid pro quo". The (51756964 2070726f 2071756f) comes from the ASCII string "Quid pro
16 octet (128 bit) key is 00 01 02 ... 0f and the 32 octet (256 bit) quo". The 16-octet (128-bit) key is 00 01 02 ... 0f, and the
key is 00 01 02 ... 1f. The RTP payload type (1000000 binary = 64 32-octet (256-bit) key is 00 01 02 ... 1f. At the time this document
decimal) was at the time this document was written an unassigned was written, the RTP payload type (1000000 binary = 64 decimal) was
value. an unassigned value.
As shown in section 8.1, the IV is formed XORing two 12-octet As shown in Section 8.1, the IV is formed by XORing two 12-octet
values. The first 12-octet value is formed by concatenating two zero values. The first 12-octet value is formed by concatenating two
octets, the 4-octet SSRC (found in the 9th thru 12th octets of the zero octets, the 4-octet SSRC (found in the ninth through 12th octets
packet), the 4-octet rollover counter ROC maintained at each end of of the packet), the 4-octet rollover counter (ROC) maintained at each
the link, and the 2-octet sequence number SEQ (found in the 3rd and end of the link, and the 2-octet sequence number (SEQ) (found in the
4th octets of the packet). The second 12-octet value is the salt, a third and fourth octets of the packet). The second 12-octet value is
value that is held constant at least until the key is changed. the salt, a value that is held constant at least until the key is
changed.
| Pad | SSRC | ROC | SEQ | | Pad | SSRC | ROC | SEQ |
00 00 55 01 a0 b2 00 00 00 00 f1 7b 00 00 55 01 a0 b2 00 00 00 00 f1 7b
salt 51 75 69 64 20 70 72 6f 20 71 75 6f salt 51 75 69 64 20 70 72 6f 20 71 75 6f
------------------------------------ ------------------------------------
IV 51 75 3c 65 80 c2 72 6f 20 71 84 14 IV 51 75 3c 65 80 c2 72 6f 20 71 84 14
All of the RTP examples use this IV. All of the RTP examples use this IV.
16.1. SRTP AEAD_AES_128_GCM 16.1. SRTP AEAD_AES_128_GCM
16.1.1. SRTP AEAD_AES_128_GCM Encryption
Encrypting the following packet: 16.1.1. SRTP AEAD_AES_128_GCM Encryption
8040f17b 8041f8d3 5501a0b2 47616c6c Encrypting the following packet:
69612065 7374206f 6d6e6973 20646976
69736120 696e2070 61727465 73207472
6573
Form the IV 8040f17b 8041f8d3 5501a0b2 47616c6c
| Pad | SSRC | ROC | SEQ | 69612065 7374206f 6d6e6973 20646976
00 00 55 01 a0 b2 00 00 00 00 f1 7b 69736120 696e2070 61727465 73207472
salt: 51 75 69 64 20 70 72 6f 20 71 75 6f 6573
IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f Form the IV
AAD: 8040f17b 8041f8d3 5501a0b2 | Pad | SSRC | ROC | SEQ |
PT: 47616c6c 69612065 7374206f 6d6e6973 00 00 55 01 a0 b2 00 00 00 00 f1 7b
20646976 69736120 696e2070 61727465 salt: 51 75 69 64 20 70 72 6f 20 71 75 6f
73207472 6573 IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
H: c6a13b37878f5b826f4f8162a1c8d879
Encrypt plaintext Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
block # 0 AAD: 8040f17b 8041f8d3 5501a0b2
IV||blk_cntr: 51753c6580c2726f2071841400000002 PT: 47616c6c 69612065 7374206f 6d6e6973
key_block: b5 2c 8f cf 92 55 fe 09 df ce a6 73 f0 10 22 b9 20646976 69736120 696e2070 61727465
plain_block: 47 61 6c 6c 69 61 20 65 73 74 20 6f 6d 6e 69 73 73207472 6573
cipher_block: f2 4d e3 a3 fb 34 de 6c ac ba 86 1c 9d 7e 4b ca IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
block # 1 H: c6a13b37878f5b826f4f8162a1c8d879
IV||blk_cntr: 51753c6580c2726f2071841400000003
key_block: 9e 07 52 a3 64 5a 2f 4f 2b cb d4 0a 30 b5 a5 fe
plain_block: 20 64 69 76 69 73 61 20 69 6e 20 70 61 72 74 65
cipher_block: be 63 3b d5 0d 29 4e 6f 42 a5 f4 7a 51 c7 d1 9b
block # 2
IV||blk_cntr: 51753c6580c2726f2071841400000004
key_block: 45 fe 4e ad ed 40 0a 5d 1a f3 63 f9 0c e1 49 3b
plain_block: 73 20 74 72 65 73
cipher_block: 36 de 3a df 88 33
Cipher before tag appended Encrypt the Plaintext
f24de3a3 fb34de6c acba861c 9d7e4bca block # 0
be633bd5 0d294e6f 42a5f47a 51c7d19b IV||blk_cntr: 51753c6580c2726f2071841400000002
36de3adf 8833 key_block: b5 2c 8f cf 92 55 fe 09 df ce a6 73 f0 10 22 b9
plain_block: 47 61 6c 6c 69 61 20 65 73 74 20 6f 6d 6e 69 73
cipher_block: f2 4d e3 a3 fb 34 de 6c ac ba 86 1c 9d 7e 4b ca
block # 1
IV||blk_cntr: 51753c6580c2726f2071841400000003
key_block: 9e 07 52 a3 64 5a 2f 4f 2b cb d4 0a 30 b5 a5 fe
plain_block: 20 64 69 76 69 73 61 20 69 6e 20 70 61 72 74 65
cipher_block: be 63 3b d5 0d 29 4e 6f 42 a5 f4 7a 51 c7 d1 9b
block # 2
IV||blk_cntr: 51753c6580c2726f2071841400000004
key_block: 45 fe 4e ad ed 40 0a 5d 1a f3 63 f9 0c e1 49 3b
plain_block: 73 20 74 72 65 73
cipher_block: 36 de 3a df 88 33
Compute GMAC tag Cipher before tag appended
f24de3a3 fb34de6c acba861c 9d7e4bca
be633bd5 0d294e6f 42a5f47a 51c7d19b
36de3adf 8833
Process AAD Compute the GMAC tag
AAD word: 8040f17b8041f8d35501a0b200000000
partial hash: bcfb3d1d0e6e3e78ba45403377dba11b
Process Cipher Process the AAD
Cipher word: f24de3a3fb34de6cacba861c9d7e4bca AAD word: 8040f17b8041f8d35501a0b200000000
partial hash: 0ebc0abe1b15b32fedd2b07888c1ef61 partial hash: bcfb3d1d0e6e3e78ba45403377dba11b
Cipher word: be633bd50d294e6f42a5f47a51c7d19b
partial hash: 438e5797011ea860585709a2899f4685
Cipher word: 36de3adf883300000000000000000000
partial hash: 336fb643310d7bac2aeaa76247f6036d
Process Length Word Process the cipher
Length word: 00000000000000600000000000000130 cipher word: f24de3a3fb34de6cacba861c9d7e4bca
partial hash: 1b964067078c408c4e442a8f015e5264 partial hash: 0ebc0abe1b15b32fedd2b07888c1ef61
cipher word: be633bd50d294e6f42a5f47a51c7d19b
partial hash: 438e5797011ea860585709a2899f4685
cipher word: 36de3adf883300000000000000000000
partial hash: 336fb643310d7bac2aeaa76247f6036d
Turn GHASH into GMAC Process the length word
GHASH: 1b 96 40 67 07 8c 40 8c 4e 44 2a 8f 01 5e 52 64 length word: 00000000000000600000000000000130
K0: 92 0b 3f 40 b9 3d 2a 1d 1c 8b 5c d1 e5 67 5e aa partial hash: 1b964067078c408c4e442a8f015e5264
full GMAC: 89 9d 7f 27 be b1 6a 91 52 cf 76 5e e4 39 0c ce
Cipher with tag Turn GHASH into GMAC
f24de3a3 fb34de6c acba861c 9d7e4bca GHASH: 1b 96 40 67 07 8c 40 8c 4e 44 2a 8f 01 5e 52 64
be633bd5 0d294e6f 42a5f47a 51c7d19b K0: 92 0b 3f 40 b9 3d 2a 1d 1c 8b 5c d1 e5 67 5e aa
36de3adf 8833899d 7f27beb1 6a9152cf full GMAC: 89 9d 7f 27 be b1 6a 91 52 cf 76 5e e4 39 0c ce
765ee439 0cce
Encrypted and Tagged packet: Cipher with tag
8040f17b 8041f8d3 5501a0b2 f24de3a3 f24de3a3 fb34de6c acba861c 9d7e4bca
fb34de6c acba861c 9d7e4bca be633bd5 be633bd5 0d294e6f 42a5f47a 51c7d19b
0d294e6f 42a5f47a 51c7d19b 36de3adf 36de3adf 8833899d 7f27beb1 6a9152cf
8833899d 7f27beb1 6a9152cf 765ee439 765ee439 0cce
0cce
16.1.2. SRTP AEAD_AES_128_GCM Decryption Encrypted and tagged packet:
8040f17b 8041f8d3 5501a0b2 f24de3a3
fb34de6c acba861c 9d7e4bca be633bd5
0d294e6f 42a5f47a 51c7d19b 36de3adf
8833899d 7f27beb1 6a9152cf 765ee439
0cce
Decrypting the following packet: 16.1.2. SRTP AEAD_AES_128_GCM Decryption
8040f17b 8041f8d3 5501a0b2 f24de3a3 Decrypting the following packet:
fb34de6c acba861c 9d7e4bca be633bd5
0d294e6f 42a5f47a 51c7d19b 36de3adf
8833899d 7f27beb1 6a9152cf 765ee439
0cce
Form the IV 8040f17b 8041f8d3 5501a0b2 f24de3a3
| Pad | SSRC | ROC | SEQ | fb34de6c acba861c 9d7e4bca be633bd5
00 00 55 01 a0 b2 00 00 00 00 f1 7b 0d294e6f 42a5f47a 51c7d19b 36de3adf
salt: 51 75 69 64 20 70 72 6f 20 71 75 6f 8833899d 7f27beb1 6a9152cf 765ee439
IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14 0cce
Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f Form the IV
AAD: 8040f17b 8041f8d3 5501a0b2 | Pad | SSRC | ROC | SEQ |
CT: f24de3a3 fb34de6c acba861c 9d7e4bca 00 00 55 01 a0 b2 00 00 00 00 f1 7b
be633bd5 0d294e6f 42a5f47a 51c7d19b salt: 51 75 69 64 20 70 72 6f 20 71 75 6f
36de3adf 8833899d 7f27beb1 6a9152cf IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
765ee439 0cce
IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
H: c6a13b37878f5b826f4f8162a1c8d879
Verify received tag 89 9d 7f 27 be b1 6a 91 52 cf 76 5e e4 39 0c ce Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
AAD: 8040f17b 8041f8d3 5501a0b2
CT: f24de3a3 fb34de6c acba861c 9d7e4bca
be633bd5 0d294e6f 42a5f47a 51c7d19b
36de3adf 8833899d 7f27beb1 6a9152cf
765ee439 0cce
IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
H: c6a13b37878f5b826f4f8162a1c8d879
Process AAD Verify the received tag
AAD word: 8040f17b8041f8d35501a0b200000000 89 9d 7f 27 be b1 6a 91 52 cf 76 5e e4 39 0c ce
partial hash: bcfb3d1d0e6e3e78ba45403377dba11b
Process Cipher Process the AAD
Cipher word: f24de3a3fb34de6cacba861c9d7e4bca AAD word: 8040f17b8041f8d35501a0b200000000
partial hash: 0ebc0abe1b15b32fedd2b07888c1ef61 partial hash: bcfb3d1d0e6e3e78ba45403377dba11b
Cipher word: be633bd50d294e6f42a5f47a51c7d19b
partial hash: 438e5797011ea860585709a2899f4685
Cipher word: 36de3adf883300000000000000000000
partial hash: 336fb643310d7bac2aeaa76247f6036d
Process Length Word Process the cipher
Length word: 00000000000000600000000000000130 cipher word: f24de3a3fb34de6cacba861c9d7e4bca
partial hash: 1b964067078c408c4e442a8f015e5264 partial hash: 0ebc0abe1b15b32fedd2b07888c1ef61
cipher word: be633bd50d294e6f42a5f47a51c7d19b
partial hash: 438e5797011ea860585709a2899f4685
cipher word: 36de3adf883300000000000000000000
partial hash: 336fb643310d7bac2aeaa76247f6036d
Turn GHASH into GMAC Process the length word
GHASH: 1b 96 40 67 07 8c 40 8c 4e 44 2a 8f 01 5e 52 64 length word: 00000000000000600000000000000130
K0: 92 0b 3f 40 b9 3d 2a 1d 1c 8b 5c d1 e5 67 5e aa partial hash: 1b964067078c408c4e442a8f015e5264
full GMAC: 89 9d 7f 27 be b1 6a 91 52 cf 76 5e e4 39 0c ce
Received tag = 899d7f27 beb16a91 52cf765e e4390cce Turn GHASH into GMAC
Computed tag = 899d7f27 beb16a91 52cf765e e4390cce GHASH: 1b 96 40 67 07 8c 40 8c 4e 44 2a 8f 01 5e 52 64
Received tag verified. K0: 92 0b 3f 40 b9 3d 2a 1d 1c 8b 5c d1 e5 67 5e aa
full GMAC: 89 9d 7f 27 be b1 6a 91 52 cf 76 5e e4 39 0c ce
Decrypt cipher Received tag = 899d7f27 beb16a91 52cf765e e4390cce
block # 0 Computed tag = 899d7f27 beb16a91 52cf765e e4390cce
IV||blk_cntr: 51753c6580c2726f2071841400000002 Received tag verified.
key_block: b5 2c 8f cf 92 55 fe 09 df ce a6 73 f0 10 22 b9
cipher_block: f2 4d e3 a3 fb 34 de 6c ac ba 86 1c 9d 7e 4b ca
plain_block: 47 61 6c 6c 69 61 20 65 73 74 20 6f 6d 6e 69 73
block # 1
IV||blk_cntr: 51753c6580c2726f2071841400000003
key_block: 9e 07 52 a3 64 5a 2f 4f 2b cb d4 0a 30 b5 a5 fe
cipher_block: be 63 3b d5 0d 29 4e 6f 42 a5 f4 7a 51 c7 d1 9b
plain_block: 20 64 69 76 69 73 61 20 69 6e 20 70 61 72 74 65
block # 2
IV||blk_cntr: 51753c6580c2726f2071841400000004
key_block: 45 fe 4e ad ed 40 0a 5d 1a f3 63 f9 0c e1 49 3b
cipher_block: 36 de 3a df 88 33
plain_block: 73 20 74 72 65 73
Verified and Taged packet: Decrypt the cipher
47616c6c 69612065 7374206f 6d6e6973 block # 0
20646976 69736120 696e2070 61727465 IV||blk_cntr: 51753c6580c2726f2071841400000002
73207472 6573 key_block: b5 2c 8f cf 92 55 fe 09 df ce a6 73 f0 10 22 b9
cipher_block: f2 4d e3 a3 fb 34 de 6c ac ba 86 1c 9d 7e 4b ca
plain_block: 47 61 6c 6c 69 61 20 65 73 74 20 6f 6d 6e 69 73
block # 1
IV||blk_cntr: 51753c6580c2726f2071841400000003
key_block: 9e 07 52 a3 64 5a 2f 4f 2b cb d4 0a 30 b5 a5 fe
cipher_block: be 63 3b d5 0d 29 4e 6f 42 a5 f4 7a 51 c7 d1 9b
plain_block: 20 64 69 76 69 73 61 20 69 6e 20 70 61 72 74 65
block # 2
IV||blk_cntr: 51753c6580c2726f2071841400000004
key_block: 45 fe 4e ad ed 40 0a 5d 1a f3 63 f9 0c e1 49 3b
cipher_block: 36 de 3a df 88 33
plain_block: 73 20 74 72 65 73
16.1.3. SRTP AEAD_AES_128_GCM Authentication Tagging Verified and tagged packet:
47616c6c 69612065 7374206f 6d6e6973
20646976 69736120 696e2070 61727465
73207472 6573
Tagging the following packet: 16.1.3. SRTP AEAD_AES_128_GCM Authentication Tagging
8040f17b 8041f8d3 5501a0b2 47616c6c Tagging the following packet:
69612065 7374206f 6d6e6973 20646976
69736120 696e2070 61727465 73207472
6573
Form the IV 8040f17b 8041f8d3 5501a0b2 47616c6c
| Pad | SSRC | ROC | SEQ | 69612065 7374206f 6d6e6973 20646976
00 00 55 01 a0 b2 00 00 00 00 f1 7b 69736120 696e2070 61727465 73207472
salt: 51 75 69 64 20 70 72 6f 20 71 75 6f 6573
IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f Form the IV
AAD: 8040f17b 8041f8d3 5501a0b2 47616c6c | Pad | SSRC | ROC | SEQ |
69612065 7374206f 6d6e6973 20646976 00 00 55 01 a0 b2 00 00 00 00 f1 7b
69736120 696e2070 61727465 73207472 salt: 51 75 69 64 20 70 72 6f 20 71 75 6f
6573 IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
H: c6a13b37878f5b826f4f8162a1c8d879
Compute GMAC tag Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
AAD: 8040f17b 8041f8d3 5501a0b2 47616c6c
69612065 7374206f 6d6e6973 20646976
69736120 696e2070 61727465 73207472
6573
IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
H: c6a13b37878f5b826f4f8162a1c8d879
Process AAD Compute the GMAC tag
AAD word: 8040f17b8041f8d35501a0b247616c6c
partial hash: 79f41fea34a474a77609d8925e9f2b22
AAD word: 696120657374206f6d6e697320646976
partial hash: 84093a2f85abf17ab37d3ce2f706138f
AAD word: 69736120696e20706172746573207472
partial hash: ab2760fee24e6dec754739d8059cd144
AAD word: 65730000000000000000000000000000
partial hash: e84f3c55d287fc561c41d09a8aada4be
Process Length Word Process the AAD
Length word: 00000000000001900000000000000000 AAD word: 8040f17b8041f8d35501a0b247616c6c
partial hash: b04200c26b81c98af55cc2eafccd1cbc partial hash: 79f41fea34a474a77609d8925e9f2b22
AAD word: 696120657374206f6d6e697320646976
partial hash: 84093a2f85abf17ab37d3ce2f706138f
AAD word: 69736120696e20706172746573207472
partial hash: ab2760fee24e6dec754739d8059cd144
AAD word: 65730000000000000000000000000000
partial hash: e84f3c55d287fc561c41d09a8aada4be
Turn GHASH into GMAC Process the length word
GHASH: b0 42 00 c2 6b 81 c9 8a f5 5c c2 ea fc cd 1c bc length word: 00000000000001900000000000000000
K0: 92 0b 3f 40 b9 3d 2a 1d 1c 8b 5c d1 e5 67 5e aa partial hash: b04200c26b81c98af55cc2eafccd1cbc
full GMAC: 22 49 3f 82 d2 bc e3 97 e9 d7 9e 3b 19 aa 42 16
Cipher with tag Turn GHASH into GMAC
22493f82 d2bce397 e9d79e3b 19aa4216 GHASH: b0 42 00 c2 6b 81 c9 8a f5 5c c2 ea fc cd 1c bc
K0: 92 0b 3f 40 b9 3d 2a 1d 1c 8b 5c d1 e5 67 5e aa
full GMAC: 22 49 3f 82 d2 bc e3 97 e9 d7 9e 3b 19 aa 42 16
Tagged Packet: Cipher with tag
8040f17b 8041f8d3 5501a0b2 47616c6c 22493f82 d2bce397 e9d79e3b 19aa4216
69612065 7374206f 6d6e6973 20646976
69736120 696e2070 61727465 73207472
65732249 3f82d2bc e397e9d7 9e3b19aa
4216
16.1.4. SRTP AEAD_AES_128_GCM Tag Verification Tagged packet:
8040f17b 8041f8d3 5501a0b2 47616c6c
69612065 7374206f 6d6e6973 20646976
69736120 696e2070 61727465 73207472
65732249 3f82d2bc e397e9d7 9e3b19aa
4216
Verifying the following packet: 16.1.4. SRTP AEAD_AES_128_GCM Tag Verification
8040f17b 8041f8d3 5501a0b2 47616c6c Verifying the following packet:
69612065 7374206f 6d6e6973 20646976
69736120 696e2070 61727465 73207472
65732249 3f82d2bc e397e9d7 9e3b19aa
4216
Form the IV 8040f17b 8041f8d3 5501a0b2 47616c6c
| Pad | SSRC | ROC | SEQ | 69612065 7374206f 6d6e6973 20646976
00 00 55 01 a0 b2 00 00 00 00 f1 7b 69736120 696e2070 61727465 73207472
salt: 51 75 69 64 20 70 72 6f 20 71 75 6f 65732249 3f82d2bc e397e9d7 9e3b19aa
IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14 4216
Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f Form the IV
AAD: 8040f17b 8041f8d3 5501a0b2 47616c6c | Pad | SSRC | ROC | SEQ |
69612065 7374206f 6d6e6973 20646976 00 00 55 01 a0 b2 00 00 00 00 f1 7b
69736120 696e2070 61727465 73207472 salt: 51 75 69 64 20 70 72 6f 20 71 75 6f
6573 IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
CT: 22493f82 d2bce397 e9d79e3b 19aa4216
IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
H: c6a13b37878f5b826f4f8162a1c8d879
Verify received tag 22 49 3f 82 d2 bc e3 97 e9 d7 9e 3b 19 aa 42 16 Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
AAD: 8040f17b 8041f8d3 5501a0b2 47616c6c
69612065 7374206f 6d6e6973 20646976
69736120 696e2070 61727465 73207472
6573
CT: 22493f82 d2bce397 e9d79e3b 19aa4216
IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
H: c6a13b37878f5b826f4f8162a1c8d879
Process AAD Verify the received tag
AAD word: 8040f17b8041f8d35501a0b247616c6c 22 49 3f 82 d2 bc e3 97 e9 d7 9e 3b 19 aa 42 16
partial hash: 79f41fea34a474a77609d8925e9f2b22
AAD word: 696120657374206f6d6e697320646976
partial hash: 84093a2f85abf17ab37d3ce2f706138f
AAD word: 69736120696e20706172746573207472
partial hash: ab2760fee24e6dec754739d8059cd144
AAD word: 65730000000000000000000000000000
partial hash: e84f3c55d287fc561c41d09a8aada4be
Process Length Word Process the AAD
Length word: 00000000000001900000000000000000 AAD word: 8040f17b8041f8d35501a0b247616c6c
partial hash: b04200c26b81c98af55cc2eafccd1cbc partial hash: 79f41fea34a474a77609d8925e9f2b22
AAD word: 696120657374206f6d6e697320646976
partial hash: 84093a2f85abf17ab37d3ce2f706138f
AAD word: 69736120696e20706172746573207472
partial hash: ab2760fee24e6dec754739d8059cd144
AAD word: 65730000000000000000000000000000
partial hash: e84f3c55d287fc561c41d09a8aada4be
Turn GHASH into GMAC Process the length word
GHASH: b0 42 00 c2 6b 81 c9 8a f5 5c c2 ea fc cd 1c bc length word: 00000000000001900000000000000000
K0: 92 0b 3f 40 b9 3d 2a 1d 1c 8b 5c d1 e5 67 5e aa partial hash: b04200c26b81c98af55cc2eafccd1cbc
full GMAC: 22 49 3f 82 d2 bc e3 97 e9 d7 9e 3b 19 aa 42 16
Received tag = 22493f82 d2bce397 e9d79e3b 19aa4216 Turn GHASH into GMAC
Computed tag = 22493f82 d2bce397 e9d79e3b 19aa4216 GHASH: b0 42 00 c2 6b 81 c9 8a f5 5c c2 ea fc cd 1c bc
Received tag verified. K0: 92 0b 3f 40 b9 3d 2a 1d 1c 8b 5c d1 e5 67 5e aa
full GMAC: 22 49 3f 82 d2 bc e3 97 e9 d7 9e 3b 19 aa 42 16
16.2. SRTP AEAD_AES_256_GCM Received tag = 22493f82 d2bce397 e9d79e3b 19aa4216
16.2.1. SRTP AEAD_AES_256_GCM Encryption Computed tag = 22493f82 d2bce397 e9d79e3b 19aa4216
Received tag verified.
Encrypting the following packet: 16.2. SRTP AEAD_AES_256_GCM
8040f17b 8041f8d3 5501a0b2 47616c6c 16.2.1. SRTP AEAD_AES_256_GCM Encryption
69612065 7374206f 6d6e6973 20646976
69736120 696e2070 61727465 73207472
6573
Form the IV Encrypting the following packet:
| Pad | SSRC | ROC | SEQ |
00 00 55 01 a0 b2 00 00 00 00 f1 7b
salt: 51 75 69 64 20 70 72 6f 20 71 75 6f
IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 8040f17b 8041f8d3 5501a0b2 47616c6c
10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 69612065 7374206f 6d6e6973 20646976
AAD: 8040f17b 8041f8d3 5501a0b2 69736120 696e2070 61727465 73207472
PT: 47616c6c 69612065 7374206f 6d6e6973 6573
20646976 69736120 696e2070 61727465
73207472 6573
IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
H: f29000b62a499fd0a9f39a6add2e7780
Encrypt plaintext Form the IV
block # 0 | Pad | SSRC | ROC | SEQ |
IV||blk_cntr: 51753c6580c2726f2071841400000002 00 00 55 01 a0 b2 00 00 00 00 f1 7b
key_block: 75 d0 b2 14 c1 43 de 77 9c eb 58 95 5e 40 5a d9 salt: 51 75 69 64 20 70 72 6f 20 71 75 6f
plain_block: 47 61 6c 6c 69 61 20 65 73 74 20 6f 6d 6e 69 73 IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
cipher_block: 32 b1 de 78 a8 22 fe 12 ef 9f 78 fa 33 2e 33 aa
block # 1
IV||blk_cntr: 51753c6580c2726f2071841400000003
key_block: 91 e4 7b 4e f3 2b 83 d3 dc 65 0a 72 17 8d da 6a
plain_block: 20 64 69 76 69 73 61 20 69 6e 20 70 61 72 74 65
cipher_block: b1 80 12 38 9a 58 e2 f3 b5 0b 2a 02 76 ff ae 0f
block # 2
IV||blk_cntr: 51753c6580c2726f2071841400000004
key_block: 68 86 43 eb dd 08 07 98 16 3a 16 d5 e5 04 f6 3a
plain_block: 73 20 74 72 65 73
cipher_block: 1b a6 37 99 b8 7b
Cipher before tag appended Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
32b1de78 a822fe12 ef9f78fa 332e33aa 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
b1801238 9a58e2f3 b50b2a02 76ffae0f AAD: 8040f17b 8041f8d3 5501a0b2
1ba63799 b87b PT: 47616c6c 69612065 7374206f 6d6e6973
20646976 69736120 696e2070 61727465
73207472 6573
IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
H: f29000b62a499fd0a9f39a6add2e7780
Compute GMAC tag Encrypt the Plaintext
block # 0
IV||blk_cntr: 51753c6580c2726f2071841400000002
key_block: 75 d0 b2 14 c1 43 de 77 9c eb 58 95 5e 40 5a d9
plain_block: 47 61 6c 6c 69 61 20 65 73 74 20 6f 6d 6e 69 73
cipher_block: 32 b1 de 78 a8 22 fe 12 ef 9f 78 fa 33 2e 33 aa
block # 1
IV||blk_cntr: 51753c6580c2726f2071841400000003
key_block: 91 e4 7b 4e f3 2b 83 d3 dc 65 0a 72 17 8d da 6a
plain_block: 20 64 69 76 69 73 61 20 69 6e 20 70 61 72 74 65
cipher_block: b1 80 12 38 9a 58 e2 f3 b5 0b 2a 02 76 ff ae 0f
block # 2
IV||blk_cntr: 51753c6580c2726f2071841400000004
key_block: 68 86 43 eb dd 08 07 98 16 3a 16 d5 e5 04 f6 3a
plain_block: 73 20 74 72 65 73
cipher_block: 1b a6 37 99 b8 7b
Process AAD Cipher before tag appended
AAD word: 8040f17b8041f8d35501a0b200000000 32b1de78 a822fe12 ef9f78fa 332e33aa
b1801238 9a58e2f3 b50b2a02 76ffae0f
1ba63799 b87b
partial hash: 0154dcb75485b71880e1957c877351bd Compute the GMAC tag
Process Cipher Process the AAD
Cipher word: 32b1de78a822fe12ef9f78fa332e33aa AAD word: 8040f17b8041f8d35501a0b200000000
partial hash: c3f07db9a8b9cb4345eb07f793d322d2 partial hash: 0154dcb75485b71880e1957c877351bd
Cipher word: b18012389a58e2f3b50b2a0276ffae0f
partial hash: 6d1e66fe32eb32ecd8906ceab09db996
Cipher word: 1ba63799b87b00000000000000000000
partial hash: b3d1d2f1fa3b366619bc42cd2eedafee
Process Length Word Process the cipher
Length word: 00000000000000600000000000000130 cipher word: 32b1de78a822fe12ef9f78fa332e33aa
partial hash: 7debf5fa1fac3bd318d5e1a7ee401091 partial hash: c3f07db9a8b9cb4345eb07f793d322d2
cipher word: b18012389a58e2f3b50b2a0276ffae0f
partial hash: 6d1e66fe32eb32ecd8906ceab09db996
cipher word: 1ba63799b87b00000000000000000000
partial hash: b3d1d2f1fa3b366619bc42cd2eedafee
Turn GHASH into GMAC Process the length word
GHASH: 7d eb f5 fa 1f ac 3b d3 18 d5 e1 a7 ee 40 10 91 length word: 00000000000000600000000000000130
K0: 07 48 2e cc c0 53 ed 63 e1 6e 99 df 39 e7 7c 82 partial hash: 7debf5fa1fac3bd318d5e1a7ee401091
full GMAC: 7a a3 db 36 df ff d6 b0 f9 bb 78 78 d7 a7 6c 13
Cipher with tag Turn GHASH into GMAC
32b1de78 a822fe12 ef9f78fa 332e33aa GHASH: 7d eb f5 fa 1f ac 3b d3 18 d5 e1 a7 ee 40 10 91
b1801238 9a58e2f3 b50b2a02 76ffae0f K0: 07 48 2e cc c0 53 ed 63 e1 6e 99 df 39 e7 7c 82
1ba63799 b87b7aa3 db36dfff d6b0f9bb full GMAC: 7a a3 db 36 df ff d6 b0 f9 bb 78 78 d7 a7 6c 13
7878d7a7 6c13
Encrypted and Tagged packet: Cipher with tag
8040f17b 8041f8d3 5501a0b2 32b1de78 32b1de78 a822fe12 ef9f78fa 332e33aa
a822fe12 ef9f78fa 332e33aa b1801238 b1801238 9a58e2f3 b50b2a02 76ffae0f
9a58e2f3 b50b2a02 76ffae0f 1ba63799 1ba63799 b87b7aa3 db36dfff d6b0f9bb
b87b7aa3 db36dfff d6b0f9bb 7878d7a7 7878d7a7 6c13
6c13
16.2.2. SRTP AEAD_AES_256_GCM Decryption Encrypted and tagged packet:
8040f17b 8041f8d3 5501a0b2 32b1de78
a822fe12 ef9f78fa 332e33aa b1801238
9a58e2f3 b50b2a02 76ffae0f 1ba63799
b87b7aa3 db36dfff d6b0f9bb 7878d7a7
6c13
Decrypting the following packet: 16.2.2. SRTP AEAD_AES_256_GCM Decryption
8040f17b 8041f8d3 5501a0b2 32b1de78 Decrypting the following packet:
a822fe12 ef9f78fa 332e33aa b1801238
9a58e2f3 b50b2a02 76ffae0f 1ba63799
b87b7aa3 db36dfff d6b0f9bb 7878d7a7
6c13
Form the IV 8040f17b 8041f8d3 5501a0b2 32b1de78
| Pad | SSRC | ROC | SEQ | a822fe12 ef9f78fa 332e33aa b1801238
00 00 55 01 a0 b2 00 00 00 00 f1 7b 9a58e2f3 b50b2a02 76ffae0f 1ba63799
salt: 51 75 69 64 20 70 72 6f 20 71 75 6f b87b7aa3 db36dfff d6b0f9bb 7878d7a7
IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14 6c13
Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f Form the IV
10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f | Pad | SSRC | ROC | SEQ |
AAD: 8040f17b 8041f8d3 5501a0b2 00 00 55 01 a0 b2 00 00 00 00 f1 7b
CT: 32b1de78 a822fe12 ef9f78fa 332e33aa salt: 51 75 69 64 20 70 72 6f 20 71 75 6f
b1801238 9a58e2f3 b50b2a02 76ffae0f IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
1ba63799 b87b7aa3 db36dfff d6b0f9bb
7878d7a7 6c13
IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
H: f29000b62a499fd0a9f39a6add2e7780
Verify received tag 7a a3 db 36 df ff d6 b0 f9 bb 78 78 d7 a7 6c 13 Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
AAD: 8040f17b 8041f8d3 5501a0b2
CT: 32b1de78 a822fe12 ef9f78fa 332e33aa
b1801238 9a58e2f3 b50b2a02 76ffae0f
1ba63799 b87b7aa3 db36dfff d6b0f9bb
7878d7a7 6c13
IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
H: f29000b62a499fd0a9f39a6add2e7780
Process AAD Verify the received tag
AAD word: 8040f17b8041f8d35501a0b200000000 7a a3 db 36 df ff d6 b0 f9 bb 78 78 d7 a7 6c 13
partial hash: 0154dcb75485b71880e1957c877351bd
Process Cipher Process the AAD
Cipher word: 32b1de78a822fe12ef9f78fa332e33aa AAD word: 8040f17b8041f8d35501a0b200000000
partial hash: c3f07db9a8b9cb4345eb07f793d322d2 partial hash: 0154dcb75485b71880e1957c877351bd
Cipher word: b18012389a58e2f3b50b2a0276ffae0f
partial hash: 6d1e66fe32eb32ecd8906ceab09db996
Cipher word: 1ba63799b87b00000000000000000000
partial hash: b3d1d2f1fa3b366619bc42cd2eedafee
Process Length Word Process the cipher
Length word: 00000000000000600000000000000130 cipher word: 32b1de78a822fe12ef9f78fa332e33aa
partial hash: 7debf5fa1fac3bd318d5e1a7ee401091 partial hash: c3f07db9a8b9cb4345eb07f793d322d2
cipher word: b18012389a58e2f3b50b2a0276ffae0f
partial hash: 6d1e66fe32eb32ecd8906ceab09db996
cipher word: 1ba63799b87b00000000000000000000
partial hash: b3d1d2f1fa3b366619bc42cd2eedafee
Turn GHASH into GMAC Process the length word
GHASH: 7d eb f5 fa 1f ac 3b d3 18 d5 e1 a7 ee 40 10 91 length word: 00000000000000600000000000000130
K0: 07 48 2e cc c0 53 ed 63 e1 6e 99 df 39 e7 7c 82 partial hash: 7debf5fa1fac3bd318d5e1a7ee401091
full GMAC: 7a a3 db 36 df ff d6 b0 f9 bb 78 78 d7 a7 6c 13
Received tag = 7aa3db36 dfffd6b0 f9bb7878 d7a76c13 Turn GHASH into GMAC
Computed tag = 7aa3db36 dfffd6b0 f9bb7878 d7a76c13 GHASH: 7d eb f5 fa 1f ac 3b d3 18 d5 e1 a7 ee 40 10 91
K0: 07 48 2e cc c0 53 ed 63 e1 6e 99 df 39 e7 7c 82
full GMAC: 7a a3 db 36 df ff d6 b0 f9 bb 78 78 d7 a7 6c 13
Received tag verified. Received tag = 7aa3db36 dfffd6b0 f9bb7878 d7a76c13
Computed tag = 7aa3db36 dfffd6b0 f9bb7878 d7a76c13
Received tag verified.
Decrypt cipher Decrypt the cipher
block # 0 block # 0
IV||blk_cntr: 51753c6580c2726f2071841400000002 IV||blk_cntr: 51753c6580c2726f2071841400000002
key_block: 75 d0 b2 14 c1 43 de 77 9c eb 58 95 5e 40 5a d9 key_block: 75 d0 b2 14 c1 43 de 77 9c eb 58 95 5e 40 5a d9
cipher_block: 32 b1 de 78 a8 22 fe 12 ef 9f 78 fa 33 2e 33 aa cipher_block: 32 b1 de 78 a8 22 fe 12 ef 9f 78 fa 33 2e 33 aa
plain_block: 47 61 6c 6c 69 61 20 65 73 74 20 6f 6d 6e 69 73 plain_block: 47 61 6c 6c 69 61 20 65 73 74 20 6f 6d 6e 69 73
block # 1 block # 1
IV||blk_cntr: 51753c6580c2726f2071841400000003 IV||blk_cntr: 51753c6580c2726f2071841400000003
key_block: 91 e4 7b 4e f3 2b 83 d3 dc 65 0a 72 17 8d da 6a key_block: 91 e4 7b 4e f3 2b 83 d3 dc 65 0a 72 17 8d da 6a
cipher_block: b1 80 12 38 9a 58 e2 f3 b5 0b 2a 02 76 ff ae 0f cipher_block: b1 80 12 38 9a 58 e2 f3 b5 0b 2a 02 76 ff ae 0f
plain_block: 20 64 69 76 69 73 61 20 69 6e 20 70 61 72 74 65 plain_block: 20 64 69 76 69 73 61 20 69 6e 20 70 61 72 74 65
block # 2 block # 2
IV||blk_cntr: 51753c6580c2726f2071841400000004 IV||blk_cntr: 51753c6580c2726f2071841400000004
key_block: 68 86 43 eb dd 08 07 98 16 3a 16 d5 e5 04 f6 3a key_block: 68 86 43 eb dd 08 07 98 16 3a 16 d5 e5 04 f6 3a
cipher_block: 1b a6 37 99 b8 7b cipher_block: 1b a6 37 99 b8 7b
plain_block: 73 20 74 72 65 73 plain_block: 73 20 74 72 65 73
Verified and Taged packet: Verified and tagged packet:
47616c6c 69612065 7374206f 6d6e6973 47616c6c 69612065 7374206f 6d6e6973
20646976 69736120 696e2070 61727465 20646976 69736120 696e2070 61727465
73207472 6573 73207472 6573
16.2.3. SRTP AEAD_AES_256_GCM Authentication Tagging 16.2.3. SRTP AEAD_AES_256_GCM Authentication Tagging
Tagging the following packet: Tagging the following packet:
8040f17b 8041f8d3 5501a0b2 47616c6c 8040f17b 8041f8d3 5501a0b2 47616c6c
69612065 7374206f 6d6e6973 20646976 69612065 7374206f 6d6e6973 20646976
69736120 696e2070 61727465 73207472 69736120 696e2070 61727465 73207472
6573 6573
Form the IV Form the IV
| Pad | SSRC | ROC | SEQ | | Pad | SSRC | ROC | SEQ |
00 00 55 01 a0 b2 00 00 00 00 f1 7b 00 00 55 01 a0 b2 00 00 00 00 f1 7b
salt: 51 75 69 64 20 70 72 6f 20 71 75 6f salt: 51 75 69 64 20 70 72 6f 20 71 75 6f
IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14 IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
AAD: 8040f17b 8041f8d3 5501a0b2 47616c6c AAD: 8040f17b 8041f8d3 5501a0b2 47616c6c
69612065 7374206f 6d6e6973 20646976 69612065 7374206f 6d6e6973 20646976
69736120 696e2070 61727465 73207472 69736120 696e2070 61727465 73207472
6573 6573
IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14 IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
H: f29000b62a499fd0a9f39a6add2e7780 H: f29000b62a499fd0a9f39a6add2e7780
Compute GMAC tag Compute the GMAC tag
Process AAD Process the AAD
AAD word: 8040f17b8041f8d35501a0b247616c6c AAD word: 8040f17b8041f8d35501a0b247616c6c
partial hash: c059753e6763791762ca630d8ef97714 partial hash: c059753e6763791762ca630d8ef97714
AAD word: 696120657374206f6d6e697320646976 AAD word: 696120657374206f6d6e697320646976
partial hash: a4e3401e712900dc4f1d2303bc4b2675 partial hash: a4e3401e712900dc4f1d2303bc4b2675
AAD word: 69736120696e20706172746573207472 AAD word: 69736120696e20706172746573207472
partial hash: 1c8c1af883de0d67878f379a19c65987 partial hash: 1c8c1af883de0d67878f379a19c65987
AAD word: 65730000000000000000000000000000 AAD word: 65730000000000000000000000000000
partial hash: 958462781aa8e8feacce6d93b54472ac partial hash: 958462781aa8e8feacce6d93b54472ac
Process Length Word Process the length word
Length word: 00000000000001900000000000000000 length word: 00000000000001900000000000000000
partial hash: af2efb5dcfdb9900e7127721fdb56956 partial hash: af2efb5dcfdb9900e7127721fdb56956
Turn GHASH into GMAC Turn GHASH into GMAC
GHASH: af 2e fb 5d cf db 99 00 e7 12 77 21 fd b5 69 56 GHASH: af 2e fb 5d cf db 99 00 e7 12 77 21 fd b5 69 56
K0: 07 48 2e cc c0 53 ed 63 e1 6e 99 df 39 e7 7c 82 K0: 07 48 2e cc c0 53 ed 63 e1 6e 99 df 39 e7 7c 82
full GMAC: a8 66 d5 91 0f 88 74 63 06 7c ee fe c4 52 15 d4 full GMAC: a8 66 d5 91 0f 88 74 63 06 7c ee fe c4 52 15 d4
Cipher with tag Cipher with tag
a866d591 0f887463 067ceefe c45215d4 a866d591 0f887463 067ceefe c45215d4
Tagged Packet: Tagged packet:
8040f17b 8041f8d3 5501a0b2 47616c6c 8040f17b 8041f8d3 5501a0b2 47616c6c
69612065 7374206f 6d6e6973 20646976 69612065 7374206f 6d6e6973 20646976
69736120 696e2070 61727465 73207472 69736120 696e2070 61727465 73207472
6573a866 d5910f88 7463067c eefec452 6573a866 d5910f88 7463067c eefec452
15d4 15d4
16.2.4. SRTP AEAD_AES_256_GCM Tag Verification 16.2.4. SRTP AEAD_AES_256_GCM Tag Verification
Verifying the following packet: Verifying the following packet:
8040f17b 8041f8d3 5501a0b2 47616c6c 8040f17b 8041f8d3 5501a0b2 47616c6c
69612065 7374206f 6d6e6973 20646976 69612065 7374206f 6d6e6973 20646976
69736120 696e2070 61727465 73207472 69736120 696e2070 61727465 73207472
6573a866 d5910f88 7463067c eefec452 6573a866 d5910f88 7463067c eefec452
15d4 15d4
Form the IV Form the IV
| Pad | SSRC | ROC | SEQ | | Pad | SSRC | ROC | SEQ |
00 00 55 01 a0 b2 00 00 00 00 f1 7b 00 00 55 01 a0 b2 00 00 00 00 f1 7b
salt: 51 75 69 64 20 70 72 6f 20 71 75 6f salt: 51 75 69 64 20 70 72 6f 20 71 75 6f
IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14 IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
AAD: 8040f17b 8041f8d3 5501a0b2 47616c6c AAD: 8040f17b 8041f8d3 5501a0b2 47616c6c
69612065 7374206f 6d6e6973 20646976 69612065 7374206f 6d6e6973 20646976
69736120 696e2070 61727465 73207472 69736120 696e2070 61727465 73207472
6573 6573
CT: a866d591 0f887463 067ceefe c45215d4 CT: a866d591 0f887463 067ceefe c45215d4
IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14 IV: 51 75 3c 65 80 c2 72 6f 20 71 84 14
H: f29000b62a499fd0a9f39a6add2e7780 H: f29000b62a499fd0a9f39a6add2e7780
Verify received tag a8 66 d5 91 0f 88 74 63 06 7c ee fe c4 52 15 d4 Verify the received tag
a8 66 d5 91 0f 88 74 63 06 7c ee fe c4 52 15 d4
Process AAD Process the AAD
AAD word: 8040f17b8041f8d35501a0b247616c6c AAD word: 8040f17b8041f8d35501a0b247616c6c
partial hash: c059753e6763791762ca630d8ef97714 partial hash: c059753e6763791762ca630d8ef97714
AAD word: 696120657374206f6d6e697320646976 AAD word: 696120657374206f6d6e697320646976
partial hash: a4e3401e712900dc4f1d2303bc4b2675 partial hash: a4e3401e712900dc4f1d2303bc4b2675
AAD word: 69736120696e20706172746573207472 AAD word: 69736120696e20706172746573207472
partial hash: 1c8c1af883de0d67878f379a19c65987 partial hash: 1c8c1af883de0d67878f379a19c65987
AAD word: 65730000000000000000000000000000 AAD word: 65730000000000000000000000000000
partial hash: 958462781aa8e8feacce6d93b54472ac partial hash: 958462781aa8e8feacce6d93b54472ac
Process Length Word Process the length word
Length word: 00000000000001900000000000000000 length word: 00000000000001900000000000000000
partial hash: af2efb5dcfdb9900e7127721fdb56956 partial hash: af2efb5dcfdb9900e7127721fdb56956
Turn GHASH into GMAC Turn GHASH into GMAC
GHASH: af 2e fb 5d cf db 99 00 e7 12 77 21 fd b5 69 56 GHASH: af 2e fb 5d cf db 99 00 e7 12 77 21 fd b5 69 56
K0: 07 48 2e cc c0 53 ed 63 e1 6e 99 df 39 e7 7c 82 K0: 07 48 2e cc c0 53 ed 63 e1 6e 99 df 39 e7 7c 82
full GMAC: a8 66 d5 91 0f 88 74 63 06 7c ee fe c4 52 15 d4 full GMAC: a8 66 d5 91 0f 88 74 63 06 7c ee fe c4 52 15 d4
Received tag = a866d591 0f887463 067ceefe c45215d4 Received tag = a866d591 0f887463 067ceefe c45215d4
Computed tag = a866d591 0f887463 067ceefe c45215d4 Computed tag = a866d591 0f887463 067ceefe c45215d4
Received tag verified. Received tag verified.
17. RTCP Test Vectors 17. RTCP Test Vectors
The examples in this section are all based upon the same RTCP packet: The examples in this section are all based upon the same RTCP packet:
81c8000e 4d617273 4e545031 4e545031 81c8000e 4d617273 4e545031 4e545031
52545020 0000042a 0000eb98 4c756e61 52545020 0000042a 0000eb98 4c756e61
deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef
deadbeef deadbeef
with 32-bit SRTCP index 000005d4. with 32-bit SRTCP index 000005d4.
As shown in section 9.1, the IV is formed by XORing two 12-octet As shown in Section 9.1, the IV is formed by XORing two 12-octet
values. The first 12-octet value is formed by concatenating two zero values. The first 12-octet value is formed by concatenating
octets, the 4-octet SSRC (found in the 5th thru 8th octets of the RTP two zero octets, the 4-octet SSRC (found in the fifth through
packet), another 2 padding octets and the 31-bit SRTCP index, right eighth octets of the RTP packet), another two padding octets, and the
justified in a 32-bit = 4-octet field with a single "0" bit 31-bit SRTCP index, right-justified in a 32-bit = 4-octet field with
pre-pended as padding. An example of SRTCP IV formation is shown a single "0" bit prepended as padding. An example of SRTCP IV
below: formation is shown below:
| Pad | SSRC | Pad | 0+SRTCP | | Pad | SSRC | Pad | 0+SRTCP |
00 00 4d 61 72 73 00 00 00 00 05 d4 00 00 4d 61 72 73 00 00 00 00 05 d4
salt 51 75 69 64 20 70 72 6f 20 71 75 6f salt 51 75 69 64 20 70 72 6f 20 71 75 6f
------------------------------------ ------------------------------------
IV 51 75 24 05 52 03 72 6f 20 71 70 bb IV 51 75 24 05 52 03 72 6f 20 71 70 bb
In an SRTCP packet a 1-bit encryption flag is pre-pended to the In an SRTCP packet, a 1-bit Encryption flag is prepended to the
31-bit SRTCP index to form a 32-bit value we shall call the ESRTCP 31-bit SRTCP index to form a 32-bit value we shall call the
word. The E flag is one if the SRTCP packet has been encrypted and "ESRTCP word". The E-flag is one if the SRTCP packet has been
zero if it has been tagged but not encrypted. Note that the ESRTCP encrypted and zero if it has been tagged but not encrypted. Note
field is only present in an SRTCP packet, not in an RTCP packet. The that the ESRTCP field is only present in an SRTCP packet, not in an
full ESRTCP word is part of the AAD. RTCP packet. The full ESRTCP word is part of the AAD.
When encrypting and tagging an RTCP packet (E flag = 1), the SRTCP When encrypting and tagging an RTCP packet (E-flag = 1), the SRTCP
packet consists of the following fields in the following order: packet consists of the following fields in the following order:
- The first 8 octets of the RTCP packet (part of the AAD). - The first 8 octets of the RTCP packet (part of the AAD).
- The cipher.
- The ESRTCP word (the final part of the AAD). - The cipher.
- Any raw data that might have been appended to the end of the
original RTCP packet. - The ESRTCP word (the final part of the AAD).
- Any Raw Data that might have been appended to the end of the
original RTCP packet.
Recall that AEAD treats the authentication tag as an integral part of Recall that AEAD treats the authentication tag as an integral part of
the cipher, and in fact the authentication tag is the last 8 or 16 the cipher, and in fact the authentication tag is the last 8 or
octets of the cipher. 16 octets of the cipher.
The reader is reminded that when the RTCP packet is to be tagged but The reader is reminded that when the RTCP packet is to be tagged but
not encrypted (E flag = 0), GCM will produce cipher that consists not encrypted (E-flag = 0), GCM will produce a cipher that consists
solely of the 8 or 16 byte authentication tag. The tagged SRTCP solely of the 8-octet or 16-octet authentication tag. The tagged
consists of the following fields in the order listed below: SRTCP consists of the following fields in the order listed below:
- All of the AAD save for the ECSRTP word. - All of the AAD, except for the ESRTCP word.
- The cipher (= the authentication tag).
- The ESRTCP word (the final part of the AAD).
- Any raw data that might have been appended to the end of the
original RTCP packet.
17.1. SRTCP AEAD_AES_128_GCM Encrypt and Tag - The cipher (= the authentication tag).
Encrypting the following packet: - The ESRTCP word (the final part of the AAD).
81c8000d 4d617273 4e545031 4e545032 - Any Raw Data that might have been appended to the end of the
52545020 0000042a 0000e930 4c756e61 original RTCP packet.
deadbeef deadbeef deadbeef deadbeef
deadbeef
Key size = 128 bits 17.1. SRTCP AEAD_AES_128_GCM Encryption and Tagging
Tag size = 16 octets
Form the IV Encrypting the following packet:
| Pad | SSRC | Pad | SRTCP |
00 00 4d 61 72 73 00 00 00 00 05 d4
salt: 51 75 69 64 20 70 72 6f 20 71 75 6f
IV: 51 75 24 05 52 03 72 6f 20 71 70 bb
Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 81c8000d 4d617273 4e545031 4e545032
AAD: 81c8000d 4d617273 800005d4 52545020 0000042a 0000e930 4c756e61
PT: 4e545031 4e545032 52545020 0000042a deadbeef deadbeef deadbeef deadbeef
0000e930 4c756e61 deadbeef deadbeef deadbeef
deadbeef deadbeef deadbeef
IV: 51 75 24 05 52 03 72 6f 20 71 70 bb
H: c6a13b37878f5b826f4f8162a1c8d879
Encrypt plaintext Key size = 128 bits
block # 0 Tag size = 16 octets
IV||blk_cntr: 517524055203726f207170bb00000002
key_block: 2d bd 18 b4 92 8e e6 4e f5 73 87 46 2f 6b 7a b3
plain_block: 4e 54 50 31 4e 54 50 32 52 54 50 20 00 00 04 2a
cipher_block: 63 e9 48 85 dc da b6 7c a7 27 d7 66 2f 6b 7e 99
block # 1
IV||blk_cntr: 517524055203726f207170bb00000003
key_block: 7f f5 29 c7 20 73 9d 4c 18 db 1b 1e ad a0 d1 35
plain_block: 00 00 e9 30 4c 75 6e 61 de ad be ef de ad be ef
cipher_block: 7f f5 c0 f7 6c 06 f3 2d c6 76 a5 f1 73 0d 6f da
block # 2
IV||blk_cntr: 517524055203726f207170bb00000004
key_block: 92 4d 25 a9 58 9d 83 02 d5 14 99 b4 e0 14 78 15
plain_block: de ad be ef de ad be ef de ad be ef
cipher_block: 4c e0 9b 46 86 30 3d ed 0b b9 27 5b
Cipher before tag appended Form the IV
63e94885 dcdab67c a727d766 2f6b7e99 | Pad | SSRC | Pad | SRTCP |
7ff5c0f7 6c06f32d c676a5f1 730d6fda 00 00 4d 61 72 73 00 00 00 00 05 d4
4ce09b46 86303ded 0bb9275b salt: 51 75 69 64 20 70 72 6f 20 71 75 6f
IV: 51 75 24 05 52 03 72 6f 20 71 70 bb
Compute GMAC tag Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
AAD: 81c8000d 4d617273 800005d4
PT: 4e545031 4e545032 52545020 0000042a
0000e930 4c756e61 deadbeef deadbeef
deadbeef deadbeef deadbeef
IV: 51 75 24 05 52 03 72 6f 20 71 70 bb
H: c6a13b37878f5b826f4f8162a1c8d879
Process AAD Encrypt the Plaintext
AAD word: 81c8000d4d617273800005d400000000 block # 0
partial hash: 085d6eb166c555aa62982f630430ec6e IV||blk_cntr: 517524055203726f207170bb00000002
key_block: 2d bd 18 b4 92 8e e6 4e f5 73 87 46 2f 6b 7a b3
plain_block: 4e 54 50 31 4e 54 50 32 52 54 50 20 00 00 04 2a
cipher_block: 63 e9 48 85 dc da b6 7c a7 27 d7 66 2f 6b 7e 99
block # 1
IV||blk_cntr: 517524055203726f207170bb00000003
key_block: 7f f5 29 c7 20 73 9d 4c 18 db 1b 1e ad a0 d1 35
plain_block: 00 00 e9 30 4c 75 6e 61 de ad be ef de ad be ef
cipher_block: 7f f5 c0 f7 6c 06 f3 2d c6 76 a5 f1 73 0d 6f da
block # 2
IV||blk_cntr: 517524055203726f207170bb00000004
key_block: 92 4d 25 a9 58 9d 83 02 d5 14 99 b4 e0 14 78 15
plain_block: de ad be ef de ad be ef de ad be ef
cipher_block: 4c e0 9b 46 86 30 3d ed 0b b9 27 5b
Process Cipher Cipher before tag appended
Cipher word: 63e94885dcdab67ca727d7662f6b7e99 63e94885 dcdab67c a727d766 2f6b7e99
partial hash: 8c9221be93466d68bbb16fa0d42b0187 7ff5c0f7 6c06f32d c676a5f1 730d6fda
Cipher word: 7ff5c0f76c06f32dc676a5f1730d6fda 4ce09b46 86303ded 0bb9275b
partial hash: 221ebb044ec9fd0bf116d7780f198792
Cipher word: 4ce09b4686303ded0bb9275b00000000
partial hash: 50f70b9ca110ab312dce212657328dae
Process Length Word Compute the GMAC tag
Length word: 00000000000000600000000000000160
partial hash: 7296107c9716534371dfc1a30c5ffeb5
Turn GHASH into GMAC Process the AAD
GHASH: 72 96 10 7c 97 16 53 43 71 df c1 a3 0c 5f fe b5 AAD word: 81c8000d4d617273800005d400000000
K0: ba dc b4 24 01 d9 1e 6c b4 74 39 d1 49 86 14 6b partial hash: 085d6eb166c555aa62982f630430ec6e
full GMAC: c8 4a a4 58 96 cf 4d 2f c5 ab f8 72 45 d9 ea de
Cipher with tag Process the cipher
63e94885 dcdab67c a727d766 2f6b7e99 cipher word: 63e94885dcdab67ca727d7662f6b7e99
7ff5c0f7 6c06f32d c676a5f1 730d6fda partial hash: 8c9221be93466d68bbb16fa0d42b0187
4ce09b46 86303ded 0bb9275b c84aa458 cipher word: 7ff5c0f76c06f32dc676a5f1730d6fda
96cf4d2f c5abf872 45d9eade partial hash: 221ebb044ec9fd0bf116d7780f198792
cipher word: 4ce09b4686303ded0bb9275b00000000
partial hash: 50f70b9ca110ab312dce212657328dae
Append ESRTCP word with Eflag set. Process the length word
Cext:63e94885 dcdab67c a727d766 2f6b7e99 length word: 00000000000000600000000000000160
7ff5c0f7 6c06f32d c676a5f1 730d6fda partial hash: 7296107c9716534371dfc1a30c5ffeb5
4ce09b46 86303ded 0bb9275b c84aa458
96cf4d2f c5abf872 45d9eade 800005d4
Encrypted and Tagged packet: Turn GHASH into GMAC
81c8000d 4d617273 63e94885 dcdab67c GHASH: 72 96 10 7c 97 16 53 43 71 df c1 a3 0c 5f fe b5
a727d766 2f6b7e99 7ff5c0f7 6c06f32d K0: ba dc b4 24 01 d9 1e 6c b4 74 39 d1 49 86 14 6b
c676a5f1 730d6fda 4ce09b46 86303ded full GMAC: c8 4a a4 58 96 cf 4d 2f c5 ab f8 72 45 d9 ea de
0bb9275b c84aa458 96cf4d2f c5abf872
45d9eade 800005d4
17.2. SRTCP AEAD_AES_256_GCM Verify and Decryption Cipher with tag
63e94885 dcdab67c a727d766 2f6b7e99
7ff5c0f7 6c06f32d c676a5f1 730d6fda
4ce09b46 86303ded 0bb9275b c84aa458
96cf4d2f c5abf872 45d9eade
Key size = 256 bits Append the ESRTCP word with the E-flag set
Tag size = 16 octets 63e94885 dcdab67c a727d766 2f6b7e99
7ff5c0f7 6c06f32d c676a5f1 730d6fda
4ce09b46 86303ded 0bb9275b c84aa458
96cf4d2f c5abf872 45d9eade 800005d4
Process Length Word Encrypted and tagged packet:
81c8000d 4d617273 63e94885 dcdab67c
a727d766 2f6b7e99 7ff5c0f7 6c06f32d
c676a5f1 730d6fda 4ce09b46 86303ded
0bb9275b c84aa458 96cf4d2f c5abf872
45d9eade 800005d4
Decrypting the following packet: 17.2. SRTCP AEAD_AES_256_GCM Verification and Decryption
81c8000d 4d617273 d50ae4d1 f5ce5d30 Key size = 256 bits
4ba297e4 7d470c28 2c3ece5d bffe0a50 Tag size = 16 octets
a2eaa5c1 110555be 8415f658 c61de047
6f1b6fad 1d1eb30c 4446839f 57ff6f6c
b26ac3be 800005d4
Key size = 256 bits Process the length word
Key size = 16 octets
Form the IV Decrypting the following packet:
| Pad | SSRC | Pad | SRTCP |
00 00 4d 61 72 73 00 00 00 00 05 d4
salt: 51 75 69 64 20 70 72 6f 20 71 75 6f
IV: 51 75 24 05 52 03 72 6f 20 71 70 bb
Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 81c8000d 4d617273 d50ae4d1 f5ce5d30
10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 4ba297e4 7d470c28 2c3ece5d bffe0a50
AAD: 81c8000d 4d617273 800005d4 a2eaa5c1 110555be 8415f658 c61de047
CT: d50ae4d1 f5ce5d30 4ba297e4 7d470c28 6f1b6fad 1d1eb30c 4446839f 57ff6f6c
2c3ece5d bffe0a50 a2eaa5c1 110555be b26ac3be 800005d4
8415f658 c61de047 6f1b6fad 1d1eb30c
4446839f 57ff6f6c b26ac3be
IV: 51 75 24 05 52 03 72 6f 20 71 70 bb
H: f29000b62a499fd0a9f39a6add2e7780
Verify received tag 1d 1e b3 0c 44 46 83 9f 57 ff 6f 6c b2 6a c3 be Key size = 256 bits
Key size = 16 octets
Process AAD Form the IV
AAD word: 81c8000d4d617273800005d400000000 | Pad | SSRC | Pad | SRTCP |
partial hash: 3ae5afd36dead5280b18950400176b5b 00 00 4d 61 72 73 00 00 00 00 05 d4
salt: 51 75 69 64 20 70 72 6f 20 71 75 6f
IV: 51 75 24 05 52 03 72 6f 20 71 70 bb
Process Cipher Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
Cipher word: d50ae4d1f5ce5d304ba297e47d470c28 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
partial hash: e90fab7546f6940781227227ac926ebe AAD: 81c8000d 4d617273 800005d4
Cipher word: 2c3ece5dbffe0a50a2eaa5c1110555be CT: d50ae4d1 f5ce5d30 4ba297e4 7d470c28
partial hash: 9b236807d8b2dab07583adce367aa88f 2c3ece5d bffe0a50 a2eaa5c1 110555be
Cipher word: 8415f658c61de0476f1b6fad00000000 8415f658 c61de047 6f1b6fad 1d1eb30c
partial hash: e69313f423a75e3e0b7eb93321700e86 4446839f 57ff6f6c b26ac3be
IV: 51 75 24 05 52 03 72 6f 20 71 70 bb
H: f29000b62a499fd0a9f39a6add2e7780
Process Length Word Verify the received tag
Length word: 00000000000000600000000000000160 1d 1e b3 0c 44 46 83 9f 57 ff 6f 6c b2 6a c3 be
partial hash: 3a284af2616fdf505faf37eec39fbc8b
Turn GHASH into GMAC Process the AAD
GHASH: 3a 28 4a f2 61 6f df 50 5f af 37 ee c3 9f bc 8b AAD word: 81c8000d4d617273800005d400000000
K0: 27 36 f9 fe 25 29 5c cf 08 50 58 82 71 f5 7f 35 partial hash: 3ae5afd36dead5280b18950400176b5b
full GMAC: 1d 1e b3 0c 44 46 83 9f 57 ff 6f 6c b2 6a c3 be
Received tag = 1d1eb30c 4446839f 57ff6f6c b26ac3be Process the cipher
Computed tag = 1d1eb30c 4446839f 57ff6f6c b26ac3be cipher word: d50ae4d1f5ce5d304ba297e47d470c28
partial hash: e90fab7546f6940781227227ac926ebe
cipher word: 2c3ece5dbffe0a50a2eaa5c1110555be
partial hash: 9b236807d8b2dab07583adce367aa88f
cipher word: 8415f658c61de0476f1b6fad00000000
partial hash: e69313f423a75e3e0b7eb93321700e86
Received tag verified. Process the length word
length word: 00000000000000600000000000000160
partial hash: 3a284af2616fdf505faf37eec39fbc8b
Decrypt cipher Turn GHASH into GMAC
block # 0 GHASH: 3a 28 4a f2 61 6f df 50 5f af 37 ee c3 9f bc 8b
IV||blk_cntr: 517524055203726f207170bb00000002 K0: 27 36 f9 fe 25 29 5c cf 08 50 58 82 71 f5 7f 35
key_block: 9b 5e b4 e0 bb 9a 0d 02 19 f6 c7 c4 7d 47 08 02 full GMAC: 1d 1e b3 0c 44 46 83 9f 57 ff 6f 6c b2 6a c3 be
cipher_block: d5 0a e4 d1 f5 ce 5d 30 4b a2 97 e4 7d 47 0c 28
plain_block: 4e 54 50 31 4e 54 50 32 52 54 50 20 00 00 04 2a
block # 1
IV||blk_cntr: 517524055203726f207170bb00000003
key_block: 2c 3e 27 6d f3 8b 64 31 7c 47 1b 2e cf a8 eb 51
cipher_block: 2c 3e ce 5d bf fe 0a 50 a2 ea a5 c1 11 05 55 be
plain_block: 00 00 e9 30 4c 75 6e 61 de ad be ef de ad be ef
block # 2
IV||blk_cntr: 517524055203726f207170bb00000004
key_block: 5a b8 48 b7 18 b0 5e a8 b1 b6 d1 42 3b 74 39 55
cipher_block: 84 15 f6 58 c6 1d e0 47 6f 1b 6f ad
plain_block: de ad be ef de ad be ef de ad be ef
Verified and Decrypted packet: Received tag = 1d1eb30c 4446839f 57ff6f6c b26ac3be
81c8000d 4d617273 4e545031 4e545032 Computed tag = 1d1eb30c 4446839f 57ff6f6c b26ac3be
52545020 0000042a 0000e930 4c756e61 Received tag verified.
deadbeef deadbeef deadbeef deadbeef
deadbeef
17.3. SRTCP AEAD_AES_128_GCM Tag Only Decrypt the cipher
block # 0
IV||blk_cntr: 517524055203726f207170bb00000002
key_block: 9b 5e b4 e0 bb 9a 0d 02 19 f6 c7 c4 7d 47 08 02
cipher_block: d5 0a e4 d1 f5 ce 5d 30 4b a2 97 e4 7d 47 0c 28
plain_block: 4e 54 50 31 4e 54 50 32 52 54 50 20 00 00 04 2a
block # 1
IV||blk_cntr: 517524055203726f207170bb00000003
key_block: 2c 3e 27 6d f3 8b 64 31 7c 47 1b 2e cf a8 eb 51
cipher_block: 2c 3e ce 5d bf fe 0a 50 a2 ea a5 c1 11 05 55 be
plain_block: 00 00 e9 30 4c 75 6e 61 de ad be ef de ad be ef
block # 2
IV||blk_cntr: 517524055203726f207170bb00000004
key_block: 5a b8 48 b7 18 b0 5e a8 b1 b6 d1 42 3b 74 39 55
cipher_block: 84 15 f6 58 c6 1d e0 47 6f 1b 6f ad
plain_block: de ad be ef de ad be ef de ad be ef
Tagging the following packet: Verified and decrypted packet:
81c8000d 4d617273 4e545031 4e545032
52545020 0000042a 0000e930 4c756e61
deadbeef deadbeef deadbeef deadbeef
deadbeef
81c8000d 4d617273 4e545031 4e545032 17.3. SRTCP AEAD_AES_128_GCM Tagging Only
52545020 0000042a 0000e930 4c756e61
deadbeef deadbeef deadbeef deadbeef
deadbeef
Key size = 128 bits Tagging the following packet:
Tag size = 16 octets
Form the IV 81c8000d 4d617273 4e545031 4e545032
| Pad | SSRC | Pad | SRTCP | 52545020 0000042a 0000e930 4c756e61
00 00 4d 61 72 73 00 00 00 00 05 d4 deadbeef deadbeef deadbeef deadbeef
salt: 51 75 69 64 20 70 72 6f 20 71 75 6f deadbeef
IV: 51 75 24 05 52 03 72 6f 20 71 70 bb
Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f Key size = 128 bits
AAD: 81c8000d 4d617273 4e545031 4e545032 Tag size = 16 octets
52545020 0000042a 0000e930 4c756e61
deadbeef deadbeef deadbeef deadbeef
deadbeef 000005d4
IV: 51 75 24 05 52 03 72 6f 20 71 70 bb
H: c6a13b37878f5b826f4f8162a1c8d879
Compute GMAC tag Form the IV
Process AAD | Pad | SSRC | Pad | SRTCP |
AAD word: 81c8000d4d6172734e5450314e545032 00 00 4d 61 72 73 00 00 00 00 05 d4
partial hash: f8dbbe278e06afe17fb4fb2e67f0a22e salt: 51 75 69 64 20 70 72 6f 20 71 75 6f
AAD word: 525450200000042a0000e9304c756e61 IV: 51 75 24 05 52 03 72 6f 20 71 70 bb
partial hash: 6ccd900dfd0eb292f68f8a410d0648ec
AAD word: deadbeefdeadbeefdeadbeefdeadbeef
partial hash: 6a14be0ea384c6b746235ba955a57ff5
AAD word: deadbeef000005d40000000000000000
partial hash: cc81f14905670a1e37f8bc81a91997cd
Process Length Word Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
Length word: 00000000000001c00000000000000000 AAD: 81c8000d 4d617273 4e545031 4e545032
partial hash: 3ec16d4c3c0e90a59e91be415bd976d8 52545020 0000042a 0000e930 4c756e61
deadbeef deadbeef deadbeef deadbeef
deadbeef 000005d4
IV: 51 75 24 05 52 03 72 6f 20 71 70 bb
H: c6a13b37878f5b826f4f8162a1c8d879
Turn GHASH into GMAC Compute the GMAC tag
GHASH: 3e c1 6d 4c 3c 0e 90 a5 9e 91 be 41 5b d9 76 d8
K0: ba dc b4 24 01 d9 1e 6c b4 74 39 d1 49 86 14 6b
full GMAC: 84 1d d9 68 3d d7 8e c9 2a e5 87 90 12 5f 62 b3
Cipher with tag Process the AAD
841dd968 3dd78ec9 2ae58790 125f62b3 AAD word: 81c8000d4d6172734e5450314e545032
partial hash: f8dbbe278e06afe17fb4fb2e67f0a22e
AAD word: 525450200000042a0000e9304c756e61
partial hash: 6ccd900dfd0eb292f68f8a410d0648ec
AAD word: deadbeefdeadbeefdeadbeefdeadbeef
partial hash: 6a14be0ea384c6b746235ba955a57ff5
AAD word: deadbeef000005d40000000000000000
partial hash: cc81f14905670a1e37f8bc81a91997cd
Tagged Packet: Process the length word
81c8000d 4d617273 4e545031 4e545032 length word: 00000000000001c00000000000000000
52545020 0000042a 0000e930 4c756e61 partial hash: 3ec16d4c3c0e90a59e91be415bd976d8
deadbeef deadbeef deadbeef deadbeef
deadbeef 841dd968 3dd78ec9 2ae58790
125f62b3 000005d4
17.4. SRTCP AEAD_AES_256_GCM Tag Verification Turn GHASH into GMAC
GHASH: 3e c1 6d 4c 3c 0e 90 a5 9e 91 be 41 5b d9 76 d8
K0: ba dc b4 24 01 d9 1e 6c b4 74 39 d1 49 86 14 6b
full GMAC: 84 1d d9 68 3d d7 8e c9 2a e5 87 90 12 5f 62 b3
Key size = 256 bits Cipher with tag
Tag size = 16 octets 841dd968 3dd78ec9 2ae58790 125f62b3
Process Length Word Tagged packet:
Verifying the following packet: 81c8000d 4d617273 4e545031 4e545032
52545020 0000042a 0000e930 4c756e61
deadbeef deadbeef deadbeef deadbeef
deadbeef 841dd968 3dd78ec9 2ae58790
125f62b3 000005d4
81c8000d 4d617273 4e545031 4e545032 17.4. SRTCP AEAD_AES_256_GCM Tag Verification
52545020 0000042a 0000e930 4c756e61
deadbeef deadbeef deadbeef deadbeef
deadbeef 91db4afb feee5a97 8fab4393
ed2615fe 000005d4
Key size = 256 bits Key size = 256 bits
Key size = 16 octets Tag size = 16 octets
Form the IV Process the length word
| Pad | SSRC | Pad | SRTCP | Verifying the following packet:
00 00 4d 61 72 73 00 00 00 00 05 d4
salt: 51 75 69 64 20 70 72 6f 20 71 75 6f
IV: 51 75 24 05 52 03 72 6f 20 71 70 bb
Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 81c8000d 4d617273 4e545031 4e545032
10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 52545020 0000042a 0000e930 4c756e61
AAD: 81c8000d 4d617273 4e545031 4e545032 deadbeef deadbeef deadbeef deadbeef
52545020 0000042a 0000e930 4c756e61 deadbeef 91db4afb feee5a97 8fab4393
deadbeef deadbeef deadbeef deadbeef ed2615fe 000005d4
deadbeef 000005d4
CT: 91db4afb feee5a97 8fab4393 ed2615fe
IV: 51 75 24 05 52 03 72 6f 20 71 70 bb
H: f29000b62a499fd0a9f39a6add2e7780
Verify received tag 91 db 4a fb fe ee 5a 97 8f ab 43 93 ed 26 15 fe Key size = 256 bits
Key size = 16 octets
Process AAD Form the IV
AAD word: 81c8000d4d6172734e5450314e545032 | Pad | SSRC | Pad | SRTCP |
partial hash: 7bc665c71676a5a5f663b3229af4b85c 00 00 4d 61 72 73 00 00 00 00 05 d4
AAD word: 525450200000042a0000e9304c756e61 salt: 51 75 69 64 20 70 72 6f 20 71 75 6f
partial hash: 34ed77752703ab7d69f44237910e3bc0 IV: 51 75 24 05 52 03 72 6f 20 71 70 bb
AAD word: deadbeefdeadbeefdeadbeefdeadbeef
partial hash: 74a59f1a99282344d64ab1c8a2be6cf8
AAD word: deadbeef000005d40000000000000000
partial hash: 126335c0baa7ab1b79416ceeb9f7a518
Process Length Word Key: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
Length word: 00000000000001c00000000000000000 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
partial hash: b6edb305dbc7065887fb1b119cd36acb AAD: 81c8000d 4d617273 4e545031 4e545032
52545020 0000042a 0000e930 4c756e61
deadbeef deadbeef deadbeef deadbeef
deadbeef 000005d4
CT: 91db4afb feee5a97 8fab4393 ed2615fe
IV: 51 75 24 05 52 03 72 6f 20 71 70 bb
H: f29000b62a499fd0a9f39a6add2e7780
Turn GHASH into GMAC Verify the received tag
GHASH: b6 ed b3 05 db c7 06 58 87 fb 1b 11 9c d3 6a cb 91 db 4a fb fe ee 5a 97 8f ab 43 93 ed 26 15 fe
K0: 27 36 f9 fe 25 29 5c cf 08 50 58 82 71 f5 7f 35
full GMAC: 91 db 4a fb fe ee 5a 97 8f ab 43 93 ed 26 15 fe
Received tag = 91db4afb feee5a97 8fab4393 ed2615fe Process the AAD
Computed tag = 91db4afb feee5a97 8fab4393 ed2615fe AAD word: 81c8000d4d6172734e5450314e545032
Received tag verified. partial hash: 7bc665c71676a5a5f663b3229af4b85c
AAD word: 525450200000042a0000e9304c756e61
partial hash: 34ed77752703ab7d69f44237910e3bc0
AAD word: deadbeefdeadbeefdeadbeefdeadbeef
partial hash: 74a59f1a99282344d64ab1c8a2be6cf8
AAD word: deadbeef000005d40000000000000000
partial hash: 126335c0baa7ab1b79416ceeb9f7a518
Verified Packet: Process the length word
81c8000d 4d617273 4e545031 4e545032 length word: 00000000000001c00000000000000000
52545020 0000042a 0000e930 4c756e61 partial hash: b6edb305dbc7065887fb1b119cd36acb
deadbeef deadbeef deadbeef deadbeef
deadbeef
18. Acknowledgements Turn GHASH into GMAC
GHASH: b6 ed b3 05 db c7 06 58 87 fb 1b 11 9c d3 6a cb
K0: 27 36 f9 fe 25 29 5c cf 08 50 58 82 71 f5 7f 35
full GMAC: 91 db 4a fb fe ee 5a 97 8f ab 43 93 ed 26 15 fe
The authors would like to thank Michael Peck, Michael Torla, Qin Wu, Received tag = 91db4afb feee5a97 8fab4393 ed2615fe
Magnus Westerlund, Oscar Ohllson, Woo-Hwan Kim, John Mattsson, Computed tag = 91db4afb feee5a97 8fab4393 ed2615fe
Richard Barnes, John Mattisson, Morris Dworkin, Stehen Farrell and Received tag verified.
many other reviewers who provided valuable comments on earlier drafts
of this document.
19. References Verified packet:
81c8000d 4d617273 4e545031 4e545032
52545020 0000042a 0000e930 4c756e61
deadbeef deadbeef deadbeef deadbeef
deadbeef
19.1. Normative References 18. References
18.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997. Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997,
<http://www.rfc-editor.org/info/rfc2119>.
[RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V.
Jacobson, "RTP: A Transport Protocol for Real-Time Jacobson, "RTP: A Transport Protocol for Real-Time
Applications", STD 64, RFC 3550, July 2003. Applications", STD 64, RFC 3550, DOI 10.17487/RFC3550,
July 2003, <http://www.rfc-editor.org/info/rfc3550>.
[RFC3711] Baugher, M., McGrew, D., Naslund, M., Carrara, E., and [RFC3711] Baugher, M., McGrew, D., Naslund, M., Carrara, E., and K.
K. Norrman, "The Secure Real-time Transport Protocol Norrman, "The Secure Real-time Transport Protocol (SRTP)",
(SRTP)", RFC 3711, September 2003. RFC 3711, DOI 10.17487/RFC3711, March 2004,
<http://www.rfc-editor.org/info/rfc3711>.
[RFC3830] Arkko, J., Carrara, E., Lindholm, F., Naslund, M.,and [RFC3830] Arkko, J., Carrara, E., Lindholm, F., Naslund, M., and K.
Norrman, K, "MIKEY: Multimedia Internet KEYing", RFC 3830, Norrman, "MIKEY: Multimedia Internet KEYing", RFC 3830,
August 2004. DOI 10.17487/RFC3830, August 2004,
<http://www.rfc-editor.org/info/rfc3830>.
[RFC4568] Andreasen, F., Baugher, M., and D.Wing, "Session [RFC4568] Andreasen, F., Baugher, M., and D. Wing, "Session
Description Protocol (SDP): Security Descriptions for Description Protocol (SDP) Security Descriptions for Media
Media Streams", RFC 4568, July 2006. Streams", RFC 4568, DOI 10.17487/RFC4568, July 2006,
<http://www.rfc-editor.org/info/rfc4568>.
[RFC5116] McGrew, D., "An Interface and Algorithms for [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated
Authenticated Encryption with Associated Data", RFC 5116, Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008,
January 2008. <http://www.rfc-editor.org/info/rfc5116>.
[RFC5282] McGrew, D. and D. Black, "Using Authenticated Encryption [RFC5234] Crocker, D., Ed., and P. Overell, "Augmented BNF for
Algorithms with the Encrypted Payload of the Internet Key Syntax Specifications: ABNF", STD 68, RFC 5234,
Exchange version 2 (IKEv2) Protocol", RFC 5282, DOI 10.17487/RFC5234, January 2008,
August 2008. <http://www.rfc-editor.org/info/rfc5234>.
[RFC5764] McGrew, D. and E. Rescorla, "Datagram Transport Layer [RFC5764] McGrew, D. and E. Rescorla, "Datagram Transport Layer
Security (DTLS) Extension to Establish Keys for the Secure Security (DTLS) Extension to Establish Keys for the Secure
Real-time Transport Protocol (SRTP)", RFC 5764, May 2010. Real-time Transport Protocol (SRTP)", RFC 5764,
DOI 10.17487/RFC5764, May 2010,
[RFC6188] D. McGrew, "The Use of AES-192 and AES-256 in Secure <http://www.rfc-editor.org/info/rfc5764>.
RTP", RFC 6188, March 2011.
[RFC6904] J. Lennox, "Encryption of Header Extensions in the Secure [RFC6188] McGrew, D., "The Use of AES-192 and AES-256 in Secure
Real-Time Transport Protocol (SRTP)", January 2013. RTP", RFC 6188, DOI 10.17487/RFC6188, March 2011,
<http://www.rfc-editor.org/info/rfc6188>.
19.2. Informative References [RFC6904] Lennox, J., "Encryption of Header Extensions in the Secure
Real-time Transport Protocol (SRTP)", RFC 6904,
DOI 10.17487/RFC6904, April 2013,
<http://www.rfc-editor.org/info/rfc6904>.
[BN00] Bellare, M. and C. Namprempre, "Authenticated encryption: 18.2. Informative References
[BN00] Bellare, M. and C. Namprempre, "Authenticated Encryption:
Relations among notions and analysis of the generic Relations among notions and analysis of the generic
composition paradigm", Proceedings of ASIACRYPT 2000, composition paradigm", Proceedings of ASIACRYPT 2000,
Springer-Verlag, LNCS 1976, pp. 531-545 http:// Springer-Verlag, LNCS 1976, pp. 531-545,
www-cse.ucsd.edu/users/mihir/papers/oem.html. DOI 10.1007/3-540-44448-3_41,
<http://www-cse.ucsd.edu/users/mihir/papers/oem.html>.
[Ferg] Ferguson, N., "Authentication weaknesses in GCM", http://
csrc.nist.gov/groups/ST/toolkit/BCM/documents/comments/
CWC-GCM/Ferguson2.pdf. May 2005.
[GCM] Dworkin, M., "NIST Special Publication 800-38D: [GCM] Dworkin, M., "NIST Special Publication 800-38D:
Recommendation for Block Cipher Modes of Operation: Recommendation for Block Cipher Modes of Operation:
Galois/Counter Mode (GCM) and GMAC.", U.S. National Galois/Counter Mode (GCM) and GMAC", U.S. National
Institute of Standards and Technology http:// Institute of Standards and Technology, November 2007,
csrc.nist.gov/publications/nistpubs/800-38D/SP800-38D.pdf. <http://csrc.nist.gov/publications/nistpubs/
800-38D/SP-800-38D.pdf>.
[R02] Rogaway, P., "Authenticated encryption with Associated- [R02] Rogaway, P., "Authenticated-Encryption with Associated-
Data", ACM Conference on Computer and Communication Data", ACM Conference on Computer and Communications
Security (CCS'02), pp. 98-107, ACM Press, Security (CCS'02), pp. 98-107, ACM Press,
2002. http://www.cs.ucdavis.edu/~rogaway/papers/ad.html. DOI 10.1145/586110.586125, September 2002,
<http://www.cs.ucdavis.edu/~rogaway/papers/ad.html>.
[RFC4771] Lehtovirta, V., Naslund, M., and K. Norrman, "Integrity [RFC4771] Lehtovirta, V., Naslund, M., and K. Norrman, "Integrity
Transform Carrying Roll-Over Counter for the Secure Real- Transform Carrying Roll-Over Counter for the Secure
time Transport Protocol (SRTP)", RFC 4771, January 2007. Real-time Transport Protocol (SRTP)", RFC 4771,
DOI 10.17487/RFC4771, January 2007,
<http://www.rfc-editor.org/info/rfc4771>.
Author's Address Acknowledgements
David A. McGrew The authors would like to thank Michael Peck, Michael Torla, Qin Wu,
Cisco Systems, Inc. Magnus Westerlund, Oscar Ohllson, Woo-Hwan Kim, John Mattsson,
510 McCarthy Blvd. Richard Barnes, Morris Dworkin, Stephen Farrell, and many other
Milpitas, CA 95035 reviewers who provided valuable comments on earlier draft versions of
US this document.
Phone: (408) 525 8651
Email: mcgrew@cisco.com
URI: http://www.mindspring.com/~dmcgrew/dam.htm
Kevin M. Igoe Authors' Addresses
NSA/CSS Commercial Solutions Center
National Security Agency
EMail: kmigoe@nsa.gov
Acknowledgement David A. McGrew
Cisco Systems, Inc.
510 McCarthy Blvd.
Milpitas, CA 95035
United States
Phone: (408) 525 8651
Funding for the RFC Editor function is provided by the IETF Email: mcgrew@cisco.com
Administrative Support Activity (IASA). URI: http://www.mindspring.com/~dmcgrew/dam.htm
Kevin M. Igoe
NSA/CSS Commercial Solutions Center
National Security Agency
Email: mythicalkevin@yahoo.com
 End of changes. 353 change blocks. 
1296 lines changed or deleted 1326 lines changed or added

This html diff was produced by rfcdiff 1.42. The latest version is available from http://tools.ietf.org/tools/rfcdiff/