zoukankan      html  css  js  c++  java
  • libnum报错问题解决

    之前在使用python libnum库时报错

    附上报错内容

    Traceback (most recent call last) :
      File" D:/python file/ctf/RSA共模攻击. py",line 37, in <module>
        main()
      File" D: /python file/ctf/RSA共模攻击. py", line 33, in main
        print(n2s(m)) #二进制转string
      File" D: pvthon2. 7libsite-packages libnumstrings. py", line 20, in n2s
        return str (codecs. decode(s,’hex' ),’ utf-8' )
    TypeError: str() takes at most 1 argument (2 given)

    当时在大佬的指导下换python3运行,安装完相关python库后运行,依然报错

    附上报错内容

    Traceback (most recent call last):
      File "D:/python file/ctf/RSA共模攻击.py", line 38, in <module>
        main()
      File "D:/python file/ctf/RSA共模攻击.py", line 33, in main
        print(n2s(m))
      File "D:python3.3libsite-packageslibnumstrings.py", line 20, in n2s
        return str(codecs.decode(s, 'hex'),'utf-8')
    LookupError: unknown encoding: hex

    在之后写题时发现运行别的脚本时也出现了相同的错误

    于是开始思考是不是python库的问题

    根据libnum库官方教程安装完成后成功解决问题

    附上网址

    https://github.com/hellman/libnum

    下载后文件夹内容如下

    使用如下命令安装

    python setup.py install

    安装完成后重新运行脚本,即可解决报错问题

  • 相关阅读:
    Jenkins自动化部署入门详细教程
    单元测试
    弱网测试
    Token、Cookie和Session
    测试开发人员必备Linux命令
    TestNG(一)
    char和varchar
    你平时会看日志吗,一般会出现哪些异常(Exception)
    内存溢出和内存泄漏的区别,产生原因以及解决方案
    测试一个电梯
  • 原文地址:https://www.cnblogs.com/anweilx/p/12394295.html
Copyright © 2011-2022 走看看