GnuPG加密解密

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/stSahana/article/details/79261117

GnuPG加密解密

本文使用Gnupg CommandLine,GnuPG在windows平台上有图形化界面程序Gpg4win可用。

需要查看文件的一方

gpg --gen-key
#输入用户名(可选)、邮箱(可选)、密码
gpg -a --output public.asc --export [用户ID,即上一步骤中的RealName]
#将导出的公钥public.asc发送给加密的一方
#收到加密文件encrypt.en后
gpg -o output.txt -d encrypt.en

加密文件的一方

#导入公钥
gpg --import [公钥文件]
#谁要查看文件就用谁的公钥加密
gpg -r [用户ID] -o output.en -e [需要加密的文件]
#生成的output.en就是加密后的文件

猜你喜欢

转载自blog.csdn.net/stSahana/article/details/79261117