Bcrypt-hash a password
• 66 words • 1 min • updated
⚠️ This post is over one year old. It may no longer be up to date or relevant. Opinions may have changed.
Given the password correct horse battery staple, we would like to bcrypt-hash
it.

XKCD Courtesy of Randall Munroe
Here’s one way to do so via the command line:
shell
$ htpasswd -nbBC 10 "" 'correct horse battery staple' | tr -d ':\n' | sed 's/$2y/$2a/'…which yields:
$2a$10$HKSHfLu4l7TvOmnLkhUngu2U1pJUUw7hEU0LE1iN84S09fJsZowHmYou could verify it matches e.g. via https://bcrypt-generator.com/.
Context: ArgoCD expects a bcrypt-hashed password in its config file.