Closed TelegramSam closed 2 years ago
Wait, wait. I AM saying that we send one envelope to 3 different devices that all belong to the same user. If that's not what Sam's saying then we have a very surprising misalignment.
IMO, it is NOT okay to send a different encryption envelope to each device. That defeats the whole goal of having multiplex encryption.
Wait, wait. I AM saying that we send one envelope to 3 different devices that all belong to the same user. If that's not what Sam's saying then we have a very surprising misalignment.
IMO, it is NOT okay to send a different encryption envelope to each device. That defeats the whole goal of having multiplex encryption.
JWE has 3 formats as described earlier:
Compact: the 5 .
separated base64URL encoded sections representing a JWE for a single recipient (1 key).
Flattened JSON: a JSON format of a JWE envelope for a single recipient (1 key) message.
These two formats support merging recipients[0].header
into the protected
section since there's only 1 recipient (to answer your original question: yes protected
is a special section representing the protect headers in a JWE envelope).
General JSON Format: The same format as Flattened JSON but with multiple recipients (multiple keys) each with its own headers in recipient[x].header
. Recipient headers usually include epk
, apu
, apv
, etc. These cannot be merged into the protected
headers common section of the JWE since each key has a unique key wrapping (and therefore ECDH-ES computation) of the cek (encrypted and set as recipient[x].encrypted_key
).
Needed: The encrypted form of a JWM is a JWE.
Add JWE, in the General JSON Format.
This was approved in the recent DIDComm WG on 20220516 pending a few modifications, which have been added. With those changes, it's ready for merging.
Signed-off-by: Sam Curren telegramsam@gmail.com Fixes #256
I'm not sure this is complete, in spite of filling the requirements in #256 Review is needed here for correctness.