pycrypto错误….ImportTerror:无法导入名称conn

2024-04-24 09:51:19 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用pycrypto++在python中设计AES-CTR加密/解密程序。但每次我运行以下代码时:

decryptor = AES.new(key, AES.MODE_CTR, counter=Counter.new(64, prefix=nonce))

我发现以下错误:

Traceback (most recent call last):
  File "aes-ctr.py", line 3, in <module>
  from collections import Counter
ImportError: cannot import name Counter

现在是我给的,请帮帮我。我的python版本是2.7.3


Tags: key代码import程序newprefixmode错误