Retrieve passphrase from stdin with echo, instead of as a command line arg.

This commit is contained in:
drduh 2015-07-03 14:08:15 -04:00
parent 4ddbc34b96
commit ec371cbeb7
1 changed files with 4 additions and 4 deletions

8
pwd.sh
View File

@ -48,18 +48,18 @@ get_pass () {
decrypt () { decrypt () {
# Decrypt with a password. # Decrypt with a password.
${gpg} \ echo "${1}" | ${gpg} \
--decrypt --armor --batch \ --decrypt --armor --batch \
--command-fd 0 --passphrase "${1}" "${2}" 2>/dev/null --passphrase-fd 0 "${2}" 2>/dev/null
} }
encrypt () { encrypt () {
# Encrypt with a password. # Encrypt with a password.
${gpg} \ echo "${1}" | ${gpg} \
--symmetric --armor --batch --yes \ --symmetric --armor --batch --yes \
--command-fd 0 --passphrase "${1}" \ --passphrase-fd 0 \
--output "${2}" "${3}" 2>/dev/null --output "${2}" "${3}" 2>/dev/null
} }