有没有遇到 python import paramiko 和 Crypto 错误,比如“不使用 mpz_powm_sec。”?

发布于 2025-01-03 17:24:39 字数 1140 浏览 0 评论 0原文

操作系统:redhat 5.2 i386

python:2.7

错误如下:

Python 2.7.2 (default, Feb  7 2012, 11:16:30) 
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import paramiko
/home/master/local/lib/python2.7/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec.  You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
  _warn("Not using mpz_powm_sec.  You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning)

这是我的 libgmp 版本:

 ldconfig -p |grep libgmp
        libgmpxx.so.3 (libc6, hwcap: 0x0000000004000000) => /usr/lib/sse2/libgmpxx.so.3
        libgmpxx.so.3 (libc6) => /usr/lib/libgmpxx.so.3
        libgmpxx.so (libc6) => /usr/lib/libgmpxx.so
        libgmp.so.3 (libc6, hwcap: 0x0000000004000000) => /usr/lib/sse2/libgmp.so.3
        libgmp.so.3 (libc6) => /usr/lib/libgmp.so.3
        libgmp.so (libc6) => /usr/lib/libgmp.so

以上所有内容似乎与 libgmp 有关,这让我很困惑。PLZ 给我一些建议,谢谢!

OS: redhat 5.2 i386

python: 2.7

err like:

Python 2.7.2 (default, Feb  7 2012, 11:16:30) 
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import paramiko
/home/master/local/lib/python2.7/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec.  You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
  _warn("Not using mpz_powm_sec.  You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning)

it's my libgmp version:

 ldconfig -p |grep libgmp
        libgmpxx.so.3 (libc6, hwcap: 0x0000000004000000) => /usr/lib/sse2/libgmpxx.so.3
        libgmpxx.so.3 (libc6) => /usr/lib/libgmpxx.so.3
        libgmpxx.so (libc6) => /usr/lib/libgmpxx.so
        libgmp.so.3 (libc6, hwcap: 0x0000000004000000) => /usr/lib/sse2/libgmp.so.3
        libgmp.so.3 (libc6) => /usr/lib/libgmp.so.3
        libgmp.so (libc6) => /usr/lib/libgmp.so

all above seems like related to libgmp,that confused me.PLZ show me some suggestion,thx!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

仅此而已 2025-01-10 17:24:39

这是正常的 - RHEL 5 似乎有 GMP 版本 4.x,因此 Python 库是针对该版本构建的。

如果您确实想摆脱警告,请从官方来源重建 GMP 库,然后重建您的 Python。

您可以考虑升级到更现代的操作系统 - EL5 将在今年年底 EOP。或者至少将您的操作系统更新到最新版本(5.7)

This is normal - RHEL 5 seems to have GMP version 4.x, and therefore the Python libraries are built against that version.

Rebuild the GMP library from official sources and rebuild your Python after that, if you really want to get rid of the warning.

You could consider upgrading to an more modern OS - EL5 will be EOP by the end of this year. Or at least update your OS to the latest revision (5.7)

叹沉浮 2025-01-10 17:24:39

我也遇到了这个问题,重建 python(在我的例子中是 2.7)是不够的。编译新版本的 gmp 后,我必须用 pip 重新安装 pycrypto,事实上,我不知道是否有必要重建 python,但我仍然按照 Kimvais 的回答做了。

I had this problem too and rebuilding python (in my case 2.7) was not sufficient. I had to reinstall pycrypto with pip after compiling the newer version of gmp, in fact, I don't know if rebuilding python was necessary but I still did it following Kimvais answer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文