About pw - The Mosquitto-Go-Auth Password Generator
===================================================
pw is a command-line tool used to generate password hashes in a format compatible with Mosquitto-Go-Auth.
This tool is especially useful when you're configuring your Mosquitto MQTT broker to use mosquitto-go-auth for authentication and authorization,
and you need to hash user passwords according to the algorithm and parameter settings your Mosquitto configuration expects.

The tool supports several hashing algorithms, including PBKDF2, Argon2, and Bcrypt,
and allows you to specify parameters such as salt size, number of iterations, key length, and the hashing algorithm (e.g., SHA256 or SHA512 for PBKDF2).
The generated hash string includes all the necessary information for mosquitto-go-auth to correctly verify the password.

---

Usage with DM90i
----------------
This tool is used to hash the password if you want to manually add a new MQTT user or change the password of an existing user.

Usage with default DM90i configuration of Mosquitto:
./pw -h pbkdf2 -s 16 -i 100000 -l 64 -a sha512 -p PASSWORD_TO_HASH

It is important to use the parameters as described above unless you also change the Mosquitto configuration and
also re-hash the passwords for the existing MQTT users with the new parameters.

---

Full parameter description
--------------------------
  -a string
      algorithm: sha256 or sha512 (default "sha512")
  -c int
      bcrypt ost param (default 10)
  -e string
      salt encoding (default "base64")
  -h string
      hasher: pbkdf2, argon2 or bcrypt (default "pbkdf2")
  -i int
      hash iterations: defaults to 100000 for pbkdf2, please set to a reasonable value for argon2 (default 100000)
  -l int
      key length, recommended values are 32 for sha256 and 64 for sha512
  -m int
      memory for argon2 hash (default 4096)
  -p string
      password
  -pl int
      parallelism for argon2 (default 2)
  -s int
      salt size (default 16)
