Deterministic password generator using a chained hash pipeline.
- Shell 100%
| about | ||
| install | ||
| keygen | ||
| LICENSE | ||
| README.md | ||
| VERSION | ||
keygen
Deterministic password generator using a chained hash pipeline.
Description
keygen is a minimal shell script that generates deterministic passwords and hashes from stdin input using a chained pipeline of standard Unix hash utilities:
md5sum → sha1sum → sha224sum → sha256sum → sha384sum → sha512sum → base64
Designed for use in automated encryption workflows where reproducible key derivation from a known secret is required — no external dependencies beyond standard coreutils.
Usage
printf 'secret' | keygen [OPTIONS]
echo 'secret' | keygen [OPTIONS]
keygen [OPTIONS] # prompts for input interactively
Options
| Option | Description |
|---|---|
hash |
Output raw hash instead of base64-encoded password |
-s |
Inject special characters (!@#%) every 5 characters |
N |
Truncate output to N characters (default: 500) |
Examples
# Generate a password from a secret (piped)
printf 'mysecret' | keygen
# Interactive input (prompts for text)
keygen
# Generate a shorter password (32 chars)
printf 'mysecret' | keygen 32
# Generate a password with special characters
printf 'mysecret' | keygen -s 32
# Output raw hash only
printf 'mysecret' | keygen hash
# Use as key derivation in a script
key=$(printf '%s\n' "$disk_id" | keygen 64)
Dependencies
md5sum,sha1sum,sha224sum,sha256sum,sha384sum,sha512sum— coreutilsbase64— coreutilsawk,cut— standard Unix tools
Security Notes
- Output is fully deterministic: same input always produces same output
- No state, no files, no network — runs entirely in memory
- Intended for use in pipelines where the input secret is already protected
- Do not use with weak or short secrets