The beginning of the password contains a random salt(in a standardized format), and it changes every time you generate the password. But during verification, the code reads the salt from the hash and uses it with the submitted password to calculate the same hash.
See the description section here: https://en.m.wikipedia.org/wiki/Bcrypt
On Wed, Feb 20, 2019, 13:19 Michał Kaczanowicz <mj.kaczanowicz@gmail.com wrote:
My problem at the moment is - I checked several options for password hashing algorithm both with php and htpasswd and none of them matches value in db :( In my example user is judgehost and password is test, and hash stored in db is:
$2y$10$FdUtw5PKeM/7aLjt1QI3uOVW5l9u4dG0F9q2SBWixiMzLNqaym76q
What's more cryptic to me, I "changed" the password via web interface several time to the same "test" password and each time record in db changed its value. Perheps someone has an idea on how is that even possible?
Cheers, Michał
On Wed, Feb 20, 2019 at 9:03 AM Thijs Kinkhorst thijs@kinkhorst.com wrote:
Hi Michał,
On Tue, February 19, 2019 19:55, Michał‚ Kaczanowicz wrote:
My current task is to deploy domjudge - or more precisely, to create a "one click deploy" configuration. I aim to use docker images of domserver and domjudge. I'd like to accomplish my task using docker and docker compose. But here comes a slight problem. After setting up domserver, I need to set new password for judgehost user. Setup manual suggest to do it "by hand", via web interface on admin account. Is there a way to do that programatically, e.g. simply updating password for judgehost user in domjudge.user table? How is the hash computed?
Interesting project! Would be great if you could share the results!
You should be able to use PHP's password_hash() on the desired string like this:
$hash = password_hash("yourpasword", PASSWORD_DEFAULT);
Or on the command line:
htpasswd -bnB "" yourpassword|tr -d ":\n"
Cheers, Thijs _______________________________________________ DOMjudge-devel mailing list DOMjudge-devel@domjudge.org https://www.domjudge.org/mailman/listinfo/domjudge-devel
DOMjudge-devel mailing list DOMjudge-devel@domjudge.org https://www.domjudge.org/mailman/listinfo/domjudge-devel