# `OpenrelikWorkerCommon.PasswordUtils`
[🔗](https://github.com/hacktobeer/openrelik-worker-common-elixir/blob/v0.1.0/lib/openrelik_worker_common/password_utils.ex#L15)

Helper functions for password hash cracking (`openrelik_worker_common.password_utils`).

# `bruteforce_password_hashes`

```elixir
@spec bruteforce_password_hashes(
  [String.t()],
  String.t() | nil,
  String.t(),
  String.t(),
  pos_integer() | keyword(),
  String.t(),
  keyword()
) :: [{String.t(), String.t()}]
```

Bruteforces password hashes using Hashcat or John the Ripper (`john`).

## Parameters
* `password_hashes` - List of password hashes as strings.
* `tmp_dir` - Path to use as a temporary directory.
* `password_list_file_path` - Path to the password list file.
* `password_rules_file_path` - Path to the password rules file.
* `timeout` - Number of seconds to run before terminating the process (default `300`).
* `extra_args` - Any extra arguments to be passed to Hashcat (default `""`).
* `opts` - Optional keyword overrides for testing (`:which_fn`, `:cmd_runner`, `:pot_file`, `:fallback_password_list`).

## Returns
List of `{password_hash, plaintext}` tuples.

## Raises
`RuntimeError` if execution fails or required tools/wordlists are unavailable.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
