swadpw allows to create and edit password files for swad(8) to be used with its file credential checker. It uses bcrypt password hashes in flavors $2b$ or $2y$. They are internally the same, $2b$ is the default of OpenBSD's bcrypt implementation used by swad(8), while $2y$ is what Apache uses.
Files created by swadpw are fully compatible with Apache's .htpasswd format when the $2y$ hash flavor is chosen and no real names are given for users.
In the standard mode of operation, passwords are expected to be typed on a terminal. The terminal's local echo is disabled for typing a password, IOW, you can't see what you type. Therefore, you have to type the password twice to make sure it was typed correctly. The only way to correct typing errors is the "backspace" key, all other control characters aren't handled and will mess up what you typed.
The options are as follows:
Add a new user to the password file. Fails if the user already exists.
Always use the OpenBSD flavor for bcrypt hashes ($2b$).
Set the cost factor for newly created bcrypt password hashes. The time needed to hash a password grows exponentially with this factor. For sensible password security, a factor of at least 12 is recommended nowadays. Setting the factor too high will cause significant CPU load for every user login.
Delete the given user from the password file. Fails if the user doesn't exist.
Path to the password file to edit or create.
Print a help text and exit.
Set an optional real name name for the user added or edited.
Allow reading the password from plain standard input if not connected to a terminal. This is required to use swadpw in a pipe.
Print version information and exit.
Always use the Apache flavor for bcrypt hashes ($2y$).
The user to add or modify.
swad(8)