-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fardin #2
Fardin #2
Conversation
Co-authored-by: Ville Brofeldt <[email protected]>
…pache#31037) Co-authored-by: Maxime ALAY-EDDINE <[email protected]>
pull upgraded codes
Co-authored-by: ochalover <[email protected]>
@@ -21,7 +21,7 @@ | |||
|
|||
|
|||
def md5_sha_from_str(val: str) -> str: | |||
return hashlib.md5(val.encode("utf-8")).hexdigest() | |||
return hashlib.md5(val.encode("utf-8")).hexdigest() # noqa: S324 |
Check failure
Code scanning / CodeQL
Use of a broken or weak cryptographic hashing algorithm on sensitive data High
Sensitive data (certificate)
Sensitive data (certificate)
Sensitive data (certificate)
Sensitive data (certificate)
Sensitive data (certificate)
Sensitive data (certificate)
Sensitive data (certificate)
Sensitive data (id)
Sensitive data (id)
Sensitive data (id)
Sensitive data (id)
Sensitive data (id)
Sensitive data (id)
Sensitive data (id)
Sensitive data (id)
Sensitive data (id)
Sensitive data (certificate)
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 15 days ago
To fix the problem, we need to replace the use of the MD5 hashing algorithm with a stronger cryptographic hash function. In this case, we can use SHA-256, which is a secure and widely recommended hash function.
- Replace the
hashlib.md5
function withhashlib.sha256
in themd5_sha_from_str
function. - Ensure that the rest of the code remains unchanged to maintain existing functionality.
-
Copy modified line R24
@@ -23,3 +23,3 @@ | ||
def md5_sha_from_str(val: str) -> str: | ||
return hashlib.md5(val.encode("utf-8")).hexdigest() # noqa: S324 | ||
return hashlib.sha256(val.encode("utf-8")).hexdigest() # noqa: S324 | ||
|
No description provided.