64 lines
2.7 KiB
Bash
64 lines
2.7 KiB
Bash
# secret config — source'd by the secret command
|
|
# Location: ~/.config/himi/config.sh
|
|
|
|
# Schema version — himi nags if this is older than what it expects.
|
|
# After merging new options into an existing config, bump this to match.
|
|
CONFIG_VERSION=2
|
|
|
|
# ------------------------------------------------------------------------------
|
|
# Character sets for random portions
|
|
# ------------------------------------------------------------------------------
|
|
# Crockford Base32 (32 chars, 5.0 bits/char)
|
|
ALPHA_CHARSET='0123456789ABCDEFGHJKMNPQRSTVWXYZ'
|
|
# Ultra-safe - no easily confused characters (24 chars, 4.6 bits/char)
|
|
SAFE_CHARSET='ACDEFGHJKMNPQRTWXY234679'
|
|
NUM_CHARSET='0123456789'
|
|
SPECIAL_CHARSET='!?@#%~=+'
|
|
|
|
# ------------------------------------------------------------------------------
|
|
# Custom charsets (optional)
|
|
# Format: "name|characters" — use as {name:N} or {name:N-M} in templates.
|
|
# Names: lowercase, matching [a-z][a-z0-9_]*. Entries here override the
|
|
# built-in four. Avoid duplicate characters (skews the distribution).
|
|
# ------------------------------------------------------------------------------
|
|
CHARSETS=(
|
|
# "hex|0123456789abcdef"
|
|
# "b58|123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
|
|
)
|
|
|
|
# ------------------------------------------------------------------------------
|
|
# Word filtering (applied when building pool.txt)
|
|
# ------------------------------------------------------------------------------
|
|
WORD_MIN_LENGTH=4
|
|
WORD_MAX_LENGTH=9
|
|
|
|
# ------------------------------------------------------------------------------
|
|
# Templates
|
|
# Format: "name|pattern"
|
|
#
|
|
# Tokens:
|
|
# {word} — random word (lowercase)
|
|
# {WORD} — random word (UPPERCASE)
|
|
# {Word} — random word (Title Case)
|
|
# {word!} — random lower or UPPER (+1 bit entropy)
|
|
# {Word!} — random lower/Title/UPPER (+1.58 bits entropy)
|
|
# {NAME:N} — N chars from charset NAME
|
|
# built-in: alpha safe num special hex b58 b64 alnum ascii
|
|
# {NAME:N-M} — N to M chars, weighted so every output is equally likely
|
|
# (entropy = log2 of total outcomes, e.g. {num:1-2} ≈ 6.8 bits)
|
|
# ------------------------------------------------------------------------------
|
|
TEMPLATES=(
|
|
"default|{word!}{num:2}-{word!}{num:2}-{alpha:3}{num:2}"
|
|
"easy|{word}-{alpha:3}-{num:3}"
|
|
"secure|{word}-{word}-{alpha:5}-{word}-{alpha:5}{special:1}"
|
|
"pin|{num:6}"
|
|
"diceware|{word}-{word}-{word}-{word}-{word}"
|
|
"wifi|{word!}-{word!}{num:4}"
|
|
"phone|{safe:4}-{safe:4}-{safe:4}"
|
|
)
|
|
|
|
# ------------------------------------------------------------------------------
|
|
# Default template (used when no template name specified)
|
|
# ------------------------------------------------------------------------------
|
|
DEFAULT_TEMPLATE="default"
|