Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

authentication tag mismatch #99

Closed
ravenet opened this issue Jul 17, 2018 · 11 comments
Closed

authentication tag mismatch #99

ravenet opened this issue Jul 17, 2018 · 11 comments

Comments

@ravenet
Copy link

ravenet commented Jul 17, 2018

Hi,

First I would like to thank for nice library, but When I use JWE to decrypt data, I am gettting above error.

my method,
MethodOne(string chiperText, JweAlgorithm algorithm = JweAlgorithm.RSA1_5, JweEncryption encryption = JweEncryption.A128GCM)
{

//Where I am passing data
Jose.JWT.Decode(chiperText.Trim(), keyHolderInfo.PrivateKey, algorithm, encryption)

}

Please advice why i am getting that error.

Thank you

@dvsekhvalnov
Copy link
Owner

Hi @ravenet ,

tag mismatch - usually means signature doesn't match payload. (E.g. corrupted or tampered).

For troubleshooting can you add little bit more info? Like example of token you trying to decode and keys? (Well assuming that's not production used keys).

@ravenet
Copy link
Author

ravenet commented Jul 17, 2018

Hi Dvsekhvalnov,
Thank you for your response, and I am using test RSA private key. let me send code then it easy to you see the issue.

https://gist.github.com/ravenet/46feeace86d683df90f3956aba96fe21

Here is all detail in code and please let me know if you require any more details.

Thank you

@dvsekhvalnov
Copy link
Owner

@ravenet , i'm getting same when trying to decode your nested encrypted token, it looks nested token is changed after encryption, that's why it is not passing. So:

  1. Can you show part that creates token (both nested and envelope)?
  2. Why you have that weird nested thing at all? What's point of signing encrypted token once more?

@ravenet
Copy link
Author

ravenet commented Jul 21, 2018

Hi,

Thank you and let me share with you and any idea why it is nested? and in test methods which one is suitable for this case.

Thank you

@dvsekhvalnov
Copy link
Owner

Sure @ravenet , go for it.

@dvsekhvalnov
Copy link
Owner

Closing due to inactivity. Feel free to reopen.

@Dhazan1
Copy link

Dhazan1 commented Jul 20, 2022

I'm encrypting, then immediately I'm decrypting, but I keep getting this error

Jose.EncryptionException: 'Unable to decrypt content or authentication tag do not match.'

@Dhazan1
Copy link

Dhazan1 commented Jul 20, 2022

This is the link to the code write-up

@Dhazan1
Copy link

Dhazan1 commented Jul 20, 2022

@dvsekhvalnov
Copy link
Owner

Hi @Dhazan1, mind open new ticket?

i'll try to take a look.

@Dhazan1
Copy link

Dhazan1 commented Jul 20, 2022

New ticket opened
#195

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants