#!/bin/sh # A bad password derivation scheme, hopefully portable. # Requires `expect' to enable `keychain' key unlocking. # Read source for detail. 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 trap 'stty echo' EXIT # Read without processing at all IFS="" read -r MASTER # Restore state stty echo trap - EXIT echo USEKEYCHAIN () { expect - <