Skip to content

Implement password hashing using bcrypt #12

@volcodes

Description

@volcodes

Enhance the security of our Go application by implementing password hashing using the bcrypt package. This feature will ensure that user passwords are securely stored in the database, mitigating risks associated with plaintext password storage.

Acceptance Criteria:

  • Integrate the golang.org/x/crypto/bcrypt library for password hashing.
  • Create a utility function to hash passwords with bcrypt.
  • Passwords should be hashed using a sufficient cost parameter (e.g., bcrypt.DefaultCost).
  • Implement a utility function to compare plaintext passwords with hashed passwords for authentication purposes.
  • Update the user creation workflow to hash passwords before storing them in the database.
  • Ensure compatibility with existing test cases and write additional tests to validate password hashing and comparison.

Technical Notes:

  • Refer to the official Go documentation and best practices for bcrypt implementation.
  • Ensure the cost parameter is chosen for optimal security without impacting performance significantly.
  • Follow the existing project conventions for error handling and logging.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions