Skip to content

Instantly share code, notes, and snippets.

@leifwalsh
Created June 7, 2011 23:41
Show Gist options
  • Save leifwalsh/1013465 to your computer and use it in GitHub Desktop.
Save leifwalsh/1013465 to your computer and use it in GitHub Desktop.
dirty rotten password manager
$ cat >~/bin/mypass
#!/bin/bash
if [[ $# -ne 1 ]]; then echo "Usage: $(basename $0) <site>" && exit 2; fi
(gpg -q -d ~/.passwd.gpg; echo "$1") | sha256sum | cut -c-16
^D
$ gpg --default-recipient-self -e >~/.passwd.gpg
<your password here>^D^D
$ chmod +x ~/bin/mypass
$ mypass google.com
...
$ mypass facebook.com
...
$ mypass americanexpress.com
...
$ cat >/dev/null
now change all your passwords and stop worrying about it.
note that I don't have a good solution for your phone, but
http://www.xorbin.com/tools/sha256-hash-calculator is a
decent online sha256 calculator you can use in a pinch.
replace `sha256sum' with `shasum -a 256' on osx.
combine with pbcopy or xclip for extra delicious!^D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment