[图文教程] 玩转 GPG —— 生成密钥和加密信息 :)

GPG 是一款加密软件。在开源软件的世界里面玩,总会或多或少遇见 GPG 相关的东西,比如说

  • openSUSE 添加新软件源,要你确定接受一串密钥
  • GitHub 上可以用 GPG 来给你的 commit 签名
  • 像一些严格的项目,比如说 Debian,你不能正确地给出你的 GPG key,寸步难行
  • 下载软件源码包,或者安装镜像的时候总会有一个 .asc 文件。比如 openSUSE

  • 你开发了软件,可以给你的软件源码包签名,这样分发的过程中,避免供应链攻击
  • 或者 你不希望你的通讯被给第三方给看到 。

GPG 相关的教程网上已经有很多很多了,不过大部分都扯淡太多,云里雾里,说不出本质的东西,导致看起来很高深的样子。实际使用起来很简单,这里给一个简化版本

每个人都有一对 公钥 和 私钥(public key & secret key)。

私钥是绝对不能暴露给任何人极其私密的。
公钥是可以上传到公共服务器,每个人都可以看到的。

使用起来是这个样子的:

  1. 我拿到你的公钥,我就可以用 我的私钥 和 你的公钥 加密出一封只有 你,也就是对应私钥持有者才能解密的密文。
  2. 我可以用我的私钥来给 文件或者数据 签名。然后别人通过公共服务器拿到我的公钥,就可以用公钥验证一下这些 文件和数据 是不是完整且没有被更改过的。

大部分教程都上来一堆命令行,云里雾里,这里只用图形界面 Kleopatra,在同类中最好的 :)。其它的替代品 GNOME Seahorse, GNU Privacy Assistant 都大同小异。

sudo zypper in kleopatra gpg2

启动 Kleopatra,新建你的公钥和私钥,点完下一步就可以看到你新建的钥匙:

注:在输入名字和邮箱以后,下面有高级设置,把 rsa 1024 bits 改成 4096 bits。作为练习用有效期也可以改短一点。

然后你可以导入我的公钥,只要点击上方的搜索,输入 slbtty 就可以看到我的公钥,

不过默认的钥匙服务器可能国内访问有问题,可以改成

hkp://keyserver.ubuntu.com/

或者先下载再导入 slbtty.asc


然后你就可以给我发加密过的信息了,在 notepad 里面,添加收件人(比如我 :)

输入文字,点击加密就可以得到加密过的消息了

如果你作为接收人,拥有私钥,把加密的消息复制到这里,就可以解密了。


如果你想让别人给你发加密信件,你需要先公开你的公钥。直接点击上方 导出 export,然后你会得到一个 .asc 文件。你可以直接 1.共享这个文件 2. 复制粘贴里面的内容 3. 上传到公共的服务器中,比如https://keyserver.Ubuntu.com/。点击 submit key,复制粘贴你的公钥进去就可以了。

上传以后的搜索结果:

注:Ubuntu 的钥匙服务器是服务 Ubuntu 的,可能不会和其他的服务器同步。你可以把公钥多上传一些地方。https://pgp.mit.edu/ https://keys.openpgp.org/ https://zimmermann.mayfirst.org/


如果你想用命令行,可以参考如下
阮一峰 的 GPG 入门教程 https://www.ruanyifeng.com/blog/2013/07/gpg.html
月光博客的教程 https://www.williamlong.info/archives/3439.html
命令行速查手册 https://www.gnupg.org/howtos/zh/index.html
用 GPG 签名文件https://access.redhat.com/solutions/1541303
GPG 新闻 https://www.gnupg.org/index.html

5赞

So,有没有人想互相发加密消息玩一玩?

你可以: 分享你的公钥,然后我给你发消息

或者

我的公钥 给我发加密消息,并分享你的公钥

直接在回复区里进行就可以。

-----BEGIN PGP MESSAGE-----

hQIMA5K+ZGJglsXdARAAxGUSPYF5JierRm5RYvEkrG8ld8/h2uwQp0ONoMqq1vPa
8LVsKtxkNjcdGC1AMZcxmm3NE0E9i49FfzYH+lt3xdJJbkHUgU13O6GKacDXSv9q
EsxBA3g1b9hHHCQoNavCedCEx27aCS2aiBoJ+OpUxE+bqvIoygcrSk/PSwh9Ln+P
Y6nqOXRO7vs8o2tyzJnOD8dwCX8E/1KlqcUkQXwKcMyBKja6v82pUvrzJELCHUA2
nu/Uul4lE24ZgWsNG+BvQ4v0CAOyvdQYSdS+wwgs4z/tv0gtMJIqI9ZQiaIm/tOc
EppfVzzrKrFYwwhOpan1+z/CfhRXeWjog89fwcrc1T86P46mhZ1NtcBRCQqTu+mV
GQ17o1L3z41kCpSRwoFLly6wtMONtW7jX2yePdOE9reB791fhSITaX3+zZg5WCbA
2lc00ZSKz9k2d5J6USlOziW4o7/v1sHKHRMgr3cVZQus961ZTYZqN1u6/AW0JaTZ
44/zYB9Tj9E4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u9A8vP135Y3VnjufyBNGjOFhqe1i5Nfmq3O

