-
Notifications
You must be signed in to change notification settings - Fork 463
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
Marked HMAC SHA based algorithms as insecure and obsolete #384
Conversation
Question about this commit: Can you provide industry evidence that I can present to my colleagues and supervisors that describe the knowledge of the HMAC SHA algorithms becoming obsolete? |
I'm not an industry-recognized expert so take my opinion as just a yet another opinion. Azure AD uses RS256 too:
|
I found JWT Handbook (v0.14.1) that looks reliable because it's linked from https://jwt.io/introduction, and it says:
In my understanding, asymmetric encryption algorithms are basically more robust than HMAC but HMAC SHA-256 with a strong secret is also sufficiently safe and is not discouraged. How about you, @abatishchev? |
Empirically, I would say that hashing should be faster than encrypting. But googling quickly shows that it's not necessarily the case. The question you're raising is complex so is the answer to it. The only quick answer which is correct would be "it depends". Depends on the algorithm and the scenario. Generally speaking, hashing is less secure than encryption. Strong hashing is strong, weak encryption is weak. But in common scenarios where JWT is used, such as securing the communication between a client and a server over HTTP, asymmetric algorithm is the preferred choice. But after reading up, you conclude that |
OK, so I'd like to suggest that if you are not of the opinion that all HMAC SHA algorithms are considered insecure by the public, then the wording would be better modified. The current sentence "HMAC SHA based algorithms are not secure" seems to make a general statement that HMAC SHA is no longer a secure algorithm. If this message is intended as a guide to using JWT, it would be desirable to provide references to support this statement (the JWT Handbook might be a good place to start). Also, moving the comment from the Obsolete attribute to the class comment would be a good idea. I believe the Obsolete attribute implies that the symbol can be removed in the near future. Since the user cannot determine whether the reason for the removal is due to security issues or API design reasons, questions such as #470 can arise. |
When I'm trying to use
Which makes me think I'm doing something wrong, when in reality this algorithm is completely fine for a lot of common applications. |
Hi @Akronae, |
@abatishchev HMAC SHA seems valid to me for most applications who do not need state of the art encryption, who are not likely to be the target of highly sophisticated attack by a foreign government or any other entity having a big enough computing grid at their disposal. That is to say 99% of the applications out there. For the first part, from the official Microsoft documentation, there seems to be no indication that HMAC SHA is flawed or insecured. For the second part, browsing the web I was not able to find anything consistent or relevant pointing out that HMAC SHA is not secure For the third part, jwt.io itself uses HMAC SHA 256 on their playground, although this is not a proof, if this algorithm should be discouraged, one could assume that it would not be the default algorithm to be used in this playground. Even from your original response to @jennaramsey, reading the anwser you linked, I cannot find any guidance arguing against HMAC SHA (am I reading right?)
I really cannot grasp this PR, I'm not well versed with cryptography so I might be mixing things up here. I'm sorry if I do. |
* Reverted #384. * Bumped version to 10.1.0 * Updated changelog
No description provided.