diff --git a/README.md b/README.md index 73258ed..1dc3700 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,22 @@ # pwd.sh -GnuPG wrapper for password management +GnuPG wrapper for password management. + +This script uses GPG to manage an encrypted text file containing passwords. + +# Requirements +Requires `gpg`. Install with `brew install gpg` or `apt-get install gnupg` or build and install it from [source](https://www.gnupg.org/download/index.html). + +# Installation + + git clone https://github.com/drduh/pwd.sh && cd pwd.sh + +# Use + +Run the script with `./pwd.sh` + +Type `w` to create a password. Will update existing password with same Username/ID. + +Type `r` to print stored passwords. Can be piped to `grep` and `pbcopy` or `xsel`, for example. + +To reset/erase keys and passwords, `rm pwd.sh.*`. diff --git a/pwd.sh b/pwd.sh index a10e8ef..a7ce37a 100755 --- a/pwd.sh +++ b/pwd.sh @@ -68,7 +68,7 @@ read_pass () { echo "Empty safe, no passwords!" exit 3 else - echo "Enter password for ${safe}." + echo "Enter password to unlock ${safe}." get_pass ; echo decrypt ${password} ${safe} fi @@ -88,7 +88,7 @@ write_pass () { user_pass=$(gen_pass) fi - echo "Enter password for ${safe}." + echo "Enter password to unlock ${safe}." get_pass ; echo tmp_secret=$(mktemp -q /tmp/pwd.sh.XXXXXX) @@ -110,9 +110,9 @@ gen_pass () { if [ "$pass_length" == "min" ]; then len=6 elif [ "$pass_length" == "avg" ]; then - len=12 + len=18 else - len=24 + len=36 fi ${gpg} --gen-random -a 0 ${len}