e0/LpRacsHDR0OJhtnJoetY513zLQvoQ6gsElNZyG82HPqWxzyXgR22PoH0hGjOd

35sjByidzXqUEdvg0jVbe2bT5Evmw2U4JXqUH+cvLT3ujrMU8u8ZTPsx92A3j2X5

CToo6YnVVzbU7GzXko8ZEucya79rtpZyPUMljkRp9n6nPIUv5H/X6PYS5zlD6kp5

H2R9ytfnlgzq2kqmxtgDIAhBWA==

=eAAp

-----END PGP MESSAGE-----

@lostFox

 -----BEGIN PGP SIGNED MESSAGE-----

Hash: SHA256

I am fine :)

I don't have your public key, so I cannot reply an encrypted message.

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEElpwxMjG7x/YT1IPfbfdys8Die6oFAmAVRroACgkQbfdys8Di

e6r/iQ/+NDCZFHUkIg3U0vvlA4WAS5c/ruuBDTF9ae6cnO9Uj0II0zsNdTcFpDC6

gHi4zhJ2/Wth5bgh82KOfQLVSsdqVF8XgiMbFH4/61tw3sZgSSLNikdS1HspBn9/

YwIkZlhCBdZBMzjpJ4pxMldK0j9OjRg79XvafcOkrsVnIFjqyoT0kDigbV9I1Z1v

lABv26z6r6nWFd7kiCuJllFwLNSzX/SEqGgQM4PrkbpVLn+gVZ6wNHXdK7dl9+Pk

l/6HQ0/U55CN0AlL3yE500WD2rmVjZChc34u39Efwp6fMaKWbaLegqJhSw+zFeCq

WocmFxiYQYnz320KaPu61MSsUCmoBt+NP/Wg9gUJjzbsYY60SD5Yb9y/2++iGtAL

ck2BzfCqKjszC1DZ8i0lS/XrKhpFkpc79mLFAehzmYa1N9BWLhu6JFG+DnXWWXkL

VUAnF2Dk/0FZg/HcoTazL6Ra29KF+UitbYhrOC+Dd4J9P/qUe2qZ0U2h5Eoh79pN

rJk4ycocazFydoVe3QVX0N89KmjYOsttQJMv3c6kCnpq0JmJlUQ1M63/JOhsJhL0

oS5jpq4Tt2/mAp7URKrVuESTHUns+SKyhXaiWnGV9VJLCxMYT/Jq9e190NHRzVr6

2jDVn20fttKasjmH7TTSkL/FxwkeKYp5Bzc0rwC6EemABwu9qaM=

=TNDZ

-----END PGP SIGNATURE-----

-----BEGIN PGP MESSAGE-----

hQIMA5K+ZGJglsXdARAAnXR+uQbRvztaup62AdA6K49j1TdNRvzmhEnnlp7Y+8tB
jcQlXmNUsDPQomfxXiJDVlUR05/7yejz148A3YhMlvI4RTBs5wkELhq3vfLcMefi
B+VRdpTNS+OR/1YBNPWpz3DmIrHOJS5+TJBfYIQqE1U98zYzADMwtHZvUWM29RTI
niYETj4QNdTfIcsZt1EQyYwvyaoUJ+vhu8ov5jbwFwQSZpgpRv3o1MG793Gbz2gK
rDKlPq8O61eU6SLGOqWDObueJsvWXv9FcxeldSuVse7RcbScGI7P/R63BRbqJ86Z
wzLU/VNH6LGncJXAI1xqwZ0fvSdAt0jNh5j9zMB8i0O6rZCDYPfMR0dL7T02QeW/
HsdyYFYXLD1Ks/34cXIO9E+MzT1TvezctkOJjHf+pJesos/Nbsa8N0BcA0wnbLTw
0jADiCPkKIQutzub/4w/v3MQ9yu9vbzXQTwwCvZuGsjGghO57ibFaU86ESUbJ3Yi
NuTc4NBBvjHGmSJAIXw/34cppeVCQTCURm5JTzTVwnxaZqYhvcrYeC8nhzPuaYSa
qF/yRQsVfJR0XoDaFjFr5pphho8scFM4eOTT2UQ2p3SyA0/xCJHWwM8/+3+y4F6R
BN4GdF969MUF97kG9BgiabAIG2SwqlRiZE2EYFO3MGzAcaqTkU/s/mnkWOMPU9bS
XwGatDX+McjcF2/ac/XAo3I16jWMhmejwHsn+k/otYOQrDW7i6os+OsvKDySBPCF
UQ+DyzCDXXgs6rshLY75mt2J8FSYeNm1pr2IK2BeXy8N9/IthWLRcRdaxlguaAui
=hTWX
-----END PGP MESSAGE-----

