Library for easy hashing passwords in Golang https://salifm.github.io/hasher
Go to file
Salif Mehmed f2721dcd7c
change salt length from 16 to 32 and use constant-time hash comparison
2020-05-12 13:54:09 +03:00
cmd/hasher change salt length from 16 to 32 and use constant-time hash comparison 2020-05-12 13:54:09 +03:00
.gitignore Initial commit 2020-05-10 21:05:10 +03:00
go.mod change salt length from 16 to 32 and use constant-time hash comparison 2020-05-12 13:54:09 +03:00
go.sum change salt length from 16 to 32 and use constant-time hash comparison 2020-05-12 13:54:09 +03:00
hasher_test.go change salt length from 16 to 32 and use constant-time hash comparison 2020-05-12 13:54:09 +03:00
hasher.go change salt length from 16 to 32 and use constant-time hash comparison 2020-05-12 13:54:09 +03:00
LICENSE Initial commit 2020-05-10 21:05:10 +03:00
README.md change salt length from 16 to 32 and use constant-time hash comparison 2020-05-12 13:54:09 +03:00

hasher

Library for easy hashing and verifying passwords.

Hashing algorithm is Argon2id.

The parameters are:

  • Memory: 65536 B
  • Iterations: 1
  • Parallelism: 4
  • Salt length: 32

Usage

Import

import (
    "github.com/salifm/hasher"
)

Hash

var password string = "password"
hash, salt, err := hasher.Hash(password)
// save hash and salt to database

Verify

var password string = "password"
// get hash and salt from database
match, err := hasher.Verify(password, hash, salt)
if match {
    // The password is correct
}

License

This library is licensed under the MIT license