-
Notifications
You must be signed in to change notification settings - Fork 510
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
Enhancement Request: Add usedforsecurity
Argument to Hash Functions to Indicate Security Context Usage
#790
Comments
Thanks for pointing out the existence of this flag in the standard lib - I didn't realize it was added back in 2020 ... Still, I am not convinced and will not implement the proposal, because I don't agree it is a good idea in the first place.
|
Thanks for your prompt response. As you mentioned:
|
|
Hello,
Thank you for maintaining the Python cryptographic library.
I am a research student with an interest in cryptographic engineering. Recently, we developed a Cryptographic APIs Misuse Detector to identify potential misuses. We have also adapted our rules for the mainstream
pycryptodome
library. In comparing the use of insecure hash functions between thepycryptodome
library and thehashlib
standard library, we identified numerous misuses in real-world applications. Unfortunately, unlike thehashlib
standard library, thepycryptodome
library does not have a keyword-only argument likeusedforsecurity
to explicitly indicate whether it is used in a security context. I believe it would be beneficial to consider adding this feature. As a reference, in the official library, there is a set keyword-only argument usedforsecurity with the default valueTrue
. A false value allows the use of insecure and blocked hashing algorithms in restricted environments.Reference: hashlib
Usage
I am grateful for your dedication to the cryptographic library. If this enhancement is considered, I would be delighted to contribute to the Python cryptographic library.
Thank you for your time and consideration.
The text was updated successfully, but these errors were encountered: