https://github.com/salif/hasher
Library and cli tool for password hashing
https://github.com/salif/hasher
argon2 argon2-library argon2-password-hashing argon2id command-line-hashing-tool command-line-tool default-parameters easy-hashing easy-to-use go golang golang-library hash hasher hashing password password-hash password-hasher salting verify
Last synced: 8 months ago
JSON representation
Library and cli tool for password hashing
- Host: GitHub
- URL: https://github.com/salif/hasher
- Owner: salif
- License: mit
- Created: 2020-05-10T18:05:09.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-12-12T14:15:10.000Z (10 months ago)
- Last Synced: 2024-12-29T10:13:46.582Z (9 months ago)
- Topics: argon2, argon2-library, argon2-password-hashing, argon2id, command-line-hashing-tool, command-line-tool, default-parameters, easy-hashing, easy-to-use, go, golang, golang-library, hash, hasher, hashing, password, password-hash, password-hasher, salting, verify
- Language: Go
- Homepage: https://pkg.go.dev/salif.eu/go/hasher
- Size: 24.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hasher
Library and cli tool for password hashing
The hashing algorithm is Argon2id.
The result is:
* Hash: hexadecimal string with length of **64**
* Salt: hexadecimal string with length of **32**
* Version: int## Usage
### Get
```sh
go get -u salif.eu/go/hasher
```### Import
```go
import (
"salif.eu/go/hasher"
)
```### Hash
```go
var password = "password"
var hash, salt, version = hasher.Hash(password)
// save hash, salt and version to database
```### Verify
```go
var password = "password"
// get hash, salt and version from database
var ok = hasher.Verify(password, hash, salt, version)
if ok {
// The password is correct
}
```## CLI tool
### Install
```sh
go get -u salif.eu/go/hasher/cmd/hasher
```### Hash
```sh
echo -n "password" | hasher
```#### or
```sh
hasher "filename"
```### Verify
```sh
echo -n "password" | hasher "hash" "salt" 2
```#### or
```sh
hasher "filename" "hash" "salt" 2
```## License
This library is licensed under the [MIT](./LICENSE) license