1
0
mirror of https://github.com/octoleo/Purse.git synced 2024-12-29 12:32:39 +00:00

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

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
} }