Nice👍
Here's the script itself, which in this example I've named 'poohbear':
$ cat poohbear #!/bin/bash # # This script will take any string as input. # If you include spaces in your string, you must quote the entire string. # If no string is specified, the current Epoch time to the millisecond is used. if [ "$1" = "" ]; then STRING=`date +%s%N` else STRING=$1 fi echo "Starting with: $STRING" MYSTRING=`echo $STRING | sha256sum` echo "Now converted to: $MYSTRING" echo "Parsing it out a bit more..." echo "Your password string would be:" echo ${MYSTRING:10:4}-${MYSTRING:14:4}-${MYSTRING:20:4}-${MYSTRING:24:4}-${MYSTRING:30:4}-${MYSTRING:34:4}-${MYSTRING:40:4}-${MYSTRING:44:4}
Here's the script in operation. In this example, I'm feeding it the name of the website as the initial string.
$ ./poohbear www.foobar.com Starting with: www.foobar.com Now converted to: 0114330729fa5ab07ba7ff3dab769a5164468c35c83d27095764572e5b237408 - Parsing it out a bit more... Your password string would be: fa5a-b07b-ff3d-ab76-5164-468c-c83d-2709
Here's the same script with no arguments. The initial string is the unix time to the millisecond.
$ ./poohbear Starting with: 1610478451303734951 Now converted to: fab09df74c1275b4611cadaddb6a4e4fdb0298fe086c308f162b2ad7a1b84fd4 - Parsing it out a bit more... Your password string would be: 1275-b461-adad-db6a-4fdb-0298-086c-308f
One thing that is cool about using a script like this to generate passwords for you, is that once you have the password, if you want you can further obfuscate things by only taking the 2nd, 4th, 6th, and 8th set. You'd still end up with b461db6a0298308f as your password, which is pretty strong, and hard for someone to recreate unless they knew how you produced it.