再也不用担心你的文件会被莫名其妙给抄水表了   (「・ω・)「

准备

pkg install gnupg

所有命令

gpg --help

会显示出全部命令:

Commands:
 -s, --sign                  make a signature
     --clear-sign            make a clear text signature
 -b, --detach-sign           make a detached signature
 -e, --encrypt               encrypt data
 -c, --symmetric             encryption only with symmetric cipher
 -d, --decrypt               decrypt data (default)
     --verify                verify a signature
 -k, --list-keys             list keys
     --list-signatures       list keys and signatures
     --check-signatures      list and check key signatures
     --fingerprint           list keys and fingerprints
 -K, --list-secret-keys      list secret keys
     --generate-key          generate a new key pair
     --quick-generate-key    quickly generate a new key pair
     --quick-add-uid         quickly add a new user-id
     --quick-revoke-uid      quickly revoke a user-id
     --quick-set-expire      quickly set a new expiration date
     --full-generate-key     full featured key pair generation
     --generate-revocation   generate a revocation certificate
     --delete-keys           remove keys from the public keyring
     --delete-secret-keys    remove keys from the secret keyring
     --quick-sign-key        quickly sign a key
     --quick-lsign-key       quickly sign a key locally
     --sign-key              sign a key
     --lsign-key             sign a key locally
     --edit-key              sign or edit a key
     --change-passphrase     change a passphrase
     --export                export keys
     --send-keys             export keys to a keyserver
     --receive-keys          import keys from a keyserver
     --search-keys           search for keys on a keyserver
     --refresh-keys          update all keys from a keyserver
     --import                import/merge keys
     --update-trustdb        update the trust database
     --print-md              print message digests
     --server                run in server mode
     --tofu-policy VALUE     set the TOFU policy for a key

相信大家应该用不到那么多

常用命令

生成密钥

gpg --gen-key
gpg --full-gen-key (个人喜欢)

列出密钥

gpg --list-keys

可供参考的资料

http://www.linuxidc.com/Linux/2015-02/113014.htm (推荐) https://blog.csdn.net/xingzouagain/article/details/52511129

总结

GnuPG原本是有一个安卓版本的(保护者计划,具体可以去GnuPG官网看一下),但已经3到4年没有更新过。希望这篇blog对需要的人有帮助 GnuPG在Windows上有GUI版本(gpg4win),如果你只想做一个懒惰的小白的话,可以用那个