1

I encrypted it with the command

gpg2 -c --passphrase thePassword --batch --no-tty <file >file.gpg2

How can I decrypt it, knowing the password?

1 Answer 1

4

I've just tested and it works.

On first virtual machine:

[yurij@centos7 gpg]$ cat test2.c
Another test.
Really?
OK.
[yurij@centos7 gpg]$ gpg2 -c --passphrase password --batch --no-tty < test2.c >test2.c.gpg2
[yurij@centos7 gpg]$ cat test2.c.gpg2
�c�a����0Li�p��t���JL��(
                        �ޢ� Xt��Z�f��(s�XU�K(ؖ��n�O[yurij@centos7 gpg]$
[yurij@centos7 gpg]$ scp test2.c.gpg2 192.168.56.4:trash/gpg
[email protected]'s password:
test2.c.gpg2                                                                                         100%   65    57.6KB/s   00:00

On the second virtual machine:

yurij@debian9:~/trash/gpg$ cat test2.c.gpg2
�c�a����0Li�p��t���JL��(
                        �ޢ� Xt��Z�f��(s�XU�K(ؖ��n�Oyurij@debian9:~/trash/gpg$
yurij@debian9:~/trash/gpg$ gpg -d --passphrase password --batch --no-tty < test2.c.gpg2 >test2.c.decrypted
gpg: CAST5 encrypted data
gpg: encrypted with 1 passphrase
gpg: WARNING: message was not integrity protected
yurij@debian9:~/trash/gpg$ cat test2.c.decrypted
Another test.
Really?
OK.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .