Gpg
如何解密對稱編碼的 gpg2 文件?
我用命令加密它
gpg2 -c --passphrase thePassword --batch --no-tty <file >file.gpg2
知道密碼的情況下如何解密?
我剛剛測試過,它可以工作。
在第一個虛擬機上:
[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 yurij@192.168.56.4'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.