argon2-cli 0.2.1

Generate Argon2 hashes from command line
# argon2-cli

Generate Argon2 hashes from command line

## Installation

```bash
cargo install argon2-cli
```

Or via [`cargo-binstall`](https://github.com/cargo-bins/cargo-binstall):

```bash
cargo binstall argon2-cli
```

## Usage

```bash
echo -n "password" | argon2
```

This CLI accepts the password via `stdin`, which avoids putting the password in shell history.

### Options

```
argon2 [-h] [salt] [-i|-d|-id] [-t iterations] [-m log2(memory in KiB) | -k memory in KiB] [-p parallelism] [-l hash length] [-e|-r] [-v (10|13)]
```

- `[salt]` Optional explicit salt; must be at least 8 characters long
- `-i` Use Argon2i (default)
- `-d` Use Argon2d
- `-id` Use Argon2id
- `-t` Number of iterations (default: 3)
- `-m` Memory usage of 2^N KiB (default: 12)
- `-k` Memory usage of N KiB (default: 4096)
- `-p` Parallelism threads (default: 1)
- `-l` Hash output length in bytes (default: 32)
- `-e` Output only encoded hash
- `-r` Output only raw bytes
- `-v` Argon2 version (default: 13)

## Examples

```bash
# Basic usage (random salt generated automatically)
echo -n "password" | argon2

# With explicit salt
echo -n "password" | argon2 somesalt

# Use Argon2id with custom parameters
echo -n "password" | argon2 somesalt -id -t 4 -m 16 -p 4

# Output only encoded hash
echo -n "password" | argon2 somesalt -e
```

## Compatibility

This CLI strives for interface compatibility with the [C reference implementation](https://github.com/P-H-C/phc-winner-argon2), but does not guarantee it. Deviations are made where the original interface significantly hinders usability. For example, the salt is optional in our implementation and a cryptographically secure random salt is generated by default. This CLI also accepts the password via `stdin`, unlike the standard Linux `argon2` CLI, which helps avoid leaking passwords into shell history.

## License

MIT