Gnus:用 GPG 加密邮件

这周四(2014-10-09)在公司同事 Jack 的帮助下,成功地用 Gnus 发送了加密邮件。

1 流程

Gnus 自带对 GPG 的支持,所以一旦 Gnus 配置成功(见 2.2 ),给邮件加密很容易:

  • C-x m (compose-mail),开一封新邮件
  • C-c C-m C-e (mml-secure-message-sign-encrypt)

    这会在邮件开始处添加一个标签:

    <#secure method=pgpmime mode=signencrypt>
    

    解释一下 mode=signencrypt

    • sign :用发送者(你)的私钥签名,所以接收者知道邮件确实是你发的
    • encrypt :用接受者的公钥加密,所以邮件只有接受者能解密
  • 写完邮件, C-c C-c (message-send-and-exit) 发送

2 配置

2.1 用 GPG 生成公钥私钥,加载其他人的公钥

不赘述了,直接看 manual 就行,或着搜索相关教程。

2.2 配置 Gnus

我没有自己的邮件服务器,用的是谷歌的 Gmail。

Gnus 配置则基本是跟着陈斌兄的 Practical guide to use Gnus with Gmail 来的,简单实用。

3 我的公钥

http://wenshanren.org/wp-content/uploads/2014/05/wpid-PGP-wenshan2.asc

–—BEGIN PGP PUBLIC KEY BLOCK–—
Version: GnuPG v1

mQENBFNlPGEBCADALGQlcpOfWCKvaasalZWH+WZnY7LFBw4qaUbMHZtuh+3uyKm7
VadfPjcbKtko0pa7inY0CYPQ9oHaSZ0trimXdiMgf5693tmb733MZt72fc9sE7Xy
Iyq9v0QCEUwZsUFkac8qcWaZxIvx99/lro4NCStE/DCmM4BjpNanWcZMS2LDGGcT
mV35Qhl/0WT5JVZBM600iqbN8nsFPBdeu1t6F5/tFPf9QQXa9d3NLVc2gtCbYATi
7l4/2+EyTxHFYBxZfjHj5fViKlQyeDQBrg5hFh6jp0Zq+Hk4Kp6J1sRcgYecD8oq
gHI/wKELYs5XCrUdYv9DNxvwvZD3PeW8EjOFABEBAAG0LeS7u+aWh+WxsSAoUmVu
IFdlbnNoYW4pIDxyZW53czE5OTBAZ21haWwuY29tPokBNwQTAQIAIgUCU2U8YQIb
AwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4A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