RFC 9605: Secure Frame (SFrame): Lightweight Authenticated Encryption for Real-Time Media
- E. Omara,
- J. Uberti,
- S. G. Murillo,
- R. Barnes, Ed.,
- Y. Fablet
Abstract
This document describes the Secure Frame (SFrame) end-to-end encryption and authentication mechanism for media frames in a multiparty conference call, in which central media servers (Selective Forwarding Units or SFUs) can access the media metadata needed to make forwarding decisions without having access to the actual media.¶
This mechanism differs from the Secure Real-Time Protocol (SRTP) in that it is independent of RTP (thus compatible with non-RTP media transport) and can be applied to whole media frames in order to be more bandwidth efficient.¶
Status of This Memo
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 7841.¶
Information about the current status of this document, any
errata, and how to provide feedback on it may be obtained at
https://
Copyright Notice
Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(https://
1. Introduction
Modern multiparty video call systems use Selective Forwarding Unit (SFU) servers to efficiently route media streams to call endpoints based on factors such as available bandwidth, desired video size, codec support, and other factors. An SFU typically does not need access to the media content of the conference, which allows the media to be encrypted "end to end" so that it cannot be decrypted by the SFU. In order for the SFU to work properly, though, it usually needs to be able to access RTP metadata and RTCP feedback messages, which is not possible if all RTP/RTCP traffic is end-to-end encrypted.¶
As such, two layers of encryption and authentication are required:¶
The Secure Real-Time Protocol (SRTP) is already widely used for HBH encryption [RFC3711]. The SRTP "double encryption" scheme defines a way to do E2E encryption in SRTP [RFC8723]. Unfortunately, this scheme has poor efficiency and high complexity, and its entanglement with RTP makes it unworkable in several realistic SFU scenarios.¶
This document proposes a new E2EE protection scheme known as SFrame, specifically designed to work in group conference calls with SFUs. SFrame is a general encryption framing that can be used to protect media payloads, agnostic of transport.¶
2. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
We use "Selective Forwarding Unit (SFU)" and "media stream" in a less formal sense than in [RFC7656]. An SFU is a selective switching function for media payloads, and a media stream is a sequence of media payloads, regardless of whether those media payloads are transported over RTP or some other protocol.¶
3. Goals
SFrame is designed to be a suitable E2EE protection scheme for conference call media in a broad range of scenarios, as outlined by the following goals:¶
4. SFrame
This document defines an encryption mechanism that provides effective E2EE, is simple to implement, has no dependencies on RTP, and minimizes encryption bandwidth overhead. This section describes how the mechanism works and includes details of how applications utilize SFrame for media protection as well as the actual mechanics of E2EE for protecting media.¶
4.1. Application Context
SFrame is a general encryption framing, intended to be used as an E2EE layer over an underlying HBH-encrypted transport such as SRTP or QUIC [RFC3711][MOQ-TRANSPORT].¶
The scale at which SFrame encryption is applied to media determines the overall amount of overhead that SFrame adds to the media stream as well as the engineering complexity involved in integrating SFrame into a particular environment. Two patterns are common: using SFrame to encrypt either whole media frames (per frame) or individual transport-level media payloads (per packet).¶
For example, Figure 1 shows a typical media sender stack that takes media from some source, encodes it into frames, divides those frames into media packets, and then sends those payloads in SRTP packets. The receiver stack performs the reverse operations, reassembling frames from SRTP packets and decoding. Arrows indicate two different ways that SFrame protection could be integrated into this media stack: to encrypt whole frames or individual media packets.¶
Applying SFrame per frame in this system offers higher efficiency but may require a more complex integration in environments where depacketization relies on the content of media packets. Applying SFrame per packet avoids this complexity at the cost of higher bandwidth consumption. Some quantitative discussion of these trade-offs is provided in Appendix B.¶
As noted above, however, SFrame is a general media encapsulation and can be
applied in other scenarios. The important thing is that the sender and
receivers of an SFrame
Like SRTP, SFrame does not define how the keys used for SFrame are exchanged by the parties in the conference. Keys for SFrame might be distributed over an existing E2E-secure channel (see Section 5.1) or derived from an E2E-secure shared secret (see Section 5.2). The key management system MUST ensure that each key used for encrypting media is used by exactly one media sender in order to avoid reuse of nonces.¶
4.2. SFrame Ciphertext
An SFrame ciphertext comprises an SFrame header followed by the output of an Authenticated Encryption with Associated Data (AEAD) encryption of the plaintext [RFC5116], with the header provided as additional authenticated data (AAD).¶
The SFrame header is a variable-length structure described in detail in Section 4.3. The structure of the encrypted data and authentication tag are determined by the AEAD algorithm in use.¶
When SFrame is applied per packet, the payload of each packet will be an SFrame ciphertext. When SFrame is applied per frame, the SFrame ciphertext representing an encrypted frame will span several packets, with the header appearing in the first packet and the authentication tag in the last packet. It is the responsibility of the application to reassemble an encrypted frame from individual packets, accounting for packet loss and reordering as necessary.¶
4.3. SFrame Header
The SFrame header specifies two values from which encryption parameters are derived:¶
Applications MUST ensure that each (KID, CTR) combination is used for exactly one SFrame encryption operation. A typical approach to achieve this guarantee is outlined in Section 9.1.¶
The SFrame header has the overall structure shown in Figure 3. The first byte is a "config byte", with the following fields:¶
- Extended KID Flag (X, 1 bit):
-
Indicates if the K field contains the KID or the KID length.¶
- KID or KID Length (K, 3 bits):
-
If the X flag is set to 0, this field contains the KID. If the X flag is set to 1, then it contains the length of the KID, minus one.¶
- Extended CTR Flag (Y, 1 bit):
-
Indicates if the C field contains the CTR or the CTR length.¶
- CTR or CTR Length (C, 3 bits):
-
This field contains the CTR if the Y flag is set to 0, or the CTR length, minus one, if set to 1.¶
The KID and CTR fields are encoded as compact unsigned integers in network (big-endian) byte order. If the value of one of these fields is in the range 0-7, then the value is carried in the corresponding bits of the config byte (K or C) and the corresponding flag (X or Y) is set to zero. Otherwise, the value MUST be encoded with the minimum number of bytes required and appended after the config byte, with the KID first and CTR second. The header field (K or C) is set to the number of bytes in the encoded value, minus one. The value 000 represents a length of 1, 001 a length of 2, etc. This allows a 3-bit length field to represent the value lengths 1-8.¶
The SFrame header can thus take one of the four forms shown in Figure 4, depending on which of the X and Y flags are set.¶
4.4. Encryption Schema
SFrame encryption uses an AEAD encryption algorithm and hash function defined by the cipher suite in use (see Section 4.5). We will refer to the following aspects of the AEAD and the hash algorithm below:¶
4.4.1. Key Selection
Each SFrame encryption or decryption operation is premised on a single secret
base_key, which is labeled with an integer KID value signaled in the SFrame
header.¶
The sender and receivers need to agree on which base_key should be used for a given
KID. Moreover, senders and receivers need to agree on whether a base_key will be used
for encryption or decryption only. The process for provisioning base_key values and their KID
values is beyond the scope of this specification, but its security properties will
bound the assurances that SFrame provides. For example, if SFrame is used to
provide E2E security against intermediary media nodes, then SFrame keys need to
be negotiated in a way that does not make them accessible to these intermediaries.¶
For each known KID value, the client stores the corresponding symmetric key
base_key. For keys that can be used for encryption, the client also stores
the next CTR value to be used when encrypting (initially 0).¶
When encrypting a plaintext, the application specifies which KID is to be used,
and the CTR value is incremented after successful encryption. When decrypting,
the base_key for decryption is selected from the available keys using the KID
value in the SFrame header.¶
A given base_key MUST NOT be used for encryption by multiple senders. Such reuse
would result in multiple encrypted frames being generated with the same (key,
nonce) pair, which harms the protections provided by many AEAD algorithms.
Implementations MUST mark each base_key as usable for encryption or decryption,
never both.¶
Note that the set of available keys might change over the lifetime of a real-time session. In such cases, the client will need to manage key usage to avoid media loss due to a key being used to encrypt before all receivers are able to use it to decrypt. For example, an application may make decryption-only keys available immediately, but delay the use of keys for encryption until (a) all receivers have acknowledged receipt of the new key, or (b) a timeout expires.¶
4.4.2. Key Derivation
SFrame encryption and decryption use a key and salt derived from the base_key
associated with a KID. Given a base_key value, the key and salt are derived
using HMAC-based Key Derivation Function (HKDF) [RFC5869] as follows:¶
In the derivation of sframe_secret:¶
The hash function used for HKDF is determined by the cipher suite in use.¶
4.4.3. Encryption
SFrame encryption uses the AEAD encryption algorithm for the cipher suite in use.
The key for the encryption is the sframe_key. The nonce is formed by first XORing
the sframe_salt with the current CTR value, and then encoding the result as a big-endian integer of
length AEAD.Nn.¶
The encryptor forms an SFrame header using the CTR and KID values provided.
The encoded header is provided as AAD to the AEAD encryption operation, together
with application
For example, the metadata input to encryption allows for frame metadata to be authenticated when SFrame is applied per frame. After encoding the frame and before packetizing it, the necessary media metadata will be moved out of the encoded frame buffer to be sent in some channel visible to the SFU (e.g., an RTP header extension).¶
4.4.4. Decryption
Before decrypting, a receiver needs to assemble a full SFrame ciphertext. When an SFrame ciphertext is fragmented into multiple parts for transport (e.g., a whole encrypted frame sent in multiple SRTP packets), the receiving client collects all the fragments of the ciphertext, using appropriate sequencing and start/end markers in the transport. Once all of the required fragments are available, the client reassembles them into the SFrame ciphertext and passes the ciphertext to SFrame for decryption.¶
The KID field in the SFrame header is used to find the right key and salt for the encrypted frame, and the CTR field is used to construct the nonce. The SFrame decryption procedure is as follows:¶
If a ciphertext fails to decrypt because there is no key available for the KID
in the SFrame header, the client MAY buffer the ciphertext and retry decryption
once a key with that KID is received. If a ciphertext fails to decrypt for any
other reason, the client MUST discard the ciphertext. Invalid ciphertexts SHOULD be
discarded in a way that is indistinguishab
4.5. Cipher Suites
Each SFrame session uses a single cipher suite that specifies the following primitives:¶
This document defines the following cipher suites, with the constants defined in Section 4.4:¶
Numeric identifiers for these cipher suites are defined in the IANA registry created in Section 8.1.¶
In the suite names, the length of the authentication tag is indicated by the last value: "_128" indicates a 128-bit tag, "_80" indicates an 80-bit tag, "_64" indicates a 64-bit tag, and "_32" indicates a 32-bit tag.¶
In a session that uses multiple media streams, different cipher suites might be configured for different media streams. For example, in order to conserve bandwidth, a session might use a cipher suite with 80-bit tags for video frames and another cipher suite with 32-bit tags for audio frames.¶
4.5.1. AES-CTR with SHA2
In order to allow very short tag sizes, we define a synthetic AEAD function
using the authenticated counter mode of AES together with HMAC for
authentication. We use an encrypt
Before encryption or decryption, encryption and authentication subkeys are
derived from the single AEAD key. The overall length of the AEAD key is Nka +
Nh, where Nka represents the key size for the AES block cipher in use and Nh
represents the output size of the hash function (as in Section 4.4).
The encryption subkey comprises the first Nka bytes and the authentication
subkey comprises the remaining Nh bytes.¶
The AEAD encryption and decryption functions are then composed of individual
calls to the CTR encrypt function and HMAC. The resulting MAC value is truncated
to a number of bytes Nt fixed by the cipher suite.¶
5. Key Management
SFrame must be integrated with an E2E key management framework to exchange and rotate the keys used for SFrame encryption. The key management framework provides the following functions:¶
It is the responsibility of the application to provide the key management framework, as described in Section 9.2.¶
5.1. Sender Keys
If the participants in a call have a preexisting E2E-secure channel, they can
use it to distribute SFrame keys. Each client participating in a call generates
a fresh base_key value that it will use to encrypt media. The client then uses
the E2E-secure channel to send their encryption key to the other participants.¶
In this scheme, it is assumed that receivers have a signal outside of SFrame for
which client has sent a given frame (e.g., an RTP synchronization source (SSRC)). SFrame KID
values are then used to distinguish between versions of the sender's base_key.¶
KID values in this scheme have two parts: a "key generation" and a "ratchet step". Both are unsigned integers that begin at zero. The key generation increments each time the sender distributes a new key to receivers. The ratchet step is incremented each time the sender ratchets their key forward for forward secrecy:¶
For compactness, we do not send the whole ratchet step. Instead, we send only
its low-order R bits, where R is a value set by the application. Different
senders may use different values of R, but each receiver of a given sender
needs to know what value of R is used by the sender so that they can recognize
when they need to ratchet (vs. expecting a new key). R effectively defines a
reordering window, since no more than 2R ratchet steps can be
active at a given time. The key generation is sent in the remaining 64 - R
bits of the KID.¶
The sender signals such a ratchet step update by sending with a KID value in which the ratchet step has been incremented. A receiver who receives from a sender with a new KID computes the new key as above. The old key may be kept for some time to allow for out-of-order delivery, but should be deleted promptly.¶
If a new participant joins in the middle of a session, they will need to receive from each sender (a) the current sender key for that sender and (b) the current KID value for the sender. Evicting a participant requires each sender to send a fresh sender key to all receivers.¶
It is the application's responsibility to decide when sender keys are updated. A sender
key may be updated by sending a new base_key (updating the key generation) or
by hashing the current base_key (updating the ratchet step). Ratcheting the
key forward is useful when adding new receivers to an SFrame-based interaction,
since it ensures that the new receivers can't decrypt any media encrypted before
they were added. If a sender wishes to assure the opposite property when
removing a receiver (i.e., ensuring that the receiver can't decrypt media after
they are removed), then the sender will need to distribute a new sender key.¶
5.2. MLS
The Messaging Layer Security (MLS) protocol provides group authenticated key exchange [MLS-ARCH] [MLS-PROTO]. In principle, it could be used to instantiate the sender key scheme above, but it can also be used more efficiently directly.¶
MLS creates a linear sequence of keys, each of which is shared among the members of a group at a given point in time. When a member joins or leaves the group, a new key is produced that is known only to the augmented or reduced group. Each step in the lifetime of the group is known as an "epoch", and each member of the group is assigned an "index" that is constant for the time they are in the group.¶
To generate keys and nonces for SFrame, we use the MLS exporter function to
generate a base_key value for each MLS epoch. Each member of the group is
assigned a set of KID values so that each member has a unique sframe_key and
sframe_salt that it uses to encrypt with. Senders may choose any KID value
within their assigned set of KID values, e.g., to allow a single sender to send
multiple, uncoordinated outbound media streams.¶
For compactness, we do not send the whole epoch number. Instead, we send only
its low-order E bits, where E is a value set by the application. E
effectively defines a reordering window, since no more than 2E
epochs can be active at a given time. To handle rollover of the epoch counter,
receivers MUST remove an old epoch when a new epoch with the same low-order
E bits is introduced.¶
Let S be the number of bits required to encode a member index in the group,
i.e., the smallest value such that group_size <= (1 << S). The sender index
is encoded in the S bits above the epoch. The remaining 64 - S - E bits of
the KID value are a context value chosen by the sender (context value 0 will
produce the shortest encoded KID).¶
Once an SFrame stack has been provisioned with the sframe for an
epoch, it can compute the required KID values on demand (as well as the
resulting SFrame keys/nonces derived from the base_key and KID) as it needs
to encrypt or decrypt for a given member.¶
6. Media Considerations
6.1. Selective Forwarding Units
SFUs (e.g., those described in Section 3.7 of [RFC7667]) receive the media streams from each participant and select which ones should be forwarded to each of the other participants. There are several approaches for stream selection, but in general, the SFU needs to access metadata associated with each frame and modify the RTP information of the incoming packets when they are transmitted to the received participants.¶
This section describes how these normal SFU modes of operation interact with the E2EE provided by SFrame.¶
6.1.1. RTP Stream Reuse
The SFU may choose to send only a certain number of streams based on the voice activity of the participants. To avoid the overhead involved in establishing new transport streams, the SFU may decide to reuse previously existing streams or even pre-allocate a predefined number of streams and choose in each moment in time which participant media will be sent through it.¶
This means that the same transport-level stream (e.g., an RTP stream defined by either SSRC or Media Identification (MID)) may carry media from different streams of different participants. Because each participant uses a different key to encrypt their media, the receiver will be able to verify the sender of the media within the RTP stream at any given point in time. Thus the receiver will correctly associate the media with the sender indicated by the authenticated SFrame KID value, irrespective of how the SFU transmits the media to the client.¶
Note that in order to prevent impersonation by a malicious participant (not the SFU), a mechanism based on digital signature would be required. SFrame does not protect against such attacks.¶
6.1.2. Simulcast
When using simulcast, the same input image will produce N different encoded frames (one per simulcast layer), which would be processed independently by the frame encryptor and assigned an unique CTR value for each.¶
6.1.3. Scalable Video Coding (SVC)
In both temporal and spatial scalability, the SFU may choose to drop layers in order to match a certain bitrate or to forward specific media sizes or frames per second. In order to support the SFU selectively removing layers, the sender MUST encapsulate each layer in a different SFrame ciphertext.¶
6.2. Video Key Frames
Forward security and post-compromise security require that the E2EE keys (base keys) are updated any time a participant joins or leaves the call.¶
The key exchange happens asynchronously and on a different path than the SFU signaling and media. So it may happen that when a new participant joins the call and the SFU side requests a key frame, the sender generates the E2EE frame with a key that is not known by the receiver, so it will be discarded. When the sender updates his sending key with the new key, it will send it in a non-key frame, so the receiver will be able to decrypt it, but not decode it.¶
The new receiver will then re-request a key frame, but due to sender and SFU policies, that new key frame could take some time to be generated.¶
If the sender sends a key frame after the new E2EE key is in use, the time required for the new participant to display the video is minimized.¶
Note that this issue does not arise for media streams that do not have dependencies among frames, e.g., audio streams. In these streams, each frame is independently decodable, so a frame never depends on another frame that might be on the other side of a key rotation.¶
6.3. Partial Decoding
Some codecs support partial decoding, where individual packets can be decoded without waiting for the full frame to arrive. When SFrame is applied per frame, partial decoding is not possible because the decoder cannot access data until an entire frame has arrived and has been decrypted.¶
7. Security Considerations
7.1. No Header Confidentiality
SFrame provides integrity protection to the SFrame header (the KID and CTR values), but it does not provide confidentiality protection. Parties that can observe the SFrame header may learn, for example, which parties are sending SFrame payloads (from KID values) and at what rates (from CTR values). In cases where SFrame is used for end-to-end security on top of hop-by-hop protections (e.g., running over SRTP as described in Appendix B.5), the hop-by-hop security mechanisms provide confidentiality protection of the SFrame header between hops.¶
7.2. No Per-Sender Authentication
SFrame does not provide per-sender authentication of media data. Any sender in a session can send media that will be associated with any other sender. This is because SFrame uses symmetric encryption to protect media data, so that any receiver also has the keys required to encrypt packets for the sender.¶
7.3. Key Management
The specifics of key management are beyond the scope of this document. However, every client SHOULD change their keys when new clients join or leave the call for forward secrecy and post-compromise security.¶
7.4. Replay
The handling of replay is out of the scope of this document. However, senders MUST reject requests to encrypt multiple times with the same key and nonce since several AEAD algorithms fail badly in such cases (see, e.g., Section 5.1.1 of [RFC5116]).¶
8. IANA Considerations
IANA has created a new registry called "SFrame Cipher Suites" (Section 8.1) under the "SFrame" group registry heading.¶
8.1. SFrame Cipher Suites
The "SFrame Cipher Suites" registry lists identifiers for SFrame cipher suites as defined in Section 4.5. The cipher suite field is two bytes wide, so the valid cipher suites are in the range 0x0000 to 0xFFFF. Except as noted below, assignments are made via the Specification Required policy [RFC8126].¶
The registration template is as follows:¶
Initial contents:¶
9. Application Responsibilities
To use SFrame, an application needs to define the inputs to the SFrame encryption and decryption operations, and how SFrame ciphertexts are delivered from sender to receiver (including any fragmentation and reassembly). In this section, we lay out additional requirements that an application must meet in order for SFrame to operate securely.¶
In general, an application using SFrame is responsible for configuring SFrame. The application must first define when SFrame is applied at all. When SFrame is applied, the application must define which cipher suite is to be used. If new versions of SFrame are defined in the future, it will be the application's responsibility to determine which version should be used.¶
This division of responsibilitie
9.1. Header Value Uniqueness
Applications MUST ensure that each (base_key, KID, CTR) combination is used
for at most one SFrame encryption operation. This ensures that the (key, nonce)
pairs used by the underlying AEAD algorithm are never reused. Typically this is
done by assigning each sender a KID or set of KIDs, then having each sender use
the CTR field as a monotonic counter, incrementing for each plaintext that is
encrypted. In addition to its simplicity, this scheme minimizes overhead by
keeping CTR values as small as possible.¶
In applications where an SFrame context might be written to persistent storage,
this context needs to include the last-used CTR value. When the context is used
later, the application should use the stored CTR value to determine the next CTR
value to be used in an encryption operation, and then write the next CTR value
back to storage before using the CTR value for encryption. Storing the CTR
value before usage (vs. after) helps ensure that a storage failure will not
cause reuse of the same (base_key, KID, CTR) combination.¶
9.2. Key Management Framework
The application is responsible for provisioning SFrame with a mapping of KID values to
base_key values and the resulting keys and salts. More importantly, the
application specifies which KID values are used for which purposes (e.g., by
which senders). An application's KID assignment strategy MUST be structured to
assure the non-reuse properties discussed in Section 9.1.¶
The application is also responsible for defining a rotation schedule for keys. For example, one application might have an ephemeral group for every call and keep rotating keys when endpoints join or leave the call, while another application could have a persistent group that can be used for multiple calls and simply derives ephemeral symmetric keys for a specific call.¶
It should be noted that KID values are not encrypted by SFrame and are thus
visible to any application
9.3. Anti-Replay
It is the responsibility of the application to handle anti-replay. Replay by network attackers is assumed to be prevented by network-layer facilities (e.g., TLS, SRTP). As mentioned in Section 7.4, senders MUST reject requests to encrypt multiple times with the same key and nonce.¶
It is not mandatory to implement anti-replay on the receiver side. Receivers MAY apply time- or counter-based anti-replay mitigations. For example, Section 3.3.2 of [RFC3711] specifies a counter-based anti-replay mitigation, which could be adapted to use with SFrame, using the CTR field as the counter.¶
9.4. Metadata
The metadata input to SFrame operations is an opaque byte string specified by the application. As
such, the application needs to define what information should go in the
metadata input and ensure that it is provided to the encryption and decryption
functions at the appropriate points. A receiver MUST NOT use SFrame
For example, consider an application where SFrame is used to encrypt audio frames that are sent over SRTP, with some application data included in the RTP header extension. Suppose the application also includes this application data in the SFrame metadata, so that the SFU is allowed to read, but not modify, the application data. A receiver can use the application data in the RTP header extension as part of the standard SRTP decryption process since this is required to recover the SFrame ciphertext carried in the SRTP payload. However, the receiver MUST NOT use the application data for other purposes before SFrame decryption has authenticated the application data.¶
10. References
10.1. Normative References
- [MLS-PROTO]
-
Barnes, R., Beurdouche, B., Robert, R., Millican, J., Omara, E., and K. Cohn-Gordon, "The Messaging Layer Security (MLS) Protocol", RFC 9420, DOI 10
.17487 , , <https:///RFC9420 www >..rfc -editor .org /info /rfc9420 - [RFC2119]
-
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10
.17487 , , <https:///RFC2119 www >..rfc -editor .org /info /rfc2119 - [RFC5116]
-
McGrew, D., "An Interface and Algorithms for Authenticated Encryption", RFC 5116, DOI 10
.17487 , , <https:///RFC5116 www >..rfc -editor .org /info /rfc5116 - [RFC5869]
-
Krawczyk, H. and P. Eronen, "HMAC-based Extract
-and , RFC 5869, DOI 10-Expand Key Derivation Function (HKDF)" .17487 , , <https:///RFC5869 www >..rfc -editor .org /info /rfc5869 - [RFC8126]
-
Cotton, M., Leiba, B., and T. Narten, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 8126, DOI 10
.17487 , , <https:///RFC8126 www >..rfc -editor .org /info /rfc8126 - [RFC8174]
-
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10
.17487 , , <https:///RFC8174 www >..rfc -editor .org /info /rfc8174
10.2. Informative References
- [MLS-ARCH]
-
Beurdouche, B., Rescorla, E., Omara, E., Inguva, S., and A. Duric, "The Messaging Layer Security (MLS) Architecture", Work in Progress, Internet-Draft, draft
-ietf , , <https://-mls -architecture -15 datatracker >..ietf .org /doc /html /draft -ietf -mls -architecture -15 - [MOQ-TRANSPORT]
-
Curley, L., Pugin, K., Nandakumar, S., Vasiliev, V., and I. Swett, Ed., "Media over QUIC Transport", Work in Progress, Internet-Draft, draft
-ietf , , <https://-moq -transport -05 datatracker >..ietf .org /doc /html /draft -ietf -moq -transport -05 - [RFC3711]
-
Baugher, M., McGrew, D., Naslund, M., Carrara, E., and K. Norrman, "The Secure Real-time Transport Protocol (SRTP)", RFC 3711, DOI 10
.17487 , , <https:///RFC3711 www >..rfc -editor .org /info /rfc3711 - [RFC6716]
-
Valin, JM., Vos, K., and T. Terriberry, "Definition of the Opus Audio Codec", RFC 6716, DOI 10
.17487 , , <https:///RFC6716 www >..rfc -editor .org /info /rfc6716 - [RFC7656]
-
Lennox, J., Gross, K., Nandakumar, S., Salgueiro, G., and B. Burman, Ed., "A Taxonomy of Semantics and Mechanisms for Real-Time Transport Protocol (RTP) Sources", RFC 7656, DOI 10
.17487 , , <https:///RFC7656 www >..rfc -editor .org /info /rfc7656 - [RFC7667]
-
Westerlund, M. and S. Wenger, "RTP Topologies", RFC 7667, DOI 10
.17487 , , <https:///RFC7667 www >..rfc -editor .org /info /rfc7667 - [RFC8723]
-
Jennings, C., Jones, P., Barnes, R., and A.B. Roach, "Double Encryption Procedures for the Secure Real-Time Transport Protocol (SRTP)", RFC 8723, DOI 10
.17487 , , <https:///RFC8723 www >..rfc -editor .org /info /rfc8723 - [RFC8866]
-
Begen, A., Kyzivat, P., Perkins, C., and M. Handley, "SDP: Session Description Protocol", RFC 8866, DOI 10
.17487 , , <https:///RFC8866 www >..rfc -editor .org /info /rfc8866 - [RTP-PAYLOAD]
-
Murillo, S. G., Fablet, Y., and A. Gouaillard, "Codec agnostic RTP payload format for video", Work in Progress, Internet-Draft, draft
-gouaillard , , <https://-avtcore -codec -agn -rtp -payload -01 datatracker >..ietf .org /doc /html /draft -gouaillard -avtcore -codec -agn -rtp -payload -01 - [TestVectors]
-
"SFrame Test Vectors", commit 025d568, , <https://
github >..com /sframe -wg /sframe /blob /025d568 /test -vectors /test -vectors .json - [WEBTRANSPORT]
-
Vasiliev, V., "The WebTransport Protocol Framework", Work in Progress, Internet-Draft, draft
-ietf , , <https://-webtrans -overview -08 datatracker >..ietf .org /api /v1 /doc /document /draft -ietf -webtrans -overview /
Appendix A. Example API
This section is not normative.¶
This section describes a notional API that an SFrame implementation might expose. The core concept is an "SFrame context", within which KID values are meaningful. In the key management scheme described in Section 5.1, each sender has a different context; in the scheme described in Section 5.2, all senders share the same context.¶
An SFrame context stores mappings from KID values to "key contexts", which are different depending on whether the KID is to be used for sending or receiving (an SFrame key should never be used for both operations). A key context tracks the key and salt associated to the KID, and the current CTR value. A key context to be used for sending also tracks the next CTR value to be used.¶
The primary operations on an SFrame context are as follows:¶
Figure 10 shows an example of the types of structures and methods that could be used to create an SFrame API in Rust.¶
Appendix B. Overhead Analysis
Any use of SFrame will impose overhead in terms of the amount of bandwidth necessary to transmit a given media stream. Exactly how much overhead will be added depends on several factors:¶
Overall, the overhead rate in kilobits per second can be estimated as:¶
OverheadKbps = (1 + |CTR| + |KID| + |TAG|) * 8 * CTPerSecond / 1024
¶
Here the constant value 1 reflects the fixed SFrame header; |CTR| and
|KID| reflect the lengths of those fields; |TAG| reflects the cipher
overhead; and CTPerSecond reflects the number of SFrame ciphertexts
sent per second (e.g., packets or frames per second).¶
In the remainder of this section, we compute overhead estimates for a collection of common scenarios.¶
B.1. Assumptions
In the below calculations, we make conservative assumptions about SFrame overhead so that the overhead amounts we compute here are likely to be an upper bound of those seen in practice.¶
In total, then, we assume that each SFrame encryption will add 22 bytes of overhead.¶
We consider two scenarios: applying SFrame per frame and per packet. In each scenario, we compute the SFrame overhead in absolute terms (kbps) and as a percentage of the base bandwidth.¶
B.2. Audio
In audio streams, there is typically a one-to-one relationship between frames and packets, so the overhead is the same whether one uses SFrame at a per-packet or per-frame level.¶
Table 4 considers three scenarios that are based on recommended configurations of the Opus codec [RFC6716] (where "fps" stands for "frames per second"):¶
B.3. Video
Video frames can be larger than an MTU and thus are commonly split across multiple frames. Tables 5 and 6 show the estimated overhead of encrypting a video stream, where SFrame is applied per frame and per packet, respectively. The choices of resolution, frames per second, and bandwidth roughly reflect the capabilities of modern video codecs across a range from very low to very high quality.¶
In the per-frame case, the SFrame percentage overhead approaches zero as the quality of the video improves since bandwidth is driven more by picture size than frame rate. In the per-packet case, the SFrame percentage overhead approaches the ratio between the SFrame overhead per packet and the MTU (here 22 bytes of SFrame overhead divided by an assumed 1200-byte MTU, or about 1.8%).¶
B.4. Conferences
Real conferences usually involve several audio and video streams. The overhead of SFrame in such a conference is the aggregate of the overhead across all the individual streams. Thus, while SFrame incurs a large percentage overhead on an audio stream, if the conference also involves a video stream, then the audio overhead is likely negligible relative to the overall bandwidth of the conference.¶
For example, Table 7 shows the overhead estimates for a two-person conference where one person is sending low-quality media and the other is sending high-quality media. (And we assume that SFrame is applied per frame.) The video streams dominate the bandwidth at the SFU, so the total bandwidth overhead is only around 1%.¶
B.5. SFrame over RTP
SFrame is a generic encapsulation format, but many of the applications in which it is likely to be integrated are based on RTP. This section discusses how an integration between SFrame and RTP could be done, and some of the challenges that would need to be overcome.¶
As discussed in Section 4.1, there are two natural patterns for integrating SFrame into an application: applying SFrame per frame or per packet. In RTP-based applications, applying SFrame per packet means that the payload of each RTP packet will be an SFrame ciphertext, starting with an SFrame header, as shown in Figure 11. Applying SFrame per frame means that different RTP payloads will have different formats: The first payload of a frame will contain the SFrame headers, and subsequent payloads will contain further chunks of the ciphertext, as shown in Figure 12.¶
In order for these media payloads to be properly interpreted by receivers, receivers will need to be configured to know which of the above schemes the sender has applied to a given sequence of RTP packets. SFrame does not provide a mechanism for distributing this configuration information. In applications that use SDP for negotiating RTP media streams [RFC8866], an appropriate extension to SDP could provide this function.¶
Applying SFrame per frame also requires that packetization and depacketization be done in a generic manner that does not depend on the media content of the packets, since the content being packetized or depacketized will be opaque ciphertext (except for the SFrame header). In order for such a generic packetization scheme to work interoperably, one would have to be defined, e.g., as proposed in [RTP-PAYLOAD].¶
Appendix C. Test Vectors
This section provides a set of test vectors that implementations can use to
verify that they correctly implement SFrame encryption and decryption. In
addition to test vectors for the overall process of SFrame
encryption
All values are either numeric or byte strings. Numeric values are represented
as hex values, prefixed with 0x. Byte strings are represented in hex
encoding.¶
Line breaks and whitespace within values are inserted to conform to the width requirements of the RFC format. They should be removed before use.¶
These test vectors are also available in JSON format at [TestVectors]. In the JSON test vectors, numeric values are JSON numbers and byte string values are JSON strings containing the hex encoding of the byte strings.¶
C.1. Header Encoding/Decoding
For each case, we provide:¶
An implementation should verify that:¶
C.2. AEAD Encryption/Decryption Using AES-CTR and HMAC
For each case, we provide:¶
An implementation should verify that the following are true, where
AEAD.Encrypt and AEAD.Decrypt are as defined in Section 4.5.1:¶
The other values in the test vector are intermediate values provided to facilitate debugging of test failures.¶
C.3. SFrame Encryption/Decryption
For each case, we provide:¶
An implementation should verify that the following are true, where
encrypt and decrypt are as defined in Section 4.4, using an SFrame
context initialized with base_key assigned to kid:¶
The other values in the test vector are intermediate values provided to facilitate debugging of test failures.¶
Acknowledgements
The authors wish to specially thank Dr. Alex Gouaillard as one of the early contributors to the document. His passion and energy were key to the design and development of SFrame.¶