Skip to content

Instantly share code, notes, and snippets.

@k14i
Last active December 20, 2015 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k14i/6201516 to your computer and use it in GitHub Desktop.
Save k14i/6201516 to your computer and use it in GitHub Desktop.
You should not save your passwords anywhare and should not forget them! This thesis will be solved only by algorithm.
#!/usr/bin/env bash
DIR=$HOME/etc/get_password
. $DIR/get_password_string.txt
. $DIR/get_password_cycle.txt
ALGORITHM="sha1" # md4, md5, sha, sha1, ripemd160 and so on.
count=1
while [ $count -le ${CYCLE} ];
do
STR=`echo ${STR} | openssl dgst -$ALGORITHM`
count=`expr $count + 1`
done
#if [ `uname` == "Darwin" ]; then
# echo ${STR} | awk '{print $2}'
#else
# echo ${STR}
#fi
echo ${STR}
exit $?
CYCLE=1 # set a numeric (integer)
STR="" # put a seed string here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment