Skip to content

Instantly share code, notes, and snippets.

@ptsneves
Created January 7, 2018 19:03
Show Gist options
  • Save ptsneves/6c938a3422209afc4f365972ee9f6a2f to your computer and use it in GitHub Desktop.
Save ptsneves/6c938a3422209afc4f365972ee9f6a2f to your computer and use it in GitHub Desktop.
Generates passowords with sha1sum with a master password and a salt like in http://www.angel.net/~nic/passwd.current.html
#!/bin/bash
if [ $# != 2 ]; then
echo "Usage: $0 <master password> <salt>"
exit 1
fi
#Puts it in the clipboard, at least in gnome
echo -n "$(echo -n $1:$2| sha1sum | cut -f1 -d\ | xxd -r -p | base64 | cut -c 1-13)@1a" | xclip -selection "clipboard"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment