Using htpasswd
The Apache2 utilities provide a tool called htpasswd
. Create bcrypt-hashs using this tool.
Example command and output to generate the hash for string “plainpassword”:
$ htpasswd -nbBC 10 USER plainpassword
USER:$2y$10$1J2BG6LJYImEcZVRxXn1TOs9iRKLvJvWWSf5/AE5ZOaWUlmZxQJsa
Hint: On Linux systems apache2-utils can be installed using the installed package manager. Probably administrative privileges are required, so the sudo
command may be required.
Example command when using apt
package manager:
apt install apache2-utils
Using Autodigit Password Encoder
kgs provides a little tool to generate bcrypt-Hashs for Java. Therefore this utility can be used in both Windows and Linux environments.
Please find the utility here for download:
Inorder to generate a password hash via Java from Windows command line or Linux terminal, go into the directory containing the jar-file downloaded before and execute this command:
java -jar autodigit-password-encoder.jar <password>