@LiuSen

-----BEGIN PGP MESSAGE-----

hQIMAxhQGdrR+QjVAQ/+MqsiZV3j+ToA8F0wAu9mWimxv3uNkAN5uvBgzwuvHN05
vW5zG8jfQh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3HHDA6pXhHzprYy8C3zR4elc7dYKNGsqt
dEaSUgoFxeTmJwg9upMXwdFJIpGmO9/zCJ09tLLdBJloSE5jMeUpgiAzJcc8mk52
KslOPTyGjqrRu6lLLc8+eT8FexSbjsa3VjowDgMaQdJufEqXxp30SJQxZ6opXQf7
eKZt+h2gZqmwh42i6YhZGh6SzAmBGpGR1KH/LatR1fim74c6WzKGXdal/WccfxZ1
l4FvUxJME4Yd0jrXwH6pxI08L2Cmgg4EPpivtqAU63Vma7B2Lk2uQAhfwfdj/97S
wBgBjmIXwuCt0GJm12cv+Un7a4ZmVwH/S+FCbdgY74qeVkR6da/wpklk4nBV9MIF
1Kx9kB0Vi0w9ASHr0vvJCJb+9GUKDvDzuT1w8mKDRJWzVAdGCcspUtSjxrLCzhK4
w4AHa7URd8YH+r/rUEPXIdmsq7wml8jqCWHjt0DvkcXwOpBcDDGn7BsMNlczW1j0
SM62P98ddoGpwobulXGwgeTsirQPHNmNfscrdMAB+OLTwFZ4Vo01sr35KtED4FIi
EdNVIbv1Za1KCRnXexsG8/RR2srpJvDxHKc=
=hF8p
-----END PGP MESSAGE-----

1赞

1202 年了, ECC 支持已经比较普及了,生成私钥的时候可以考虑直接生成 ECC key 用用看

ECC 的优点(密钥短、运算快(?))带来的收益是很少的。用户不需要背密钥,长度影响不大;速度更是无感。

相反,如果遇到兼容性问题,任何一个都不是用户本身能够解决的。比如智能卡的算法支持、软件版本等。

ECC 最主要的优势在于理论安全性更高,当然现在 RSA 4096 安全性也是足够的,但 RSA 2048 已经开始被认为安全性不足, RSA 1024 在很多地方已经被认为是不安全的了,所以实际上会用 ECC 生成 GPG 密钥的人多数是想要更强的安全性

另外考虑到一个 GPG key 可能会用很多年(我自己的一个 key 是从 2013 年用到现在),选一个更新一些的算法和更强的加密强度还是多少有一些必要的

libgcrypt 从 1.7 开始支持了 ECC key, 这已经是快 5 年前的事情了,智能卡的话没什么好办法,确实只能按硬件支持来,不过对于新一些的设备比如 yubikey 之类,最好的姿势应该是直接用硬件生成私钥并且私钥永远不离开设备

1赞

另外楼主,强烈建议加上 revoke key 的步骤,并且生成私钥之后做的第一件事情应该就是生成吊销证书并且妥善备份,之后才是上传公钥到 key server…
血泪教训…

然后你们几个人加密聊天,论坛其他观众全员蒙蔽(

2赞

如无必要,最好不要把公钥上传到 key server,原因:

  1. 泄露个人信息,而且一旦上传,全球同步,再无删除可能
  2. 泄露社交关系(Web Of Trust)
  3. 制造垃圾数据(如果公钥很快被废弃,尤其是对于新手)

本来就是要公开的邮箱,也不算 “泄漏” 把,

@AstroProfundis 因为 Kleopatra 那软件到处都有提示,包括上传服务器的时候弄一个吊销的东西,所以就没写 :)

原来如此,我没正经用过 Kleopatra 不知道原来会提示(