带 gpg 加密的机器人
我正在 python 上创建一些机器人,我想从不同的即时消息客户端(例如 Miranda IM、QIP 等)向他发送加密消息。对于这个问题,我使用 python-gnupg 用于生成公钥和私钥的库。据我了解,有必要将公钥发送给远程用户。我不能简单地将这个密钥发送给用户,因为我不知道哪个用户连接到机器人。因此,我认为,最好将公钥发送到机器人连接的服务器,例如 jabber.org、icq.com 等。 我该怎么做呢?或者说,还有其他方法吗?
I am creating some bot on python and I want to send encrypted message him from different instant messaging clients, e.g Miranda IM, QIP etc. For this issue I use python-gnupg library for generating public and private keys. As I understand it is necessary to send public key to remote users. I can't simply send this key to an user, because i don't know which user connect to the bot. So, I think, it would be good to send the public key to servers where the bot is connected to, for example, jabber.org, icq.com etc.
How can I do it? Or, are there any other ways?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将您的公钥上传到 MIT 公钥服务器 (http://pgp.mit.edu/)。它们不提供 API,但可以使用 urllib 和一些简单的正则表达式搜索从 Python 轻松驱动 HTML 界面。
You could upload your public key to the MIT public key server (http://pgp.mit.edu/). They do not provide an API, but the HTML interface would be quite easy to drive from Python using
urllib
and some simple regexp searching.您可以使用 Jabber 的 vCard 系统在其自己的 vCard 中发布其身份,该 vCard 可从所有 XMPP 客户端的 XMPP 服务器目录获取。
例如,您可以将其放在 vCard 的“关于”字段中,
您可以从中激发自己的灵感
http://yabfog.com/blog/2009/06/03 /xmpp-vcard-python-脚本
You could use the vCard system of Jabber to publish its identity in its own vCard available from the XMPP server directory for all XMPP clients.
You might put it in the 'About' field of the vCard for example
You can inspire yourself from that
http://yabfog.com/blog/2009/06/03/xmpp-vcard-python-script