Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cipher: proper cipher/decipher tool #35

Open
katcipis opened this issue Mar 8, 2017 · 3 comments
Open

cipher: proper cipher/decipher tool #35

katcipis opened this issue Mar 8, 2017 · 3 comments

Comments

@katcipis
Copy link
Collaborator

katcipis commented Mar 8, 2017

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 :-)

@lborguetti
Copy link
Collaborator

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

@katcipis
Copy link
Collaborator Author

katcipis commented Mar 8, 2017

@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.

@i4ki
Copy link
Collaborator

i4ki commented Mar 30, 2017

another problem with the solution is that your password is visible for every other program running on the machine by listing processes (ps aux)....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants