I was wondering why even for the same username and the same password, htpasswd outputs a new hash everytime? I tried finding an answer to this question, but couldn't.
More than one user can theoretically have the same password, although if they do, that usually indicates that both users have picked a bad password. A username can be any sequence of characters you want (with some exceptions), and does not necessarily correspond to a real person's name.
A username is almost always paired with a password. This username/password combination is referred to as a login, and is often required for users to log in to websites. For example, to access your e-mail via the Web, you are required to enter your username and password.
Password-based authentication Also known as knowledge-based authentication, password-based authentication relies on a username and password or PIN. The most common authentication method, anyone who has logged in to a computer knows how to use a password.
Step 1 – A user visits a site and fills in a form to create their username and password. Step 2 – That password is put through a hash function and the hash is stored in the database. Step 3 – When a user logs in they enter their password again on the site.
The passwords generated by "htpasswd" use a random salt, to make it harder to guess. It also means that pre-crypted dictionaries for attacks have to be much larger since they have to crypt every possible password with every possible salt.
htpasswd uses crypt(3) behind the scenes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With