Fixed Symmetric Key Encryption/Decryption#12
Fixed Symmetric Key Encryption/Decryption#12wendtr wants to merge 7 commits intoDemonware:masterfrom
Conversation
…c encryption/decryption(AESCBC) or to use Asymmetric encryption/decryption (RSA)
|
@wendtr This is not right way to do it. |
|
Right after sending that pull request we realized we implemented everything poorly, and that it did not satisfy any of the algorithms supported by JWE. What we were looking to do was use Direct Symmetric Encryption (RFC 7518, Section 4.1, 4.5). I believe our current implementation of Direct Encryption implements this. The code is not implemented in the best way (uses an If-Else statement), but it could be cleaned up possibly. |
So I noticed that symmetric key encryption was not working, even though the functions existed. This fix that I put in isn't necessarily the greatest, but it allows you to use the AES encryption/decryption functions for CEK. I know this might not necessarily be the best way to do so, but it is currently a quick fix for anyone who wants to use symmetric crypto with your library.
In addition, I created a simple test in the test suite.
sregister is the other contributor to this, although it may not reflect so in the commits.