Skip to content

Commit

Permalink
Better encrypt/decrypt diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
bifurcation committed Dec 5, 2023
1 parent ff2be4a commit 1e49e47
Showing 1 changed file with 76 additions and 33 deletions.
109 changes: 76 additions & 33 deletions draft-ietf-sframe-enc.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,39 +488,42 @@ 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).

~~~ aasvg

+----------------+ +---------------+
| metadata | | |
+-------+--------+ | |
| | plaintext |
| | |
| | |
| +-------+-------+
| |
header ----+------------------>| AAD
+-----+ |
| S | |
+-----+ |
| KID +--+--> sframe_key ----->| Key
| | | |
| | +--> sframe_salt --+ |
+-----+ | |
| CTR +---------------------+->| Nonce
| | |
| | |
+-----+ |
| AEAD.Encrypt
| |
| +---------------+ |
+---->| SFrame Header | |
+---------------+ |
| | |
| |<----+
| ciphertext |
| |
| |
+---------------+
~~~~~ aasvg
+---------------+
| |
| |
| plaintext |
| |
| |
+-------+-------+
|
.- +-----+ |
| | +--+--> sframe_key ----->| Key
Header | | KID | | |
| | | +--> sframe_salt --+ |
+--+ +-----+ | |
| | | +---------------------+->| Nonce
| | | CTR | |
| | | | |
| '- +-----+ |
| |
| +----------------+ |
| | metadata | |
| +-------+--------+ |
| | |
+------------------+----------------->| AAD
| |
| AEAD.Encrypt
| |
| +---------------+ |
+-------------->| SFrame Header | |
+---------------+ |
| | |
| |<----+
| ciphertext |
| |
| |
+---------------+
~~~~~
{: title="Encryption flow" }

Expand Down Expand Up @@ -558,6 +561,46 @@ other reason, the client MUST discard the ciphertext. Invalid ciphertexts SHOULD
discarded in a way that is indistinguishable (to an external observer) from having
processed a valid ciphertext.

~~~~~ aasvg
+---------------+
+---------------| SFrame Header |
| +---------------+
| | |
| | |-----+
| | ciphertext | |
| | | |
| | | |
| +---------------+ |
| |
| .- +-----+ |
| | | +--+--> sframe_key ----->| Key
| | | KID | | |
| | | | +--> sframe_salt --+ |
+->+ +-----+ | |
| | | +---------------------+->| Nonce
| | | CTR | |
| | | | |
| '- +-----+ |
| |
| +----------------+ |
| | metadata | |
| +-------+--------+ |
| | |
+------------------+----------------->| AAD
|
AEAD.Decrypt
|
V
+---------------+
| |
| |
| plaintext |
| |
| |
+---------------+
~~~~~
{: title="Decryption flow" }

## Cipher Suites

Each SFrame session uses a single cipher suite that specifies the following
Expand Down

0 comments on commit 1e49e47

Please sign in to comment.