bcrypt-tool
is a dandy CLI tool for generating and matching bcrypt hashes
Module github.com/shoenig/bcrypt-tool
provides a simple command line tool.
The bcrypt-tool
tool is available from the Releases page.
It is pre-compiled for many operating systems and architectures including
- Linux
- Windows
- MacOS
- FreeBSD
- OpenBSD
- Plan9
The bcrypt-tool
command can be installed as a snap
$ sudo snap install bcrypt-tool
The bcrypt-tool
command can be compiled by running
$ go get github.com/shoenig/bcrypt-tool
$ bcrypt-tool hash p4ssw0rd
$ bcrypt-tool hash p4ssw0rd 31
$ bcrypt-tool match p4ssw0rd $2a$10$nWFwjoFo4zhyVosdYMb6XOxZqlVB9Bk0TzOvmuo16oIwMZJXkpanW
note: depending on your shell, you may need to escape the $ characters
$ bcrypt-tool cost $2a$10$nWFwjoFo4zhyVosdYMb6XOxZqlVB9Bk0TzOvmuo16oIwMZJXkpanW
note: depending on your shell, you may need to escape the $ characters
bcrypt-tool [action] parameter ...
-
hash [password] <cost>
Use bcrypt to generate a hash given password and optional cost (4-31) -
match [password] [hash]
Use bcrypt to check if a password matches a hash -
cost [hash]
Use bcrypt to determine the cost of a hash (4-31)
The github.com/shoenig/bcrypt-tool
module is always improving with new features
and error corrections. For contributing bug fixes and new features please file an issue.
The github.com/shoenig/bcrypt-tool
module is open source under the MIT license.