From f939fc149896dc8d7c19808eb34e0de6ac7f7b53 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 26 Mar 2026 09:12:37 +0000 Subject: [PATCH] fix: resolve CodeQL alert #17 - Use of a broken or weak cryptographic hashing algorithm on sensitive data --- vulnerable_weak_crypto.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vulnerable_weak_crypto.py b/vulnerable_weak_crypto.py index 5b8aca6..b12ee27 100644 --- a/vulnerable_weak_crypto.py +++ b/vulnerable_weak_crypto.py @@ -34,7 +34,8 @@ def weak_random_key(): class PasswordHasher: def hash(self, password): - return MD5.new(password.encode()).hexdigest() + from Crypto.Hash import SHA256 + return SHA256.new(password.encode()).hexdigest() def verify_password(input_password, stored_hash): input_hash = hashlib.md5(input_password.encode()).hexdigest()