This repository was archived by the owner on Feb 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 275
A256CBC_HS512 and AuthTag length #206
Labels
Comments
Hi @tommyseus, that's looks like a bug indeed! According to RFC 7518 Section 5.2.5 the auth tag length should indeed be the key size. I can make a quick pull request to fix this. |
csstaub
added a commit
that referenced
this issue
Nov 20, 2018
The auth tag len for AES-CBC+HMAC algorithms should match the key size, see RFC 7518 Section 5.2.4 and Section 5.2.5. Unfortunately this will (as-is) cause problems with decrypting AES-CBC+HMAC ciphertexts that were encrypted with this library that used 192-bit and 256-bit key sizes. A future pull request could add a flag to add some sort of compabitility flag to allow for decryption to continue working for those cases.
See: #207 |
The pull request above will fix the issue, but in the meantime I would recommend using AES-128-GCM (or AES-128-CBC-HMAC) as a cipher. GCM is superior to CBC+HMAC, and a 128-bit key is sufficient for all practical use-cases. |
Fix is in 2.2.0, please reopen if you continue to experience issues @tommyseus. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello, i have a problem with the generated token and a php jwt lib.
This code will create a raw string with a short auth tag (D2IoqyKAhOnv_5_mKB3PbQ):
It is not possible to use this token with the following php script. The php code throws a exception (the exception is ignored) and the payload is empty.
Exception: InvalidArgumentException: Unable to verify the tag.
I think the problem is auth tag is to short. If i change the harcoded authtagBytes to the keysize value (32) then everythink works.
go-jose/symmetric.go
Lines 103 to 111 in 9ab2713
Would be nice if someone could check the value for authtagBytes.
The text was updated successfully, but these errors were encountered: