When implementing JSON Web Encryption (JWE), I understand the reasons why you might choose A256KW over DIR. But, now I notice there is also A256GCMKW as an optional part of the JWE standard (see RFC7518 page 19 which defines it in detail, and also page 13 where it is declared to be Optional – RFC7518 is JSON Web Algorithms (JWA), while JWE is defined in RFC7516 which incorporates JWA by reference.)
I can see some obvious disadvantages A256GCMKW has compared to A256KW:
- As an optional part of the standard, some JWE implementations will not support it
- It is going to impose an additional performance cost (although, depending on your use case, this might not be significant in practice)
But, I'm assuming for it to be standardised it must have some advantage over A256KW in some scenario – what is that advantage?
Note (if it matters) I was planning to use A256GCM content encryption with A256KW key algorithm. The combination of A256GCMKW + A256GCM would provide two layers of authenticated encryption – while I can't see how that could hurt, is it adding complexity for little or no real value?