Skip to content

Potential fix for code scanning alert no. 1: Use of a broken or weak cryptographic hashing algorithm on sensitive data #5

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ModusOperandom
Copy link
Owner

Potential fix for https://github.com/ModusOperandom/skills-introduction-to-repository-management/security/code-scanning/1

To fix the issue, we need to replace the insecure hashlib.sha256 hashing function with a secure password hashing algorithm. The best approach is to use a library like argon2-cffi, which implements the Argon2 password hashing algorithm. Argon2 is computationally expensive, includes built-in salting, and is specifically designed for password hashing.

Steps to fix:

  1. Install the argon2-cffi library if it is not already installed.
  2. Replace the hash_password function to use Argon2 for hashing passwords.
  3. Update the login function to verify the password using Argon2's verify method instead of directly comparing hashed values.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…cryptographic hashing algorithm on sensitive data

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant