Minimal command-line tool for scrypt key derivation (RFC 7914).
Reads a passphrase from stdin, normalizes whitespace, derives a key using scrypt, and outputs the result in hex, base64, and/or BIP39 mnemonic format.
Credit to w3rs/kdftool which this tool is originally based on.
cargo install --path .Download a pre-built binary from the Releases page.
echo "my passphrase" | scrypt-rs [OPTIONS]| Flag | Long | Default | Description |
|---|---|---|---|
-S |
--short |
Output only the hex-encoded derived key | |
-s |
--salt |
"" |
Salt string |
-L |
--logn |
19 |
log₂(N) — CPU/memory cost parameter |
-r |
8 |
Block size parameter | |
-p |
2 |
Parallelization parameter | |
-l |
--len |
16 |
Derived key length in bytes |
Short output (hex only):
echo "my secret passphrase" | scrypt-rs -S -s "my salt" -L 14 -r 8 -p 1 -l 32Full output (shows all input parameters + hex, base64, and BIP39):
echo "my secret passphrase" | scrypt-rs -s "my salt" -L 14 -r 8 -p 1 -l 32Example full output:
Input | Salt: "my salt"
Input | Normalized passphrase: "my secret passphrase"
Input | Scrypt parameters: cost factor 14 - blocksize 8 - parallelization 1 - key length in bytes 32
Output| Scrypt derived key in hexadecimal: <hex>
Output| Scrypt derived key in base64: <base64>
Output| Scrypt BIP39 words list representation: <24 words>
BIP39 mnemonic generation requires the derived key length to be one of: 16, 20, 24, 28, or 32 bytes. Other lengths will show "Unable to generate words list".
cargo build --releasecargo fmt # format code
cargo clippy # lint
cargo test # run all tests