#!/bin/sh LOG="$HOME/.my_password_generator.log" echo -n "Enter [Key]: " stty -echo read key stty echo # echo "[$key]" # -- for debug only -- # echo "*******************" echo -n "Enter [Start Len]: " read start len [ -z "$start" ] && echo "Pleas enter 'Start'" && exit [ -z "$len" ] && echo "Pleas enter 'Len'" && exit L=$key K="" end=`expr $start + $len - 1` for i in `seq 1 129`; do L=`echo -n $L | sha512sum -b | cut -f1 -d' '` K="$K$L" done B=`echo $K | xz -c -f | base64 -w0` echo -n $B | cut -c${start}-${end} FP=`echo -n $B | sha512sum | cut -c1-4,125-128 | tr 'a-f' 'A-F'` echo "fingerprint: $FP" [ -e "$LOG" ] && echo "`date` | $FP $start" >> $LOG