Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我从公钥服务器检索了 PGP 密钥,现在需要帮助来获取可以接受此 PGP 公钥的 python 加密方法。
据我所知,PGP/Gnupg.py 模块不允许我在不生成密钥的情况下单独使用加密/解密功能。
在我看来,最简单的方法是使用GPGME,它基本上是将 GnuPG 包装在一个方便的库形式中(因此名称,GPGME = GnuPG Made Easy)。有一个用于 GPGME 的 Python 包装器,名为Pyme,它可以让您使用标准 PGP 格式执行诸如导入密钥、使用它们加密消息等操作。在线有一些基本的 Pyme 文档,以及在源代码分发中包含更复杂示例的承诺。