如何解密对称编码的gpg2文件?

如何解密对称编码的gpg2文件?

我用命令加密了

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

知道密码后如何解密?

答案1

我刚刚测试过并且有效。

在第一个虚拟机上:

[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

在第二个虚拟机上:

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.

相关内容