Open katcipis opened 7 years ago
Ok, but that code bellow help to resolve your question ;)
#!/bin/bash
read -rsp "Enter passphrase: " PASSPHRASE
for FILE in *.*.gpg; do
echo "Extracting $FILE to ${FILE%.gpg}."
echo "$PASSPHRASE" | gpg --passphrase-fd 0 --batch -d --output "${FILE%.gpg}" "$FILE"
done
@lborguetti the code bellow is mentioned on stack overflow, for me it does not solve it, it is still cumbersome. Does not make sense to me to require a agent to work with symmetrical cryptography.
another problem with the solution is that your password is visible for every other program running on the machine by listing processes (ps aux)....
I was already sad with my gpg that for only ciphering with a symmetric key asks for the password on a GUI. Lately I wanted to write some automation and this was getting on my way, trying to get around it I found this:
http://stackoverflow.com/questions/17769831/how-to-make-gpg-prompt-for-passphrase-on-cli
Requiring an agent just to know how you are going to receive a password does not seem to be simple...neither safe. The objective here is just to create a VERY simple tool that ciphers data symmetrically, it will guarantee confidentiality only, no guarantees on identity or integrity of data (would require key pairs). These other two problems could be addressed later if needed, I don't use them right now :-)