0
$\begingroup$

As far as I know JWE (JSON Web Encryption) supports both integrity and confidentiality. I agree about the confedintiality because only the recepient with a private key can decrypt a message. What about the integrity? Given that the Content encryption key is encrypted using a public key, anyone (who knows the public key) can generate JWE and receipent won’t know for sure whether its coming from the specific sender.

Can a sender somehow sign the JWE using its own private key (note that this another key pair) so that the recipient can verify the integrity?

$\endgroup$
2
  • 1
    $\begingroup$ To answer my question it is possible to nest JWS and JWE which will provide both confidentiality and integrity. $\endgroup$ Nov 26 '20 at 23:41
  • 1
    $\begingroup$ Beware that signatures can be replaced by other signatures. In other words, an adversary with a trusted key pair can replace the signature or put a signature on another document with impunity. So it is important if you encrypt-then-sign to only trust one key or a limited set of keys... $\endgroup$
    – Maarten Bodewes
    Nov 27 '20 at 11:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.