diff options
| author | tslil clingman <> | 2019-04-09 22:16:57 -0400 |
|---|---|---|
| committer | tslil clingman <> | 2019-04-09 22:16:57 -0400 |
| commit | 1e32cf0116d816dc64f744ed8812aa5a2a850f1e (patch) | |
| tree | 9ab4805e52054a601c2bd2bc6c901072f4add22c /badpass | |
| parent | d3c79596d15feb7d3c435636535fa6911df0f96e (diff) | |
tweaks + "docs"
Diffstat (limited to 'badpass')
| -rwxr-xr-x | badpass | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -1,9 +1,13 @@ #!/bin/sh -# Requires expect +# A bad password derivation scheme, hopefully portable. +# Requires `expect' to enable `keychain' key unlocking. +# Read source for detail. -PREFIX="THIS IS TOTALLY SUPER SECRET" -PHRASE="THIS IS TOTALLY SUPER SECRET" +PREFIX="Prepended to every password, usually special chars + uppercase" +MIDFIX="A not-necessarily-secret string to prevent pre-baked rainbow tables" + +echo -n "Master password: " # Supress echo, and trap exit for correct restoration stty -echo @@ -16,10 +20,7 @@ read -r MASTER # Restore state stty echo trap - EXIT - -USEECHO () { - echo $1 $2 -} +echo USEKEYCHAIN () { expect - <<EOF @@ -30,13 +31,13 @@ expect { EOF } -CALL=USEECHO +CALL=echo if [ "$1" = "-k" ]; then CALL=USEKEYCHAIN shift fi; for NAME in "$@"; do - PREPASS=$(echo $NAME$PHRASE$MASTER | sha256sum | cut -b -24) + PREPASS=$(echo $NAME$MIDFIX$MASTER | sha256sum | cut -b -24) $CALL $NAME $PREFIX$PREPASS done |
