Skip to content

mohamedabadee/crypt

Repository files navigation

🔒 Crypt: Convenient Password Hashing Library in Go

Welcome to the Crypt repository! This library provides an easy and efficient way to handle password hashing in Go. With a focus on security and simplicity, Crypt allows developers to integrate password hashing seamlessly into their applications.

Table of Contents

Introduction

In today’s digital world, securing user passwords is crucial. The Crypt library offers a straightforward solution for hashing passwords using industry-standard algorithms. Whether you are building a web application, mobile app, or any service that requires user authentication, Crypt provides the tools you need to protect user data effectively.

Features

  • Easy to Use: Simple API for hashing and verifying passwords.
  • Secure Algorithms: Supports modern hashing algorithms to ensure maximum security.
  • Customizable: Options to configure hashing parameters based on your needs.
  • Lightweight: Minimal dependencies for faster performance.

Installation

To install the Crypt library, use the following command:

go get github.com/mohamedabadee/crypt

This command fetches the library and makes it available for use in your Go projects.

Usage

Here’s a quick example of how to use the Crypt library to hash and verify passwords:

package main

import (
    "fmt"
    "github.com/mohamedabadee/crypt"
)

func main() {
    password := "mySecurePassword"

    // Hash the password
    hashedPassword, err := crypt.HashPassword(password)
    if err != nil {
        fmt.Println("Error hashing password:", err)
        return
    }

    fmt.Println("Hashed Password:", hashedPassword)

    // Verify the password
    isValid := crypt.VerifyPassword(hashedPassword, password)
    if isValid {
        fmt.Println("Password is valid!")
    } else {
        fmt.Println("Invalid password.")
    }
}

This example demonstrates how to hash a password and verify it. Adjust the code as necessary to fit your application.

API Reference

HashPassword

func HashPassword(password string) (string, error)
  • Parameters:
    • password: The plain text password to hash.
  • Returns:
    • A hashed password as a string.
    • An error if the hashing fails.

VerifyPassword

func VerifyPassword(hashedPassword, password string) bool
  • Parameters:
    • hashedPassword: The hashed password to verify against.
    • password: The plain text password to check.
  • Returns:
    • A boolean indicating whether the password is valid.

Contributing

We welcome contributions! If you want to help improve the Crypt library, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes.
  4. Submit a pull request with a clear description of your changes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Releases

For the latest releases, visit Releases. Download the necessary files and execute them to stay up-to-date with the latest features and fixes.

You can also check the "Releases" section for more information on updates and changes to the library.

Badges

Latest Release

Additional Resources

  • Documentation: Refer to the official Go documentation for more details on the Go programming language.
  • Security Best Practices: Always follow security best practices when handling user passwords, including using strong hashing algorithms and salting.

Community

Join our community for discussions, updates, and support. Connect with us on:

  • GitHub Issues: Report bugs or request features.
  • Discussion Forum: Share your experiences and tips with other users.

Conclusion

The Crypt library is designed to make password hashing simple and secure. By following the guidelines provided in this README, you can easily integrate Crypt into your projects and enhance your application's security.

For more information, visit the Releases page and explore the latest updates.