commit ca1add249b0cc9ca59f7a85511cf85a52fe96f25 Author: silvernode Date: Mon Jun 1 00:41:02 2015 -0500 initial commit diff --git a/bashpass.sh b/bashpass.sh new file mode 100755 index 0000000..cac3f95 --- /dev/null +++ b/bashpass.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +source functions.sh + + + case "$1" in + -s | --sha ) usingSHA + ;; + + -o | --openssl ) usingOPENSSL + ;; + + -l | --lefthand ) leftHAND + ;; + + *) echo + echo "BASH PASS HELP" + echo + echo "-s | --sha SHA the date and print 32 character pass" + echo + echo "-o | --openssl 32 character password using openssl" + echo + echo "-l | --lefthand 8 character password for left hand" + ;; + esac diff --git a/functions.sh b/functions.sh new file mode 100644 index 0000000..4a47dcb --- /dev/null +++ b/functions.sh @@ -0,0 +1,28 @@ +#!/bin/bash + + +usingSHA(){ +#hashes date with SHA +echo +echo "32 character password generated using SHA256 with date" +echo "***************************************************" +date +%s | sha256sum | base64 | head -c 32 ; echo +echo "***************************************************" +} + +usingOPENSSL(){ + echo + echo "32 character password generated using openssl" + echo "**************************************************" + openssl rand -base64 32 + echo "**************************************************" +} + +leftHAND(){ + echo + echo "8 character password generated using /dev/urandom" + echo "Meant to type with left hand" + echo "**************************************************" +