1.PGP加密
1.1 简介
PGP:Pretty Good Policy,良好隐私密码法,是一套用于消息加密、验证的应用程序。
加密发送一个文件:
获取pgp公钥进行加密文件内容,发送给指定用户。
用户获取文件之后,用对应密钥对文件内容进行解密,获取数据。
1.2 生成pgp公钥密钥
下载软件的地址:https://files.gpg4win.org/gpg4win-3.1.11.exe
软件名:kleopatra
新建密钥对
输入自定义的名称和邮件地址:
点击下一步:
箭头处输入用于保护密钥的密码,用于在使用密钥进行解密文件时的验证处理。
输入密码,点击ok。密码如果不合乎规定,可能会需要再次确定输入密码,如果符合要求,则不会弹出下面的弹框。
创建成功如下图:
生成密钥对副本:会导出对应的密钥文件:
-----BEGIN PGP PRIVATE KEY BLOCK-----
lQPGBF8IMjIBCACxeUkY+E//VuP+U9EdnT4Wh3IMAlo6XxNEOWs5/dCz6ogjLctu
qLCtVV6ibBXBJebSFpRd+TgF3RS+kTsUm+BnVdA/UG+54WJuokwHVxL958MSKFeo
jJDKfsm2wutL02C3bYn6aRqIzJ7kNrFVB+n0eORNx863jJUVTfUx8FUP6xpoq8jD
yuMg0u3OQmasRtz1T8R9C67miCORWv4wLVzQW4QgyBkYP/ndbVxcGTxslxNL7BvR
M0GpJd23SMd1KEBAgN9W5fwKrrKT5kx6qxcxSdQ3qs13/RpgZA3ylhvm/OKS3ntJ
3v2EYSKXv/OevivIFQURS96CHA8ABpxCUXe7ABEBAAH+BwMCl8An2GjNL93HxjOl
w77f97RXTQYXtiZXNGP5CXDZUAXjMTVpNQ0Cjogk1ArzhLWboFBA0c2g1OE+s8ds
XN3La8WA5yuffRkjoVQvkq31A/bbNsbYK71relLiB/taGNvRO3nlFV2+G5hLzW6P
wc/i/kMv9xSLsURnUhc10XkkDCQmyl5Pe3qQLzsiH1j+ro3qRSsAzAofCZaQoKtu
6Z3BKQTPREwSZSew4X+pEUq91jq4Anl0cMSb3QiGPNbuZD8hzfnXhTK++XLhE3Nn
FZuj0c5pnH+UnR5f1/PfJPsw6YEZrkJN8U44bdSIbk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