mirror of
https://github.com/octoleo/Purse.git
synced 2024-12-28 20:12:38 +00:00
Retrieve passphrase from stdin with echo, instead of as a command line arg.
This commit is contained in:
parent
4ddbc34b96
commit
ec371cbeb7
8
pwd.sh
8
pwd.sh
@ -48,18 +48,18 @@ get_pass () {
|
||||
decrypt () {
|
||||
# Decrypt with a password.
|
||||
|
||||
${gpg} \
|
||||
echo "${1}" | ${gpg} \
|
||||
--decrypt --armor --batch \
|
||||
--command-fd 0 --passphrase "${1}" "${2}" 2>/dev/null
|
||||
--passphrase-fd 0 "${2}" 2>/dev/null
|
||||
}
|
||||
|
||||
|
||||
encrypt () {
|
||||
# Encrypt with a password.
|
||||
|
||||
${gpg} \
|
||||
echo "${1}" | ${gpg} \
|
||||
--symmetric --armor --batch --yes \
|
||||
--command-fd 0 --passphrase "${1}" \
|
||||
--passphrase-fd 0 \
|
||||
--output "${2}" "${3}" 2>/dev/null
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user