-
-
Notifications
You must be signed in to change notification settings - Fork 680
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
Cryptography, proposed modification to 6.6.4 related to (second) pre-image attacks #2500
Comments
I would have some homework to do to have a better understanding on this topic :) This may not very easy to understand for the casual reader. Can we give some concrete examples? |
I leave this up to @danielcuthbert's judgement, I am not sure about this one. |
Wouldn't MD5 be a very relevant example here? |
So @unprovable do you agree with this wording update? |
I think the wording works. One could maybe make it slightly simpler but then we are splitting atoms and we could, if needed, add a more basic english option to the Appendix |
@randomstuff please can you open a PR? |
OK, I realize I am still trying to understand this. 😄
|
From this wording, I understand that there are use cases where having 128 bit hash output in digital signatures would be OK/allowed and some cases where it would be required to have 256 bits instead. Is that right? However, the casual reader that I am is left wondering in which cases (in practice) it would be OK to only be (second) pre-image resistant. Can we come up with practical examples of both cases? Moreover the only secure hash algorithms which are allowed are 256 bits or more with the exception of SHA-1 which is only approved as part of HMAC-SHA-1. In practices, which algorithm with less than 256 bit output would I use to be conformant to this requirement? SHA-1? Truncated SHA-256? |
One case that I am thinking of is OpenID connect In practice, when using HS256, RS256 or ES256, the hash algorithm is SHA-256 so these claims would contain 128-bit truncations of SHA-256 hashes. Would that be allowed by this requirement? Question: Do we need to make it clear that truncation of approved hash functions is OK? Is it always the case? Question: I think, that in this example we are in the case where (second) pre-image attack resistance is required? Because the access token and code are generated by the issuer?
Question: Should that also apply to MAC as well? (eg. JWS with MAC) |
I think we should steer people away from any use of SHA-1 and/or hash truncation. They are only to be used in very specialized and legacy situations.
There really is no need for SHA-1 in new development. There are better alternatives.
|
@jmanico - @randomstuff is stalking about OpenID which is very much a modern protocol that uses hash truncation. It's still a common practice and if done properly, not a problem whilst allowing for mixing different hash sources. @randomstuff - for the hashes I recall are in OpenID, they are all longer than 128 bit which helps when you truncate it down to that length. The fact that there are two hashes being truncated (I think?) maintains the resistance to pre-image (as you'd have to bruteforce two halves of two different hashes). Bart may know of a formal proof of this. |
In my opinion, if there is just "There are better alternatives" - it is not a valid reason to have a requirement to disallow using it. If we have a requirement to disallow it, it must be clear for developers and testers, that if they have it in use, why they need to make the change or what risk they have if they don't do so. |
SHA-1 is deprecated. It shouldn't be used, and I think this NIST article has links that cover the main reasons why. |
OK, my initial was to clarify this part of the proposed wording:
Questions which I think are not clear:
|
Shall we move the SHA-1 discussion out of here (#2551) because I don't think that's the main topic here? |
Yes, the hash is output is always at least 256 bit so the truncation is always at least 128 bit.
You often/usually only have |
I respectfully disagree. SHA-1 has known weaknesses, and there are better alternatives with superior performance characteristics. The collision vulnerabilities, such as those demonstrated by the SHAttered attack, are not theoretical—they are real. There is no compelling reason to use SHA-1 in new development, and I believe we should guide developers away from it. Rather than outright disallowing it, I recommend focusing on requirements that promote the use of secure hashes and MACs, rather than simply listing what not to use. |
This is for a major protocol with a large team of professional cryptographers. I would not suggest that developers building web apps and API's to do the same. It's a technique that can go badly fast if used incorrectly. |
Thank you for this comment. It's exactly the point I am trying to make and appreciate you chiming in. :) |
Your willingness to just oppose me is amazing. With what do you disagree? That a requirement need to be based on facts? Context, gentelmans, context. I was pointing out the expectations for a requirement. The requirement can not stand on the quoted phrases ("There are better alternatives") and expects to have better arguments. |
Very strongly agree! But to this point, wouldn't writing such cryptographic code violate 6.2.2? this may be a digressing point, apologies. |
Your willingness to just oppose me is amazing. With what do you disagree? That a requirement need to be based on facts?
This is not personal. Stick to the technical discussion please. This is not about you, at all. I’m saddened to see you think it’s about you when it’s clearly not. It’s about SHA-1. Again Elar, this is not about you and it never was.
I disagree with any requirement that encourages the use of SHA-1 in any way. That's my opinion. You don't have to agree. But it's my opinion based on NIST guidelines and the published hash collisions years ago regarding SHA-1.
|
Very strongly agree! But to this point, wouldn't writing such
cryptographic code violate 6.2.2? this may be a digressing point, apologies.
I agree that hash mixing or hash truncation or similar really does
violate 6.2.2
|
OK, I think we have moved SHA-1 discussion to #2551 @randomstuff where are we with this specific requirement? |
Current:
Proposed by Bart Preneel:
The text was updated successfully, but these errors were encountered: