Symmetric & Encrypt in One

MFPA 2014-667rhzu3dc-lists-groups at riseup.net
Sat Sep 27 18:51:37 CEST 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hi


On Saturday 27 September 2014 at 5:00:29 PM, in
<mid:4089312.dH2CvKo2sl at inno>, Hauke Laging wrote:


> Am Sa 27.09.2014, 16:11:09 schrieb MFPA:

>> If I just try:-

>> echo "$PW" | gpg --passphrase-fd 0 --symmetric
>> --output file.gpg file

>> it symmetrically encrypts but I cannot find a
>> passphrase that works for decryption.

> I quote the man page for "--passphrase-fd n":

> "[...] Note that this passphrase is only used if the
> option --batch has also been given. This is different
> from gpg."

Good spot, although it didn't work for me with or withour --batch.

A spot of web searching [0] lead me to try "printf pass\npass" instead
of "echo pass" because the passphrase needs to be entered twice.


The following works for me:-

printf pass\npass | gpg --batch --passphrase-fd 0 -a --symmetric
- --output file.gpg file

And, Hauke, it worked without the "--batch" as well when I tried.
Maybe I just got lucky.


[0] search term: echo to stdin.
    The fourth result was
    <https://stackoverflow.com/questions/3323966/echo-smbpasswd-by-stdin-doesnt-work>



- --
Best regards

MFPA                    mailto:2014-667rhzu3dc-lists-groups at riseup.net

We're all shipwrecked on this idea that everything has to be explained.
-----BEGIN PGP SIGNATURE-----

iPQEAQEKAF4FAlQm6yZXFIAAAAAALgAgaXNzdWVyLWZwckBub3RhdGlvbnMub3Bl
bnBncC5maWZ0aGhvcnNlbWFuLm5ldEJBMjM5QjQ2ODFGMUVGOTUxOEU2QkQ0NjQ0
N0VDQTAzAAoJEKipC46tDG5pJ0EEAKJJ3IUQQiZocxj8fEkiWZ5WQwcrGoueyBXV
B67zhAbBkAk/nsoV9z/LIupdaRdiGylOp55Rc0cbMQ4f0SlZkLGPvXEs99BasETh
f3ze/rdk8PXetU5oANXD1p1ny+V0pONoTkXY7YbTTSZ0GOmhP42fbyZeWMgFH926
q5+ufzBP
=avtf
-----END PGP SIGNATURE-----




More information about the Gnupg-users mailing list