Hi all! There's a website that generates a password by joining a master password with the website's name (e.g. master password=abc and site=google) then hashing that with SHA1 and then coding the resulting hash with Base64. I've been trying to implement that in Bash, but I can't. I mean I can but my results are extremely different from the ones in the website. Help?
The website that generates the password using JavaScript is at http://angel.net/~nic/passwd.sha1.html
And here is my bash script:
#!/bin/bash
CUT=8
echo -n "Enter your master password. "
read -s MASTER
echo -en "\nEnter the site's name. "
read SITE
PASS=$(echo -n $MASTER$SITE | sha1sum | sed -e 's/[ -]//g' | base64 | cut -b 1-$CUT)
echo $PASS | sed -e 's/[\/+=]//g'
I'm new to Stack Overflow so tell me if I'm breaking any rule, etc...